From b1a020ef13a3020512033c31ece3b9773aa623d7 Mon Sep 17 00:00:00 2001 From: Ivan Lysov Date: Mon, 27 Oct 2025 21:14:39 +0500 Subject: [PATCH 1/2] 2 sec timeout --- PlaygamaBridge.js | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/PlaygamaBridge.js b/PlaygamaBridge.js index c7edc9c..7ef8589 100644 --- a/PlaygamaBridge.js +++ b/PlaygamaBridge.js @@ -509,8 +509,13 @@ return Promise.resolve() } + let bridgeScript = null + let bridgeTimeout = null + let bridgeLoaded = false + const self = this function initializeBridge() { + clearTimeout(bridgeTimeout) return new Promise(resolve => { window.bridge.engine = 'scratch' window.bridge.initialize({ disableLoadingLogo: true }) @@ -603,16 +608,35 @@ } return new Promise(resolve => { - const script = document.createElement('script') - script.src = SDK_URL - document.head.appendChild(script) + function addLocalBridge() { + if (bridgeLoaded) return + bridgeLoaded = true + clearTimeout(bridgeTimeout) + + if (bridgeScript && bridgeScript.parentNode) { + bridgeScript.onload = null + bridgeScript.onerror = null + bridgeScript.src = '' + bridgeScript.parentNode.removeChild(bridgeScript) + } - script.onload = () => { - initializeBridge().then(() => resolve()) + evalLocalScript() } - script.onerror = function() { - (()=>{var e={258:e=>{!function(t){e.exports=t;var r="listeners",n={on:function(e,t){return a(this,e).push(t),this},once:function(e,t){var r=this;return n.originalListener=t,a(r,e).push(n),r;function n(){i.call(r,e,n),t.apply(this,arguments)}},off:i,emit:function(e,t){var r=this,n=a(r,e,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(e){e.call(r)}));else if(2===o)n.forEach((function(e){e.call(r,t)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(e){e.apply(r,i)}))}return!!n.length}};function o(e){for(var t in n)e[t]=n[t];return e}function i(e,t){var n,o=this;if(arguments.length){if(t){if(n=a(o,e,!0)){if(!(n=n.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return i.call(o,e);o[r][e]=n}}else if((n=o[r])&&(delete n[e],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(e,t,n){if(!n||e[r]){var o=e[r]||(e[r]={});return o[t]||(o[t]=[])}}o(t.prototype),t.mixin=o}((function e(){if(!(this instanceof e))return new e}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={VK:"vk",OK:"ok",YANDEX:"yandex",CRAZY_GAMES:"crazy_games",ABSOLUTE_GAMES:"absolute_games",GAME_DISTRIBUTION:"game_distribution",PLAYGAMA:"playgama",PLAYDECK:"playdeck",TELEGRAM:"telegram",Y8:"y8",LAGGED:"lagged",FACEBOOK:"facebook",POKI:"poki",MOCK:"mock",QA_TOOL:"qa_tool",MSN:"msn",HUAWEI:"huawei",BITQUEST:"bitquest",GAMEPUSH:"gamepush",DISCORD:"discord",JIO_GAMES:"jio_games",YOUTUBE:"youtube",PORTAL:"portal",REDDIT:"reddit"},t={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"},n={INTERSTITIAL_STATE_CHANGED:"interstitial_state_changed",REWARDED_STATE_CHANGED:"rewarded_state_changed",BANNER_STATE_CHANGED:"banner_state_changed",VISIBILITY_STATE_CHANGED:"visibility_state_changed",AUDIO_STATE_CHANGED:"audio_state_changed",PAUSE_STATE_CHANGED:"pause_state_changed"},o={VISIBLE:"visible",HIDDEN:"hidden"},i={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed"},a={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed",REWARDED:"rewarded"},s={LOADING:"loading",SHOWN:"shown",HIDDEN:"hidden",FAILED:"failed"},c="banner-container",u={LOCAL_STORAGE:"local_storage",PLATFORM_INTERNAL:"platform_internal"},l={DESKTOP:"desktop",MOBILE:"mobile",TABLET:"tablet",TV:"tv"},f={GAME_READY:"game_ready",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",GAME_OVER:"game_over"},p="not_available",d="in_game",h="native",y={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"},m={message:"Before using the SDK you must initialize it"},v={message:"Storage not supported"},_={message:"Storage not available"},g={message:"GameDistribution Game ID is undefined"},S={message:"Y8 Game params are not found"},b={message:"OK Game params are not found"},E={message:"Lagged Game params are not found"},P={message:"Huawei Game params are not found"},w={message:"GamePush Game params are not found"},A={message:"Message is too long"},O={message:"Discord Game params are not found"};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function T(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=e;for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?e.reduce((function(e,n,o){if(e[o]=we(t,n),r)try{e[o]=JSON.parse(e[o])}catch(e){}return e}),new Array(e.length)):we(t,e)}function Oe(e,t){for(var r=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||t&&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=e;var a=Math.max(0,Math.min(100,e)),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")}}}}],r&&Te(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(W);H().mixin(Ce.prototype);const Ne=Ce;function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function Be(e,t){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(t){var n=t[this._platformBridge.platformId];if(n)return this.get(e,n,r)}var o=t;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.getDataFromStorage(e,o,r):Promise.reject()}},{key:"set",value:function(e,t,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(e,t,n)}var o=r;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.setDataToStorage(e,t,o):Promise.reject()}},{key:"delete",value:function(e,t){if(t){var r=t[this._platformBridge.platformId];if(r)return this.delete(e,r)}var n=t;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?this._platformBridge.deleteDataFromStorage(e,n):Promise.reject()}}],r&&Be(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(W);function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ve(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"bottom",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN)if(gt(this,Ct,zt).call(this,s.LOADING),this.isBannerSupported){var n,o=r;o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback);var i=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,a=gt(this,Bt,Jt).call(this,o,i);this._platformBridge.showBanner(t,a)}else gt(this,Ct,zt).call(this,s.FAILED)}},{key:"hideBanner",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:"preloadInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this))if(gt(this,Nt,Zt).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&St(this,wt)&&St(this,wt).state===Qe)gt(this,Nt,Zt).call(this,i.FAILED);else{var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.showInterstitial(a)}else gt(this,Nt,Zt).call(this,i.FAILED)}},{key:"preloadRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=t;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===(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=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this)){var r;_t(this,kt,t),St(this,kt)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&_t(this,kt,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=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,o=gt(this,Bt,Jt).call(this,St(this,kt),n);gt(this,Gt,Yt).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):gt(this,Gt,Yt).call(this,a.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],r&<(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(W);function Ht(e){_t(this,At,e),St(this,wt)&&(St(this,wt).stop(),gt(this,Lt,Vt).call(this))}function Ft(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function xt(){var e=gt(this,Rt,Ut).call(this);if(void 0!==e){var t=gt(this,Dt,Ft).call(this,e);null!==t&>(this,Tt,Ht).call(this,t)}}function Ut(){var e;return null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e?void 0:e.minimumDelayBetweenInterstitial}function Vt(){St(this,At)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(_t(this,wt,new ct(St(this,At))),St(this,wt).start())}function Wt(){var e=[i.LOADING,i.OPENED].includes(St(this,Pt)),t=[a.LOADING,a.OPENED,a.REWARDED].includes(St(this,Ot));return e||t}function zt(e){St(this,Et)!==e&&(_t(this,Et,e),this.emit(n.BANNER_STATE_CHANGED,St(this,Et)))}function Zt(e){St(this,Pt)!==e&&(_t(this,Pt,e),this.emit(n.INTERSTITIAL_STATE_CHANGED,St(this,Pt)))}function Yt(e){St(this,Ot)!==e&&(_t(this,Ot,e),this.emit(n.REWARDED_STATE_CHANGED,St(this,Ot)))}function Jt(e,t){if(!e)return e;if(!t)return e;var r=t.find((function(t){return t.id===e}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:e}H().mixin(Mt.prototype);const Kt=Mt;function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Xt(e,t){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(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,n).then((function(t){t[o]?r._resolvePromiseDecorator(e):r._rejectPromiseDecorator(e)})).catch((function(t){r._rejectPromiseDecorator(e,t)}))),i.promise}const Rn=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sn(e,t)}(p,t);var r,n,o,c,f=(o=p,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=En(o);if(c){var r=En(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bn(e)}(this,e)});function p(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?e.entries.map((function(e){return{id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc("large")}})):[],t._resolvePromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(e){t._rejectPromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),zn(this,Kn).purchase(r).then((function(r){var n=Cn({id:e},r.purchaseData);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),zn(this,Kn).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),zn(this,Kn).getCatalog().then((function(r){var n=t.map((function(e){var t,n=r.find((function(t){return t.id===e.id}));return{id:e.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(t=n.getPriceCurrencyImage)||void 0===t?void 0:t.call(n,"medium")}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),zn(this,Kn).getPurchases().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cn({id:r.find((function(t){return t.id===e.productID})).id},e.purchaseData);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"getRemoteConfig",value:function(e){var t=this;if(!this._platformSdk)return Promise.reject();var r=e;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(y.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(y.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(e){t._resolvePromiseDecorator(y.GET_REMOTE_CONFIG,e)})).catch((function(e){t._rejectPromiseDecorator(y.GET_REMOTE_CONFIG,e)}))),n.promise}},{key:"clipboardWrite",value:function(e){var t=this,r=this._getPromiseDecorator(y.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(y.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((function(){t._resolvePromiseDecorator(y.CLIPBOARD_WRITE,!0)})).catch((function(e){t._rejectPromiseDecorator(y.CLIPBOARD_WRITE,e)}))),r.promise}}])&&Nn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),h}(mn);function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){to=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==eo(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ro(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function no(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ro(i,n,o,a,s,"next",e)}function s(e){ro(i,n,o,a,s,"throw",e)}a(void 0)}))}}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function io(e){for(var t=1;t120?this._rejectPromiseDecorator(y.INVITE_FRIENDS,A):this._platformSdk.UI.showInvite(t)),r.promise}},{key:"rate",value:function(){var e=this._getPromiseDecorator(y.RATE);return e||(e=this._createPromiseDecorator(y.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}},{key:"createPost",value:function(e){if(!e||null==e||!e.media)return Promise.reject();var t,r=this._getPromiseDecorator(y.CREATE_POST);return r||(r=this._createPromiseDecorator(y.CREATE_POST),this._platformSdk.UI.postMediatopic(e,null!==(t=e.status)&&void 0!==t&&t)),r.promise}},{key:"joinCommunity",value:function(e){if(!e||null==e||!e.groupId)return Promise.reject();var t,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,null!==(t=e.enableMessages)&&void 0!==t&&t)),r.promise}}])&&si(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function ca(e){return ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ca(e)}function ua(){ua=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==ca(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function la(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function fa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pa(e){for(var t=1;t1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){e.next=5;break}return e.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=e.sent;case 5:return e.abrupt("return",Ae(t,this._platformStorageCachedData,r));case 6:case"end":return e.stop()}}),e,this)})),Aa=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){la(i,n,o,a,s,"next",e)}function s(e){la(i,n,o,a,s,"throw",e)}a(void 0)}))},Aa.apply(this,arguments)}const Oa=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ma(e,t)}(l,t);var r,n,o,s,c=(o=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_a(o);if(s){var r=_a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ca(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return va(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,as)),{},{playerid:t.playerid,playername:t.playername,lastupdated:t.lastupdated,date:t.date,rdate:t.rdate})}))):n(new Error(e.errorcode))}))}))}},{key:"showAchievementsNativePopup",value:function(e){return this._platformSdk.GameAPI.Achievements.list(e),Promise.resolve()}}])&&ls(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function As(e){return As="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},As(e)}function Os(e,t){for(var r=0;r0&&(e._playerId=o,e._playerName=i,e._playerPhotos.push(a),e._isPlayerAuthorized=!0),e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)}))}))})):this._rejectPromiseDecorator(y.INITIALIZE,E)),t.promise}},{key:"isStorageSupported",value:function(e){return e!==u.PLATFORM_INTERNAL&&Ts(Is(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e!==u.PLATFORM_INTERNAL&&Ts(Is(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"showInterstitial",value:function(){var e=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){e._setInterstitialState(i.CLOSED)}))}},{key:"showRewarded",value:function(){var e=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(t,r){t?r():e._setRewardedState(a.FAILED)}),(function(t){t?(e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)):e._setRewardedState(a.FAILED)}))}},{key:"leaderboardsSetScore",value:function(e,t){var r=this,n=this._getPromiseDecorator(y.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(y.LEADERBOARDS_SET_SCORE);var o={score:t,board:e};this._platformSdk.Scores.save(o,(function(e){e.success?r._resolvePromiseDecorator(y.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(y.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(e){var t=this;return e.achievement?new Promise((function(r,n){t._platformSdk.Achievements.save(Array.isArray(e.achievement)?e.achievement:[e.achievement],(function(e){e.success?r(e):n(e.errormsg)}))})):Promise.reject()}}])&&Os(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Ls(){Ls=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Gs(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function js(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Cs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ns(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];var r=null;return this._preloadedInterstitialPromises[e]=this._platformSdk.getInterstitialAdAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedInterstitialPromises[e]=null,Promise.reject()})),this._preloadedInterstitialPromises[e]}function nc(e){var t=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];var r=null;return this._preloadedRewardedPromises[e]=this._platformSdk.getRewardedVideoAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedRewardedPromises[e]=null,Promise.reject()})),this._preloadedRewardedPromises[e]}function oc(){return ic.apply(this,arguments)}function ic(){var e;return e=Ls().mark((function e(){return Ls().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(0),"INVALID_OPERATION"!==(null===e.t0||void 0===e.t0?void 0:e.t0.code)){e.next=13;break}e.next=14;break;case 13:throw new Error(e.t0);case 14:return e.prev=15,e.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!e.sent){e.next=21;break}return e.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:e.next=28;break;case 23:if(e.prev=23,e.t1=e.catch(15),"INVALID_OPERATION"!==(null===e.t1||void 0===e.t1?void 0:e.t1.code)){e.next=27;break}return e.abrupt("return",Promise.resolve());case 27:throw new Error(e.t1);case 28:return e.abrupt("return",Promise.resolve());case 29:case"end":return e.stop()}}),e,this,[[0,8],[15,23]])})),ic=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){js(i,n,o,a,s,"next",e)}function s(e){js(i,n,o,a,s,"throw",e)}a(void 0)}))},ic.apply(this,arguments)}const ac=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fs(e,t)}(d,t);var r,n,o,c,p=(o=d,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Us(o);if(c){var r=Us(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Gs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xs(e)}(this,e)});function d(){var e,t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var o=arguments.length,i=new Array(o),a=0;a\n \n \n \n \n \n \n \n \n \n \n \n \n',"",{players:r},(function(e){e.showAsync(),t._overlay=e,n.remove(),t._resolvePromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(e,r){n.remove(),t._rejectPromiseDecorator(y.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(e){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this,r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Ns({id:e},r);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this,r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this,t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=t.map((function(e){var t=r.find((function(t){return t.productID===e.platformProductId}));return{id:e.id,title:t.title,description:t.description,imageURI:t.imageURI,price:t.price,priceCurrencyCode:t.priceCurrencyCode,priceValue:t.priceAmount}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Ns({id:r.find((function(t){return t.id===e.productID})).id},e);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.image||!t.text)return Promise.reject();if(!Pe(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.inviteAsync(t).then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),r.promise}},{key:"joinCommunity",value:function(e){var t=this,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),e&&!0===e.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)}))),r.promise}},{key:"share",value:function(e){var t=this;if(!e.image||!e.text)return Promise.reject();if(!Pe(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.shareAsync(Ns({intent:"REQUEST"},e)).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}],n&&Ms(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),d}(mn);function sc(e){return sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sc(e)}function cc(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent.postMessage(e,t)}},{key:"addListener",value:function(e){window.addEventListener("message",e)}},{key:"removeListener",value:function(e){window.removeEventListener("message",e)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&cc(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType("resource")||[],i=n.length>0?n:["name","initiatorType"],a=o.map((function(e){var t={};return i.forEach((function(r){r in e&&(t[r]=e[r])})),t}));return Oc(this,Bc).send({type:t.PLATFORM,action:jc,id:e,options:{resources:a}}),Promise.resolve(o)}lc=Fc;const Vc=Fc;function Wc(e){return Wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wc(e)}function zc(e,t){for(var r=0;r=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(y.CONSUME_PURCHASE,e)}else this._rejectPromiseDecorator(y.CONSUME_PURCHASE,new Error(e))}function tl(e){if(e.success){var t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.data.map((function(e){var r=JSON.parse(e),n=Pu({id:t.find((function(e){return e.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(y.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(y.GET_PURCHASES,new Error(e))}function rl(e){e.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.GET_STORAGE_DATA,new Error(e))}function nl(e){e.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.SET_STORAGE_DATA,new Error(e))}function ol(e){e.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA,new Error(e))}const il=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ou(e,t)}(s,t);var r,n,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Tu(o);if(i){var r=Tu(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===bu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ku(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ll(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function fl(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ll(i,n,o,a,s,"next",e)}function s(e){ll(i,n,o,a,s,"throw",e)}a(void 0)}))}}function pl(e,t){for(var r=0;rr.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")===r.length-4?parseInt(r.replace(/,/,""),10):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")!==r.length-3?parseFloat(r.replace(",",".")):r.includes(".")&&-1!==r.lastIndexOf(".")&&r.lastIndexOf(".")===r.length-4?parseInt(r.replace(/\./,""),10):r.includes(".")?parseFloat(r):parseInt(r,10),a=null===(t=o.price)||void 0===t||null===(t=t.currency)||void 0===t?void 0:t.toUpperCase(),s="".concat(i," ").concat(a);return{id:e.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));e._resolvePromiseDecorator(y.GET_CATALOG,o)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.entitlements.map((function(e){return Ml({id:r.find((function(t){return t.id===e.id})).id},e)})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=this._getPromiseDecorator(y.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),t.promise}},{key:"share",value:function(e){var t=this;if(!e.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:e.mediaUrl}).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}])&&Hl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(mn);function Zl(e){return Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zl(e)}function Yl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jl(e){for(var t=1;t2?t.slice(0,2):t,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(r,rf(r,n,"set"),o)}));e._platformStorageCachedData={};var r=e._platformSdk.game.loadData().then((function(t){"string"==typeof t&&""!==t&&(e._platformStorageCachedData=JSON.parse(t))}));e._platformSdk.system.onAudioEnabledChange((function(t){e._setAudioState(t)})),e._platformSdk.system.onPause((function(){e._setPauseState(!0)})),e._platformSdk.system.onResume((function(){e._setPauseState(!1)})),Promise.all([t,r]).finally((function(){e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE),e._platformSdk.game.firstFrameReady()}))}))}))),t.promise}},{key:"isStorageSupported",value:function(e){return e===u.PLATFORM_INTERNAL||Xl(ef(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e===u.PLATFORM_INTERNAL||Xl(ef(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"getDataFromStorage",value:function(e,t,r){var n=this;return t===u.PLATFORM_INTERNAL?new Promise((function(t,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(e)){for(var i=[],a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,sf);e.playerId=r||null,e.playerName=n||null,o&&e.playerPhotos.push(o),e.playerExtra=i,e._isPlayerAuthorized=!0}e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)},window.onBannerReady=function(){e._isBannerAvailable=!0},Se("https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js",this._options.adTestMode?{"data-jg-test-environment":"on"}:{}).catch((function(t){e._rejectPromiseDecorator(y.INITIALIZE,JSON.stringify(t))}))),t.promise}},{key:"preloadInterstitial",value:function(){yf(this,mf,_f).call(this)}},{key:"showInterstitial",value:function(){var e=this;yf(this,mf,_f).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Interstitial,{onAdClosed:function(){e._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setInterstitialState(i.FAILED)}}),e._setInterstitialState(i.OPENED),e._preloadInterstitialPromise=null}))}},{key:"preloadRewarded",value:function(){yf(this,vf,gf).call(this)}},{key:"showRewarded",value:function(){var e=this;yf(this,vf,gf).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Rewarded,{onAdClosed:function(t){t&&e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setRewardedState(a.FAILED)}}),e._setRewardedState(a.OPENED),e._preloadRewardedPromise=null}))}},{key:"showBanner",value:function(e){var t,r=this;this._isBannerAvailable?null===(t=window.JGBanner)||void 0===t||t.loadBanner().then((function(){var t,n;r._setBannerState(s.SHOWN),null===(t=window.JGBanner)||void 0===t||t.showBanner(e||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(e){console.error(e),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:"hideBanner",value:function(){var e;null===(e=window.JGBanner)||void 0===e||e.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:"leaderboardsSetScore",value:function(e,t,r){if(!r)return Promise.reject();var n="string"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(n),Promise.resolve()}}])&&cf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function bf(e){return bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bf(e)}function Ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Lf(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function jf(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Lf(i,n,o,a,s,"next",e)}function s(e){Lf(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Cf(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};window.parent.postMessage({type:e,data:t},"*")}function $f(e){this._isPlayerAuthorized=e.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=e.playerId,this._playerName=e.playerName,e.playerPhoto&&this._playerPhotos.push(e.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(y.INITIALIZE)}function ep(e){var t,r;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,null!==(r=e.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(y.GET_STORAGE_DATA)}function tp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA):this._rejectPromiseDecorator(y.SET_STORAGE_DATA)}function rp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA)}function np(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.PURCHASE,e.data):this._rejectPromiseDecorator(y.PURCHASE,e.data)}function op(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_CATALOG,e.data):this._rejectPromiseDecorator(y.GET_CATALOG,e.data)}function ip(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_PURCHASES,e.data):this._rejectPromiseDecorator(y.GET_PURCHASES,e.data)}function ap(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.CREATE_POST):this._rejectPromiseDecorator(y.CREATE_POST)}function sp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.JOIN_COMMUNITY):this._rejectPromiseDecorator(y.JOIN_COMMUNITY)}const cp=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bf(e,t)}(l,t);var r,n,o,i,a,s,c=(a=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hf(a);if(s){var r=Hf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===If(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mf(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this._getPromiseDecorator(y.CREATE_POST);return t||(t=this._createPromiseDecorator(y.CREATE_POST),xf(this,Uf,Qf).call(this,y.CREATE_POST,{options:e})),t.promise}},{key:"joinCommunity",value:function(){var e=this._getPromiseDecorator(y.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(y.JOIN_COMMUNITY),xf(this,Uf,Qf).call(this,y.JOIN_COMMUNITY)),e.promise}}],n&&Cf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function up(e){return up="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},up(e)}function lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fp(e){for(var t=1;t { initializeBridge().then(() => resolve()) } + bridgeScript.onerror = addLocalBridge + + bridgeTimeout = setTimeout(() => { + console.warn('CDN bridge failed to load within 2 seconds, loading local bridge') + addLocalBridge() + }, 2000) + + document.head.appendChild(bridgeScript) + + function evalLocalScript() { + (()=>{var e={611:e=>{!function(t){e.exports=t;var r="listeners",n={on:function(e,t){return a(this,e).push(t),this},once:function(e,t){var r=this;return n.originalListener=t,a(r,e).push(n),r;function n(){i.call(r,e,n),t.apply(this,arguments)}},off:i,emit:function(e,t){var r=this,n=a(r,e,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(e){e.call(r)}));else if(2===o)n.forEach((function(e){e.call(r,t)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(e){e.apply(r,i)}))}return!!n.length}};function o(e){for(var t in n)e[t]=n[t];return e}function i(e,t){var n,o=this;if(arguments.length){if(t){if(n=a(o,e,!0)){if(!(n=n.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return i.call(o,e);o[r][e]=n}}else if((n=o[r])&&(delete n[e],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(e,t,n){if(!n||e[r]){var o=e[r]||(e[r]={});return o[t]||(o[t]=[])}}o(t.prototype),t.mixin=o}((function e(){if(!(this instanceof e))return new e}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={VK:"vk",OK:"ok",YANDEX:"yandex",CRAZY_GAMES:"crazy_games",ABSOLUTE_GAMES:"absolute_games",GAME_DISTRIBUTION:"game_distribution",PLAYGAMA:"playgama",PLAYDECK:"playdeck",TELEGRAM:"telegram",Y8:"y8",LAGGED:"lagged",FACEBOOK:"facebook",POKI:"poki",MOCK:"mock",QA_TOOL:"qa_tool",MSN:"msn",HUAWEI:"huawei",BITQUEST:"bitquest",GAMEPUSH:"gamepush",DISCORD:"discord",JIO_GAMES:"jio_games",YOUTUBE:"youtube",PORTAL:"portal",REDDIT:"reddit"},t={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"},n={INTERSTITIAL_STATE_CHANGED:"interstitial_state_changed",REWARDED_STATE_CHANGED:"rewarded_state_changed",BANNER_STATE_CHANGED:"banner_state_changed",VISIBILITY_STATE_CHANGED:"visibility_state_changed",AUDIO_STATE_CHANGED:"audio_state_changed",PAUSE_STATE_CHANGED:"pause_state_changed"},o={VISIBLE:"visible",HIDDEN:"hidden"},i={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed"},a={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed",REWARDED:"rewarded"},s={LOADING:"loading",SHOWN:"shown",HIDDEN:"hidden",FAILED:"failed"},c="banner-container",u={LOCAL_STORAGE:"local_storage",PLATFORM_INTERNAL:"platform_internal"},l={DESKTOP:"desktop",MOBILE:"mobile",TABLET:"tablet",TV:"tv"},f={GAME_READY:"game_ready",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",GAME_OVER:"game_over"},p="not_available",d="in_game",h="native",y={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"},m={message:"Before using the SDK you must initialize it"},v={message:"Storage not supported"},_={message:"Storage not available"},g={message:"GameDistribution Game ID is undefined"},S={message:"Y8 Game params are not found"},b={message:"OK Game params are not found"},E={message:"Lagged Game params are not found"},P={message:"Huawei Game params are not found"},w={message:"GamePush Game params are not found"},A={message:"Message is too long"},O={message:"Discord Game params are not found"};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function T(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=e;for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?e.reduce((function(e,n,o){if(e[o]=we(t,n),r)try{e[o]=JSON.parse(e[o])}catch(e){}return e}),new Array(e.length)):we(t,e)}function Oe(e,t){for(var r=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||t&&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=e;var a=Math.max(0,Math.min(100,e)),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")}}}}],r&&Te(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(W);H().mixin(Ce.prototype);const Ne=Ce;function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function Be(e,t){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(t){var n=t[this._platformBridge.platformId];if(n)return this.get(e,n,r)}var o=t;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.getDataFromStorage(e,o,r):Promise.reject()}},{key:"set",value:function(e,t,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(e,t,n)}var o=r;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.setDataToStorage(e,t,o):Promise.reject()}},{key:"delete",value:function(e,t){if(t){var r=t[this._platformBridge.platformId];if(r)return this.delete(e,r)}var n=t;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?this._platformBridge.deleteDataFromStorage(e,n):Promise.reject()}}],r&&Be(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(W);function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ve(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"bottom",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN)if(gt(this,Ct,zt).call(this,s.LOADING),this.isBannerSupported){var n,o=r;o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback);var i=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,a=gt(this,Bt,Jt).call(this,o,i);this._platformBridge.showBanner(t,a)}else gt(this,Ct,zt).call(this,s.FAILED)}},{key:"hideBanner",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:"preloadInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this))if(gt(this,Nt,Zt).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&St(this,wt)&&St(this,wt).state===Qe)gt(this,Nt,Zt).call(this,i.FAILED);else{var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.showInterstitial(a)}else gt(this,Nt,Zt).call(this,i.FAILED)}},{key:"preloadRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=t;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===(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=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this)){var r;_t(this,kt,t),St(this,kt)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&_t(this,kt,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=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,o=gt(this,Bt,Jt).call(this,St(this,kt),n);gt(this,Gt,Yt).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):gt(this,Gt,Yt).call(this,a.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],r&<(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(W);function Ht(e){_t(this,At,e),St(this,wt)&&(St(this,wt).stop(),gt(this,Lt,Vt).call(this))}function Ft(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function xt(){var e=gt(this,Rt,Ut).call(this);if(void 0!==e){var t=gt(this,Dt,Ft).call(this,e);null!==t&>(this,Tt,Ht).call(this,t)}}function Ut(){var e;return null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e?void 0:e.minimumDelayBetweenInterstitial}function Vt(){St(this,At)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(_t(this,wt,new ct(St(this,At))),St(this,wt).start())}function Wt(){var e=[i.LOADING,i.OPENED].includes(St(this,Pt)),t=[a.LOADING,a.OPENED,a.REWARDED].includes(St(this,Ot));return e||t}function zt(e){St(this,Et)!==e&&(_t(this,Et,e),this.emit(n.BANNER_STATE_CHANGED,St(this,Et)))}function Zt(e){St(this,Pt)!==e&&(_t(this,Pt,e),this.emit(n.INTERSTITIAL_STATE_CHANGED,St(this,Pt)))}function Yt(e){St(this,Ot)!==e&&(_t(this,Ot,e),this.emit(n.REWARDED_STATE_CHANGED,St(this,Ot)))}function Jt(e,t){if(!e)return e;if(!t)return e;var r=t.find((function(t){return t.id===e}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:e}H().mixin(Mt.prototype);const Kt=Mt;function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Xt(e,t){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(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,n).then((function(t){t[o]?r._resolvePromiseDecorator(e):r._rejectPromiseDecorator(e)})).catch((function(t){r._rejectPromiseDecorator(e,t)}))),i.promise}const Rn=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sn(e,t)}(p,t);var r,n,o,c,f=(o=p,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=En(o);if(c){var r=En(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bn(e)}(this,e)});function p(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?e.entries.map((function(e){return{id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc("large")}})):[],t._resolvePromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(e){t._rejectPromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),zn(this,Kn).purchase(r).then((function(r){var n=Cn({id:e},r.purchaseData);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),zn(this,Kn).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),zn(this,Kn).getCatalog().then((function(r){var n=t.map((function(e){var t,n=r.find((function(t){return t.id===e.id}));return{id:e.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(t=n.getPriceCurrencyImage)||void 0===t?void 0:t.call(n,"medium")}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),zn(this,Kn).getPurchases().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cn({id:r.find((function(t){return t.id===e.productID})).id},e.purchaseData);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"getRemoteConfig",value:function(e){var t=this;if(!this._platformSdk)return Promise.reject();var r=e;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(y.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(y.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(e){t._resolvePromiseDecorator(y.GET_REMOTE_CONFIG,e)})).catch((function(e){t._rejectPromiseDecorator(y.GET_REMOTE_CONFIG,e)}))),n.promise}},{key:"clipboardWrite",value:function(e){var t=this,r=this._getPromiseDecorator(y.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(y.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((function(){t._resolvePromiseDecorator(y.CLIPBOARD_WRITE,!0)})).catch((function(e){t._rejectPromiseDecorator(y.CLIPBOARD_WRITE,e)}))),r.promise}}])&&Nn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),h}(mn);function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){to=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==eo(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ro(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function no(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ro(i,n,o,a,s,"next",e)}function s(e){ro(i,n,o,a,s,"throw",e)}a(void 0)}))}}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function io(e){for(var t=1;t120?this._rejectPromiseDecorator(y.INVITE_FRIENDS,A):this._platformSdk.UI.showInvite(t)),r.promise}},{key:"rate",value:function(){var e=this._getPromiseDecorator(y.RATE);return e||(e=this._createPromiseDecorator(y.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}},{key:"createPost",value:function(e){if(!e||null==e||!e.media)return Promise.reject();var t,r=this._getPromiseDecorator(y.CREATE_POST);return r||(r=this._createPromiseDecorator(y.CREATE_POST),this._platformSdk.UI.postMediatopic(e,null!==(t=e.status)&&void 0!==t&&t)),r.promise}},{key:"joinCommunity",value:function(e){if(!e||null==e||!e.groupId)return Promise.reject();var t,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,null!==(t=e.enableMessages)&&void 0!==t&&t)),r.promise}}])&&ai(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function ca(){ca=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==sa(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ua(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function la(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){e.next=5;break}return e.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=e.sent;case 5:return e.abrupt("return",Ae(t,this._platformStorageCachedData,r));case 6:case"end":return e.stop()}}),e,this)})),wa=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ua(i,n,o,a,s,"next",e)}function s(e){ua(i,n,o,a,s,"throw",e)}a(void 0)}))},wa.apply(this,arguments)}const Aa=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ya(e,t)}(l,t);var r,n,o,s,c=(o=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=va(o);if(s){var r=va(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ma(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,is)),{},{playerid:t.playerid,playername:t.playername,lastupdated:t.lastupdated,date:t.date,rdate:t.rdate})}))):n(new Error(e.errorcode))}))}))}},{key:"showAchievementsNativePopup",value:function(e){return this._platformSdk.GameAPI.Achievements.list(e),Promise.resolve()}}])&&us(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function ws(e){return ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ws(e)}function As(e,t){for(var r=0;r0&&(e._playerId=o,e._playerName=i,e._playerPhotos.push(a),e._isPlayerAuthorized=!0),e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)}))}))})):this._rejectPromiseDecorator(y.INITIALIZE,E)),t.promise}},{key:"isStorageSupported",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"showInterstitial",value:function(){var e=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){e._setInterstitialState(i.CLOSED)}))}},{key:"showRewarded",value:function(){var e=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(t,r){t?r():e._setRewardedState(a.FAILED)}),(function(t){t?(e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)):e._setRewardedState(a.FAILED)}))}},{key:"leaderboardsSetScore",value:function(e,t){var r=this,n=this._getPromiseDecorator(y.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(y.LEADERBOARDS_SET_SCORE);var o={score:t,board:e};this._platformSdk.Scores.save(o,(function(e){e.success?r._resolvePromiseDecorator(y.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(y.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(e){var t=this;return e.achievement?new Promise((function(r,n){t._platformSdk.Achievements.save(Array.isArray(e.achievement)?e.achievement:[e.achievement],(function(e){e.success?r(e):n(e.errormsg)}))})):Promise.reject()}}])&&As(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Rs(){Rs=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ns(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Ls(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];var r=null;return this._preloadedInterstitialPromises[e]=this._platformSdk.getInterstitialAdAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedInterstitialPromises[e]=null,Promise.reject()})),this._preloadedInterstitialPromises[e]}function rc(e){var t=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];var r=null;return this._preloadedRewardedPromises[e]=this._platformSdk.getRewardedVideoAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedRewardedPromises[e]=null,Promise.reject()})),this._preloadedRewardedPromises[e]}function nc(){return oc.apply(this,arguments)}function oc(){var e;return e=Rs().mark((function e(){return Rs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(0),"INVALID_OPERATION"!==(null===e.t0||void 0===e.t0?void 0:e.t0.code)){e.next=13;break}e.next=14;break;case 13:throw new Error(e.t0);case 14:return e.prev=15,e.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!e.sent){e.next=21;break}return e.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:e.next=28;break;case 23:if(e.prev=23,e.t1=e.catch(15),"INVALID_OPERATION"!==(null===e.t1||void 0===e.t1?void 0:e.t1.code)){e.next=27;break}return e.abrupt("return",Promise.resolve());case 27:throw new Error(e.t1);case 28:return e.abrupt("return",Promise.resolve());case 29:case"end":return e.stop()}}),e,this,[[0,8],[15,23]])})),oc=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ls(i,n,o,a,s,"next",e)}function s(e){Ls(i,n,o,a,s,"throw",e)}a(void 0)}))},oc.apply(this,arguments)}const ic=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hs(e,t)}(d,t);var r,n,o,c,p=(o=d,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xs(o);if(c){var r=xs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Fs(e)}(this,e)});function d(){var e,t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var o=arguments.length,i=new Array(o),a=0;a\n \n \n \n \n \n \n \n \n \n \n \n \n',"",{players:r},(function(e){e.showAsync(),t._overlay=e,n.remove(),t._resolvePromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(e,r){n.remove(),t._rejectPromiseDecorator(y.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(e){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this,r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Cs({id:e},r);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this,r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this,t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=t.map((function(e){var t=r.find((function(t){return t.productID===e.platformProductId}));return{id:e.id,title:t.title,description:t.description,imageURI:t.imageURI,price:t.price,priceCurrencyCode:t.priceCurrencyCode,priceValue:t.priceAmount}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cs({id:r.find((function(t){return t.id===e.productID})).id},e);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.image||!t.text)return Promise.reject();if(!Pe(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.inviteAsync(t).then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),r.promise}},{key:"joinCommunity",value:function(e){var t=this,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),e&&!0===e.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)}))),r.promise}},{key:"share",value:function(e){var t=this;if(!e.image||!e.text)return Promise.reject();if(!Pe(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.shareAsync(Cs({intent:"REQUEST"},e)).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}],n&&Bs(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),d}(mn);function ac(e){return ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ac(e)}function sc(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent.postMessage(e,t)}},{key:"addListener",value:function(e){window.addEventListener("message",e)}},{key:"removeListener",value:function(e){window.removeEventListener("message",e)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&sc(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType("resource")||[],i=n.length>0?n:["name","initiatorType"],a=o.map((function(e){var t={};return i.forEach((function(r){r in e&&(t[r]=e[r])})),t}));return Ac(this,Gc).send({type:t.PLATFORM,action:Lc,id:e,options:{resources:a}}),Promise.resolve(o)}uc=Hc;const Uc=Hc;function Vc(e){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(e)}function Wc(e,t){for(var r=0;r=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(y.CONSUME_PURCHASE,e)}else this._rejectPromiseDecorator(y.CONSUME_PURCHASE,new Error(e))}function el(e){if(e.success){var t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.data.map((function(e){var r=JSON.parse(e),n=Eu({id:t.find((function(e){return e.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(y.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(y.GET_PURCHASES,new Error(e))}function tl(e){e.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.GET_STORAGE_DATA,new Error(e))}function rl(e){e.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.SET_STORAGE_DATA,new Error(e))}function nl(e){e.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA,new Error(e))}const ol=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Au(e,t)}(s,t);var r,n,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ku(o);if(i){var r=ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Su(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ou(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ul(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function ll(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ul(i,n,o,a,s,"next",e)}function s(e){ul(i,n,o,a,s,"throw",e)}a(void 0)}))}}function fl(e,t){for(var r=0;rr.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")===r.length-4?parseInt(r.replace(/,/,""),10):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")!==r.length-3?parseFloat(r.replace(",",".")):r.includes(".")&&-1!==r.lastIndexOf(".")&&r.lastIndexOf(".")===r.length-4?parseInt(r.replace(/\./,""),10):r.includes(".")?parseFloat(r):parseInt(r,10),a=null===(t=o.price)||void 0===t||null===(t=t.currency)||void 0===t?void 0:t.toUpperCase(),s="".concat(i," ").concat(a);return{id:e.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));e._resolvePromiseDecorator(y.GET_CATALOG,o)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.entitlements.map((function(e){return Bl({id:r.find((function(t){return t.id===e.id})).id},e)})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=this._getPromiseDecorator(y.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),t.promise}},{key:"share",value:function(e){var t=this;if(!e.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:e.mediaUrl}).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}])&&Ml(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(mn);function zl(e){return zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zl(e)}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t2?t.slice(0,2):t,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(r,tf(r,n,"set"),o)}));e._platformStorageCachedData={};var r=e._platformSdk.game.loadData().then((function(t){"string"==typeof t&&""!==t&&(e._platformStorageCachedData=JSON.parse(t))}));e._platformSdk.system.onAudioEnabledChange((function(t){e._setAudioState(t)})),e._platformSdk.system.onPause((function(){e._setPauseState(!0)})),e._platformSdk.system.onResume((function(){e._setPauseState(!1)})),Promise.all([t,r]).finally((function(){e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE),e._platformSdk.game.firstFrameReady()}))}))}))),t.promise}},{key:"isStorageSupported",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"getDataFromStorage",value:function(e,t,r){var n=this;return t===u.PLATFORM_INTERNAL?new Promise((function(t,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(e)){for(var i=[],a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,af);e.playerId=r||null,e.playerName=n||null,o&&e.playerPhotos.push(o),e.playerExtra=i,e._isPlayerAuthorized=!0}e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)},window.onBannerReady=function(){e._isBannerAvailable=!0},Se("https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js",this._options.adTestMode?{"data-jg-test-environment":"on"}:{}).catch((function(t){e._rejectPromiseDecorator(y.INITIALIZE,JSON.stringify(t))}))),t.promise}},{key:"preloadInterstitial",value:function(){hf(this,yf,vf).call(this)}},{key:"showInterstitial",value:function(){var e=this;hf(this,yf,vf).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Interstitial,{onAdClosed:function(){e._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setInterstitialState(i.FAILED)}}),e._setInterstitialState(i.OPENED),e._preloadInterstitialPromise=null}))}},{key:"preloadRewarded",value:function(){hf(this,mf,_f).call(this)}},{key:"showRewarded",value:function(){var e=this;hf(this,mf,_f).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Rewarded,{onAdClosed:function(t){t&&e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setRewardedState(a.FAILED)}}),e._setRewardedState(a.OPENED),e._preloadRewardedPromise=null}))}},{key:"showBanner",value:function(e){var t,r=this;this._isBannerAvailable?null===(t=window.JGBanner)||void 0===t||t.loadBanner().then((function(){var t,n;r._setBannerState(s.SHOWN),null===(t=window.JGBanner)||void 0===t||t.showBanner(e||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(e){console.error(e),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:"hideBanner",value:function(){var e;null===(e=window.JGBanner)||void 0===e||e.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:"leaderboardsSetScore",value:function(e,t,r){if(!r)return Promise.reject();var n="string"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(n),Promise.resolve()}}])&&sf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Sf(e){return Sf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sf(e)}function bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Rf(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Lf(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Rf(i,n,o,a,s,"next",e)}function s(e){Rf(i,n,o,a,s,"throw",e)}a(void 0)}))}}function jf(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};window.parent.postMessage({type:e,data:t},"*")}function Qf(e){this._isPlayerAuthorized=e.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=e.playerId,this._playerName=e.playerName,e.playerPhoto&&this._playerPhotos.push(e.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(y.INITIALIZE)}function $f(e){var t,r;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,null!==(r=e.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(y.GET_STORAGE_DATA)}function ep(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA):this._rejectPromiseDecorator(y.SET_STORAGE_DATA)}function tp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA)}function rp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.PURCHASE,e.data):this._rejectPromiseDecorator(y.PURCHASE,e.data)}function np(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_CATALOG,e.data):this._rejectPromiseDecorator(y.GET_CATALOG,e.data)}function op(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_PURCHASES,e.data):this._rejectPromiseDecorator(y.GET_PURCHASES,e.data)}function ip(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.CREATE_POST):this._rejectPromiseDecorator(y.CREATE_POST)}function ap(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.JOIN_COMMUNITY):this._rejectPromiseDecorator(y.JOIN_COMMUNITY)}const sp=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gf(e,t)}(l,t);var r,n,o,i,a,s,c=(a=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mf(a);if(s){var r=Mf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Df(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bf(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this._getPromiseDecorator(y.CREATE_POST);return t||(t=this._createPromiseDecorator(y.CREATE_POST),Ff(this,xf,Xf).call(this,y.CREATE_POST,{options:e})),t.promise}},{key:"joinCommunity",value:function(){var e=this._getPromiseDecorator(y.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(y.JOIN_COMMUNITY),Ff(this,xf,Xf).call(this,y.JOIN_COMMUNITY)),e.promise}}],n&&jf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function cp(e){return cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(e)}function up(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lp(e){for(var t=1;t resolve()) } }) From 5e01c25d1e739e90bda4f56b2f91637441c8f5de Mon Sep 17 00:00:00 2001 From: Ivan Lysov Date: Wed, 29 Oct 2025 12:16:26 +0500 Subject: [PATCH 2/2] check for global var --- PlaygamaBridge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlaygamaBridge.js b/PlaygamaBridge.js index 7ef8589..f6a590a 100644 --- a/PlaygamaBridge.js +++ b/PlaygamaBridge.js @@ -636,7 +636,7 @@ document.head.appendChild(bridgeScript) function evalLocalScript() { - (()=>{var e={611:e=>{!function(t){e.exports=t;var r="listeners",n={on:function(e,t){return a(this,e).push(t),this},once:function(e,t){var r=this;return n.originalListener=t,a(r,e).push(n),r;function n(){i.call(r,e,n),t.apply(this,arguments)}},off:i,emit:function(e,t){var r=this,n=a(r,e,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(e){e.call(r)}));else if(2===o)n.forEach((function(e){e.call(r,t)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(e){e.apply(r,i)}))}return!!n.length}};function o(e){for(var t in n)e[t]=n[t];return e}function i(e,t){var n,o=this;if(arguments.length){if(t){if(n=a(o,e,!0)){if(!(n=n.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return i.call(o,e);o[r][e]=n}}else if((n=o[r])&&(delete n[e],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(e,t,n){if(!n||e[r]){var o=e[r]||(e[r]={});return o[t]||(o[t]=[])}}o(t.prototype),t.mixin=o}((function e(){if(!(this instanceof e))return new e}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={VK:"vk",OK:"ok",YANDEX:"yandex",CRAZY_GAMES:"crazy_games",ABSOLUTE_GAMES:"absolute_games",GAME_DISTRIBUTION:"game_distribution",PLAYGAMA:"playgama",PLAYDECK:"playdeck",TELEGRAM:"telegram",Y8:"y8",LAGGED:"lagged",FACEBOOK:"facebook",POKI:"poki",MOCK:"mock",QA_TOOL:"qa_tool",MSN:"msn",HUAWEI:"huawei",BITQUEST:"bitquest",GAMEPUSH:"gamepush",DISCORD:"discord",JIO_GAMES:"jio_games",YOUTUBE:"youtube",PORTAL:"portal",REDDIT:"reddit"},t={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"},n={INTERSTITIAL_STATE_CHANGED:"interstitial_state_changed",REWARDED_STATE_CHANGED:"rewarded_state_changed",BANNER_STATE_CHANGED:"banner_state_changed",VISIBILITY_STATE_CHANGED:"visibility_state_changed",AUDIO_STATE_CHANGED:"audio_state_changed",PAUSE_STATE_CHANGED:"pause_state_changed"},o={VISIBLE:"visible",HIDDEN:"hidden"},i={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed"},a={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed",REWARDED:"rewarded"},s={LOADING:"loading",SHOWN:"shown",HIDDEN:"hidden",FAILED:"failed"},c="banner-container",u={LOCAL_STORAGE:"local_storage",PLATFORM_INTERNAL:"platform_internal"},l={DESKTOP:"desktop",MOBILE:"mobile",TABLET:"tablet",TV:"tv"},f={GAME_READY:"game_ready",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",GAME_OVER:"game_over"},p="not_available",d="in_game",h="native",y={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"},m={message:"Before using the SDK you must initialize it"},v={message:"Storage not supported"},_={message:"Storage not available"},g={message:"GameDistribution Game ID is undefined"},S={message:"Y8 Game params are not found"},b={message:"OK Game params are not found"},E={message:"Lagged Game params are not found"},P={message:"Huawei Game params are not found"},w={message:"GamePush Game params are not found"},A={message:"Message is too long"},O={message:"Discord Game params are not found"};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function T(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=e;for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?e.reduce((function(e,n,o){if(e[o]=we(t,n),r)try{e[o]=JSON.parse(e[o])}catch(e){}return e}),new Array(e.length)):we(t,e)}function Oe(e,t){for(var r=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||t&&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=e;var a=Math.max(0,Math.min(100,e)),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")}}}}],r&&Te(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(W);H().mixin(Ce.prototype);const Ne=Ce;function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function Be(e,t){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(t){var n=t[this._platformBridge.platformId];if(n)return this.get(e,n,r)}var o=t;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.getDataFromStorage(e,o,r):Promise.reject()}},{key:"set",value:function(e,t,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(e,t,n)}var o=r;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.setDataToStorage(e,t,o):Promise.reject()}},{key:"delete",value:function(e,t){if(t){var r=t[this._platformBridge.platformId];if(r)return this.delete(e,r)}var n=t;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?this._platformBridge.deleteDataFromStorage(e,n):Promise.reject()}}],r&&Be(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(W);function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ve(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"bottom",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN)if(gt(this,Ct,zt).call(this,s.LOADING),this.isBannerSupported){var n,o=r;o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback);var i=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,a=gt(this,Bt,Jt).call(this,o,i);this._platformBridge.showBanner(t,a)}else gt(this,Ct,zt).call(this,s.FAILED)}},{key:"hideBanner",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:"preloadInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this))if(gt(this,Nt,Zt).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&St(this,wt)&&St(this,wt).state===Qe)gt(this,Nt,Zt).call(this,i.FAILED);else{var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.showInterstitial(a)}else gt(this,Nt,Zt).call(this,i.FAILED)}},{key:"preloadRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=t;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===(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=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this)){var r;_t(this,kt,t),St(this,kt)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&_t(this,kt,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=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,o=gt(this,Bt,Jt).call(this,St(this,kt),n);gt(this,Gt,Yt).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):gt(this,Gt,Yt).call(this,a.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],r&<(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(W);function Ht(e){_t(this,At,e),St(this,wt)&&(St(this,wt).stop(),gt(this,Lt,Vt).call(this))}function Ft(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function xt(){var e=gt(this,Rt,Ut).call(this);if(void 0!==e){var t=gt(this,Dt,Ft).call(this,e);null!==t&>(this,Tt,Ht).call(this,t)}}function Ut(){var e;return null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e?void 0:e.minimumDelayBetweenInterstitial}function Vt(){St(this,At)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(_t(this,wt,new ct(St(this,At))),St(this,wt).start())}function Wt(){var e=[i.LOADING,i.OPENED].includes(St(this,Pt)),t=[a.LOADING,a.OPENED,a.REWARDED].includes(St(this,Ot));return e||t}function zt(e){St(this,Et)!==e&&(_t(this,Et,e),this.emit(n.BANNER_STATE_CHANGED,St(this,Et)))}function Zt(e){St(this,Pt)!==e&&(_t(this,Pt,e),this.emit(n.INTERSTITIAL_STATE_CHANGED,St(this,Pt)))}function Yt(e){St(this,Ot)!==e&&(_t(this,Ot,e),this.emit(n.REWARDED_STATE_CHANGED,St(this,Ot)))}function Jt(e,t){if(!e)return e;if(!t)return e;var r=t.find((function(t){return t.id===e}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:e}H().mixin(Mt.prototype);const Kt=Mt;function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Xt(e,t){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(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,n).then((function(t){t[o]?r._resolvePromiseDecorator(e):r._rejectPromiseDecorator(e)})).catch((function(t){r._rejectPromiseDecorator(e,t)}))),i.promise}const Rn=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sn(e,t)}(p,t);var r,n,o,c,f=(o=p,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=En(o);if(c){var r=En(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bn(e)}(this,e)});function p(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?e.entries.map((function(e){return{id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc("large")}})):[],t._resolvePromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(e){t._rejectPromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),zn(this,Kn).purchase(r).then((function(r){var n=Cn({id:e},r.purchaseData);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),zn(this,Kn).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),zn(this,Kn).getCatalog().then((function(r){var n=t.map((function(e){var t,n=r.find((function(t){return t.id===e.id}));return{id:e.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(t=n.getPriceCurrencyImage)||void 0===t?void 0:t.call(n,"medium")}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),zn(this,Kn).getPurchases().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cn({id:r.find((function(t){return t.id===e.productID})).id},e.purchaseData);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"getRemoteConfig",value:function(e){var t=this;if(!this._platformSdk)return Promise.reject();var r=e;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(y.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(y.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(e){t._resolvePromiseDecorator(y.GET_REMOTE_CONFIG,e)})).catch((function(e){t._rejectPromiseDecorator(y.GET_REMOTE_CONFIG,e)}))),n.promise}},{key:"clipboardWrite",value:function(e){var t=this,r=this._getPromiseDecorator(y.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(y.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((function(){t._resolvePromiseDecorator(y.CLIPBOARD_WRITE,!0)})).catch((function(e){t._rejectPromiseDecorator(y.CLIPBOARD_WRITE,e)}))),r.promise}}])&&Nn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),h}(mn);function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){to=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==eo(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ro(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function no(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ro(i,n,o,a,s,"next",e)}function s(e){ro(i,n,o,a,s,"throw",e)}a(void 0)}))}}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function io(e){for(var t=1;t120?this._rejectPromiseDecorator(y.INVITE_FRIENDS,A):this._platformSdk.UI.showInvite(t)),r.promise}},{key:"rate",value:function(){var e=this._getPromiseDecorator(y.RATE);return e||(e=this._createPromiseDecorator(y.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}},{key:"createPost",value:function(e){if(!e||null==e||!e.media)return Promise.reject();var t,r=this._getPromiseDecorator(y.CREATE_POST);return r||(r=this._createPromiseDecorator(y.CREATE_POST),this._platformSdk.UI.postMediatopic(e,null!==(t=e.status)&&void 0!==t&&t)),r.promise}},{key:"joinCommunity",value:function(e){if(!e||null==e||!e.groupId)return Promise.reject();var t,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,null!==(t=e.enableMessages)&&void 0!==t&&t)),r.promise}}])&&ai(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function ca(){ca=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==sa(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ua(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function la(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){e.next=5;break}return e.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=e.sent;case 5:return e.abrupt("return",Ae(t,this._platformStorageCachedData,r));case 6:case"end":return e.stop()}}),e,this)})),wa=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ua(i,n,o,a,s,"next",e)}function s(e){ua(i,n,o,a,s,"throw",e)}a(void 0)}))},wa.apply(this,arguments)}const Aa=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ya(e,t)}(l,t);var r,n,o,s,c=(o=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=va(o);if(s){var r=va(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ma(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,is)),{},{playerid:t.playerid,playername:t.playername,lastupdated:t.lastupdated,date:t.date,rdate:t.rdate})}))):n(new Error(e.errorcode))}))}))}},{key:"showAchievementsNativePopup",value:function(e){return this._platformSdk.GameAPI.Achievements.list(e),Promise.resolve()}}])&&us(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function ws(e){return ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ws(e)}function As(e,t){for(var r=0;r0&&(e._playerId=o,e._playerName=i,e._playerPhotos.push(a),e._isPlayerAuthorized=!0),e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)}))}))})):this._rejectPromiseDecorator(y.INITIALIZE,E)),t.promise}},{key:"isStorageSupported",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"showInterstitial",value:function(){var e=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){e._setInterstitialState(i.CLOSED)}))}},{key:"showRewarded",value:function(){var e=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(t,r){t?r():e._setRewardedState(a.FAILED)}),(function(t){t?(e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)):e._setRewardedState(a.FAILED)}))}},{key:"leaderboardsSetScore",value:function(e,t){var r=this,n=this._getPromiseDecorator(y.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(y.LEADERBOARDS_SET_SCORE);var o={score:t,board:e};this._platformSdk.Scores.save(o,(function(e){e.success?r._resolvePromiseDecorator(y.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(y.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(e){var t=this;return e.achievement?new Promise((function(r,n){t._platformSdk.Achievements.save(Array.isArray(e.achievement)?e.achievement:[e.achievement],(function(e){e.success?r(e):n(e.errormsg)}))})):Promise.reject()}}])&&As(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Rs(){Rs=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ns(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Ls(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];var r=null;return this._preloadedInterstitialPromises[e]=this._platformSdk.getInterstitialAdAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedInterstitialPromises[e]=null,Promise.reject()})),this._preloadedInterstitialPromises[e]}function rc(e){var t=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];var r=null;return this._preloadedRewardedPromises[e]=this._platformSdk.getRewardedVideoAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedRewardedPromises[e]=null,Promise.reject()})),this._preloadedRewardedPromises[e]}function nc(){return oc.apply(this,arguments)}function oc(){var e;return e=Rs().mark((function e(){return Rs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(0),"INVALID_OPERATION"!==(null===e.t0||void 0===e.t0?void 0:e.t0.code)){e.next=13;break}e.next=14;break;case 13:throw new Error(e.t0);case 14:return e.prev=15,e.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!e.sent){e.next=21;break}return e.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:e.next=28;break;case 23:if(e.prev=23,e.t1=e.catch(15),"INVALID_OPERATION"!==(null===e.t1||void 0===e.t1?void 0:e.t1.code)){e.next=27;break}return e.abrupt("return",Promise.resolve());case 27:throw new Error(e.t1);case 28:return e.abrupt("return",Promise.resolve());case 29:case"end":return e.stop()}}),e,this,[[0,8],[15,23]])})),oc=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ls(i,n,o,a,s,"next",e)}function s(e){Ls(i,n,o,a,s,"throw",e)}a(void 0)}))},oc.apply(this,arguments)}const ic=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hs(e,t)}(d,t);var r,n,o,c,p=(o=d,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xs(o);if(c){var r=xs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Fs(e)}(this,e)});function d(){var e,t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var o=arguments.length,i=new Array(o),a=0;a\n \n \n \n \n \n \n \n \n \n \n \n \n',"",{players:r},(function(e){e.showAsync(),t._overlay=e,n.remove(),t._resolvePromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(e,r){n.remove(),t._rejectPromiseDecorator(y.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(e){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this,r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Cs({id:e},r);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this,r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this,t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=t.map((function(e){var t=r.find((function(t){return t.productID===e.platformProductId}));return{id:e.id,title:t.title,description:t.description,imageURI:t.imageURI,price:t.price,priceCurrencyCode:t.priceCurrencyCode,priceValue:t.priceAmount}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cs({id:r.find((function(t){return t.id===e.productID})).id},e);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.image||!t.text)return Promise.reject();if(!Pe(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.inviteAsync(t).then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),r.promise}},{key:"joinCommunity",value:function(e){var t=this,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),e&&!0===e.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)}))),r.promise}},{key:"share",value:function(e){var t=this;if(!e.image||!e.text)return Promise.reject();if(!Pe(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.shareAsync(Cs({intent:"REQUEST"},e)).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}],n&&Bs(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),d}(mn);function ac(e){return ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ac(e)}function sc(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent.postMessage(e,t)}},{key:"addListener",value:function(e){window.addEventListener("message",e)}},{key:"removeListener",value:function(e){window.removeEventListener("message",e)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&sc(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType("resource")||[],i=n.length>0?n:["name","initiatorType"],a=o.map((function(e){var t={};return i.forEach((function(r){r in e&&(t[r]=e[r])})),t}));return Ac(this,Gc).send({type:t.PLATFORM,action:Lc,id:e,options:{resources:a}}),Promise.resolve(o)}uc=Hc;const Uc=Hc;function Vc(e){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(e)}function Wc(e,t){for(var r=0;r=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(y.CONSUME_PURCHASE,e)}else this._rejectPromiseDecorator(y.CONSUME_PURCHASE,new Error(e))}function el(e){if(e.success){var t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.data.map((function(e){var r=JSON.parse(e),n=Eu({id:t.find((function(e){return e.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(y.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(y.GET_PURCHASES,new Error(e))}function tl(e){e.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.GET_STORAGE_DATA,new Error(e))}function rl(e){e.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.SET_STORAGE_DATA,new Error(e))}function nl(e){e.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA,new Error(e))}const ol=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Au(e,t)}(s,t);var r,n,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ku(o);if(i){var r=ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Su(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ou(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ul(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function ll(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ul(i,n,o,a,s,"next",e)}function s(e){ul(i,n,o,a,s,"throw",e)}a(void 0)}))}}function fl(e,t){for(var r=0;rr.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")===r.length-4?parseInt(r.replace(/,/,""),10):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")!==r.length-3?parseFloat(r.replace(",",".")):r.includes(".")&&-1!==r.lastIndexOf(".")&&r.lastIndexOf(".")===r.length-4?parseInt(r.replace(/\./,""),10):r.includes(".")?parseFloat(r):parseInt(r,10),a=null===(t=o.price)||void 0===t||null===(t=t.currency)||void 0===t?void 0:t.toUpperCase(),s="".concat(i," ").concat(a);return{id:e.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));e._resolvePromiseDecorator(y.GET_CATALOG,o)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.entitlements.map((function(e){return Bl({id:r.find((function(t){return t.id===e.id})).id},e)})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=this._getPromiseDecorator(y.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),t.promise}},{key:"share",value:function(e){var t=this;if(!e.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:e.mediaUrl}).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}])&&Ml(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(mn);function zl(e){return zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zl(e)}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t2?t.slice(0,2):t,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(r,tf(r,n,"set"),o)}));e._platformStorageCachedData={};var r=e._platformSdk.game.loadData().then((function(t){"string"==typeof t&&""!==t&&(e._platformStorageCachedData=JSON.parse(t))}));e._platformSdk.system.onAudioEnabledChange((function(t){e._setAudioState(t)})),e._platformSdk.system.onPause((function(){e._setPauseState(!0)})),e._platformSdk.system.onResume((function(){e._setPauseState(!1)})),Promise.all([t,r]).finally((function(){e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE),e._platformSdk.game.firstFrameReady()}))}))}))),t.promise}},{key:"isStorageSupported",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"getDataFromStorage",value:function(e,t,r){var n=this;return t===u.PLATFORM_INTERNAL?new Promise((function(t,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(e)){for(var i=[],a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,af);e.playerId=r||null,e.playerName=n||null,o&&e.playerPhotos.push(o),e.playerExtra=i,e._isPlayerAuthorized=!0}e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)},window.onBannerReady=function(){e._isBannerAvailable=!0},Se("https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js",this._options.adTestMode?{"data-jg-test-environment":"on"}:{}).catch((function(t){e._rejectPromiseDecorator(y.INITIALIZE,JSON.stringify(t))}))),t.promise}},{key:"preloadInterstitial",value:function(){hf(this,yf,vf).call(this)}},{key:"showInterstitial",value:function(){var e=this;hf(this,yf,vf).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Interstitial,{onAdClosed:function(){e._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setInterstitialState(i.FAILED)}}),e._setInterstitialState(i.OPENED),e._preloadInterstitialPromise=null}))}},{key:"preloadRewarded",value:function(){hf(this,mf,_f).call(this)}},{key:"showRewarded",value:function(){var e=this;hf(this,mf,_f).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Rewarded,{onAdClosed:function(t){t&&e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setRewardedState(a.FAILED)}}),e._setRewardedState(a.OPENED),e._preloadRewardedPromise=null}))}},{key:"showBanner",value:function(e){var t,r=this;this._isBannerAvailable?null===(t=window.JGBanner)||void 0===t||t.loadBanner().then((function(){var t,n;r._setBannerState(s.SHOWN),null===(t=window.JGBanner)||void 0===t||t.showBanner(e||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(e){console.error(e),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:"hideBanner",value:function(){var e;null===(e=window.JGBanner)||void 0===e||e.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:"leaderboardsSetScore",value:function(e,t,r){if(!r)return Promise.reject();var n="string"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(n),Promise.resolve()}}])&&sf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Sf(e){return Sf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sf(e)}function bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Rf(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Lf(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Rf(i,n,o,a,s,"next",e)}function s(e){Rf(i,n,o,a,s,"throw",e)}a(void 0)}))}}function jf(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};window.parent.postMessage({type:e,data:t},"*")}function Qf(e){this._isPlayerAuthorized=e.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=e.playerId,this._playerName=e.playerName,e.playerPhoto&&this._playerPhotos.push(e.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(y.INITIALIZE)}function $f(e){var t,r;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,null!==(r=e.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(y.GET_STORAGE_DATA)}function ep(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA):this._rejectPromiseDecorator(y.SET_STORAGE_DATA)}function tp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA)}function rp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.PURCHASE,e.data):this._rejectPromiseDecorator(y.PURCHASE,e.data)}function np(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_CATALOG,e.data):this._rejectPromiseDecorator(y.GET_CATALOG,e.data)}function op(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_PURCHASES,e.data):this._rejectPromiseDecorator(y.GET_PURCHASES,e.data)}function ip(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.CREATE_POST):this._rejectPromiseDecorator(y.CREATE_POST)}function ap(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.JOIN_COMMUNITY):this._rejectPromiseDecorator(y.JOIN_COMMUNITY)}const sp=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gf(e,t)}(l,t);var r,n,o,i,a,s,c=(a=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mf(a);if(s){var r=Mf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Df(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bf(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this._getPromiseDecorator(y.CREATE_POST);return t||(t=this._createPromiseDecorator(y.CREATE_POST),Ff(this,xf,Xf).call(this,y.CREATE_POST,{options:e})),t.promise}},{key:"joinCommunity",value:function(){var e=this._getPromiseDecorator(y.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(y.JOIN_COMMUNITY),Ff(this,xf,Xf).call(this,y.JOIN_COMMUNITY)),e.promise}}],n&&jf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function cp(e){return cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(e)}function up(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lp(e){for(var t=1;t{var e={611:e=>{!function(t){e.exports=t;var r="listeners",n={on:function(e,t){return a(this,e).push(t),this},once:function(e,t){var r=this;return n.originalListener=t,a(r,e).push(n),r;function n(){i.call(r,e,n),t.apply(this,arguments)}},off:i,emit:function(e,t){var r=this,n=a(r,e,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(e){e.call(r)}));else if(2===o)n.forEach((function(e){e.call(r,t)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(e){e.apply(r,i)}))}return!!n.length}};function o(e){for(var t in n)e[t]=n[t];return e}function i(e,t){var n,o=this;if(arguments.length){if(t){if(n=a(o,e,!0)){if(!(n=n.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return i.call(o,e);o[r][e]=n}}else if((n=o[r])&&(delete n[e],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(e,t,n){if(!n||e[r]){var o=e[r]||(e[r]={});return o[t]||(o[t]=[])}}o(t.prototype),t.mixin=o}((function e(){if(!(this instanceof e))return new e}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e={VK:"vk",OK:"ok",YANDEX:"yandex",CRAZY_GAMES:"crazy_games",ABSOLUTE_GAMES:"absolute_games",GAME_DISTRIBUTION:"game_distribution",PLAYGAMA:"playgama",PLAYDECK:"playdeck",TELEGRAM:"telegram",Y8:"y8",LAGGED:"lagged",FACEBOOK:"facebook",POKI:"poki",MOCK:"mock",QA_TOOL:"qa_tool",MSN:"msn",HUAWEI:"huawei",BITQUEST:"bitquest",GAMEPUSH:"gamepush",DISCORD:"discord",JIO_GAMES:"jio_games",YOUTUBE:"youtube",PORTAL:"portal",REDDIT:"reddit"},t={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"},n={INTERSTITIAL_STATE_CHANGED:"interstitial_state_changed",REWARDED_STATE_CHANGED:"rewarded_state_changed",BANNER_STATE_CHANGED:"banner_state_changed",VISIBILITY_STATE_CHANGED:"visibility_state_changed",AUDIO_STATE_CHANGED:"audio_state_changed",PAUSE_STATE_CHANGED:"pause_state_changed"},o={VISIBLE:"visible",HIDDEN:"hidden"},i={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed"},a={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed",REWARDED:"rewarded"},s={LOADING:"loading",SHOWN:"shown",HIDDEN:"hidden",FAILED:"failed"},c="banner-container",u={LOCAL_STORAGE:"local_storage",PLATFORM_INTERNAL:"platform_internal"},l={DESKTOP:"desktop",MOBILE:"mobile",TABLET:"tablet",TV:"tv"},f={GAME_READY:"game_ready",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",GAME_OVER:"game_over"},p="not_available",d="in_game",h="native",y={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"},m={message:"Before using the SDK you must initialize it"},v={message:"Storage not supported"},_={message:"Storage not available"},g={message:"GameDistribution Game ID is undefined"},S={message:"Y8 Game params are not found"},b={message:"OK Game params are not found"},E={message:"Lagged Game params are not found"},P={message:"Huawei Game params are not found"},w={message:"GamePush Game params are not found"},A={message:"Message is too long"},O={message:"Discord Game params are not found"};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function T(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=e;for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?e.reduce((function(e,n,o){if(e[o]=we(t,n),r)try{e[o]=JSON.parse(e[o])}catch(e){}return e}),new Array(e.length)):we(t,e)}function Oe(e,t){for(var r=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||t&&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=e;var a=Math.max(0,Math.min(100,e)),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")}}}}],r&&Te(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(W);H().mixin(Ce.prototype);const Ne=Ce;function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function Be(e,t){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(t){var n=t[this._platformBridge.platformId];if(n)return this.get(e,n,r)}var o=t;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.getDataFromStorage(e,o,r):Promise.reject()}},{key:"set",value:function(e,t,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(e,t,n)}var o=r;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.setDataToStorage(e,t,o):Promise.reject()}},{key:"delete",value:function(e,t){if(t){var r=t[this._platformBridge.platformId];if(r)return this.delete(e,r)}var n=t;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?this._platformBridge.deleteDataFromStorage(e,n):Promise.reject()}}],r&&Be(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(W);function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ve(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"bottom",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN)if(gt(this,Ct,zt).call(this,s.LOADING),this.isBannerSupported){var n,o=r;o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback);var i=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,a=gt(this,Bt,Jt).call(this,o,i);this._platformBridge.showBanner(t,a)}else gt(this,Ct,zt).call(this,s.FAILED)}},{key:"hideBanner",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:"preloadInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this))if(gt(this,Nt,Zt).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&St(this,wt)&&St(this,wt).state===Qe)gt(this,Nt,Zt).call(this,i.FAILED);else{var r,n=t;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===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.showInterstitial(a)}else gt(this,Nt,Zt).call(this,i.FAILED)}},{key:"preloadRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=t;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===(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=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this)){var r;_t(this,kt,t),St(this,kt)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&_t(this,kt,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=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,o=gt(this,Bt,Jt).call(this,St(this,kt),n);gt(this,Gt,Yt).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):gt(this,Gt,Yt).call(this,a.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],r&<(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(W);function Ht(e){_t(this,At,e),St(this,wt)&&(St(this,wt).stop(),gt(this,Lt,Vt).call(this))}function Ft(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function xt(){var e=gt(this,Rt,Ut).call(this);if(void 0!==e){var t=gt(this,Dt,Ft).call(this,e);null!==t&>(this,Tt,Ht).call(this,t)}}function Ut(){var e;return null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e?void 0:e.minimumDelayBetweenInterstitial}function Vt(){St(this,At)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(_t(this,wt,new ct(St(this,At))),St(this,wt).start())}function Wt(){var e=[i.LOADING,i.OPENED].includes(St(this,Pt)),t=[a.LOADING,a.OPENED,a.REWARDED].includes(St(this,Ot));return e||t}function zt(e){St(this,Et)!==e&&(_t(this,Et,e),this.emit(n.BANNER_STATE_CHANGED,St(this,Et)))}function Zt(e){St(this,Pt)!==e&&(_t(this,Pt,e),this.emit(n.INTERSTITIAL_STATE_CHANGED,St(this,Pt)))}function Yt(e){St(this,Ot)!==e&&(_t(this,Ot,e),this.emit(n.REWARDED_STATE_CHANGED,St(this,Ot)))}function Jt(e,t){if(!e)return e;if(!t)return e;var r=t.find((function(t){return t.id===e}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:e}H().mixin(Mt.prototype);const Kt=Mt;function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Xt(e,t){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(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,n).then((function(t){t[o]?r._resolvePromiseDecorator(e):r._rejectPromiseDecorator(e)})).catch((function(t){r._rejectPromiseDecorator(e,t)}))),i.promise}const Rn=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sn(e,t)}(p,t);var r,n,o,c,f=(o=p,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=En(o);if(c){var r=En(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bn(e)}(this,e)});function p(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?e.entries.map((function(e){return{id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc("large")}})):[],t._resolvePromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(e){t._rejectPromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),zn(this,Kn).purchase(r).then((function(r){var n=Cn({id:e},r.purchaseData);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),zn(this,Kn).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),zn(this,Kn).getCatalog().then((function(r){var n=t.map((function(e){var t,n=r.find((function(t){return t.id===e.id}));return{id:e.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(t=n.getPriceCurrencyImage)||void 0===t?void 0:t.call(n,"medium")}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),zn(this,Kn).getPurchases().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cn({id:r.find((function(t){return t.id===e.productID})).id},e.purchaseData);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"getRemoteConfig",value:function(e){var t=this;if(!this._platformSdk)return Promise.reject();var r=e;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(y.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(y.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(e){t._resolvePromiseDecorator(y.GET_REMOTE_CONFIG,e)})).catch((function(e){t._rejectPromiseDecorator(y.GET_REMOTE_CONFIG,e)}))),n.promise}},{key:"clipboardWrite",value:function(e){var t=this,r=this._getPromiseDecorator(y.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(y.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((function(){t._resolvePromiseDecorator(y.CLIPBOARD_WRITE,!0)})).catch((function(e){t._rejectPromiseDecorator(y.CLIPBOARD_WRITE,e)}))),r.promise}}])&&Nn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),h}(mn);function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){to=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==eo(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ro(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function no(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ro(i,n,o,a,s,"next",e)}function s(e){ro(i,n,o,a,s,"throw",e)}a(void 0)}))}}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function io(e){for(var t=1;t120?this._rejectPromiseDecorator(y.INVITE_FRIENDS,A):this._platformSdk.UI.showInvite(t)),r.promise}},{key:"rate",value:function(){var e=this._getPromiseDecorator(y.RATE);return e||(e=this._createPromiseDecorator(y.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}},{key:"createPost",value:function(e){if(!e||null==e||!e.media)return Promise.reject();var t,r=this._getPromiseDecorator(y.CREATE_POST);return r||(r=this._createPromiseDecorator(y.CREATE_POST),this._platformSdk.UI.postMediatopic(e,null!==(t=e.status)&&void 0!==t&&t)),r.promise}},{key:"joinCommunity",value:function(e){if(!e||null==e||!e.groupId)return Promise.reject();var t,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,null!==(t=e.enableMessages)&&void 0!==t&&t)),r.promise}}])&&ai(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function ca(){ca=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==sa(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ua(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function la(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){e.next=5;break}return e.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=e.sent;case 5:return e.abrupt("return",Ae(t,this._platformStorageCachedData,r));case 6:case"end":return e.stop()}}),e,this)})),wa=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ua(i,n,o,a,s,"next",e)}function s(e){ua(i,n,o,a,s,"throw",e)}a(void 0)}))},wa.apply(this,arguments)}const Aa=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ya(e,t)}(l,t);var r,n,o,s,c=(o=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=va(o);if(s){var r=va(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ma(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,is)),{},{playerid:t.playerid,playername:t.playername,lastupdated:t.lastupdated,date:t.date,rdate:t.rdate})}))):n(new Error(e.errorcode))}))}))}},{key:"showAchievementsNativePopup",value:function(e){return this._platformSdk.GameAPI.Achievements.list(e),Promise.resolve()}}])&&us(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function ws(e){return ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ws(e)}function As(e,t){for(var r=0;r0&&(e._playerId=o,e._playerName=i,e._playerPhotos.push(a),e._isPlayerAuthorized=!0),e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)}))}))})):this._rejectPromiseDecorator(y.INITIALIZE,E)),t.promise}},{key:"isStorageSupported",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"showInterstitial",value:function(){var e=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){e._setInterstitialState(i.CLOSED)}))}},{key:"showRewarded",value:function(){var e=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(t,r){t?r():e._setRewardedState(a.FAILED)}),(function(t){t?(e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)):e._setRewardedState(a.FAILED)}))}},{key:"leaderboardsSetScore",value:function(e,t){var r=this,n=this._getPromiseDecorator(y.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(y.LEADERBOARDS_SET_SCORE);var o={score:t,board:e};this._platformSdk.Scores.save(o,(function(e){e.success?r._resolvePromiseDecorator(y.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(y.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(e){var t=this;return e.achievement?new Promise((function(r,n){t._platformSdk.Achievements.save(Array.isArray(e.achievement)?e.achievement:[e.achievement],(function(e){e.success?r(e):n(e.errormsg)}))})):Promise.reject()}}])&&As(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Rs(){Rs=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ns(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}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=h;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,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,t.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[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Ls(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];var r=null;return this._preloadedInterstitialPromises[e]=this._platformSdk.getInterstitialAdAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedInterstitialPromises[e]=null,Promise.reject()})),this._preloadedInterstitialPromises[e]}function rc(e){var t=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];var r=null;return this._preloadedRewardedPromises[e]=this._platformSdk.getRewardedVideoAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedRewardedPromises[e]=null,Promise.reject()})),this._preloadedRewardedPromises[e]}function nc(){return oc.apply(this,arguments)}function oc(){var e;return e=Rs().mark((function e(){return Rs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(0),"INVALID_OPERATION"!==(null===e.t0||void 0===e.t0?void 0:e.t0.code)){e.next=13;break}e.next=14;break;case 13:throw new Error(e.t0);case 14:return e.prev=15,e.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!e.sent){e.next=21;break}return e.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:e.next=28;break;case 23:if(e.prev=23,e.t1=e.catch(15),"INVALID_OPERATION"!==(null===e.t1||void 0===e.t1?void 0:e.t1.code)){e.next=27;break}return e.abrupt("return",Promise.resolve());case 27:throw new Error(e.t1);case 28:return e.abrupt("return",Promise.resolve());case 29:case"end":return e.stop()}}),e,this,[[0,8],[15,23]])})),oc=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ls(i,n,o,a,s,"next",e)}function s(e){Ls(i,n,o,a,s,"throw",e)}a(void 0)}))},oc.apply(this,arguments)}const ic=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hs(e,t)}(d,t);var r,n,o,c,p=(o=d,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xs(o);if(c){var r=xs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Fs(e)}(this,e)});function d(){var e,t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var o=arguments.length,i=new Array(o),a=0;a\n \n \n \n \n \n \n \n \n \n \n \n \n',"",{players:r},(function(e){e.showAsync(),t._overlay=e,n.remove(),t._resolvePromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(e,r){n.remove(),t._rejectPromiseDecorator(y.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(e){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return r.promise}},{key:"paymentsPurchase",value:function(e){var t=this,r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Cs({id:e},r);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(e){var t=this,r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var e=this,t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=t.map((function(e){var t=r.find((function(t){return t.productID===e.platformProductId}));return{id:e.id,title:t.title,description:t.description,imageURI:t.imageURI,price:t.price,priceCurrencyCode:t.priceCurrencyCode,priceValue:t.priceAmount}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cs({id:r.find((function(t){return t.id===e.productID})).id},e);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.image||!t.text)return Promise.reject();if(!Pe(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.inviteAsync(t).then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),r.promise}},{key:"joinCommunity",value:function(e){var t=this,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),e&&!0===e.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)}))),r.promise}},{key:"share",value:function(e){var t=this;if(!e.image||!e.text)return Promise.reject();if(!Pe(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.shareAsync(Cs({intent:"REQUEST"},e)).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}],n&&Bs(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),d}(mn);function ac(e){return ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ac(e)}function sc(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent.postMessage(e,t)}},{key:"addListener",value:function(e){window.addEventListener("message",e)}},{key:"removeListener",value:function(e){window.removeEventListener("message",e)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&sc(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType("resource")||[],i=n.length>0?n:["name","initiatorType"],a=o.map((function(e){var t={};return i.forEach((function(r){r in e&&(t[r]=e[r])})),t}));return Ac(this,Gc).send({type:t.PLATFORM,action:Lc,id:e,options:{resources:a}}),Promise.resolve(o)}uc=Hc;const Uc=Hc;function Vc(e){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(e)}function Wc(e,t){for(var r=0;r=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(y.CONSUME_PURCHASE,e)}else this._rejectPromiseDecorator(y.CONSUME_PURCHASE,new Error(e))}function el(e){if(e.success){var t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.data.map((function(e){var r=JSON.parse(e),n=Eu({id:t.find((function(e){return e.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(y.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(y.GET_PURCHASES,new Error(e))}function tl(e){e.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.GET_STORAGE_DATA,new Error(e))}function rl(e){e.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.SET_STORAGE_DATA,new Error(e))}function nl(e){e.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA,new Error(e))}const ol=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Au(e,t)}(s,t);var r,n,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ku(o);if(i){var r=ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Su(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ou(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function ul(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function ll(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ul(i,n,o,a,s,"next",e)}function s(e){ul(i,n,o,a,s,"throw",e)}a(void 0)}))}}function fl(e,t){for(var r=0;rr.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")===r.length-4?parseInt(r.replace(/,/,""),10):r.includes(",")&&-1!==r.lastIndexOf(",")&&r.lastIndexOf(",")!==r.length-3?parseFloat(r.replace(",",".")):r.includes(".")&&-1!==r.lastIndexOf(".")&&r.lastIndexOf(".")===r.length-4?parseInt(r.replace(/\./,""),10):r.includes(".")?parseFloat(r):parseInt(r,10),a=null===(t=o.price)||void 0===t||null===(t=t.currency)||void 0===t?void 0:t.toUpperCase(),s="".concat(i," ").concat(a);return{id:e.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));e._resolvePromiseDecorator(y.GET_CATALOG,o)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.entitlements.map((function(e){return Bl({id:r.find((function(t){return t.id===e.id})).id},e)})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:"inviteFriends",value:function(){var e=this,t=this._getPromiseDecorator(y.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),t.promise}},{key:"share",value:function(e){var t=this;if(!e.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:e.mediaUrl}).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}])&&Ml(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(mn);function zl(e){return zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zl(e)}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t2?t.slice(0,2):t,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(r,tf(r,n,"set"),o)}));e._platformStorageCachedData={};var r=e._platformSdk.game.loadData().then((function(t){"string"==typeof t&&""!==t&&(e._platformStorageCachedData=JSON.parse(t))}));e._platformSdk.system.onAudioEnabledChange((function(t){e._setAudioState(t)})),e._platformSdk.system.onPause((function(){e._setPauseState(!0)})),e._platformSdk.system.onResume((function(){e._setPauseState(!1)})),Promise.all([t,r]).finally((function(){e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE),e._platformSdk.game.firstFrameReady()}))}))}))),t.promise}},{key:"isStorageSupported",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageSupported",this).call(this,e)}},{key:"isStorageAvailable",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),"isStorageAvailable",this).call(this,e)}},{key:"getDataFromStorage",value:function(e,t,r){var n=this;return t===u.PLATFORM_INTERNAL?new Promise((function(t,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(e)){for(var i=[],a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,af);e.playerId=r||null,e.playerName=n||null,o&&e.playerPhotos.push(o),e.playerExtra=i,e._isPlayerAuthorized=!0}e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)},window.onBannerReady=function(){e._isBannerAvailable=!0},Se("https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js",this._options.adTestMode?{"data-jg-test-environment":"on"}:{}).catch((function(t){e._rejectPromiseDecorator(y.INITIALIZE,JSON.stringify(t))}))),t.promise}},{key:"preloadInterstitial",value:function(){hf(this,yf,vf).call(this)}},{key:"showInterstitial",value:function(){var e=this;hf(this,yf,vf).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Interstitial,{onAdClosed:function(){e._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setInterstitialState(i.FAILED)}}),e._setInterstitialState(i.OPENED),e._preloadInterstitialPromise=null}))}},{key:"preloadRewarded",value:function(){hf(this,mf,_f).call(this)}},{key:"showRewarded",value:function(){var e=this;hf(this,mf,_f).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Rewarded,{onAdClosed:function(t){t&&e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setRewardedState(a.FAILED)}}),e._setRewardedState(a.OPENED),e._preloadRewardedPromise=null}))}},{key:"showBanner",value:function(e){var t,r=this;this._isBannerAvailable?null===(t=window.JGBanner)||void 0===t||t.loadBanner().then((function(){var t,n;r._setBannerState(s.SHOWN),null===(t=window.JGBanner)||void 0===t||t.showBanner(e||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(e){console.error(e),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:"hideBanner",value:function(){var e;null===(e=window.JGBanner)||void 0===e||e.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:"leaderboardsSetScore",value:function(e,t,r){if(!r)return Promise.reject();var n="string"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(n),Promise.resolve()}}])&&sf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function Sf(e){return Sf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sf(e)}function bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Rf(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Lf(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Rf(i,n,o,a,s,"next",e)}function s(e){Rf(i,n,o,a,s,"throw",e)}a(void 0)}))}}function jf(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};window.parent.postMessage({type:e,data:t},"*")}function Qf(e){this._isPlayerAuthorized=e.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=e.playerId,this._playerName=e.playerName,e.playerPhoto&&this._playerPhotos.push(e.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(y.INITIALIZE)}function $f(e){var t,r;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,null!==(r=e.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(y.GET_STORAGE_DATA)}function ep(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA):this._rejectPromiseDecorator(y.SET_STORAGE_DATA)}function tp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA)}function rp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.PURCHASE,e.data):this._rejectPromiseDecorator(y.PURCHASE,e.data)}function np(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_CATALOG,e.data):this._rejectPromiseDecorator(y.GET_CATALOG,e.data)}function op(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_PURCHASES,e.data):this._rejectPromiseDecorator(y.GET_PURCHASES,e.data)}function ip(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.CREATE_POST):this._rejectPromiseDecorator(y.CREATE_POST)}function ap(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.JOIN_COMMUNITY):this._rejectPromiseDecorator(y.JOIN_COMMUNITY)}const sp=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gf(e,t)}(l,t);var r,n,o,i,a,s,c=(a=l,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mf(a);if(s){var r=Mf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Df(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bf(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this._getPromiseDecorator(y.CREATE_POST);return t||(t=this._createPromiseDecorator(y.CREATE_POST),Ff(this,xf,Xf).call(this,y.CREATE_POST,{options:e})),t.promise}},{key:"joinCommunity",value:function(){var e=this._getPromiseDecorator(y.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(y.JOIN_COMMUNITY),Ff(this,xf,Xf).call(this,y.JOIN_COMMUNITY)),e.promise}}],n&&jf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(mn);function cp(e){return cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cp(e)}function up(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lp(e){for(var t=1;t resolve()) } })