/* * Project: @gamedistribution.com/html5-sdk * Description: GameDistribution.com HTML5 SDK * Development By: GameDistribution.com * Copyright(c): 2019 * Version: 1.2.15 (29-05-2019 12:59) */ !function e(t,n,o){function i(s,a){if(!n[s]){if(!t[s]){var d="function"==typeof require&&require;if(!a&&d)return d(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(n>>>18),b64chars.charAt(n>>>12&63),t>=2?"=":b64chars.charAt(n>>>6&63),t>=1?"=":b64chars.charAt(63&n)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][€-¿]","[à -ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,n=t%4,o=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),i=[fromCharCode(o>>>16),fromCharCode(o>>>8&255),fromCharCode(255&o)];return i.length-=[0,0,2,1][n],i.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),void 0!==module&&module.exports?module.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===o||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function a(){m&&f&&(m=!1,f.length?p=f.concat(p):b=-1,p.length&&d())}function d(){if(!m){var e=r(a);m=!0;for(var t=p.length;t;){for(f=p,p=[];++b1)for(var n=1;n-1?t:e}function g(e,t){var n=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=h(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),o=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}),t}function p(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),o=n.shift().trim();if(o){var i=n.join(":").trim();t.append(o,i)}}),t}function m(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&v.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,o){e=t(e),o=n(o);var i=this.map[e];this.map[e]=i?i+","+o:o},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,o){this.map[t(e)]=n(o)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},b.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},l.call(g.prototype),l.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];m.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=g,e.Response=m,e.fetch=function(e,t){return new Promise(function(n,o){var i=new g(e,t),r=new XMLHttpRequest;r.onload=function(){var e={status:r.status,statusText:r.statusText,headers:p(r.getAllResponseHeaders()||"")};e.url="responseURL"in r?r.responseURL:e.headers.get("X-Request-URL");var t="response"in r?r.response:r.responseText;n(new m(t,e))},r.onerror=function(){o(new TypeError("Network request failed"))},r.ontimeout=function(){o(new TypeError("Network request failed"))},r.open(i.method,i.url,!0),"include"===i.credentials&&(r.withCredentials=!0),"responseType"in r&&b.blob&&(r.responseType="blob"),i.headers.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],6:[function(e,t,n){t.exports={name:"@gamedistribution.com/html5-sdk",version:"1.2.15",author:"GameDistribution.com",description:"GameDistribution.com HTML5 SDK",url:"https://gamedistribution.com",license:"MIT",main:"lib/main.js",scripts:{test:'echo "Error: no test specified" && exit 1'},directories:{doc:"https://github.com/GameDistribution/GD-HTML5/wiki"},repository:{type:"git",url:"git@github.com:GameDistribution/GD-HTML5.git"},dependencies:{"es6-promise":"^4.1.1","js-base64":"^2.5.1","whatwg-fetch":"^2.0.3"},devDependencies:{"babel-eslint":"^8.0.0","babel-preset-env":"^1.6.1",babelify:"^7.2.0",eslint:"^4.7.0","eslint-config-google":"^0.9.1","eslint-friendly-formatter":"^3.0.0","eslint-loader":"^1.7.1","eslint-plugin-html":"^3.0.0","eslint-plugin-promise":"^3.4.0","eslint-plugin-standard":"^2.0.1",grunt:"^1.0.4","grunt-banner":"^0.6.0","grunt-browser-sync":"^2.2.0","grunt-browserify":"^5.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^3.1.0","grunt-contrib-watch":"^1.0.0","grunt-exec":"^3.0.0","grunt-google-cloud":"^1.0.7"},engines:{node:">= 10.15.0",npm:">= 6.6.0"}}},{}],7:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n=0||(o={callback:t,scope:n},this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(o))}},{key:"broadcast",value:function(e,t){var n=this.listeners[e];e&&this.listeners[e]&&(t=t||{},n.forEach(function(e){e.callback.call(e.scope,t)}))}}]),e}();n.default=s},{}],8:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n\n \n \n \n \n \n \n \n \n \n \n ',o.appendChild(i);var r=document.getElementById("gdsdk__pauseGame"),s=document.getElementById("gdsdk__resumeGame"),a=document.getElementById("gdsdk__showBanner"),d=document.getElementById("gdsdk__cancel"),c=document.getElementById("gdsdk__demo"),u=document.getElementById("gdsdk__midrollTimer"),l=document.getElementById("gdsdk__hbgdDebug"),h=document.getElementById("gdsdk__hbgdConfig"),g=document.getElementById("gdsdk__closeDebug");localStorage.getItem("gd_tag")?(c.innerHTML="Revert Vast tag",c.style.background="#ff8c1c"):(c.innerHTML="Demo VAST tag",c.style.background="#44a5ab"),localStorage.getItem("gd_midroll")?(u.innerHTML="Revert delay",u.style.background="#ff8c1c"):(u.innerHTML="Disable delay",u.style.background="#44a5ab"),r.addEventListener("click",function(){window.gdsdk.onPauseGame("Pause game requested from debugger","warning")}),s.addEventListener("click",function(){window.gdsdk.onResumeGame("Resume game requested from debugger","warning")}),a.addEventListener("click",function(){window.gdsdk.showBanner()}),d.addEventListener("click",function(){window.gdsdk.videoAdInstance.requestAttempts=0,window.gdsdk.videoAdInstance.cancel()}),c.addEventListener("click",function(){try{if(localStorage.getItem("gd_tag"))localStorage.removeItem("gd_tag");else{localStorage.setItem("gd_tag","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=")}location.reload()}catch(e){console.log(e)}}),u.addEventListener("click",function(){try{localStorage.getItem("gd_midroll")?localStorage.removeItem("gd_midroll"):localStorage.setItem("gd_midroll","0"),location.reload()}catch(e){console.log(e)}}),g.addEventListener("click",function(){try{localStorage.getItem("gd_debug")?localStorage.removeItem("gd_debug"):localStorage.setItem("gd_debug","0"),location.reload()}catch(e){console.log(e)}}),l.addEventListener("click",function(){try{window.idhbgd.debug(!0)}catch(e){console.log(e)}}),h.addEventListener("click",function(){try{var e=window.idhbgd.getConfig();console.info(e)}catch(e){console.log(e)}})}}]),e}();n.default=a},{"../components/EventBus":7}],9:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0&&t.forEach(function(e){return n.push(e)}),n=encodeURIComponent(r.Base64.encode(JSON.stringify(n))),fetch(this._url+"?tp=com.gdsdk."+e+"&ar="+n+"&ts="+Date.now())}}]),e}();n.default=s},{"js-base64":3,"whatwg-fetch":5}],10:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"1":"0",this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:u,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:l,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.adsLoaderPromise=new Promise(function(e,t){a.eventBus.subscribe("AD_SDK_LOADER_READY",function(){return e()}),a.eventBus.subscribe("AD_CANCELED",function(){return t(new Error("Initial adsLoaderPromise failed to load."))})}),this._loadScripts().then(function(){a._createPlayer(),a._setUpIMA()}).catch(function(e){return a.onError(e)}),window.idhbgd=window.idhbgd||{},window.idhbgd.que=window.idhbgd.que||[]}return i(e,[{key:"start",value:function(){var e=this;this._startSafetyTimer(12e3,"start()"),this.eventBus.subscribe("AD_SDK_LOADER_READY",function(){e._clearSafetyTimer("AD_SDK_LOADER_READY")}),this.eventBus.subscribe("AD_SDK_MANAGER_READY",function(){e._clearSafetyTimer("AD_SDK_MANAGER_READY")}),this.eventBus.subscribe("LOADED",function(){e._clearSafetyTimer("LOADED"),e._startSafetyTimer(8e3,"LOADED")}),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){e._show()}),this.eventBus.subscribe("STARTED",function(){e._clearSafetyTimer("STARTED")})}},{key:"requestAd",value:function(){var e=this;return new Promise(function(t,n){if(e.requestRunning)(0,a.dankLog)("AD_SDK_REQUEST","A request is already running","warning");else{e.requestRunning=!0,1===e.adTypeCount&&(e.adCount=0),e.adCount++,e.adTypeCount++;try{localStorage.getItem("gd_debug")&&localStorage.getItem("gd_tag")?t(localStorage.getItem("gd_tag")):e._tunnlReportingKeys().then(function(o){void 0===window.idhbgd.requestAds&&n("Prebid.js wrapper script hit an error or didn't exist!");var i=(o.nsid?o.nsid:"TNL_T-17102571517")+"/"+(o.tid?o.tid:"TNL_NS-18101700058");delete o.nsid,delete o.tid,(0,a.dankLog)("AD_SDK_AD_UNIT",i,"info");var r=o.consent_string?o.consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA";Object.assign(o,{tnl_system:"1",tnl_content_category:e.category.toLowerCase()}),void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_REQUEST",eventAction:e.parentDomain,eventLabel:i});var s="0"===e.userDeclinedPersonalAds;window.idhbgd.que.push(function(){window.idhbgd.setAdserverTargeting(o),window.idhbgd.setDfpAdUnitCode(i),window.idhbgd.setRefererUrl(encodeURIComponent(e.parentUrl)),window.idhbgd.allowPersonalizedAds(s),window.idhbgd.setDefaultGdprConsentString(r),window.idhbgd.requestAds({callback:function(e){t(e)}})})}).catch(function(e){console.log(e),n(e)})}catch(e){n(e)}}})}},{key:"_tunnlReportingKeys",value:function(){var e=this;return new Promise(function(t){var n="";n=!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==s.getParentDomain?"page_url="+encodeURIComponent(e.parentUrl):"bundle=com.hopy.frivgames";var o=(0,s.getMobilePlatform)(),i=1===e.adTypeCount?"preroll1":"midroll"+e.adCount.toString(),r=(0,s.getQueryString)("ch",window.location.href),a=(0,s.getQueryString)("ch_date",window.location.href),d=r?"&ch="+r:"",c=a?"&ch_date="+a:"",u="https://pub.tunnl.com/opphb?"+n+"&player_width="+e.options.width+"&player_height="+e.options.height+"&ad_type=video_image&os="+o+"&game_id="+e.gameId+"&ad_position="+i+d+c+"&correlator="+Date.now(),l=new Request(u,{method:"GET"});fetch(l).then(function(e){var t=e.headers.get("content-type");if(t&&-1!==t.indexOf("application/json"))return e.json();throw new TypeError("Oops, we didn't get JSON!")}).then(function(e){return t(e)}).catch(function(n){console.log(n);var o={tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:e.options.width,tnl_ph:e.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:e.gameId.toString(),tnl_ad_pos:i,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:e.category.toLowerCase()};void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_REQUEST_FALLBACK",eventAction:e.parentUrl,eventLabel:n}),t(o)})})}},{key:"loadAd",value:function(e){if("undefined"!=typeof google)try{var t=new google.ima.AdsRequest;if(t.adTagUrl=e,(0,a.dankLog)("AD_SDK_TAG_URL",t.adTagUrl,"success"),t.linearAdSlotWidth=this.options.width,t.linearAdSlotHeight=this.options.height,t.nonLinearAdSlotWidth=this.options.width,t.nonLinearAdSlotHeight=this.options.height,t.forceNonLinearFullSlot=!0,void 0!==window.ga){var n=new Date,o=n.getHours(),i=n.getDate(),r=n.getMonth(),s=n.getFullYear();window.ga("gd.send",{hitType:"event",eventCategory:1===this.adTypeCount?"AD_PREROLL":"AD_MIDROLL",eventAction:this.parentDomain+" | h"+o+" d"+i+" m"+r+" y"+s,eventLabel:e})}this.adsLoader.requestAds(t)}catch(e){this._onAdError(e)}else this.onError("Unable to load ad, google IMA SDK not defined.")}},{key:"cancel",value:function(){var e=this;this.adsLoaderPromise.then(function(){e.adsLoader&&e.adsLoader.contentComplete(),e.adsManager&&e.adsManager.destroy(),e._hide(),e.requestRunning=!1}).catch(function(){console.log(new Error("adsLoaderPromise failed to load."))});this.eventBus.broadcast("AD_CANCELED",{name:"AD_CANCELED",message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:"AD_CANCELED",label:this.gameId}})}},{key:"onError",value:function(e){this.eventBus.broadcast("AD_SDK_ERROR",{name:"AD_SDK_ERROR",message:e,status:"error",analytics:{category:this.eventCategory,action:"AD_SDK_ERROR",label:e}}),this.cancel(),this._clearSafetyTimer("AD_SDK_ERROR")}},{key:"_hide",value:function(){var e=this;this.adContainer&&(this.adContainer.style.opacity="0",this.thirdPartyContainer&&(this.thirdPartyContainer.style.opacity="0"),setTimeout(function(){e.adContainer.style.transform="translateX(-9999px)",e.adContainer.style.zIndex="0",e.thirdPartyContainer&&(e.thirdPartyContainer.style.transform="translateX(-9999px)",e.thirdPartyContainer.style.zIndex="0")},this.canRequestPreroll()?0:this.containerTransitionSpeed))}},{key:"_show",value:function(){var e=this;this.adContainer&&(this.adContainer.style.transform="translateX(0)",this.adContainer.style.zIndex="99",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform="translateX(0)",this.thirdPartyContainer.style.zIndex="99",this.thirdPartyContainer.style.display="block"),setTimeout(function(){e.adContainer.style.opacity="1",e.thirdPartyContainer&&(e.thirdPartyContainer.style.opacity="1")},10))}},{key:"_loadScripts",value:function(){var e=this,t=new Promise(function(t,n){var o=e.options.debug?"//imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"//imasdk.googleapis.com/js/sdkloader/ima3.js",i=document.getElementsByTagName("script")[0],r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=o,r.onload=function(){t()},r.onerror=function(){n("IMA script failed to load! Probably due to an ADBLOCKER!")},i.parentNode.insertBefore(r,i)}),n=new Promise(function(t,n){var o=e.options.debug?"https://test-hb.improvedigital.com/pbw/gameDistribution.min.js?v=1":"https://hb.improvedigital.com/pbw/gameDistribution.min.js?v=1",i=document.getElementsByTagName("script")[0],r=document.createElement("script");r.type="text/javascript",r.id="idhbgd",r.async=!0,r.src=o,r.onload=function(){t()},r.onerror=function(){n("Prebid.js failed to load! Probably due to an ADBLOCKER!")},i.parentNode.insertBefore(r,i)});return Promise.all([t,n])}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id=this.prefix+"advertisement",this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex="0",this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.adContainer.style.transform="translateX(-9999px)",this.adContainer.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.adContainer.style.opacity="0",this.adContainer.style.transition="opacity "+this.containerTransitionSpeed+"ms cubic-bezier(0.55, 0, 0.1, 1)",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform="translateX(-9999px)",this.thirdPartyContainer.style.opacity="0",this.thirdPartyContainer.style.transition="opacity "+this.containerTransitionSpeed+"ms cubic-bezier(0.55, 0, 0.1, 1)");var n=document.createElement("div");n.id=this.prefix+"advertisement_slot",n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.thirdPartyContainer?(this.adContainer.appendChild(n),this.thirdPartyContainer.appendChild(this.adContainer)):(this.adContainer.appendChild(n),t.appendChild(this.adContainer)),window.addEventListener("resize",function(){var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e.options.width=e.thirdPartyContainer?e.thirdPartyContainer.offsetWidth:t,e.options.height=e.thirdPartyContainer?e.thirdPartyContainer.offsetHeight:o,n.style.width=e.options.width+"px",n.style.height=e.options.height+"px"})}},{key:"_setUpIMA",value:function(){google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.INSECURE),google.ima.settings.setLocale(this.options.locale),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.adDisplayContainer=new google.ima.AdDisplayContainer(document.getElementById(this.prefix+"advertisement_slot")),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this);var e=new Date,t=e.getHours(),n=e.getDate(),o=e.getMonth(),i=e.getFullYear(),r="AD_SDK_LOADER_READY";this.eventBus.broadcast(r,{name:r,message:this.options,status:"success",analytics:{category:r,action:this.parentDomain,label:"h"+t+" d"+n+" m"+o+" y"+i}})}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;if(n.enablePreloading=!0,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){t.adsManager.resize(t.options.width,t.options.height,google.ima.ViewMode.NORMAL)}),this.adsManager&&this.adDisplayContainer){var o=new Date,i=o.getHours(),r=o.getDate(),s=o.getMonth(),a=o.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:this.adsManager,status:"success",analytics:{category:d,action:this.parentDomain,label:"h"+i+" d"+r+" m"+s+" y"+a}}),this.adDisplayContainer.initialize();try{this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start()}catch(e){this.onError(e)}}}},{key:"_onAdEvent",value:function(e){var t=this,n=new Date,o=n.getHours(),i=n.getDate(),r=n.getMonth(),s=n.getFullYear(),a="",d="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:a="AD_BREAK_READY",d="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:a="AD_METADATA",d="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:a="ALL_ADS_COMPLETED",d="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:a="CLICK",d="Fired when the ad is clicked.";break;case google.ima.AdEvent.Type.COMPLETE:a="COMPLETE",d="Fired when the ad completes playing.";break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:a="CONTENT_PAUSE_REQUESTED",d="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:a="CONTENT_RESUME_REQUESTED",d="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",this._hide(),this.adsLoaderPromise.then(function(){if(t.adsLoader&&t.adsLoader.contentComplete(),t.adsManager&&t.adsManager.destroy(),1===t.adCount){var e=[];t.tags.forEach(function(t){e.push(t.title.toLowerCase())});var n=t.category.toLowerCase();t._loadDisplayAd(t.gameId,e,n)}t.requestRunning=!1;t.eventBus.broadcast("AD_SDK_FINISHED",{name:"AD_SDK_FINISHED",message:"IMA is ready for new requests.",status:"success",analytics:{category:"AD_SDK_FINISHED",action:t.parentDomain,label:"h"+o+" d"+i+" m"+r+" y"+s}})}).catch(function(){console.log(new Error("adsLoaderPromise failed to load."))});break;case google.ima.AdEvent.Type.DURATION_CHANGE:a="DURATION_CHANGE",d="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:a="FIRST_QUARTILE",d="Fired when the ad playhead crosses first quartile.";break;case google.ima.AdEvent.Type.IMPRESSION:a="IMPRESSION",d="Fired when the impression URL has been pinged.";try{if(void 0!==window.pbjsgd){var c=window.pbjsgd.getHighestCpmBids();this.options.debug&&console.log("Winner(s)",c),c.length>0?c.forEach(function(e){void 0!==window.ga&&e.bidder&&window.ga("gd.send",{hitType:"event",eventCategory:"IMPRESSION_"+e.bidder.toUpperCase(),eventAction:t.parentDomain,eventLabel:"h"+o+" d"+i+" m"+r+" y"+s})}):void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"IMPRESSION_ADEXCHANGE",eventAction:this.parentDomain,eventLabel:"h"+o+" d"+i+" m"+r+" y"+s})}}catch(e){console.log(e)}break;case google.ima.AdEvent.Type.INTERACTION:a="INTERACTION",d="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:a="LINEAR_CHANGED",d="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:a="LOADED",d=e.getAd().getContentType();break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(a="LOG",d=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:a="MIDPOINT",d="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:a="PAUSED",d="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:a="RESUMED",d="Fired when the ad is resumed.";break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:a="SKIPPABLE_STATE_CHANGED",d="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:a="SKIPPED",d="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:a="STARTED",d="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:a="THIRD_QUARTILE",d="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:a="USER_CLOSE",d="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:a="VOLUME_CHANGED",d="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:a="VOLUME_MUTED",d="Fired when the ad volume has been muted."}""!==a&&""!==d&&this.eventBus.broadcast(a,{name:a,message:d,status:"success",analytics:{category:a,action:this.parentDomain,label:"h"+o+" d"+i+" m"+r+" y"+s}})}},{key:"_onAdError",value:function(e){this.cancel(),this._clearSafetyTimer("AD_ERROR");try{if(void 0!==window.ga){var t=e.getError().getMessage();this.eventBus.broadcast("AD_ERROR",{name:"AD_ERROR",message:t,status:"warning",analytics:{category:"AD_ERROR",action:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),label:t}})}if(void 0!==window.pbjsgd){var n=window.pbjsgd.getHighestCpmBids();this.options.debug&&console.log("Failed winner(s) ",n),n.length>0?n.forEach(function(t){var n=t.adId?t.adId:null,o=t.creativeId?t.creativeId:null;void 0!==window.ga&&t.bidder&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_ERROR_"+t.bidder.toUpperCase(),eventAction:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),eventLabel:n+" | "+o})}):void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_ERROR_ADEXCHANGE",eventAction:e.getError().getErrorCode().toString()||e.getError().getVastErrorCode().toString(),eventLabel:e.getError().getMessage()})}}catch(e){console.log(e)}}},{key:"_startSafetyTimer",value:function(e,t){var n=this;(0,a.dankLog)("AD_SAFETY_TIMER","Invoked timer from: "+t,"success"),this.safetyTimer=window.setTimeout(function(){n.eventBus.broadcast("AD_SAFETY_TIMER",{name:"AD_SAFETY_TIMER",message:"Advertisement took too long to load.",status:"warning",analytics:{category:n.eventCategory,action:"AD_SAFETY_TIMER",label:n.gameId}}),n.cancel(),n._clearSafetyTimer(t)},e)}},{key:"_clearSafetyTimer",value:function(e){if(void 0!==this.safetyTimer&&null!==this.safetyTimer&&((0,a.dankLog)("AD_SAFETY_TIMER","Cleared timer set at: "+e,"success"),clearTimeout(this.safetyTimer),this.safetyTimer=void 0,"requestAd()"===e)){var t=new Date,n=t.getHours(),o=t.getDate(),i=t.getMonth(),r=t.getFullYear();void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"AD_SDK_AD_REQUEST_ERROR",eventAction:"h"+n+" d"+o+" m"+i+" y"+r})}}},{key:"_loadDisplayAd",value:function(e,t,n){var o=this,i=document.body||document.getElementsByTagName("body")[0],r=document.createElement("div");r.id=this.prefix+"baguette",r.style.zIndex="100",r.style.position="absolute",r.style.top="0",r.style.left="0",i.appendChild(r);var s=document.createElement("script");s.async=!0,s.type="text/javascript";var a="https:"===document.location.protocol;s.src=(a?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(s,d),window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],googletag.cmd.push(function(){var i=[];i[0]=googletag.defineSlot("/1015413/Gamedistribution_ingame_1x1_crosspromo",[1,1],o.prefix+"baguette").setCollapseEmptyDiv(!0,!0).addService(googletag.pubads()),googletag.pubads().setTargeting("crossid",e),googletag.pubads().setTargeting("crosstags",t),googletag.pubads().setTargeting("crosscategory",n),googletag.pubads().disableInitialLoad(),googletag.enableServices(),googletag.display(o.prefix+"baguette"),googletag.pubads().refresh([i[0]])})}}]),e}();n.default=c},{"../components/EventBus":7,"../modules/common":13,"../modules/dankLog":14}],11:[function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){return e&&e.__esModule?e:{default:e}}(e("./main")),r="object"===("undefined"==typeof GD_OPTIONS?"undefined":o(GD_OPTIONS))&&GD_OPTIONS?GD_OPTIONS:window.gdApi&&"object"===o(window.gdApi.q[0][0])&&window.gdApi.q[0][0]?window.gdApi.q[0][0]:{};window.gdApi&&"object"===o(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&(r.hasOwnProperty("advertisementSettings")||(r.advertisementSettings={autoplay:!0})),window.gdsdk=new i.default(r),window.gdApi=window.gdsdk},{"./main":12}],12:[function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var n=0;n=0||document.cookie.indexOf("ogdpr_tracking=0")>=0;if(this._analytics(m,p),["razda.com","74.127.72.247"].indexOf(p)>-1)return void 0!==window.ga&&window.ga("gd.send",{hitType:"event",eventCategory:"SDK_BLOCKED",eventAction:p,eventLabel:this.options.gameId+""}),void(document.location="/blocked.html?domain="+p+"&localTime="+(new Date).getHours());var b=[];this.options.testing=this.options.testing||b.indexOf(p)>-1,this.options.testing&&(0,h.dankLog)("SDK_TESTING_ENABLED",this.options.testing,"info"),this.whitelabelPartner=!1;var v=(0,g.getQueryParams)("xanthophyll");v.hasOwnProperty("xanthophyll")&&"true"===v.xanthophyll&&(this.whitelabelPartner=!0,(0,h.dankLog)("SDK_WHITELABEL",this.whitelabelPartner,"success"));try{if("developer.gamedistribution.com"===p){localStorage.setItem("gd_debug","true"),localStorage.setItem("gd_midroll","0");localStorage.setItem("gd_tag","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=")}else"html5.api.gamedistribution.com"!==p&&"localhost:3000"!==p||(localStorage.setItem("gd_debug","true"),localStorage.setItem("gd_midroll","0"));localStorage.getItem("gd_debug")&&this.openConsole()}catch(e){console.log(e)}(new Image).src="https://ana.tunnl.com/event?page_url="+encodeURIComponent(u)+"&game_id="+this.options.gameId+"&eventtype=1",this.eventBus=new c.default,this.eventBus.gameId=this.options.gameId+"",this.eventBus.subscribe("SDK_BLOCKED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_DATA_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_START",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GAME_PAUSE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_TRACKING",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_TARGETING",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SDK_GDPR_THIRD_PARTY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_LOADER_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_MANAGER_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_REQUEST_ADS",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SDK_FINISHED",function(e){n._onEvent(e),n._checkPrerollRequest(e)}),this.eventBus.subscribe("AD_CANCELED",function(e){n._onEvent(e),n.onResumeGame("Advertisement error, no worries, start / resume the game.","warning")}),this.eventBus.subscribe("AD_ERROR",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_SAFETY_TIMER",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_BREAK_READY",function(e){return n._onEvent(e)}),this.eventBus.subscribe("AD_METADATA",function(e){return n._onEvent(e)}),this.eventBus.subscribe("ALL_ADS_COMPLETED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("CLICK",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad click")}catch(e){}}),this.eventBus.subscribe("COMPLETE",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad complete")}catch(e){}}),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(e){n._onEvent(e),n.onPauseGame("New advertisements requested and loaded","success")}),this.eventBus.subscribe("CONTENT_RESUME_REQUESTED",function(e){if(n._onEvent(e),n.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),"developer.gamedistribution.com"===p||!0===new RegExp("^localhost").test(p)){(new Image).src="https://game.api.gamedistribution.com/game/hasapi/"+n.options.gameId;try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:n.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}),this.eventBus.subscribe("DURATION_CHANGE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("FIRST_QUARTILE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("IMPRESSION",function(e){n._onEvent(e);try{window._cc13998.bcpw("genp","ad video"),window._cc13998.bcpw("act","ad impression")}catch(e){}}),this.eventBus.subscribe("INTERACTION",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LINEAR_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LOADED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("LOG",function(e){return n._onEvent(e)}),this.eventBus.subscribe("MIDPOINT",function(e){return n._onEvent(e)}),this.eventBus.subscribe("PAUSED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("RESUMED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SKIPPABLE_STATE_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("SKIPPED",function(e){n._onEvent(e);try{window._cc13998.bcpw("act","ad skipped")}catch(e){}}),this.eventBus.subscribe("STARTED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("THIRD_QUARTILE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("USER_CLOSE",function(e){return n._onEvent(e)}),this.eventBus.subscribe("VOLUME_CHANGED",function(e){return n._onEvent(e)}),this.eventBus.subscribe("VOLUME_MUTED",function(e){return n._onEvent(e)}),this._gdpr(p),this.adRequestTimer=void 0,this.videoAdInstance=new d.default(this.options.flashSettings.adContainerId,this.options.prefix,this.options.advertisementSettings);var y=new Promise(function(e){var t={gameId:n.options.gameId?n.options.gameId+"":"49258a0e497c42b5b5d87887f24d27a6",advertisements:!0,preroll:!0,midroll:12e4,title:"",tags:[],category:"",assets:[]},o="https://game.api.gamedistribution.com/game/get/"+t.gameId.replace(/-/g,"")+"/?domain="+p+"&localTime="+(new Date).getHours(),i=new Request(o,{method:"GET"});fetch(i).then(function(e){var t=e.headers.get("content-type");if(t&&-1!==t.indexOf("application/json"))return e.json();throw new TypeError("Oops, we didn't get JSON!")}).then(function(o){if(o.error)(0,h.dankLog)("SDK_GAME_DATA_READY",o.error,"warning");else if(o.success){var i={gameId:o.result.game.gameMd5,advertisements:o.result.game.enableAds,preroll:o.result.game.preRoll,midroll:6e4*o.result.game.timeAds,title:o.result.game.title,tags:o.result.game.tags,category:o.result.game.category,assets:o.result.game.assets,displaySecondPrerollIfFirstOneShort:o.result.game.displaySecondPrerollIfFirstOneShort};(t=(0,g.extendDefaults)(t,i)).displaySecondPrerollIfFirstOneShort&&(n.videoAdInstance.maxPrerollCount=2),(0,h.dankLog)("SDK_GAME_DATA_READY",t,"success")}e(t)}).catch(function(n){(0,h.dankLog)("SDK_GAME_DATA_READY",n,"success"),e(t)})});y.then(function(e){n.videoAdInstance.gameId=e.gameId,n.videoAdInstance.category=e.category,n.videoAdInstance.tags=e.tags;try{localStorage.getItem("gd_debug")&&(localStorage.getItem("gd_tag")&&(n.videoAdInstance.tag=localStorage.getItem("gd_tag")),localStorage.getItem("gd_midroll")&&(e.midroll=localStorage.getItem("gd_midroll")))}catch(e){console.log(e)}if(e.advertisements){var t=["gry.pl","oyunskor.com","juegos.com","a10.com","agame.com","spelletjes.nl","jeux.fr","gioco.it","ojogos.com.br","gamesgames.com","games.co.id","jetztspielen.de","spel.nl","spela.se","jeu.fr","spielen.com","giochi.it","games.co.uk","ourgames.ru","flashgames.ru","permainan.co.id","mousebreaker.com","gameplayer.io","oyunoyna.com","spilgames.com","spilcloud.com"].indexOf(p)>-1&&document.cookie.indexOf("ogdpr_tracking=1")<0;e.preroll?(n.videoAdInstance.options.autoplay||t)&&n._createSplash(e,t):n.adRequestTimer=new Date}n.videoAdInstance.start()}).catch(function(){console.log(new Error("gameDataPromise failed to resolve."))}),this.readyPromise=Promise.all([y,this.videoAdInstance.adsLoaderPromise]).then(function(e){return n.eventBus.broadcast("SDK_READY",{name:"SDK_READY",message:"Everything is ready.",status:"success",analytics:{category:"SDK",action:"SDK_READY",label:n.options.gameId+""}}),n.options.onInit("Everything is ready."),e[0]}).catch(function(){return n.eventBus.broadcast("SDK_ERROR",{name:"SDK_ERROR",message:"The SDK failed.",status:"error",analytics:{category:"SDK",action:"SDK_ERROR",label:n.options.gameId+""}}),n.options.onError("The SDK failed."),!1})}return s(e,[{key:"_gdpr",value:function(e){var t=document.location.search.indexOf("gdpr-tracking")>=0,n=document.location.search.indexOf("gdpr-tracking=1")>=0,o="",i="";t?n?(o="General Data Protection Regulation is set to allow tracking.",i="success"):(o="General Data Protection Regulation is set to disallow tracking.",i="warning"):(o="General Data Protection Regulation consent for tracking is not set by the publisher.",i="warning"),this.eventBus.broadcast("SDK_GDPR_TRACKING",{name:"SDK_GDPR_TRACKING",message:o,status:i,analytics:{category:"SDK_GDPR_TRACKING",action:e,label:t?n?"1":"0":"not set"}});var r=document.location.search.indexOf("gdpr-targeting")>=0,s=document.location.search.indexOf("gdpr-targeting=1")>=0,a="",d="";r?s?(a="General Data Protection Regulation is set to allow personalised advertisements.",d="success"):(a="General Data Protection Regulation is set to disallow personalised advertisements.",d="warning"):(a="General Data Protection Regulation consent for targeting is not set by the publisher.",d="warning"),this.eventBus.broadcast("SDK_GDPR_TARGETING",{name:"SDK_GDPR_TARGETING",message:a,status:d,analytics:{category:"SDK_GDPR_TARGETING",action:e,label:r?s?"1":"0":"not set"}});var c=document.location.search.indexOf("gdpr-third-party")>=0,u=document.location.search.indexOf("gdpr-third-party=1")>=0,l="",h="";c?u?(l="General Data Protection Regulation is set to allow third parties.",h="success"):(l="General Data Protection Regulation is set to disallow third parties.",h="warning"):(l="General Data Protection Regulation consent for third parties is not set by the publisher.",h="warning"),this.eventBus.broadcast("SDK_GDPR_THIRD_PARTY",{name:"SDK_GDPR_THIRD_PARTY",message:l,status:h,analytics:{category:"SDK_GDPR_THIRD_PARTY",action:e,label:c?u?"1":"0":"not set"}})}},{key:"_onEvent",value:function(e){(0,h.dankLog)(e.name,e.message,e.status);try{void 0!==window.ga&&e.analytics&&window.ga("gd.send",{hitType:"event",eventCategory:e.analytics.category?e.analytics.category:"",eventAction:e.analytics.action?e.analytics.action:"",eventLabel:e.analytics.label?e.analytics.label:""})}catch(e){console.log(e)}this.options.onEvent(e)}},{key:"_analytics",value:function(e,t){var n=this;(0,g.getScript)("https://www.google-analytics.com/analytics.js","gdsdk_google_analytics").then(function(){window.ga("create","UA-102601800-1",{name:"gd",cookieExpires:7776e3},"auto"),window.ga("gd.send","pageview"),e||window.ga("gd.set","anonymizeIp",!0)}).catch(function(e){(0,h.dankLog)("SDK_LOAD_SCRIPT",e,"error")}),e||(0,g.getScript)("https://tags.crwdcntrl.net/c/13998/cc.js?ns=_cc13998","LOTCC_13998").then(function(){n.readyPromise.then(function(e){"object"===r(window._cc13998)&&"function"==typeof window._cc13998.bcpf&&"function"==typeof window._cc13998.bcpw&&(window._cc13998.bcpw("act","play"),window._cc13998.bcpw("int","domain : "+t),window._cc13998.bcpw("int","category : "+e.category.toLowerCase()),"complete"===document.readyState?window._cc13998.bcpf():window._cc13998.bcp())})}).catch(function(e){(0,h.dankLog)("SDK_LOAD_SCRIPT",e,"error")})}},{key:"_createSplash",value:function(e,t){var n=this,o=e.assets.find(function(e){return e.hasOwnProperty("name")&&512===e.width&&512===e.height});o=o?"https://img.gamedistribution.com/"+o.name:e.assets[0].hasOwnProperty("name")?"https://img.gamedistribution.com/"+e.assets[0].name:"https://img.gamedistribution.com/logo.svg";var i="\n body {\n position: inherit;\n }\n ."+this.options.prefix+"splash-background-container {\n box-sizing: border-box;\n position: absolute;\n z-index: 664;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: #000;\n overflow: hidden;\n }\n ."+this.options.prefix+"splash-background-image {\n box-sizing: border-box;\n position: absolute;\n top: -25%;\n left: -25%;\n width: 150%;\n height: 150%;\n background-image: url("+o+");\n background-size: cover;\n filter: blur(50px) brightness(1.5);\n }\n ."+this.options.prefix+"splash-container {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n position: absolute;\n z-index: 665;\n bottom: 0;\n width: 100%;\n height: 100%;\n }\n ."+this.options.prefix+"splash-top {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n flex: 1;\n align-self: center;\n justify-content: center;\n padding: 20px;\n }\n ."+this.options.prefix+"splash-top > div {\n text-align: center;\n }\n ."+this.options.prefix+"splash-top > div > button {\n border: 0;\n margin: auto;\n padding: 10px 22px;\n border-radius: 5px;\n border: 3px solid white;\n background: linear-gradient(0deg, #dddddd, #ffffff);\n color: #222;\n text-transform: uppercase;\n text-shadow: 0 0 1px #fff;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 18px;\n cursor: pointer;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n }\n ."+this.options.prefix+"splash-top > div > button:hover {\n background: linear-gradient(0deg, #ffffff, #dddddd);\n }\n ."+this.options.prefix+"splash-top > div > button:active {\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);\n background: linear-gradient(0deg, #ffffff, #f5f5f5);\n }\n ."+this.options.prefix+"splash-top > div > div {\n position: relative;\n width: 150px;\n height: 150px;\n margin: auto auto 20px;\n border-radius: 100%;\n overflow: hidden;\n border: 3px solid rgba(255, 255, 255, 1);\n background-color: #000;\n box-shadow: inset 0 5px 5px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);\n background-image: url("+o+");\n background-position: center;\n background-size: cover;\n }\n ."+this.options.prefix+"splash-top > div > div > img {\n width: 100%;\n height: 100%;\n }\n ."+this.options.prefix+"splash-bottom {\n display: flex;\n flex-flow: column;\n box-sizing: border-box;\n align-self: center;\n justify-content: center;\n width: 100%;\n padding: 0 0 20px;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-consent,\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-title {\n box-sizing: border-box;\n width: 100%;\n padding: 20px;\n background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.5) 50%, transparent);\n color: #fff;\n text-align: left;\n font-size: 12px;\n font-family: Arial;\n font-weight: normal;\n text-shadow: 0 0 1px rgba(0, 0, 0, 0.7);\n line-height: 150%;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-title {\n padding: 15px 0;\n text-align: center;\n font-size: 18px;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n line-height: 100%;\n }\n ."+this.options.prefix+"splash-bottom > ."+this.options.prefix+"splash-consent a {\n color: #fff;\n }\n ",r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),r.appendChild(s);var a="";a=t?'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n ':"b92a4170784248bca2ffa0c08bec7a50"===e.gameId?'\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n ':'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
'+e.title+"
\n
\n
\n ";var d=document.createElement("div");d.innerHTML=a,d.id=this.options.prefix+"splash";var c=this.options.flashSettings.splashContainerId?document.getElementById(this.options.flashSettings.splashContainerId):null;if(c)c.style.display="block",c.insertBefore(d,c.firstChild);else{var u=document.body||document.getElementsByTagName("body")[0];u.insertBefore(d,u.firstChild)}t?document.getElementById(this.options.prefix+"splash-button").addEventListener("click",function(){var e=new Date;e.setDate(e.getDate()+90),document.cookie="ogdpr_tracking=1; expires="+e.toUTCString()+"; path=/",n.showBanner()}):d.addEventListener("click",function(){n.showBanner()}),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){d&&d.parentNode?d.parentNode.removeChild(d):d&&(d.style.display="none"),c&&c.parentNode?c.parentNode.removeChild(c):c&&(c.style.display="none")}),this.eventBus.subscribe("SDK_GAME_START",function(){d&&d.parentNode?d.parentNode.removeChild(d):d&&(d.style.display="none"),c&&c.parentNode?c.parentNode.removeChild(c):c&&(c.style.display="none")})}},{key:"_checkPrerollRequest",value:function(){var e=this;this.videoAdInstance.canRequestPreroll()&&(this.videoAdInstance.requestedPrerollCount++,this.videoAdInstance.requestAttempts=0,this.videoAdInstance.requestAd().then(function(t){return e.videoAdInstance.loadAd(t)}).catch(function(t){e.videoAdInstance.onError(t)}),this.msgrt.send("req.ad.preroll."+this.videoAdInstance.requestedPrerollCount))}},{key:"showBanner",value:function(){var e=this;this.readyPromise.then(function(t){t.advertisements&&!e.whitelabelPartner?void 0!==e.adRequestTimer?(new Date).valueOf()-e.adRequestTimer.valueOf()