@bygd/gd-sdk-pes 1.29.16 → 1.29.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{parseJSON as i,getParentUrl as a,getParentDomain as s,getIframeDepth as o,getTopDomain as d,getQueryParams as c,getMobilePlatform as u,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as g,Layers as v,getKeyByValue as b,getQueryString as y,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as R}from"@bygd/gd-sdk-era/dist/default";import S from"@babel/runtime/helpers/classCallCheck";import D from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import I from"url-parse";import{Base64 as O}from"js-base64";import P from"validator";import C from"is-valid-domain";import L from"get-value";import U from"set-value";import M from"lodash.clonedeep";import j from"can-autoplay";import{isPlainObject as G}from"is-plain-object";import B from"querystringify";import N from"lodash.merge";import{EventEmitter as F}from"events";import{v4 as q}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},H=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||function(){return this}()||Function("return this")(),z={exports:{}},K=H,$=Object.defineProperty,Q=function(e,t){try{$(K,e,{value:t,configurable:!0,writable:!0})}catch(n){K[e]=t}return t},Y=Q,J=H["__core-js_shared__"]||Y("__core-js_shared__",{}),X=J;(z.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Z,ee,te=Function.prototype,ne=te.bind,re=te.call,ie=ne&&ne.bind(re),ae=ne?function(e){return e&&ie(re,e)}:function(e){return e&&function(){return re.apply(e,arguments)}},se=H.TypeError,oe=function(e){if(null==e)throw se("Can't call method on "+e);return e},de=oe,ce=H.Object,ue=function(e){return ce(de(e))},le=ue,he=ae({}.hasOwnProperty),pe=Object.hasOwn||function(e,t){return he(le(e),t)},fe=ae,me=0,ge=Math.random(),ve=fe(1..toString),be=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ve(++me+ge,36)},ye=function(e){return"function"==typeof e},_e=H,we=ye,Ae=function(e){return we(e)?e:void 0},ke=function(e,t){return arguments.length<2?Ae(_e[e]):_e[e]&&_e[e][t]},Ee=ke("navigator","userAgent")||"",xe=H,Re=Ee,Se=xe.process,De=xe.Deno,Te=Se&&Se.versions||De&&De.version,Ie=Te&&Te.v8;Ie&&(ee=(Z=Ie.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!ee&&Re&&(!(Z=Re.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=Re.match(/Chrome\/(\d+)/))&&(ee=+Z[1]);var Oe=ee,Pe=function(e){try{return!!e()}catch(e){return!0}},Ce=Oe,Le=Pe,Ue=!!Object.getOwnPropertySymbols&&!Le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ce&&Ce<41})),Me=Ue&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=H,Ge=z.exports,Be=pe,Ne=be,Fe=Ue,qe=Me,Ve=Ge("wks"),We=je.Symbol,He=We&&We.for,ze=qe?We:We&&We.withoutSetter||Ne,Ke=function(e){if(!Be(Ve,e)||!Fe&&"string"!=typeof Ve[e]){var t="Symbol."+e;Fe&&Be(We,e)?Ve[e]=We[e]:Ve[e]=qe&&He?He(t):ze(t)}return Ve[e]},$e={};$e[Ke("toStringTag")]="z";var Qe="[object z]"===String($e),Ye={exports:{}},Je=!Pe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Xe={},Ze=ye,et=function(e){return"object"==typeof e?null!==e:Ze(e)},tt=et,nt=H.document,rt=tt(nt)&&tt(nt.createElement),it=function(e){return rt?nt.createElement(e):{}},at=it,st=!Je&&!Pe((function(){return 7!=Object.defineProperty(at("div"),"a",{get:function(){return 7}}).a})),ot=H,dt=et,ct=ot.String,ut=ot.TypeError,lt=function(e){if(dt(e))return e;throw ut(ct(e)+" is not an object")},ht=Function.prototype.call,pt=ht.bind?ht.bind(ht):function(){return ht.apply(ht,arguments)},ft=ae({}.isPrototypeOf),mt=ke,gt=ye,vt=ft,bt=Me,yt=H.Object,_t=bt?function(e){return"symbol"==typeof e}:function(e){var t=mt("Symbol");return gt(t)&&vt(t.prototype,yt(e))},wt=H.String,At=function(e){try{return wt(e)}catch(e){return"Object"}},kt=ye,Et=At,xt=H.TypeError,Rt=function(e){if(kt(e))return e;throw xt(Et(e)+" is not a function")},St=Rt,Dt=function(e,t){var n=e[t];return null==n?void 0:St(n)},Tt=pt,It=ye,Ot=et,Pt=H.TypeError,Ct=pt,Lt=et,Ut=_t,Mt=Dt,jt=function(e,t){var n,r;if("string"===t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;if(It(n=e.valueOf)&&!Ot(r=Tt(n,e)))return r;if("string"!==t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;throw Pt("Can't convert object to primitive value")},Gt=Ke,Bt=H.TypeError,Nt=Gt("toPrimitive"),Ft=function(e,t){if(!Lt(e)||Ut(e))return e;var n,r=Mt(e,Nt);if(r){if(void 0===t&&(t="default"),n=Ct(r,e,t),!Lt(n)||Ut(n))return n;throw Bt("Can't convert object to primitive value")}return void 0===t&&(t="number"),jt(e,t)},qt=_t,Vt=function(e){var t=Ft(e,"string");return qt(t)?t:t+""},Wt=Je,Ht=st,zt=lt,Kt=Vt,$t=H.TypeError,Qt=Object.defineProperty;Xe.f=Wt?Qt:function(e,t,n){if(zt(e),t=Kt(t),zt(n),Ht)try{return Qt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw $t("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Yt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Jt=Xe,Xt=Yt,Zt=Je?function(e,t,n){return Jt.f(e,t,Xt(1,n))}:function(e,t,n){return e[t]=n,e},en=ye,tn=J,nn=ae(Function.toString);en(tn.inspectSource)||(tn.inspectSource=function(e){return nn(e)});var rn,an,sn,on=tn.inspectSource,dn=ye,cn=on,un=H.WeakMap,ln=dn(un)&&/native code/.test(cn(un)),hn=z.exports,pn=be,fn=hn("keys"),mn=function(e){return fn[e]||(fn[e]=pn(e))},gn={},vn=ln,bn=H,yn=ae,_n=et,wn=Zt,An=pe,kn=J,En=mn,xn=gn,Rn=bn.TypeError,Sn=bn.WeakMap;if(vn||kn.state){var Dn=kn.state||(kn.state=new Sn),Tn=yn(Dn.get),In=yn(Dn.has),On=yn(Dn.set);rn=function(e,t){if(In(Dn,e))throw new Rn("Object already initialized");return t.facade=e,On(Dn,e,t),t},an=function(e){return Tn(Dn,e)||{}},sn=function(e){return In(Dn,e)}}else{var Pn=En("state");xn[Pn]=!0,rn=function(e,t){if(An(e,Pn))throw new Rn("Object already initialized");return t.facade=e,wn(e,Pn,t),t},an=function(e){return An(e,Pn)?e[Pn]:{}},sn=function(e){return An(e,Pn)}}var Cn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!_n(t)||(n=an(t)).type!==e)throw Rn("Incompatible receiver, "+e+" required");return n}}},Ln=Je,Un=pe,Mn=Function.prototype,jn=Ln&&Object.getOwnPropertyDescriptor,Gn=Un(Mn,"name"),Bn={EXISTS:Gn,PROPER:Gn&&"something"===function(){}.name,CONFIGURABLE:Gn&&(!Ln||Ln&&jn(Mn,"name").configurable)},Nn=H,Fn=ye,qn=pe,Vn=Zt,Wn=Q,Hn=on,zn=Bn.CONFIGURABLE,Kn=Cn.get,$n=Cn.enforce,Qn=String(String).split("String");(Ye.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;Fn(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!qn(n,"name")||zn&&n.name!==d)&&Vn(n,"name",d),(i=$n(n)).source||(i.source=Qn.join("string"==typeof d?d:""))),e!==Nn?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Vn(e,t,n)):s?e[t]=n:Wn(t,n)})(Function.prototype,"toString",(function(){return Fn(this)&&Kn(this).source||Hn(this)}));var Yn=ae,Jn=Yn({}.toString),Xn=Yn("".slice),Zn=function(e){return Xn(Jn(e),8,-1)},er=H,tr=Qe,nr=ye,rr=Zn,ir=Ke("toStringTag"),ar=er.Object,sr="Arguments"==rr(function(){return arguments}()),or=tr?rr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=ar(e),ir))?n:sr?rr(t):"Object"==(r=rr(t))&&nr(t.callee)?"Arguments":r},dr=or,cr=Qe?{}.toString:function(){return"[object "+dr(this)+"]"},ur=Qe,lr=Ye.exports,hr=cr;ur||lr(Object.prototype,"toString",hr,{unsafe:!0});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fr=it("span").classList,mr=fr&&fr.constructor&&fr.constructor.prototype,gr=mr===Object.prototype?void 0:mr,vr=Rt,br=ae(ae.bind),yr=function(e,t){return vr(e),void 0===t?e:br?br(e,t):function(){return e.apply(t,arguments)}},_r=ae,wr=Pe,Ar=Zn,kr=H.Object,Er=_r("".split),xr=wr((function(){return!kr("z").propertyIsEnumerable(0)}))?function(e){return"String"==Ar(e)?Er(e,""):kr(e)}:kr,Rr=Math.ceil,Sr=Math.floor,Dr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Sr:Rr)(t)},Tr=Dr,Ir=Math.min,Or=function(e){return e>0?Ir(Tr(e),9007199254740991):0},Pr=Or,Cr=function(e){return Pr(e.length)},Lr=Zn,Ur=Array.isArray||function(e){return"Array"==Lr(e)},Mr=ae,jr=Pe,Gr=ye,Br=or,Nr=on,Fr=function(){},qr=[],Vr=ke("Reflect","construct"),Wr=/^\s*(?:class|function)\b/,Hr=Mr(Wr.exec),zr=!Wr.exec(Fr),Kr=function(e){if(!Gr(e))return!1;try{return Vr(Fr,qr,e),!0}catch(e){return!1}},$r=!Vr||jr((function(){var e;return Kr(Kr.call)||!Kr(Object)||!Kr((function(){e=!0}))||e}))?function(e){if(!Gr(e))return!1;switch(Br(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return zr||!!Hr(Wr,Nr(e))}:Kr,Qr=H,Yr=Ur,Jr=$r,Xr=et,Zr=Ke("species"),ei=Qr.Array,ti=function(e){var t;return Yr(e)&&(t=e.constructor,(Jr(t)&&(t===ei||Yr(t.prototype))||Xr(t)&&null===(t=t[Zr]))&&(t=void 0)),void 0===t?ei:t},ni=function(e,t){return new(ti(e))(0===t?0:t)},ri=yr,ii=xr,ai=ue,si=Cr,oi=ni,di=ae([].push),ci=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(d,c,u,l){for(var h,p,f=ai(d),m=ii(f),g=ri(c,u),v=si(m),b=0,y=l||oi,_=t?y(d,v):n||s?y(d,0):void 0;v>b;b++)if((o||b in m)&&(p=g(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:di(_,h)}else switch(e){case 4:return!1;case 7:di(_,h)}return a?-1:r||i?i:_}},ui={forEach:ci(0),map:ci(1),filter:ci(2),some:ci(3),every:ci(4),find:ci(5),findIndex:ci(6),filterReject:ci(7)},li=Pe,hi=function(e,t){var n=[][e];return!!n&&li((function(){n.call(null,t||function(){throw 1},1)}))},pi=ui.forEach,fi=H,mi=pr,gi=gr,vi=hi("forEach")?[].forEach:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)},bi=Zt,yi=function(e){if(e&&e.forEach!==vi)try{bi(e,"forEach",vi)}catch(t){e.forEach=vi}};for(var _i in mi)mi[_i]&&yi(fi[_i]&&fi[_i].prototype);yi(gi);var wi={},Ai={},ki={}.propertyIsEnumerable,Ei=Object.getOwnPropertyDescriptor,xi=Ei&&!ki.call({1:2},1);Ai.f=xi?function(e){var t=Ei(this,e);return!!t&&t.enumerable}:ki;var Ri=xr,Si=oe,Di=function(e){return Ri(Si(e))},Ti=Je,Ii=pt,Oi=Ai,Pi=Yt,Ci=Di,Li=Vt,Ui=pe,Mi=st,ji=Object.getOwnPropertyDescriptor;wi.f=Ti?ji:function(e,t){if(e=Ci(e),t=Li(t),Mi)try{return ji(e,t)}catch(e){}if(Ui(e,t))return Pi(!Ii(Oi.f,e,t),e[t])};var Gi={},Bi=Dr,Ni=Math.max,Fi=Math.min,qi=function(e,t){var n=Bi(e);return n<0?Ni(n+t,0):Fi(n,t)},Vi=Di,Wi=qi,Hi=Cr,zi=function(e){return function(t,n,r){var i,a=Vi(t),s=Hi(a),o=Wi(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},Ki={includes:zi(!0),indexOf:zi(!1)},$i=pe,Qi=Di,Yi=Ki.indexOf,Ji=gn,Xi=ae([].push),Zi=function(e,t){var n,r=Qi(e),i=0,a=[];for(n in r)!$i(Ji,n)&&$i(r,n)&&Xi(a,n);for(;t.length>i;)$i(r,n=t[i++])&&(~Yi(a,n)||Xi(a,n));return a},ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ta=Zi,na=ea.concat("length","prototype");Gi.f=Object.getOwnPropertyNames||function(e){return ta(e,na)};var ra={};ra.f=Object.getOwnPropertySymbols;var ia=ke,aa=Gi,sa=ra,oa=lt,da=ae([].concat),ca=ia("Reflect","ownKeys")||function(e){var t=aa.f(oa(e)),n=sa.f;return n?da(t,n(e)):t},ua=pe,la=ca,ha=wi,pa=Xe,fa=function(e,t){for(var n=la(t),r=pa.f,i=ha.f,a=0;a<n.length;a++){var s=n[a];ua(e,s)||r(e,s,i(t,s))}},ma=Pe,ga=ye,va=/#|\.prototype\./,ba=function(e,t){var n=_a[ya(e)];return n==Aa||n!=wa&&(ga(t)?ma(t):!!t)},ya=ba.normalize=function(e){return String(e).replace(va,".").toLowerCase()},_a=ba.data={},wa=ba.NATIVE="N",Aa=ba.POLYFILL="P",ka=ba,Ea=H,xa=wi.f,Ra=Zt,Sa=Ye.exports,Da=Q,Ta=fa,Ia=ka,Oa=function(e,t){var n,r,i,a,s,o=e.target,d=e.global,c=e.stat;if(n=d?Ea:c?Ea[o]||Da(o,{}):(Ea[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xa(n,r))&&s.value:n[r],!Ia(d?r:o+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ta(a,i)}(e.sham||i&&i.sham)&&Ra(a,"sham",!0),Sa(n,r,a,e)}},Pa=Zi,Ca=ea,La=Object.keys||function(e){return Pa(e,Ca)},Ua=ue,Ma=La;Oa({target:"Object",stat:!0,forced:Pe((function(){Ma(1)}))},{keys:function(e){return Ma(Ua(e))}});var ja=Array.isArray,Ga=Object.prototype.toString,Ba=ja||function(e){return!!e&&"[object Array]"==Ga.call(e)},Na={name:"@bygd/gd-sdk-pes",version:"1.29.16",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},Fa=function(e){var t=qa("object"===n(e)?e:i(e));return t&&t.version?Na.version>=t.version?t:void 0:t},qa=function(e){var n=this;if(!Ba(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},Va=function(){var e;(e=console).log.apply(e,arguments)},Wa=function(){var e;(e=console).log.apply(e,arguments)};JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima","adsense"],midroll:["ima","adsense","ima","adsense"],rewarded:["ima","adsense","ima","adsense"]}}),JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima"],midroll:["ima","adsense","ima"],rewarded:["ima","adsense","ima","adsense"]}});var Ha,za={},Ka=Function.prototype,$a=Ka.apply,Qa=Ka.bind,Ya=Ka.call,Ja="object"==typeof Reflect&&Reflect.apply||(Qa?Ya.bind($a):function(){return Ya.apply($a,arguments)}),Xa=or,Za=H.String,es=function(e){if("Symbol"===Xa(e))throw TypeError("Cannot convert a Symbol value to a string");return Za(e)},ts=Xe,ns=lt,rs=Di,is=La,as=Je?Object.defineProperties:function(e,t){ns(e);for(var n,r=rs(t),i=is(t),a=i.length,s=0;a>s;)ts.f(e,n=i[s++],r[n]);return e},ss=ke("document","documentElement"),os=lt,ds=as,cs=ea,us=gn,ls=ss,hs=it,ps=mn("IE_PROTO"),fs=function(){},ms=function(e){return"<script>"+e+"<\/script>"},gs=function(e){e.write(ms("")),e.close();var t=e.parentWindow.Object;return e=null,t},vs=function(){try{Ha=new ActiveXObject("htmlfile")}catch(e){}var e,t;vs="undefined"!=typeof document?document.domain&&Ha?gs(Ha):((t=hs("iframe")).style.display="none",ls.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ms("document.F=Object")),e.close(),e.F):gs(Ha);for(var n=cs.length;n--;)delete vs.prototype[cs[n]];return vs()};us[ps]=!0;var bs=Object.create||function(e,t){var n;return null!==e?(fs.prototype=os(e),n=new fs,fs.prototype=null,n[ps]=e):n=vs(),void 0===t?n:ds(n,t)},ys={},_s=ae([].slice),ws=Zn,As=Di,ks=Gi.f,Es=_s,xs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ys.f=function(e){return xs&&"Window"==ws(e)?function(e){try{return ks(e)}catch(e){return Es(xs)}}(e):ks(As(e))};var Rs={},Ss=Ke;Rs.f=Ss;var Ds=H,Ts=pe,Is=Rs,Os=Xe.f,Ps=function(e){var t=Ds.Symbol||(Ds.Symbol={});Ts(t,e)||Os(t,e,{value:Is.f(e)})},Cs=Xe.f,Ls=pe,Us=Ke("toStringTag"),Ms=function(e,t,n){e&&!Ls(e=n?e:e.prototype,Us)&&Cs(e,Us,{configurable:!0,value:t})},js=Oa,Gs=H,Bs=ke,Ns=Ja,Fs=pt,Vs=ae,Ws=Je,Hs=Ue,zs=Pe,Ks=pe,$s=Ur,Qs=ye,Ys=et,Js=ft,Xs=_t,Zs=lt,eo=ue,to=Di,no=Vt,ro=es,io=Yt,ao=bs,so=La,oo=Gi,co=ys,uo=ra,lo=wi,ho=Xe,po=Ai,fo=_s,mo=Ye.exports,go=z.exports,vo=gn,bo=be,yo=Ke,_o=Rs,wo=Ps,Ao=Ms,ko=Cn,Eo=ui.forEach,xo=mn("hidden"),Ro=yo("toPrimitive"),So=ko.set,Do=ko.getterFor("Symbol"),To=Object.prototype,Io=Gs.Symbol,Oo=Io&&Io.prototype,Po=Gs.TypeError,Co=Gs.QObject,Lo=Bs("JSON","stringify"),Uo=lo.f,Mo=ho.f,jo=co.f,Go=po.f,Bo=Vs([].push),No=go("symbols"),Fo=go("op-symbols"),qo=go("string-to-symbol-registry"),Vo=go("symbol-to-string-registry"),Wo=go("wks"),Ho=!Co||!Co.prototype||!Co.prototype.findChild,zo=Ws&&zs((function(){return 7!=ao(Mo({},"a",{get:function(){return Mo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Uo(To,t);r&&delete To[t],Mo(e,t,n),r&&e!==To&&Mo(To,t,r)}:Mo,Ko=function(e,t){var n=No[e]=ao(Oo);return So(n,{type:"Symbol",tag:e,description:t}),Ws||(n.description=t),n},$o=function(e,t,n){e===To&&$o(Fo,t,n),Zs(e);var r=no(t);return Zs(n),Ks(No,r)?(n.enumerable?(Ks(e,xo)&&e[xo][r]&&(e[xo][r]=!1),n=ao(n,{enumerable:io(0,!1)})):(Ks(e,xo)||Mo(e,xo,io(1,{})),e[xo][r]=!0),zo(e,r,n)):Mo(e,r,n)},Qo=function(e,t){Zs(e);var n=to(t),r=so(n).concat(Zo(n));return Eo(r,(function(t){Ws&&!Fs(Yo,n,t)||$o(e,t,n[t])})),e},Yo=function(e){var t=no(e),n=Fs(Go,this,t);return!(this===To&&Ks(No,t)&&!Ks(Fo,t))&&(!(n||!Ks(this,t)||!Ks(No,t)||Ks(this,xo)&&this[xo][t])||n)},Jo=function(e,t){var n=to(e),r=no(t);if(n!==To||!Ks(No,r)||Ks(Fo,r)){var i=Uo(n,r);return!i||!Ks(No,r)||Ks(n,xo)&&n[xo][r]||(i.enumerable=!0),i}},Xo=function(e){var t=jo(to(e)),n=[];return Eo(t,(function(e){Ks(No,e)||Ks(vo,e)||Bo(n,e)})),n},Zo=function(e){var t=e===To,n=jo(t?Fo:to(e)),r=[];return Eo(n,(function(e){!Ks(No,e)||t&&!Ks(To,e)||Bo(r,No[e])})),r};(Hs||(mo(Oo=(Io=function(){if(Js(Oo,this))throw Po("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ro(arguments[0]):void 0,t=bo(e),n=function(e){this===To&&Fs(n,Fo,e),Ks(this,xo)&&Ks(this[xo],t)&&(this[xo][t]=!1),zo(this,t,io(1,e))};return Ws&&Ho&&zo(To,t,{configurable:!0,set:n}),Ko(t,e)}).prototype,"toString",(function(){return Do(this).tag})),mo(Io,"withoutSetter",(function(e){return Ko(bo(e),e)})),po.f=Yo,ho.f=$o,lo.f=Jo,oo.f=co.f=Xo,uo.f=Zo,_o.f=function(e){return Ko(yo(e),e)},Ws&&(Mo(Oo,"description",{configurable:!0,get:function(){return Do(this).description}}),mo(To,"propertyIsEnumerable",Yo,{unsafe:!0}))),js({global:!0,wrap:!0,forced:!Hs,sham:!Hs},{Symbol:Io}),Eo(so(Wo),(function(e){wo(e)})),js({target:"Symbol",stat:!0,forced:!Hs},{for:function(e){var t=ro(e);if(Ks(qo,t))return qo[t];var n=Io(t);return qo[t]=n,Vo[n]=t,n},keyFor:function(e){if(!Xs(e))throw Po(e+" is not a symbol");if(Ks(Vo,e))return Vo[e]},useSetter:function(){Ho=!0},useSimple:function(){Ho=!1}}),js({target:"Object",stat:!0,forced:!Hs,sham:!Ws},{create:function(e,t){return void 0===t?ao(e):Qo(ao(e),t)},defineProperty:$o,defineProperties:Qo,getOwnPropertyDescriptor:Jo}),js({target:"Object",stat:!0,forced:!Hs},{getOwnPropertyNames:Xo,getOwnPropertySymbols:Zo}),js({target:"Object",stat:!0,forced:zs((function(){uo.f(1)}))},{getOwnPropertySymbols:function(e){return uo.f(eo(e))}}),Lo)&&js({target:"JSON",stat:!0,forced:!Hs||zs((function(){var e=Io();return"[null]"!=Lo([e])||"{}"!=Lo({a:e})||"{}"!=Lo(Object(e))}))},{stringify:function(e,t,n){var r=fo(arguments),i=t;if((Ys(t)||void 0!==e)&&!Xs(e))return $s(t)||(t=function(e,t){if(Qs(i)&&(t=Fs(i,this,e,t)),!Xs(t))return t}),r[1]=t,Ns(Lo,null,r)}});if(!Oo[Ro]){var ed=Oo.valueOf;mo(Oo,Ro,(function(e){return Fs(ed,this)}))}Ao(Io,"Symbol"),vo[xo]=!0;var td=Pe,nd=Oe,rd=Ke("species"),id=function(e){return nd>=51||!td((function(){var t=[];return(t.constructor={})[rd]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ad=ui.filter;Oa({target:"Array",proto:!0,forced:!id("filter")},{filter:function(e){return ad(this,e,arguments.length>1?arguments[1]:void 0)}});var sd=Oa,od=Pe,dd=Di,cd=wi.f,ud=Je,ld=od((function(){cd(1)}));sd({target:"Object",stat:!0,forced:!ud||ld,sham:!ud},{getOwnPropertyDescriptor:function(e,t){return cd(dd(e),t)}});var hd=Vt,pd=Xe,fd=Yt,md=function(e,t,n){var r=hd(t);r in e?pd.f(e,r,fd(0,n)):e[r]=n},gd=ca,vd=Di,bd=wi,yd=md;Oa({target:"Object",stat:!0,sham:!Je},{getOwnPropertyDescriptors:function(e){for(var t,n,r=vd(e),i=bd.f,a=gd(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&yd(s,t,n);return s}});var _d=Oa,wd=H,Ad=Ur,kd=$r,Ed=et,xd=qi,Rd=Cr,Sd=Di,Dd=md,Td=Ke,Id=_s,Od=id("slice"),Pd=Td("species"),Cd=wd.Array,Ld=Math.max;_d({target:"Array",proto:!0,forced:!Od},{slice:function(e,t){var n,r,i,a=Sd(this),s=Rd(a),o=xd(e,s),d=xd(void 0===t?s:t,s);if(Ad(a)&&(n=a.constructor,(kd(n)&&(n===Cd||Ad(n.prototype))||Ed(n)&&null===(n=n[Pd]))&&(n=void 0),n===Cd||void 0===n))return Id(a,o,d);for(r=new(void 0===n?Cd:n)(Ld(d-o,0)),i=0;o<d;o++,i++)o in a&&Dd(r,i,a[o]);return r.length=i,r}});var Ud=pt,Md=lt,jd=Dt,Gd=function(e,t,n){var r,i;Md(e);try{if(!(r=jd(e,"return"))){if("throw"===t)throw n;return n}r=Ud(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Md(r),n},Bd=lt,Nd=Gd,Fd={},qd=Fd,Vd=Ke("iterator"),Wd=Array.prototype,Hd=function(e){return void 0!==e&&(qd.Array===e||Wd[Vd]===e)},zd=or,Kd=Dt,$d=Fd,Qd=Ke("iterator"),Yd=function(e){if(null!=e)return Kd(e,Qd)||Kd(e,"@@iterator")||$d[zd(e)]},Jd=pt,Xd=Rt,Zd=lt,ec=At,tc=Yd,nc=H.TypeError,rc=function(e,t){var n=arguments.length<2?tc(e):t;if(Xd(n))return Zd(Jd(n,e));throw nc(ec(e)+" is not iterable")},ic=yr,ac=pt,sc=ue,oc=function(e,t,n,r){try{return r?t(Bd(n)[0],n[1]):t(n)}catch(t){Nd(e,"throw",t)}},dc=Hd,cc=$r,uc=Cr,lc=md,hc=rc,pc=Yd,fc=H.Array,mc=Ke("iterator"),gc=!1;try{var vc=0,bc={next:function(){return{done:!!vc++}},return:function(){gc=!0}};bc[mc]=function(){return this},Array.from(bc,(function(){throw 2}))}catch(e){}var yc=function(e,t){if(!t&&!gc)return!1;var n=!1;try{var r={};r[mc]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},_c=function(e){var t=sc(e),n=cc(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ic(i,r>2?arguments[2]:void 0));var s,o,d,c,u,l,h=pc(t),p=0;if(!h||this==fc&&dc(h))for(s=uc(t),o=n?new this(s):fc(s);s>p;p++)l=a?i(t[p],p):t[p],lc(o,p,l);else for(u=(c=hc(t,h)).next,o=n?new this:[];!(d=ac(u,c)).done;p++)l=a?oc(c,i,[d.value,p],!0):d.value,lc(o,p,l);return o.length=p,o};Oa({target:"Array",stat:!0,forced:!yc((function(e){Array.from(e)}))},{from:_c});var wc,Ac,kc,Ec=ae,xc=Dr,Rc=es,Sc=oe,Dc=Ec("".charAt),Tc=Ec("".charCodeAt),Ic=Ec("".slice),Oc=function(e){return function(t,n){var r,i,a=Rc(Sc(t)),s=xc(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=Tc(a,s))<55296||r>56319||s+1===o||(i=Tc(a,s+1))<56320||i>57343?e?Dc(a,s):r:e?Ic(a,s,s+2):i-56320+(r-55296<<10)+65536}},Pc={codeAt:Oc(!1),charAt:Oc(!0)},Cc=!Pe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Lc=H,Uc=pe,Mc=ye,jc=ue,Gc=Cc,Bc=mn("IE_PROTO"),Nc=Lc.Object,Fc=Nc.prototype,qc=Gc?Nc.getPrototypeOf:function(e){var t=jc(e);if(Uc(t,Bc))return t[Bc];var n=t.constructor;return Mc(n)&&t instanceof n?n.prototype:t instanceof Nc?Fc:null},Vc=Pe,Wc=ye,Hc=qc,zc=Ye.exports,Kc=Ke("iterator"),$c=!1;[].keys&&("next"in(kc=[].keys())?(Ac=Hc(Hc(kc)))!==Object.prototype&&(wc=Ac):$c=!0);var Qc=null==wc||Vc((function(){var e={};return wc[Kc].call(e)!==e}));Qc&&(wc={}),Wc(wc[Kc])||zc(wc,Kc,(function(){return this}));var Yc={IteratorPrototype:wc,BUGGY_SAFARI_ITERATORS:$c},Jc=Yc.IteratorPrototype,Xc=bs,Zc=Yt,eu=Ms,tu=Fd,nu=function(){return this},ru=function(e,t,n){var r=t+" Iterator";return e.prototype=Xc(Jc,{next:Zc(1,n)}),eu(e,r,!1),tu[r]=nu,e},iu=H,au=ye,su=iu.String,ou=iu.TypeError,du=ae,cu=lt,uu=function(e){if("object"==typeof e||au(e))return e;throw ou("Can't set "+su(e)+" as a prototype")},lu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=du(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return cu(n),uu(r),t?e(n,r):n.__proto__=r,n}}():void 0),hu=Oa,pu=pt,fu=Bn,mu=ye,gu=ru,vu=qc,bu=lu,yu=Ms,_u=Zt,wu=Ye.exports,Au=Fd,ku=fu.PROPER,Eu=fu.CONFIGURABLE,xu=Yc.IteratorPrototype,Ru=Yc.BUGGY_SAFARI_ITERATORS,Su=Ke("iterator"),Du=function(){return this},Tu=function(e,t,n,r,i,a,s){gu(n,t,r);var o,d,c,u=function(e){if(e===i&&m)return m;if(!Ru&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Su]||p["@@iterator"]||i&&p[i],m=!Ru&&f||u(i),g="Array"==t&&p.entries||f;if(g&&(o=vu(g.call(new e)))!==Object.prototype&&o.next&&(vu(o)!==xu&&(bu?bu(o,xu):mu(o[Su])||wu(o,Su,Du)),yu(o,l,!0)),ku&&"values"==i&&f&&"values"!==f.name&&(Eu?_u(p,"name","values"):(h=!0,m=function(){return pu(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(c in d)(Ru||h||!(c in p))&&wu(p,c,d[c]);else hu({target:t,proto:!0,forced:Ru||h},d);return p[Su]!==m&&wu(p,Su,m,{name:i}),Au[t]=m,d},Iu=Pc.charAt,Ou=es,Pu=Cn,Cu=Tu,Lu=Pu.set,Uu=Pu.getterFor("String Iterator");Cu(String,"String",(function(e){Lu(this,{type:"String Iterator",string:Ou(e),index:0})}),(function(){var e,t=Uu(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Iu(n,r),t.index+=e.length,{value:e,done:!1})}));var Mu=lt,ju=function(){var e=Mu(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Gu={},Bu=Pe,Nu=H.RegExp;Gu.UNSUPPORTED_Y=Bu((function(){var e=Nu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Gu.BROKEN_CARET=Bu((function(){var e=Nu("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Fu=Pe,qu=H.RegExp,Vu=Fu((function(){var e=qu(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Wu=Pe,Hu=H.RegExp,zu=Wu((function(){var e=Hu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ku=pt,$u=ae,Qu=es,Yu=ju,Ju=Gu,Xu=z.exports,Zu=bs,el=Cn.get,tl=Vu,nl=zu,rl=Xu("native-string-replace",String.prototype.replace),il=RegExp.prototype.exec,al=il,sl=$u("".charAt),ol=$u("".indexOf),dl=$u("".replace),cl=$u("".slice),ul=function(){var e=/a/,t=/b*/g;return Ku(il,e,"a"),Ku(il,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ll=Ju.UNSUPPORTED_Y||Ju.BROKEN_CARET,hl=void 0!==/()??/.exec("")[1];(ul||hl||ll||tl||nl)&&(al=function(e){var t,n,r,i,a,s,o,d=this,c=el(d),u=Qu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=Ku(al,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=ll&&d.sticky,f=Ku(Yu,d),m=d.source,g=0,v=u;if(p&&(f=dl(f,"y",""),-1===ol(f,"g")&&(f+="g"),v=cl(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==sl(u,d.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",f)),hl&&(n=new RegExp("^"+m+"$(?!\\s)",f)),ul&&(r=d.lastIndex),i=Ku(il,p?n:d,v),p?i?(i.input=cl(i.input,g),i[0]=cl(i[0],g),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:ul&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),hl&&i&&i.length>1&&Ku(rl,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=Zu(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var pl=al;Oa({target:"RegExp",proto:!0,forced:/./.exec!==pl},{exec:pl});var fl=Oa,ml=Je,gl=H,vl=ae,bl=pe,yl=ye,_l=ft,wl=es,Al=Xe.f,kl=fa,El=gl.Symbol,xl=El&&El.prototype;if(ml&&yl(El)&&(!("description"in xl)||void 0!==El().description)){var Rl={},Sl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:wl(arguments[0]),t=_l(xl,this)?new El(e):void 0===e?El():El(e);return""===e&&(Rl[t]=!0),t};kl(Sl,El),Sl.prototype=xl,xl.constructor=Sl;var Dl="Symbol(test)"==String(El("test")),Tl=vl(xl.toString),Il=vl(xl.valueOf),Ol=/^Symbol\((.*)\)[^)]+$/,Pl=vl("".replace),Cl=vl("".slice);Al(xl,"description",{configurable:!0,get:function(){var e=Il(this),t=Tl(e);if(bl(Rl,e))return"";var n=Dl?Cl(t,7,-1):Pl(t,Ol,"$1");return""===n?void 0:n}}),fl({global:!0,forced:!0},{Symbol:Sl})}Ps("iterator");var Ll=bs,Ul=Xe,Ml=Ke("unscopables"),jl=Array.prototype;null==jl[Ml]&&Ul.f(jl,Ml,{configurable:!0,value:Ll(null)});var Gl=function(e){jl[Ml][e]=!0},Bl=Di,Nl=Gl,Fl=Fd,ql=Cn,Vl=Tu,Wl=ql.set,Hl=ql.getterFor("Array Iterator"),zl=Vl(Array,"Array",(function(e,t){Wl(this,{type:"Array Iterator",target:Bl(e),index:0,kind:t})}),(function(){var e=Hl(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Fl.Arguments=Fl.Array,Nl("keys"),Nl("values"),Nl("entries");var Kl=H,$l=pr,Ql=gr,Yl=zl,Jl=Zt,Xl=Ke,Zl=Xl("iterator"),eh=Xl("toStringTag"),th=Yl.values,nh=function(e,t){if(e){if(e[Zl]!==th)try{Jl(e,Zl,th)}catch(t){e[Zl]=th}if(e[eh]||Jl(e,eh,t),$l[t])for(var n in Yl)if(e[n]!==Yl[n])try{Jl(e,n,Yl[n])}catch(t){e[n]=Yl[n]}}};for(var rh in $l)nh(Kl[rh]&&Kl[rh].prototype,rh);nh(Ql,"DOMTokenList");var ih,ah,sh,oh,dh=H.Promise,ch=Ye.exports,uh=function(e,t,n){for(var r in t)ch(e,r,t[r],n);return e},lh=ke,hh=Xe,ph=Je,fh=Ke("species"),mh=function(e){var t=lh(e),n=hh.f;ph&&t&&!t[fh]&&n(t,fh,{configurable:!0,get:function(){return this}})},gh=ft,vh=H.TypeError,bh=function(e,t){if(gh(t,e))return e;throw vh("Incorrect invocation")},yh=yr,_h=pt,wh=lt,Ah=At,kh=Hd,Eh=Cr,xh=ft,Rh=rc,Sh=Yd,Dh=Gd,Th=H.TypeError,Ih=function(e,t){this.stopped=e,this.result=t},Oh=Ih.prototype,Ph=$r,Ch=At,Lh=H.TypeError,Uh=lt,Mh=function(e){if(Ph(e))return e;throw Lh(Ch(e)+" is not a constructor")},jh=Ke("species"),Gh=function(e,t){var n,r=Uh(e).constructor;return void 0===r||null==(n=Uh(r)[jh])?t:Mh(n)},Bh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ee),Nh="process"==Zn(H.process),Fh=H,qh=Ja,Vh=yr,Wh=ye,Hh=pe,zh=Pe,Kh=ss,$h=_s,Qh=it,Yh=Bh,Jh=Nh,Xh=Fh.setImmediate,Zh=Fh.clearImmediate,ep=Fh.process,tp=Fh.Dispatch,np=Fh.Function,rp=Fh.MessageChannel,ip=Fh.String,ap=0,sp={};try{ih=Fh.location}catch(e){}var op=function(e){if(Hh(sp,e)){var t=sp[e];delete sp[e],t()}},dp=function(e){return function(){op(e)}},cp=function(e){op(e.data)},up=function(e){Fh.postMessage(ip(e),ih.protocol+"//"+ih.host)};Xh&&Zh||(Xh=function(e){var t=$h(arguments,1);return sp[++ap]=function(){qh(Wh(e)?e:np(e),void 0,t)},ah(ap),ap},Zh=function(e){delete sp[e]},Jh?ah=function(e){ep.nextTick(dp(e))}:tp&&tp.now?ah=function(e){tp.now(dp(e))}:rp&&!Yh?(oh=(sh=new rp).port2,sh.port1.onmessage=cp,ah=Vh(oh.postMessage,oh)):Fh.addEventListener&&Wh(Fh.postMessage)&&!Fh.importScripts&&ih&&"file:"!==ih.protocol&&!zh(up)?(ah=up,Fh.addEventListener("message",cp,!1)):ah="onreadystatechange"in Qh("script")?function(e){Kh.appendChild(Qh("script")).onreadystatechange=function(){Kh.removeChild(this),op(e)}}:function(e){setTimeout(dp(e),0)});var lp,hp,pp,fp,mp,gp,vp,bp,yp={set:Xh,clear:Zh},_p=H,wp=/ipad|iphone|ipod/i.test(Ee)&&void 0!==_p.Pebble,Ap=/web0s(?!.*chrome)/i.test(Ee),kp=H,Ep=yr,xp=wi.f,Rp=yp.set,Sp=Bh,Dp=wp,Tp=Ap,Ip=Nh,Op=kp.MutationObserver||kp.WebKitMutationObserver,Pp=kp.document,Cp=kp.process,Lp=kp.Promise,Up=xp(kp,"queueMicrotask"),Mp=Up&&Up.value;Mp||(lp=function(){var e,t;for(Ip&&(e=Cp.domain)&&e.exit();hp;){t=hp.fn,hp=hp.next;try{t()}catch(e){throw hp?fp():pp=void 0,e}}pp=void 0,e&&e.enter()},Sp||Ip||Tp||!Op||!Pp?!Dp&&Lp&&Lp.resolve?((vp=Lp.resolve(void 0)).constructor=Lp,bp=Ep(vp.then,vp),fp=function(){bp(lp)}):Ip?fp=function(){Cp.nextTick(lp)}:(Rp=Ep(Rp,kp),fp=function(){Rp(lp)}):(mp=!0,gp=Pp.createTextNode(""),new Op(lp).observe(gp,{characterData:!0}),fp=function(){gp.data=mp=!mp}));var jp=Mp||function(e){var t={fn:e,next:void 0};pp&&(pp.next=t),hp||(hp=t,fp()),pp=t},Gp={},Bp=Rt,Np=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Bp(t),this.reject=Bp(n)};Gp.f=function(e){return new Np(e)};var Fp,qp,Vp,Wp,Hp=lt,zp=et,Kp=Gp,$p=function(e,t){if(Hp(e),zp(t)&&t.constructor===e)return t;var n=Kp.f(e);return(0,n.resolve)(t),n.promise},Qp=H,Yp="object"==typeof window,Jp=Oa,Xp=H,Zp=ke,ef=pt,tf=dh,nf=Ye.exports,rf=uh,af=lu,sf=Ms,of=mh,df=Rt,cf=ye,uf=et,lf=bh,hf=on,pf=function(e,t,n){var r,i,a,s,o,d,c,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=yh(t,u),m=function(e){return r&&Dh(r,"normal",e),new Ih(!0,e)},g=function(e){return l?(wh(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=Sh(e)))throw Th(Ah(e)+" is not iterable");if(kh(i)){for(a=0,s=Eh(e);s>a;a++)if((o=g(e[a]))&&xh(Oh,o))return o;return new Ih(!1)}r=Rh(e,i)}for(d=r.next;!(c=_h(d,r)).done;){try{o=g(c.value)}catch(e){Dh(r,"throw",e)}if("object"==typeof o&&o&&xh(Oh,o))return o}return new Ih(!1)},ff=yc,mf=Gh,gf=yp.set,vf=jp,bf=$p,yf=function(e,t){var n=Qp.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},_f=Gp,wf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Af=Cn,kf=ka,Ef=Yp,xf=Nh,Rf=Oe,Sf=Ke("species"),Df=Af.get,Tf=Af.set,If=Af.getterFor("Promise"),Of=tf&&tf.prototype,Pf=tf,Cf=Of,Lf=Xp.TypeError,Uf=Xp.document,Mf=Xp.process,jf=_f.f,Gf=jf,Bf=!!(Uf&&Uf.createEvent&&Xp.dispatchEvent),Nf=cf(Xp.PromiseRejectionEvent),Ff=!1,qf=kf("Promise",(function(){var e=hf(Pf),t=e!==String(Pf);if(!t&&66===Rf)return!0;if(Rf>=51&&/native code/.test(e))return!1;var n=new Pf((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Sf]=r,!(Ff=n.then((function(){}))instanceof r)||!t&&Ef&&!Nf})),Vf=qf||!ff((function(e){Pf.all(e).catch((function(){}))})),Wf=function(e){var t;return!(!uf(e)||!cf(t=e.then))&&t},Hf=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;vf((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var s,o,d,c=n[a++],u=i?c.ok:c.fail,l=c.resolve,h=c.reject,p=c.domain;try{u?(i||(2===e.rejection&&Qf(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),d=!0)),s===c.promise?h(Lf("Promise-chain cycle")):(o=Wf(s))?ef(o,s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Kf(e)}))}},zf=function(e,t,n){var r,i;Bf?((r=Uf.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Xp.dispatchEvent(r)):r={promise:t,reason:n},!Nf&&(i=Xp["on"+e])?i(r):"unhandledrejection"===e&&yf("Unhandled promise rejection",n)},Kf=function(e){ef(gf,Xp,(function(){var t,n=e.facade,r=e.value;if($f(e)&&(t=wf((function(){xf?Mf.emit("unhandledRejection",r,n):zf("unhandledrejection",n,r)})),e.rejection=xf||$f(e)?2:1,t.error))throw t.value}))},$f=function(e){return 1!==e.rejection&&!e.parent},Qf=function(e){ef(gf,Xp,(function(){var t=e.facade;xf?Mf.emit("rejectionHandled",t):zf("rejectionhandled",t,e.value)}))},Yf=function(e,t,n){return function(r){e(t,r,n)}},Jf=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Hf(e,!0))},Xf=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Lf("Promise can't be resolved itself");var r=Wf(t);r?vf((function(){var n={done:!1};try{ef(r,t,Yf(Xf,n,e),Yf(Jf,n,e))}catch(t){Jf(n,t,e)}})):(e.value=t,e.state=1,Hf(e,!1))}catch(t){Jf({done:!1},t,e)}}};if(qf&&(Cf=(Pf=function(e){lf(this,Cf),df(e),ef(Fp,this);var t=Df(this);try{e(Yf(Xf,t),Yf(Jf,t))}catch(e){Jf(t,e)}}).prototype,(Fp=function(e){Tf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=rf(Cf,{then:function(e,t){var n=If(this),r=n.reactions,i=jf(mf(this,Pf));return i.ok=!cf(e)||e,i.fail=cf(t)&&t,i.domain=xf?Mf.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&Hf(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),qp=function(){var e=new Fp,t=Df(e);this.promise=e,this.resolve=Yf(Xf,t),this.reject=Yf(Jf,t)},_f.f=jf=function(e){return e===Pf||e===Vp?new qp(e):Gf(e)},cf(tf)&&Of!==Object.prototype)){Wp=Of.then,Ff||(nf(Of,"then",(function(e,t){var n=this;return new Pf((function(e,t){ef(Wp,n,e,t)})).then(e,t)}),{unsafe:!0}),nf(Of,"catch",Cf.catch,{unsafe:!0}));try{delete Of.constructor}catch(e){}af&&af(Of,Cf)}Jp({global:!0,wrap:!0,forced:qf},{Promise:Pf}),sf(Pf,"Promise",!1),of("Promise"),Vp=Zp("Promise"),Jp({target:"Promise",stat:!0,forced:qf},{reject:function(e){var t=jf(this);return ef(t.reject,void 0,e),t.promise}}),Jp({target:"Promise",stat:!0,forced:qf},{resolve:function(e){return bf(this,e)}}),Jp({target:"Promise",stat:!0,forced:Vf},{all:function(e){var t=this,n=jf(t),r=n.resolve,i=n.reject,a=wf((function(){var n=df(t.resolve),a=[],s=0,o=1;pf(e,(function(e){var d=s++,c=!1;o++,ef(n,t,e).then((function(e){c||(c=!0,a[d]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=jf(t),r=n.reject,i=wf((function(){var i=df(t.resolve);pf(e,(function(e){ef(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Zf=Oa,em=H,tm=Pe,nm=Ur,rm=et,im=ue,am=Cr,sm=md,om=ni,dm=id,cm=Oe,um=Ke("isConcatSpreadable"),lm=em.TypeError,hm=cm>=51||!tm((function(){var e=[];return e[um]=!1,e.concat()[0]!==e})),pm=dm("concat"),fm=function(e){if(!rm(e))return!1;var t=e[um];return void 0!==t?!!t:nm(e)};Zf({target:"Array",proto:!0,forced:!hm||!pm},{concat:function(e){var t,n,r,i,a,s=im(this),o=om(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(fm(a=-1===t?s:arguments[t])){if(d+(i=am(a))>9007199254740991)throw lm("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&sm(o,d,a[n])}else{if(d>=9007199254740991)throw lm("Maximum allowed index exceeded");sm(o,d++,a)}return o.length=d,o}});var mm=Je,gm=Bn.EXISTS,vm=ae,bm=Xe.f,ym=Function.prototype,_m=vm(ym.toString),wm=/^\s*function ([^ (]*)/,Am=vm(wm.exec);function km(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Em(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Em(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xm(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}mm&&!gm&&bm(ym,"name",{configurable:!0,get:function(){try{return Am(wm,_m(this))[1]}catch(e){return""}}});var Sm,Dm={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Tm={},Im=function(e,t){Tm[e]=Rm(Rm({},t),{},{isLoading:!1})},Om=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Pm=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=Tm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=km(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,d=Dm[o].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Om({id:o,src:Dm[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),c=o.id,u=o.src,console.log("Could not load external script ".concat(c," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Om({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),Cm=new function t(){var n=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),D(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Im(this.moduleName,this.moduleConfig)},Lm=et,Um=Zn,Mm=Ke("match"),jm=function(e){var t;return Lm(e)&&(void 0!==(t=e[Mm])?!!t:"RegExp"==Um(e))},Gm=jm,Bm=H.TypeError,Nm=function(e){if(Gm(e))throw Bm("The method doesn't accept regular expressions");return e},Fm=Ke("match"),qm=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Fm]=!1,"/./"[e](t)}catch(e){}}return!1},Vm=Oa,Wm=ae,Hm=wi.f,zm=Or,Km=es,$m=Nm,Qm=oe,Ym=qm,Jm=Wm("".startsWith),Xm=Wm("".slice),Zm=Math.min,eg=Ym("startsWith");Vm({target:"String",proto:!0,forced:!!(eg||(Sm=Hm(String.prototype,"startsWith"),!Sm||Sm.writable))&&!eg},{startsWith:function(e){var t=Km(Qm(this));$m(e);var n=zm(Zm(arguments.length>1?arguments[1]:void 0,t.length)),r=Km(e);return Jm?Jm(t,r,n):Xm(t,n,n+r.length)===r}});var tg=ae,ng=Bn.PROPER,rg=Ye.exports,ig=lt,ag=ft,sg=es,og=Pe,dg=ju,cg=RegExp.prototype,ug=cg.toString,lg=tg(dg),hg=og((function(){return"/a/b"!=ug.call({source:"a",flags:"b"})})),pg=ng&&"toString"!=ug.name;(hg||pg)&&rg(RegExp.prototype,"toString",(function(){var e=ig(this),t=sg(e.source),n=e.flags;return"/"+t+"/"+sg(void 0===n&&ag(cg,e)&&!("flags"in cg)?lg(e):n)}),{unsafe:!0});var fg=ae,mg=Ye.exports,gg=pl,vg=Pe,bg=Ke,yg=Zt,_g=bg("species"),wg=RegExp.prototype,Ag=function(e,t,n,r){var i=bg(e),a=!vg((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!vg((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[_g]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=fg(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var s=fg(e),d=t.exec;return d===gg||d===wg.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));mg(String.prototype,e,d[0]),mg(wg,i,d[1])}r&&yg(wg[i],"sham",!0)},kg=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Eg=pt,xg=lt,Rg=ye,Sg=Zn,Dg=pl,Tg=H.TypeError,Ig=function(e,t){var n=e.exec;if(Rg(n)){var r=Eg(n,e,t);return null!==r&&xg(r),r}if("RegExp"===Sg(e))return Eg(Dg,e,t);throw Tg("RegExp#exec called on incompatible receiver")},Og=pt,Pg=lt,Cg=oe,Lg=kg,Ug=es,Mg=Dt,jg=Ig;function Gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gg(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ag("search",(function(e,t,n){return[function(t){var n=Cg(this),r=null==t?void 0:Mg(t,e);return r?Og(r,t,n):new RegExp(t)[e](Ug(n))},function(e){var r=Pg(this),i=Ug(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;Lg(s,0)||(r.lastIndex=0);var o=jg(r,i);return Lg(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Ng,Fg,qg=function(){function e(){S(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),c=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?c:d()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:c,topDomain:u&&u.length?u:c,noGAPageView:f,noLotamePageView:m,noGamedockSDK:g,noMinijuegosSDK:v,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:c===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Bg(Bg({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}}]),e}(),Vg=function(){try{return(new qg).getBridgeContext()}catch(e){return{}}}(),Wg={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Ng=!1,(Fg=c("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Fg.xanthophyll&&(Ng=!0),Ng)},Hg=Pc.charAt,zg=function(e,t,n){return t+(n?Hg(e,t).length:1)},Kg=ae,$g=ue,Qg=Math.floor,Yg=Kg("".charAt),Jg=Kg("".replace),Xg=Kg("".slice),Zg=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ev=/\$([$&'`]|\d{1,2})/g,tv=Ja,nv=pt,rv=ae,iv=Ag,av=Pe,sv=lt,ov=ye,dv=Dr,cv=Or,uv=es,lv=oe,hv=zg,pv=Dt,fv=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,d=ev;return void 0!==i&&(i=$g(i),d=Zg),Jg(a,d,(function(a,d){var c;switch(Yg(d,0)){case"$":return"$";case"&":return e;case"`":return Xg(t,0,n);case"'":return Xg(t,s);case"<":c=i[Xg(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>o){var l=Qg(u/10);return 0===l?a:l<=o?void 0===r[l-1]?Yg(d,1):r[l-1]+Yg(d,1):a}c=r[u-1]}return void 0===c?"":c}))},mv=Ig,gv=Ke("replace"),vv=Math.max,bv=Math.min,yv=rv([].concat),_v=rv([].push),wv=rv("".indexOf),Av=rv("".slice),kv="$0"==="a".replace(/./,"$0"),Ev=!!/./[gv]&&""===/./[gv]("a","$0");iv("replace",(function(e,t,n){var r=Ev?"$":"$0";return[function(e,n){var r=lv(this),i=null==e?void 0:pv(e,gv);return i?nv(i,e,r,n):nv(t,uv(r),e,n)},function(e,i){var a=sv(this),s=uv(e);if("string"==typeof i&&-1===wv(i,r)&&-1===wv(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var d=ov(i);d||(i=uv(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=mv(a,s);if(null===h)break;if(_v(l,h),!c)break;""===uv(h[0])&&(a.lastIndex=hv(s,cv(a.lastIndex),u))}for(var p,f="",m=0,g=0;g<l.length;g++){for(var v=uv((h=l[g])[0]),b=vv(bv(dv(h.index),s.length),0),y=[],_=1;_<h.length;_++)_v(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=yv([v],y,b,s);void 0!==w&&_v(A,w);var k=uv(tv(i,void 0,A))}else k=fv(v,s,b,y,w,i);b>=m&&(f+=Av(s,m,b)+k,m=b+v.length)}return f+Av(s,m)}]}),!!av((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!kv||Ev);var xv=Pe,Rv=Ke("iterator"),Sv=!xv((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Rv]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Dv=_s,Tv=Math.floor,Iv=function(e,t){var n=e.length,r=Tv(n/2);return n<8?Ov(e,t):Pv(e,Iv(Dv(e,0,r),t),Iv(Dv(e,r),t),t)},Ov=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Pv=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},Cv=Iv,Lv=Oa,Uv=H,Mv=ke,jv=pt,Gv=ae,Bv=Sv,Nv=Ye.exports,Fv=uh,qv=Ms,Vv=ru,Wv=Cn,Hv=bh,zv=ye,Kv=pe,$v=yr,Qv=or,Yv=lt,Jv=et,Xv=es,Zv=bs,eb=Yt,tb=rc,nb=Yd,rb=Cv,ib=Ke("iterator"),ab=Wv.set,sb=Wv.getterFor("URLSearchParams"),ob=Wv.getterFor("URLSearchParamsIterator"),db=Mv("fetch"),cb=Mv("Request"),ub=Mv("Headers"),lb=cb&&cb.prototype,hb=ub&&ub.prototype,pb=Uv.RegExp,fb=Uv.TypeError,mb=Uv.decodeURIComponent,gb=Uv.encodeURIComponent,vb=Gv("".charAt),bb=Gv([].join),yb=Gv([].push),_b=Gv("".replace),wb=Gv([].shift),Ab=Gv([].splice),kb=Gv("".split),Eb=Gv("".slice),xb=/\+/g,Rb=Array(4),Sb=function(e){return Rb[e-1]||(Rb[e-1]=pb("((?:%[\\da-f]{2}){"+e+"})","gi"))},Db=function(e){try{return mb(e)}catch(t){return e}},Tb=function(e){var t=_b(e,xb," "),n=4;try{return mb(t)}catch(e){for(;n;)t=_b(t,Sb(n--),Db);return t}},Ib=/[!'()~]|%20/g,Ob={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Pb=function(e){return Ob[e]},Cb=function(e){return _b(gb(e),Ib,Pb)},Lb=function(e,t){if(t)for(var n,r,i=kb(t,"&"),a=0;a<i.length;)(n=i[a++]).length&&(r=kb(n,"="),yb(e,{key:Tb(wb(r)),value:Tb(bb(r,"="))}))},Ub=function(e){this.entries.length=0,Lb(this.entries,e)},Mb=function(e,t){if(e<t)throw fb("Not enough arguments")},jb=Vv((function(e,t){ab(this,{type:"URLSearchParamsIterator",iterator:tb(sb(e).entries),kind:t})}),"Iterator",(function(){var e=ob(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Gb=function(){Hv(this,Bb);var e,t,n,r,i,a,s,o,d,c=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(ab(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Ub}),void 0!==c)if(Jv(c))if(e=nb(c))for(n=(t=tb(c,e)).next;!(r=jv(n,t)).done;){if(a=(i=tb(Yv(r.value))).next,(s=jv(a,i)).done||(o=jv(a,i)).done||!jv(a,i).done)throw fb("Expected sequence with length 2");yb(l,{key:Xv(s.value),value:Xv(o.value)})}else for(d in c)Kv(c,d)&&yb(l,{key:d,value:Xv(c[d])});else Lb(l,"string"==typeof c?"?"===vb(c,0)?Eb(c,1):c:Xv(c))},Bb=Gb.prototype;if(Fv(Bb,{append:function(e,t){Mb(arguments.length,2);var n=sb(this);yb(n.entries,{key:Xv(e),value:Xv(t)}),n.updateURL()},delete:function(e){Mb(arguments.length,1);for(var t=sb(this),n=t.entries,r=Xv(e),i=0;i<n.length;)n[i].key===r?Ab(n,i,1):i++;t.updateURL()},get:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=[],i=0;i<t.length;i++)t[i].key===n&&yb(r,t[i].value);return r},has:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Mb(arguments.length,1);for(var n,r=sb(this),i=r.entries,a=!1,s=Xv(e),o=Xv(t),d=0;d<i.length;d++)(n=i[d]).key===s&&(a?Ab(i,d--,1):(a=!0,n.value=o));a||yb(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=sb(this);rb(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=sb(this).entries,r=$v(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new jb(this,"keys")},values:function(){return new jb(this,"values")},entries:function(){return new jb(this,"entries")}},{enumerable:!0}),Nv(Bb,ib,Bb.entries,{name:"entries"}),Nv(Bb,"toString",(function(){for(var e,t=sb(this).entries,n=[],r=0;r<t.length;)e=t[r++],yb(n,Cb(e.key)+"="+Cb(e.value));return bb(n,"&")}),{enumerable:!0}),qv(Gb,"URLSearchParams"),Lv({global:!0,forced:!Bv},{URLSearchParams:Gb}),!Bv&&zv(ub)){var Nb=Gv(hb.has),Fb=Gv(hb.set),qb=function(e){if(Jv(e)){var t,n=e.body;if("URLSearchParams"===Qv(n))return t=e.headers?new ub(e.headers):new ub,Nb(t,"content-type")||Fb(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Zv(e,{body:eb(0,Xv(n)),headers:eb(0,t)})}return e};if(zv(db)&&Lv({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return db(e,arguments.length>1?qb(arguments[1]):{})}}),zv(cb)){var Vb=function(e){return Hv(this,lb),new cb(e,arguments.length>1?qb(arguments[1]):{})};lb.constructor=Vb,Vb.prototype=lb,Lv({global:!0,forced:!0},{Request:Vb})}}var Wb=Ki.includes,Hb=Gl;Oa({target:"Array",proto:!0},{includes:function(e){return Wb(this,e,arguments.length>1?arguments[1]:void 0)}}),Hb("includes");var zb=Oa,Kb=Nm,$b=oe,Qb=es,Yb=qm,Jb=ae("".indexOf);zb({target:"String",proto:!0,forced:!Yb("includes")},{includes:function(e){return!!~Jb(Qb($b(this)),Qb(Kb(e)),arguments.length>1?arguments[1]:void 0)}});var Xb=Ja,Zb=pt,ey=ae,ty=Ag,ny=jm,ry=lt,iy=oe,ay=Gh,sy=zg,oy=Or,dy=es,cy=Dt,uy=_s,ly=Ig,hy=pl,py=Pe,fy=Gu.UNSUPPORTED_Y,my=Math.min,gy=[].push,vy=ey(/./.exec),by=ey(gy),yy=ey("".slice);function _y(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function d(e){return L(r,e)}function c(e,t){return U(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),P.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(c("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],c("top.domain.from","origins");else if(0===t)n=s,c("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(C(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?C(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",o),c("partner.url.from","fallback"))}.bind(this)(),{get:d,print:function(e){console.log(d(e))}}}ty("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=dy(iy(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ny(e))return Zb(t,r,e,i);for(var a,s,o,d=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,c+"g");(a=Zb(hy,l,r))&&!((s=l.lastIndex)>u&&(by(d,yy(r,u,a.index)),a.length>1&&a.index<r.length&&Xb(gy,d,uy(a,1)),o=a[0].length,u=s,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&vy(l,"")||by(d,""):by(d,yy(r,u)),d.length>i?uy(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Zb(t,this,e,n)}:t,[function(t,n){var i=iy(this),a=null==t?void 0:cy(t,e);return a?Zb(a,t,i,n):Zb(r,dy(i),t,n)},function(e,i){var a=ry(this),s=dy(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var d=ay(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(fy?"g":"y"),l=new d(fy?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===ly(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=fy?0:f;var g,v=ly(l,fy?yy(s,f):s);if(null===v||(g=my(oy(l.lastIndex+(fy?f:0)),s.length))===p)f=sy(s,f,c);else{if(by(m,yy(s,p,f)),m.length===h)return m;for(var b=1;b<=v.length-1;b++)if(by(m,v[b]),m.length===h)return m;f=p=g}}return by(m,yy(s,p)),m}]}),!!py((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),fy);var wy="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==wy&&wy,Ay="URLSearchParams"in wy,ky="Symbol"in wy&&"iterator"in Symbol,Ey="FileReader"in wy&&"Blob"in wy&&function(){try{return new Blob,!0}catch(e){return!1}}(),xy="FormData"in wy,Ry="ArrayBuffer"in wy;if(Ry)var Sy=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Dy=ArrayBuffer.isView||function(e){return e&&Sy.indexOf(Object.prototype.toString.call(e))>-1};function Ty(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Iy(e){return"string"!=typeof e&&(e=String(e)),e}function Oy(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return ky&&(t[Symbol.iterator]=function(){return t}),t}function Py(e){this.map={},e instanceof Py?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Cy(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Ly(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Uy(e){var t=new FileReader,n=Ly(t);return t.readAsArrayBuffer(e),n}function My(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function jy(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Ey&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:xy&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Ay&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ry&&Ey&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=My(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ry&&(ArrayBuffer.prototype.isPrototypeOf(e)||Dy(e))?this._bodyArrayBuffer=My(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ay&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ey&&(this.blob=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Cy(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Uy)}),this.text=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Ly(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},xy&&(this.formData=function(){return this.text().then(Ny)}),this.json=function(){return this.text().then(JSON.parse)},this}Py.prototype.append=function(e,t){e=Ty(e),t=Iy(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Py.prototype.delete=function(e){delete this.map[Ty(e)]},Py.prototype.get=function(e){return e=Ty(e),this.has(e)?this.map[e]:null},Py.prototype.has=function(e){return this.map.hasOwnProperty(Ty(e))},Py.prototype.set=function(e,t){this.map[Ty(e)]=Iy(t)},Py.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Py.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Oy(e)},Py.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Oy(e)},Py.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Oy(e)},ky&&(Py.prototype[Symbol.iterator]=Py.prototype.entries);var Gy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function By(e,t){if(!(this instanceof By))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof By){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Py(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Py(t.headers)),this.method=function(e){var t=e.toUpperCase();return Gy.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Ny(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Fy(e,t){if(!(this instanceof Fy))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Py(t.headers),this.url=t.url||"",this._initBody(e)}By.prototype.clone=function(){return new By(this,{body:this._bodyInit})},jy.call(By.prototype),jy.call(Fy.prototype),Fy.prototype.clone=function(){return new Fy(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Py(this.headers),url:this.url})},Fy.error=function(){var e=new Fy(null,{status:0,statusText:""});return e.type="error",e};var qy=[301,302,303,307,308];Fy.redirect=function(e,t){if(-1===qy.indexOf(t))throw new RangeError("Invalid status code");return new Fy(null,{status:t,headers:{location:e}})};var Vy,Wy=wy.DOMException;try{new Wy}catch(e){Wy=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Wy.prototype=Object.create(Error.prototype),Wy.prototype.constructor=Wy}function Hy(e,t){return new Promise((function(n,r){var i=new By(e,t);if(i.signal&&i.signal.aborted)return r(new Wy("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new Py,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Fy(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new Wy("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&wy.location.href?wy.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(Ey?a.responseType="blob":Ry&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Py?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Iy(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}Hy.polyfill=!0,wy.fetch||(wy.fetch=Hy,wy.Headers=Py,wy.Request=By,wy.Response=Fy);var zy,Ky=function(e){var n=this;if(!Vy){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Vg.topDomain,domain:Vg.parentDomain,referrer:Vg.parentURL,depth:o(),version:Na.version,byloader:Vg.isTokenGameURL,isTokenGameURL:Vg.isTokenGameURL,isMasterGameURL:Vg.isMasterGameURL,isExtHostedGameURL:Vg.isExtHostedGameURL,byloaderVersion:Vg.version,tracking:Wg.userDeclinedTracking,whitelabel:Wg.whitelabelPartner,platform:u()};Vy=new l(r)}return Vy||{send:function(){t(this,n)}.bind(this)}};var $y,Qy,Yy=[],Jy=function(e){Yy.push(e)},Xy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if($y){e.next=4;break}return e.next=3,Zy(Qy);case 3:$y=e.sent;case 4:return e.abrupt("return",$y);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zy=function(e){var n=this;zy.send("gdfw.loading",{message:"loading"}),Yy=[],Jy("1"),Jy("2");var r=new _y;Jy("3");var i=r.get("partner.domain.value");Jy("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Jy("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(Na.version,"&localTime=").concat((new Date).getHours())}.bind(this);Jy("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Jy("7"),new Promise(function(e){var r=this;if(t(this,n),$y)e($y);else{Jy("7.1");var i=a();try{Jy("7.2");var o=s();Jy("7.3"),fetch(o).then(function(e){return t(this,r),Jy("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Jy("7.5"),n.success){var s,o,d,c,u=n.result.game;Jy("7.6");var l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:Fa(u.__t4r)||{},block_exts:Fa(u.push_cuda),bloc_gard:Fa(u.bloc_gard),cookie:Fa(u.cookie),gdpr:Fa(u.gdpr),diagnostic:Fa(u.diagnostic),cmp:Fa(u.cmp),gft:Fa(u.gft)||{},sdk:Fa(u.sdk)||{},sdkfw:Fa(u.sdkfw)||{},loader:Fa(u.loader)||{},splash:Fa(u.splash)||{},promo:Fa(u.promo)||{},dAds:Fa(u.dads)||{},pAds:Fa(u.pads)||{},mAds:Fa(u.mads)||{},rAds:Fa(u.rads)||{},lp:Fa(u.lp)||{},extsc:Fa(u.extsc)||{},evnts:Fa(u.evnts)||{},dp:Fa(u.dp)||{},adflw:Fa(u.adflw)||{}};Jy("7.7");var p=h(M(i),l);Jy("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(d=o.afg)||void 0===d?void 0:d.enabled),function(){t(this,a)}.bind(this),Jy("7.9"),null!==(c=p.pAds)&&void 0!==c&&c.enabled&&(p.preroll=!0),Jy("7.10"),zy.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var d=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(d,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},e_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),t_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.next=5,e_();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),n_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return d=e.sent,c=!(null==d||null===(t=d.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:c,path:c?null==d||null===(n=d.extsc)||void 0===n?void 0:n.path:"",name:c?null==d||null===(i=d.extsc)||void 0===i?void 0:i.name:"",ref:c?null==d||null===(a=d.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:c?null==d||null===(s=d.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!c&&!(null==d||null===(o=d.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),r_=function(){var n=e(r.mark((function e(){var n,i,a,s,o,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n_();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,d),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),i_=!1,a_=!1,s_=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i_){e.next=4;break}return e.abrupt("return",n(a_));case 4:i_=!0;case 5:return e.next=7,n_();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return a_=!0,e.abrupt("return",n(!0));case 16:d=!0,setTimeout(function(){t(this,u),d&&(d=!1,i_=!0,n(!1))}.bind(this),5e3),c=setInterval(function(){t(this,u),d&&o&&window[s]?(d=!1,i_=!0,a_=!0,clearInterval(c),n(!0)):d||clearInterval(c)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},o_=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),h("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),h("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),h("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),h("cancelAd")}.bind(this),o=function(){return t(this,n),h("openConsole")}.bind(this),d=function(){return t(this,n),h("showBanner")}.bind(this),c=function(){return t(this,n),h("session")}.bind(this),u=function(e){return t(this,n),h("sendGenericEvent",{options:e})}.bind(this),l=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),h=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),p=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&m(r)}),!1)}.bind(this),f=function(){t(this,n),p(),h("init")}.bind(this),m=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:d,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:c,onEvent:m,init:f,_sendSDKReady:l,sendGenericEvent:u}}(e);return n.init(),n},d_=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},c_=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},u_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,e_();case 2:return t=e.sent,n=!t,e.next=6,c_(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=d_(),s=a.isMasterGameURL,o=s(),e.next=13,t_();case 13:return d=e.sent,c=!1,c=d?!o&&!!i:!o,e.abrupt("return",c);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),l_=Je,h_=ae,p_=La,f_=Di,m_=h_(Ai.f),g_=h_([].push),v_=function(e){return function(t){for(var n,r=f_(t),i=p_(r),a=i.length,s=0,o=[];a>s;)n=i[s++],l_&&!m_(r,n)||g_(o,e?[n,r[n]]:r[n]);return o}},b_={entries:v_(!0),values:v_(!1)}.values;Oa({target:"Object",stat:!0},{values:function(e){return b_(e)}});var y_=Oa,__=dh,w_=Pe,A_=ke,k_=ye,E_=Gh,x_=$p,R_=Ye.exports;if(y_({target:"Promise",proto:!0,real:!0,forced:!!__&&w_((function(){__.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=E_(this,A_("Promise")),n=k_(e);return this.then(n?function(n){return x_(t,e()).then((function(){return n}))}:e,n?function(n){return x_(t,e()).then((function(){throw n}))}:e)}}),k_(__)){var S_=A_("Promise").prototype.finally;__.prototype.finally!==S_&&R_(__.prototype,"finally",S_,{unsafe:!0})}var D_=oe,T_=es,I_=ae("".replace),O_="[\t\n\v\f\r \u2028\u2029\ufeff]",P_=RegExp("^"+O_+O_+"*"),C_=RegExp(O_+O_+"*$"),L_=function(e){return function(t){var n=T_(D_(t));return 1&e&&(n=I_(n,P_,"")),2&e&&(n=I_(n,C_,"")),n}},U_={start:L_(1),end:L_(2),trim:L_(3)},M_=Bn.PROPER,j_=Pe,G_="\t\n\v\f\r \u2028\u2029\ufeff",B_=U_.trim;Oa({target:"String",proto:!0,forced:function(e){return j_((function(){return!!G_[e]()||"
"!=="
"[e]()||M_&&G_[e].name!==e}))}("trim")},{trim:function(){return B_(this)}});var N_=ye,F_=et,q_=lu,V_=Je,W_=H,H_=ae,z_=ka,K_=function(e,t,n){var r,i;return q_&&N_(r=t.constructor)&&r!==n&&F_(i=r.prototype)&&i!==n.prototype&&q_(e,i),e},$_=Zt,Q_=Xe.f,Y_=Gi.f,J_=ft,X_=jm,Z_=es,ew=ju,tw=Gu,nw=Ye.exports,rw=Pe,iw=pe,aw=Cn.enforce,sw=mh,ow=Vu,dw=zu,cw=Ke("match"),uw=W_.RegExp,lw=uw.prototype,hw=W_.SyntaxError,pw=H_(ew),fw=H_(lw.exec),mw=H_("".charAt),gw=H_("".replace),vw=H_("".indexOf),bw=H_("".slice),yw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_w=/a/g,ww=/a/g,Aw=new uw(_w)!==_w,kw=tw.UNSUPPORTED_Y,Ew=V_&&(!Aw||kw||ow||dw||rw((function(){return ww[cw]=!1,uw(_w)!=_w||uw(ww)==ww||"/a/i"!=uw(_w,"i")})));if(z_("RegExp",Ew)){for(var xw=function(e,t){var n,r,i,a,s,o,d=J_(lw,this),c=X_(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===xw)return e;if((c||J_(lw,e))&&(e=e.source,u&&(t="flags"in h?h.flags:pw(h))),e=void 0===e?"":Z_(e),t=void 0===t?"":Z_(t),h=e,ow&&"dotAll"in _w&&(r=!!t&&vw(t,"s")>-1)&&(t=gw(t,/s/g,"")),n=t,kw&&"sticky"in _w&&(i=!!t&&vw(t,"y")>-1)&&(t=gw(t,/y/g,"")),dw&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,d=!1,c=0,u="";r<=n;r++){if("\\"===(t=mw(e,r)))t+=mw(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:fw(yw,bw(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||iw(s,u))throw new hw("Invalid capture group name");s[u]=!0,a[a.length]=[u,c],d=!1,u="";continue}d?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=K_(uw(e,t),d?this:lw,xw),(r||i||l.length)&&(o=aw(s),r&&(o.dotAll=!0,o.raw=xw(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=mw(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+mw(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{$_(s,"source",""===h?"(?:)":h)}catch(e){}return s},Rw=function(e){e in xw||Q_(xw,e,{configurable:!0,get:function(){return uw[e]},set:function(t){uw[e]=t}})},Sw=Y_(uw),Dw=0;Sw.length>Dw;)Rw(Sw[Dw++]);lw.constructor=xw,xw.prototype=lw,nw(W_,"RegExp",xw)}sw("RegExp");var Tw=Oa,Iw=ui.find,Ow=Gl,Pw=!0;"find"in[]&&Array(1).find((function(){Pw=!1})),Tw({target:"Array",proto:!0,forced:Pw},{find:function(e){return Iw(this,e,arguments.length>1?arguments[1]:void 0)}}),Ow("find");var Cw=Oa,Lw=xr,Uw=Di,Mw=hi,jw=ae([].join),Gw=Lw!=Object,Bw=Mw("join",",");Cw({target:"Array",proto:!0,forced:Gw||!Bw},{join:function(e){return jw(Uw(this),void 0===e?",":e)}});var Nw=ui.map;Oa({target:"Array",proto:!0,forced:!id("map")},{map:function(e){return Nw(this,e,arguments.length>1?arguments[1]:void 0)}});var Fw=Je,qw=ae,Vw=pt,Ww=Pe,Hw=La,zw=ra,Kw=Ai,$w=ue,Qw=xr,Yw=Object.assign,Jw=Object.defineProperty,Xw=qw([].concat),Zw=!Yw||Ww((function(){if(Fw&&1!==Yw({b:1},Yw(Jw({},"a",{enumerable:!0,get:function(){Jw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Yw({},e)[n]||Hw(Yw({},t)).join("")!=r}))?function(e,t){for(var n=$w(e),r=arguments.length,i=1,a=zw.f,s=Kw.f;r>i;)for(var o,d=Qw(arguments[i++]),c=a?Xw(Hw(d),a(d)):Hw(d),u=c.length,l=0;u>l;)o=c[l++],Fw&&!Vw(s,d,o)||(n[o]=d[o]);return n}:Yw,eA=Zw;Oa({target:"Object",stat:!0,forced:Object.assign!==eA},{assign:eA});var tA=function(){function e(t){S(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),nA=function(){function e(t,n){S(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),rA=function(e){if(!e)return!1;var t=iA.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},iA=Object.prototype.toString;function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oA(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function dA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uA=new F,lA=null,hA=function(){function n(e,r,i){var a=this;if(S(this,n),lA)return lA;lA=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):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 o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:d,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,d,c,u,l,p,A,k,E,x,R,P,C,L,U,F,q,V,W;return T(n,[{key:"start",value:(W=e(r.mark((function n(){var i,a,s,o=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.adSystemInitialize(e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o._init_afg_script({adsense_channel:"4089988593"});case 2:case"end":return e.stop()}}),e)}))));case 3:return i=n.sent,this.afgInitSuccess=i.success,n.next=7,this.adSystemInitialize(e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o._init_hl_script();case 2:return e.next=4,o._init_ima_script();case 4:o._createPlayer(),o._setUpIMA();case 6:case"end":return e.stop()}}),e)}))));case 7:if(a=n.sent,this.imaInitSuccess=a.success,s=[],this.afgInitSuccess||s.push(i.error),this.imaInitSuccess||s.push(a.error),!(s.length>0)){n.next=14;break}throw s[0];case 14:window.eventTest=function(e){t(this,o),this._broadcast(e,{message:"",status:"success"})}.bind(this),n.next=21;break;case 17:throw n.prev=17,n.t0=n.catch(0),Wa("gd-adflow error on ads.start",n.t0),new Error(n.t0);case 21:case"end":return n.stop()}}),n,this,[[0,17]])}))),function(){return W.apply(this,arguments)})},{key:"adSystemInitialize",value:(V=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={success:!1},e.prev=1,e.next=4,t();case 4:n.success=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n.error=e.t0;case 10:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,7]])}))),function(e){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p,f,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],d=Math.floor(Math.random()*o.length),c=o[d],s({url:c}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,u=a.nextAdPosition(n),console.log("GD-SDK Position",u),a._broadcast("AD_REQUEST",{message:u}),l=a.options,"preroll"===u&&G(l.preroll)?l=l.preroll:"midroll"===u&&G(l.midroll)?l=l.midroll:"rewarded"===u&&G(l.rewarded)&&(l=l.rewarded),h="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",e.next=17,window.idhb.isLoaded();case 17:if(p={tnl_keys:cA(cA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&G(l.retry_on_success)&&G(l.retry_on_success.vast))){e.next=22;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 22:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&G(l.retry_on_failure.vast))){e.next=26;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 26:if(!G(l.vast)){e.next=28;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 28:return e.next=30,a._create_dp_context(u,i);case 30:f=e.sent,Va("gd-adflow, before idhb",u,h),window.idhb.requestAds({slots:D({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,g),console.log("GD-SDK After HB..."),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:cA(cA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=38;break;case 35:throw e.prev=35,e.t0=e.catch(8),new Error(e.t0);case 38:case"end":return e.stop()}}),e,this,[[8,35]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===g.Rewarded)return this.adRewardedCount++,"rewarded";if(e===g.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===g.Rewarded?"rewarded":e===g.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){var a=this;if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var s,o=null==e||null===(s=e.tnl_keys)||void 0===s?void 0:s.tnl_ad_pos;this.adSuccess=!1;var d=new google.ima.AdsRequest,c=this._transformVast(e,n),u=cA(cA({},n),{},{adTag:c,tnl_ad_pos:o});this.adCounter[o]=this.adCounter[o]||0,this.adCounter[o]++;var l=e.dp,h=e.hl;l&&(l.adtag_url=c.url,this._extend_dp_with_adsense(l,h,null==e?void 0:e.tnl_keys));var p=this._isVMAP(o);if(function(){t(this,a),n.shouldFail&&(l?(l.adtag_url="dp_original_broken",l.fallback_url="dp_fallback_broken"):c.url="original_broken",null==l||l.adtag_url,null==l||l.fallback_url,c.url),p=!1}.bind(this),p){var f=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=sA(sA({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=sA(sA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var d=o.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:c++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:c++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:l,adtag:c,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(o)}));d.adsResponse=f}else if(l&&h.bidFloorApplied){var m=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(l);d.adsResponse=m}else if(l&&l.fallback_url){var g=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(l);d.adsResponse=g}else d.adTagUrl=c.url;d.linearAdSlotWidth=this.options.width,d.linearAdSlotHeight=this.options.height,d.nonLinearAdSlotWidth=this.options.width,d.nonLinearAdSlotHeight=this.options.height,d.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(d.vastLoadTimeout=this.options.vast_load_timeout),d.setAdWillAutoPlay(n.autoplayAllowed),d.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(d,u);try{this._broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}i(d)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this._broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(q=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):j.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(F=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.adType,i=t.params,this.adType_=n,this.adContext=cA({},i),"promo"!==(null==i?void 0:i.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(i,n));case 5:if("adsense"!==(null==i?void 0:i.adapter)){e.next=26;break}if(n!==g.Interstitial){e.next=19;break}if("preroll"!==(null==i?void 0:i.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==i?void 0:i.position)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==i?void 0:i.position)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 17:e.next=24;break;case 19:if(n!==g.Rewarded){e.next=23;break}return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 23:case 34:throw new Error("Unsupported ad type");case 24:e.next=35;break;case 26:if(n!==g.Interstitial){e.next=30;break}return e.abrupt("return",this._startInterstitialAd(i));case 30:if(n!==g.Rewarded){e.next=34;break}return e.abrupt("return",this._startRewardedAd(i));case 35:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==g.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==g.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new nA(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(C=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,u,l,h,p,f,m,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(d=i?i.containerId:null)||s("Container id is not specified"),c=document.getElementById(d),document.getElementById(d)||s("No container is found with this id - ".concat(d)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),u=i.slotId?i.slotId:"gd__banner@".concat(d),document.getElementById(u)||(l="\n .gd__banner{\n z-index: ".concat(v.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),c.appendChild(h)),(p=document.createElement("div")).id=u,p.classList.add("gd__banner"),c.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[u]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,g)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return C.apply(this,arguments)})},{key:"_startInterstitialAd",value:(P=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(cA(cA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return P.apply(this,arguments)})},{key:"_startPromo",value:(R=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(cA(cA({},i),t),n);case 11:if(e.sent.success){e.next=16;break}return e.abrupt("return");case 16:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=27;break;case 22:throw e.prev=22,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(t,n){var i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,i=this.nextAdPosition(n),a=this._create_promo_context(i),this._requestPromo(a,cA({adType:g.Interstitial},t)),e.next=7,this._waitOnAdLoad();case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(g.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,cA({adType:g.Interstitial},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_waitOnAdLoad",value:function(){var e=this;return new Promise(function(n,r){var i=this;t(this,e);var a="videoad.preloadad";this.eventBus.unsubscribeScope(a);var s=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!0,args:e})}.bind(this),1)}.bind(this),o=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!1,args:e})}.bind(this),1)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",s,a),this.eventBus.subscribe("AD_SDK_CANCELED",o,a),this.eventBus.subscribe("AD_ERROR",o,a)}.bind(this))}},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(cA(cA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(g.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,cA({adType:g.Rewarded},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(g.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(g.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player&&(this.video_ad_player.src=""),this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=this.gameData.__t4r;var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this._broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=v.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),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)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),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(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c="AD_SDK_MANAGER_READY";this._broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var n,r=this,i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c=b(google.ima.AdEvent.Type,e.type),u=!1,l=(null==e||null===(n=e.getAd())||void 0===n?void 0:n.getContentType())||"",h=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="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:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:u=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:e.getAd(),u=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===g.Rewarded&&this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="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:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",u=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="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:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var v=e.getAd().getContentType();p=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:u=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:u=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}if(""!==c&&""!==p&&this._broadcast(c,{name:c,message:p,status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),u&&!this.adSuccess){this.adSuccess=!0;var y=e.getAd(),_="Rainbow"===(null==y?void 0:y.getAdSystem())&&(null==y?void 0:y.getWrapperAdIds().some(function(e){return t(this,r),"promo"===e}.bind(this)));null==y||y.getAdSystem(),null==y||y.getWrapperAdIds(),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success",isPromoSuccess:_}),this.resetForNext(e)}}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);uA.emit("AD_ERROR",r),this._broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(rA(e.getInnerError)){var t=e.getInnerError();if(t)return rA(t.getErrorCode)&&rA(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];G(s)&&(i.query[a]=B.stringify(s))}var o=new I(i.url,!0);return N(o.query,i.query||{}),cA({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=B.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&G(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&G(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),G(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var d=B.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var c in d){new RegExp(a.cust_params.$$remove,"i").test(c)&&delete d[c]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=d,N(s,u),s.cust_params=B.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var d,c=Math.random()<o;return a&&c&&(null===(d=e.t4r[a])||void 0===d?void 0:d.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,d,c,u,l,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(c=d.mAds)||void 0===c||null===(u=c.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?b>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,d=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new tA(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(O.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(O.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,d="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a);console.log("gd-adflow openPromoUrl",d);var c=o?d:void 0;return function(){t(this,r)}.bind(this),{promo_url:c,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:d={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(c=new tA(a.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(O.encode(JSON.stringify(d))),null==i||i.adapterIndex,null==i||i.isLastAdapter,l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&(null==i?void 0:i.isLastAdapter)&&"rewarded"===n,null==l||l.enabled,null==i||i.isLastAdapter,fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(u,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(u),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(u),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 20:case"end":return e.stop()}}),e,this,[[0,16]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=B.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=B.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(u=e(r.mark((function e(n){var i,a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],s=function(){return t(this,u),!1}.bind(this),window.idhb=window.idhb||{iabCmpExists:s},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=9,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 9:o=y("ch",window.location.href),d=y("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},o&&(c.channel=o),d&&(c.ch_date=d),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_ima_script",value:(c=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"_init_afg_script",value:(d=e(r.mark((function e(n){var i,a,s,o,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,d),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,u),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense rewarded error",status:"error",skipForward:!0}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),d=function(e){t(this,u),e()}.bind(this),c=function(e){t(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),r={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(r),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var r}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,a),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"}),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"preroll",adBreakDone:i},window.adsbygoogle.push(r),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var r}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error 2",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense midroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),r={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(O.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===g.Rewarded)t="reward";else if(n===g.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}},{key:"_broadcast",value:function(e,n){var r=this,i=!1;["AD_ERROR"].some(function(n){return t(this,r),n===e}.bind(this))&&(i=!this.adContext.isLastAdapter||this.adContext.extraPromoRunOnFail,console.log("gd-adflow skipForward",e,i,this.adContext.adapterIndex,this.adContext.isLastAdapter,this.adContext.extraPromoRunOnFail)),this.eventBus.broadcast(e,cA(cA({},n),{},{skipForward:i}))}}]),n}(),pA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",d=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Im(this.moduleName,this.moduleConfig)},fA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",d=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Im(this.moduleName,this.moduleConfig)},mA=function(e,t){console.log(e,t)},gA={},vA={},bA=null;function yA(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return gA.version=r,gA.frame=e,gA.function=n,gA.version}function _A(e){var n=this;return bA||(bA=new Promise(function(r){function i(t,n){if(mA("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:gA,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),yA(),gA.frame?2===gA.version?(mA("TCF v2 CMP found. Fetching the consent."),gA.function?(mA("CMP API is directly accessible, calling it now..."),gA.function("addEventListener",gA.version,i)):(mA("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==vA[r.callId]&&vA[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var d=Math.random()+"",c="".concat(a,"Call"),u=D({},c,{command:e,parameter:o,callId:d,version:r});vA[d]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,gA.version,r)}("addEventListener",gA.frame,i))):r({result:"cmpVersionNotV2",cmp:gA}):r({result:"cmpNotFound"})}.bind(this)),bA)}var wA=new(function(){function t(){S(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(d,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function AA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function kA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var EA=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var d=this;t(this,n);try{var c=document.createElement("script");if(c.async=null==s||s,c.type="text/javascript",c.onload=function(){t(this,d),e()}.bind(this),c.onerror=function(){t(this,d);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),c.src=r,i){var u,l=AA(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;c.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},xA=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,EA({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,EA({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,EA({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),RA=new F,SA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(SA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=SA[i][a];s&&RA.emit(s,r)}}),!1);var TA=q(),IA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:TA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){CA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",CA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=TA,CA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},OA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=PA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},PA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},CA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function MA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function jA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GA,BA=function(){function n(e){var r=this;S(this,n),D(this,"_getAdTypeByAfgPosition",function(e){var n=this;t(this,r);var i={preroll:["preroll","start"],midroll:["next"],rewarded:["reward"]},a=Object.keys(i).find(function(r){var a=this;return t(this,n),i[r].some(function(n){return t(this,a),n===e.params.position}.bind(this))}.bind(this));return a||"midroll"}.bind(this)),this._gameData=e._gameData,this._msgrt=e.msgrt,this._adInstance=e.adInstance,this._eventBus=e.eventBus,this.blockedAdsMap=e.blockedAdsMap,this._onResumeGame=e.onResumeGame.bind(e),this._setAdRequestTimer=e._setAdRequestTimer.bind(e),this._giveGift=e._giveGift.bind(e),this.send_atom_event=e.send_atom_event.bind(e),this.get_session_id=e.get_session_id.bind(e),this.get_ad_system_init_result=e.get_ad_system_init_result.bind(e)}var i,a;return T(n,[{key:"runAdFlow",value:(a=e(r.mark((function e(n){var i,a,s,o,d,c,u,l,h,p,f,m,g,v,b,y,_,w,A,k,E,x,R,S,D,T,I,O,P,C,L,U,M,j=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d=this._getAdTypeByAfgPosition(n),n.params.position,c=this._getAdFlow(d),u=this._gameData,l=u.afg_disabled,h=null===(i=u.promo)||void 0===i||null===(a=i.rainbow)||void 0===a?void 0:a.enabled,p=null===(s=u.promo)||void 0===s?void 0:s.onadsense,f="reward"===(null===(o=n.params)||void 0===o?void 0:o.position),m=l?c.filter(function(e){return t(this,j),"adsense"!==e}.bind(this)):c,g=this.get_ad_system_init_result(),v=g.afg,b=g.ima,this.adsBlocked=!v&&!b,this.adsBlocked?(Va("gd-adflow adsBlocked so changing the flow"),m=[m[0]]):(v||(m=m.filter(function(e){return t(this,j),"adsense"!==e}.bind(this))),b||(m=m.filter(function(e){return t(this,j),"ima"!==e}.bind(this)))),y=!1,_=!1,w=[],A=0,k=!1,E=MA(m),e.prev=21,E.s();case 23:if((x=E.n()).done){e.next=50;break}return R=x.value,n.params.adapter=R,S=A===m.length-1,h&&S&&"ima"===R&&(n.params.runPromoAsImaFallback=!0),D=S&&"adsense"===R&&h&&p&&f,n.params=UA(UA({},n.params),{},{adapterIndex:A,isLastAdapter:S,shouldFail:!1,extraPromoRunOnFail:D}),function(){t(this,j)}.bind(this),Va("gd-adflow, before adInvoke",A,R,n.params.shouldFail),e.next=34,this.adInvoke(n);case 34:if(T=e.sent,I=T.success,O=T.args,!I){e.next=44;break}return Va("gd-adflow, adapter-result-success",A,R,O),y=!0,_=!(null==O||!O.isPromoSuccess),e.abrupt("break",50);case 44:Va("gd-adflow, adapter-result-failure",A,R,O.message),A++,w.push(O.message),S&&"adsense"===R&&h&&p&&f&&(k=!0);case 48:e.next=23;break;case 50:e.next=55;break;case 52:e.prev=52,e.t0=e.catch(21),E.e(e.t0);case 55:return e.prev=55,E.f(),e.finish(55);case 58:if(!k){e.next=67;break}return n.params.adapter="promo",e.next=63,this.adInvoke(n);case 63:e.sent.success&&(_=!0);case 67:(function(){t(this,j)}).bind(this),P=w.join(" /n"),y?(this._setAdRequestTimer(),this._onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),this._giveGift()):(this._onResumeGame(P,"warning"),this._giveGift()),C="-1",L="none",y&&_?C="promo_ima":y?(C="index_".concat(A),L=m[A]):_&&(C="promo_adsense"),U=this.get_session_id(),this.adsBlocked&&"-1"===C?(M="rewarded"===d?"rewarded":this.blockedAdsMap.preroll?"midroll":"preroll",this.blockedAdsMap[M]=this.blockedAdsMap[M]?this.blockedAdsMap[M]+1:1,JSON.stringify(this.blockedAdsMap),this._msgrt.send("adflow.blocked.pos",{message:"".concat(M)}),this.send_atom_event("gd.adflow",{adBlocker:!0,afgBlocked:!0,imaBlocked:!0,adType:M,sessionId:U,successAdapter:"none",adFlowIndex:C})):(this._msgrt.send("adflow.all.index",{message:"".concat(C)}),this._msgrt.send("adflow.all.success_adapter",{message:"".concat(L)}),this._msgrt.send("adflow.".concat(d,".index"),{message:"".concat(C)}),this._msgrt.send("adflow.".concat(d,".success_adapter"),{message:"".concat(L)}),this.send_atom_event("gd.adflow",{adFlowIndex:C,successAdapter:L,adBlocker:!1,afgBlocked:!v,imaBlocked:!b,adType:d,sessionId:U}));case 77:case"end":return e.stop()}}),e,this,[[21,52,55,58]])}))),function(e){return a.apply(this,arguments)})},{key:"adInvoke",value:(i=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="main.showad.".concat(i.params.adapter,".").concat(i.params.adapterIndex),d=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!1,args:e})}.bind(this),c=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!0,args:e})}.bind(this),a._eventBus.subscribe("AD_ERROR",d,o),a._eventBus.subscribe("AD_SDK_CANCELED",d,o),a._eventBus.subscribe("AD_SUCCESS",c,o),e.prev=6,e.next=9,a._adInstance.startAd(i);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(6),Wa("gd-adflow startAd error",e.t0),n({success:!1,err:e.t0});case 15:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return i.apply(this,arguments)})},{key:"_getAdFlow",value:function(e){var n,r,i,a,s,o,d,c,u=this,l=void function(){t(this,u)}.bind(this),h=this._gameData.adflw;l&&(h=l);var p=null!==(n=h)&&void 0!==n&&null!==(r=n.adapters)&&void 0!==r&&r.default?null===(i=h)||void 0===i||null===(a=i.adapters)||void 0===a?void 0:a.default:["ima","adsense"];return p=null!==(s=h)&&void 0!==s&&null!==(o=s.adapters)&&void 0!==o&&o[e]?null===(d=h)||void 0===d||null===(c=d.adapters)||void 0===c?void 0:c[e]:p}}]),n}(),NA=new F,FA=["https://games.softgames.com","https://sg.gamedistribution.com","https://minigame-stg.aeriagames.jp","https://minigame.aeriagames.jp"];function qA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function VA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=e.source;if(FA.some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)){var s=r.system,o=r.action,d="aeriaExternalHostsConnector"===s&&"resultBoxClosed"===o;if("Softgames"===s&&"score"===o)GA=a,(window.parent||window).postMessage(r,"*"),NA.emit("aeria-event",r);else d&&GA&&GA.postMessage(r,"*")}}),!1);var WA,HA=q(),zA=null,KA=null,$A=function(){function n(e){var r=this;if(S(this,n),zA)return zA;zA=this,this.blockedAdsMap={},this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new _y,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&IA(this._gameData)}.bind(this)),this._registerSGBridge(),this._whichFrame()}var i,v,b,y,w,D,P,C,L,U,j,G;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(G=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new _y,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,xA();case 6:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{key:"testConsent",value:function(){try{yA();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_A({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;RA.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"_sendLoadedEvent",value:function(){if(!this._isLoaded&&(this._isLoaded=!0,"loader-frame"===this._whichFrame()))try{this._whichFrame(),this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(j=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().then(function(){t(this,s),(this._isMasterGameURL()||this._isExtHostedGameURL())&&(this.msgrt.send("adblocker.flw",{message:"ok"}),this.msgrt.send("adblocker.adapters",{message:"none"}))}.bind(this)).catch(function(e){t(this,s);var n="".concat(e).startsWith("Error: Blocked:");Va("gd-adflow adsBlocked",n,e);var r=this.get_ad_system_init_result(),i=r.ima,a=r.afg;if(this.adsBlocked=!i&&!a,this._isMasterGameURL()||this._isExtHostedGameURL()){this.msgrt.send("adblocker.flw",{message:"".concat(this.adsBlocked?"blocked":"ok")});var o=i||a?i?a?"none":"adsense":"ima":"all";this.msgrt.send("adblocker.adapters",{message:"".concat(o)})}console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return j.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=M(e);this.options=t?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Na.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(B.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=c("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:o(),version:Na.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:u(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),KA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&KA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),wA.track(KA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=KA)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&wA.track(KA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){if(t(this,e),n.message.startsWith("Blocked:")){if(!this._bridge.noBlockerEvent&&(this.msgrt.send("error",{message:n.message}),!this._hasBlocker)){this._hasBlocker=!0;var r=Math.random()<.25;this.msgrt.send("adblck.src",{message:n.message}),r&&this._sendTunnlEvent(3)}}else this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(Na.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(B.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(L=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new hA(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=Na,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(C=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return t=e.sent,this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"_createSplash",value:(P=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version}),n,this._parentDomain),e.next=6,n_();case 6:o=e.sent,d=o.enabled,s.on("playClick",function(){var e=this;if(t(this,c),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),d?window.gdsdk.showAd(g.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(g.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,c),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,c),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(D=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(g.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(y=e(r.mark((function t(n){var i,a=this,s=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>1&&void 0!==s[1]?s[1]:{},t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,s){var o,d,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d={adType:n,params:i,adTimestamp:a.adRequestTimer},e.next=5,a.sdkReady;case 5:return c=e.sent,e.next=8,a.videoAdReady;case 8:if(null!==(o=a._gameData.lp)&&void 0!==o&&o.load||a._sendLoadedEvent(),a._sendGamedockGamePlay(),a._rejectAdIfGameBlocked({gameData:c,adRequest:d}),a._rejectAdIfAdDisabled({gameData:c,adRequest:d}),a._rejectAdIfUnsupportedType({adRequest:d}),"rewarded"===n&&a._setGameRewardedFlag(),null!=i&&i.isGift||a._rejectAdIfAdRateHits({gameData:c,adRequest:d}),a.adInstance.attachAfgPosition(d),!a.adFlowRunning){e.next=18;break}return e.abrupt("return",t());case 18:return a.adFlowRunning=!0,u=new BA(a),e.next=22,u.runAdFlow(d);case 22:a.adFlowRunning=!1,t(),a._post_message({topic:"adrequest.instream"}),e.next=32;break;case 27:e.prev=27,e.t0=e.catch(0),a.adFlowRunning=!1,a.onResumeGame(e.t0.message,"warning"),s(e.t0.message);case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t)}))),function(e){return y.apply(this,arguments)})},{key:"_giveGift",value:function(){var e,t,n,r,i;null!==(e=this._gameData)&&void 0!==e&&null!==(t=e.gft)&&void 0!==t&&t.enabled&&(null===(n=this._gameData)||void 0===n||null===(r=n.gft)||void 0===r||null===(i=r.durations[this._giftCount])||void 0===i?void 0:i.after)===this.adInstance.adMidrollCount&&this.decideToGiveAGift()}},{key:"_setAdRequestTimer",value:function(){this.adRequestTimer=Date.now()}},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==g.Interstitial&&t.adType!==g.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=g.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===g.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,d=e.adRequest,c=null;d.adType===g.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):c=o.midroll;if(d.adType===g.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(b=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=g.Rewarded,e.next=16;break;case 14:if(n===g.Interstitial||n===g.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:return e.next=18,i.adInstance.preloadAd(n);case 18:o=e.sent,t(o),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(0),a(e.t0);case 25:case"end":return e.stop()}}),e,null,[[0,22]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return b.apply(this,arguments)})},{key:"cancelAd",value:(v=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return v.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){console.log("gd-adflow error onResumeGame",e),p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||OA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||OA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new R(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),c=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?c:d()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:c,topDomain:u&&u.length?u:c,noGAPageView:f,noLotamePageView:m,noGamedockSDK:g,noMinijuegosSDK:v,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:c===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_whichFrame",value:function(){return(this._isMasterGameURL()||this._isExtHostedGameURL())&&!this._isTokenGameURL()?"loader-frame":"game-frame"}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new fA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(i=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new pA(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(B.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=VA(VA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)KA.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning||n.adFlowRunning?console.log("Advertisement already running..."):(n.showAd(g.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}},{key:"send_atom_event",value:function(e,t){this.adInstance._send_atom_event(e,t)}},{key:"get_session_id",value:function(){return HA}},{key:"get_ad_system_init_result",value:function(){return{afg:this.adInstance.afgInitSuccess,ima:this.adInstance.imaInitSuccess}}},{key:"_setGameRewardedFlag",value:function(){try{if("developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasrewarded/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var e=JSON.stringify({type:"GD_SDK_REWARDED_SET",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(e,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(e,"*")}catch(e){}}}catch(e){}}}]),n}(),QA={},YA=function(e){try{if(e.skipForward)return;if(QA.source){var t={type:"gd-sdk-on-event",event:e};QA.source.postMessage(t,QA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},JA=function(){YA({name:"SDK_READY",status:"success",message:"Everything is ready."}),YA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),YA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},XA=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,d=a.type,c=a.method,u=a.options;if("gd-sdk-self"!==d){if("gd-sdk"===d){if(!QA.source&&"init"===c)return function(e){var t=e.source,n=e.origin;QA={source:t,origin:n}}({source:o,origin:s}),void JA();var l=n[c];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===c&&za.firstAdapterModeAdsense&&"rewarded"!==u.adType&&(console.log("promo-test, set first adapter to adssense 3"),u.params=u.params?u.params:{},u.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(u)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:c,options:u};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},ZA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){YA(e),t.apply(this,arguments)}}(e);var t=new $A(e);return XA(t),t},ek=function(e){try{var t=Ky(e);e.gameId||t.send("nogameid",{message:"".concat(Vg.parentURL)})}catch(e){}},tk={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ek(t),zy=Ky(Qy=t),e.next=5,u_();case 5:return n=e.sent,i=n?o_(t):ZA(t),r_(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",ZA(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function nk(){return(nk=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s_();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,ik(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rk=!1;function ik(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),WA)return r(WA);if(rk)var s=setInterval(function(){t(this,a),WA&&(rk=!1,clearInterval(s),r(WA))}.bind(this),100);else rk=!0,tk.create(e).then(function(e){t(this,a),WA=e,e._sendSDKReady(),rk=!1,r(WA)}.bind(this))}.bind(this))}var ak,sk=(ik(ak=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return nk.apply(this,arguments)}(ak,e)}});function ok(){var n=this;this.AdType=g,this.preloadAd=function(e){var n=this;return sk.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sk.invoke(function(e){var r=this;if(t(this,a),n===g.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.sendEvent=function(e){var n=this;return sk.invoke(function(r){return t(this,n),r.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){t(this,n),Cm.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Cm.addScore(e)}.bind(this)}}ok.prototype=new function(){this.showBanner=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new ok,window.gdApi=window.gdsdk;
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{parseJSON as i,getParentUrl as a,getParentDomain as s,getIframeDepth as o,getTopDomain as c,getQueryParams as d,getMobilePlatform as u,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as g,Layers as v,getKeyByValue as b,getQueryString as y,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as R}from"@bygd/gd-sdk-era/dist/default";import S from"@babel/runtime/helpers/classCallCheck";import D from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import I from"url-parse";import{Base64 as O}from"js-base64";import P from"validator";import C from"is-valid-domain";import L from"get-value";import U from"set-value";import M from"lodash.clonedeep";import j from"can-autoplay";import{isPlainObject as G}from"is-plain-object";import B from"querystringify";import N from"lodash.merge";import{EventEmitter as F}from"events";import{v4 as q}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},H=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||function(){return this}()||Function("return this")(),z={exports:{}},K=H,$=Object.defineProperty,Q=function(e,t){try{$(K,e,{value:t,configurable:!0,writable:!0})}catch(n){K[e]=t}return t},Y=Q,J=H["__core-js_shared__"]||Y("__core-js_shared__",{}),X=J;(z.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Z,ee,te=Function.prototype,ne=te.bind,re=te.call,ie=ne&&ne.bind(re),ae=ne?function(e){return e&&ie(re,e)}:function(e){return e&&function(){return re.apply(e,arguments)}},se=H.TypeError,oe=function(e){if(null==e)throw se("Can't call method on "+e);return e},ce=oe,de=H.Object,ue=function(e){return de(ce(e))},le=ue,he=ae({}.hasOwnProperty),pe=Object.hasOwn||function(e,t){return he(le(e),t)},fe=ae,me=0,ge=Math.random(),ve=fe(1..toString),be=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ve(++me+ge,36)},ye=function(e){return"function"==typeof e},_e=H,we=ye,Ae=function(e){return we(e)?e:void 0},ke=function(e,t){return arguments.length<2?Ae(_e[e]):_e[e]&&_e[e][t]},Ee=ke("navigator","userAgent")||"",xe=H,Re=Ee,Se=xe.process,De=xe.Deno,Te=Se&&Se.versions||De&&De.version,Ie=Te&&Te.v8;Ie&&(ee=(Z=Ie.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!ee&&Re&&(!(Z=Re.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=Re.match(/Chrome\/(\d+)/))&&(ee=+Z[1]);var Oe=ee,Pe=function(e){try{return!!e()}catch(e){return!0}},Ce=Oe,Le=Pe,Ue=!!Object.getOwnPropertySymbols&&!Le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ce&&Ce<41})),Me=Ue&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=H,Ge=z.exports,Be=pe,Ne=be,Fe=Ue,qe=Me,Ve=Ge("wks"),We=je.Symbol,He=We&&We.for,ze=qe?We:We&&We.withoutSetter||Ne,Ke=function(e){if(!Be(Ve,e)||!Fe&&"string"!=typeof Ve[e]){var t="Symbol."+e;Fe&&Be(We,e)?Ve[e]=We[e]:Ve[e]=qe&&He?He(t):ze(t)}return Ve[e]},$e={};$e[Ke("toStringTag")]="z";var Qe="[object z]"===String($e),Ye={exports:{}},Je=!Pe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Xe={},Ze=ye,et=function(e){return"object"==typeof e?null!==e:Ze(e)},tt=et,nt=H.document,rt=tt(nt)&&tt(nt.createElement),it=function(e){return rt?nt.createElement(e):{}},at=it,st=!Je&&!Pe((function(){return 7!=Object.defineProperty(at("div"),"a",{get:function(){return 7}}).a})),ot=H,ct=et,dt=ot.String,ut=ot.TypeError,lt=function(e){if(ct(e))return e;throw ut(dt(e)+" is not an object")},ht=Function.prototype.call,pt=ht.bind?ht.bind(ht):function(){return ht.apply(ht,arguments)},ft=ae({}.isPrototypeOf),mt=ke,gt=ye,vt=ft,bt=Me,yt=H.Object,_t=bt?function(e){return"symbol"==typeof e}:function(e){var t=mt("Symbol");return gt(t)&&vt(t.prototype,yt(e))},wt=H.String,At=function(e){try{return wt(e)}catch(e){return"Object"}},kt=ye,Et=At,xt=H.TypeError,Rt=function(e){if(kt(e))return e;throw xt(Et(e)+" is not a function")},St=Rt,Dt=function(e,t){var n=e[t];return null==n?void 0:St(n)},Tt=pt,It=ye,Ot=et,Pt=H.TypeError,Ct=pt,Lt=et,Ut=_t,Mt=Dt,jt=function(e,t){var n,r;if("string"===t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;if(It(n=e.valueOf)&&!Ot(r=Tt(n,e)))return r;if("string"!==t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;throw Pt("Can't convert object to primitive value")},Gt=Ke,Bt=H.TypeError,Nt=Gt("toPrimitive"),Ft=function(e,t){if(!Lt(e)||Ut(e))return e;var n,r=Mt(e,Nt);if(r){if(void 0===t&&(t="default"),n=Ct(r,e,t),!Lt(n)||Ut(n))return n;throw Bt("Can't convert object to primitive value")}return void 0===t&&(t="number"),jt(e,t)},qt=_t,Vt=function(e){var t=Ft(e,"string");return qt(t)?t:t+""},Wt=Je,Ht=st,zt=lt,Kt=Vt,$t=H.TypeError,Qt=Object.defineProperty;Xe.f=Wt?Qt:function(e,t,n){if(zt(e),t=Kt(t),zt(n),Ht)try{return Qt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw $t("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Yt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Jt=Xe,Xt=Yt,Zt=Je?function(e,t,n){return Jt.f(e,t,Xt(1,n))}:function(e,t,n){return e[t]=n,e},en=ye,tn=J,nn=ae(Function.toString);en(tn.inspectSource)||(tn.inspectSource=function(e){return nn(e)});var rn,an,sn,on=tn.inspectSource,cn=ye,dn=on,un=H.WeakMap,ln=cn(un)&&/native code/.test(dn(un)),hn=z.exports,pn=be,fn=hn("keys"),mn=function(e){return fn[e]||(fn[e]=pn(e))},gn={},vn=ln,bn=H,yn=ae,_n=et,wn=Zt,An=pe,kn=J,En=mn,xn=gn,Rn=bn.TypeError,Sn=bn.WeakMap;if(vn||kn.state){var Dn=kn.state||(kn.state=new Sn),Tn=yn(Dn.get),In=yn(Dn.has),On=yn(Dn.set);rn=function(e,t){if(In(Dn,e))throw new Rn("Object already initialized");return t.facade=e,On(Dn,e,t),t},an=function(e){return Tn(Dn,e)||{}},sn=function(e){return In(Dn,e)}}else{var Pn=En("state");xn[Pn]=!0,rn=function(e,t){if(An(e,Pn))throw new Rn("Object already initialized");return t.facade=e,wn(e,Pn,t),t},an=function(e){return An(e,Pn)?e[Pn]:{}},sn=function(e){return An(e,Pn)}}var Cn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!_n(t)||(n=an(t)).type!==e)throw Rn("Incompatible receiver, "+e+" required");return n}}},Ln=Je,Un=pe,Mn=Function.prototype,jn=Ln&&Object.getOwnPropertyDescriptor,Gn=Un(Mn,"name"),Bn={EXISTS:Gn,PROPER:Gn&&"something"===function(){}.name,CONFIGURABLE:Gn&&(!Ln||Ln&&jn(Mn,"name").configurable)},Nn=H,Fn=ye,qn=pe,Vn=Zt,Wn=Q,Hn=on,zn=Bn.CONFIGURABLE,Kn=Cn.get,$n=Cn.enforce,Qn=String(String).split("String");(Ye.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,c=r&&void 0!==r.name?r.name:t;Fn(n)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!qn(n,"name")||zn&&n.name!==c)&&Vn(n,"name",c),(i=$n(n)).source||(i.source=Qn.join("string"==typeof c?c:""))),e!==Nn?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Vn(e,t,n)):s?e[t]=n:Wn(t,n)})(Function.prototype,"toString",(function(){return Fn(this)&&Kn(this).source||Hn(this)}));var Yn=ae,Jn=Yn({}.toString),Xn=Yn("".slice),Zn=function(e){return Xn(Jn(e),8,-1)},er=H,tr=Qe,nr=ye,rr=Zn,ir=Ke("toStringTag"),ar=er.Object,sr="Arguments"==rr(function(){return arguments}()),or=tr?rr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=ar(e),ir))?n:sr?rr(t):"Object"==(r=rr(t))&&nr(t.callee)?"Arguments":r},cr=or,dr=Qe?{}.toString:function(){return"[object "+cr(this)+"]"},ur=Qe,lr=Ye.exports,hr=dr;ur||lr(Object.prototype,"toString",hr,{unsafe:!0});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fr=it("span").classList,mr=fr&&fr.constructor&&fr.constructor.prototype,gr=mr===Object.prototype?void 0:mr,vr=Rt,br=ae(ae.bind),yr=function(e,t){return vr(e),void 0===t?e:br?br(e,t):function(){return e.apply(t,arguments)}},_r=ae,wr=Pe,Ar=Zn,kr=H.Object,Er=_r("".split),xr=wr((function(){return!kr("z").propertyIsEnumerable(0)}))?function(e){return"String"==Ar(e)?Er(e,""):kr(e)}:kr,Rr=Math.ceil,Sr=Math.floor,Dr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Sr:Rr)(t)},Tr=Dr,Ir=Math.min,Or=function(e){return e>0?Ir(Tr(e),9007199254740991):0},Pr=Or,Cr=function(e){return Pr(e.length)},Lr=Zn,Ur=Array.isArray||function(e){return"Array"==Lr(e)},Mr=ae,jr=Pe,Gr=ye,Br=or,Nr=on,Fr=function(){},qr=[],Vr=ke("Reflect","construct"),Wr=/^\s*(?:class|function)\b/,Hr=Mr(Wr.exec),zr=!Wr.exec(Fr),Kr=function(e){if(!Gr(e))return!1;try{return Vr(Fr,qr,e),!0}catch(e){return!1}},$r=!Vr||jr((function(){var e;return Kr(Kr.call)||!Kr(Object)||!Kr((function(){e=!0}))||e}))?function(e){if(!Gr(e))return!1;switch(Br(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return zr||!!Hr(Wr,Nr(e))}:Kr,Qr=H,Yr=Ur,Jr=$r,Xr=et,Zr=Ke("species"),ei=Qr.Array,ti=function(e){var t;return Yr(e)&&(t=e.constructor,(Jr(t)&&(t===ei||Yr(t.prototype))||Xr(t)&&null===(t=t[Zr]))&&(t=void 0)),void 0===t?ei:t},ni=function(e,t){return new(ti(e))(0===t?0:t)},ri=yr,ii=xr,ai=ue,si=Cr,oi=ni,ci=ae([].push),di=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(c,d,u,l){for(var h,p,f=ai(c),m=ii(f),g=ri(d,u),v=si(m),b=0,y=l||oi,_=t?y(c,v):n||s?y(c,0):void 0;v>b;b++)if((o||b in m)&&(p=g(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:ci(_,h)}else switch(e){case 4:return!1;case 7:ci(_,h)}return a?-1:r||i?i:_}},ui={forEach:di(0),map:di(1),filter:di(2),some:di(3),every:di(4),find:di(5),findIndex:di(6),filterReject:di(7)},li=Pe,hi=function(e,t){var n=[][e];return!!n&&li((function(){n.call(null,t||function(){throw 1},1)}))},pi=ui.forEach,fi=H,mi=pr,gi=gr,vi=hi("forEach")?[].forEach:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)},bi=Zt,yi=function(e){if(e&&e.forEach!==vi)try{bi(e,"forEach",vi)}catch(t){e.forEach=vi}};for(var _i in mi)mi[_i]&&yi(fi[_i]&&fi[_i].prototype);yi(gi);var wi={},Ai={},ki={}.propertyIsEnumerable,Ei=Object.getOwnPropertyDescriptor,xi=Ei&&!ki.call({1:2},1);Ai.f=xi?function(e){var t=Ei(this,e);return!!t&&t.enumerable}:ki;var Ri=xr,Si=oe,Di=function(e){return Ri(Si(e))},Ti=Je,Ii=pt,Oi=Ai,Pi=Yt,Ci=Di,Li=Vt,Ui=pe,Mi=st,ji=Object.getOwnPropertyDescriptor;wi.f=Ti?ji:function(e,t){if(e=Ci(e),t=Li(t),Mi)try{return ji(e,t)}catch(e){}if(Ui(e,t))return Pi(!Ii(Oi.f,e,t),e[t])};var Gi={},Bi=Dr,Ni=Math.max,Fi=Math.min,qi=function(e,t){var n=Bi(e);return n<0?Ni(n+t,0):Fi(n,t)},Vi=Di,Wi=qi,Hi=Cr,zi=function(e){return function(t,n,r){var i,a=Vi(t),s=Hi(a),o=Wi(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},Ki={includes:zi(!0),indexOf:zi(!1)},$i=pe,Qi=Di,Yi=Ki.indexOf,Ji=gn,Xi=ae([].push),Zi=function(e,t){var n,r=Qi(e),i=0,a=[];for(n in r)!$i(Ji,n)&&$i(r,n)&&Xi(a,n);for(;t.length>i;)$i(r,n=t[i++])&&(~Yi(a,n)||Xi(a,n));return a},ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ta=Zi,na=ea.concat("length","prototype");Gi.f=Object.getOwnPropertyNames||function(e){return ta(e,na)};var ra={};ra.f=Object.getOwnPropertySymbols;var ia=ke,aa=Gi,sa=ra,oa=lt,ca=ae([].concat),da=ia("Reflect","ownKeys")||function(e){var t=aa.f(oa(e)),n=sa.f;return n?ca(t,n(e)):t},ua=pe,la=da,ha=wi,pa=Xe,fa=function(e,t){for(var n=la(t),r=pa.f,i=ha.f,a=0;a<n.length;a++){var s=n[a];ua(e,s)||r(e,s,i(t,s))}},ma=Pe,ga=ye,va=/#|\.prototype\./,ba=function(e,t){var n=_a[ya(e)];return n==Aa||n!=wa&&(ga(t)?ma(t):!!t)},ya=ba.normalize=function(e){return String(e).replace(va,".").toLowerCase()},_a=ba.data={},wa=ba.NATIVE="N",Aa=ba.POLYFILL="P",ka=ba,Ea=H,xa=wi.f,Ra=Zt,Sa=Ye.exports,Da=Q,Ta=fa,Ia=ka,Oa=function(e,t){var n,r,i,a,s,o=e.target,c=e.global,d=e.stat;if(n=c?Ea:d?Ea[o]||Da(o,{}):(Ea[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xa(n,r))&&s.value:n[r],!Ia(c?r:o+(d?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ta(a,i)}(e.sham||i&&i.sham)&&Ra(a,"sham",!0),Sa(n,r,a,e)}},Pa=Zi,Ca=ea,La=Object.keys||function(e){return Pa(e,Ca)},Ua=ue,Ma=La;Oa({target:"Object",stat:!0,forced:Pe((function(){Ma(1)}))},{keys:function(e){return Ma(Ua(e))}});var ja=Array.isArray,Ga=Object.prototype.toString,Ba=ja||function(e){return!!e&&"[object Array]"==Ga.call(e)},Na={name:"@bygd/gd-sdk-pes",version:"1.29.21",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},Fa=function(e){var t=qa("object"===n(e)?e:i(e));return t&&t.version?Na.version>=t.version?t:void 0:t},qa=function(e){var n=this;if(!Ba(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},Va=function(){var e;(e=console).log.apply(e,arguments)},Wa=function(){var e;(e=console).log.apply(e,arguments)};JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima","adsense"],midroll:["ima","adsense","ima","adsense"],rewarded:["ima","adsense","ima","adsense"]}}),JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima"],midroll:["ima","adsense","ima"],rewarded:["ima","adsense","ima","adsense"]}});var Ha,za={},Ka=Function.prototype,$a=Ka.apply,Qa=Ka.bind,Ya=Ka.call,Ja="object"==typeof Reflect&&Reflect.apply||(Qa?Ya.bind($a):function(){return Ya.apply($a,arguments)}),Xa=or,Za=H.String,es=function(e){if("Symbol"===Xa(e))throw TypeError("Cannot convert a Symbol value to a string");return Za(e)},ts=Xe,ns=lt,rs=Di,is=La,as=Je?Object.defineProperties:function(e,t){ns(e);for(var n,r=rs(t),i=is(t),a=i.length,s=0;a>s;)ts.f(e,n=i[s++],r[n]);return e},ss=ke("document","documentElement"),os=lt,cs=as,ds=ea,us=gn,ls=ss,hs=it,ps=mn("IE_PROTO"),fs=function(){},ms=function(e){return"<script>"+e+"<\/script>"},gs=function(e){e.write(ms("")),e.close();var t=e.parentWindow.Object;return e=null,t},vs=function(){try{Ha=new ActiveXObject("htmlfile")}catch(e){}var e,t;vs="undefined"!=typeof document?document.domain&&Ha?gs(Ha):((t=hs("iframe")).style.display="none",ls.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ms("document.F=Object")),e.close(),e.F):gs(Ha);for(var n=ds.length;n--;)delete vs.prototype[ds[n]];return vs()};us[ps]=!0;var bs=Object.create||function(e,t){var n;return null!==e?(fs.prototype=os(e),n=new fs,fs.prototype=null,n[ps]=e):n=vs(),void 0===t?n:cs(n,t)},ys={},_s=ae([].slice),ws=Zn,As=Di,ks=Gi.f,Es=_s,xs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ys.f=function(e){return xs&&"Window"==ws(e)?function(e){try{return ks(e)}catch(e){return Es(xs)}}(e):ks(As(e))};var Rs={},Ss=Ke;Rs.f=Ss;var Ds=H,Ts=pe,Is=Rs,Os=Xe.f,Ps=function(e){var t=Ds.Symbol||(Ds.Symbol={});Ts(t,e)||Os(t,e,{value:Is.f(e)})},Cs=Xe.f,Ls=pe,Us=Ke("toStringTag"),Ms=function(e,t,n){e&&!Ls(e=n?e:e.prototype,Us)&&Cs(e,Us,{configurable:!0,value:t})},js=Oa,Gs=H,Bs=ke,Ns=Ja,Fs=pt,Vs=ae,Ws=Je,Hs=Ue,zs=Pe,Ks=pe,$s=Ur,Qs=ye,Ys=et,Js=ft,Xs=_t,Zs=lt,eo=ue,to=Di,no=Vt,ro=es,io=Yt,ao=bs,so=La,oo=Gi,co=ys,uo=ra,lo=wi,ho=Xe,po=Ai,fo=_s,mo=Ye.exports,go=z.exports,vo=gn,bo=be,yo=Ke,_o=Rs,wo=Ps,Ao=Ms,ko=Cn,Eo=ui.forEach,xo=mn("hidden"),Ro=yo("toPrimitive"),So=ko.set,Do=ko.getterFor("Symbol"),To=Object.prototype,Io=Gs.Symbol,Oo=Io&&Io.prototype,Po=Gs.TypeError,Co=Gs.QObject,Lo=Bs("JSON","stringify"),Uo=lo.f,Mo=ho.f,jo=co.f,Go=po.f,Bo=Vs([].push),No=go("symbols"),Fo=go("op-symbols"),qo=go("string-to-symbol-registry"),Vo=go("symbol-to-string-registry"),Wo=go("wks"),Ho=!Co||!Co.prototype||!Co.prototype.findChild,zo=Ws&&zs((function(){return 7!=ao(Mo({},"a",{get:function(){return Mo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Uo(To,t);r&&delete To[t],Mo(e,t,n),r&&e!==To&&Mo(To,t,r)}:Mo,Ko=function(e,t){var n=No[e]=ao(Oo);return So(n,{type:"Symbol",tag:e,description:t}),Ws||(n.description=t),n},$o=function(e,t,n){e===To&&$o(Fo,t,n),Zs(e);var r=no(t);return Zs(n),Ks(No,r)?(n.enumerable?(Ks(e,xo)&&e[xo][r]&&(e[xo][r]=!1),n=ao(n,{enumerable:io(0,!1)})):(Ks(e,xo)||Mo(e,xo,io(1,{})),e[xo][r]=!0),zo(e,r,n)):Mo(e,r,n)},Qo=function(e,t){Zs(e);var n=to(t),r=so(n).concat(Zo(n));return Eo(r,(function(t){Ws&&!Fs(Yo,n,t)||$o(e,t,n[t])})),e},Yo=function(e){var t=no(e),n=Fs(Go,this,t);return!(this===To&&Ks(No,t)&&!Ks(Fo,t))&&(!(n||!Ks(this,t)||!Ks(No,t)||Ks(this,xo)&&this[xo][t])||n)},Jo=function(e,t){var n=to(e),r=no(t);if(n!==To||!Ks(No,r)||Ks(Fo,r)){var i=Uo(n,r);return!i||!Ks(No,r)||Ks(n,xo)&&n[xo][r]||(i.enumerable=!0),i}},Xo=function(e){var t=jo(to(e)),n=[];return Eo(t,(function(e){Ks(No,e)||Ks(vo,e)||Bo(n,e)})),n},Zo=function(e){var t=e===To,n=jo(t?Fo:to(e)),r=[];return Eo(n,(function(e){!Ks(No,e)||t&&!Ks(To,e)||Bo(r,No[e])})),r};(Hs||(mo(Oo=(Io=function(){if(Js(Oo,this))throw Po("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ro(arguments[0]):void 0,t=bo(e),n=function(e){this===To&&Fs(n,Fo,e),Ks(this,xo)&&Ks(this[xo],t)&&(this[xo][t]=!1),zo(this,t,io(1,e))};return Ws&&Ho&&zo(To,t,{configurable:!0,set:n}),Ko(t,e)}).prototype,"toString",(function(){return Do(this).tag})),mo(Io,"withoutSetter",(function(e){return Ko(bo(e),e)})),po.f=Yo,ho.f=$o,lo.f=Jo,oo.f=co.f=Xo,uo.f=Zo,_o.f=function(e){return Ko(yo(e),e)},Ws&&(Mo(Oo,"description",{configurable:!0,get:function(){return Do(this).description}}),mo(To,"propertyIsEnumerable",Yo,{unsafe:!0}))),js({global:!0,wrap:!0,forced:!Hs,sham:!Hs},{Symbol:Io}),Eo(so(Wo),(function(e){wo(e)})),js({target:"Symbol",stat:!0,forced:!Hs},{for:function(e){var t=ro(e);if(Ks(qo,t))return qo[t];var n=Io(t);return qo[t]=n,Vo[n]=t,n},keyFor:function(e){if(!Xs(e))throw Po(e+" is not a symbol");if(Ks(Vo,e))return Vo[e]},useSetter:function(){Ho=!0},useSimple:function(){Ho=!1}}),js({target:"Object",stat:!0,forced:!Hs,sham:!Ws},{create:function(e,t){return void 0===t?ao(e):Qo(ao(e),t)},defineProperty:$o,defineProperties:Qo,getOwnPropertyDescriptor:Jo}),js({target:"Object",stat:!0,forced:!Hs},{getOwnPropertyNames:Xo,getOwnPropertySymbols:Zo}),js({target:"Object",stat:!0,forced:zs((function(){uo.f(1)}))},{getOwnPropertySymbols:function(e){return uo.f(eo(e))}}),Lo)&&js({target:"JSON",stat:!0,forced:!Hs||zs((function(){var e=Io();return"[null]"!=Lo([e])||"{}"!=Lo({a:e})||"{}"!=Lo(Object(e))}))},{stringify:function(e,t,n){var r=fo(arguments),i=t;if((Ys(t)||void 0!==e)&&!Xs(e))return $s(t)||(t=function(e,t){if(Qs(i)&&(t=Fs(i,this,e,t)),!Xs(t))return t}),r[1]=t,Ns(Lo,null,r)}});if(!Oo[Ro]){var ec=Oo.valueOf;mo(Oo,Ro,(function(e){return Fs(ec,this)}))}Ao(Io,"Symbol"),vo[xo]=!0;var tc=Pe,nc=Oe,rc=Ke("species"),ic=function(e){return nc>=51||!tc((function(){var t=[];return(t.constructor={})[rc]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ac=ui.filter;Oa({target:"Array",proto:!0,forced:!ic("filter")},{filter:function(e){return ac(this,e,arguments.length>1?arguments[1]:void 0)}});var sc=Oa,oc=Pe,cc=Di,dc=wi.f,uc=Je,lc=oc((function(){dc(1)}));sc({target:"Object",stat:!0,forced:!uc||lc,sham:!uc},{getOwnPropertyDescriptor:function(e,t){return dc(cc(e),t)}});var hc=Vt,pc=Xe,fc=Yt,mc=function(e,t,n){var r=hc(t);r in e?pc.f(e,r,fc(0,n)):e[r]=n},gc=da,vc=Di,bc=wi,yc=mc;Oa({target:"Object",stat:!0,sham:!Je},{getOwnPropertyDescriptors:function(e){for(var t,n,r=vc(e),i=bc.f,a=gc(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&yc(s,t,n);return s}});var _c=Oa,wc=H,Ac=Ur,kc=$r,Ec=et,xc=qi,Rc=Cr,Sc=Di,Dc=mc,Tc=Ke,Ic=_s,Oc=ic("slice"),Pc=Tc("species"),Cc=wc.Array,Lc=Math.max;_c({target:"Array",proto:!0,forced:!Oc},{slice:function(e,t){var n,r,i,a=Sc(this),s=Rc(a),o=xc(e,s),c=xc(void 0===t?s:t,s);if(Ac(a)&&(n=a.constructor,(kc(n)&&(n===Cc||Ac(n.prototype))||Ec(n)&&null===(n=n[Pc]))&&(n=void 0),n===Cc||void 0===n))return Ic(a,o,c);for(r=new(void 0===n?Cc:n)(Lc(c-o,0)),i=0;o<c;o++,i++)o in a&&Dc(r,i,a[o]);return r.length=i,r}});var Uc=pt,Mc=lt,jc=Dt,Gc=function(e,t,n){var r,i;Mc(e);try{if(!(r=jc(e,"return"))){if("throw"===t)throw n;return n}r=Uc(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Mc(r),n},Bc=lt,Nc=Gc,Fc={},qc=Fc,Vc=Ke("iterator"),Wc=Array.prototype,Hc=function(e){return void 0!==e&&(qc.Array===e||Wc[Vc]===e)},zc=or,Kc=Dt,$c=Fc,Qc=Ke("iterator"),Yc=function(e){if(null!=e)return Kc(e,Qc)||Kc(e,"@@iterator")||$c[zc(e)]},Jc=pt,Xc=Rt,Zc=lt,ed=At,td=Yc,nd=H.TypeError,rd=function(e,t){var n=arguments.length<2?td(e):t;if(Xc(n))return Zc(Jc(n,e));throw nd(ed(e)+" is not iterable")},id=yr,ad=pt,sd=ue,od=function(e,t,n,r){try{return r?t(Bc(n)[0],n[1]):t(n)}catch(t){Nc(e,"throw",t)}},cd=Hc,dd=$r,ud=Cr,ld=mc,hd=rd,pd=Yc,fd=H.Array,md=Ke("iterator"),gd=!1;try{var vd=0,bd={next:function(){return{done:!!vd++}},return:function(){gd=!0}};bd[md]=function(){return this},Array.from(bd,(function(){throw 2}))}catch(e){}var yd=function(e,t){if(!t&&!gd)return!1;var n=!1;try{var r={};r[md]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},_d=function(e){var t=sd(e),n=dd(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=id(i,r>2?arguments[2]:void 0));var s,o,c,d,u,l,h=pd(t),p=0;if(!h||this==fd&&cd(h))for(s=ud(t),o=n?new this(s):fd(s);s>p;p++)l=a?i(t[p],p):t[p],ld(o,p,l);else for(u=(d=hd(t,h)).next,o=n?new this:[];!(c=ad(u,d)).done;p++)l=a?od(d,i,[c.value,p],!0):c.value,ld(o,p,l);return o.length=p,o};Oa({target:"Array",stat:!0,forced:!yd((function(e){Array.from(e)}))},{from:_d});var wd,Ad,kd,Ed=ae,xd=Dr,Rd=es,Sd=oe,Dd=Ed("".charAt),Td=Ed("".charCodeAt),Id=Ed("".slice),Od=function(e){return function(t,n){var r,i,a=Rd(Sd(t)),s=xd(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=Td(a,s))<55296||r>56319||s+1===o||(i=Td(a,s+1))<56320||i>57343?e?Dd(a,s):r:e?Id(a,s,s+2):i-56320+(r-55296<<10)+65536}},Pd={codeAt:Od(!1),charAt:Od(!0)},Cd=!Pe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ld=H,Ud=pe,Md=ye,jd=ue,Gd=Cd,Bd=mn("IE_PROTO"),Nd=Ld.Object,Fd=Nd.prototype,qd=Gd?Nd.getPrototypeOf:function(e){var t=jd(e);if(Ud(t,Bd))return t[Bd];var n=t.constructor;return Md(n)&&t instanceof n?n.prototype:t instanceof Nd?Fd:null},Vd=Pe,Wd=ye,Hd=qd,zd=Ye.exports,Kd=Ke("iterator"),$d=!1;[].keys&&("next"in(kd=[].keys())?(Ad=Hd(Hd(kd)))!==Object.prototype&&(wd=Ad):$d=!0);var Qd=null==wd||Vd((function(){var e={};return wd[Kd].call(e)!==e}));Qd&&(wd={}),Wd(wd[Kd])||zd(wd,Kd,(function(){return this}));var Yd={IteratorPrototype:wd,BUGGY_SAFARI_ITERATORS:$d},Jd=Yd.IteratorPrototype,Xd=bs,Zd=Yt,eu=Ms,tu=Fc,nu=function(){return this},ru=function(e,t,n){var r=t+" Iterator";return e.prototype=Xd(Jd,{next:Zd(1,n)}),eu(e,r,!1),tu[r]=nu,e},iu=H,au=ye,su=iu.String,ou=iu.TypeError,cu=ae,du=lt,uu=function(e){if("object"==typeof e||au(e))return e;throw ou("Can't set "+su(e)+" as a prototype")},lu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=cu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return du(n),uu(r),t?e(n,r):n.__proto__=r,n}}():void 0),hu=Oa,pu=pt,fu=Bn,mu=ye,gu=ru,vu=qd,bu=lu,yu=Ms,_u=Zt,wu=Ye.exports,Au=Fc,ku=fu.PROPER,Eu=fu.CONFIGURABLE,xu=Yd.IteratorPrototype,Ru=Yd.BUGGY_SAFARI_ITERATORS,Su=Ke("iterator"),Du=function(){return this},Tu=function(e,t,n,r,i,a,s){gu(n,t,r);var o,c,d,u=function(e){if(e===i&&m)return m;if(!Ru&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Su]||p["@@iterator"]||i&&p[i],m=!Ru&&f||u(i),g="Array"==t&&p.entries||f;if(g&&(o=vu(g.call(new e)))!==Object.prototype&&o.next&&(vu(o)!==xu&&(bu?bu(o,xu):mu(o[Su])||wu(o,Su,Du)),yu(o,l,!0)),ku&&"values"==i&&f&&"values"!==f.name&&(Eu?_u(p,"name","values"):(h=!0,m=function(){return pu(f,this)})),i)if(c={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(d in c)(Ru||h||!(d in p))&&wu(p,d,c[d]);else hu({target:t,proto:!0,forced:Ru||h},c);return p[Su]!==m&&wu(p,Su,m,{name:i}),Au[t]=m,c},Iu=Pd.charAt,Ou=es,Pu=Cn,Cu=Tu,Lu=Pu.set,Uu=Pu.getterFor("String Iterator");Cu(String,"String",(function(e){Lu(this,{type:"String Iterator",string:Ou(e),index:0})}),(function(){var e,t=Uu(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Iu(n,r),t.index+=e.length,{value:e,done:!1})}));var Mu=lt,ju=function(){var e=Mu(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Gu={},Bu=Pe,Nu=H.RegExp;Gu.UNSUPPORTED_Y=Bu((function(){var e=Nu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Gu.BROKEN_CARET=Bu((function(){var e=Nu("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Fu=Pe,qu=H.RegExp,Vu=Fu((function(){var e=qu(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Wu=Pe,Hu=H.RegExp,zu=Wu((function(){var e=Hu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ku=pt,$u=ae,Qu=es,Yu=ju,Ju=Gu,Xu=z.exports,Zu=bs,el=Cn.get,tl=Vu,nl=zu,rl=Xu("native-string-replace",String.prototype.replace),il=RegExp.prototype.exec,al=il,sl=$u("".charAt),ol=$u("".indexOf),cl=$u("".replace),dl=$u("".slice),ul=function(){var e=/a/,t=/b*/g;return Ku(il,e,"a"),Ku(il,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ll=Ju.UNSUPPORTED_Y||Ju.BROKEN_CARET,hl=void 0!==/()??/.exec("")[1];(ul||hl||ll||tl||nl)&&(al=function(e){var t,n,r,i,a,s,o,c=this,d=el(c),u=Qu(e),l=d.raw;if(l)return l.lastIndex=c.lastIndex,t=Ku(al,l,u),c.lastIndex=l.lastIndex,t;var h=d.groups,p=ll&&c.sticky,f=Ku(Yu,c),m=c.source,g=0,v=u;if(p&&(f=cl(f,"y",""),-1===ol(f,"g")&&(f+="g"),v=dl(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==sl(u,c.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",f)),hl&&(n=new RegExp("^"+m+"$(?!\\s)",f)),ul&&(r=c.lastIndex),i=Ku(il,p?n:c,v),p?i?(i.input=dl(i.input,g),i[0]=dl(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:ul&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),hl&&i&&i.length>1&&Ku(rl,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=Zu(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var pl=al;Oa({target:"RegExp",proto:!0,forced:/./.exec!==pl},{exec:pl});var fl=Oa,ml=Je,gl=H,vl=ae,bl=pe,yl=ye,_l=ft,wl=es,Al=Xe.f,kl=fa,El=gl.Symbol,xl=El&&El.prototype;if(ml&&yl(El)&&(!("description"in xl)||void 0!==El().description)){var Rl={},Sl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:wl(arguments[0]),t=_l(xl,this)?new El(e):void 0===e?El():El(e);return""===e&&(Rl[t]=!0),t};kl(Sl,El),Sl.prototype=xl,xl.constructor=Sl;var Dl="Symbol(test)"==String(El("test")),Tl=vl(xl.toString),Il=vl(xl.valueOf),Ol=/^Symbol\((.*)\)[^)]+$/,Pl=vl("".replace),Cl=vl("".slice);Al(xl,"description",{configurable:!0,get:function(){var e=Il(this),t=Tl(e);if(bl(Rl,e))return"";var n=Dl?Cl(t,7,-1):Pl(t,Ol,"$1");return""===n?void 0:n}}),fl({global:!0,forced:!0},{Symbol:Sl})}Ps("iterator");var Ll=bs,Ul=Xe,Ml=Ke("unscopables"),jl=Array.prototype;null==jl[Ml]&&Ul.f(jl,Ml,{configurable:!0,value:Ll(null)});var Gl=function(e){jl[Ml][e]=!0},Bl=Di,Nl=Gl,Fl=Fc,ql=Cn,Vl=Tu,Wl=ql.set,Hl=ql.getterFor("Array Iterator"),zl=Vl(Array,"Array",(function(e,t){Wl(this,{type:"Array Iterator",target:Bl(e),index:0,kind:t})}),(function(){var e=Hl(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Fl.Arguments=Fl.Array,Nl("keys"),Nl("values"),Nl("entries");var Kl=H,$l=pr,Ql=gr,Yl=zl,Jl=Zt,Xl=Ke,Zl=Xl("iterator"),eh=Xl("toStringTag"),th=Yl.values,nh=function(e,t){if(e){if(e[Zl]!==th)try{Jl(e,Zl,th)}catch(t){e[Zl]=th}if(e[eh]||Jl(e,eh,t),$l[t])for(var n in Yl)if(e[n]!==Yl[n])try{Jl(e,n,Yl[n])}catch(t){e[n]=Yl[n]}}};for(var rh in $l)nh(Kl[rh]&&Kl[rh].prototype,rh);nh(Ql,"DOMTokenList");var ih,ah,sh,oh,ch=H.Promise,dh=Ye.exports,uh=function(e,t,n){for(var r in t)dh(e,r,t[r],n);return e},lh=ke,hh=Xe,ph=Je,fh=Ke("species"),mh=function(e){var t=lh(e),n=hh.f;ph&&t&&!t[fh]&&n(t,fh,{configurable:!0,get:function(){return this}})},gh=ft,vh=H.TypeError,bh=function(e,t){if(gh(t,e))return e;throw vh("Incorrect invocation")},yh=yr,_h=pt,wh=lt,Ah=At,kh=Hc,Eh=Cr,xh=ft,Rh=rd,Sh=Yc,Dh=Gc,Th=H.TypeError,Ih=function(e,t){this.stopped=e,this.result=t},Oh=Ih.prototype,Ph=$r,Ch=At,Lh=H.TypeError,Uh=lt,Mh=function(e){if(Ph(e))return e;throw Lh(Ch(e)+" is not a constructor")},jh=Ke("species"),Gh=function(e,t){var n,r=Uh(e).constructor;return void 0===r||null==(n=Uh(r)[jh])?t:Mh(n)},Bh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ee),Nh="process"==Zn(H.process),Fh=H,qh=Ja,Vh=yr,Wh=ye,Hh=pe,zh=Pe,Kh=ss,$h=_s,Qh=it,Yh=Bh,Jh=Nh,Xh=Fh.setImmediate,Zh=Fh.clearImmediate,ep=Fh.process,tp=Fh.Dispatch,np=Fh.Function,rp=Fh.MessageChannel,ip=Fh.String,ap=0,sp={};try{ih=Fh.location}catch(e){}var op=function(e){if(Hh(sp,e)){var t=sp[e];delete sp[e],t()}},cp=function(e){return function(){op(e)}},dp=function(e){op(e.data)},up=function(e){Fh.postMessage(ip(e),ih.protocol+"//"+ih.host)};Xh&&Zh||(Xh=function(e){var t=$h(arguments,1);return sp[++ap]=function(){qh(Wh(e)?e:np(e),void 0,t)},ah(ap),ap},Zh=function(e){delete sp[e]},Jh?ah=function(e){ep.nextTick(cp(e))}:tp&&tp.now?ah=function(e){tp.now(cp(e))}:rp&&!Yh?(oh=(sh=new rp).port2,sh.port1.onmessage=dp,ah=Vh(oh.postMessage,oh)):Fh.addEventListener&&Wh(Fh.postMessage)&&!Fh.importScripts&&ih&&"file:"!==ih.protocol&&!zh(up)?(ah=up,Fh.addEventListener("message",dp,!1)):ah="onreadystatechange"in Qh("script")?function(e){Kh.appendChild(Qh("script")).onreadystatechange=function(){Kh.removeChild(this),op(e)}}:function(e){setTimeout(cp(e),0)});var lp,hp,pp,fp,mp,gp,vp,bp,yp={set:Xh,clear:Zh},_p=H,wp=/ipad|iphone|ipod/i.test(Ee)&&void 0!==_p.Pebble,Ap=/web0s(?!.*chrome)/i.test(Ee),kp=H,Ep=yr,xp=wi.f,Rp=yp.set,Sp=Bh,Dp=wp,Tp=Ap,Ip=Nh,Op=kp.MutationObserver||kp.WebKitMutationObserver,Pp=kp.document,Cp=kp.process,Lp=kp.Promise,Up=xp(kp,"queueMicrotask"),Mp=Up&&Up.value;Mp||(lp=function(){var e,t;for(Ip&&(e=Cp.domain)&&e.exit();hp;){t=hp.fn,hp=hp.next;try{t()}catch(e){throw hp?fp():pp=void 0,e}}pp=void 0,e&&e.enter()},Sp||Ip||Tp||!Op||!Pp?!Dp&&Lp&&Lp.resolve?((vp=Lp.resolve(void 0)).constructor=Lp,bp=Ep(vp.then,vp),fp=function(){bp(lp)}):Ip?fp=function(){Cp.nextTick(lp)}:(Rp=Ep(Rp,kp),fp=function(){Rp(lp)}):(mp=!0,gp=Pp.createTextNode(""),new Op(lp).observe(gp,{characterData:!0}),fp=function(){gp.data=mp=!mp}));var jp=Mp||function(e){var t={fn:e,next:void 0};pp&&(pp.next=t),hp||(hp=t,fp()),pp=t},Gp={},Bp=Rt,Np=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Bp(t),this.reject=Bp(n)};Gp.f=function(e){return new Np(e)};var Fp,qp,Vp,Wp,Hp=lt,zp=et,Kp=Gp,$p=function(e,t){if(Hp(e),zp(t)&&t.constructor===e)return t;var n=Kp.f(e);return(0,n.resolve)(t),n.promise},Qp=H,Yp="object"==typeof window,Jp=Oa,Xp=H,Zp=ke,ef=pt,tf=ch,nf=Ye.exports,rf=uh,af=lu,sf=Ms,of=mh,cf=Rt,df=ye,uf=et,lf=bh,hf=on,pf=function(e,t,n){var r,i,a,s,o,c,d,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=yh(t,u),m=function(e){return r&&Dh(r,"normal",e),new Ih(!0,e)},g=function(e){return l?(wh(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=Sh(e)))throw Th(Ah(e)+" is not iterable");if(kh(i)){for(a=0,s=Eh(e);s>a;a++)if((o=g(e[a]))&&xh(Oh,o))return o;return new Ih(!1)}r=Rh(e,i)}for(c=r.next;!(d=_h(c,r)).done;){try{o=g(d.value)}catch(e){Dh(r,"throw",e)}if("object"==typeof o&&o&&xh(Oh,o))return o}return new Ih(!1)},ff=yd,mf=Gh,gf=yp.set,vf=jp,bf=$p,yf=function(e,t){var n=Qp.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},_f=Gp,wf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Af=Cn,kf=ka,Ef=Yp,xf=Nh,Rf=Oe,Sf=Ke("species"),Df=Af.get,Tf=Af.set,If=Af.getterFor("Promise"),Of=tf&&tf.prototype,Pf=tf,Cf=Of,Lf=Xp.TypeError,Uf=Xp.document,Mf=Xp.process,jf=_f.f,Gf=jf,Bf=!!(Uf&&Uf.createEvent&&Xp.dispatchEvent),Nf=df(Xp.PromiseRejectionEvent),Ff=!1,qf=kf("Promise",(function(){var e=hf(Pf),t=e!==String(Pf);if(!t&&66===Rf)return!0;if(Rf>=51&&/native code/.test(e))return!1;var n=new Pf((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Sf]=r,!(Ff=n.then((function(){}))instanceof r)||!t&&Ef&&!Nf})),Vf=qf||!ff((function(e){Pf.all(e).catch((function(){}))})),Wf=function(e){var t;return!(!uf(e)||!df(t=e.then))&&t},Hf=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;vf((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var s,o,c,d=n[a++],u=i?d.ok:d.fail,l=d.resolve,h=d.reject,p=d.domain;try{u?(i||(2===e.rejection&&Qf(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),c=!0)),s===d.promise?h(Lf("Promise-chain cycle")):(o=Wf(s))?ef(o,s,l,h):l(s)):h(r)}catch(e){p&&!c&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Kf(e)}))}},zf=function(e,t,n){var r,i;Bf?((r=Uf.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Xp.dispatchEvent(r)):r={promise:t,reason:n},!Nf&&(i=Xp["on"+e])?i(r):"unhandledrejection"===e&&yf("Unhandled promise rejection",n)},Kf=function(e){ef(gf,Xp,(function(){var t,n=e.facade,r=e.value;if($f(e)&&(t=wf((function(){xf?Mf.emit("unhandledRejection",r,n):zf("unhandledrejection",n,r)})),e.rejection=xf||$f(e)?2:1,t.error))throw t.value}))},$f=function(e){return 1!==e.rejection&&!e.parent},Qf=function(e){ef(gf,Xp,(function(){var t=e.facade;xf?Mf.emit("rejectionHandled",t):zf("rejectionhandled",t,e.value)}))},Yf=function(e,t,n){return function(r){e(t,r,n)}},Jf=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Hf(e,!0))},Xf=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Lf("Promise can't be resolved itself");var r=Wf(t);r?vf((function(){var n={done:!1};try{ef(r,t,Yf(Xf,n,e),Yf(Jf,n,e))}catch(t){Jf(n,t,e)}})):(e.value=t,e.state=1,Hf(e,!1))}catch(t){Jf({done:!1},t,e)}}};if(qf&&(Cf=(Pf=function(e){lf(this,Cf),cf(e),ef(Fp,this);var t=Df(this);try{e(Yf(Xf,t),Yf(Jf,t))}catch(e){Jf(t,e)}}).prototype,(Fp=function(e){Tf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=rf(Cf,{then:function(e,t){var n=If(this),r=n.reactions,i=jf(mf(this,Pf));return i.ok=!df(e)||e,i.fail=df(t)&&t,i.domain=xf?Mf.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&Hf(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),qp=function(){var e=new Fp,t=Df(e);this.promise=e,this.resolve=Yf(Xf,t),this.reject=Yf(Jf,t)},_f.f=jf=function(e){return e===Pf||e===Vp?new qp(e):Gf(e)},df(tf)&&Of!==Object.prototype)){Wp=Of.then,Ff||(nf(Of,"then",(function(e,t){var n=this;return new Pf((function(e,t){ef(Wp,n,e,t)})).then(e,t)}),{unsafe:!0}),nf(Of,"catch",Cf.catch,{unsafe:!0}));try{delete Of.constructor}catch(e){}af&&af(Of,Cf)}Jp({global:!0,wrap:!0,forced:qf},{Promise:Pf}),sf(Pf,"Promise",!1),of("Promise"),Vp=Zp("Promise"),Jp({target:"Promise",stat:!0,forced:qf},{reject:function(e){var t=jf(this);return ef(t.reject,void 0,e),t.promise}}),Jp({target:"Promise",stat:!0,forced:qf},{resolve:function(e){return bf(this,e)}}),Jp({target:"Promise",stat:!0,forced:Vf},{all:function(e){var t=this,n=jf(t),r=n.resolve,i=n.reject,a=wf((function(){var n=cf(t.resolve),a=[],s=0,o=1;pf(e,(function(e){var c=s++,d=!1;o++,ef(n,t,e).then((function(e){d||(d=!0,a[c]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=jf(t),r=n.reject,i=wf((function(){var i=cf(t.resolve);pf(e,(function(e){ef(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Zf=Oa,em=H,tm=Pe,nm=Ur,rm=et,im=ue,am=Cr,sm=mc,om=ni,cm=ic,dm=Oe,um=Ke("isConcatSpreadable"),lm=em.TypeError,hm=dm>=51||!tm((function(){var e=[];return e[um]=!1,e.concat()[0]!==e})),pm=cm("concat"),fm=function(e){if(!rm(e))return!1;var t=e[um];return void 0!==t?!!t:nm(e)};Zf({target:"Array",proto:!0,forced:!hm||!pm},{concat:function(e){var t,n,r,i,a,s=im(this),o=om(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(fm(a=-1===t?s:arguments[t])){if(c+(i=am(a))>9007199254740991)throw lm("Maximum allowed index exceeded");for(n=0;n<i;n++,c++)n in a&&sm(o,c,a[n])}else{if(c>=9007199254740991)throw lm("Maximum allowed index exceeded");sm(o,c++,a)}return o.length=c,o}});var mm=Je,gm=Bn.EXISTS,vm=ae,bm=Xe.f,ym=Function.prototype,_m=vm(ym.toString),wm=/^\s*function ([^ (]*)/,Am=vm(wm.exec);function km(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Em(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Em(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xm(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}mm&&!gm&&bm(ym,"name",{configurable:!0,get:function(){try{return Am(wm,_m(this))[1]}catch(e){return""}}});var Sm,Dm={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Tm={},Im=function(e,t){Tm[e]=Rm(Rm({},t),{},{isLoading:!1})},Om=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Pm=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,c,d,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=Tm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=km(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,c=Dm[o].name,!window[c]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Om({id:o,src:Dm[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),d=o.id,u=o.src,console.log("Could not load external script ".concat(d," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Om({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),Cm=new function t(){var n=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),D(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Im(this.moduleName,this.moduleConfig)},Lm=et,Um=Zn,Mm=Ke("match"),jm=function(e){var t;return Lm(e)&&(void 0!==(t=e[Mm])?!!t:"RegExp"==Um(e))},Gm=jm,Bm=H.TypeError,Nm=function(e){if(Gm(e))throw Bm("The method doesn't accept regular expressions");return e},Fm=Ke("match"),qm=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Fm]=!1,"/./"[e](t)}catch(e){}}return!1},Vm=Oa,Wm=ae,Hm=wi.f,zm=Or,Km=es,$m=Nm,Qm=oe,Ym=qm,Jm=Wm("".startsWith),Xm=Wm("".slice),Zm=Math.min,eg=Ym("startsWith");Vm({target:"String",proto:!0,forced:!!(eg||(Sm=Hm(String.prototype,"startsWith"),!Sm||Sm.writable))&&!eg},{startsWith:function(e){var t=Km(Qm(this));$m(e);var n=zm(Zm(arguments.length>1?arguments[1]:void 0,t.length)),r=Km(e);return Jm?Jm(t,r,n):Xm(t,n,n+r.length)===r}});var tg=ae,ng=Bn.PROPER,rg=Ye.exports,ig=lt,ag=ft,sg=es,og=Pe,cg=ju,dg=RegExp.prototype,ug=dg.toString,lg=tg(cg),hg=og((function(){return"/a/b"!=ug.call({source:"a",flags:"b"})})),pg=ng&&"toString"!=ug.name;(hg||pg)&&rg(RegExp.prototype,"toString",(function(){var e=ig(this),t=sg(e.source),n=e.flags;return"/"+t+"/"+sg(void 0===n&&ag(dg,e)&&!("flags"in dg)?lg(e):n)}),{unsafe:!0});var fg=ae,mg=Ye.exports,gg=pl,vg=Pe,bg=Ke,yg=Zt,_g=bg("species"),wg=RegExp.prototype,Ag=function(e,t,n,r){var i=bg(e),a=!vg((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!vg((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[_g]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=fg(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var s=fg(e),c=t.exec;return c===gg||c===wg.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));mg(String.prototype,e,c[0]),mg(wg,i,c[1])}r&&yg(wg[i],"sham",!0)},kg=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Eg=pt,xg=lt,Rg=ye,Sg=Zn,Dg=pl,Tg=H.TypeError,Ig=function(e,t){var n=e.exec;if(Rg(n)){var r=Eg(n,e,t);return null!==r&&xg(r),r}if("RegExp"===Sg(e))return Eg(Dg,e,t);throw Tg("RegExp#exec called on incompatible receiver")},Og=pt,Pg=lt,Cg=oe,Lg=kg,Ug=es,Mg=Dt,jg=Ig;function Gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gg(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ag("search",(function(e,t,n){return[function(t){var n=Cg(this),r=null==t?void 0:Mg(t,e);return r?Og(r,t,n):new RegExp(t)[e](Ug(n))},function(e){var r=Pg(this),i=Ug(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;Lg(s,0)||(r.lastIndex=0);var o=jg(r,i);return Lg(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Ng,Fg,qg=function(){function e(){S(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),d=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?d:c()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:d,topDomain:u&&u.length?u:d,noGAPageView:f,noLotamePageView:m,noGamedockSDK:g,noMinijuegosSDK:v,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:d===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Bg(Bg({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}}]),e}(),Vg=function(){try{return(new qg).getBridgeContext()}catch(e){return{}}}(),Wg={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Ng=!1,(Fg=d("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Fg.xanthophyll&&(Ng=!0),Ng)},Hg=Pd.charAt,zg=function(e,t,n){return t+(n?Hg(e,t).length:1)},Kg=ae,$g=ue,Qg=Math.floor,Yg=Kg("".charAt),Jg=Kg("".replace),Xg=Kg("".slice),Zg=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ev=/\$([$&'`]|\d{1,2})/g,tv=Ja,nv=pt,rv=ae,iv=Ag,av=Pe,sv=lt,ov=ye,cv=Dr,dv=Or,uv=es,lv=oe,hv=zg,pv=Dt,fv=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,c=ev;return void 0!==i&&(i=$g(i),c=Zg),Jg(a,c,(function(a,c){var d;switch(Yg(c,0)){case"$":return"$";case"&":return e;case"`":return Xg(t,0,n);case"'":return Xg(t,s);case"<":d=i[Xg(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>o){var l=Qg(u/10);return 0===l?a:l<=o?void 0===r[l-1]?Yg(c,1):r[l-1]+Yg(c,1):a}d=r[u-1]}return void 0===d?"":d}))},mv=Ig,gv=Ke("replace"),vv=Math.max,bv=Math.min,yv=rv([].concat),_v=rv([].push),wv=rv("".indexOf),Av=rv("".slice),kv="$0"==="a".replace(/./,"$0"),Ev=!!/./[gv]&&""===/./[gv]("a","$0");iv("replace",(function(e,t,n){var r=Ev?"$":"$0";return[function(e,n){var r=lv(this),i=null==e?void 0:pv(e,gv);return i?nv(i,e,r,n):nv(t,uv(r),e,n)},function(e,i){var a=sv(this),s=uv(e);if("string"==typeof i&&-1===wv(i,r)&&-1===wv(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var c=ov(i);c||(i=uv(i));var d=a.global;if(d){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=mv(a,s);if(null===h)break;if(_v(l,h),!d)break;""===uv(h[0])&&(a.lastIndex=hv(s,dv(a.lastIndex),u))}for(var p,f="",m=0,g=0;g<l.length;g++){for(var v=uv((h=l[g])[0]),b=vv(bv(cv(h.index),s.length),0),y=[],_=1;_<h.length;_++)_v(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(c){var A=yv([v],y,b,s);void 0!==w&&_v(A,w);var k=uv(tv(i,void 0,A))}else k=fv(v,s,b,y,w,i);b>=m&&(f+=Av(s,m,b)+k,m=b+v.length)}return f+Av(s,m)}]}),!!av((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!kv||Ev);var xv=Pe,Rv=Ke("iterator"),Sv=!xv((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Rv]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Dv=_s,Tv=Math.floor,Iv=function(e,t){var n=e.length,r=Tv(n/2);return n<8?Ov(e,t):Pv(e,Iv(Dv(e,0,r),t),Iv(Dv(e,r),t),t)},Ov=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Pv=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},Cv=Iv,Lv=Oa,Uv=H,Mv=ke,jv=pt,Gv=ae,Bv=Sv,Nv=Ye.exports,Fv=uh,qv=Ms,Vv=ru,Wv=Cn,Hv=bh,zv=ye,Kv=pe,$v=yr,Qv=or,Yv=lt,Jv=et,Xv=es,Zv=bs,eb=Yt,tb=rd,nb=Yc,rb=Cv,ib=Ke("iterator"),ab=Wv.set,sb=Wv.getterFor("URLSearchParams"),ob=Wv.getterFor("URLSearchParamsIterator"),cb=Mv("fetch"),db=Mv("Request"),ub=Mv("Headers"),lb=db&&db.prototype,hb=ub&&ub.prototype,pb=Uv.RegExp,fb=Uv.TypeError,mb=Uv.decodeURIComponent,gb=Uv.encodeURIComponent,vb=Gv("".charAt),bb=Gv([].join),yb=Gv([].push),_b=Gv("".replace),wb=Gv([].shift),Ab=Gv([].splice),kb=Gv("".split),Eb=Gv("".slice),xb=/\+/g,Rb=Array(4),Sb=function(e){return Rb[e-1]||(Rb[e-1]=pb("((?:%[\\da-f]{2}){"+e+"})","gi"))},Db=function(e){try{return mb(e)}catch(t){return e}},Tb=function(e){var t=_b(e,xb," "),n=4;try{return mb(t)}catch(e){for(;n;)t=_b(t,Sb(n--),Db);return t}},Ib=/[!'()~]|%20/g,Ob={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Pb=function(e){return Ob[e]},Cb=function(e){return _b(gb(e),Ib,Pb)},Lb=function(e,t){if(t)for(var n,r,i=kb(t,"&"),a=0;a<i.length;)(n=i[a++]).length&&(r=kb(n,"="),yb(e,{key:Tb(wb(r)),value:Tb(bb(r,"="))}))},Ub=function(e){this.entries.length=0,Lb(this.entries,e)},Mb=function(e,t){if(e<t)throw fb("Not enough arguments")},jb=Vv((function(e,t){ab(this,{type:"URLSearchParamsIterator",iterator:tb(sb(e).entries),kind:t})}),"Iterator",(function(){var e=ob(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Gb=function(){Hv(this,Bb);var e,t,n,r,i,a,s,o,c,d=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(ab(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Ub}),void 0!==d)if(Jv(d))if(e=nb(d))for(n=(t=tb(d,e)).next;!(r=jv(n,t)).done;){if(a=(i=tb(Yv(r.value))).next,(s=jv(a,i)).done||(o=jv(a,i)).done||!jv(a,i).done)throw fb("Expected sequence with length 2");yb(l,{key:Xv(s.value),value:Xv(o.value)})}else for(c in d)Kv(d,c)&&yb(l,{key:c,value:Xv(d[c])});else Lb(l,"string"==typeof d?"?"===vb(d,0)?Eb(d,1):d:Xv(d))},Bb=Gb.prototype;if(Fv(Bb,{append:function(e,t){Mb(arguments.length,2);var n=sb(this);yb(n.entries,{key:Xv(e),value:Xv(t)}),n.updateURL()},delete:function(e){Mb(arguments.length,1);for(var t=sb(this),n=t.entries,r=Xv(e),i=0;i<n.length;)n[i].key===r?Ab(n,i,1):i++;t.updateURL()},get:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=[],i=0;i<t.length;i++)t[i].key===n&&yb(r,t[i].value);return r},has:function(e){Mb(arguments.length,1);for(var t=sb(this).entries,n=Xv(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Mb(arguments.length,1);for(var n,r=sb(this),i=r.entries,a=!1,s=Xv(e),o=Xv(t),c=0;c<i.length;c++)(n=i[c]).key===s&&(a?Ab(i,c--,1):(a=!0,n.value=o));a||yb(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=sb(this);rb(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=sb(this).entries,r=$v(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new jb(this,"keys")},values:function(){return new jb(this,"values")},entries:function(){return new jb(this,"entries")}},{enumerable:!0}),Nv(Bb,ib,Bb.entries,{name:"entries"}),Nv(Bb,"toString",(function(){for(var e,t=sb(this).entries,n=[],r=0;r<t.length;)e=t[r++],yb(n,Cb(e.key)+"="+Cb(e.value));return bb(n,"&")}),{enumerable:!0}),qv(Gb,"URLSearchParams"),Lv({global:!0,forced:!Bv},{URLSearchParams:Gb}),!Bv&&zv(ub)){var Nb=Gv(hb.has),Fb=Gv(hb.set),qb=function(e){if(Jv(e)){var t,n=e.body;if("URLSearchParams"===Qv(n))return t=e.headers?new ub(e.headers):new ub,Nb(t,"content-type")||Fb(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Zv(e,{body:eb(0,Xv(n)),headers:eb(0,t)})}return e};if(zv(cb)&&Lv({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return cb(e,arguments.length>1?qb(arguments[1]):{})}}),zv(db)){var Vb=function(e){return Hv(this,lb),new db(e,arguments.length>1?qb(arguments[1]):{})};lb.constructor=Vb,Vb.prototype=lb,Lv({global:!0,forced:!0},{Request:Vb})}}var Wb=Ki.includes,Hb=Gl;Oa({target:"Array",proto:!0},{includes:function(e){return Wb(this,e,arguments.length>1?arguments[1]:void 0)}}),Hb("includes");var zb=Oa,Kb=Nm,$b=oe,Qb=es,Yb=qm,Jb=ae("".indexOf);zb({target:"String",proto:!0,forced:!Yb("includes")},{includes:function(e){return!!~Jb(Qb($b(this)),Qb(Kb(e)),arguments.length>1?arguments[1]:void 0)}});var Xb=Ja,Zb=pt,ey=ae,ty=Ag,ny=jm,ry=lt,iy=oe,ay=Gh,sy=zg,oy=Or,cy=es,dy=Dt,uy=_s,ly=Ig,hy=pl,py=Pe,fy=Gu.UNSUPPORTED_Y,my=Math.min,gy=[].push,vy=ey(/./.exec),by=ey(gy),yy=ey("".slice);function _y(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function c(e){return L(r,e)}function d(e,t){return U(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),P.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(d("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],d("top.domain.from","origins");else if(0===t)n=s,d("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,d("top.domain.from","referrer"))}d("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(C(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",r.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",r.top.domain.value),d("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?C(e)?(d("partner.url.value",a),d("partner.url.from","partner-domain")):(d("partner.url.value",e),d("partner.url.from","partner-url")):(d("partner.url.value",o),d("partner.url.from","fallback"))}.bind(this)(),{get:c,print:function(e){console.log(c(e))}}}ty("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=cy(iy(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ny(e))return Zb(t,r,e,i);for(var a,s,o,c=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,d+"g");(a=Zb(hy,l,r))&&!((s=l.lastIndex)>u&&(by(c,yy(r,u,a.index)),a.length>1&&a.index<r.length&&Xb(gy,c,uy(a,1)),o=a[0].length,u=s,c.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&vy(l,"")||by(c,""):by(c,yy(r,u)),c.length>i?uy(c,0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Zb(t,this,e,n)}:t,[function(t,n){var i=iy(this),a=null==t?void 0:dy(t,e);return a?Zb(a,t,i,n):Zb(r,cy(i),t,n)},function(e,i){var a=ry(this),s=cy(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var c=ay(a,RegExp),d=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(fy?"g":"y"),l=new c(fy?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===ly(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=fy?0:f;var g,v=ly(l,fy?yy(s,f):s);if(null===v||(g=my(oy(l.lastIndex+(fy?f:0)),s.length))===p)f=sy(s,f,d);else{if(by(m,yy(s,p,f)),m.length===h)return m;for(var b=1;b<=v.length-1;b++)if(by(m,v[b]),m.length===h)return m;f=p=g}}return by(m,yy(s,p)),m}]}),!!py((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),fy);var wy="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==wy&&wy,Ay="URLSearchParams"in wy,ky="Symbol"in wy&&"iterator"in Symbol,Ey="FileReader"in wy&&"Blob"in wy&&function(){try{return new Blob,!0}catch(e){return!1}}(),xy="FormData"in wy,Ry="ArrayBuffer"in wy;if(Ry)var Sy=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Dy=ArrayBuffer.isView||function(e){return e&&Sy.indexOf(Object.prototype.toString.call(e))>-1};function Ty(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Iy(e){return"string"!=typeof e&&(e=String(e)),e}function Oy(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return ky&&(t[Symbol.iterator]=function(){return t}),t}function Py(e){this.map={},e instanceof Py?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Cy(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Ly(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Uy(e){var t=new FileReader,n=Ly(t);return t.readAsArrayBuffer(e),n}function My(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function jy(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Ey&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:xy&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Ay&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ry&&Ey&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=My(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ry&&(ArrayBuffer.prototype.isPrototypeOf(e)||Dy(e))?this._bodyArrayBuffer=My(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ay&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ey&&(this.blob=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Cy(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Uy)}),this.text=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Ly(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},xy&&(this.formData=function(){return this.text().then(Ny)}),this.json=function(){return this.text().then(JSON.parse)},this}Py.prototype.append=function(e,t){e=Ty(e),t=Iy(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Py.prototype.delete=function(e){delete this.map[Ty(e)]},Py.prototype.get=function(e){return e=Ty(e),this.has(e)?this.map[e]:null},Py.prototype.has=function(e){return this.map.hasOwnProperty(Ty(e))},Py.prototype.set=function(e,t){this.map[Ty(e)]=Iy(t)},Py.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Py.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Oy(e)},Py.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Oy(e)},Py.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Oy(e)},ky&&(Py.prototype[Symbol.iterator]=Py.prototype.entries);var Gy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function By(e,t){if(!(this instanceof By))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof By){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Py(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Py(t.headers)),this.method=function(e){var t=e.toUpperCase();return Gy.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Ny(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Fy(e,t){if(!(this instanceof Fy))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Py(t.headers),this.url=t.url||"",this._initBody(e)}By.prototype.clone=function(){return new By(this,{body:this._bodyInit})},jy.call(By.prototype),jy.call(Fy.prototype),Fy.prototype.clone=function(){return new Fy(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Py(this.headers),url:this.url})},Fy.error=function(){var e=new Fy(null,{status:0,statusText:""});return e.type="error",e};var qy=[301,302,303,307,308];Fy.redirect=function(e,t){if(-1===qy.indexOf(t))throw new RangeError("Invalid status code");return new Fy(null,{status:t,headers:{location:e}})};var Vy,Wy=wy.DOMException;try{new Wy}catch(e){Wy=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Wy.prototype=Object.create(Error.prototype),Wy.prototype.constructor=Wy}function Hy(e,t){return new Promise((function(n,r){var i=new By(e,t);if(i.signal&&i.signal.aborted)return r(new Wy("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new Py,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Fy(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new Wy("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&wy.location.href?wy.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(Ey?a.responseType="blob":Ry&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Py?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Iy(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}Hy.polyfill=!0,wy.fetch||(wy.fetch=Hy,wy.Headers=Py,wy.Request=By,wy.Response=Fy);var zy,Ky=function(e){var n=this;if(!Vy){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Vg.topDomain,domain:Vg.parentDomain,referrer:Vg.parentURL,depth:o(),version:Na.version,byloader:Vg.isTokenGameURL,isTokenGameURL:Vg.isTokenGameURL,isMasterGameURL:Vg.isMasterGameURL,isExtHostedGameURL:Vg.isExtHostedGameURL,byloaderVersion:Vg.version,tracking:Wg.userDeclinedTracking,whitelabel:Wg.whitelabelPartner,platform:u()};Vy=new l(r)}return Vy||{send:function(){t(this,n)}.bind(this)}};var $y,Qy,Yy=[],Jy=function(e){Yy.push(e)},Xy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if($y){e.next=4;break}return e.next=3,Zy(Qy);case 3:$y=e.sent;case 4:return e.abrupt("return",$y);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zy=function(e){var n=this;zy.send("gdfw.loading",{message:"loading"}),Yy=[],Jy("1"),Jy("2");var r=new _y;Jy("3");var i=r.get("partner.domain.value");Jy("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Jy("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(Na.version,"&localTime=").concat((new Date).getHours())}.bind(this);Jy("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Jy("7"),new Promise(function(e){var r=this;if(t(this,n),$y)e($y);else{Jy("7.1");var i=a();try{Jy("7.2");var o=s();Jy("7.3"),fetch(o).then(function(e){return t(this,r),Jy("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Jy("7.5"),n.success){var s,o,c,d,u=n.result.game;Jy("7.6");var l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:Fa(u.__t4r)||{},block_exts:Fa(u.push_cuda),bloc_gard:Fa(u.bloc_gard),cookie:Fa(u.cookie),gdpr:Fa(u.gdpr),diagnostic:Fa(u.diagnostic),cmp:Fa(u.cmp),gft:Fa(u.gft)||{},sdk:Fa(u.sdk)||{},sdkfw:Fa(u.sdkfw)||{},loader:Fa(u.loader)||{},splash:Fa(u.splash)||{},promo:Fa(u.promo)||{},dAds:Fa(u.dads)||{},pAds:Fa(u.pads)||{},mAds:Fa(u.mads)||{},rAds:Fa(u.rads)||{},lp:Fa(u.lp)||{},extsc:Fa(u.extsc)||{},evnts:Fa(u.evnts)||{},dp:Fa(u.dp)||{},adflw:Fa(u.adflw)||{}};Jy("7.7");var p=h(M(i),l);Jy("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(c=o.afg)||void 0===c?void 0:c.enabled),function(){t(this,a)}.bind(this),Jy("7.9"),null!==(d=p.pAds)&&void 0!==d&&d.enabled&&(p.preroll=!0),Jy("7.10"),zy.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var c=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(c,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},e_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),t_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.next=5,e_();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),n_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return c=e.sent,d=!(null==c||null===(t=c.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:d,path:d?null==c||null===(n=c.extsc)||void 0===n?void 0:n.path:"",name:d?null==c||null===(i=c.extsc)||void 0===i?void 0:i.name:"",ref:d?null==c||null===(a=c.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:d?null==c||null===(s=c.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!d&&!(null==c||null===(o=c.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),r_=function(){var n=e(r.mark((function e(){var n,i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n_();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,c),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),i_=!1,a_=!1,s_=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i_){e.next=4;break}return e.abrupt("return",n(a_));case 4:i_=!0;case 5:return e.next=7,n_();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return a_=!0,e.abrupt("return",n(!0));case 16:c=!0,setTimeout(function(){t(this,u),c&&(c=!1,i_=!0,n(!1))}.bind(this),5e3),d=setInterval(function(){t(this,u),c&&o&&window[s]?(c=!1,i_=!0,a_=!0,clearInterval(d),n(!0)):c||clearInterval(d)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},o_=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),h("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),h("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),h("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),h("cancelAd")}.bind(this),o=function(){return t(this,n),h("openConsole")}.bind(this),c=function(){return t(this,n),h("showBanner")}.bind(this),d=function(){return t(this,n),h("session")}.bind(this),u=function(e){return t(this,n),h("sendGenericEvent",{options:e})}.bind(this),l=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),h=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),p=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&m(r)}),!1)}.bind(this),f=function(){t(this,n),p(),h("init")}.bind(this),m=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:c,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:d,onEvent:m,init:f,_sendSDKReady:l,sendGenericEvent:u}}(e);return n.init(),n},c_=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},d_=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},u_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,e_();case 2:return t=e.sent,n=!t,e.next=6,d_(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=c_(),s=a.isMasterGameURL,o=s(),e.next=13,t_();case 13:return c=e.sent,d=!1,d=c?!o&&!!i:!o,e.abrupt("return",d);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),l_=Je,h_=ae,p_=La,f_=Di,m_=h_(Ai.f),g_=h_([].push),v_=function(e){return function(t){for(var n,r=f_(t),i=p_(r),a=i.length,s=0,o=[];a>s;)n=i[s++],l_&&!m_(r,n)||g_(o,e?[n,r[n]]:r[n]);return o}},b_={entries:v_(!0),values:v_(!1)}.values;Oa({target:"Object",stat:!0},{values:function(e){return b_(e)}});var y_=Oa,__=ch,w_=Pe,A_=ke,k_=ye,E_=Gh,x_=$p,R_=Ye.exports;if(y_({target:"Promise",proto:!0,real:!0,forced:!!__&&w_((function(){__.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=E_(this,A_("Promise")),n=k_(e);return this.then(n?function(n){return x_(t,e()).then((function(){return n}))}:e,n?function(n){return x_(t,e()).then((function(){throw n}))}:e)}}),k_(__)){var S_=A_("Promise").prototype.finally;__.prototype.finally!==S_&&R_(__.prototype,"finally",S_,{unsafe:!0})}var D_=oe,T_=es,I_=ae("".replace),O_="[\t\n\v\f\r \u2028\u2029\ufeff]",P_=RegExp("^"+O_+O_+"*"),C_=RegExp(O_+O_+"*$"),L_=function(e){return function(t){var n=T_(D_(t));return 1&e&&(n=I_(n,P_,"")),2&e&&(n=I_(n,C_,"")),n}},U_={start:L_(1),end:L_(2),trim:L_(3)},M_=Bn.PROPER,j_=Pe,G_="\t\n\v\f\r \u2028\u2029\ufeff",B_=U_.trim;Oa({target:"String",proto:!0,forced:function(e){return j_((function(){return!!G_[e]()||"
"!=="
"[e]()||M_&&G_[e].name!==e}))}("trim")},{trim:function(){return B_(this)}});var N_=ye,F_=et,q_=lu,V_=Je,W_=H,H_=ae,z_=ka,K_=function(e,t,n){var r,i;return q_&&N_(r=t.constructor)&&r!==n&&F_(i=r.prototype)&&i!==n.prototype&&q_(e,i),e},$_=Zt,Q_=Xe.f,Y_=Gi.f,J_=ft,X_=jm,Z_=es,ew=ju,tw=Gu,nw=Ye.exports,rw=Pe,iw=pe,aw=Cn.enforce,sw=mh,ow=Vu,cw=zu,dw=Ke("match"),uw=W_.RegExp,lw=uw.prototype,hw=W_.SyntaxError,pw=H_(ew),fw=H_(lw.exec),mw=H_("".charAt),gw=H_("".replace),vw=H_("".indexOf),bw=H_("".slice),yw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_w=/a/g,ww=/a/g,Aw=new uw(_w)!==_w,kw=tw.UNSUPPORTED_Y,Ew=V_&&(!Aw||kw||ow||cw||rw((function(){return ww[dw]=!1,uw(_w)!=_w||uw(ww)==ww||"/a/i"!=uw(_w,"i")})));if(z_("RegExp",Ew)){for(var xw=function(e,t){var n,r,i,a,s,o,c=J_(lw,this),d=X_(e),u=void 0===t,l=[],h=e;if(!c&&d&&u&&e.constructor===xw)return e;if((d||J_(lw,e))&&(e=e.source,u&&(t="flags"in h?h.flags:pw(h))),e=void 0===e?"":Z_(e),t=void 0===t?"":Z_(t),h=e,ow&&"dotAll"in _w&&(r=!!t&&vw(t,"s")>-1)&&(t=gw(t,/s/g,"")),n=t,kw&&"sticky"in _w&&(i=!!t&&vw(t,"y")>-1)&&(t=gw(t,/y/g,"")),cw&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,c=!1,d=0,u="";r<=n;r++){if("\\"===(t=mw(e,r)))t+=mw(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:fw(yw,bw(e,r+1))&&(r+=2,c=!0),i+=t,d++;continue;case">"===t&&c:if(""===u||iw(s,u))throw new hw("Invalid capture group name");s[u]=!0,a[a.length]=[u,d],c=!1,u="";continue}c?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=K_(uw(e,t),c?this:lw,xw),(r||i||l.length)&&(o=aw(s),r&&(o.dotAll=!0,o.raw=xw(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=mw(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+mw(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{$_(s,"source",""===h?"(?:)":h)}catch(e){}return s},Rw=function(e){e in xw||Q_(xw,e,{configurable:!0,get:function(){return uw[e]},set:function(t){uw[e]=t}})},Sw=Y_(uw),Dw=0;Sw.length>Dw;)Rw(Sw[Dw++]);lw.constructor=xw,xw.prototype=lw,nw(W_,"RegExp",xw)}sw("RegExp");var Tw=Oa,Iw=ui.find,Ow=Gl,Pw=!0;"find"in[]&&Array(1).find((function(){Pw=!1})),Tw({target:"Array",proto:!0,forced:Pw},{find:function(e){return Iw(this,e,arguments.length>1?arguments[1]:void 0)}}),Ow("find");var Cw=Oa,Lw=xr,Uw=Di,Mw=hi,jw=ae([].join),Gw=Lw!=Object,Bw=Mw("join",",");Cw({target:"Array",proto:!0,forced:Gw||!Bw},{join:function(e){return jw(Uw(this),void 0===e?",":e)}});var Nw=ui.map;Oa({target:"Array",proto:!0,forced:!ic("map")},{map:function(e){return Nw(this,e,arguments.length>1?arguments[1]:void 0)}});var Fw=Je,qw=ae,Vw=pt,Ww=Pe,Hw=La,zw=ra,Kw=Ai,$w=ue,Qw=xr,Yw=Object.assign,Jw=Object.defineProperty,Xw=qw([].concat),Zw=!Yw||Ww((function(){if(Fw&&1!==Yw({b:1},Yw(Jw({},"a",{enumerable:!0,get:function(){Jw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Yw({},e)[n]||Hw(Yw({},t)).join("")!=r}))?function(e,t){for(var n=$w(e),r=arguments.length,i=1,a=zw.f,s=Kw.f;r>i;)for(var o,c=Qw(arguments[i++]),d=a?Xw(Hw(c),a(c)):Hw(c),u=d.length,l=0;u>l;)o=d[l++],Fw&&!Vw(s,c,o)||(n[o]=c[o]);return n}:Yw,eA=Zw;Oa({target:"Object",stat:!0,forced:Object.assign!==eA},{assign:eA});var tA=function(){function e(t){S(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),nA=function(){function e(t,n){S(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),rA=function(e){if(!e)return!1;var t=iA.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},iA=Object.prototype.toString;function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oA(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function cA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uA=new F,lA=null,hA=function(){function n(e,r,i){var a=this;if(S(this,n),lA)return lA;lA=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):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 o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,c,d,u,l,p,A,k,E,x,R,P,C,L,U,F,q,V,W;return T(n,[{key:"start",value:(W=e(r.mark((function n(){var i,a,s,o=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.adSystemInitialize(e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o._init_afg_script({adsense_channel:"4089988593"});case 2:case"end":return e.stop()}}),e)}))));case 3:return i=n.sent,this.afgInitSuccess=i.success,n.next=7,this.adSystemInitialize(e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o._init_hl_script();case 2:return e.next=4,o._init_ima_script();case 4:o._createPlayer(),o._setUpIMA();case 6:case"end":return e.stop()}}),e)}))));case 7:if(a=n.sent,this.imaInitSuccess=a.success,s=[],this.afgInitSuccess||s.push(i.error),this.imaInitSuccess||s.push(a.error),!(s.length>0)){n.next=14;break}throw s[0];case 14:window.eventTest=function(e){t(this,o),this._broadcast(e,{message:"",status:"success"})}.bind(this),n.next=21;break;case 17:throw n.prev=17,n.t0=n.catch(0),Wa("gd-adflow error on ads.start",n.t0),new Error(n.t0);case 21:case"end":return n.stop()}}),n,this,[[0,17]])}))),function(){return W.apply(this,arguments)})},{key:"adSystemInitialize",value:(V=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={success:!1},e.prev=1,e.next=4,t();case 4:n.success=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n.error=e.t0;case 10:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,7]])}))),function(e){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,d,u,l,h,p,f,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),d=o[c],s({url:d}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,u=a.nextAdPosition(n),console.log("GD-SDK Position",u),a._broadcast("AD_REQUEST",{message:u}),l=a.options,"preroll"===u&&G(l.preroll)?l=l.preroll:"midroll"===u&&G(l.midroll)?l=l.midroll:"rewarded"===u&&G(l.rewarded)&&(l=l.rewarded),h="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",e.next=17,window.idhb.isLoaded();case 17:if(p={tnl_keys:dA(dA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&G(l.retry_on_success)&&G(l.retry_on_success.vast))){e.next=22;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 22:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&G(l.retry_on_failure.vast))){e.next=26;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 26:if(!G(l.vast)){e.next=28;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 28:return e.next=30,a._create_dp_context(u,i);case 30:f=e.sent,Va("gd-adflow, before idhb",u,h),window.idhb.requestAds({slots:D({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,g),console.log("GD-SDK After HB..."),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:dA(dA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=38;break;case 35:throw e.prev=35,e.t0=e.catch(8),new Error(e.t0);case 38:case"end":return e.stop()}}),e,this,[[8,35]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===g.Rewarded)return this.adRewardedCount++,"rewarded";if(e===g.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===g.Rewarded?"rewarded":e===g.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){var a=this;if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var s,o=null==e||null===(s=e.tnl_keys)||void 0===s?void 0:s.tnl_ad_pos;this.adSuccess=!1;var c=new google.ima.AdsRequest,d=this._transformVast(e,n),u=dA(dA({},n),{},{adTag:d,tnl_ad_pos:o});this.adCounter[o]=this.adCounter[o]||0,this.adCounter[o]++;var l=e.dp,h=e.hl;l&&(l.adtag_url=d.url,this._extend_dp_with_adsense(l,h,null==e?void 0:e.tnl_keys));var p=this._isVMAP(o);if(function(){t(this,a),n.shouldFail&&(l?(l.adtag_url="dp_original_broken",l.fallback_url="dp_fallback_broken"):d.url="original_broken",null==l||l.adtag_url,null==l||l.fallback_url,d.url),p=!1}.bind(this),p){var f=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=sA(sA({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=sA(sA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var c=o.toString(),d=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:d++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:d++,adtag_url:c,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:l,adtag:d,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(o)}));c.adsResponse=f}else if(l&&h.bidFloorApplied){var m=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(l);c.adsResponse=m}else if(l&&l.fallback_url){var g=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(l);c.adsResponse=g}else c.adTagUrl=d.url;c.linearAdSlotWidth=this.options.width,c.linearAdSlotHeight=this.options.height,c.nonLinearAdSlotWidth=this.options.width,c.nonLinearAdSlotHeight=this.options.height,c.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(c.vastLoadTimeout=this.options.vast_load_timeout),c.setAdWillAutoPlay(n.autoplayAllowed),c.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(c,u);try{this._broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}i(c)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this._broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(q=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):j.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(F=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.adType,i=t.params,this.adType_=n,this.adContext=dA({},i),"promo"!==(null==i?void 0:i.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(i,n));case 5:if("adsense"!==(null==i?void 0:i.adapter)){e.next=26;break}if(n!==g.Interstitial){e.next=19;break}if("preroll"!==(null==i?void 0:i.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==i?void 0:i.position)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==i?void 0:i.position)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 17:e.next=24;break;case 19:if(n!==g.Rewarded){e.next=23;break}return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 23:case 34:throw new Error("Unsupported ad type");case 24:e.next=35;break;case 26:if(n!==g.Interstitial){e.next=30;break}return e.abrupt("return",this._startInterstitialAd(i));case 30:if(n!==g.Rewarded){e.next=34;break}return e.abrupt("return",this._startRewardedAd(i));case 35:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==g.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==g.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new nA(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(C=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,c,d,u,l,h,p,f,m,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(c=i?i.containerId:null)||s("Container id is not specified"),d=document.getElementById(c),document.getElementById(c)||s("No container is found with this id - ".concat(c)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),u=i.slotId?i.slotId:"gd__banner@".concat(c),document.getElementById(u)||(l="\n .gd__banner{\n z-index: ".concat(v.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),d.appendChild(h)),(p=document.createElement("div")).id=u,p.classList.add("gd__banner"),d.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[u]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,g)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return C.apply(this,arguments)})},{key:"_startInterstitialAd",value:(P=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(dA(dA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return P.apply(this,arguments)})},{key:"_startPromo",value:(R=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(dA(dA({},i),t),n);case 11:if(e.sent.success){e.next=16;break}return e.abrupt("return");case 16:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=27;break;case 22:throw e.prev=22,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(t,n){var i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,i=this.nextAdPosition(n),a=this._create_promo_context(i),this._requestPromo(a,dA({adType:g.Interstitial},t)),e.next=7,this._waitOnAdLoad();case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(g.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,dA({adType:g.Interstitial},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_waitOnAdLoad",value:function(){var e=this;return new Promise(function(n,r){var i=this;t(this,e);var a="videoad.preloadad";this.eventBus.unsubscribeScope(a);var s=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!0,args:e})}.bind(this),1)}.bind(this),o=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!1,args:e})}.bind(this),1)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",s,a),this.eventBus.subscribe("AD_SDK_CANCELED",o,a),this.eventBus.subscribe("AD_ERROR",o,a)}.bind(this))}},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(dA(dA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(g.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,dA({adType:g.Rewarded},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(g.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(g.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player&&(this.video_ad_player.src=""),this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=this.gameData.__t4r;var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this._broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=v.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),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)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),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(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),c=i.getFullYear(),d="AD_SDK_MANAGER_READY";this._broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(c)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var n,r=this,i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),c=i.getFullYear(),d=b(google.ima.AdEvent.Type,e.type),u=!1,l=(null==e||null===(n=e.getAd())||void 0===n?void 0:n.getContentType())||"",h=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="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:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:u=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:e.getAd(),u=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===g.Rewarded&&this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="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:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",u=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="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:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var v=e.getAd().getContentType();p=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:u=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:u=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}if(""!==d&&""!==p&&this._broadcast(d,{name:d,message:p,status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(c)}}),u&&!this.adSuccess){this.adSuccess=!0;var y=e.getAd(),_="Rainbow"===(null==y?void 0:y.getAdSystem())&&(null==y?void 0:y.getWrapperAdIds().some(function(e){return t(this,r),"promo"===e}.bind(this)));null==y||y.getAdSystem(),null==y||y.getWrapperAdIds(),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success",isPromoSuccess:_}),this.resetForNext(e)}}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);uA.emit("AD_ERROR",r),this._broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(rA(e.getInnerError)){var t=e.getInnerError();if(t)return rA(t.getErrorCode)&&rA(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];G(s)&&(i.query[a]=B.stringify(s))}var o=new I(i.url,!0);return N(o.query,i.query||{}),dA({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=B.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&G(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&G(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),G(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var c=B.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var d in c){new RegExp(a.cust_params.$$remove,"i").test(d)&&delete c[d]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=c,N(s,u),s.cust_params=B.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var c,d=Math.random()<o;return a&&d&&(null===(c=e.t4r[a])||void 0===c?void 0:c.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,c,d,u,l,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(c=this.gameData)||void 0===c||null===(d=c.mAds)||void 0===d||null===(u=d.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?b>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,c=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:c}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,c;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(c=o.pAds)||void 0===c?void 0:c.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new tA(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(O.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(O.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,c="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a);console.log("gd-adflow openPromoUrl",c);var d=o?c:void 0;return function(){t(this,r)}.bind(this),{promo_url:d,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,d,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:c={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(d=new tA(a.gameData).checkCustomParams())&&(c.cp=d),u=encodeURIComponent(O.encode(JSON.stringify(c))),null==i||i.adapterIndex,null==i||i.isLastAdapter,l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&(null==i?void 0:i.isLastAdapter)&&"rewarded"===n,null==l||l.enabled,null==i||i.isLastAdapter,fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(u,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(u),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(u),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 20:case"end":return e.stop()}}),e,this,[[0,16]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=B.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=B.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(u=e(r.mark((function e(n){var i,a,s,o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],s=function(){return t(this,u),!1}.bind(this),window.idhb=window.idhb||{iabCmpExists:s},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=9,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 9:o=y("ch",window.location.href),c=y("ch_date",window.location.href),d={tnl_content_category:this.category.toLowerCase()},o&&(d.channel=o),c&&(d.ch_date=c),window.idhb.setAdserverTargeting(d),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_ima_script",value:(d=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_afg_script",value:(c=e(r.mark((function e(n){var i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,u),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense rewarded error",status:"error",skipForward:!0}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),c=function(e){t(this,u),e()}.bind(this),d=function(e){t(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),r={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:c,adBreakDone:d},window.adsbygoogle.push(r),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var r}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,a),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"}),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"preroll",adBreakDone:i},window.adsbygoogle.push(r),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var r}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error 2",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense midroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),r={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(O.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===g.Rewarded)t="reward";else if(n===g.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}},{key:"_broadcast",value:function(e,n){var r=this,i=!1;["AD_ERROR"].some(function(n){return t(this,r),n===e}.bind(this))&&(i=!this.adContext.isLastAdapter||this.adContext.extraPromoRunOnFail,console.log("gd-adflow skipForward",e,i,this.adContext.adapterIndex,this.adContext.isLastAdapter,this.adContext.extraPromoRunOnFail)),this.eventBus.broadcast(e,dA(dA({},n),{},{skipForward:i}))}}]),n}(),pA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",c=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},Im(this.moduleName,this.moduleConfig)},fA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",c=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},Im(this.moduleName,this.moduleConfig)},mA=function(e,t){console.log(e,t)},gA={},vA={},bA=null;function yA(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return gA.version=r,gA.frame=e,gA.function=n,gA.version}function _A(e){var n=this;return bA||(bA=new Promise(function(r){function i(t,n){if(mA("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:gA,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),yA(),gA.frame?2===gA.version?(mA("TCF v2 CMP found. Fetching the consent."),gA.function?(mA("CMP API is directly accessible, calling it now..."),gA.function("addEventListener",gA.version,i)):(mA("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==vA[r.callId]&&vA[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var c=Math.random()+"",d="".concat(a,"Call"),u=D({},d,{command:e,parameter:o,callId:c,version:r});vA[c]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,gA.version,r)}("addEventListener",gA.frame,i))):r({result:"cmpVersionNotV2",cmp:gA}):r({result:"cmpNotFound"})}.bind(this)),bA)}var wA=new(function(){function t(){S(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,c="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(c,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(d,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function AA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function kA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var EA=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var c=this;t(this,n);try{var d=document.createElement("script");if(d.async=null==s||s,d.type="text/javascript",d.onload=function(){t(this,c),e()}.bind(this),d.onerror=function(){t(this,c);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),d.src=r,i){var u,l=AA(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;d.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(d)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},xA=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,EA({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,EA({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,EA({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),RA=new F,SA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(SA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=SA[i][a];s&&RA.emit(s,r)}}),!1);var TA=q(),IA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:TA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){CA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",CA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=TA,CA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},OA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=PA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},PA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},CA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function MA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function jA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GA,BA=function(){function n(e){var r=this;S(this,n),D(this,"_getAdTypeByAfgPosition",function(e){var n=this;t(this,r);var i={preroll:["preroll","start"],midroll:["next"],rewarded:["reward"]},a=Object.keys(i).find(function(r){var a=this;return t(this,n),i[r].some(function(n){return t(this,a),n===e.params.position}.bind(this))}.bind(this));return a||"midroll"}.bind(this)),this._gameData=e._gameData,this._msgrt=e.msgrt,this._adInstance=e.adInstance,this._eventBus=e.eventBus,this.blockedAdsMap=e.blockedAdsMap,this._parentURL=e._parentURL,this._onResumeGame=e.onResumeGame.bind(e),this._setAdRequestTimer=e._setAdRequestTimer.bind(e),this._giveGift=e._giveGift.bind(e),this.send_atom_event=e.send_atom_event.bind(e),this.get_session_id=e.get_session_id.bind(e),this.get_ad_system_init_result=e.get_ad_system_init_result.bind(e)}var i,a,s;return T(n,[{key:"runAdFlow",value:(s=e(r.mark((function e(n){var i,a,s,o,c,d,u,l,h,p,f,m,g,v,b,y,_,w,A,k,E,x,R,S,D,T,I,O,P,C,L,U,M,j,G,B=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=this._getAdTypeByAfgPosition(n),n.params.position,d=this._getAdFlow(c),u=this._gameData,l=u.afg_disabled,h=null===(i=u.promo)||void 0===i||null===(a=i.rainbow)||void 0===a?void 0:a.enabled,p=null===(s=u.promo)||void 0===s?void 0:s.onadsense,f="reward"===(null===(o=n.params)||void 0===o?void 0:o.position),m=l?d.filter(function(e){return t(this,B),"adsense"!==e}.bind(this)):d,g=this.get_ad_system_init_result(),v=g.afg,b=g.ima,this.adsBlocked=!v&&!b,this.adsBlocked?(Va("gd-adflow adsBlocked so changing the flow"),m=[m[0]]):(v||(m=m.filter(function(e){return t(this,B),"adsense"!==e}.bind(this))),b||(m=m.filter(function(e){return t(this,B),"ima"!==e}.bind(this)))),y=!1,_=!1,w=[],A=0,k=!1,E=MA(m),e.prev=21,E.s();case 23:if((x=E.n()).done){e.next=59;break}if(R=x.value,n.params.adapter=R,S=A===m.length-1,"tag"!==R){e.next=36;break}return e.next=30,this._createTagDiv("gdsdk__advertisement");case 30:D=e.sent,T=D.success,A++,y=T,e.next=57;break;case 36:return h&&S&&"ima"===R&&(n.params.runPromoAsImaFallback=!0),I=S&&"adsense"===R&&h&&p&&f,n.params=UA(UA({},n.params),{},{adapterIndex:A,isLastAdapter:S,shouldFail:!1,extraPromoRunOnFail:I}),function(){t(this,B)}.bind(this),Va("gd-adflow, before adInvoke",A,R,n.params.shouldFail),e.next=43,this.adInvoke(n);case 43:if(O=e.sent,P=O.success,C=O.args,!P){e.next=53;break}return Va("gd-adflow, adapter-result-success",A,R,C),y=!0,_=!(null==C||!C.isPromoSuccess),e.abrupt("break",59);case 53:Va("gd-adflow, adapter-result-failure",A,R,C.message),A++,w.push(C.message),S&&"adsense"===R&&h&&p&&f&&(k=!0);case 57:e.next=23;break;case 59:e.next=64;break;case 61:e.prev=61,e.t0=e.catch(21),E.e(e.t0);case 64:return e.prev=64,E.f(),e.finish(64);case 67:if(!k){e.next=76;break}return n.params.adapter="promo",e.next=72,this.adInvoke(n);case 72:e.sent.success&&(_=!0);case 76:(function(){t(this,B)}).bind(this),L=w.join(" /n"),y?(this._setAdRequestTimer(),this._onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),this._giveGift()):(this._onResumeGame(L,"warning"),this._giveGift()),U="-1",M="none",y&&_?U="promo_ima":y?(U="index_".concat(A),M=m[A]):_&&(U="promo_adsense"),j=this.get_session_id(),this.adsBlocked&&"-1"===U?(G="rewarded"===c?"rewarded":this.blockedAdsMap.preroll?"midroll":"preroll",this.blockedAdsMap[G]=this.blockedAdsMap[G]?this.blockedAdsMap[G]+1:1,JSON.stringify(this.blockedAdsMap),this._msgrt.send("adflow.blocked.pos",{message:"".concat(G)}),this.send_atom_event("gd.adflow",{adBlocker:!0,afgBlocked:!0,imaBlocked:!0,adType:G,sessionId:j,successAdapter:"none",adFlowIndex:U})):(this._msgrt.send("adflow.all.index",{message:"".concat(U)}),this._msgrt.send("adflow.all.success_adapter",{message:"".concat(M)}),this._msgrt.send("adflow.".concat(c,".index"),{message:"".concat(U)}),this._msgrt.send("adflow.".concat(c,".success_adapter"),{message:"".concat(M)}),this.send_atom_event("gd.adflow",{adFlowIndex:U,successAdapter:M,adBlocker:!1,afgBlocked:!v,imaBlocked:!b,adType:c,sessionId:j}));case 86:case"end":return e.stop()}}),e,this,[[21,61,64,67]])}))),function(e){return s.apply(this,arguments)})},{key:"adInvoke",value:(a=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="main.showad.".concat(i.params.adapter,".").concat(i.params.adapterIndex),c=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!1,args:e})}.bind(this),d=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!0,args:e})}.bind(this),a._eventBus.subscribe("AD_ERROR",c,o),a._eventBus.subscribe("AD_SDK_CANCELED",c,o),a._eventBus.subscribe("AD_SUCCESS",d,o),e.prev=6,e.next=9,a._adInstance.startAd(i);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(6),Wa("gd-adflow startAd error",e.t0),n({success:!1,err:e.t0});case 15:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return a.apply(this,arguments)})},{key:"_getAdFlow",value:function(e){var n,r,i,a,s,o,c,d,u=this,l=void function(){t(this,u)}.bind(this),h=this._gameData.adflw;l&&(h=l);var p=null!==(n=h)&&void 0!==n&&null!==(r=n.adapters)&&void 0!==r&&r.default?null===(i=h)||void 0===i||null===(a=i.adapters)||void 0===a?void 0:a.default:["ima","adsense"];return p=null!==(s=h)&&void 0!==s&&null!==(o=s.adapters)&&void 0!==o&&o[e]?null===(c=h)||void 0===c||null===(d=c.adapters)||void 0===d?void 0:d[e]:p}},{key:"_createTagDiv",value:(i=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{console.log("gd-sdk, script creation started..."),s=document.getElementById(n),o=document.createElement("div"),c=document.createElement("script"),o.id="snack_div",c.setAttribute("src","https://tag.winister.app/v1/snack?version=0.1.17"),c.setAttribute("data-tag-id","KD7Z"),c.setAttribute("callback-fn","() => { console.log('gd-sdk, callback successfull');window.responseFunc();}"),c.setAttribute("callback-status","(status) => { console.log('gd-sdk, callback successfull',status)}"),c.setAttribute("data-content-type","game"),c.setAttribute("data-fit","v"),c.setAttribute("page-url",i._parentURL),o.style.width="100%",o.style.height="100%",o.appendChild(c),s.appendChild(o),console.log("gd-sdk, script creation completed..."),s.style.visibility="visible",window.responseFunc=function(){s.style.visibility="hidden",s.removeChild(document.getElementById("snack_div")),t({success:!0})}}catch(e){console.log("tag.error",e.message),container.style.visibility="hidden"}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)})}]),n}(),NA=new F,FA=["https://games.softgames.com","https://sg.gamedistribution.com","https://minigame-stg.aeriagames.jp","https://minigame.aeriagames.jp"];function qA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function VA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=e.source;if(FA.some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)){var s=r.system,o=r.action,c="aeriaExternalHostsConnector"===s&&"resultBoxClosed"===o;if("Softgames"===s&&"score"===o)GA=a,(window.parent||window).postMessage(r,"*"),NA.emit("aeria-event",r);else c&&GA&&GA.postMessage(r,"*")}}),!1);var WA,HA=q(),zA=null,KA=null,$A=function(){function n(e){var r=this;if(S(this,n),zA)return zA;zA=this,this.blockedAdsMap={},this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new _y,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&IA(this._gameData)}.bind(this)),this._registerSGBridge(),this._whichFrame()}var i,v,b,y,w,D,P,C,L,U,j,G;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(G=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new _y,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,xA();case 6:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{key:"testConsent",value:function(){try{yA();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_A({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;RA.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"_sendLoadedEvent",value:function(){if(!this._isLoaded&&(this._isLoaded=!0,"loader-frame"===this._whichFrame()))try{this._whichFrame(),this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(j=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().then(function(){t(this,s),(this._isMasterGameURL()||this._isExtHostedGameURL())&&(this.msgrt.send("adblocker.flw",{message:"ok"}),this.msgrt.send("adblocker.adapters",{message:"none"}))}.bind(this)).catch(function(e){t(this,s);var n="".concat(e).startsWith("Error: Blocked:");Va("gd-adflow adsBlocked",n,e);var r=this.get_ad_system_init_result(),i=r.ima,a=r.afg;if(this.adsBlocked=!i&&!a,this._isMasterGameURL()||this._isExtHostedGameURL()){this.msgrt.send("adblocker.flw",{message:"".concat(this.adsBlocked?"blocked":"ok")});var o=i||a?i?a?"none":"adsense":"ima":"all";this.msgrt.send("adblocker.adapters",{message:"".concat(o)})}console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return j.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=M(e);this.options=t?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Na.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(B.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=d("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:o(),version:Na.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:u(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),KA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&KA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),wA.track(KA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=KA)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&wA.track(KA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){if(t(this,e),n.message.startsWith("Blocked:")){if(!this._bridge.noBlockerEvent&&(this.msgrt.send("error",{message:n.message}),!this._hasBlocker)){this._hasBlocker=!0;var r=Math.random()<.25;this.msgrt.send("adblck.src",{message:n.message}),r&&this._sendTunnlEvent(3)}}else this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(Na.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(B.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(L=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new hA(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=Na,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(C=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return t=e.sent,this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"_createSplash",value:(P=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version}),n,this._parentDomain),e.next=6,n_();case 6:o=e.sent,c=o.enabled,s.on("playClick",function(){var e=this;if(t(this,d),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),c?window.gdsdk.showAd(g.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(g.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this))),OA({event:"FirstInteraction",game:this._gameData})}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,d),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,d),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(D=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,d),c.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(VA(VA({},this.options),{},{isConsentDomain:i,version:Na.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,d),c.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(g.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(y=e(r.mark((function t(n){var i,a=this,s=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>1&&void 0!==s[1]?s[1]:{},t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,s){var o,c,d,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c={adType:n,params:i,adTimestamp:a.adRequestTimer},e.next=5,a.sdkReady;case 5:return d=e.sent,e.next=8,a.videoAdReady;case 8:if(null!==(o=a._gameData.lp)&&void 0!==o&&o.load||a._sendLoadedEvent(),a._sendGamedockGamePlay(),a._rejectAdIfGameBlocked({gameData:d,adRequest:c}),a._rejectAdIfAdDisabled({gameData:d,adRequest:c}),a._rejectAdIfUnsupportedType({adRequest:c}),"rewarded"===n&&a._setGameRewardedFlag(),null!=i&&i.isGift||a._rejectAdIfAdRateHits({gameData:d,adRequest:c}),a.adInstance.attachAfgPosition(c),!a.adFlowRunning){e.next=18;break}return e.abrupt("return",t());case 18:return a.adFlowRunning=!0,u=new BA(a),e.next=22,u.runAdFlow(c);case 22:a.adFlowRunning=!1,t(),a._post_message({topic:"adrequest.instream"}),e.next=32;break;case 27:e.prev=27,e.t0=e.catch(0),a.adFlowRunning=!1,a.onResumeGame(e.t0.message,"warning"),s(e.t0.message);case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t)}))),function(e){return y.apply(this,arguments)})},{key:"_giveGift",value:function(){var e,t,n,r,i;null!==(e=this._gameData)&&void 0!==e&&null!==(t=e.gft)&&void 0!==t&&t.enabled&&(null===(n=this._gameData)||void 0===n||null===(r=n.gft)||void 0===r||null===(i=r.durations[this._giftCount])||void 0===i?void 0:i.after)===this.adInstance.adMidrollCount&&this.decideToGiveAGift()}},{key:"_setAdRequestTimer",value:function(){this.adRequestTimer=Date.now()}},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==g.Interstitial&&t.adType!==g.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=g.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===g.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,c=e.adRequest,d=null;c.adType===g.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(d=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):d=o.midroll;if(c.adType===g.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<d)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(b=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=g.Rewarded,e.next=16;break;case 14:if(n===g.Interstitial||n===g.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:return e.next=18,i.adInstance.preloadAd(n);case 18:o=e.sent,t(o),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(0),a(e.t0);case 25:case"end":return e.stop()}}),e,null,[[0,22]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return b.apply(this,arguments)})},{key:"cancelAd",value:(v=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return v.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){console.log("gd-adflow error onResumeGame",e),p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||OA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||OA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new R(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),d=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?d:c()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:d,topDomain:u&&u.length?u:d,noGAPageView:f,noLotamePageView:m,noGamedockSDK:g,noMinijuegosSDK:v,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:d===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_whichFrame",value:function(){return(this._isMasterGameURL()||this._isExtHostedGameURL())&&!this._isTokenGameURL()?"loader-frame":"game-frame"}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new fA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(i=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new pA(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(B.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=VA(VA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)KA.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning||n.adFlowRunning?console.log("Advertisement already running..."):(n.showAd(g.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}},{key:"send_atom_event",value:function(e,t){this.adInstance._send_atom_event(e,t)}},{key:"get_session_id",value:function(){return HA}},{key:"get_ad_system_init_result",value:function(){return{afg:this.adInstance.afgInitSuccess,ima:this.adInstance.imaInitSuccess}}},{key:"_setGameRewardedFlag",value:function(){try{if("developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasrewarded/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var e=JSON.stringify({type:"GD_SDK_REWARDED_SET",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(e,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(e,"*")}catch(e){}}}catch(e){}}}]),n}(),QA={},YA=function(e){try{if(e.skipForward)return;if(QA.source){var t={type:"gd-sdk-on-event",event:e};QA.source.postMessage(t,QA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},JA=function(){YA({name:"SDK_READY",status:"success",message:"Everything is ready."}),YA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),YA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},XA=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,c=a.type,d=a.method,u=a.options;if("gd-sdk-self"!==c){if("gd-sdk"===c){if(!QA.source&&"init"===d)return function(e){var t=e.source,n=e.origin;QA={source:t,origin:n}}({source:o,origin:s}),void JA();var l=n[d];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===d&&za.firstAdapterModeAdsense&&"rewarded"!==u.adType&&(console.log("promo-test, set first adapter to adssense 3"),u.params=u.params?u.params:{},u.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(u)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:d,options:u};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},ZA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){YA(e),t.apply(this,arguments)}}(e);var t=new $A(e);return XA(t),t},ek=function(e){try{var t=Ky(e);e.gameId||t.send("nogameid",{message:"".concat(Vg.parentURL)})}catch(e){}},tk={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ek(t),zy=Ky(Qy=t),e.next=5,u_();case 5:return n=e.sent,i=n?o_(t):ZA(t),r_(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",ZA(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function nk(){return(nk=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s_();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,ik(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rk=!1;function ik(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),WA)return r(WA);if(rk)var s=setInterval(function(){t(this,a),WA&&(rk=!1,clearInterval(s),r(WA))}.bind(this),100);else rk=!0,tk.create(e).then(function(e){t(this,a),WA=e,e._sendSDKReady(),rk=!1,r(WA)}.bind(this))}.bind(this))}var ak,sk=(ik(ak=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return nk.apply(this,arguments)}(ak,e)}});function ok(){var n=this;this.AdType=g,this.preloadAd=function(e){var n=this;return sk.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sk.invoke(function(e){var r=this;if(t(this,a),n===g.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.sendEvent=function(e){var n=this;return sk.invoke(function(r){return t(this,n),r.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){t(this,n),Cm.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Cm.addScore(e)}.bind(this)}}ok.prototype=new function(){this.showBanner=function(){var e=this;return sk.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new ok,window.gdApi=window.gdsdk;
|