diff --git a/dist/playgama-bridge.js b/dist/playgama-bridge.js index dbcbca0..1db36d2 100644 --- a/dist/playgama-bridge.js +++ b/dist/playgama-bridge.js @@ -1 +1 @@ -(()=>{var t={258:t=>{!function(e){t.exports=e;var r="listeners",n={on:function(t,e){return a(this,t).push(e),this},once:function(t,e){var r=this;return n.originalListener=e,a(r,t).push(n),r;function n(){i.call(r,t,n),e.apply(this,arguments)}},off:i,emit:function(t,e){var r=this,n=a(r,t,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(t){t.call(r)}));else if(2===o)n.forEach((function(t){t.call(r,e)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(t){t.apply(r,i)}))}return!!n.length}};function o(t){for(var e in n)t[e]=n[e];return t}function i(t,e){var n,o=this;if(arguments.length){if(e){if(n=a(o,t,!0)){if(!(n=n.filter((function(t){return t!==e&&t.originalListener!==e}))).length)return i.call(o,t);o[r][t]=n}}else if((n=o[r])&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(t,e,n){if(!n||t[r]){var o=t[r]||(t[r]={});return o[e]||(o[e]=[])}}o(e.prototype),e.mixin=o}((function t(){if(!(this instanceof t))return new t}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t={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",XIAOMI:"xiaomi"},e={CORE:"core",PLATFORM:"platform",PLAYER:"player",GAME:"game",STORAGE:"storage",ADVERTISEMENT:"advertisement",SOCIAL:"social",DEVICE:"device",LEADERBOARDS:"leaderboards",PAYMENTS:"payments",REMOTE_CONFIG:"remote_config",CLIPBOARD:"clipboard",ACHIEVEMENTS:"achievements",ANALYTICS:"analytics"},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",ORIENTATION_STATE_CHANGED:"orientation_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={PORTRAIT:"portrait",LANDSCAPE:"landscape"},p="bridge-orientation-overlay",h={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"},d="not_available",y="in_game",m="native",v="native_popup",_={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"},g={SDK_NOT_INITIALIZED:{message:"Before using the SDK you must initialize it"},STORAGE_NOT_SUPPORTED:{message:"Storage not supported"},STORAGE_NOT_AVAILABLE:{message:"Storage not available"},GAME_PARAMS_NOT_FOUND:{message:"Game params are not found"},INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:{message:"Message is too long"}};function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function b(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=t;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t){var a=document.createElement("script");a.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",a.setAttribute("data-ad-client",e),r?a.setAttribute("data-ad-channel",r):n&&a.setAttribute("data-ad-host",n),o&&a.setAttribute("data-admob-interstitial-slot",o),i&&a.setAttribute("data-admob-rewarded-slot",i),u&&a.setAttribute("data-adbreak-test","on"),a.setAttribute("data-ad-frequency-hint",s),a.setAttribute("crossorigin","anonymous"),a.addEventListener("load",(function(){window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push(U({preloadAdBreaks:"on",sound:"on",onReady:function(){}},l)),t((function(t){return window.adsbygoogle.push(t)}))})),document.head.appendChild(a)}))};function Y(t){var e=document.createElement("div");return e.id=c,e.style.position="absolute",document.body.appendChild(e),"top"===t?(e.style.top="0px",e.style.height="90px",e.style.width="100%"):(e.style.bottom="0px",e.style.height="90px",e.style.width="100%"),e}var Z=function(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(t))return t.reduce((function(t,n,o){if(t[o]=K(e,n),r)try{t[o]=JSON.parse(t[o])}catch(t){}return t}),new Array(t.length));var n=K(e,t);if(r&&"string"==typeof n)try{n=JSON.parse(n)}catch(t){}return n}function X(t,e){for(var r=U({},t),n=Object.keys(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent[V](t,e)}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};return{event_name:t,module:e,bridge_version:B.i8,platform_id:this._platformBridge.platformId,game_id:ft(this,_t),player_id:this._platformBridge.playerId,player_guest_id:ft(this,gt),session_id:ft(this,St),timestamp:(new Date).toISOString(),data:r}}function jt(){var e,r=this;if(0!==ft(this,yt).length){var n=function(t){if(Array.isArray(t))return rt(t)}(e=ft(this,yt))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();ht(this,yt,[]),ht(this,mt,null);var o="https://playgama.com/api/events/v2/bridge/analytics";this._platformBridge.platformId===t.DISCORD&&(o="/playgama/api/events/v2/bridge/analytics"),fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:n})}).then((function(t){if(!t.ok)throw new Error("Network response was not ok: ".concat(t.status));ht(r,bt,0)})).catch((function(){ht(r,bt,ft(r,bt)+1),ft(r,bt)>=2&&pt(r,Ot,Nt).call(r)}))}}function Nt(){ht(this,Et,!0),ht(this,yt,[]),ft(this,mt)&&(clearTimeout(ft(this,mt)),ht(this,mt,null)),ft(this,vt)&&(clearInterval(ft(this,vt)),ht(this,vt,null))}function Ct(){var e,r=this._platformBridge.options;switch(this._platformBridge.platformId){case t.GAME_DISTRIBUTION:case t.Y8:e=r.gameId;break;case t.HUAWEI:e=r.appId;break;case t.MSN:e=r.gameId;break;case t.DISCORD:e=r.appId;break;case t.GAMEPUSH:e=r.projectId;break;default:e=null}return e||(e=pt(this,kt,Gt).call(this,window.location.href)),e}function Gt(e){try{var r=new URL(e).pathname.split("/").filter(Boolean);switch(this._platformBridge.platformId){case t.YANDEX:var n=r.indexOf("app"),o=-1!==n?r[n+1]:null;if(o)return o;break;case t.LAGGED:var i=r.indexOf("g"),a=-1!==i?r[i+1]:null;if(a)return pt(this,Dt,xt).call(this,a);break;case t.CRAZY_GAMES:var s=r.indexOf("game"),c=-1!==s?r[s+1]:null;if(c)return pt(this,Dt,xt).call(this,c);break;case t.PLAYGAMA:var u=r.indexOf("game"),l=-1!==u?r[u+1]:null;if(l)return pt(this,Dt,xt).call(this,l);var f=r[0];if("string"==typeof f&&/^[a-z0-9]{10,}$/i.test(f))return f}}catch(t){return null}return null}function xt(t){return"string"!=typeof t||0===t.length?"":t.replace(/-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}function Bt(){var t=this;ft(this,vt)||ht(this,vt,setInterval((function(){t.send("".concat(e.CORE,"_ping"),e.CORE)}),15e3))}const Mt=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&it(t,e)}(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(t){return!1}}(),function(){var t,e=st(o);if(i){var r=st(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return at(t)}(this,t)});function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),ct(at(t=a.call(this)),It),ct(at(t),Dt),ct(at(t),kt),ct(at(t),Tt),ct(at(t),Ot),ct(at(t),At),ct(at(t),Pt),ct(at(t),wt),ut(at(t),yt,{writable:!0,value:[]}),ut(at(t),mt,{writable:!0,value:null}),ut(at(t),vt,{writable:!0,value:null}),ut(at(t),_t,{writable:!0,value:null}),ut(at(t),gt,{writable:!0,value:null}),ut(at(t),St,{writable:!0,value:null}),ut(at(t),bt,{writable:!0,value:0}),ut(at(t),Et,{writable:!0,value:!1}),ht(at(t),St,pt(at(t),wt,Rt).call(at(t))),t}return r=s,n=[{key:"initialize",value:function(t){var r;this._platformBridge=t,!1===(null===(r=this._platformBridge.options)||void 0===r?void 0:r.sendAnalyticsEvents)&&ht(this,Et,!0);var n=window.location.href;(n.startsWith("file://")||n.includes("localhost")||n.includes("127.0.0.1"))&&ht(this,Et,!0),ht(this,_t,pt(this,Tt,Ct).call(this)),ht(this,gt,$().id);var o=pt(this,Pt,Lt).call(this,"".concat(e.CORE,"_initialization_started"),e.CORE);return ft(this,yt).push(o),pt(this,It,Bt).call(this),this}},{key:"send",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!ft(this,Et)){var o=pt(this,Pt,Lt).call(this,t,e,n);ft(this,yt).push(o),ft(this,mt)&&clearTimeout(ft(this,mt)),ht(this,mt,setTimeout((function(){pt(r,At,jt).call(r)}),3e3))}}}],n&&nt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(x));function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function Ft(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||e&&null!==this._currentLoadingProgress)){var r=document.getElementById("fillRect"),n=document.getElementById("gradientMover"),o=document.getElementById("logo"),i=document.getElementById("loading-overlay");if(r&&n&&o&&i){this._currentLoadingProgress=t;var a=Math.max(0,Math.min(100,t)),s=100-a;r.style.transform="translateY(".concat(s,"%)"),100===a?(this._loadingProcessCompleted=!0,setTimeout((function(){r.style.display="none",n.style.display="block",n.classList.add("gradient-mover")}),400),setTimeout((function(){return o.classList.add("logo-fade-out")}),900),setTimeout((function(){return i.remove()}),1400)):n.classList.remove("gradient-mover")}}}}],o&&ae(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(x);L().mixin(pe.prototype);const he=pe;function de(t){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(t)}function ye(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(e){var n=e[this._platformBridge.platformId];if(n)return this.get(t,n,r)}var o=e;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?Array.isArray(t)&&0===t.length?Promise.resolve([]):this._platformBridge.getDataFromStorage(t,o,r):Promise.reject()}},{key:"set",value:function(t,e,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(t,e,n)}var o=r;if(o||(o=this.defaultType),!this._platformBridge.isStorageAvailable(o))return Promise.reject();if(Array.isArray(t)){if(!Array.isArray(e))return Promise.reject(new Error("Value must be an array when key is an array"));if(t.length!==e.length)return Promise.reject(new Error("Key and value arrays must have the same length"));if(0===t.length)return Promise.resolve()}return this._platformBridge.setDataToStorage(t,e,o)}},{key:"delete",value:function(t,e){if(e){var r=e[this._platformBridge.platformId];if(r)return this.delete(t,r)}var n=e;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?Array.isArray(t)&&0===t.length?Promise.resolve():this._platformBridge.deleteDataFromStorage(t,n):Promise.reject()}}],r&&ye(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(x);function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function be(t,e){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){qe(this,er,e);var n,o=r;if(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),qe(this,rr,o),Xe(this,yr,Or).call(this,s.LOADING),this.isBannerSupported){var i=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.banner)||void 0===t?void 0:t.placements,a=Xe(this,_r,Dr).call(this,o,i);this._platformBridge.showBanner(e,a)}else Xe(this,yr,Or).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 t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=e;n&&"string"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,i=Xe(this,_r,Dr).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!Xe(this,dr,Ar).call(this)){var r,n=e;if(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),qe(this,or,n),Xe(this,mr,Tr).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&Qe(this,ir)&&Qe(this,ir).state===Ie)Xe(this,mr,Tr).call(this,i.FAILED);else{var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,a=Xe(this,_r,Dr).call(this,n,o);this._platformBridge.showInterstitial(a)}else Xe(this,mr,Tr).call(this,i.FAILED)}}},{key:"preloadRewarded",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=e;n&&"string"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,i=Xe(this,_r,Dr).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!Xe(this,dr,Ar).call(this)){var r;qe(this,cr,e),Qe(this,cr)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&qe(this,cr,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,o=Xe(this,_r,Dr).call(this,Qe(this,cr),n);Xe(this,vr,kr).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):Xe(this,vr,kr).call(this,a.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],r&&Ue(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(x);function Sr(t){qe(this,ar,t),Qe(this,ir)&&(Qe(this,ir).stop(),Xe(this,hr,Pr).call(this))}function br(t){if("number"==typeof t)return t;if("string"==typeof t){var e=parseInt(t,10);return Number.isNaN(e)?null:e}return null}function Er(){var t=Xe(this,pr,wr).call(this);if(void 0!==t){var e=Xe(this,lr,br).call(this,t);null!==e&&Xe(this,ur,Sr).call(this,e)}}function wr(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.minimumDelayBetweenInterstitial}function Pr(){Qe(this,ar)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(qe(this,ir,new He(Qe(this,ar))),Qe(this,ir).start())}function Ar(){var t=[i.LOADING,i.OPENED].includes(Qe(this,nr)),e=[a.LOADING,a.OPENED,a.REWARDED].includes(Qe(this,sr));return t||e}function Or(t){Qe(this,tr)!==t&&(qe(this,tr,t),Mt.send("".concat(e.ADVERTISEMENT,"_banner_").concat(t),e.ADVERTISEMENT,{position:Qe(this,er),placement:Qe(this,rr)}),this.emit(n.BANNER_STATE_CHANGED,Qe(this,tr)))}function Tr(t){Qe(this,nr)!==t&&(qe(this,nr,t),Mt.send("".concat(e.ADVERTISEMENT,"_interstitial_").concat(t),e.ADVERTISEMENT,{placement:Qe(this,or)}),this.emit(n.INTERSTITIAL_STATE_CHANGED,Qe(this,nr)))}function kr(t){Qe(this,sr)!==t&&(qe(this,sr,t),Mt.send("".concat(e.ADVERTISEMENT,"_rewarded_").concat(t),e.ADVERTISEMENT,{placement:Qe(this,cr)}),this.emit(n.REWARDED_STATE_CHANGED,Qe(this,sr)))}function Dr(t,e){if(!t)return t;if(!e)return t;var r=e.find((function(e){return e.id===t}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:t}L().mixin(gr.prototype);const Ir=gr;function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Lr(t,e){for(var r=0;rwindow.innerWidth?f.PORTRAIT:f.LANDSCAPE}function ln(){var t=Zr(this,en,un).call(this);t!==Jr(this,qr)&&(Yr(this,qr,t),this.emit(n.ORIENTATION_STATE_CHANGED,Jr(this,qr)),Zr(this,nn,fn).call(this))}function fn(){if(Jr(this,$r))if(1===Jr(this,Qr).length){var t=Jr(this,Qr)[0];Jr(this,qr)!==t?Zr(this,on,pn).call(this):Zr(this,an,hn).call(this)}else Zr(this,an,hn).call(this)}function pn(){Jr(this,Xr)||(Yr(this,Xr,function(){if(!document.getElementById("bridge-orientation-overlay-styles")){var t=document.createElement("style");t.id="bridge-orientation-overlay-styles",t.textContent="\n #".concat(p," {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.95);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n z-index: 9999999;\n }\n\n #bridge-orientation-icon {\n width: 80px;\n height: 80px;\n animation: bridge-rotate-phone 1.5s ease-in-out infinite;\n }\n\n #bridge-orientation-message {\n color: #fff;\n font-size: 18px;\n font-family: Arial, sans-serif;\n margin-top: 20px;\n text-align: center;\n }\n\n @keyframes bridge-rotate-phone {\n 0%, 100% { transform: rotate(0deg); }\n 50% { transform: rotate(90deg); }\n }\n "),document.head.appendChild(t)}var e=document.createElement("div");e.id=p;var r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("id","bridge-orientation-icon"),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("fill","none"),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.innerHTML='\n \n \n ';var n=document.createElement("div");return n.id="bridge-orientation-message",n.innerText="Please rotate your device",e.appendChild(r),e.appendChild(n),e}()),document.body.appendChild(Jr(this,Xr)))}function hn(){Jr(this,Xr)&&(Jr(this,Xr).remove(),Yr(this,Xr,null))}L().mixin(sn.prototype);const dn=sn;function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function mn(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function On(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Tn(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Mn(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Hn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Mn(i,n,o,a,s,"next",t)}function s(t){Mn(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Fn(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"result",i=this._getPromiseDecorator(t);return i||(i=this._createPromiseDecorator(t),this._platformSdk.send(e,n).then((function(e){e[o]?r._resolvePromiseDecorator(t):r._rejectPromiseDecorator(t)})).catch((function(e){r._rejectPromiseDecorator(t,e)}))),i.promise}const ri=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zo(t,e)}(p,e);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(t){return!1}}(),function(){var t,e=Zo(o);if(c){var r=Zo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Uo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Yo(t)}(this,t)});function p(){var t,e,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?t.entries.map((function(t){return{id:t.player.uniqueID,name:t.player.publicName,score:t.score,rank:t.rank,photo:t.player.getAvatarSrc("large")}})):[],e._resolvePromiseDecorator(_.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(t){e._rejectPromiseDecorator(_.LEADERBOARDS_GET_ENTRIES,t)}))}return r.promise}},{key:"paymentsPurchase",value:function(t){var e=this;if(!mi(this,Si))return Promise.reject();var r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(_.PURCHASE);return n||(n=this._createPromiseDecorator(_.PURCHASE),mi(this,Si).purchase(r).then((function(r){var n=ii({id:t},r.purchaseData);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(_.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(_.PURCHASE,t)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(t){var e=this;if(!mi(this,Si))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(_.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(_.CONSUME_PURCHASE),mi(this,Si).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(_.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(_.CONSUME_PURCHASE,t)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var t=this;if(!mi(this,Si))return Promise.reject();var e=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(_.GET_CATALOG);return r||(r=this._createPromiseDecorator(_.GET_CATALOG),mi(this,Si).getCatalog().then((function(r){var n=e.map((function(t){var e,n=r.find((function(e){return e.id===t.id}));return{id:t.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(e=n.getPriceCurrencyImage)||void 0===e?void 0:e.call(n,"medium")}}));t._resolvePromiseDecorator(_.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var t=this;if(!mi(this,Si))return Promise.reject();var e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),mi(this,Si).getPurchases().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=ii({id:r.find((function(e){return e.id===t.productID})).id},t.purchaseData);return delete e.productID,e})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.GET_PURCHASES,e)}))),e.promise}},{key:"getRemoteConfig",value:function(t){var e=this;if(!this._platformSdk)return Promise.reject();var r=t;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(_.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(_.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(t){e._resolvePromiseDecorator(_.GET_REMOTE_CONFIG,t)})).catch((function(t){e._rejectPromiseDecorator(_.GET_REMOTE_CONFIG,t)}))),n.promise}},{key:"clipboardWrite",value:function(t){var e=this,r=this._getPromiseDecorator(_.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(_.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(t).then((function(){e._resolvePromiseDecorator(_.CLIPBOARD_WRITE,!0)})).catch((function(t){e._rejectPromiseDecorator(_.CLIPBOARD_WRITE,t)}))),r.promise}}])&&ai(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),p}(Fo);function Ai(t){return Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(t)}function Oi(){Oi=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function _(){}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 w=g.prototype=v.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ai(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(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=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ti(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function ki(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ti(i,n,o,a,s,"next",t)}function s(t){Ti(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Di(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ii(t){for(var e=1;e120?this._rejectPromiseDecorator(_.INVITE_FRIENDS,g.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(e)),r.promise}},{key:"rate",value:function(){var t=this._getPromiseDecorator(_.RATE);return t||(t=this._createPromiseDecorator(_.RATE),this._platformSdk.UI.showRatingDialog()),t.promise}},{key:"createPost",value:function(t){if(!t||null==t||!t.media)return Promise.reject();var e,r=this._getPromiseDecorator(_.CREATE_POST);return r||(r=this._createPromiseDecorator(_.CREATE_POST),this._platformSdk.UI.postMediatopic(t,null!==(e=t.status)&&void 0!==e&&e)),r.promise}},{key:"joinCommunity",value:function(t){if(!t||null==t||!t.groupId)return Promise.reject();var e,r=this._getPromiseDecorator(_.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(_.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(t.groupId,null!==(e=t.enableMessages)&&void 0!==e&&e)),r.promise}}])&&Ra(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(Fo);function Ls(t){return Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ls(t)}function js(){js=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function _(){}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 w=g.prototype=v.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ls(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(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=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ns(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Cs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gs(t){for(var e=1;e1&&void 0!==n[1])||n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt("return",q(e,this._platformStorageCachedData,r));case 6:case"end":return t.stop()}}),t,this)})),Ks=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ns(i,n,o,a,s,"next",t)}function s(t){Ns(i,n,o,a,s,"throw",t)}a(void 0)}))},Ks.apply(this,arguments)}const qs=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hs(t,e)}(l,e);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(t){return!1}}(),function(){var t,e=Us(o);if(s){var r=Us(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ls(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fs(t)}(this,t)});function l(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);for(var e=arguments.length,r=new Array(e),n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,Ic)),{},{playerid:e.playerid,playername:e.playername,lastupdated:e.lastupdated,date:e.date,rdate:e.rdate})}))):n(new Error(t.errorcode))}))}))}},{key:"showAchievementsNativePopup",value:function(t){return this._platformSdk.GameAPI.Achievements.list(t),Promise.resolve()}}])&&Nc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(Fo);function Kc(t){return Kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(t)}function qc(t,e){for(var r=0;r0&&(t._playerId=o,t._playerName=i,t._playerPhotos.push(a),t._isPlayerAuthorized=!0),t._isInitialized=!0,t._resolvePromiseDecorator(_.INITIALIZE)}))}))})):this._rejectPromiseDecorator(_.INITIALIZE,g.GAME_PARAMS_NOT_FOUND)),e.promise}},{key:"isStorageSupported",value:function(t){return t!==u.PLATFORM_INTERNAL&&Qc(tu(l.prototype),"isStorageSupported",this).call(this,t)}},{key:"isStorageAvailable",value:function(t){return t!==u.PLATFORM_INTERNAL&&Qc(tu(l.prototype),"isStorageAvailable",this).call(this,t)}},{key:"showInterstitial",value:function(){var t=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){t._setInterstitialState(i.CLOSED)}))}},{key:"showRewarded",value:function(){var t=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(e,r){e?r():t._setRewardedState(a.FAILED)}),(function(e){e?(t._setRewardedState(a.REWARDED),t._setRewardedState(a.CLOSED)):t._setRewardedState(a.FAILED)}))}},{key:"leaderboardsSetScore",value:function(t,e){var r=this,n=this._getPromiseDecorator(_.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(_.LEADERBOARDS_SET_SCORE);var o={score:e,board:t};this._platformSdk.Scores.save(o,(function(t){t.success?r._resolvePromiseDecorator(_.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(_.LEADERBOARDS_SET_SCORE,t.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(t){var e=this;return t.achievement?new Promise((function(r,n){e._platformSdk.Achievements.save(Array.isArray(t.achievement)?t.achievement:[t.achievement],(function(t){t.success?r(t):n(t.errormsg)}))})):Promise.reject()}}])&&qc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(Fo);function ru(){ru=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function _(){}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 w=g.prototype=v.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==au(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(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=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function nu(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function ou(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function iu(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[t])return this._preloadedInterstitialPromises[t];var r=null;return this._preloadedInterstitialPromises[t]=this._platformSdk.getInterstitialAdAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedInterstitialPromises[t]=null,Promise.reject()})),this._preloadedInterstitialPromises[t]}function Tu(t){var e=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[t])return this._preloadedRewardedPromises[t];var r=null;return this._preloadedRewardedPromises[t]=this._platformSdk.getRewardedVideoAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedRewardedPromises[t]=null,Promise.reject()})),this._preloadedRewardedPromises[t]}function ku(){return Du.apply(this,arguments)}function Du(){var t;return t=ru().mark((function t(){return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!t.sent){t.next=6;break}return t.abrupt("return",Promise.resolve());case 6:t.next=14;break;case 8:if(t.prev=8,t.t0=t.catch(0),"INVALID_OPERATION"!==(null===t.t0||void 0===t.t0?void 0:t.t0.code)){t.next=13;break}t.next=14;break;case 13:throw new Error(t.t0);case 14:return t.prev=15,t.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!t.sent){t.next=21;break}return t.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:t.next=28;break;case 23:if(t.prev=23,t.t1=t.catch(15),"INVALID_OPERATION"!==(null===t.t1||void 0===t.t1?void 0:t.t1.code)){t.next=27;break}return t.abrupt("return",Promise.resolve());case 27:throw new Error(t.t1);case 28:return t.abrupt("return",Promise.resolve());case 29:case"end":return t.stop()}}),t,this,[[0,8],[15,23]])})),Du=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){nu(i,n,o,a,s,"next",t)}function s(t){nu(i,n,o,a,s,"throw",t)}a(void 0)}))},Du.apply(this,arguments)}const Iu=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lu(t,e)}(p,e);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(t){return!1}}(),function(){var t,e=pu(o);if(c){var r=pu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===au(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fu(t)}(this,t)});function p(){var t,e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p);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(t){t.showAsync(),e._overlay=t,n.remove(),e._resolvePromiseDecorator(_.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(t,r){n.remove(),e._rejectPromiseDecorator(_.LEADERBOARDS_SHOW_NATIVE_POPUP,r)})).iframeElement;o.style.zIndex=9999,o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.height="100vh",o.style.width="100vw",o.style.border=0,o.id=o.name,document.body.appendChild(o)})).catch((function(t){n.remove(),e._rejectPromiseDecorator(_.LEADERBOARDS_SHOW_NATIVE_POPUP,t)}))}return r.promise}},{key:"paymentsPurchase",value:function(t){var e=this,r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(_.PURCHASE);return n||(n=this._createPromiseDecorator(_.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=iu({id:t},r);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(_.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(_.PURCHASE,t)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(t){var e=this,r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(_.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(_.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(_.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(_.CONSUME_PURCHASE,t)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var t=this,e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();var r=this._getPromiseDecorator(_.GET_CATALOG);return r||(r=this._createPromiseDecorator(_.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=e.map((function(t){var e=r.find((function(e){return e.productID===t.platformProductId}));return{id:t.id,title:e.title,description:e.description,imageURI:e.imageURI,price:e.price,priceCurrencyCode:e.priceCurrencyCode,priceValue:e.priceAmount}}));t._resolvePromiseDecorator(_.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var t=this,e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=iu({id:r.find((function(e){return e.id===t.productID})).id},t);return delete e.productID,e})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.GET_PURCHASES,e)}))),e.promise}},{key:"inviteFriends",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.image||!e.text)return Promise.reject();if(!J(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(_.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(_.INVITE_FRIENDS),this._platformSdk.inviteAsync(e).then((function(){t._resolvePromiseDecorator(_.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(_.INVITE_FRIENDS,e)}))),r.promise}},{key:"joinCommunity",value:function(t){var e=this,r=this._getPromiseDecorator(_.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(_.JOIN_COMMUNITY),t&&!0===t.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(t){return e._resolvePromiseDecorator(_.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(_.JOIN_COMMUNITY,t)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(t){return e._resolvePromiseDecorator(_.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(_.JOIN_COMMUNITY,t)}))),r.promise}},{key:"share",value:function(t){var e=this;if(!t.image||!t.text)return Promise.reject();if(!J(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(_.SHARE);return r||(r=this._createPromiseDecorator(_.SHARE),this._platformSdk.shareAsync(iu({intent:"REQUEST"},t)).then((function(){e._resolvePromiseDecorator(_.SHARE)})).catch((function(t){e._rejectPromiseDecorator(_.SHARE,t)}))),r.promise}}],n&&cu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),p}(Fo);function Ru(t){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(t)}function Lu(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*")}},{key:"addListener",value:function(t){window.addEventListener("message",t)}},{key:"removeListener",value:function(t){window.removeEventListener("message",t)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&Lu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Gu(){Gu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function _(){}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 w=g.prototype=v.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Fu(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(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=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function xu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType("resource")||[],i=n.length>0?n:["name","initiatorType"],a=o.map((function(t){var e={};return i.forEach((function(r){r in t&&(e[r]=t[r])})),e}));return Qu(this,fl,El).call(this,{type:e.PLATFORM,action:rl.GET_PERFORMANCE_RESOURCES,id:t,options:{resources:a}}),Promise.resolve(o)}function El(t){Xu(this,al).send(Hu({source:tl},t))}function wl(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Xu(this,al).generateMessageId(),a=Hu({timeout:0},o);return new Promise((function(s,c){var u=function n(o){var a=o.data;(null==a?void 0:a.type)===t&&(null==a?void 0:a.action)===e&&(null==a?void 0:a.id)===i&&(null==a?void 0:a.source)!==tl&&(Xu(r,al).removeListener(n),s(a))};Xu(r,al).addListener(u),Qu(r,fl,El).call(r,Hu({type:t,action:e,id:i,options:o},n)),a.timeout>0&&setTimeout((function(){c(new Error("Request timeout")),Xu(r,al).removeListener(u)}),a.timeout)}))}function Pl(){return Al.apply(this,arguments)}function Al(){var t;return t=Gu().mark((function t(){var r=this;return Gu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Qu(this,pl,wl).call(this,e.PLAYER,rl.GET_PLAYER).then((function(t){var e,n=t.player;null!=n&&n.isAuthorized?(r._playerId=n.userId,r._isPlayerAuthorized=n.isAuthorized,r._playerName=n.name,Array.isArray(n.photos)&&(r._playerPhotos=function(t){if(Array.isArray(t))return xu(t)}(e=n.photos)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return xu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xu(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r._playerExtra=n,Qu(r,ml,kl).call(r)):r._playerApplyGuestData()})).catch((function(){r._playerApplyGuestData()})));case 1:case"end":return t.stop()}}),t,this)})),Al=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Bu(i,n,o,a,s,"next",t)}function s(t){Bu(i,n,o,a,s,"throw",t)}a(void 0)}))},Al.apply(this,arguments)}function Ol(t){var e=t.action,r=t.payload;if("interstitial"===e){if(!this.isInterstitialSupported)return;switch(r.status){case"start":this._setInterstitialState(i.LOADING);break;case"open":this._setInterstitialState(i.OPENED);break;case"failed":this._setInterstitialState(i.FAILED);break;case"close":this._setInterstitialState(i.CLOSED)}}else if("reward"===e){if(!this.isRewardedSupported)return;switch(r.status){case"start":this._setRewardedState(a.LOADING);break;case"open":this._setRewardedState(a.OPENED);break;case"rewarded":this._setRewardedState(a.REWARDED);break;case"close":this._setRewardedState(a.CLOSED);break;case"failed":this._setRewardedState(a.FAILED)}}}function Tl(){return this._internalStoragePolicy===el.AUTHORIZED_ONLY&&this._isPlayerAuthorized||this._internalStoragePolicy===el.ALWAYS}function kl(){Qu(this,yl,Tl).call(this)?this._defaultStorageType=u.PLATFORM_INTERNAL:this._defaultStorageType=u.LOCAL_STORAGE}Nu=vl;const Dl=vl;function Il(t){return Il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Il(t)}function Rl(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ml(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Hl(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ml(i,n,o,a,s,"next",t)}function s(t){Ml(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Fl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ul(t){for(var e=1;e1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt("return",q(e,this._platformStorageCachedData,r));case 6:case"end":return t.stop()}}),t,this)}))),hf.apply(this,arguments)}const df=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yl(t,e)}(d,e);var r,n,o,c,l,f,p,h=(f=d,p=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(t){return!1}}(),function(){var t,e=Jl(f);if(p){var r=Jl(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===xl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Zl(t)}(this,t)});function d(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d);for(var e=arguments.length,r=new Array(e),n=0;n=0&&this._paymentsPurchases.splice(e,1),this._resolvePromiseDecorator(_.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(_.CONSUME_PURCHASE,new Error(t))}function Kf(t){if(t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=t.data.map((function(t){var r=JSON.parse(t),n=vf({id:e.find((function(t){return t.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(_.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(_.GET_PURCHASES,new Error(t))}function qf(t){t.success?this._resolvePromiseDecorator(_.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.GET_STORAGE_DATA,new Error(t))}function Xf(t){t.success?this._resolvePromiseDecorator(_.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.SET_STORAGE_DATA,new Error(t))}function Qf(t){t.success?this._resolvePromiseDecorator(_.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.DELETE_STORAGE_DATA,new Error(t))}const $f=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sf(t,e)}(s,e);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(t){return!1}}(),function(){var t,e=Ef(o);if(i){var r=Ef(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return bf(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,r=new Array(e),n=0;n=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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function op(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function ip(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){op(i,n,o,a,s,"next",t)}function s(t){op(i,n,o,a,s,"throw",t)}a(void 0)}))}}function ap(t,e){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===(e=o.price)||void 0===e||null===(e=e.currency)||void 0===e?void 0:e.toUpperCase(),s="".concat(i," ").concat(a);return{id:t.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));t._resolvePromiseDecorator(_.GET_CATALOG,o)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var t=this,e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.entitlements.map((function(t){return Lp({id:r.find((function(e){return e.id===t.id})).id},t)})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.GET_PURCHASES,e)}))),e.promise}},{key:"inviteFriends",value:function(){var t=this,e=this._getPromiseDecorator(_.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(_.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){t._resolvePromiseDecorator(_.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(_.INVITE_FRIENDS,e)}))),e.promise}},{key:"share",value:function(t){var e=this;if(!t.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(_.SHARE);return r||(r=this._createPromiseDecorator(_.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:t.mediaUrl}).then((function(){e._resolvePromiseDecorator(_.SHARE)})).catch((function(t){e._rejectPromiseDecorator(_.SHARE,t)}))),r.promise}}])&&jp(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),s}(Fo);function Fp(t){return Fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fp(t)}function Up(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vp(t){for(var e=1;e2?e.slice(0,2):e,function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(r,Xp(r,n,"set"),o)}));t._platformStorageCachedData={};var r=t._platformSdk.game.loadData().then((function(e){"string"==typeof e&&""!==e&&(t._platformStorageCachedData=JSON.parse(e))}));t._platformSdk.system.onAudioEnabledChange((function(e){t._setAudioState(e)})),t._platformSdk.system.onPause((function(){t._setPauseState(!0)})),t._platformSdk.system.onResume((function(){t._setPauseState(!1)})),Promise.all([e,r]).finally((function(){t._isInitialized=!0,t._resolvePromiseDecorator(_.INITIALIZE),t._platformSdk.game.firstFrameReady()}))}))),e.promise}},{key:"isStorageSupported",value:function(t){return t===u.PLATFORM_INTERNAL||Yp(Kp(l.prototype),"isStorageSupported",this).call(this,t)}},{key:"isStorageAvailable",value:function(t){return t===u.PLATFORM_INTERNAL||Yp(Kp(l.prototype),"isStorageAvailable",this).call(this,t)}},{key:"getDataFromStorage",value:function(t,e,r){var n=this;return e===u.PLATFORM_INTERNAL?new Promise((function(e,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(t)){for(var i=[],a=0;a=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,eh);t.playerId=r||null,t.playerName=n||null,o&&t.playerPhotos.push(o),t.playerExtra=i,t._isPlayerAuthorized=!0}t._isInitialized=!0,t._resolvePromiseDecorator(_.INITIALIZE)},window.onBannerReady=function(){t._isBannerAvailable=!0},W("https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js",this._options.adTestMode?{"data-jg-test-environment":"on"}:{}).catch((function(e){t._rejectPromiseDecorator(_.INITIALIZE,JSON.stringify(e))}))),e.promise}},{key:"preloadInterstitial",value:function(){uh(this,lh,ph).call(this)}},{key:"showInterstitial",value:function(){var t=this;uh(this,lh,ph).call(this).then((function(){var e;t._platformSdk.showAd(null===(e=window.AdType)||void 0===e?void 0:e.Interstitial,{onAdClosed:function(){t._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(e){console.error(e),t._setInterstitialState(i.FAILED)}}),t._setInterstitialState(i.OPENED),t._preloadInterstitialPromise=null}))}},{key:"preloadRewarded",value:function(){uh(this,fh,hh).call(this)}},{key:"showRewarded",value:function(){var t=this;uh(this,fh,hh).call(this).then((function(){var e;t._platformSdk.showAd(null===(e=window.AdType)||void 0===e?void 0:e.Rewarded,{onAdClosed:function(e){e&&t._setRewardedState(a.REWARDED),t._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(e){console.error(e),t._setRewardedState(a.FAILED)}}),t._setRewardedState(a.OPENED),t._preloadRewardedPromise=null}))}},{key:"showBanner",value:function(t){var e,r=this;this._isBannerAvailable?null===(e=window.JGBanner)||void 0===e||e.loadBanner().then((function(){var e,n;r._setBannerState(s.SHOWN),null===(e=window.JGBanner)||void 0===e||e.showBanner(t||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(t){console.error(t),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:"hideBanner",value:function(){var t;null===(t=window.JGBanner)||void 0===t||t.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:"leaderboardsSetScore",value:function(t,e,r){if(!r)return Promise.reject();var n="string"==typeof e?parseInt(e,10):e;return this._platformSdk.postScore(n),Promise.resolve()}}])&&rh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(Fo);function yh(t){return yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(t)}function mh(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vh(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var 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;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Oh(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Th(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Oh(i,n,o,a,s,"next",t)}function s(t){Oh(i,n,o,a,s,"throw",t)}a(void 0)}))}}function kh(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{}},"*")}function Zh(t){this._isPlayerAuthorized=t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId,this._playerName=t.playerName,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto),this._defaultStorageType=u.PLATFORM_INTERNAL),this._isInitialized=!0,this._resolvePromiseDecorator(_.INITIALIZE)}function Jh(t){var e,r;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_STORAGE_DATA,null!==(r=t.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(_.GET_STORAGE_DATA)}function Kh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.SET_STORAGE_DATA):this._rejectPromiseDecorator(_.SET_STORAGE_DATA)}function qh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(_.DELETE_STORAGE_DATA)}function Xh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.PURCHASE,t.data):this._rejectPromiseDecorator(_.PURCHASE,t.data)}function Qh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_CATALOG,t.data):this._rejectPromiseDecorator(_.GET_CATALOG,t.data)}function $h(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_PURCHASES,t.data):this._rejectPromiseDecorator(_.GET_PURCHASES,t.data)}function td(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.CREATE_POST):this._rejectPromiseDecorator(_.CREATE_POST)}function ed(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.JOIN_COMMUNITY):this._rejectPromiseDecorator(_.JOIN_COMMUNITY)}const rd=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rh(t,e)}(l,e);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(t){return!1}}(),function(){var t,e=jh(a);if(s){var r=jh(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ph(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Lh(t)}(this,t)});function l(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this._getPromiseDecorator(_.CREATE_POST);return e||(e=this._createPromiseDecorator(_.CREATE_POST),Ch(this,Gh,Yh).call(this,_.CREATE_POST,{options:t})),e.promise}},{key:"joinCommunity",value:function(){var t=this._getPromiseDecorator(_.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(_.JOIN_COMMUNITY),Ch(this,Gh,Yh).call(this,_.JOIN_COMMUNITY)),t.promise}}],n&&kh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(Fo);function nd(t){return nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(t)}function od(t,e){for(var r=0;r{var t={166:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;rh});var l=new WeakMap,f=new WeakMap,p=new WeakMap;const h=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,l,{writable:!0,value:void 0}),a(this,f,{writable:!0,value:void 0}),a(this,p,{writable:!0,value:void 0}),s(this,l,new Promise((function(t,r){s(e,f,t),s(e,p,r)})))}var e,r,n;return e=t,(r=[{key:"promise",get:function(){return u(this,l)}},{key:"resolve",value:function(t){u(this,f).call(this,t)}},{key:"reject",value:function(t){u(this,p).call(this,t)}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},383:(t,e,r)=>{"use strict";r.d(e,{$H:()=>v,D1:()=>P,Dz:()=>d,QG:()=>m,RH:()=>E,Tg:()=>D,X_:()=>_,ZP:()=>w,ZT:()=>f,dG:()=>y,dY:()=>g,eE:()=>T,kM:()=>h,my:()=>A,n_:()=>O,pb:()=>p,t0:()=>S});var n=r(843);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement("script");o.src=t;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t){var a=document.createElement("script");a.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",a.setAttribute("data-ad-client",e),r?a.setAttribute("data-ad-channel",r):n&&a.setAttribute("data-ad-host",n),o&&a.setAttribute("data-admob-interstitial-slot",o),i&&a.setAttribute("data-admob-rewarded-slot",i),l&&a.setAttribute("data-adbreak-test","on"),a.setAttribute("data-ad-frequency-hint",s),a.setAttribute("crossorigin","anonymous"),a.addEventListener("load",(function(){window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push(u({preloadAdBreaks:"on",sound:"on",onReady:function(){}},f)),t((function(t){return window.adsbygoogle.push(t)}))})),document.head.appendChild(a)}))};function h(t){var e=document.createElement("div");switch(e.id=n._g,e.style.position="absolute",document.body.appendChild(e),t){case n.Cb.TOP:e.style.top="0px",e.style.height="90px",e.style.width="100%";break;case n.Cb.BOTTOM:default:e.style.bottom="0px",e.style.height="90px",e.style.width="100%"}return e}function d(){var t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100vw",t.style.height="100vh",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.zIndex="9999",t.id="loading-overlay";var e=document.createElement("div");return e.style.fontSize="24px",e.style.color="#fff",e.innerText="Loading...",t.appendChild(e),t}function y(){if(!document.getElementById("bridge-orientation-overlay-styles")){var t=document.createElement("style");t.id="bridge-orientation-overlay-styles",t.textContent="\n #".concat(n.Uw," {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.95);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n z-index: 9999999;\n }\n\n #bridge-orientation-icon {\n width: 80px;\n height: 80px;\n animation: bridge-rotate-phone 1.5s ease-in-out infinite;\n }\n\n #bridge-orientation-message {\n color: #fff;\n font-size: 18px;\n font-family: Arial, sans-serif;\n margin-top: 20px;\n text-align: center;\n }\n\n @keyframes bridge-rotate-phone {\n 0%, 100% { transform: rotate(0deg); }\n 50% { transform: rotate(90deg); }\n }\n "),document.head.appendChild(t)}var e=document.createElement("div");e.id=n.Uw;var r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("id","bridge-orientation-icon"),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("fill","none"),r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.innerHTML='\n \n \n ';var o=document.createElement("div");return o.id="bridge-orientation-message",o.innerText="Please rotate your device",e.appendChild(r),e.appendChild(o),e}function m(t){if(!document.getElementById("bridge-info-popup-styles")){var e=document.createElement("style");e.id="bridge-info-popup-styles",e.textContent="\n #bridge-info-popup-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9998;\n display: none;\n }\n\n #bridge-info-popup {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #2E3C75;\n color: #fff;\n padding: 20px;\n z-index: 9999;\n display: none;\n border-radius: 10px;\n box-shadow: 0 0 10px #2E3C75;\n font-size: 24px;\n font-family: 'Roboto', sans-serif;\n text-align: center;\n min-width: 250px;\n max-width: 30%;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n #bridge-info-popup-button {\n margin-top: 24px;\n width: 150px;\n background-color: rgba(255, 255, 255, 0.2);\n color: #fff;\n border: none;\n font-size: 24px;\n padding: 20px;\n border-radius: 5px;\n cursor: pointer;\n font-family: 'Roboto', sans-serif;\n display: block;\n }\n\n #bridge-info-popup-button:hover {\n background-color: rgba(255, 255, 255, 0.3);\n }",document.head.appendChild(e)}var r=document.getElementById("bridge-info-popup-overlay");r||((r=document.createElement("div")).id="bridge-info-popup-overlay",document.body.appendChild(r));var n=document.getElementById("bridge-info-popup");n||((n=document.createElement("div")).id="bridge-info-popup"),n.innerText=t;var o=document.getElementById("bridge-info-popup-button");return o||((o=document.createElement("button")).id="bridge-info-popup-button",o.innerText="OK",n.appendChild(o)),document.body.appendChild(n),new Promise((function(t){o.onclick=function(){n.style.display="none",r.style.display="none",t()},r.style.display="block",n.style.display="flex"}))}function v(t){var e=document.createElement("style");e.textContent="\n .fullscreen {\n background: #242424;\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0px;\n left: 0px;\n }\n\n #loading-overlay {\n font-size: 20px;\n z-index: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n #logo {\n width: 10%;\n max-width: 300px;\n min-width: 120px;\n overflow: visible;\n }\n\n .fill-rect {\n transform: translateY(100%);\n transition: transform 0.3s ease-out;\n }\n\n #gradientMover {\n display: none;\n }\n\n .gradient-mover {\n animation: moveGradient 0.4s linear;\n }\n\n @keyframes moveGradient {\n 0% { transform: translateX(0); }\n 100% { transform: translateX(-250%); }\n }\n\n .logo-fade-out {\n animation: logoFadeOut 1s linear;\n }\n\n .logo-fade-out path {\n fill: white;\n stroke: white;\n }\n\n @keyframes logoFadeOut {\n 0% { opacity: 1; }\n 50% { opacity: 0; }\n 100% { opacity: 0; }\n }\n ",document.head.appendChild(e);var r=document.createElement("div");r.id="loading-overlay",r.className="fullscreen",document.body.appendChild(r);var n=!1===t?{viewBox:"0 0 633 819",paths:["M632 1V632H1V1H632ZM350 125.586V507.414L380.586 538H546V451H478.599L478.308 451.278L454.598 474H443.406L450.944 452.328L451 452.169V187.459L457.369 182H546V95H380.586L350 125.586ZM283 125.586L252.414 95H87V182H175.631L182 187.459V445.54L175.631 451H87V538H252.414L283 507.414V125.586Z","M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z","M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z","M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z","M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z","M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z","M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z"],fillColor:"#aa76ff",strokeColor:"#aa76ff",gradientStops:[{offset:"0.235577",color:"#aa76ff"},{offset:"0.240685",color:"white"},{offset:"0.659749",color:"#aa76ff"}]}:{viewBox:"0 0 633 918",paths:["M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z","M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z","M612 847H564V894H579V861H591V894H606V861H612C615 861 617 864 617 867V894H633V868C633 856 623 847 612 847Z","M533 846C519 846 508 857 508 870C508 884 519 895 533 895C546 895 557 884 557 870C557 857 546 846 533 846ZM533 880C528 880 524 875 524 870C524 865 528 861 533 861C538 861 542 865 542 870C542 875 538 880 533 880Z","M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z","M484 861H502V847H482C469 847 459 858 459 871C459 884 469 894 482 894H502V880H484C478 880 474 876 474 871C474 865 478 861 484 861Z","M444 875C438 875 434 879 434 885C434 890 438 895 444 895C449 895 454 890 454 885C454 879 449 875 444 875Z","M402 847C389 847 378 857 378 870C378 883 389 894 402 894H425V847H402ZM410 880H403C398 880 394 876 394 870C394 865 398 861 403 861H410V880Z","M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z","M350 847H303V894H318V861H329V894H345V861H350C353 861 356 864 356 867V894H371V868C371 856 362 847 350 847Z","M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z","M269 847C256 847 247 857 247 870C247 883 256 894 269 894H293V847H269ZM277 880H271C265 880 261 876 261 870C261 865 265 861 271 861H277V880Z","M214 847C201 847 190 857 190 870C190 883 201 894 214 894H224V895C224 900 220 903 215 903H195V918H216C229 918 239 908 239 895V847H214ZM224 880H215C210 880 206 876 206 870C206 865 210 861 215 861H224V880Z","M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z","M167 847V880H153V847H137V894H167V895C167 900 163 904 157 904H137V918H158C172 918 182 909 182 896V847H167Z","M104 847C91 847 80 857 80 870C80 883 91 894 104 894H127V847H104ZM112 880H105C100 880 96 876 96 870C96 865 100 861 105 861H112V880Z","M56 833V894H72V833H56Z","M25 847H2V908H17V894H25C38 894 49 883 49 870C49 857 38 847 25 847ZM24 880H17V861H24C29 861 33 865 33 870C33 876 29 880 24 880Z","M0 0V633H633V0H0ZM451 452L443 475H456L480 452H546V537H382L352 507V126L382 96H546V181H458L451 187V452ZM252 96L282 126V507L252 537H88V452H176L183 446V187L176 181H88V96H252Z"],fillColor:"#aa76ff",strokeColor:"#aa76ff",gradientStops:[{offset:"0.235577",color:"#aa76ff"},{offset:"0.240685",color:"white"},{offset:"0.659749",color:"#aa76ff"}]};n.gradientWidthMultiplier=4;var o=i(n.viewBox.split(/[ ,]+/),4),a=o[2],s=o[3],u=Number(a),c=Number(s),l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("id","logo"),l.setAttribute("viewBox",n.viewBox),l.setAttribute("fill","none"),l.setAttribute("xmlns","http://www.w3.org/2000/svg");var f=document.createElementNS(l.namespaceURI,"defs"),p=document.createElementNS(l.namespaceURI,"mask");p.setAttribute("id","logo-mask");var h=document.createElementNS(l.namespaceURI,"rect");h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width","100%"),h.setAttribute("height","100%"),h.setAttribute("fill","black"),p.appendChild(h),n.paths.forEach((function(t){var e=document.createElementNS(l.namespaceURI,"path");e.setAttribute("d",t),e.setAttribute("fill","white"),p.appendChild(e)})),f.appendChild(p);var d=document.createElementNS(l.namespaceURI,"linearGradient");d.setAttribute("id","shineGradient"),d.setAttribute("x1","1233"),d.setAttribute("y1","0"),d.setAttribute("x2","1866"),d.setAttribute("y2","633"),d.setAttribute("gradientUnits","userSpaceOnUse"),n.gradientStops.forEach((function(t){var e=t.offset,r=t.color,n=document.createElementNS(l.namespaceURI,"stop");n.setAttribute("offset",e),n.setAttribute("stop-color",r),d.appendChild(n)})),f.appendChild(d),l.appendChild(f);var y=document.createElementNS(l.namespaceURI,"g");y.setAttribute("mask","url(#logo-mask)");var m=document.createElementNS(l.namespaceURI,"rect");m.setAttribute("id","gradientMover"),m.setAttribute("x","0"),m.setAttribute("y","0"),m.setAttribute("width",String(u*n.gradientWidthMultiplier)),m.setAttribute("height",String(c)),m.setAttribute("fill","url(#shineGradient)"),m.style.transform="translateX(0)",y.appendChild(m),l.appendChild(y);var v=document.createElementNS(l.namespaceURI,"g");v.setAttribute("mask","url(#logo-mask)");var _=document.createElementNS(l.namespaceURI,"rect");_.setAttribute("id","fillRect"),_.setAttribute("class","fill-rect"),_.setAttribute("x","0"),_.setAttribute("y","0"),_.setAttribute("width","100%"),_.setAttribute("height",String(c)),_.setAttribute("fill",n.fillColor),v.appendChild(_),l.appendChild(v),n.paths.forEach((function(t){var e=document.createElementNS(l.namespaceURI,"path");e.setAttribute("d",t),e.setAttribute("stroke",n.strokeColor),e.setAttribute("stroke-width","3"),l.appendChild(e)})),r.appendChild(l)}var _=function(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(t))return t.reduce((function(t,n,o){if(t[o]=b(e,n),r)try{t[o]=JSON.parse(t[o])}catch(t){}return t}),new Array(t.length));var n=b(e,t);if(r&&"string"==typeof n)try{n=JSON.parse(n)}catch(t){}return n}function E(t,e){for(var r=u({},t),n=Object.keys(e),o=0;oe.indexOf(".")?parseFloat(e.replace(/\./g,"").replace(",",".")):e.includes(",")&&-1!==e.lastIndexOf(",")&&e.lastIndexOf(",")===e.length-4?parseInt(e.replace(/,/,""),10):e.includes(",")&&-1!==e.lastIndexOf(",")&&e.lastIndexOf(",")!==e.length-3?parseFloat(e.replace(",",".")):e.includes(".")&&-1!==e.lastIndexOf(".")&&e.lastIndexOf(".")===e.length-4?parseInt(e.replace(/\./,""),10):e.includes(".")?parseFloat(e):parseInt(e,10)}function P(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Array.from({length:8},(function(){return t.charAt(Math.floor(62*Math.random()))})).join(""),r=Date.now().toString(36);return"".concat(e).concat(r)}function A(){var t,e="bridge_player_guest_id";try{t=localStorage.getItem(e)}catch(t){}if(!t){t=P();try{localStorage.setItem(e,t)}catch(t){}}return{id:t,name:"Guest ".concat(t)}}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";window.parent&&window.parent[l](t,e)}function T(t){window.system&&window.system[l](t)}function D(t){window.chrome&&window.chrome.webview&&"function"==typeof window.chrome.webview.postMessage&&window.chrome.webview[l](t)}},843:(t,e,r)=>{"use strict";r.d(e,{AR:()=>y,Cb:()=>f,Dt:()=>v,Kk:()=>l,Lb:()=>o,Mn:()=>g,Uw:()=>m,W1:()=>a,WA:()=>u,YU:()=>s,Z:()=>_,_g:()=>p,b3:()=>c,b9:()=>n,bD:()=>h,me:()=>d,oF:()=>i,pn:()=>b});var n="https://playgama.com/api/bridge/v1",o={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",MICROSOFT_STORE:"microsoft_store",HUAWEI:"huawei",BITQUEST:"bitquest",GAMEPUSH:"gamepush",DISCORD:"discord",JIO_GAMES:"jio_games",YOUTUBE:"youtube",PORTAL:"portal",REDDIT:"reddit",XIAOMI:"xiaomi"},i={CORE:"core",PLATFORM:"platform",PLAYER:"player",GAME:"game",STORAGE:"storage",ADVERTISEMENT:"advertisement",SOCIAL:"social",DEVICE:"device",LEADERBOARDS:"leaderboards",PAYMENTS:"payments",REMOTE_CONFIG:"remote_config",CLIPBOARD:"clipboard",ACHIEVEMENTS:"achievements",ANALYTICS:"analytics"},a={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",ORIENTATION_STATE_CHANGED:"orientation_state_changed"},s={VISIBLE:"visible",HIDDEN:"hidden"},u={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed"},c={LOADING:"loading",OPENED:"opened",CLOSED:"closed",FAILED:"failed",REWARDED:"rewarded"},l={LOADING:"loading",SHOWN:"shown",HIDDEN:"hidden",FAILED:"failed"},f={TOP:"top",BOTTOM:"bottom"},p="banner-container",h={LOCAL_STORAGE:"local_storage",PLATFORM_INTERNAL:"platform_internal"},d={DESKTOP:"desktop",MOBILE:"mobile",TABLET:"tablet",TV:"tv"},y={PORTRAIT:"portrait",LANDSCAPE:"landscape"},m="bridge-orientation-overlay",v={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"},_={NOT_AVAILABLE:"not_available",IN_GAME:"in_game",NATIVE:"native",NATIVE_POPUP:"native_popup"},g={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"},b={SDK_NOT_INITIALIZED:{message:"Before using the SDK you must initialize it"},STORAGE_NOT_SUPPORTED:{message:"Storage not supported"},STORAGE_NOT_AVAILABLE:{message:"Storage not available"},GAME_PARAMS_NOT_FOUND:{message:"Game params are not found"},INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:{message:"Message is too long"}}},66:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>V});var n=r(383),o=r(23);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,s,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,s)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,s,u){var c=h(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function c(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function l(t,e){for(var r=0;r1&&void 0!==i[1]?i[1]:{},b(this,j,e||S(this,I)),b(this,F,r),t.prev=3,b(this,R,P),t.next=7,fetch(S(this,j));case 7:if((n=t.sent).ok){t.next=10;break}throw new Error("Failed to load bridge config: ".concat(S(this,j)," ").concat(n.status," (").concat(n.statusText,")"));case 10:return t.next=12,n.text();case 12:o=t.sent,b(this,M,o),b(this,R,A),g(this,B,U).call(this,o),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(3),g(this,H,W).call(this,S(this,F)),b(this,R,O),b(this,C,t.t0.message||String(t.t0)),console.error(t.t0);case 24:case"end":return t.stop()}}),t,this,[[3,18]])})),a=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){c(o,r,n,a,s,"next",t)}function s(t){c(o,r,n,a,s,"throw",t)}a(void 0)}))},function(t){return a.apply(this,arguments)})},{key:"getPlatformOptions",value:function(t){var e,r=null===(e=this.options.platforms)||void 0===e?void 0:e[t];return r?(0,n.RH)(this.options,r):this.options}}],r&&l(e.prototype,r),o&&l(e,o),Object.defineProperty(e,"prototype",{writable:!1}),f}(o.Z))},23:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;rs});const s=i((function t(e){var r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,o=void 0,(n=a(n="_platformBridge"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,this._platformBridge=e}))},861:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>b});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{"use strict";r.r(e),r.d(e,{default:()=>P});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function f(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,s,"next",t)}function s(t){f(i,n,o,a,s,"throw",t)}a(void 0)}))}}function h(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>W});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,u,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,u)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{"use strict";r.r(e),r.d(e,{default:()=>C});var n=r(640),o=r(383),i=r(843);function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,s,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,s)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,a,s){var u=h(t[o],t,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function s(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[t])return this._preloadedInterstitialPromises[t];var r=null;return this._preloadedInterstitialPromises[t]=this._platformSdk.getInterstitialAdAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedInterstitialPromises[t]=null,Promise.reject()})),this._preloadedInterstitialPromises[t]}function j(t){var e=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[t])return this._preloadedRewardedPromises[t];var r=null;return this._preloadedRewardedPromises[t]=this._platformSdk.getRewardedVideoAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedRewardedPromises[t]=null,Promise.reject()})),this._preloadedRewardedPromises[t]}function M(){return N.apply(this,arguments)}function N(){var t;return t=a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!t.sent){t.next=6;break}return t.abrupt("return",Promise.resolve());case 6:t.next=14;break;case 8:if(t.prev=8,t.t0=t.catch(0),"INVALID_OPERATION"!==(null===t.t0||void 0===t.t0?void 0:t.t0.code)){t.next=13;break}t.next=14;break;case 13:throw new Error(t.t0);case 14:return t.prev=15,t.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!t.sent){t.next=21;break}return t.abrupt("return",this._platformSdk.player.subscribeBotAsync());case 21:t.next=28;break;case 23:if(t.prev=23,t.t1=t.catch(15),"INVALID_OPERATION"!==(null===t.t1||void 0===t.t1?void 0:t.t1.code)){t.next=27;break}return t.abrupt("return",Promise.resolve());case 27:throw new Error(t.t1);case 28:return t.abrupt("return",Promise.resolve());case 29:case"end":return t.stop()}}),t,this,[[0,8],[15,23]])})),N=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,u,"next",t)}function u(t){s(i,n,o,a,u,"throw",t)}a(void 0)}))},N.apply(this,arguments)}const C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(s,t);var e,r,n,a=m(s);function s(){var t,e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);for(var o=arguments.length,u=new Array(o),c=0;c\n \n \n \n \n \n \n \n \n \n \n \n \n',"",{players:r},(function(t){t.showAsync(),e._overlay=t,n.remove(),e._resolvePromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(t,r){n.remove(),e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,r)})).iframeElement;o.style.zIndex=9999,o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.height="100vh",o.style.width="100vw",o.style.border=0,o.id=o.name,document.body.appendChild(o)})).catch((function(t){n.remove(),e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,t)}))}return r.promise}},{key:"paymentsPurchase",value:function(t){var e=this,r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(i.Mn.PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=c({id:t},r);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(i.Mn.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.PURCHASE,t)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(t){var e=this,r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(i.Mn.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(i.Mn.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CONSUME_PURCHASE,t)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var t=this,e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();var r=this._getPromiseDecorator(i.Mn.GET_CATALOG);return r||(r=this._createPromiseDecorator(i.Mn.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=e.map((function(t){var e=r.find((function(e){return e.productID===t.platformProductId}));return{id:t.id,title:e.title,description:e.description,imageURI:e.imageURI,price:e.price,priceCurrencyCode:e.priceCurrencyCode,priceValue:e.priceAmount}}));t._resolvePromiseDecorator(i.Mn.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var t=this,e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=c({id:r.find((function(e){return e.id===t.productID})).id},t);return delete e.productID,e})),t._resolvePromiseDecorator(i.Mn.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}},{key:"inviteFriends",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.image||!e.text)return Promise.reject();if(!(0,o.dY)(e.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(i.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(i.Mn.INVITE_FRIENDS),this._platformSdk.inviteAsync(e).then((function(){t._resolvePromiseDecorator(i.Mn.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.INVITE_FRIENDS,e)}))),r.promise}},{key:"joinCommunity",value:function(t){var e=this,r=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),t&&!0===t.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(t){return e._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(t){return e._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,t)}))),r.promise}},{key:"share",value:function(t){var e=this;if(!t.image||!t.text)return Promise.reject();if(!(0,o.dY)(t.image))return Promise.reject(new Error("Image is not base64"));var r=this._getPromiseDecorator(i.Mn.SHARE);return r||(r=this._createPromiseDecorator(i.Mn.SHARE),this._platformSdk.shareAsync(c({intent:"REQUEST"},t)).then((function(){e._resolvePromiseDecorator(i.Mn.SHARE)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.SHARE,t)}))),r.promise}}],r&&h(e.prototype,r),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(n.Z)},441:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>_});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>S});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>Z});var n=r(640),o=r(843),i=r(383);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0&&this._paymentsPurchases.splice(e,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,new Error(t))}function H(t){if(t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=t.data.map((function(t){var r=JSON.parse(t),n=u({id:e.find((function(t){return t.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,new Error(t))}function U(t){t.success?this._resolvePromiseDecorator(o.Mn.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.GET_STORAGE_DATA,new Error(t))}function W(t){t.success?this._resolvePromiseDecorator(o.Mn.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.SET_STORAGE_DATA,new Error(t))}function V(t){t.success?this._resolvePromiseDecorator(o.Mn.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.DELETE_STORAGE_DATA,new Error(t))}const Z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(a,t);var e,r,n,i=p(a);function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,r=new Array(e),n=0;n{"use strict";r.r(e),r.d(e,{default:()=>E});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var s=["gamer_id","gamer_name","gamer_avatar_url"];function u(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function c(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>h});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r0&&(t._playerId=o,t._playerName=a,t._playerPhotos.push(s),t._isPlayerAuthorized=!0),t._isInitialized=!0,t._resolvePromiseDecorator(i.Mn.INITIALIZE)}))}))})):this._rejectPromiseDecorator(i.Mn.INITIALIZE,i.pn.GAME_PARAMS_NOT_FOUND)),e.promise}},{key:"isStorageSupported",value:function(t){return t!==i.bD.PLATFORM_INTERNAL&&c(p(u.prototype),"isStorageSupported",this).call(this,t)}},{key:"isStorageAvailable",value:function(t){return t!==i.bD.PLATFORM_INTERNAL&&c(p(u.prototype),"isStorageAvailable",this).call(this,t)}},{key:"showInterstitial",value:function(){var t=this;this._setInterstitialState(i.WA.OPENED),this._platformSdk.APIAds.show((function(){t._setInterstitialState(i.WA.CLOSED)}))}},{key:"showRewarded",value:function(){var t=this;this._setRewardedState(i.b3.OPENED),this._platformSdk.GEvents.reward((function(e,r){e?r():t._setRewardedState(i.b3.FAILED)}),(function(e){e?(t._setRewardedState(i.b3.REWARDED),t._setRewardedState(i.b3.CLOSED)):t._setRewardedState(i.b3.FAILED)}))}},{key:"leaderboardsSetScore",value:function(t,e){var r=this,n=this._getPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE);var o={score:e,board:t};this._platformSdk.Scores.save(o,(function(t){t.success?r._resolvePromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE,t.errormsg)}))}return n.promise}},{key:"unlockAchievement",value:function(t){var e=this;return t.achievement?new Promise((function(r,n){e._platformSdk.Achievements.save(Array.isArray(t.achievement)?t.achievement:[t.achievement],(function(t){t.success?r(t):n(t.errormsg)}))})):Promise.reject()}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(n.Z)},572:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>J});var n=r(640),o=r(843),i=r(383);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r=0&&this._paymentsPurchases.splice(e,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,new Error(t))}function V(t){if(t&&!1!==t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=(t.data||[]).filter((function(t){return t.isActive})).map((function(t){var r=e.find((function(e){return e.platformProductId===t.id}));return{id:null==r?void 0:r.id,platformProductId:t.id,status:t.status}})),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,new Error(t))}function Z(t){this._pauseStateAggregator.setState("rate",!1),t&&!1!==t.success?this._resolvePromiseDecorator(o.Mn.RATE):this._rejectPromiseDecorator(o.Mn.RATE,new Error(t))}function z(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.GET_STORAGE_DATA,new Error(t))}function Y(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.SET_STORAGE_DATA,new Error(t))}function K(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.DELETE_STORAGE_DATA,new Error(t))}const J=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(y,t);var e,r,n,a=l(y);function y(){var t,e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y);for(var i=arguments.length,s=new Array(i),u=0;u{"use strict";r.r(e),r.d(e,{default:()=>x});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,u,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,u)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function u(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,s,"next",t)}function s(t){u(i,n,o,a,s,"throw",t)}a(void 0)}))}}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt("return",(0,o.t0)(e,this._platformStorageCachedData,r));case 6:case"end":return t.stop()}}),t,this)}))),G.apply(this,arguments)}const x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}(d,t);var e,r,n,a,u,l,p=v(d);function d(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d);for(var e=arguments.length,r=new Array(e),n=0;n{"use strict";r.r(e),r.d(e,{default:()=>ct});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r120?this._rejectPromiseDecorator(i.Mn.INVITE_FRIENDS,i.pn.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(e)),r.promise}},{key:"rate",value:function(){var t=this._getPromiseDecorator(i.Mn.RATE);return t||(t=this._createPromiseDecorator(i.Mn.RATE),this._platformSdk.UI.showRatingDialog()),t.promise}},{key:"createPost",value:function(t){if(!t||null==t||!t.media)return Promise.reject();var e,r=this._getPromiseDecorator(i.Mn.CREATE_POST);return r||(r=this._createPromiseDecorator(i.Mn.CREATE_POST),this._platformSdk.UI.postMediatopic(t,null!==(e=t.status)&&void 0!==e&&e)),r.promise}},{key:"joinCommunity",value:function(t){if(!t||null==t||!t.groupId)return Promise.reject();var e,r=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(t.groupId,null!==(e=t.enableMessages)&&void 0!==e&&e)),r.promise}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),y}(n.Z)},640:(t,e,r)=>{"use strict";r.d(e,{Z:()=>M});var n=r(258),o=r.n(n),i=r(843),a=r(166);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>E});var n=r(640),o=r(843),i=r(383);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>O});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,u,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,u)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function u(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e1&&void 0!==n[1])||n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt("return",(0,o.t0)(e,this._platformStorageCachedData,r));case 6:case"end":return t.stop()}}),t,this)})),A=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,s,"next",t)}function s(t){u(i,n,o,a,s,"throw",t)}a(void 0)}))},A.apply(this,arguments)}const O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(s,t);var e,r,n,a=m(s);function s(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,r=new Array(e),n=0;n{"use strict";r.r(e),r.d(e,{default:()=>h});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>m});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{"use strict";r.r(e),r.d(e,{ACTION_NAME_QA:()=>G,INTERNAL_STORAGE_POLICY:()=>C,SUPPORTED_FEATURES:()=>Y,default:()=>vt});var n=r(640),o=r(383);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"*";(0,o.n_)(t,e)}},{key:"addListener",value:function(t){window.addEventListener("message",t)}},{key:"removeListener",value:function(t){window.removeEventListener("message",t)}},{key:"generateMessageId",value:function(){return"".concat(Date.now(),"-").concat(Math.random())}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),l=r(66),f=r(843);function p(){p=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",y="executing",m="completed",v={};function g(){}function b(){}function S(){}var E={};c(E,a,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,a)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==_(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?m:d,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function h(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],r=Array.isArray(e)?e:[],n=performance.getEntriesByType("resource")||[],o=r.length>0?r:["name","initiatorType"],i=n.map((function(t){var e={};return o.forEach((function(r){r in t&&(e[r]=t[r])})),e}));return I(this,$,lt).call(this,{type:f.oF.PLATFORM,action:G.GET_PERFORMANCE_RESOURCES,id:t,options:{resources:i}}),Promise.resolve(n)}function lt(t){k(this,K).send(v({source:M},t))}function ft(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=k(this,K).generateMessageId(),a=v({timeout:0},o);return new Promise((function(s,u){var c=function n(o){var a=o.data;(null==a?void 0:a.type)===t&&(null==a?void 0:a.action)===e&&(null==a?void 0:a.id)===i&&(null==a?void 0:a.source)!==M&&(k(r,K).removeListener(n),s(a))};k(r,K).addListener(c),I(r,$,lt).call(r,v({type:t,action:e,id:i,options:o},n)),a.timeout>0&&setTimeout((function(){u(new Error("Request timeout")),k(r,K).removeListener(c)}),a.timeout)}))}function pt(){return ht.apply(this,arguments)}function ht(){var t;return t=p().mark((function t(){var e=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",I(this,tt,ft).call(this,f.oF.PLAYER,G.GET_PLAYER).then((function(t){var r=t.player;null!=r&&r.isAuthorized?(e._playerId=r.userId,e._isPlayerAuthorized=r.isAuthorized,e._playerName=r.name,Array.isArray(r.photos)&&(e._playerPhotos=h(r.photos)),e._playerExtra=r,I(e,ot,mt).call(e)):e._playerApplyGuestData()})).catch((function(){e._playerApplyGuestData()})));case 1:case"end":return t.stop()}}),t,this)})),ht=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){y(i,n,o,a,s,"next",t)}function s(t){y(i,n,o,a,s,"throw",t)}a(void 0)}))},ht.apply(this,arguments)}function dt(t){var e=t.action,r=t.payload;if("interstitial"===e){if(!this.isInterstitialSupported)return;switch(r.status){case x:this._setInterstitialState(f.WA.LOADING);break;case F:this._setInterstitialState(f.WA.OPENED);break;case H:this._setInterstitialState(f.WA.FAILED);break;case B:this._setInterstitialState(f.WA.CLOSED)}}else if("reward"===e){if(!this.isRewardedSupported)return;switch(r.status){case U:this._setRewardedState(f.b3.LOADING);break;case W:this._setRewardedState(f.b3.OPENED);break;case V:this._setRewardedState(f.b3.REWARDED);break;case Z:this._setRewardedState(f.b3.CLOSED);break;case z:this._setRewardedState(f.b3.FAILED)}}}function yt(){return this._internalStoragePolicy===C.AUTHORIZED_ONLY&&this._isPlayerAuthorized||this._internalStoragePolicy===C.ALWAYS}function mt(){I(this,nt,yt).call(this)?this._defaultStorageType=f.bD.PLATFORM_INTERNAL:this._defaultStorageType=f.bD.LOCAL_STORAGE}u=it;const vt=it},381:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>F});var n=r(640),o=r(843),i=r(383);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:D(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",_={};function g(){}function b(){}function S(){}var E={};f(E,u,(function(){return this}));var w=Object.getPrototypeOf,P=w&&w(w(j([])));P&&P!==r&&n.call(P,u)&&(E=P);var A=S.prototype=g.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function D(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===_)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,_;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function u(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,s,"next",t)}function s(t){u(i,n,o,a,s,"throw",t)}a(void 0)}))}}function l(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};(0,i.n_)({type:t,data:e},"*")}function I(t){this._isPlayerAuthorized=t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId,this._playerName=t.playerName,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto),this._defaultStorageType=o.bD.PLATFORM_INTERNAL),this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)}function R(t){var e,r;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.GET_STORAGE_DATA,null!==(r=t.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(o.Mn.GET_STORAGE_DATA)}function L(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.SET_STORAGE_DATA):this._rejectPromiseDecorator(o.Mn.SET_STORAGE_DATA)}function j(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(o.Mn.DELETE_STORAGE_DATA)}function M(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.PURCHASE,t.data):this._rejectPromiseDecorator(o.Mn.PURCHASE,t.data)}function N(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.GET_CATALOG,t.data):this._rejectPromiseDecorator(o.Mn.GET_CATALOG,t.data)}function C(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,t.data):this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,t.data)}function G(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.CREATE_POST):this._rejectPromiseDecorator(o.Mn.CREATE_POST)}function x(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(o.Mn.JOIN_COMMUNITY):this._rejectPromiseDecorator(o.Mn.JOIN_COMMUNITY)}const F=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(f,t);var e,r,n,i,a,u=d(f);function f(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f);for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this._getPromiseDecorator(o.Mn.CREATE_POST);return e||(e=this._createPromiseDecorator(o.Mn.CREATE_POST),_(this,g,k).call(this,o.Mn.CREATE_POST,{options:t})),e.promise}},{key:"joinCommunity",value:function(){var t=this._getPromiseDecorator(o.Mn.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(o.Mn.JOIN_COMMUNITY),_(this,g,k).call(this,o.Mn.JOIN_COMMUNITY)),t.promise}}],r&&l(e.prototype,r),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),f}(n.Z)},675:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>w});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>E});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"result",i=this._getPromiseDecorator(t);return i||(i=this._createPromiseDecorator(t),this._platformSdk.send(e,n).then((function(e){e[o]?r._resolvePromiseDecorator(t):r._rejectPromiseDecorator(t)})).catch((function(e){r._rejectPromiseDecorator(t,e)}))),i.promise}const E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(_,t);var e,r,n,a=l(_);function _(){var t,e,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,_);for(var n=arguments.length,o=new Array(n),i=0;i{"use strict";r.r(e),r.d(e,{default:()=>S});var n=r(640),o=r(843),i=r(383);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var r=0;r{"use strict";r.r(e),r.d(e,{default:()=>T});var n=r(640),o=r(383),i=r(843),a=["player"];function s(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e{"use strict";r.r(e),r.d(e,{default:()=>k});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e0?t.entries.map((function(t){return{id:t.player.uniqueID,name:t.player.publicName,score:t.score,rank:t.rank,photo:t.player.getAvatarSrc("large")}})):[],e._resolvePromiseDecorator(i.Mn.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_GET_ENTRIES,t)}))}return r.promise}},{key:"paymentsPurchase",value:function(t){var e=this;if(!S(this,A))return Promise.reject();var r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(i.Mn.PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.PURCHASE),S(this,A).purchase(r).then((function(r){var n=u({id:t},r.purchaseData);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(i.Mn.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.PURCHASE,t)}))),n.promise}},{key:"paymentsConsumePurchase",value:function(t){var e=this;if(!S(this,A))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(i.Mn.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.CONSUME_PURCHASE),S(this,A).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(i.Mn.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CONSUME_PURCHASE,t)}))),n.promise}},{key:"paymentsGetCatalog",value:function(){var t=this;if(!S(this,A))return Promise.reject();var e=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(i.Mn.GET_CATALOG);return r||(r=this._createPromiseDecorator(i.Mn.GET_CATALOG),S(this,A).getCatalog().then((function(r){var n=e.map((function(t){var e,n=r.find((function(e){return e.id===t.id}));return{id:t.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(e=n.getPriceCurrencyImage)||void 0===e?void 0:e.call(n,"medium")}}));t._resolvePromiseDecorator(i.Mn.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),r.promise}},{key:"paymentsGetPurchases",value:function(){var t=this;if(!S(this,A))return Promise.reject();var e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),S(this,A).getPurchases().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=u({id:r.find((function(e){return e.id===t.productID})).id},t.purchaseData);return delete e.productID,e})),t._resolvePromiseDecorator(i.Mn.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}},{key:"getRemoteConfig",value:function(t){var e=this;if(!this._platformSdk)return Promise.reject();var r=t;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(i.Mn.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(i.Mn.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(t){e._resolvePromiseDecorator(i.Mn.GET_REMOTE_CONFIG,t)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.GET_REMOTE_CONFIG,t)}))),n.promise}},{key:"clipboardWrite",value:function(t){var e=this,r=this._getPromiseDecorator(i.Mn.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(i.Mn.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(t).then((function(){e._resolvePromiseDecorator(i.Mn.CLIPBOARD_WRITE,!0)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CLIPBOARD_WRITE,t)}))),r.promise}}])&&l(e.prototype,r),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(n.Z)},151:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>E});var n=r(640),o=r(383),i=r(843);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e2?e.slice(0,2):e)}));t._platformStorageCachedData={};var r=t._platformSdk.game.loadData().then((function(e){"string"==typeof e&&""!==e&&(t._platformStorageCachedData=JSON.parse(e))}));t._platformSdk.system.onAudioEnabledChange((function(e){t._setAudioState(e)})),t._platformSdk.system.onPause((function(){t._setPauseState(!0)})),t._platformSdk.system.onResume((function(){t._setPauseState(!1)})),Promise.all([e,r]).finally((function(){t._isInitialized=!0,t._resolvePromiseDecorator(i.Mn.INITIALIZE),t._platformSdk.game.firstFrameReady()}))}))),e.promise}},{key:"isStorageSupported",value:function(t){return t===i.bD.PLATFORM_INTERNAL||p(m(s.prototype),"isStorageSupported",this).call(this,t)}},{key:"isStorageAvailable",value:function(t){return t===i.bD.PLATFORM_INTERNAL||p(m(s.prototype),"isStorageAvailable",this).call(this,t)}},{key:"getDataFromStorage",value:function(t,e,r){var n=this;return e===i.bD.PLATFORM_INTERNAL?new Promise((function(e,o){n._platformSdk.game.loadData().then((function(o){if("string"==typeof o&&""!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(t)){for(var i=[],a=0;a{!function(e){t.exports=e;var r="listeners",n={on:function(t,e){return a(this,t).push(e),this},once:function(t,e){var r=this;return n.originalListener=e,a(r,t).push(n),r;function n(){i.call(r,t,n),e.apply(this,arguments)}},off:i,emit:function(t,e){var r=this,n=a(r,t,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(t){t.call(r)}));else if(2===o)n.forEach((function(t){t.call(r,e)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(t){t.apply(r,i)}))}return!!n.length}};function o(t){for(var e in n)t[e]=n[e];return t}function i(t,e){var n,o=this;if(arguments.length){if(e){if(n=a(o,t,!0)){if(!(n=n.filter((function(t){return t!==e&&t.originalListener!==e}))).length)return i.call(o,t);o[r][t]=n}}else if((n=o[r])&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(t,e,n){if(!n||t[r]){var o=t[r]||(t[r]={});return o[e]||(o[e]=[])}}o(e.prototype),e.mixin=o}((function t(){if(!(this instanceof t))return new t}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=r(843),e=r(166),n=r(66),o=r(258),i=r.n(o),a=r(23);const s=JSON.parse('{"i8":"1.28.0-preview.2"}');var u=r(383);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};return{event_name:t,module:e,bridge_version:s.i8,platform_id:this._platformBridge.platformId,game_id:S(this,D),player_id:this._platformBridge.playerId,player_guest_id:S(this,k),session_id:S(this,I),timestamp:(new Date).toISOString(),data:r}}function W(){var e=this;if(0!==S(this,A).length){var r=l(S(this,A));w(this,A,[]),w(this,O,null);var n="https://playgama.com/api/events/v2/bridge/analytics";this._platformBridge.platformId===t.Lb.DISCORD&&(n="/playgama/api/events/v2/bridge/analytics"),fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:r})}).then((function(t){if(!t.ok)throw new Error("Network response was not ok: ".concat(t.status));w(e,R,0)})).catch((function(){w(e,R,S(e,R)+1),S(e,R)>=2&&E(e,C,V).call(e)}))}}function V(){w(this,L,!0),w(this,A,[]),S(this,O)&&(clearTimeout(S(this,O)),w(this,O,null)),S(this,T)&&(clearInterval(S(this,T)),w(this,T,null))}function Z(){var e,r=this._platformBridge.options;switch(this._platformBridge.platformId){case t.Lb.GAME_DISTRIBUTION:case t.Lb.Y8:e=r.gameId;break;case t.Lb.HUAWEI:e=r.appId;break;case t.Lb.MSN:e=r.gameId;break;case t.Lb.DISCORD:e=r.appId;break;case t.Lb.GAMEPUSH:e=r.projectId;break;default:e=null}return e||(e=E(this,x,z).call(this,window.location.href)),e}function z(e){try{var r=new URL(e).pathname.split("/").filter(Boolean);switch(this._platformBridge.platformId){case t.Lb.YANDEX:var n=r.indexOf("app"),o=-1!==n?r[n+1]:null;if(o)return o;break;case t.Lb.LAGGED:var i=r.indexOf("g"),a=-1!==i?r[i+1]:null;if(a)return E(this,F,Y).call(this,a);break;case t.Lb.CRAZY_GAMES:var s=r.indexOf("game"),u=-1!==s?r[s+1]:null;if(u)return E(this,F,Y).call(this,u);break;case t.Lb.PLAYGAMA:var c=r.indexOf("game"),l=-1!==c?r[c+1]:null;if(l)return E(this,F,Y).call(this,l);var f=r[0];if("string"==typeof f&&/^[a-z0-9]{10,}$/i.test(f))return f}}catch(t){return null}return null}function Y(t){return"string"!=typeof t||0===t.length?"":t.replace(/-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}function K(){var e=this;S(this,T)||w(this,T,setInterval((function(){e.send("".concat(t.oF.CORE,"_ping"),t.oF.CORE)}),15e3))}const J=new(function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(a,e);var r,n,o,i=y(a);function a(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),_(m(t=i.call(this)),B),_(m(t),F),_(m(t),x),_(m(t),G),_(m(t),C),_(m(t),N),_(m(t),M),_(m(t),j),g(m(t),A,{writable:!0,value:[]}),g(m(t),O,{writable:!0,value:null}),g(m(t),T,{writable:!0,value:null}),g(m(t),D,{writable:!0,value:null}),g(m(t),k,{writable:!0,value:null}),g(m(t),I,{writable:!0,value:null}),g(m(t),R,{writable:!0,value:0}),g(m(t),L,{writable:!0,value:!1}),w(m(t),I,E(m(t),j,H).call(m(t))),t}return r=a,n=[{key:"initialize",value:function(e){var r;this._platformBridge=e,!1===(null===(r=this._platformBridge.options)||void 0===r?void 0:r.sendAnalyticsEvents)&&w(this,L,!0);var n=window.location.href;(n.startsWith("file://")||n.includes("localhost")||n.includes("127.0.0.1"))&&w(this,L,!0),w(this,D,E(this,G,Z).call(this)),w(this,k,(0,u.my)().id);var o=E(this,M,U).call(this,"".concat(t.oF.CORE,"_initialization_started"),t.oF.CORE);return S(this,A).push(o),E(this,B,K).call(this),this}},{key:"send",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!S(this,L)){var o=E(this,M,U).call(this,t,e,n);S(this,A).push(o),S(this,O)&&clearTimeout(S(this,O)),w(this,O,setTimeout((function(){E(r,N,W).call(r)}),3e3))}}}],n&&p(r.prototype,n),o&&p(r,o),Object.defineProperty(r,"prototype",{writable:!1}),a}(a.Z));function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function X(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||e&&null!==this._currentLoadingProgress)){var r=document.getElementById("fillRect"),n=document.getElementById("gradientMover"),o=document.getElementById("logo"),i=document.getElementById("loading-overlay");if(r&&n&&o&&i){this._currentLoadingProgress=t;var a=Math.max(0,Math.min(100,t)),s=100-a;r.style.transform="translateY(".concat(s,"%)"),100===a?(this._loadingProcessCompleted=!0,setTimeout((function(){r.style.display="none",n.style.display="block",n.classList.add("gradient-mover")}),400),setTimeout((function(){return o.classList.add("logo-fade-out")}),900),setTimeout((function(){return i.remove()}),1400)):n.classList.remove("gradient-mover")}}}}],n&>(r.prototype,n),o&>(r,o),Object.defineProperty(r,"prototype",{writable:!1}),a}(a.Z);i().mixin(Ot.prototype);const Tt=Ot;function Dt(t){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(t)}function kt(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(e){var n=e[this._platformBridge.platformId];if(n)return this.get(t,n,r)}var o=e;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?Array.isArray(t)&&0===t.length?Promise.resolve([]):this._platformBridge.getDataFromStorage(t,o,r):Promise.reject()}},{key:"set",value:function(t,e,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(t,e,n)}var o=r;if(o||(o=this.defaultType),!this._platformBridge.isStorageAvailable(o))return Promise.reject();if(Array.isArray(t)){if(!Array.isArray(e))return Promise.reject(new Error("Value must be an array when key is an array"));if(t.length!==e.length)return Promise.reject(new Error("Key and value arrays must have the same length"));if(0===t.length)return Promise.resolve()}return this._platformBridge.setDataToStorage(t,e,o)}},{key:"delete",value:function(t,e){if(e){var r=e[this._platformBridge.platformId];if(r)return this.delete(t,r)}var n=e;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?Array.isArray(t)&&0===t.length?Promise.resolve():this._platformBridge.deleteDataFromStorage(t,n):Promise.reject()}}],r&&kt(e.prototype,r),n&&kt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(a.Z);function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ct(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.Cb.BOTTOM,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==t.Kk.LOADING&&this.bannerState!==t.Kk.SHOWN){ve(this,Ee,r);var o,i=n;if(i||null!==(o=this._platformBridge.options)&&void 0!==o&&null!==(o=o.advertisement)&&void 0!==o&&null!==(o=o.banner)&&void 0!==o&&o.placementFallback&&(i=this._platformBridge.options.advertisement.banner.placementFallback),ve(this,we,i),_e(this,Ce,Ye).call(this,t.Kk.LOADING),this.isBannerSupported){var a=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,s=_e(this,Fe,qe).call(this,i,a);this._platformBridge.showBanner(r,s)}else _e(this,Ce,Ye).call(this,t.Kk.FAILED)}}},{key:"hideBanner",value:function(){this.bannerState!==t.Kk.LOADING&&this.bannerState!==t.Kk.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:"preloadInterstitial",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=e;n&&"string"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,i=_e(this,Fe,qe).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:"showInterstitial",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!_e(this,Ne,ze).call(this)){var n,o=r;if(o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.interstitial)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.interstitial.placementFallback),ve(this,Ae,o),_e(this,Ge,Ke).call(this,t.WA.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&ge(this,Oe)&&ge(this,Oe).state===Kt)_e(this,Ge,Ke).call(this,t.WA.FAILED);else{var i=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=_e(this,Fe,qe).call(this,o,i);this._platformBridge.showInterstitial(a)}else _e(this,Ge,Ke).call(this,t.WA.FAILED)}}},{key:"preloadRewarded",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=e;n&&"string"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,i=_e(this,Fe,qe).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:"showRewarded",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!_e(this,Ne,ze).call(this)){var n;ve(this,ke,r),ge(this,ke)||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.rewarded)&&void 0!==n&&n.placementFallback&&ve(this,ke,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=_e(this,Fe,qe).call(this,ge(this,ke),o);_e(this,xe,Je).call(this,t.b3.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(i):_e(this,xe,Je).call(this,t.b3.FAILED)}}},{key:"checkAdBlock",value:function(){return this._platformBridge.checkAdBlock()}}],n&&ue(r.prototype,n),o&&ue(r,o),Object.defineProperty(r,"prototype",{writable:!1}),a}(a.Z);function He(t){ve(this,Te,t),ge(this,Oe)&&(ge(this,Oe).stop(),_e(this,Me,Ze).call(this))}function Ue(t){if("number"==typeof t)return t;if("string"==typeof t){var e=parseInt(t,10);return Number.isNaN(e)?null:e}return null}function We(){var t=_e(this,je,Ve).call(this);if(void 0!==t){var e=_e(this,Re,Ue).call(this,t);null!==e&&_e(this,Ie,He).call(this,e)}}function Ve(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.minimumDelayBetweenInterstitial}function Ze(){ge(this,Te)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(ve(this,Oe,new ae(ge(this,Te))),ge(this,Oe).start())}function ze(){var e=[t.WA.LOADING,t.WA.OPENED].includes(ge(this,Pe)),r=[t.b3.LOADING,t.b3.OPENED,t.b3.REWARDED].includes(ge(this,De));return e||r}function Ye(e){ge(this,Se)!==e&&(ve(this,Se,e),J.send("".concat(t.oF.ADVERTISEMENT,"_banner_").concat(e),t.oF.ADVERTISEMENT,{position:ge(this,Ee),placement:ge(this,we)}),this.emit(t.W1.BANNER_STATE_CHANGED,ge(this,Se)))}function Ke(e){ge(this,Pe)!==e&&(ve(this,Pe,e),J.send("".concat(t.oF.ADVERTISEMENT,"_interstitial_").concat(e),t.oF.ADVERTISEMENT,{placement:ge(this,Ae)}),this.emit(t.W1.INTERSTITIAL_STATE_CHANGED,ge(this,Pe)))}function Je(e){ge(this,De)!==e&&(ve(this,De,e),J.send("".concat(t.oF.ADVERTISEMENT,"_rewarded_").concat(e),t.oF.ADVERTISEMENT,{placement:ge(this,ke)}),this.emit(t.W1.REWARDED_STATE_CHANGED,ge(this,De)))}function qe(t,e){if(!t)return t;if(!e)return t;var r=e.find((function(e){return e.id===t}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:t}i().mixin(Be.prototype);const Xe=Be;function Qe(t){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(t)}function $e(t,e){for(var r=0;rwindow.innerWidth?t.AR.PORTRAIT:t.AR.LANDSCAPE}function Lr(){var e=mr(this,Pr,Rr).call(this);e!==vr(this,gr)&&(yr(this,gr,e),this.emit(t.W1.ORIENTATION_STATE_CHANGED,vr(this,gr)),mr(this,Or,jr).call(this))}function jr(){if(vr(this,Er))if(1===vr(this,Sr).length){var t=vr(this,Sr)[0];vr(this,gr)!==t?mr(this,Tr,Mr).call(this):mr(this,Dr,Nr).call(this)}else mr(this,Dr,Nr).call(this)}function Mr(){vr(this,br)||(yr(this,br,(0,u.dG)()),document.body.appendChild(vr(this,br)))}function Nr(){vr(this,br)&&(vr(this,br).remove(),yr(this,br,null))}i().mixin(kr.prototype);const Cr=kr;function Gr(t){return Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(t)}function xr(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xr(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function pn(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function hn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pn(i,n,o,a,s,"next",t)}function s(t){pn(i,n,o,a,s,"throw",t)}a(void 0)}))}}function dn(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Xn(t){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(t)}function Qn(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function $n(t,e,r){var n;return n=function(t,e){if("object"!=Xn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==Xn(n)?n:String(n))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var to=($n($n($n($n($n($n($n($n($n($n(Kn={},t.Lb.VK,(function(){return Promise.resolve().then(r.bind(r,631))})),t.Lb.YANDEX,(function(){return Promise.resolve().then(r.bind(r,823))})),t.Lb.CRAZY_GAMES,(function(){return Promise.resolve().then(r.bind(r,997))})),t.Lb.ABSOLUTE_GAMES,(function(){return Promise.resolve().then(r.bind(r,861))})),t.Lb.GAME_DISTRIBUTION,(function(){return Promise.resolve().then(r.bind(r,441))})),t.Lb.OK,(function(){return Promise.resolve().then(r.bind(r,474))})),t.Lb.PLAYGAMA,(function(){return Promise.resolve().then(r.bind(r,735))})),t.Lb.PLAYDECK,(function(){return Promise.resolve().then(r.bind(r,582))})),t.Lb.TELEGRAM,(function(){return Promise.resolve().then(r.bind(r,675))})),t.Lb.Y8,(function(){return Promise.resolve().then(r.bind(r,577))})),$n($n($n($n($n($n($n($n($n($n(Kn,t.Lb.LAGGED,(function(){return Promise.resolve().then(r.bind(r,88))})),t.Lb.FACEBOOK,(function(){return Promise.resolve().then(r.bind(r,353))})),t.Lb.POKI,(function(){return Promise.resolve().then(r.bind(r,514))})),t.Lb.QA_TOOL,(function(){return Promise.resolve().then(r.bind(r,334))})),t.Lb.MSN,(function(){return Promise.resolve().then(r.bind(r,288))})),t.Lb.HUAWEI,(function(){return Promise.resolve().then(r.bind(r,999))})),t.Lb.BITQUEST,(function(){return Promise.resolve().then(r.bind(r,546))})),t.Lb.GAMEPUSH,(function(){return Promise.resolve().then(r.bind(r,133))})),t.Lb.DISCORD,(function(){return Promise.resolve().then(r.bind(r,121))})),t.Lb.YOUTUBE,(function(){return Promise.resolve().then(r.bind(r,151))})),$n($n($n($n($n(Kn,t.Lb.JIO_GAMES,(function(){return Promise.resolve().then(r.bind(r,698))})),t.Lb.PORTAL,(function(){return Promise.resolve().then(r.bind(r,993))})),t.Lb.REDDIT,(function(){return Promise.resolve().then(r.bind(r,381))})),t.Lb.XIAOMI,(function(){return Promise.resolve().then(r.bind(r,788))})),t.Lb.MICROSOFT_STORE,(function(){return Promise.resolve().then(r.bind(r,572))})));function eo(t){return ro.apply(this,arguments)}function ro(){var t;return t=qn().mark((function t(e){var r,n,o;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=to[e])){t.next=7;break}return t.next=4,r();case 4:return n=t.sent,o=n.default,t.abrupt("return",o);case 7:return t.abrupt("return",Jn.Z);case 8:case"end":return t.stop()}}),t)})),ro=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qn(i,n,o,a,s,"next",t)}function s(t){Qn(i,n,o,a,s,"throw",t)}a(void 0)}))},ro.apply(this,arguments)}function no(t){return no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},no(t)}function oo(){oo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function _(){}function g(){}var b={};c(b,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(R([])));E&&E!==r&&n.call(E,a)&&(b=E);var w=g.prototype=v.prototype=Object.create(b);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==no(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function io(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function ao(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){io(i,n,o,a,s,"next",t)}function s(t){io(i,n,o,a,s,"throw",t)}a(void 0)}))}}function so(t,e){for(var r=0;r. + */ + +import PlatformBridgeBase from './PlatformBridgeBase' +import { + ACTION_NAME, + ERROR, + INTERSTITIAL_STATE, + PLATFORM_ID, + REWARDED_STATE, + STORAGE_TYPE, +} from '../constants' +import { + addJavaScript, + deformatPrice, + postToWebView, + waitFor, +} from '../common/utils' + +const PLAYGAMA_ADS_SDK_URL = 'https://playgama.com/ads/msn.v0.1.js' + +class MicrosoftStorePlatformBridge extends PlatformBridgeBase { + get platformId() { + return PLATFORM_ID.MICROSOFT_STORE + } + + // advertisement + get isInterstitialSupported() { + return true + } + + get isRewardedSupported() { + return true + } + + // payments + get isPaymentsSupported() { + return true + } + + // social + get isRateSupported() { + return true + } + + _defaultStorageType = STORAGE_TYPE.PLATFORM_INTERNAL + + #playgamaAds = null + + #interstitialShownCount = 0 + + initialize() { + if (this._isInitialized) { + return Promise.resolve() + } + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.INITIALIZE) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.INITIALIZE) + + if (!this._options || !this._options.gameId) { + this._rejectPromiseDecorator( + ACTION_NAME.INITIALIZE, + ERROR.GAME_PARAMS_NOT_FOUND, + ) + return promiseDecorator.promise + } + + try { + this.#setupHandlers() + this.#postMessage(ACTION_NAME.INITIALIZE) + } catch (error) { + this._rejectPromiseDecorator( + ACTION_NAME.INITIALIZE, + error, + ) + } + + const advertisementBackfillId = this._options?.advertisement?.backfillId + if (advertisementBackfillId) { + addJavaScript(PLAYGAMA_ADS_SDK_URL) + .then(() => waitFor('pgAds')) + .then(() => { + window.pgAds.init(advertisementBackfillId) + .then(() => { + this.#playgamaAds = window.pgAds + const { gameId } = this._options + this.#playgamaAds.updateTargeting({ gameId }) + }) + .then(() => { + this.showInterstitial() + }) + }) + } + } + + return promiseDecorator.promise + } + + showInterstitial() { + this.#interstitialShownCount += 1 + + if (this.#interstitialShownCount === 3) { + this._setInterstitialState(INTERSTITIAL_STATE.CLOSEDs) + return this.rate() + } + + if (!this.#playgamaAds) { + return this._advertisementShowErrorPopup(false) + } + + return new Promise((resolve) => { + this.#playgamaAds.requestOutOfPageAd('interstitial') + .then((adInstance) => { + switch (adInstance.state) { + case 'empty': + this._advertisementShowErrorPopup(false).then(() => resolve()) + return + case 'ready': + this._setInterstitialState(INTERSTITIAL_STATE.OPENED) + adInstance.show() + break + default: + break + } + + adInstance.addEventListener('ready', () => { + this._setInterstitialState(INTERSTITIAL_STATE.OPENED) + adInstance.show() + }) + + adInstance.addEventListener('empty', () => { + this._advertisementShowErrorPopup(false).then(() => resolve()) + }) + + adInstance.addEventListener('closed', () => { + this._setInterstitialState(INTERSTITIAL_STATE.CLOSED) + resolve() + }) + }) + }) + } + + showRewarded() { + if (!this.#playgamaAds) { + return this._advertisementShowErrorPopup(true) + } + + return new Promise((resolve) => { + this.#playgamaAds.requestOutOfPageAd('rewarded') + .then((adInstance) => { + switch (adInstance.state) { + case 'empty': + this._advertisementShowErrorPopup(true).then(() => resolve()) + return + case 'ready': + this._setRewardedState(REWARDED_STATE.OPENED) + adInstance.show() + break + default: + break + } + + adInstance.addEventListener('ready', () => { + this._setRewardedState(REWARDED_STATE.OPENED) + adInstance.show() + }) + + adInstance.addEventListener('rewarded', () => { + this._setRewardedState(REWARDED_STATE.REWARDED) + }) + + adInstance.addEventListener('empty', () => { + this._advertisementShowErrorPopup(true).then(() => resolve()) + }) + + adInstance.addEventListener('closed', () => { + this._setRewardedState(REWARDED_STATE.CLOSED) + resolve() + }) + }) + }) + } + + // storage + isStorageSupported(storageType) { + if (storageType === STORAGE_TYPE.PLATFORM_INTERNAL) { + return true + } + + return super.isStorageSupported(storageType) + } + + isStorageAvailable(storageType) { + if (storageType === STORAGE_TYPE.PLATFORM_INTERNAL) { + return true + } + + return super.isStorageAvailable(storageType) + } + + setDataToStorage(key, value, type) { + if (type !== STORAGE_TYPE.PLATFORM_INTERNAL) { + return super.setDataToStorage(key, value, type) + } + + const keyWithPrefix = this.#withStorageKeyPrefix(key) + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.SET_STORAGE_DATA) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.SET_STORAGE_DATA) + + this.#postMessage(ACTION_NAME.SET_STORAGE_DATA, { key: keyWithPrefix, value }) + } + + return promiseDecorator.promise + } + + getDataFromStorage(key, type) { + if (type !== STORAGE_TYPE.PLATFORM_INTERNAL) { + return super.getDataFromStorage(key, type) + } + + const keyWithPrefix = this.#withStorageKeyPrefix(key) + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.GET_STORAGE_DATA) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.GET_STORAGE_DATA) + + this.#postMessage(ACTION_NAME.GET_STORAGE_DATA, keyWithPrefix) + } + + return promiseDecorator.promise + } + + deleteDataFromStorage(key, type) { + if (type !== STORAGE_TYPE.PLATFORM_INTERNAL) { + return super.deleteDataFromStorage(key, type) + } + + const keyWithPrefix = this.#withStorageKeyPrefix(key) + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.DELETE_STORAGE_DATA) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.DELETE_STORAGE_DATA) + + this.#postMessage(ACTION_NAME.DELETE_STORAGE_DATA, keyWithPrefix) + } + + return promiseDecorator.promise + } + + paymentsPurchase(id) { + const product = this._paymentsGetProductPlatformData(id) + if (!product) { + return Promise.reject() + } + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.PURCHASE) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.PURCHASE) + this.#postMessage(ACTION_NAME.PURCHASE, product.platformProductId) + } + + return promiseDecorator.promise + } + + paymentsConsumePurchase(id) { + const purchaseIndex = this._paymentsPurchases.findIndex((p) => p.id === id) + const product = this._paymentsGetProductPlatformData(id) + + if (purchaseIndex < 0 || !product) { + return Promise.reject() + } + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.CONSUME_PURCHASE) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.CONSUME_PURCHASE) + this.#postMessage(ACTION_NAME.CONSUME_PURCHASE, product.platformProductId) + } + + return promiseDecorator.promise + } + + paymentsGetCatalog() { + const products = this._paymentsGetProductsPlatformData() + if (!products) { + return Promise.reject() + } + + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.GET_CATALOG) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.GET_CATALOG) + this.#postMessage(ACTION_NAME.GET_CATALOG, products.map(({ platformProductId }) => platformProductId)) + } + + return promiseDecorator.promise + } + + paymentsGetPurchases() { + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.GET_PURCHASES) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.GET_PURCHASES) + this.#postMessage(ACTION_NAME.GET_PURCHASES) + } + + return promiseDecorator.promise + } + + rate() { + let promiseDecorator = this._getPromiseDecorator(ACTION_NAME.RATE) + if (!promiseDecorator) { + promiseDecorator = this._createPromiseDecorator(ACTION_NAME.RATE) + this.#postMessage(ACTION_NAME.RATE) + this._pauseStateAggregator.setState('rate', true) + } + + return promiseDecorator.promise + } + + #getStorageKeyPrefix() { + const gameId = this._options?.gameId + return gameId ? `pg_${gameId}_` : null + } + + #withStorageKeyPrefix(key) { + const prefix = this.#getStorageKeyPrefix() + if (!prefix) { + return key + } + + if (Array.isArray(key)) { + return key.map((k) => `${prefix}${k}`) + } + + return `${prefix}${key}` + } + + #postMessage(action, data) { + postToWebView(JSON.stringify({ action, data })) + } + + #setupHandlers() { + window.chrome.webview.addEventListener('message', (event) => { + try { + let { data } = event + + if (typeof event.data === 'string') { + data = JSON.parse(event.data) + } + + const { action } = data || {} + + if (action === ACTION_NAME.INITIALIZE) { + this.#initialize(data) + } else if (action === ACTION_NAME.GET_CATALOG) { + this.#getCatalog(data) + } else if (action === ACTION_NAME.PURCHASE) { + this.#purchase(data) + } else if (action === ACTION_NAME.CONSUME_PURCHASE) { + this.#consumePurchase(data) + } else if (action === ACTION_NAME.GET_PURCHASES) { + this.#getPurchases(data) + } else if (action === ACTION_NAME.RATE) { + this.#rate(data) + } else if (action === ACTION_NAME.GET_STORAGE_DATA) { + this.#getStorageData(data) + } else if (action === ACTION_NAME.SET_STORAGE_DATA) { + this.#setStorageData(data) + } else if (action === ACTION_NAME.DELETE_STORAGE_DATA) { + this.#deleteStorageData(data) + } + } catch (error) { + console.error('Error parsing Microsoft Store message:', error) + } + }) + } + + #initialize(data) { + if (data && data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.INITIALIZE, + new Error(data), + ) + return + } + + this._isInitialized = true + this._resolvePromiseDecorator(ACTION_NAME.INITIALIZE, data) + } + + #getCatalog(data) { + if (!data || data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.GET_CATALOG, + new Error(data), + ) + return + } + + const products = this._paymentsGetProductsPlatformData() + const mergedProducts = products.map((product) => { + const msProduct = data.data?.find((p) => p.id === product.platformProductId) + + const priceValue = deformatPrice(msProduct?.price?.formattedPrice) + const priceCurrencyCode = msProduct?.price?.currencyCode || null + const price = `${priceValue} ${priceCurrencyCode}` + + return { + id: product.id, + title: msProduct?.title, + description: msProduct?.description, + price, + priceValue, + priceCurrencyCode, + } + }) + + this._resolvePromiseDecorator(ACTION_NAME.GET_CATALOG, mergedProducts) + } + + #purchase(data) { + if (!data || data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.PURCHASE, + new Error(data), + ) + return + } + + const products = this._paymentsGetProductsPlatformData() + const product = products.find( + (p) => p.platformProductId === data.data?.id, + ) + + const mergedPurchase = { + id: product?.id, + platformProductId: data.data?.id, + status: data.data?.status, + } + + this._paymentsPurchases.push(mergedPurchase) + this._resolvePromiseDecorator(ACTION_NAME.PURCHASE, mergedPurchase) + } + + #consumePurchase(data) { + if (!data || data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.CONSUME_PURCHASE, + new Error(data), + ) + return + } + + const purchaseIndex = this._paymentsPurchases.findIndex( + (p) => p.id === data.data?.id, + ) + + if (purchaseIndex >= 0) { + this._paymentsPurchases.splice(purchaseIndex, 1) + } + + this._resolvePromiseDecorator(ACTION_NAME.CONSUME_PURCHASE, data) + } + + #getPurchases(data) { + if (!data || data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.GET_PURCHASES, + new Error(data), + ) + return + } + + const products = this._paymentsGetProductsPlatformData() + + this._paymentsPurchases = (data.data || []) + .filter(({ isActive }) => isActive) + .map((purchase) => { + const product = products.find( + (p) => p.platformProductId === purchase.id, + ) + + return { + id: product?.id, + platformProductId: purchase.id, + status: purchase.status, + } + }) + + this._resolvePromiseDecorator(ACTION_NAME.GET_PURCHASES, this._paymentsPurchases) + } + + #rate(data) { + this._pauseStateAggregator.setState('rate', false) + + if (!data || data.success === false) { + this._rejectPromiseDecorator( + ACTION_NAME.RATE, + new Error(data), + ) + return + } + + this._resolvePromiseDecorator(ACTION_NAME.RATE) + } + + // storage + #getStorageData(data) { + if (!data?.success) { + this._rejectPromiseDecorator( + ACTION_NAME.GET_STORAGE_DATA, + new Error(data), + ) + return + } + + this._resolvePromiseDecorator(ACTION_NAME.GET_STORAGE_DATA, data.data) + } + + #setStorageData(data) { + if (!data?.success) { + this._rejectPromiseDecorator( + ACTION_NAME.SET_STORAGE_DATA, + new Error(data), + ) + return + } + + this._resolvePromiseDecorator(ACTION_NAME.SET_STORAGE_DATA, data.data) + } + + #deleteStorageData(data) { + if (!data?.success) { + this._rejectPromiseDecorator( + ACTION_NAME.DELETE_STORAGE_DATA, + new Error(data), + ) + return + } + + this._resolvePromiseDecorator(ACTION_NAME.DELETE_STORAGE_DATA, data.data) + } +} + +export default MicrosoftStorePlatformBridge diff --git a/src/platform-bridges/PlatformBridgeBase.js b/src/platform-bridges/PlatformBridgeBase.js index c902ac3..a76f927 100644 --- a/src/platform-bridges/PlatformBridgeBase.js +++ b/src/platform-bridges/PlatformBridgeBase.js @@ -262,7 +262,7 @@ class PlatformBridgeBase { this._visibilityState = document.visibilityState - const aggregationStates = ['interstitial', 'rewarded', 'visibility', 'platform'] + const aggregationStates = ['interstitial', 'rewarded', 'visibility', 'platform', 'rate'] this._pauseStateAggregator = new StateAggregator( aggregationStates, (isPaused) => this.emit(EVENT_NAME.PAUSE_STATE_CHANGED, isPaused), diff --git a/src/platformImports.js b/src/platformImports.js index 4f184ae..c5404ff 100644 --- a/src/platformImports.js +++ b/src/platformImports.js @@ -43,6 +43,7 @@ const platformImports = { [PLATFORM_ID.PORTAL]: () => import('./platform-bridges/PortalPlatformBridge'), [PLATFORM_ID.REDDIT]: () => import('./platform-bridges/RedditPlatformBridge'), [PLATFORM_ID.XIAOMI]: () => import('./platform-bridges/XiaomiPlatformBridge'), + [PLATFORM_ID.MICROSOFT_STORE]: () => import('./platform-bridges/MicrosoftStorePlatformBridge'), } export async function fetchPlatformBridge(platformId) {