@jolibox/implement 1.1.52 → 1.1.53-beta.0
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.
- package/.rush/temp/package-deps_build.json +35 -26
- package/CHANGELOG.json +11 -0
- package/CHANGELOG.md +9 -0
- package/dist/common/rewards/index.d.ts +2 -0
- package/dist/common/rewards/registers/use-gem-only.d.ts +10 -0
- package/dist/common/rewards/registers/use-gem.d.ts +10 -0
- package/dist/common/rewards/registers/utils/coins/commands/currency-handlers.d.ts +15 -0
- package/dist/common/rewards/registers/utils/coins/commands/index.d.ts +1 -1
- package/dist/common/rewards/registers/utils/coins/commands/use-jolicoin.d.ts +10 -8
- package/dist/common/rewards/registers/utils/coins/commands/use-payment.d.ts +10 -8
- package/dist/common/rewards/registers/utils/coins/commands/use-unlogin.d.ts +6 -8
- package/dist/common/rewards/registers/utils/coins/currency-config.d.ts +8 -0
- package/dist/common/rewards/registers/utils/coins/index.d.ts +2 -18
- package/dist/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.d.ts +18 -0
- package/dist/common/rewards/registers/utils/coins/joligem/fetch-gem-balance.d.ts +4 -0
- package/dist/common/rewards/registers/utils/coins/joligem/gem-handler.d.ts +19 -0
- package/dist/common/rewards/registers/utils/index.d.ts +3 -1
- package/dist/common/rewards/reward-emitter.d.ts +23 -13
- package/dist/common/rewards/reward-helper.d.ts +3 -1
- package/dist/common/rewards/type.d.ts +10 -1
- package/dist/index.js +25 -25
- package/dist/index.native.js +67 -67
- package/dist/native/payment/payment-helper.d.ts +5 -1
- package/dist/native/rewards/check-frequency.d.ts +24 -0
- package/implement.build.log +2 -2
- package/package.json +6 -6
- package/src/common/rewards/__tests__/can-use-jolicoin.test.ts +265 -9
- package/src/common/rewards/fetch-reward.ts +18 -3
- package/src/common/rewards/index.ts +2 -0
- package/src/common/rewards/registers/use-gem-only.ts +58 -0
- package/src/common/rewards/registers/use-gem.ts +53 -0
- package/src/common/rewards/registers/use-jolicoin-only.ts +4 -4
- package/src/common/rewards/registers/use-jolicoin.ts +4 -4
- package/src/common/rewards/registers/utils/coins/commands/currency-handlers.ts +48 -0
- package/src/common/rewards/registers/utils/coins/commands/index.ts +1 -1
- package/src/common/rewards/registers/utils/coins/commands/use-jolicoin.ts +31 -19
- package/src/common/rewards/registers/utils/coins/commands/use-payment.ts +32 -25
- package/src/common/rewards/registers/utils/coins/commands/use-unlogin.ts +22 -24
- package/src/common/rewards/registers/utils/coins/currency-config.ts +23 -0
- package/src/common/rewards/registers/utils/coins/index.ts +2 -139
- package/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts +149 -0
- package/src/common/rewards/registers/utils/coins/joligem/fetch-gem-balance.ts +15 -0
- package/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts +131 -0
- package/src/common/rewards/registers/utils/index.ts +20 -1
- package/src/common/rewards/reward-emitter.ts +23 -13
- package/src/common/rewards/reward-helper.ts +3 -1
- package/src/common/rewards/type.ts +13 -1
- package/src/h5/api/ads.ts +5 -13
- package/src/h5/rewards/index.ts +33 -20
- package/src/native/api/ads.ts +22 -1
- package/src/native/api/call-host-method.ts +36 -1
- package/src/native/payment/index.ts +2 -0
- package/src/native/payment/payment-helper.ts +2 -1
- package/src/native/rewards/check-frequency.ts +10 -0
- package/src/native/rewards/ui/payment-modal.ts +110 -33
- package/src/native/rewards/ui/unlogin-modal.ts +182 -87
- package/src/native/rewards/ui/use-modal.ts +126 -68
- /package/dist/common/rewards/registers/utils/coins/{fetch-balance.d.ts → jolicoin/fetch-balance.d.ts} +0 -0
- /package/src/common/rewards/registers/utils/coins/{fetch-balance.ts → jolicoin/fetch-balance.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Hc=Object.create;var li=Object.defineProperty,$c=Object.defineProperties,Gc=Object.getOwnPropertyDescriptor,qc=Object.getOwnPropertyDescriptors,Kc=Object.getOwnPropertyNames,Or=Object.getOwnPropertySymbols,Sa=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Wc=Reflect.get;var Ia=(e,t,r)=>t in e?li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))ui.call(t,r)&&Ia(e,r,t[r]);if(Or)for(var r of Or(t))Ra.call(t,r)&&Ia(e,r,t[r]);return e},ke=(e,t)=>$c(e,qc(t));var Kt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ca=(e,t)=>{var r={};for(var n in e)ui.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Or)for(var n of Or(e))t.indexOf(n)<0&&Ra.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var ci=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Kc(t))!ui.call(e,i)&&i!==r&&li(e,i,{get:()=>t[i],enumerable:!(n=Gc(t,i))||n.enumerable});return e};var di=(e,t,r)=>(r=e!=null?Hc(Sa(e)):{},zc(t||!e||!e.__esModule?li(r,"default",{value:e,enumerable:!0}):r,e));var ka=(e,t,r)=>Wc(Sa(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function id(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ua(e){return new Promise(t=>setTimeout(t,e))}function yi(e){return typeof e=="string"}function Ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ba(e){return typeof e=="object"&&Array.isArray(e)}function od(e){return typeof e=="undefined"}function ad(e){return od(e)||e===null}function sd(e){return typeof e=="function"}function Fa(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function ja(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:Oa(u)&&Oa(s)?i[a]=n(Na({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function Oa(e){return e&&typeof e=="object"&&e.constructor===Object}function Ja(e,t){if(Array.isArray(e))return e.concat(t)}function Yt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!p&&d()},t),p)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function cd(e,t){return(...r)=>t(e,...r)}function Ga(e){return t=>cd(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new ud(`${i}`))}})}function Wt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Pr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function vd(e){let t=e.location?Pr(e.location,Da):null,r=e.target?Pr(e.target,Da):null;return Pr(td(Na({},e),{location:t,target:r}),md)}function Ii(e){let t=e.events.map(n=>vd(n)),r=Pr(e.device,pd);return[e.protocolVersion,t,r,e.project]}function _d(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Cd(e){return new Promise(t=>Wa(e)(t))}function Wa(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function kd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Qt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Td(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Od(e[n],t[n])}function Od(e,t){if(yi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(sd(t)){try{if(e instanceof t)return}catch(r){}if(!ad(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Pd(){return typeof globalThis!="undefined"?globalThis[za]:void 0}function Dd(e){typeof globalThis!="undefined"&&(globalThis[za]=e)}function _e(e=!1){let t=Pd();if(!e&&t)return t;let r=new Dr,n=new _i,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Dd(i),i}var gi,Qc,Yc,Xc,xa,Zc,ed,Ta,Na,td,rd,La,nd,ld,bi,wi,Va,Ha,ud,$a,Nr,Lr,Ei,Ne,hi,dd,Ai,Pa,fd,ct,Et,hd,Da,md,pd,dt,wt,gd,Ee,yd,bd,wd,qa,Si,Ri,Ed,Ad,Ka,mi,te,Id,Sd,zt,Qt,je,vi,Rd,fi,xd,ft,Dr,_i,za,V=Z(()=>{"use strict";gi=Object.defineProperty,Qc=Object.defineProperties,Yc=Object.getOwnPropertyDescriptor,Xc=Object.getOwnPropertyDescriptors,xa=Object.getOwnPropertySymbols,Zc=Object.prototype.hasOwnProperty,ed=Object.prototype.propertyIsEnumerable,Ta=(e,t,r)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Na=(e,t)=>{for(var r in t||(t={}))Zc.call(t,r)&&Ta(e,r,t[r]);if(xa)for(var r of xa(t))ed.call(t,r)&&Ta(e,r,t[r]);return e},td=(e,t)=>Qc(e,Xc(t)),rd=(e,t)=>{for(var r in t)gi(e,r,{get:t[r],enumerable:!0})},La=(e,t,r,n)=>{for(var i=n>1?void 0:n?Yc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&gi(t,r,i),i},nd=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}ld=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(ld||{}),bi=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},wi=class extends bi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Va=class extends bi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ha=class extends Va{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ud=class extends Va{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},$a=class extends wi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Nr=class extends wi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Lr=class extends bi{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Ei=class extends wi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:Wt("log"),warn:Wt("warn"),info:Wt("info"),error:Wt("error"),debug:Wt("debug")};Object.assign(globalThis,{logger:Ne});hi=Symbol.for("Jolibox.canIUseMap"),dd={};globalThis[hi]||(globalThis[hi]=dd);Ai={get config(){return globalThis[hi]}},Pa=Symbol.for("Jolibox.canIUseMap.native"),fd={};globalThis[Pa]||(globalThis[Pa]=fd);ct=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(ct||{}),Et=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Et||{}),hd=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(hd||{}),Da=["name","params"],md=["name","type","location","target","extra","timestamp","userId"],pd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];dt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});_d();wt=typeof window=="undefined",gd=()=>!wt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ee={isiOS:!wt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:!wt&&navigator.userAgent.includes("Android"),isMac:!wt&&navigator.userAgent.includes("Mac"),isFacebook:!wt&&navigator.userAgent.includes("FB_IAB"),isPC:!wt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},yd=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",bd="device_id",wd="advertising_id",qa=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,dt()),window.__joliboxLocalStorage__.getItem(e)),Si=()=>new URLSearchParams(window.location.search).get("deviceId")||qa(bd),Ri=()=>new URLSearchParams(window.location.search).get("advertisingId")||qa(wd),Ed=e=>e.charAt(0).toUpperCase()+e.slice(1),Ad=()=>{var e;let t=new URLSearchParams(window.location.search);return Ed((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ka=e=>{if(gd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=yd(),n=navigator.language,i=Si(),o=Ri();return`${t} (${Ad()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},mi=class pi{constructor(t){this.element=t,this.next=pi.Undefined,this.prev=pi.Undefined}};mi.Undefined=new mi(void 0);te=mi,Id=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Sd=0,zt=class{constructor(e){this.value=e,this.id=Sd++}},Qt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new zt(t);return this._listeners?this._listeners instanceof zt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof zt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},je=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Qt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Id,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},vi={};rd(vi,{None:()=>Rd,filter:()=>kd,once:()=>Wa,toPromise:()=>Cd});Rd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});fi=Symbol.for("Jolibox.hostEmitter"),xd=()=>{let e=new je;return globalThis[fi]||(globalThis[fi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[fi]},ft=xd();Dr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Qt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Td(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Dr=La([Fa],Dr);_i=class{constructor(){this._onWillExecuteCommand=new Qt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Qt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Dr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=id(3e4)),this._starActivation}executeCommand(e,...t){return nd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),vi.toPromise(vi.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};_i=La([Fa],_i);za=Symbol.for("Jolibox.commands")});function xe(e,t={}){Ci.emit("ERROR_REPORT",{error:e,options:t})}var Ci,ht,Ge=Z(()=>{"use strict";V();V();Ci=new je,ht=new je;xe.debounce=Yt(xe,50,{leading:!0})});var ki,Nd,Qa,Ya,Xa=Z(()=>{"use strict";V();Ge();ki=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},Nd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Qa=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:ki(o),payloadJson:ki(a),signature:ki(s)}}else throw"joli_source is missing"}catch(r){return xe(new $a(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ya=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Nd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Ld,Ur,Za,xi=Z(()=>{"use strict";V();Ld="1.1.52",Ur=()=>Ld,Za=()=>{let e=Ur();return`${Ka(e)}`}});function Oi(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Ud,es,Ti,ts,ne,Md,D,me=Z(()=>{"use strict";V();Xa();xi();V();Ud={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Si(),adId:Ri(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Ur()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},Ti=(es=globalThis.joliboxJSCore)==null?void 0:es.env,ne=Object.assign({},(ts=Ti==null?void 0:Ti())!=null?ts:Ud);Md=()=>{var f,b,A,R,w,x,N,j,H,S,L;let{payloadJson:e,headerJson:t,signature:r}=ne.schema.length?Qa(ne.schema):{},n=`${ne.deviceInfo.did}-${new Date().getTime()}`,o=new URL(ne.schema.length?ne.schema:window.location.href).searchParams,a=(A=(b=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?b:o.get("gameId"))!=null?A:"",s=(x=(w=(R=ne.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?x:n,u=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(S=(H=e==null?void 0:e.joliboxEnv)!=null?H:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var T;return(T=performance.timeOrigin)!=null?T:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var T;return(T=o.get("joliSource"))!=null?T:null},get mpId(){var T;return(T=a!=null?a:e==null?void 0:e.id)!=null?T:""},get mpVersion(){var T;return(T=t==null?void 0:t.ver)!=null?T:Ur()},get mpType(){var T,M;return(M=(T=t==null?void 0:t.__mpType)!=null?T:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var T;return((T=ne.platform)!=null?T:ne.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ne.deviceInfo},get sdkInfo(){return ne.sdkInfo},get hostInfo(){return ne.hostInfo},get hostUserInfo(){return ne.hostUserInfo},get sessionId(){var T,M;return(M=(T=ne.clientSessionId)!=null?T:s)!=null?M:n},get channel(){return h},get webviewId(){var T;return(T=ne.webviewId)!=null?T:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var T;return(T=ne.deviceInfo.adId)!=null?T:ne.deviceInfo.did},get language(){return ne.deviceInfo.lang},get sdkEnvironment(){return Oi("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Oi("gamedistribution","jolibox")?"gamedistribution":Oi("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var W,ee,he;let T=(W=ne.deviceInfo.pixelRatio)!=null?W:1,M=(ee=ne.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,K=(he=ne.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/T:20,navigationBarHeight:K!==void 0?K/T:10}},get abTests(){var T,M;return(M=(T=ne.abValues)==null?void 0:T.split(","))!=null?M:[]},onEnvConfigChanged:T=>{ja(ne,T,Ja)},encodeJoliSourceQuery:T=>{var M,K;return t&&r?Ya(Q(Q({},e),T),(M=o.get("joliSource"))!=null?M:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},D=Md()});var Pi,ns,Bd,Fd,rs,jd,is=Z(()=>{"use strict";V();Ge();me();V();Pi=!1,ns=(e,t)=>e==null?!1:t in e,Bd=e=>ns(e,"kind"),Fd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},rs=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Fd(e.name)},i=ke(Q({},n),{env:t.environment,isFromUser:r});r?ht.emit("GLOBAL_USER_ERROR",e,i):ht.emit("GLOBAL_ERROR",e,i)},jd=e=>ns(e,"kind")&&e.kind==="USER_ERROR";Ci.on("ERROR_REPORT",({error:e,options:t})=>{if(Pi)return;Pi=!0;let r=Bd(e)&&e.raw?e.raw:e;try{let n=jd(e);rs(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Ei(`${i}, origin error: ${r.message}`);Ne.error(o),rs(new Ei(o.message),{environment:t.environment},!1)}finally{Pi=!1}})});var Di,Ni=Z(()=>{"use strict";Ge();V();Ge();Di=e=>new Ha(e)});function os(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ca(d,["eventType"]),u=ke(Q({tag:n,eventType:o!=null?o:a!=null?a:ct.Other},t),{extra:Q({},s)});n=="globalJsError"?xe(new Nr(JSON.stringify(u))):e("systemLog",u,D.webviewId)};return r.debounce=Yt(r,500,{leading:!0}),r}function as(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Yt(t,500,{leading:!0}),t}var ss=Z(()=>{"use strict";V();V();Ge();me()});function ls(e,t){let r=os(e,t),n=as(r);return{track:r,trackPerformance:n}}var us=Z(()=>{"use strict";ss()});var Li=Z(()=>{"use strict"});var Mr,cs=Z(()=>{"use strict";me();V();V();Mr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[ke(Q({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(Ii(d),n):yield this.doReport(Ii(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Ui=Z(()=>{"use strict";us();Li();cs()});var Mi,ds,qe,Br,Be,At=Z(()=>{"use strict";xi();me();V();Mi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ds=AbortSignal.timeout)!=null||(AbortSignal.timeout=Mi);qe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Br(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Br=class{constructor(t){this.xua=Za();this.getJoliSource=()=>D.joliSource;var n;let r=D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:Mi(i!=null?i:3e4)});return qe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Mi(o!=null?o:3e4),credentials:"include"});qe.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Br;Be=qe.getInstance()});var Bi,Fr,Fi=Z(()=>{"use strict";me();Ui();At();Bi=class extends Mr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=D.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Fr=new Bi});var Jd,fs=Z(()=>{"use strict";is();V();Ni();V();Fi();me();Jd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:ct.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Fr.trackEvent(n,Et.WebSDK)};ht.on("GLOBAL_ERROR",(e,t)=>{Jd(t.tag,e)});ht.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var jr,hs=Z(()=>{"use strict";jr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),b=f-r;b>=this.interval&&(this.visible&&(a+=Math.min(b,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let p=this.visible;return{start(){o||(o=!0,p?d():u())},stop(){o=!1,y(),h()}}}}});var Jr,ms=Z(()=>{"use strict";me();hs();At();Jr=class extends jr{constructor(r,n,i){super(n,i);this.httpClient=Be.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var ps,Vd,Le,Hd,ji,Ke,it=Z(()=>{"use strict";fs();V();V();Ui();Fi();ms();me();Li();ps=_e(),Vd={type:Et.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Le,trackPerformance:Hd}=ls((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=Ma(r.extra)?r.extra:yi(r.extra)?JSON.parse(r.extra):{},i=ke(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:ct.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=D.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Fr.trackEvent(o,Et.WebSDK)},Vd);ps.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Hd(e,t,r)});ps.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});ji=new je,Ke=new Jr(Le,ji)});function vs(e){let t=Ai.config[e];return t||(t={},Ai.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var _s=Z(()=>{"use strict";V()});function Ji(e){gs=e}function Vr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Vr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Vr(e[r]),t),{})}function We(e){return typeof e=="number"}function Vi(e){let t=Hi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Hi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var gs,ce,Hr,$r,Gr,qr,It,Kr,Wr,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,on,$i=Z(()=>{"use strict";gs=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(gs)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${Vi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Vr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Vr(this._default)}optional(){return this._optional=!0,this}};Hr=class extends ce{validate(t){return this._optional&&t===void 0?!0:We(t)?We(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):We(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):We(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Gr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(We(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(We(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},It=class extends ce{validate(t){return!0}},Kr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Wr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},zr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Qr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${Vi(t)}`)}return!0}},Yr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(We(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(We(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(We(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Xr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Hi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Zr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Hi(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},en=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Vi(this.value),actual:r}):!0}},tn=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
|
|
2
|
-
or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},nn=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},on=class extends ce{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function
|
|
3
|
-
`);throw e.errors.length=0,Ji(!1),new TypeError(n)}}var F,qi=Z(()=>{"use strict";$i();$i();F={object(e){return new Zr(e)},array(e){return new Yr(e)},tuple(...e){return new rn(...e)},literal(e){return new en(e)},or(...e){return new tn(...e)},symbol(){return new qr},record(e){return new Xr(e)},function(){return new zr},boolean(){return new $r},string(){return new Gr},number(){return new Hr},undefined(){return new Kr},null(){return new Wr},unknown(){return new It},any(){return new It},as(){return new It},arraybuffer(){return new nn},enum(...e){return new Qr(...e)},typedarray(e){return new on(e)}}});var an,ys,bs=Z(()=>{"use strict";V();Ge();qi();Ni();an=1,ys=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:an};an+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Gi(i.paramsSchema,o,"params")}catch(x){throw Di(`${n}:fail ${x.message}`)}let A=i.implement(...o),R=A,w=`${n}:ok`;if(A&&"code"in A){let{code:x,data:N,message:j}=A;u=x,R=N,w=j}return{code:u,message:w,data:R}}catch(A){let R=A;y=(p=(h=R.code)!=null?h:R.errNo)!=null?p:2e3,u="FAILURE";let w=(b=(f=R.message)!=null?f:R.errMsg)!=null?b:`${A}`;return d=`${n}:${u} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,xe(new Lr(d,y)),{code:u,message:d}}finally{let A=Date.now()-a}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,A;let a=Ba(o)?o:[o],s=Date.now(),u={method:n,trace_id:an};an+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Gi(i.paramsSchema,a,"params")}catch(x){throw Di(x.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:x,data:N,message:j}=w;y=x,d=j,w=N}return Object.assign(h,{code:y,message:d,data:w}),h}catch(R){let w=R,x=(f=(p=w.code)!=null?p:w.errNo)!=null?f:2e3;y="FAILURE";let N=(A=(b=w.message)!=null?b:w.errMsg)!=null?A:`${R}`,j=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:j}),xe(new Lr(j,x)),h}finally{let R=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var ze,mt,ge,Xt=Z(()=>{"use strict";_s();it();bs();qi();({createAPI:ze,createSyncAPI:mt}=ys(Le)),ge=vs("h5")});var Is=ci((As,Qi)=>{(function(e){if(typeof As=="object"&&typeof Qi!="undefined")Qi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var p=typeof Kt=="function"&&Kt;if(!h&&p)return p(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var b=o[y]={exports:{}};i[y][0].call(b.exports,function(A){var R=i[y][1][A];return s(R||A)},b,b.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Kt=="function"&&Kt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(A),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=A,u=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var w=a.document.createElement("script");w.onreadystatechange=function(){A(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},a.document.documentElement.appendChild(w)}:u=function(){setTimeout(A,0)};var f,b=[];function A(){f=!0;for(var w,x,N=b.length;N;){for(x=b,b=[],w=-1;++w<N;)x[w]();N=b.length}f=!1}i.exports=R;function R(w){b.push(w)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=p;function p(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,S!==s&&R(this,S)}p.prototype.catch=function(S){return this.then(null,S)},p.prototype.then=function(S,L){if(typeof S!="function"&&this.state===y||typeof L!="function"&&this.state===d)return this;var T=new this.constructor(s);if(this.state!==h){var M=this.state===y?S:L;b(T,M,this.outcome)}else this.queue.push(new f(T,S,L));return T};function f(S,L,T){this.promise=S,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){u.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,L,T){a(function(){var M;try{M=L(T)}catch(K){return u.reject(S,K)}M===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,M)})}u.resolve=function(S,L){var T=w(A,L);if(T.status==="error")return u.reject(S,T.value);var M=T.value;if(M)R(S,M);else{S.state=y,S.outcome=L;for(var K=-1,W=S.queue.length;++K<W;)S.queue[K].callFulfilled(L)}return S},u.reject=function(S,L){S.state=d,S.outcome=L;for(var T=-1,M=S.queue.length;++T<M;)S.queue[T].callRejected(L);return S};function A(S){var L=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof L=="function")return function(){L.apply(S,arguments)}}function R(S,L){var T=!1;function M(he){T||(T=!0,u.reject(S,he))}function K(he){T||(T=!0,u.resolve(S,he))}function W(){L(K,M)}var ee=w(W);ee.status==="error"&&M(ee.value)}function w(S,L){var T={};try{T.value=S(L),T.status="success"}catch(M){T.status="error",T.value=M}return T}p.resolve=x;function x(S){return S instanceof this?S:u.resolve(new this(s),S)}p.reject=N;function N(S){var L=new this(s);return u.reject(L,S)}p.all=j;function j(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var K=new Array(T),W=0,ee=-1,he=new this(s);++ee<T;)He(S[ee],ee);return he;function He($t,kr){L.resolve($t).then(Xn,function(yt){M||(M=!0,u.reject(he,yt))});function Xn(yt){K[kr]=yt,++W===T&&!M&&(M=!0,u.resolve(he,K))}}}p.race=H;function H(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var K=-1,W=new this(s);++K<T;)ee(S[K]);return W;function ee(he){L.resolve(he).then(function(He){M||(M=!0,u.resolve(W,He))},function(He){M||(M=!0,u.reject(W,He))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,m){if(!(l instanceof m))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,m){l=l||[],m=m||{};try{return new Blob(l,m)}catch(v){if(v.name!=="TypeError")throw v;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<l.length;g+=1)_.append(l[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(l,m){m&&l.then(function(c){m(null,c)},function(c){m(c)})}function b(l,m,c){typeof m=="function"&&l.then(m),typeof c=="function"&&l.catch(c)}function A(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",x=void 0,N={},j=Object.prototype.toString,H="readonly",S="readwrite";function L(l){for(var m=l.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=l.charCodeAt(g);return c}function T(l){return new p(function(m){var c=l.transaction(w,S),_=h([""]);c.objectStore(w).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),m(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function M(l){return typeof x=="boolean"?p.resolve(x):T(l).then(function(m){return x=m,x})}function K(l){var m=N[l.name],c={};c.promise=new p(function(_,g){c.resolve=_,c.reject=g}),m.deferredOperations.push(c),m.dbReady?m.dbReady=m.dbReady.then(function(){return c.promise}):m.dbReady=c.promise}function W(l){var m=N[l.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(l,m){var c=N[l.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(l,m){return new p(function(c,_){if(N[l.name]=N[l.name]||ia(),l.db)if(m)K(l),l.db.close();else return c(l.db);var g=[l.name];m&&g.push(l.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var I=v.result;try{I.createObjectStore(l.storeName),E.oldVersion<=1&&I.createObjectStore(w)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw C}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(I){I.target.close()},c(E),W(l)}})}function He(l){return he(l,!1)}function $t(l){return he(l,!0)}function kr(l,m){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,g=l.version>l.db.version;if(_&&(l.version!==m&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var v=l.db.version+1;v>l.version&&(l.version=v)}return!0}return!1}function Xn(l){return new p(function(m,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var v=btoa(g.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:l.type})},_.readAsBinaryString(l)})}function yt(l){var m=L(atob(l.data));return h([m],{type:l.type})}function na(l){return l&&l.__local_forage_encoded_blob}function $u(l){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,l,l),c}function Gu(l){K(l);for(var m=N[l.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,He(l).then(function(v){return l.db=v,kr(l)?$t(l):v}).then(function(v){l.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(l,v),v})}function $e(l,m,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,m);c(null,g)}catch(v){if(_>0&&(!l.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!l.db||v.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),$t(l)}).then(function(){return Gu(l).then(function(){$e(l,m,c,_-1)})}).catch(c);c(v)}}function ia(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function qu(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=N[c.name];g||(g=ia(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=$u);var v=[];function E(){return p.resolve()}for(var I=0;I<g.forages.length;I++){var C=g.forages[I];C!==m&&v.push(C._initReady().catch(E))}var k=g.forages.slice(0);return p.all(v).then(function(){return c.db=g.db,He(c)}).then(function(O){return c.db=O,kr(c,m._defaultConfig.version)?$t(c):O}).then(function(O){c.db=g.db=O,m._dbInfo=c;for(var U=0;U<k.length;U++){var J=k[U];J!==m&&(J._dbInfo.db=c.db,J._dbInfo.version=c.version)}})}function Ku(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.get(l);k.onsuccess=function(){var O=k.result;O===void 0&&(O=null),na(O)&&(O=yt(O)),g(O)},k.onerror=function(){v(k.error)}}catch(O){v(O)}})}).catch(v)});return f(_,m),_}function Wu(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.openCursor(),O=1;k.onsuccess=function(){var U=k.result;if(U){var J=U.value;na(J)&&(J=yt(J));var q=l(J,U.key,O++);q!==void 0?g(q):U.continue()}else g()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function zu(l,m,c){var _=this;l=A(l);var g=new p(function(v,E){var I;_.ready().then(function(){return I=_._dbInfo,j.call(m)==="[object Blob]"?M(I.db).then(function(C){return C?m:Xn(m)}):m}).then(function(C){$e(_._dbInfo,S,function(k,O){if(k)return E(k);try{var U=O.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,l);O.oncomplete=function(){C===void 0&&(C=null),v(C)},O.onabort=O.onerror=function(){var q=J.error?J.error:J.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(g,c),g}function Qu(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,S,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.delete(l);I.oncomplete=function(){g()},I.onerror=function(){v(k.error)},I.onabort=function(){var O=k.error?k.error:k.transaction.error;v(O)}}catch(O){v(O)}})}).catch(v)});return f(_,m),_}function Yu(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,S,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var k=C.error?C.error:C.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function Xu(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,H,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.count();C.onsuccess=function(){_(C.result)},C.onerror=function(){g(C.error)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function Zu(l,m){var c=this,_=new p(function(g,v){if(l<0){g(null);return}c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=!1,O=C.openKeyCursor();O.onsuccess=function(){var U=O.result;if(!U){g(null);return}l===0||k?g(U.key):(k=!0,U.advance(l))},O.onerror=function(){v(O.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function ec(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,H,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.openKeyCursor(),k=[];C.onsuccess=function(){var O=C.result;if(!O){_(k);return}k.push(O.key),O.continue()},C.onerror=function(){g(C.error)}}catch(O){g(O)}})}).catch(g)});return f(c,l),c}function tc(l,m){m=R.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;if(!l.name)g=p.reject("Invalid arguments");else{var v=l.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(l).then(function(I){var C=N[l.name],k=C.forages;C.db=I;for(var O=0;O<k.length;O++)k[O]._dbInfo.db=I;return I});l.storeName?g=E.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var C=I.version+1;K(l);var k=N[l.name],O=k.forages;I.close();for(var U=0;U<O.length;U++){var J=O[U];J._dbInfo.db=null,J._dbInfo.version=C}var q=new p(function(z,ue){var oe=d.open(l.name,C);oe.onerror=function(De){var qt=oe.result;qt.close(),ue(De)},oe.onupgradeneeded=function(){var De=oe.result;De.deleteObjectStore(l.storeName)},oe.onsuccess=function(){var De=oe.result;De.close(),z(De)}});return q.then(function(z){k.db=z;for(var ue=0;ue<O.length;ue++){var oe=O[ue];oe._dbInfo.db=z,W(oe._dbInfo)}}).catch(function(z){throw(ee(l,z)||p.resolve()).catch(function(){}),z})}}):g=E.then(function(I){K(l);var C=N[l.name],k=C.forages;I.close();for(var O=0;O<k.length;O++){var U=k[O];U._dbInfo.db=null}var J=new p(function(q,z){var ue=d.deleteDatabase(l.name);ue.onerror=function(){var oe=ue.result;oe&&oe.close(),z(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},ue.onsuccess=function(){var oe=ue.result;oe&&oe.close(),q(oe)}});return J.then(function(q){C.db=q;for(var z=0;z<k.length;z++){var ue=k[z];W(ue._dbInfo)}}).catch(function(q){throw(ee(l,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var rc={_driver:"asyncStorage",_initStorage:qu,_support:y(),iterate:Wu,getItem:Ku,setItem:zu,removeItem:Qu,clear:Yu,length:Xu,key:Zu,keys:ec,dropInstance:tc};function nc(){return typeof openDatabase=="function"}var rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ic="~~local_forage_type~",oa=/^~~local_forage_type~([^~]+)~/,xr="__lfsc__:",Zn=xr.length,ei="arbf",ti="blob",aa="si08",sa="ui08",la="uic8",ua="si16",ca="si32",da="ur16",fa="ui32",ha="fl32",ma="fl64",pa=Zn+ei.length,va=Object.prototype.toString;function _a(l){var m=l.length*.75,c=l.length,_,g=0,v,E,I,C;l[l.length-1]==="="&&(m--,l[l.length-2]==="="&&m--);var k=new ArrayBuffer(m),O=new Uint8Array(k);for(_=0;_<c;_+=4)v=rt.indexOf(l[_]),E=rt.indexOf(l[_+1]),I=rt.indexOf(l[_+2]),C=rt.indexOf(l[_+3]),O[g++]=v<<2|E>>4,O[g++]=(E&15)<<4|I>>2,O[g++]=(I&3)<<6|C&63;return k}function ri(l){var m=new Uint8Array(l),c="",_;for(_=0;_<m.length;_+=3)c+=rt[m[_]>>2],c+=rt[(m[_]&3)<<4|m[_+1]>>4],c+=rt[(m[_+1]&15)<<2|m[_+2]>>6],c+=rt[m[_+2]&63];return m.length%3===2?c=c.substring(0,c.length-1)+"=":m.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function oc(l,m){var c="";if(l&&(c=va.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&va.call(l.buffer)==="[object ArrayBuffer]")){var _,g=xr;l instanceof ArrayBuffer?(_=l,g+=ei):(_=l.buffer,c==="[object Int8Array]"?g+=aa:c==="[object Uint8Array]"?g+=sa:c==="[object Uint8ClampedArray]"?g+=la:c==="[object Int16Array]"?g+=ua:c==="[object Uint16Array]"?g+=da:c==="[object Int32Array]"?g+=ca:c==="[object Uint32Array]"?g+=fa:c==="[object Float32Array]"?g+=ha:c==="[object Float64Array]"?g+=ma:m(new Error("Failed to get type for BinaryArray"))),m(g+ri(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=ic+l.type+"~"+ri(this.result);m(xr+ti+E)},v.readAsArrayBuffer(l)}else try{m(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),m(null,E)}}function ac(l){if(l.substring(0,Zn)!==xr)return JSON.parse(l);var m=l.substring(pa),c=l.substring(Zn,pa),_;if(c===ti&&oa.test(m)){var g=m.match(oa);_=g[1],m=m.substring(g[0].length)}var v=_a(m);switch(c){case ei:return v;case ti:return h([v],{type:_});case aa:return new Int8Array(v);case sa:return new Uint8Array(v);case la:return new Uint8ClampedArray(v);case ua:return new Int16Array(v);case da:return new Uint16Array(v);case ca:return new Int32Array(v);case fa:return new Uint32Array(v);case ha:return new Float32Array(v);case ma:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var ni={serialize:oc,deserialize:ac,stringToBuffer:_a,bufferToString:ri};function ga(l,m,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function sc(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new p(function(v,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return E(I)}c.db.transaction(function(I){ga(I,c,function(){m._dbInfo=c,v()},function(C,k){E(k)})},E)});return c.serializer=ni,g}function nt(l,m,c,_,g,v){l.executeSql(c,_,g,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(C,k){k.rows.length?v(C,I):ga(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,I)},v)}function lc(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(C,k){var O=k.rows.length?k.rows.item(0).value:null;O&&(O=E.serializer.deserialize(O)),g(O)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function uc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT * FROM "+E.storeName,[],function(C,k){for(var O=k.rows,U=O.length,J=0;J<U;J++){var q=O.item(J),z=q.value;if(z&&(z=E.serializer.deserialize(z)),z=l(z,q.key,J+1),z!==void 0){g(z);return}}g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ya(l,m,c,_){var g=this;l=A(l);var v=new p(function(E,I){g.ready().then(function(){m===void 0&&(m=null);var C=m,k=g._dbInfo;k.serializer.serialize(m,function(O,U){U?I(U):k.db.transaction(function(J){nt(J,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[l,O],function(){E(C)},function(q,z){I(z)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(ya.apply(g,[l,C,c,_-1]));return}I(J)}})})}).catch(I)});return f(v,c),v}function cc(l,m,c){return ya.apply(this,[l,m,c,1])}function dc(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function fc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function hc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(I,C){var k=C.rows.item(0).c;_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function mc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(C,k){var O=k.rows.length?k.rows.item(0).key:null;g(O)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function pc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT key FROM "+v.storeName,[],function(I,C){for(var k=[],O=0;O<C.rows.length;O++)k.push(C.rows.item(O).key);_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function vc(l){return new p(function(m,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,v){for(var E=[],I=0;I<v.rows.length;I++)E.push(v.rows.item(I).name);m({db:l,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function _c(l,m){m=R.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;return l.name?g=new p(function(v){var E;l.name===c.name?E=_._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?v({db:E,storeNames:[l.storeName]}):v(vc(E))}).then(function(v){return new p(function(E,I){v.db.transaction(function(C){function k(q){return new p(function(z,ue){C.executeSql("DROP TABLE IF EXISTS "+q,[],function(){z()},function(oe,De){ue(De)})})}for(var O=[],U=0,J=v.storeNames.length;U<J;U++)O.push(k(v.storeNames[U]));p.all(O).then(function(){E()}).catch(function(q){I(q)})},function(C){I(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var gc={_driver:"webSQLStorage",_initStorage:sc,_support:nc(),iterate:uc,getItem:lc,setItem:cc,removeItem:dc,clear:fc,length:hc,key:mc,keys:pc,dropInstance:_c};function yc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function ba(l,m){var c=l.name+"/";return l.storeName!==m.storeName&&(c+=l.storeName+"/"),c}function bc(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(m){return!0}}function wc(){return!bc()||localStorage.length>0}function Ec(l){var m=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=ba(l,m._defaultConfig),wc()?(m._dbInfo=c,c.serializer=ni,p.resolve()):p.reject()}function Ac(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var v=localStorage.key(g);v.indexOf(_)===0&&localStorage.removeItem(v)}});return f(c,l),c}function Ic(l,m){var c=this;l=A(l);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+l);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function Sc(l,m){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,v=g.keyPrefix,E=v.length,I=localStorage.length,C=1,k=0;k<I;k++){var O=localStorage.key(k);if(O.indexOf(v)===0){var U=localStorage.getItem(O);if(U&&(U=g.serializer.deserialize(U)),U=l(U,O.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function Rc(l,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(l)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function Cc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo,g=localStorage.length,v=[],E=0;E<g;E++){var I=localStorage.key(E);I.indexOf(_.keyPrefix)===0&&v.push(I.substring(_.keyPrefix.length))}return v});return f(c,l),c}function kc(l){var m=this,c=m.keys().then(function(_){return _.length});return f(c,l),c}function xc(l,m){var c=this;l=A(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,m),_}function Tc(l,m,c){var _=this;l=A(l);var g=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,I){var C=_._dbInfo;C.serializer.serialize(m,function(k,O){if(O)I(O);else try{localStorage.setItem(C.keyPrefix+l,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(U),I(U)}})})});return f(g,c),g}function Oc(l,m){if(m=R.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,g;return l.name?g=new p(function(v){l.storeName?v(ba(l,_._defaultConfig)):v(l.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var I=localStorage.key(E);I.indexOf(v)===0&&localStorage.removeItem(I)}}):g=p.reject("Invalid arguments"),f(g,m),g}var Pc={_driver:"localStorageWrapper",_initStorage:Ec,_support:yc(),iterate:Sc,getItem:Ic,setItem:Tc,removeItem:xc,clear:Ac,length:kc,key:Rc,keys:Cc,dropInstance:Oc},Dc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Nc=function(m,c){for(var _=m.length,g=0;g<_;){if(Dc(m[g],c))return!0;g++}return!1},wa=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Gt={},Ea={},bt={INDEXEDDB:rc,WEBSQL:gc,LOCALSTORAGE:Pc},Lc=[bt.INDEXEDDB._driver,bt.WEBSQL._driver,bt.LOCALSTORAGE._driver],Tr=["dropInstance"],ii=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Tr),Uc={description:"",driver:Lc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mc(l,m){l[m]=function(){var c=arguments;return l.ready().then(function(){return l[m].apply(l,c)})}}function oi(){for(var l=1;l<arguments.length;l++){var m=arguments[l];if(m)for(var c in m)m.hasOwnProperty(c)&&(wa(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Bc=function(){function l(m){s(this,l);for(var c in bt)if(bt.hasOwnProperty(c)){var _=bt[c],g=_._driver;this[c]=g,Gt[g]||this.defineDriver(_)}this._defaultConfig=oi({},Uc),this._config=oi({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,g){var v=new p(function(E,I){try{var C=c._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(k);return}for(var O=ii.concat("_initStorage"),U=0,J=O.length;U<J;U++){var q=O[U],z=!Nc(Tr,q);if((z||c[q])&&typeof c[q]!="function"){I(k);return}}var ue=function(){for(var qt=function(Jc){return function(){var Vc=new Error("Method "+Jc+" is not implemented by the current driver"),Aa=p.reject(Vc);return f(Aa,arguments[arguments.length-1]),Aa}},ai=0,jc=Tr.length;ai<jc;ai++){var si=Tr[ai];c[si]||(c[si]=qt(si))}};ue();var oe=function(qt){Gt[C]&&console.info("Redefining LocalForage driver: "+C),Gt[C]=c,Ea[C]=qt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(oe,I):oe(!!c._support):oe(!0)}catch(De){I(De)}});return b(v,_,g),v},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var v=Gt[c]?p.resolve(Gt[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},l.prototype.getSerializer=function(c){var _=p.resolve(ni);return b(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},l.prototype.setDriver=function(c,_,g){var v=this;wa(c)||(c=[c]);var E=this._getSupportedDrivers(c);function I(){v._config.driver=v.driver()}function C(U){return v._extend(U),I(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var J=0;function q(){for(;J<U.length;){var z=U[J];return J++,v._dbInfo=null,v._ready=null,v.getDriver(z).then(C).catch(q)}I();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return q()}}var O=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=O.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(J){v._driver=J._driver,I(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){I();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!Ea[c]},l.prototype._extend=function(c){oi(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=ii.length;c<_;c++)Mc(this,ii[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),Fc=new Bc;i.exports=Fc},{3:3}]},{},[4])(4)})});var Rs=ci(dn=>{"use strict";V();Xt();it();var Xi=_e(),lf=ze("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional(),variation:F.string().optional()})),implement:e=>P(dn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;Ne.info("onLevelFinished",r,n,i,o),yield Promise.all([Ke.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),Ke.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),uf=ze("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number(),variation:F.string().optional()})),implement:e=>P(dn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;Ne.info("onGamePlayEnded",t,r,n,i),yield Promise.all([Ke.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),Ke.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),cf=ze("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>P(dn,[r],function*({levelId:e,name:t}){yield Promise.all([Ke.tracker("LevelUpgrade",{name:t,levelId:e}),Ke.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});Xi.registerCommand("TaskTrackerSDK.levelFinished",lf);Xi.registerCommand("TaskTrackerSDK.gamePlayEnded",uf);Xi.registerCommand("TaskTrackerSDK.levelUpgrade",cf);ge("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,St,Cs,Zi,df,fn,eo=Z(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},St=new Map,Cs=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=St.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Zi=!1,df=()=>{Zi||(window.addEventListener("message",Cs),Zi=!0)},fn=(e,t)=>{df(),St.has(e)||St.set(e,new Set);let r=St.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&St.delete(e),St.size===0&&(window.removeEventListener("message",Cs),Zi=!1)}}});var hn,mn,pn,vn,_n,ks,gn,yn,Rt,ff,ae,Ct,kt,Ue=Z(()=>{"use strict";V();hn="UNLOCK_OPTIONS_CHANGED",mn="INVOKE_PAYMENT",pn="ON_PAYMENT_RESULT",vn="ON_USE_MODAL_EVENT",_n="ON_USE_MODAL_RESULT",ks="ON_USE_MODAL_FREQUENCY",gn="ON_USE_UNLOGIN_MODAL_EVENT",yn="INVOKE_UNLOGIN_MODAL_EVENT",Rt=new je,ff=()=>({on:Rt.on.bind(Rt),off:Rt.off.bind(Rt),emit:Rt.emit.bind(Rt)}),ae=ff(),Ct={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},kt={show:!0,minInterval:8*60*60*1e3}});var Su=ci(Xo=>{"use strict";me();Ue();eo();V();var Iu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};fn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Iu[e.result],e.result),ae.emit(_n,{useModalResult:Iu[e.result]})});ae.on(vn,(e,t)=>{var r;pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})});fn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(pn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(mn,(e,t)=>P(Xo,null,function*(){var r;pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})}));fn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(gn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{jolicoin:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}}),e.result==="SUCCESS"&&D.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(yn,e=>P(Xo,null,function*(){pt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:dt(),type:e})}))});it();me();Xt();V();var ws=_e(),Gd="env",qd="getSystemInfoSync",Kd=()=>{var i,o,a,s;let e={system:D.deviceInfo.system,platform:D.deviceInfo.platform.toLowerCase(),brand:D.deviceInfo.brand,pixelRatio:D.deviceInfo.pixelRatio,language:D.deviceInfo.lang,version:D.sdkInfo.jssdkVersion,appName:(i=D.hostInfo)==null?void 0:i.appName,SDKVersion:D.sdkInfo.nativeSDKVersion},t=(o=D.hostInfo)==null?void 0:o.version;t&&(e=ke(Q({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=ke(Q({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=ke(Q({},e),{SDKVersion:n})),e},Wd=mt(qd,{implement:Kd}),zd=mt(Gd,{implement:()=>ke(Q({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});ws.registerCommand("API.env",zd);ws.registerCommand("API.getSystemInfoSync",Wd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});V();Xt();Ge();it();var Qd="onJoliboxShow",Yd="onJoliboxHide",Xd="onReady",Wi=_e(),zi=Ga(xe),Ki=!0,Zt=!0,sn=0,ln=ji;function Zd(){let e=Date.now();if(e-sn<100)return;sn=e;let t=document.visibilityState==="visible";t!==Ki&&(Ki=t,ln.emit("visible",Ki))}function Es(e){let t=Date.now();t-sn<100||(sn=t,e==="focus"&&!Zt?Zt=!0:e==="blur"&&Zt&&(Zt=!1),ln.emit("visible",Zt))}document.addEventListener("visibilitychange",Zd);window.addEventListener("focus",()=>Es("focus"));window.addEventListener("blur",()=>Es("blur"));var ef=mt(Qd,{paramsSchema:F.tuple(F.function()),implement(e){let t=zi(e);ln.on("visible",r=>{r&&t()})}}),tf=mt(Yd,{paramsSchema:F.tuple(F.function()),implement(e){let t=zi(e);ln.on("visible",r=>{!r&&t()})}}),rf=mt(Xd,{paramsSchema:F.tuple(F.function()),implement(e){let t=zi(e);ft.on("LifecycleEvent.onReady",r=>{t(r)})}});Wi.registerCommand("LifecycleSDK.onReady",rf);Wi.registerCommand("LifecycleSDK.onJoliboxShow",ef);Wi.registerCommand("LifecycleSDK.onJoliboxHide",tf);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});Xt();V();At();me();var Ss=di(Is());var un=_e(),Yi=class{constructor(){this.httpClient=Be.create({baseUrl:D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>D.mpId;this.getItem=t=>P(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>P(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>P(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>P(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Ss.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},cn=new Yi,nf=ze("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield cn.getItem(e)})}});un.registerCommand("StorageSDK.getItem",nf);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var of=ze("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return P(this,null,function*(){return yield cn.setItem(e,t)})}});un.registerCommand("StorageSDK.setItem",of);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var af=ze("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield cn.removeItem(e)})}});un.registerCommand("StorageSDK.removeItem",af);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var sf=ze("clearStorage",{implement(){return P(this,null,function*(){return yield cn.clear()})}});un.registerCommand("StorageSDK.clear",sf);ge("storage.clear",{version:"1.0.0"});var Rb=di(Rs());it();V();At();eo();me();Ue();var xs=D.testMode;function Ts(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,u)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;xs&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return xs&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:Ct,loginGuide:kt}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:Ct,loginGuide:kt}})}}}Ue();V();var hf=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,mf=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(hf()):["ADS"],Os=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;ae.emit(hn,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return mf(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Ps=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ae.emit(ks,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||Ct,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||kt}),r.data&&ft.emit("onGlobalConfigChanged",{globalConfig:r.data}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||Ct,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||kt}}))};var Ds=e=>t=>P(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});Ue();function ot(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=Q(Q({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Ue();var Me=ot(ae,hn);me();V();V();var at=_e();Ue();Ue();var to=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;at.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,u,d,y;let n=yield Me.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(u=n==null?void 0:n.options)==null?void 0:u.find(h=>h.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0;return console.log("-----unlockOptions usemodal-----",n,i,o),(yield r({enableAutoDeduct:i,userJoliCoin:n==null?void 0:n.userJoliCoin,joliCoinQuantity:o}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},er=(e,t)=>r=>P(void 0,null,function*(){let n=ot(ae,_n);return ae.emit(vn,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var bn=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Ns=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));Ue();Ue();var ro=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;at.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var u,d,y,h,p,f;let i=yield Me.getData(),o=yield bn(r),a=(y=(d=(u=i==null?void 0:i.options)==null?void 0:u.find(b=>b.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0,s={balance:(h=o==null?void 0:o.balance)!=null?h:0,enableAutoDeduct:(f=(p=i==null?void 0:i.userJoliCoin)==null?void 0:p.enableAutoDeduct)!=null?f:!1};return Me.updateData({userJoliCoin:s}),console.log("-----unlockOptions payment-----",i,s,a),Ns((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},tr=(e,t)=>r=>P(void 0,null,function*(){let n=ot(ae,pn);return ae.emit(mn,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});me();Ue();Ue();V();var no=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;at.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,u,d,y,h,p,f,b;let i=(a=D.hostUserInfo)==null?void 0:a.isLogin,o=yield Me.getData();if(console.log("-----isLogin-----",!!i),!i){let A=yield r();if(console.log("-----unloginModalResult-----",A),A.result=="FAILED"||A.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:R,claimedRewardValue:w}=(u=(s=A.rewards)==null?void 0:s.jolicoin)!=null?u:{};if(A.result=="SUCCESS"){R&&w&&(yield Ua(3e3));let x=yield bn(n),N=(h=(y=(d=o==null?void 0:o.options)==null?void 0:d.find(H=>H.type==="JOLI_COIN"))==null?void 0:y.joliCoinChoices[0].joliCoinQuantity)!=null?h:0,j={balance:(p=x==null?void 0:x.balance)!=null?p:0,enableAutoDeduct:(b=(f=o==null?void 0:o.userJoliCoin)==null?void 0:f.enableAutoDeduct)!=null?b:!1};if(Me.updateData({userJoliCoin:j}),j.balance>=N)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},rr=(e,t)=>()=>P(void 0,null,function*(){let r=ot(ae,gn);return ae.emit(yn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var wn=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>{no(e,{httpClient:t,showUnloginModal:s}),ro(e,{httpClient:t,initiateAndAwaitPayment:o}),to(e,{showUnlockWithJolicoinModal:a});let u=D.abTests.find(y=>y.startsWith("coinOpt_v1")),d=[];return u?d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`]:d=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`],y=>P(void 0,null,function*(){var h,p,f;try{let b=!0;for(let R of d){let w=yield at.executeCommand(R);if(b=b&&w.result!=="FAILED",w.result!=="CONTINUE")break}if(!b)return n==null||n(y),!1;let A=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${dt()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});if(console.log("-----unlockWithJolicoin request result-----",A),A.code=="SUCCESS"){try{(p=y.adBreakDone)==null||p.call(y,{breakType:y.type,breakName:"name"in y&&(h=y.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in y&&((f=y.adViewed)==null||f.call(y))}catch(R){console.error("-----unlockWithJolicoin adBreakDone error-----",R)}return r==null||r({quantity:A.data.quantity,balance:A.data.balance}),!0}return n==null||n(y),!1}catch(b){if(console.info("JolicoinRewardHandler error:",b),b instanceof Error&&b.message=="CANCEL")throw b;return n==null||n(y),!1}finally{i.clearCache()}})};var Ls=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=er("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=tr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=rr("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return wn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Us=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=er("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=tr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=rr("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return wn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Qe=Ts();Os(Qe);Ps(Qe);var Sn,B,Js,ao,vt,Ms,Vs,Hs,$s,so,io,oo,pf,nr={},Gs=[],vf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ir=Array.isArray;function Ye(e,t){for(var r in t)e[r]=t[r];return e}function lo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function or(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Sn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return An(e,a,n,i,null)}function An(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Js:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function st(e){return e.children}function Te(e,t){this.props=e,this.context=t}function xt(e,t){if(t==null)return e.__?xt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?xt(e):null}function qs(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return qs(e)}}function Bs(e){(!e.__d&&(e.__d=!0)&&vt.push(e)&&!In.__r++||Ms!==B.debounceRendering)&&((Ms=B.debounceRendering)||Vs)(In)}function In(){for(var e,t,r,n,i,o,a,s=1;vt.length;)vt.length>s&&vt.sort(Hs),e=vt.shift(),s=vt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ye({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),uo(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?xt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,zs(o,r,a),r.__e!=i&&qs(r)));In.__r=0}function Ks(e,t,r,n,i,o,a,s,u,d,y){var h,p,f,b,A,R,w=n&&n.__k||Gs,x=t.length;for(u=_f(r,t,w,u,x),h=0;h<x;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?nr:w[f.__i]||nr,f.__i=h,R=uo(e,f,p,i,o,a,s,u,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&co(p.ref,null,f),y.push(f.ref,f.__c||b,f)),A==null&&b!=null&&(A=b),4&f.__u||p.__k===f.__k?u=Ws(f,u,e):typeof f.type=="function"&&R!==void 0?u=R:b&&(u=b.nextSibling),f.__u&=-7);return r.__e=A,u}function _f(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?An(null,a,null,null,null):ir(a)?An(st,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?An(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=gf(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?p--:i<y&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=xt(s)),Ys(s,s));return n}function Ws(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ws(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=xt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ar(e,t){return t=t||[],e==null||typeof e=="boolean"||(ir(e)?e.some(function(r){ar(r,t)}):t.push(e)),t}function gf(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function Fs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||vf.test(t)?r:r+"px"}function En(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Fs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Fs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace($s,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=so,e.addEventListener(t,o?oo:io,o)):e.removeEventListener(t,o?oo:io,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function js(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=so++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function uo(e,t,r,n,i,o,a,s,u,d){var y,h,p,f,b,A,R,w,x,N,j,H,S,L,T,M,K,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof W=="function")try{if(w=t.props,x="prototype"in W&&W.prototype.render,N=(y=W.contextType)&&n[y.__c],j=y?N?N.props.value:y.__:n,r.__c?R=(h=t.__c=r.__c).__=h.__E:(x?t.__c=h=new W(w,j):(t.__c=h=new Te(w,j),h.constructor=W,h.render=bf),N&&N.sub(h),h.props=w,h.state||(h.state={}),h.context=j,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),x&&h.__s==null&&(h.__s=h.state),x&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ye({},h.__s)),Ye(h.__s,W.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)x&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),x&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(x&&W.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,j)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ee){ee&&(ee.__=t)}),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,j),x&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,A)})}if(h.context=j,h.props=w,h.__P=e,h.__e=!1,S=B.__r,L=0,x){for(h.state=h.__s,h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(n=Ye(Ye({},n),h.getChildContext())),x&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,b)),M=y,y!=null&&y.type===st&&y.key==null&&(M=Qs(y.props.children)),s=Ks(e,ir(M)?M:[M],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),R&&(h.__E=h.__=null)}catch(ee){if(t.__v=null,u||o!=null)if(ee.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(K=o.length;K--;)lo(o[K]);else t.__e=r.__e,t.__k=r.__k;B.__e(ee,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=yf(r.__e,t,r,n,i,o,a,u,d);return(y=B.diffed)&&y(t),128&t.__u?void 0:s}function zs(e,t,r){for(var n=0;n<r.length;n++)co(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){B.__e(o,i.__v)}})}function Qs(e){return typeof e!="object"||e==null?e:ir(e)?e.map(Qs):Ye({},e)}function yf(e,t,r,n,i,o,a,s,u){var d,y,h,p,f,b,A,R=r.props,w=t.props,x=t.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(w);e=document.createElementNS(i,x,w.is&&w),s&&(B.__m&&B.__m(t,o),s=!1),o=null}if(x===null)R===w||s&&e.data===w||(e.data=w);else{if(o=o&&Sn.call(e.childNodes),R=r.props||nr,!s&&o!=null)for(R={},d=0;d<e.attributes.length;d++)R[(f=e.attributes[d]).name]=f.value;for(d in R)if(f=R[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;En(e,d,null,f,i)}}for(d in w)f=w[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?b=f:d=="checked"?A=f:s&&typeof f!="function"||R[d]===f||En(e,d,f,R[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Ks(t.type==="template"?e.content:e,ir(p)?p:[p],t,r,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&xt(r,0),s,u),o!=null)for(d=o.length;d--;)lo(o[d]);s||(d="value",x=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||x=="progress"&&!b||x=="option"&&b!==R[d])&&En(e,d,b,R[d],i),d="checked",A!==void 0&&A!==e[d]&&En(e,d,A,R[d],i))}return e}function co(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){B.__e(i,r)}}function Ys(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||co(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){B.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Ys(n[i],t,r||typeof e.type!="function");r||lo(e.__e),e.__c=e.__=e.__e=void 0}function bf(e,t,r){return this.constructor(e,r)}function Xs(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],uo(t,e=(!n&&r||t).__k=or(st,null,[e]),i||nr,nr,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?Sn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),zs(o,e,a)}Sn=Gs.slice,B={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Js=0,ao=function(e){return e!=null&&e.constructor==null},Te.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Bs(this))},Te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Bs(this))},Te.prototype.render=st,vt=[],Vs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hs=function(e,t){return e.__v.__b-t.__v.__b},In.__r=0,$s=/(PointerCapture)$|Capture$/i,so=0,io=js(!1),oo=js(!0),pf=0;var Tt,ie,fo,Zs,sr=0,sl=[],se=B,el=se.__b,tl=se.__r,rl=se.diffed,nl=se.__c,il=se.unmount,ol=se.__;function Cn(e,t){se.__h&&se.__h(ie,e,sr||t),sr=0;var r=ie.__H||(ie.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function kn(e){return sr=1,ll(ul,e)}function ll(e,t,r){var n=Cn(Tt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ul(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ie,!ie.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};ie.__f=!0;var o=ie.shouldComponentUpdate,a=ie.componentWillUpdate;ie.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},ie.shouldComponentUpdate=i}return n.__N||n.__}function lr(e,t){var r=Cn(Tt++,3);!se.__s&&_o(r.__H,t)&&(r.__=e,r.u=t,ie.__H.__h.push(r))}function mo(e,t){var r=Cn(Tt++,4);!se.__s&&_o(r.__H,t)&&(r.__=e,r.u=t,ie.__h.push(r))}function po(e){return sr=5,ur(function(){return{current:e}},[])}function ur(e,t){var r=Cn(Tt++,7);return _o(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function vo(e,t){return sr=8,ur(function(){return e},t)}function wf(){for(var e;e=sl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Rn),e.__H.__h.forEach(ho),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,el&&el(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ol&&ol(e,t)},se.__r=function(e){tl&&tl(e),Tt=0;var t=(ie=e.__c).__H;t&&(fo===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Rn),t.__h.forEach(ho),t.__h=[],Tt=0)),fo=ie},se.diffed=function(e){rl&&rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(sl.push(t)!==1&&Zs===se.requestAnimationFrame||((Zs=se.requestAnimationFrame)||Ef)(wf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),fo=ie=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Rn),r.__h=r.__h.filter(function(n){return!n.__||ho(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),nl&&nl(e,t)},se.unmount=function(e){il&&il(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Rn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var al=typeof requestAnimationFrame=="function";function Ef(e){var t,r=function(){clearTimeout(n),al&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);al&&(t=requestAnimationFrame(r))}function Rn(e){var t=ie,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ie=t}function ho(e){var t=ie;e.__c=e.__(),ie=t}function _o(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function ul(e,t){return typeof t=="function"?t(e):t}function If(e,t){for(var r in t)e[r]=t[r];return e}function cl(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function dl(e,t){this.props=e,this.context=t}(dl.prototype=new Te).isPureReactComponent=!0,dl.prototype.shouldComponentUpdate=function(e,t){return cl(this.props,e)||cl(this.state,t)};var fl=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),fl&&fl(e)};var Cy=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Sf=B.__e;B.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Sf(e,t,r,n)};var hl=B.unmount;function bl(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=If({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return bl(n,t,r)})),e}function wl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return wl(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function go(){this.__u=0,this.o=null,this.__b=null}function El(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function xn(){this.i=null,this.l=null}B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),hl&&hl(e)},(go.prototype=new Te).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=El(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=wl(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},go.prototype.componentWillUnmount=function(){this.o=[]},go.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=bl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&or(st,null,e.fallback);return i&&(i.__u&=-33),[or(st,null,t.__a?null:e.children),i]};var ml=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(xn.prototype=new Te).__a=function(e){var t=this,r=El(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),ml(t,e,n)):i()};r?r(o):o()}},xn.prototype.render=function(e){this.i=null,this.l=new Map;var t=ar(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},xn.prototype.componentDidUpdate=xn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){ml(e,r,t)})};var Rf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Cf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,kf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xf=/[A-Z0-9]/g,Tf=typeof document!="undefined",Of=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function yo(e,t,r){return t.__k==null&&(t.textContent=""),Xs(e,t),typeof r=="function"&&r(),e?e.__c:null}Te.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Te.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var pl=B.event;function Pf(){}function Df(){return this.cancelBubble}function Nf(){return this.defaultPrevented}B.event=function(e){return pl&&(e=pl(e)),e.persist=Pf,e.isPropagationStopped=Df,e.isDefaultPrevented=Nf,e.nativeEvent=e};var Al,Lf={enumerable:!1,configurable:!0,get:function(){return this.class}},vl=B.vnode;B.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||Tf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||Of(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":kf.test(a)&&(a=u):u=a="oninput":o&&Cf.test(a)?a=a.replace(xf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ar(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=ar(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Lf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Rf,vl&&vl(e)};var _l=B.__r;B.__r=function(e){_l&&_l(e),Al=e.__c};var gl=B.diffed;B.diffed=function(e){gl&&gl(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Al=null};var Il=Object.getOwnPropertySymbols,Uf=Object.prototype.hasOwnProperty,Mf=Object.prototype.propertyIsEnumerable,Bf=(e,t)=>{var r={};for(var n in e)Uf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Il)for(var n of Il(e))t.indexOf(n)<0&&Mf.call(e,n)&&(r[n]=e[n]);return r},zl=Object.defineProperty,Ff=Object.defineProperties,jf=Object.getOwnPropertyDescriptors,Sl=Object.getOwnPropertySymbols,Jf=Object.prototype.hasOwnProperty,Vf=Object.prototype.propertyIsEnumerable,Rl=(e,t,r)=>t in e?zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hf=(e,t)=>{for(var r in t||(t={}))Jf.call(t,r)&&Rl(e,r,t[r]);if(Sl)for(var r of Sl(t))Vf.call(t,r)&&Rl(e,r,t[r]);return e},$f=(e,t)=>Ff(e,jf(t)),Gf=(e,t)=>{for(var r in t)zl(e,r,{get:t[r],enumerable:!0})},Ql=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},qf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}function Kf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Wf(e){return typeof e=="string"}function zf(e){return typeof e=="undefined"}function Qf(e){return zf(e)||e===null}function Yf(e){return typeof e=="function"}function Yl(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var Xf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Xf||{});function cr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Zf={log:cr("log"),warn:cr("warn"),info:cr("info"),error:cr("error"),debug:cr("debug")};Object.assign(globalThis,{logger:Zf});var Cl=Symbol.for("Jolibox.canIUseMap"),eh={};globalThis[Cl]||(globalThis[Cl]=eh);var kl=Symbol.for("Jolibox.canIUseMap.native"),th={};globalThis[kl]||(globalThis[kl]=th);var Xl=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Xl||{}),Zl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Zl||{}),eu=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(eu||{}),xl=["name","params"],rh=["name","type","location","target","extra","timestamp","userId"],nh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Dn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function ih(e){let t=e.location?Dn(e.location,xl):null,r=e.target?Dn(e.target,xl):null;return Dn($f(Hf({},e),{location:t,target:r}),rh)}function oh(e){let t=e.events.map(n=>ih(n)),r=Dn(e.device,nh);return[e.protocolVersion,t,r,e.project]}function ah(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}ah();var Dt=typeof window=="undefined",Tl=()=>!Dt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Dt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Dt&&navigator.userAgent.includes("Android"),!Dt&&navigator.userAgent.includes("Mac"),!Dt&&navigator.userAgent.includes("FB_IAB"),!Dt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var Ro=class Co{constructor(t){this.element=t,this.next=Co.Undefined,this.prev=Co.Undefined}};Ro.Undefined=new Ro(void 0);var re=Ro,sh=class{constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let e=this._first;for(;e!==re.Undefined;){let t=e.next;e.prev=re.Undefined,e.next=re.Undefined,e=t}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new re(e);if(this._first===re.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==re.Undefined&&e.next!==re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===re.Undefined&&e.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):e.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):e.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==re.Undefined;)yield e.element,e=e.next}},lh=0,dr=class{constructor(e){this.value=e,this.id=lh++}},pr=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof dr&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new dr(e);return this._listeners?this._listeners instanceof dr?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,p;if(!this._disposed){if(this._listeners instanceof dr)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof dr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},uh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new pr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new sh,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ko={};Gf(ko,{None:()=>ch,filter:()=>fh,once:()=>tu,toPromise:()=>dh});var ch=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function dh(e){return new Promise(t=>tu(e)(t))}function tu(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function fh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new pr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var bo=Symbol.for("Jolibox.hostEmitter"),hh=()=>{let e=new uh;return globalThis[bo]||(globalThis[bo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[bo]};hh();function mh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)ph(e[n],t[n])}function ph(e,t){if(Wf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Yf(t)){try{if(e instanceof t)return}catch(r){}if(!Qf(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var xo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new pr,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return mh(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};xo=Ql([Yl],xo);var Ol=class{constructor(){this._onWillExecuteCommand=new pr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new pr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new xo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Kf(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return qf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ko.toPromise(ko.filter(this.registry.onDidRegisterCommand,i=>i===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};Ol=Ql([Yl],Ol);function Ie(e,t,r){return(t=vh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vh(e){var t=_h(e,"string");return typeof t=="symbol"?t:t+""}function _h(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ot=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},To=class{constructor(t){Ie(this,"context",void 0),Ie(this,"continueCallback",void 0),Ie(this,"adIsShowingCallback",void 0),Ie(this,"isBeforeAdCalled",!1),Ie(this,"isBeforeRewardCalled",!1),Ie(this,"isAdDismissedCalled",!1),Ie(this,"isAdViewedCalled",!1),Ie(this,"isAfterAdCalled",!1),Ie(this,"currentProvider",void 0),Ie(this,"currentClientParams",void 0),Ie(this,"adsHasResponse",!1),Ie(this,"videoChecker",window.document.createElement("video")),Ie(this,"contextInfo",void 0),Ie(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),Tl()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Ot(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Ot(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Tl()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Ot(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Ot(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Ot(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let d=Ot(t);d==null||d(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,u,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Tn(e,t,r){return(t=gh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gh(e){var t=yh(e,"string");return typeof t=="symbol"?t:t+""}function yh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oo=class{constructor(t){Tn(this,"context",void 0),Tn(this,"adBreakIsShowing",!1),Tn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Tn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function On(e,t,r){return(t=bh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bh(e){var t=wh(e,"string");return typeof t=="symbol"?t:t+""}function wh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Po=class{constructor(t){On(this,"configs",null),On(this,"firstRun",!0),On(this,"context",void 0),On(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return P(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function Xe(e,t,r){return(t=Eh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eh(e){var t=Ah(e,"string");return typeof t=="symbol"?t:t+""}function Ah(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Do=class{constructor(t,r){Xe(this,"name","ADSENSE"),Xe(this,"context",void 0),Xe(this,"contextInfo",void 0),Xe(this,"configured",!1),Xe(this,"initParams",void 0),Xe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Xe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Bf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Xe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Xe(this,"adUnit",n=>P(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!f)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let A=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,R=document.createElement("ins");if(R.className="adsbygoogle",R.id="jolibox-ads",R.style.display="block",R.setAttribute("data-ad-client",this.initParams.clientId),R.setAttribute("data-ad-slot",b),A&&R.setAttribute("data-ad-format",A),h&&R.setAttribute("data-full-width-responsive",h),p&&R.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",R.style.position="relative",f.appendChild(R),R.appendChild(w)}else f.appendChild(R),new MutationObserver(w=>{w.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let N=R.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(R,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return P(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function Ih(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Sh(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Rh=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Sh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Ih(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),be="-ms-",Fn="-moz-",$="-webkit-",ru="comm",Wo="rule",zo="decl",Ch="@import",nu="@keyframes",kh="@layer",xh=Math.abs,$n=String.fromCharCode,Th=Object.assign;function Oh(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function iu(e){return e.trim()}function Ph(e,t){return(e=t.exec(e))?e[0]:e}function G(e,t,r){return e.replace(t,r)}function No(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function vr(e,t,r){return e.slice(t,r)}function Je(e){return e.length}function Qo(e){return e.length}function Pn(e,t){return t.push(e),e}function Dh(e,t){return e.map(t).join("")}var Gn=1,Ut=1,ou=0,Ce=0,de=0,Mt="";function qn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Gn,column:Ut,length:a,return:""}}function fr(e,t){return Th(qn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Nh(){return de}function Lh(){return de=Ce>0?pe(Mt,--Ce):0,Ut--,de===10&&(Ut=1,Gn--),de}function Pe(){return de=Ce<ou?pe(Mt,Ce++):0,Ut++,de===10&&(Ut=1,Gn++),de}function Ve(){return pe(Mt,Ce)}function Nn(){return Ce}function yr(e,t){return vr(Mt,e,t)}function _r(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function au(e){return Gn=Ut=1,ou=Je(Mt=e),Ce=0,[]}function su(e){return Mt="",e}function Ln(e){return iu(yr(Ce-1,Lo(e===91?e+2:e===40?e+1:e)))}function Uh(e){for(;(de=Ve())&&de<33;)Pe();return _r(e)>2||_r(de)>3?"":" "}function Mh(e,t){for(;--t&&Pe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return yr(e,Nn()+(t<6&&Ve()==32&&Pe()==32))}function Lo(e){for(;Pe();)switch(de){case e:return Ce;case 34:case 39:e!==34&&e!==39&&Lo(de);break;case 40:e===41&&Lo(e);break;case 92:Pe();break}return Ce}function Bh(e,t){for(;Pe()&&e+de!==57&&!(e+de===84&&Ve()===47););return"/*"+yr(t,Ce-1)+"*"+$n(e===47?e:Pe())}function Fh(e){for(;!_r(Ve());)Pe();return yr(e,Ce)}function jh(e){return su(Un("",null,null,null,[""],e=au(e),0,[0],e))}function Un(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,p=0,f=0,b=0,A=1,R=1,w=1,x=0,N="",j=i,H=o,S=n,L=N;R;)switch(b=x,x=Pe()){case 40:if(b!=108&&pe(L,h-1)==58){No(L+=G(Ln(x),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:L+=Ln(x);break;case 9:case 10:case 13:case 32:L+=Uh(b);break;case 92:L+=Mh(Nn()-1,7);continue;case 47:switch(Ve()){case 42:case 47:Pn(Jh(Bh(Pe(),Nn()),t,r),u);break;default:L+="/"}break;case 123*A:s[d++]=Je(L)*w;case 125*A:case 59:case 0:switch(x){case 0:case 125:R=0;case 59+y:w==-1&&(L=G(L,/\f/g,"")),f>0&&Je(L)-h&&Pn(f>32?Dl(L+";",n,r,h-1):Dl(G(L," ","")+";",n,r,h-2),u);break;case 59:L+=";";default:if(Pn(S=Pl(L,t,r,d,y,i,s,N,j=[],H=[],h),o),x===123)if(y===0)Un(L,t,S,S,j,o,h,s,H);else switch(p===99&&pe(L,3)===110?100:p){case 100:case 108:case 109:case 115:Un(e,S,S,n&&Pn(Pl(e,S,S,0,0,i,s,N,i,j=[],h),H),i,H,h,s,n?j:H);break;default:Un(L,S,S,S,[""],H,0,s,H)}}d=y=f=0,A=w=1,N=L="",h=a;break;case 58:h=1+Je(L),f=b;default:if(A<1){if(x==123)--A;else if(x==125&&A++==0&&Lh()==125)continue}switch(L+=$n(x),x*A){case 38:w=y>0?1:(L+="\f",-1);break;case 44:s[d++]=(Je(L)-1)*w,w=1;break;case 64:Ve()===45&&(L+=Ln(Pe())),p=Ve(),y=h=Je(N=L+=Fh(Nn())),x++;break;case 45:b===45&&Je(L)==2&&(A=0)}}return o}function Pl(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,p=i===0?o:[""],f=Qo(p),b=0,A=0,R=0;b<n;++b)for(var w=0,x=vr(e,h+1,h=xh(A=a[b])),N=e;w<f;++w)(N=iu(A>0?p[w]+" "+x:G(x,/&\f/g,p[w])))&&(u[R++]=N);return qn(e,t,r,i===0?Wo:s,u,d,y)}function Jh(e,t,r){return qn(e,t,r,ru,$n(Nh()),vr(e,2,-2),0)}function Dl(e,t,r,n){return qn(e,t,r,zo,vr(e,0,n),vr(e,n+1,-1),n)}function Lt(e,t){for(var r="",n=Qo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Vh(e,t,r,n){switch(e.type){case kh:if(e.children.length)break;case Ch:case zo:return e.return=e.return||e.value;case ru:return"";case nu:return e.return=e.value+"{"+Lt(e.children,n)+"}";case Wo:e.value=e.props.join(",")}return Je(r=Lt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Hh(e){var t=Qo(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function $h(e){return function(t){t.root||(t=t.return)&&e(t)}}function Gh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var qh=function(e,t,r){for(var n=0,i=0;n=i,i=Ve(),n===38&&i===12&&(t[r]=1),!_r(i);)Pe();return yr(e,Ce)},Kh=function(e,t){var r=-1,n=44;do switch(_r(n)){case 0:n===38&&Ve()===12&&(t[r]=1),e[r]+=qh(Ce-1,t,r);break;case 2:e[r]+=Ln(n);break;case 4:if(n===44){e[++r]=Ve()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=$n(n)}while(n=Pe());return e},Wh=function(e,t){return su(Kh(au(e),t))},Nl=new WeakMap,zh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Nl.get(r))&&!n){Nl.set(e,!0);for(var i=[],o=Wh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Qh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function lu(e,t){switch(Oh(e,t)){case 5103:return $+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $+e+Fn+e+be+e+e;case 6828:case 4268:return $+e+be+e+e;case 6165:return $+e+be+"flex-"+e+e;case 5187:return $+e+G(e,/(\w+).+(:[^]+)/,$+"box-$1$2"+be+"flex-$1$2")+e;case 5443:return $+e+be+"flex-item-"+G(e,/flex-|-self/,"")+e;case 4675:return $+e+be+"flex-line-pack"+G(e,/align-content|flex-|-self/,"")+e;case 5548:return $+e+be+G(e,"shrink","negative")+e;case 5292:return $+e+be+G(e,"basis","preferred-size")+e;case 6060:return $+"box-"+G(e,"-grow","")+$+e+be+G(e,"grow","positive")+e;case 4554:return $+G(e,/([^-])(transform)/g,"$1"+$+"$2")+e;case 6187:return G(G(G(e,/(zoom-|grab)/,$+"$1"),/(image-set)/,$+"$1"),e,"")+e;case 5495:case 3959:return G(e,/(image-set\([^]*)/,$+"$1$`$1");case 4968:return G(G(e,/(.+:)(flex-)?(.*)/,$+"box-pack:$3"+be+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$+e+e;case 4095:case 3583:case 4068:case 2532:return G(e,/(.+)-inline(.+)/,$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Je(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return G(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+Fn+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~No(e,"stretch")?lu(G(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,Je(e)-3-(~No(e,"!important")&&10))){case 107:return G(e,":",":"+$)+e;case 101:return G(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(pe(e,14)===45?"inline-":"")+"box$3$1"+$+"$2$3$1"+be+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+be+e+e}return e}var Yh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case zo:e.return=lu(e.value,e.length);break;case nu:return Lt([fr(e,{value:G(e.value,"@","@"+$)})],n);case Wo:if(e.length)return Dh(e.props,function(i){switch(Ph(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Lt([fr(e,{props:[G(i,/:(read-\w+)/,":"+Fn+"$1")]})],n);case"::placeholder":return Lt([fr(e,{props:[G(i,/:(plac\w+)/,":"+$+"input-$1")]}),fr(e,{props:[G(i,/:(plac\w+)/,":"+Fn+"$1")]}),fr(e,{props:[G(i,/:(plac\w+)/,be+"input-$1")]})],n)}return""})}},Xh=[Yh],Zh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(b){var A=b.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var n=e.stylisPlugins||Xh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(b){for(var A=b.getAttribute("data-emotion").split(" "),R=1;R<A.length;R++)i[A[R]]=!0;a.push(b)});var s,u=[zh,Qh];{var d,y=[Vh,$h(function(b){d.insert(b)})],h=Hh(u.concat(n,y)),p=function(b){return Lt(jh(b),h)};s=function(b,A,R,w){d=R,p(b?b+"{"+A.styles+"}":A.styles),w&&(f.inserted[A.name]=!0)}}var f={key:t,sheet:new Rh({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function em(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var tm={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},rm=/[A-Z]|^ms/g,nm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,uu=function(e){return e.charCodeAt(1)===45},Ll=function(e){return e!=null&&typeof e!="boolean"},wo=Gh(function(e){return uu(e)?e:e.replace(rm,"-$&").toLowerCase()}),Ul=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(nm,function(r,n,i){return lt={name:n,styles:i,next:lt},n})}return tm[e]!==1&&!uu(e)&&typeof t=="number"&&t!==0?t+"px":t};function jn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return lt={name:i.name,styles:i.styles,next:lt},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)lt={name:a.name,styles:a.styles,next:lt},a=a.next;var s=o.styles+";";return s}return im(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function im(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=jn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Ll(s)&&(n+=wo(o)+":"+Ul(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)Ll(a[u])&&(n+=wo(o)+":"+Ul(o,a[u])+";");else{var d=jn(e,t,a);switch(o){case"animation":case"animationName":{n+=wo(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Ml=/label:\s*([^\s;{]+)\s*(;|$)/g,lt;function Eo(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";lt=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=jn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=jn(r,t,e[s]),n){var u=o;i+=u[s]}Ml.lastIndex=0;for(var d="",y;(y=Ml.exec(i))!==null;)d+="-"+y[1];var h=em(i)+d;return{name:h,styles:i,next:lt}}function cu(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var om=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},am=function(e,t,r){om(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function Bl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Fl(e,t,r){var n=[],i=cu(e,n,r);return n.length<2?r:i+t(n)}var sm=function(e){var t=Zh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Eo(s,t.registered,void 0);return am(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Eo(s,t.registered),y="animation-"+d.name;return Bl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Eo(s,t.registered);Bl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return Fl(t.registered,r,lm(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:cu.bind(null,t.registered),merge:Fl.bind(null,t.registered,r)}},lm=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},um=sm({key:"css"}),Bt=um.css,Uo,Oe,Ao,jl,Jl=0,du=[],fe=B,Vl=fe.__b,Hl=fe.__r,$l=fe.diffed,Gl=fe.__c,ql=fe.unmount,Kl=fe.__;function cm(e,t){fe.__h&&fe.__h(Oe,e,Jl||t),Jl=0;var r=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function fu(e,t){var r=cm(Uo++,7);return hm(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function dm(){for(var e;e=du.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mn),e.__H.__h.forEach(Mo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Oe=null,Vl&&Vl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kl&&Kl(e,t)},fe.__r=function(e){Hl&&Hl(e),Uo=0;var t=(Oe=e.__c).__H;t&&(Ao===Oe?(t.__h=[],Oe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Mn),t.__h.forEach(Mo),t.__h=[],Uo=0)),Ao=Oe},fe.diffed=function(e){$l&&$l(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(du.push(t)!==1&&jl===fe.requestAnimationFrame||((jl=fe.requestAnimationFrame)||fm)(dm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ao=Oe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Mn),r.__h=r.__h.filter(function(n){return!n.__||Mo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),Gl&&Gl(e,t)},fe.unmount=function(e){ql&&ql(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Mn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Wl=typeof requestAnimationFrame=="function";function fm(e){var t,r=function(){clearTimeout(n),Wl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Wl&&(t=requestAnimationFrame(r))}function Mn(e){var t=Oe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Oe=t}function Mo(e){var t=Oe;e.__c=e.__(),Oe=t}function hm(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var mm=Symbol.for("preact-signals");function Kn(){if(ut>1)ut--;else{for(var e,t=!1;hr!==void 0;){var r=hr;for(hr=void 0,Bo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&mu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Bo=0,ut--,t)throw e}}function Re(e){if(ut>0)return e();ut++;try{return e()}finally{Kn()}}var Y=void 0,hr=void 0,ut=0,Bo=0,Jn=0;function hu(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=mm;ve.prototype.h=function(){return!0};ve.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};ve.prototype.subscribe=function(e){var t=this;return wr(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=hu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Bo>100)throw new Error("Cycle detected");this.v=e,this.i++,Jn++,ut++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kn()}}}});function X(e){return new ve(e)}function mu(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function pu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function vu(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Ft(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=Jn-1,this.f=4}(Ft.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Jn))return!0;if(this.g=Jn,this.f|=1,this.i>0&&!mu(this))return this.f&=-2,!0;var e=Y;try{pu(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,vu(this),this.f&=-2,!0};Ft.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ve.prototype.S.call(this,e)};Ft.prototype.U=function(e){if(this.t!==void 0&&(ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Ft.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Ft.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=hu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function mr(e){return new Ft(e)}function _u(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ut++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Yo(e),n}finally{Y=r,Kn()}}}function Yo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,_u(e)}function pm(e){if(Y!==this)throw new Error("Out-of-order effect");vu(this),Y=e,this.f&=-2,8&this.f&&Yo(this),Kn()}function br(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}br.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};br.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_u(this),pu(this),ut++;var e=Y;return Y=this,pm.bind(this,e)};br.prototype.N=function(){2&this.f||(this.f|=2,this.o=hr,hr=this)};br.prototype.d=function(){this.f|=8,1&this.f||Yo(this)};function wr(e){var t=new br(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var gu,Io,yu=[];wr(function(){gu=this.N})();function jt(e,t){B[e]=t.bind(null,B[e]||function(){})}function Vn(e){Io&&Io(),Io=e&&e.S()}function bu(e){var t=this,r=e.data,n=wu(r);n.value=r;var i=fu(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=mr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=mr(function(){return!Array.isArray(d.value)&&!ao(d.value)}),h=wr(function(){if(this.N=Eu,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}bu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:bu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});jt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof ve&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});jt("__r",function(e,t){Vn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return wr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Vn(r),e(t)});jt("__e",function(e,t,r,n){Vn(),e(t,r,n)});jt("diffed",function(e,t){Vn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=vm(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function vm(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=X(r);return{o:function(a,s){o.value=a,n=s},d:wr(function(){this.N=Eu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}jt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});jt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Te.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function wu(e){return fu(function(){return X(e)},[])}var _m=function(e){queueMicrotask(function(){queueMicrotask(e)})};function gm(){Re(function(){for(var e;e=yu.shift();)gu.call(e)})}function Eu(){yu.push(this)===1&&(B.requestAnimationFrame||_m)(gm)}var we=Bt`
|
|
1
|
+
var Hc=Object.create;var ci=Object.defineProperty,Vc=Object.defineProperties,$c=Object.getOwnPropertyDescriptor,qc=Object.getOwnPropertyDescriptors,Wc=Object.getOwnPropertyNames,xr=Object.getOwnPropertySymbols,Ca=Object.getPrototypeOf,di=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Kc=Reflect.get;var Sa=(e,t,r)=>t in e?ci(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))di.call(t,r)&&Sa(e,r,t[r]);if(xr)for(var r of xr(t))Ra.call(t,r)&&Sa(e,r,t[r]);return e},Oe=(e,t)=>Vc(e,qc(t));var Yt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Oa=(e,t)=>{var r={};for(var n in e)di.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xr)for(var n of xr(e))t.indexOf(n)<0&&Ra.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var fi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wc(t))!di.call(e,i)&&i!==r&&ci(e,i,{get:()=>t[i],enumerable:!(n=$c(t,i))||n.enumerable});return e};var hi=(e,t,r)=>(r=e!=null?Hc(Ca(e)):{},zc(t||!e||!e.__esModule?ci(r,"default",{value:e,enumerable:!0}):r,e));var ka=(e,t,r)=>Kc(Ca(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function id(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ma(e){return new Promise(t=>setTimeout(t,e))}function bi(e){return typeof e=="string"}function Ba(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ja(e){return typeof e=="object"&&Array.isArray(e)}function od(e){return typeof e=="undefined"}function ad(e){return od(e)||e===null}function sd(e){return typeof e=="function"}function Fa(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Ga(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:Pa(u)&&Pa(s)?i[a]=n(Da({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function Pa(e){return e&&typeof e=="object"&&e.constructor===Object}function ja(e,t){if(Array.isArray(e))return e.concat(t)}function tr(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),g=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!p&&d()},t),p)return d()};return g.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},g.flush=()=>{if(n)return clearTimeout(n),n=null,d()},g}function cd(e,t){return(...r)=>t(e,...r)}function qa(e){return t=>cd(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new ud(`${i}`))}})}function Xt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Pr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function vd(e){let t=e.location?Pr(e.location,Na):null,r=e.target?Pr(e.target,Na):null;return Pr(td(Da({},e),{location:t,target:r}),md)}function Ci(e){let t=e.events.map(n=>vd(n)),r=Pr(e.device,pd);return[e.protocolVersion,t,r,e.project]}function _d(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Rd(e){return new Promise(t=>za(e)(t))}function za(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Od(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new er(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Td(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)xd(e[n],t[n])}function xd(e,t){if(bi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(sd(t)){try{if(e instanceof t)return}catch(r){}if(!ad(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Pd(){return typeof globalThis!="undefined"?globalThis[Qa]:void 0}function Ld(e){typeof globalThis!="undefined"&&(globalThis[Qa]=e)}function _e(e=!1){let t=Pd();if(!e&&t)return t;let r=new Lr,n=new yi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Ld(i),i}var wi,Qc,Yc,Xc,Ta,Zc,ed,xa,Da,td,rd,Ua,nd,ld,Ei,Ii,Ha,Va,ud,$a,Nr,Dr,Ai,De,pi,dd,Si,La,fd,dt,Et,hd,Na,md,pd,it,bt,gd,Ee,yd,wd,bd,Wa,Ri,Oi,Ed,Id,Ka,vi,te,Ad,Sd,Zt,er,Fe,gi,Cd,mi,kd,ft,Lr,yi,Qa,j=Z(()=>{"use strict";wi=Object.defineProperty,Qc=Object.defineProperties,Yc=Object.getOwnPropertyDescriptor,Xc=Object.getOwnPropertyDescriptors,Ta=Object.getOwnPropertySymbols,Zc=Object.prototype.hasOwnProperty,ed=Object.prototype.propertyIsEnumerable,xa=(e,t,r)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Da=(e,t)=>{for(var r in t||(t={}))Zc.call(t,r)&&xa(e,r,t[r]);if(Ta)for(var r of Ta(t))ed.call(t,r)&&xa(e,r,t[r]);return e},td=(e,t)=>Qc(e,Xc(t)),rd=(e,t)=>{for(var r in t)wi(e,r,{get:t[r],enumerable:!0})},Ua=(e,t,r,n)=>{for(var i=n>1?void 0:n?Yc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&wi(t,r,i),i},nd=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}ld=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(ld||{}),Ei=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},Ii=class extends Ei{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ha=class extends Ei{constructor(){super(...arguments),this.kind="USER_ERROR"}},Va=class extends Ha{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ud=class extends Ha{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},$a=class extends Ii{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Nr=class extends Ii{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Dr=class extends Ei{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Ai=class extends Ii{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};De={log:Xt("log"),warn:Xt("warn"),info:Xt("info"),error:Xt("error"),debug:Xt("debug")};Object.assign(globalThis,{logger:De});pi=Symbol.for("Jolibox.canIUseMap"),dd={};globalThis[pi]||(globalThis[pi]=dd);Si={get config(){return globalThis[pi]}},La=Symbol.for("Jolibox.canIUseMap.native"),fd={};globalThis[La]||(globalThis[La]=fd);dt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(dt||{}),Et=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Et||{}),hd=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(hd||{}),Na=["name","params"],md=["name","type","location","target","extra","timestamp","userId"],pd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];it=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});_d();bt=typeof window=="undefined",gd=()=>!bt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ee={isiOS:!bt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:!bt&&navigator.userAgent.includes("Android"),isMac:!bt&&navigator.userAgent.includes("Mac"),isFacebook:!bt&&navigator.userAgent.includes("FB_IAB"),isPC:!bt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},yd=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",wd="device_id",bd="advertising_id",Wa=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,it()),window.__joliboxLocalStorage__.getItem(e)),Ri=()=>new URLSearchParams(window.location.search).get("deviceId")||Wa(wd),Oi=()=>new URLSearchParams(window.location.search).get("advertisingId")||Wa(bd),Ed=e=>e.charAt(0).toUpperCase()+e.slice(1),Id=()=>{var e;let t=new URLSearchParams(window.location.search);return Ed((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ka=e=>{if(gd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=yd(),n=navigator.language,i=Ri(),o=Oi();return`${t} (${Id()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},vi=class _i{constructor(t){this.element=t,this.next=_i.Undefined,this.prev=_i.Undefined}};vi.Undefined=new vi(void 0);te=vi,Ad=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Sd=0,Zt=class{constructor(e){this.value=e,this.id=Sd++}},er=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Zt(t);return this._listeners?this._listeners instanceof Zt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var g,h,p,f;if(!this._disposed){if(this._listeners instanceof Zt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||h.call(g));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Fe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new er,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Ad,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},gi={};rd(gi,{None:()=>Cd,filter:()=>Od,once:()=>za,toPromise:()=>Rd});Cd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});mi=Symbol.for("Jolibox.hostEmitter"),kd=()=>{let e=new Fe;return globalThis[mi]||(globalThis[mi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[mi]},ft=kd();Lr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new er,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Td(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Lr=Ua([Fa],Lr);yi=class{constructor(){this._onWillExecuteCommand=new er,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new er,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Lr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=id(3e4)),this._starActivation}executeCommand(e,...t){return nd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),gi.toPromise(gi.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};yi=Ua([Fa],yi);Qa=Symbol.for("Jolibox.commands")});function ke(e,t={}){ki.emit("ERROR_REPORT",{error:e,options:t})}var ki,ht,$e=Z(()=>{"use strict";j();j();ki=new Fe,ht=new Fe;ke.debounce=tr(ke,50,{leading:!0})});var Ti,Nd,Ya,Xa,Za=Z(()=>{"use strict";j();$e();Ti=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},Nd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ya=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Ti(o),payloadJson:Ti(a),signature:Ti(s)}}else throw"joli_source is missing"}catch(r){return ke(new $a(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Xa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Nd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Dd,Ur,es,xi=Z(()=>{"use strict";j();Dd="1.1.53-beta.0",Ur=()=>Dd,es=()=>{let e=Ur();return`${Ka(e)}`}});function Li(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Ud,ts,Pi,rs,ne,Md,L,me=Z(()=>{"use strict";j();Za();xi();j();Ud={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Ri(),adId:Oi(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Ur()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},Pi=(ts=globalThis.joliboxJSCore)==null?void 0:ts.env,ne=Object.assign({},(rs=Pi==null?void 0:Pi())!=null?rs:Ud);Md=()=>{var f,b,I,C,w,k,N,G,H,S,D;let{payloadJson:e,headerJson:t,signature:r}=ne.schema.length?Ya(ne.schema):{},n=`${ne.deviceInfo.did}-${new Date().getTime()}`,o=new URL(ne.schema.length?ne.schema:window.location.href).searchParams,a=(I=(b=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?b:o.get("gameId"))!=null?I:"",s=(k=(w=(C=ne.clientSessionId)!=null?C:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?k:n,u=!!((G=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?G:o.get("testAdsMode")==="true"),d=(D=(S=(H=e==null?void 0:e.joliboxEnv)!=null?H:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?D:"production",g=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var T;return(T=performance.timeOrigin)!=null?T:performance.timing.navigationStart},get testMode(){return g},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var T;return(T=o.get("joliSource"))!=null?T:null},get mpId(){var T;return(T=a!=null?a:e==null?void 0:e.id)!=null?T:""},get mpVersion(){var T;return(T=t==null?void 0:t.ver)!=null?T:Ur()},get mpType(){var T,M;return(M=(T=t==null?void 0:t.__mpType)!=null?T:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var T;return((T=ne.platform)!=null?T:ne.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ne.deviceInfo},get sdkInfo(){return ne.sdkInfo},get hostInfo(){return ne.hostInfo},get hostUserInfo(){return ne.hostUserInfo},get sessionId(){var T,M;return(M=(T=ne.clientSessionId)!=null?T:s)!=null?M:n},get channel(){return h},get webviewId(){var T;return(T=ne.webviewId)!=null?T:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return g?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var T;return(T=ne.deviceInfo.adId)!=null?T:ne.deviceInfo.did},get language(){return ne.deviceInfo.lang},get sdkEnvironment(){return Li("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Li("gamedistribution","jolibox")?"gamedistribution":Li("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var K,ee,he;let T=(K=ne.deviceInfo.pixelRatio)!=null?K:1,M=(ee=ne.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,W=(he=ne.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/T:20,navigationBarHeight:W!==void 0?W/T:10}},get abTests(){var T,M;return(M=(T=ne.abValues)==null?void 0:T.split(","))!=null?M:[]},onEnvConfigChanged:T=>{Ga(ne,T,ja)},encodeJoliSourceQuery:T=>{var M,W;return t&&r?Xa(Q(Q({},e),T),(M=o.get("joliSource"))!=null?M:""):(W=o.get("joliSource"))!=null?W:""},setDoExitDirectly:()=>{p=!1}}},L=Md()});var Ni,is,Bd,Jd,ns,Fd,os=Z(()=>{"use strict";j();$e();me();j();Ni=!1,is=(e,t)=>e==null?!1:t in e,Bd=e=>is(e,"kind"),Jd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},ns=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=L.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Jd(e.name)},i=Oe(Q({},n),{env:t.environment,isFromUser:r});r?ht.emit("GLOBAL_USER_ERROR",e,i):ht.emit("GLOBAL_ERROR",e,i)},Fd=e=>is(e,"kind")&&e.kind==="USER_ERROR";ki.on("ERROR_REPORT",({error:e,options:t})=>{if(Ni)return;Ni=!0;let r=Bd(e)&&e.raw?e.raw:e;try{let n=Fd(e);ns(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Ai(`${i}, origin error: ${r.message}`);De.error(o),ns(new Ai(o.message),{environment:t.environment},!1)}finally{Ni=!1}})});var Di,Ui=Z(()=>{"use strict";$e();j();$e();Di=e=>new Va(e)});function as(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Oa(d,["eventType"]),u=Oe(Q({tag:n,eventType:o!=null?o:a!=null?a:dt.Other},t),{extra:Q({},s)});n=="globalJsError"?ke(new Nr(JSON.stringify(u))):e("systemLog",u,L.webviewId)};return r.debounce=tr(r,500,{leading:!0}),r}function ss(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=tr(t,500,{leading:!0}),t}var ls=Z(()=>{"use strict";j();j();$e();me()});function us(e,t){let r=as(e,t),n=ss(r);return{track:r,trackPerformance:n}}var cs=Z(()=>{"use strict";ls()});var Mi=Z(()=>{"use strict"});var Mr,ds=Z(()=>{"use strict";me();j();j();Mr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${L.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=L.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=L.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=L.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:L.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Oe(Q({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(Ci(d),n):yield this.doReport(Ci(d))}catch(g){De.log("[Jolibox SDK] report API error",g)}})}}});var Bi=Z(()=>{"use strict";cs();Mi();ds()});var Ji,fs,qe,Br,Be,It=Z(()=>{"use strict";xi();me();j();Ji=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(fs=AbortSignal.timeout)!=null||(AbortSignal.timeout=Ji);qe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Br(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Br=class{constructor(t){this.xua=es();this.getJoliSource=()=>L.joliSource;var n;let r=L.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,g=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},g?{"x-joli-source":g}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:Ji(i!=null?i:3e4)});return qe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,g=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},g?{"x-user-agent":g}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Ji(o!=null?o:3e4),credentials:"include"});qe.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,g=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},g?{"x-user-agent":g}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Br;Be=qe.getInstance()});var Fi,Jr,Gi=Z(()=>{"use strict";me();Bi();It();Fi=class extends Mr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=L.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Jr=new Fi});var Gd,hs=Z(()=>{"use strict";os();j();Ui();j();Gi();me();Gd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:dt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Jr.trackEvent(n,Et.WebSDK)};ht.on("GLOBAL_ERROR",(e,t)=>{Gd(t.tag,e)});ht.on("GLOBAL_USER_ERROR",(e,t)=>{De.log("UserError",e,t)})});var Fr,ms=Z(()=>{"use strict";Fr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),b=f-r;b>=this.interval&&(this.visible&&(a+=Math.min(b,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{g(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},g=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let p=this.visible;return{start(){o||(o=!0,p?d():u())},stop(){o=!1,g(),h()}}}}});var Gr,ps=Z(()=>{"use strict";me();ms();It();Gr=class extends Fr{constructor(r,n,i){super(n,i);this.httpClient=Be.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var vs,jd,Ue,Hd,ji,We,ot=Z(()=>{"use strict";hs();j();j();Bi();Gi();ps();me();Mi();vs=_e(),jd={type:Et.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:Ue,trackPerformance:Hd}=us((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=Ba(r.extra)?r.extra:bi(r.extra)?JSON.parse(r.extra):{},i=Oe(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:dt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=L.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Jr.trackEvent(o,Et.WebSDK)},jd);vs.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Hd(e,t,r)});vs.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Ue(e,t)});ji=new Fe,We=new Gr(Ue,ji)});function _s(e){let t=Si.config[e];return t||(t={},Si.config[e]=t),(r,n)=>{if(t[r]){De.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var gs=Z(()=>{"use strict";j()});function Hi(e){ys=e}function jr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>jr(t)):Object.keys(e).reduce((t,r)=>(t[r]=jr(e[r]),t),{})}function Ke(e){return typeof e=="number"}function Vi(e){let t=$i(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function $i(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var ys,ce,Hr,Vr,$r,qr,At,Wr,Kr,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,on,qi=Z(()=>{"use strict";ys=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(ys)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${Vi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return jr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:jr(this._default)}optional(){return this._optional=!0,this}};Hr=class extends ce{validate(t){return this._optional&&t===void 0?!0:Ke(t)?Ke(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ke(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ke(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Vr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},$r=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ke(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ke(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},At=class extends ce{validate(t){return!0}},Wr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Kr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},zr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Qr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${Vi(t)}`)}return!0}},Yr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Ke(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ke(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ke(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Xr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if($i(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Zr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if($i(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},en=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Vi(this.value),actual:r}):!0}},tn=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
|
|
2
|
+
or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},nn=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},on=class extends ce{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function Wi(e,t,r="param"){if(e.errors=[],e.path=r,Hi(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,Hi(!1),new TypeError(n)}}var J,Ki=Z(()=>{"use strict";qi();qi();J={object(e){return new Zr(e)},array(e){return new Yr(e)},tuple(...e){return new rn(...e)},literal(e){return new en(e)},or(...e){return new tn(...e)},symbol(){return new qr},record(e){return new Xr(e)},function(){return new zr},boolean(){return new Vr},string(){return new $r},number(){return new Hr},undefined(){return new Wr},null(){return new Kr},unknown(){return new At},any(){return new At},as(){return new At},arraybuffer(){return new nn},enum(...e){return new Qr(...e)},typedarray(e){return new on(e)}}});var an,ws,bs=Z(()=>{"use strict";j();$e();Ki();Ui();an=1,ws=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:an};an+=1;let u="SUCCESS",d=`${n}:ok`,g=0;try{if(i.paramsSchema)try{Wi(i.paramsSchema,o,"params")}catch(k){throw Di(`${n}:fail ${k.message}`)}let I=i.implement(...o),C=I,w=`${n}:ok`;if(I&&"code"in I){let{code:k,data:N,message:G}=I;u=k,C=N,w=G}return{code:u,message:w,data:C}}catch(I){let C=I;g=(p=(h=C.code)!=null?h:C.errNo)!=null?p:2e3,u="FAILURE";let w=(b=(f=C.message)!=null?f:C.errMsg)!=null?b:`${I}`;return d=`${n}:${u} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new Dr(d,g)),{code:u,message:d}}finally{let I=Date.now()-a}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,I;let a=Ja(o)?o:[o],s=Date.now(),u={method:n,trace_id:an};an+=1;let d=`${n}:ok`,g="SUCCESS",h={code:g,message:d};try{if(i.paramsSchema)try{Wi(i.paramsSchema,a,"params")}catch(k){throw Di(k.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:k,data:N,message:G}=w;g=k,d=G,w=N}return Object.assign(h,{code:g,message:d,data:w}),h}catch(C){let w=C,k=(f=(p=w.code)!=null?p:w.errNo)!=null?f:2e3;g="FAILURE";let N=(I=(b=w.message)!=null?b:w.errMsg)!=null?I:`${C}`,G=`${n}:${g} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:g,message:G}),ke(new Dr(G,k)),h}finally{let C=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var ze,mt,ge,rr=Z(()=>{"use strict";gs();ot();bs();Ki();({createAPI:ze,createSyncAPI:mt}=ws(Ue)),ge=_s("h5")});var Ss=fi((As,Xi)=>{(function(e){if(typeof As=="object"&&typeof Xi!="undefined")Xi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(g,h){if(!o[g]){if(!i[g]){var p=typeof Yt=="function"&&Yt;if(!h&&p)return p(g,!0);if(u)return u(g,!0);var f=new Error("Cannot find module '"+g+"'");throw f.code="MODULE_NOT_FOUND",f}var b=o[g]={exports:{}};i[g][0].call(b.exports,function(I){var C=i[g][1][I];return s(C||I)},b,b.exports,n,i,o,a)}return o[g].exports}for(var u=typeof Yt=="function"&&Yt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,g=new s(I),h=a.document.createTextNode("");g.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=I,u=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var w=a.document.createElement("script");w.onreadystatechange=function(){I(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},a.document.documentElement.appendChild(w)}:u=function(){setTimeout(I,0)};var f,b=[];function I(){f=!0;for(var w,k,N=b.length;N;){for(k=b,b=[],w=-1;++w<N;)k[w]();N=b.length}f=!1}i.exports=C;function C(w){b.push(w)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],g=["FULFILLED"],h=["PENDING"];i.exports=p;function p(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,S!==s&&C(this,S)}p.prototype.catch=function(S){return this.then(null,S)},p.prototype.then=function(S,D){if(typeof S!="function"&&this.state===g||typeof D!="function"&&this.state===d)return this;var T=new this.constructor(s);if(this.state!==h){var M=this.state===g?S:D;b(T,M,this.outcome)}else this.queue.push(new f(T,S,D));return T};function f(S,D,T){this.promise=S,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){u.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,D,T){a(function(){var M;try{M=D(T)}catch(W){return u.reject(S,W)}M===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,M)})}u.resolve=function(S,D){var T=w(I,D);if(T.status==="error")return u.reject(S,T.value);var M=T.value;if(M)C(S,M);else{S.state=g,S.outcome=D;for(var W=-1,K=S.queue.length;++W<K;)S.queue[W].callFulfilled(D)}return S},u.reject=function(S,D){S.state=d,S.outcome=D;for(var T=-1,M=S.queue.length;++T<M;)S.queue[T].callRejected(D);return S};function I(S){var D=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof D=="function")return function(){D.apply(S,arguments)}}function C(S,D){var T=!1;function M(he){T||(T=!0,u.reject(S,he))}function W(he){T||(T=!0,u.resolve(S,he))}function K(){D(W,M)}var ee=w(K);ee.status==="error"&&M(ee.value)}function w(S,D){var T={};try{T.value=S(D),T.status="success"}catch(M){T.status="error",T.value=M}return T}p.resolve=k;function k(S){return S instanceof this?S:u.resolve(new this(s),S)}p.reject=N;function N(S){var D=new this(s);return u.reject(D,S)}p.all=G;function G(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var W=new Array(T),K=0,ee=-1,he=new this(s);++ee<T;)He(S[ee],ee);return he;function He(Kt,Or){D.resolve(Kt).then(ei,function(yt){M||(M=!0,u.reject(he,yt))});function ei(yt){W[Or]=yt,++K===T&&!M&&(M=!0,u.resolve(he,W))}}}p.race=H;function H(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var W=-1,K=new this(s);++W<T;)ee(S[W]);return K;function ee(he){D.resolve(he).then(function(He){M||(M=!0,u.resolve(K,He))},function(He){M||(M=!0,u.reject(K,He))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,m){if(!(l instanceof m))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function g(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,m){l=l||[],m=m||{};try{return new Blob(l,m)}catch(v){if(v.name!=="TypeError")throw v;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,y=0;y<l.length;y+=1)_.append(l[y]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(l,m){m&&l.then(function(c){m(null,c)},function(c){m(c)})}function b(l,m,c){typeof m=="function"&&l.then(m),typeof c=="function"&&l.catch(c)}function I(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",k=void 0,N={},G=Object.prototype.toString,H="readonly",S="readwrite";function D(l){for(var m=l.length,c=new ArrayBuffer(m),_=new Uint8Array(c),y=0;y<m;y++)_[y]=l.charCodeAt(y);return c}function T(l){return new p(function(m){var c=l.transaction(w,S),_=h([""]);c.objectStore(w).put(_,"key"),c.onabort=function(y){y.preventDefault(),y.stopPropagation(),m(!1)},c.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function M(l){return typeof k=="boolean"?p.resolve(k):T(l).then(function(m){return k=m,k})}function W(l){var m=N[l.name],c={};c.promise=new p(function(_,y){c.resolve=_,c.reject=y}),m.deferredOperations.push(c),m.dbReady?m.dbReady=m.dbReady.then(function(){return c.promise}):m.dbReady=c.promise}function K(l){var m=N[l.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(l,m){var c=N[l.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(l,m){return new p(function(c,_){if(N[l.name]=N[l.name]||oa(),l.db)if(m)W(l),l.db.close();else return c(l.db);var y=[l.name];m&&y.push(l.version);var v=d.open.apply(d,y);m&&(v.onupgradeneeded=function(E){var A=v.result;try{A.createObjectStore(l.storeName),E.oldVersion<=1&&A.createObjectStore(w)}catch(R){if(R.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw R}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(A){A.target.close()},c(E),K(l)}})}function He(l){return he(l,!1)}function Kt(l){return he(l,!0)}function Or(l,m){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,y=l.version>l.db.version;if(_&&(l.version!==m&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),y||c){if(c){var v=l.db.version+1;v>l.version&&(l.version=v)}return!0}return!1}function ei(l){return new p(function(m,c){var _=new FileReader;_.onerror=c,_.onloadend=function(y){var v=btoa(y.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:l.type})},_.readAsBinaryString(l)})}function yt(l){var m=D(atob(l.data));return h([m],{type:l.type})}function ia(l){return l&&l.__local_forage_encoded_blob}function Vu(l){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,l,l),c}function $u(l){W(l);for(var m=N[l.name],c=m.forages,_=0;_<c.length;_++){var y=c[_];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return l.db=null,He(l).then(function(v){return l.db=v,Or(l)?Kt(l):v}).then(function(v){l.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(l,v),v})}function Ve(l,m,c,_){_===void 0&&(_=1);try{var y=l.db.transaction(l.storeName,m);c(null,y)}catch(v){if(_>0&&(!l.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!l.db||v.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Kt(l)}).then(function(){return $u(l).then(function(){Ve(l,m,c,_-1)})}).catch(c);c(v)}}function oa(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function qu(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var y=N[c.name];y||(y=oa(),N[c.name]=y),y.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Vu);var v=[];function E(){return p.resolve()}for(var A=0;A<y.forages.length;A++){var R=y.forages[A];R!==m&&v.push(R._initReady().catch(E))}var O=y.forages.slice(0);return p.all(v).then(function(){return c.db=y.db,He(c)}).then(function(x){return c.db=x,Or(c,m._defaultConfig.version)?Kt(c):x}).then(function(x){c.db=y.db=x,m._dbInfo=c;for(var U=0;U<O.length;U++){var F=O[U];F!==m&&(F._dbInfo.db=c.db,F._dbInfo.version=c.version)}})}function Wu(l,m){var c=this;l=I(l);var _=new p(function(y,v){c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.get(l);O.onsuccess=function(){var x=O.result;x===void 0&&(x=null),ia(x)&&(x=yt(x)),y(x)},O.onerror=function(){v(O.error)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Ku(l,m){var c=this,_=new p(function(y,v){c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.openCursor(),x=1;O.onsuccess=function(){var U=O.result;if(U){var F=U.value;ia(F)&&(F=yt(F));var q=l(F,U.key,x++);q!==void 0?y(q):U.continue()}else y()},O.onerror=function(){v(O.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function zu(l,m,c){var _=this;l=I(l);var y=new p(function(v,E){var A;_.ready().then(function(){return A=_._dbInfo,G.call(m)==="[object Blob]"?M(A.db).then(function(R){return R?m:ei(m)}):m}).then(function(R){Ve(_._dbInfo,S,function(O,x){if(O)return E(O);try{var U=x.objectStore(_._dbInfo.storeName);R===null&&(R=void 0);var F=U.put(R,l);x.oncomplete=function(){R===void 0&&(R=null),v(R)},x.onabort=x.onerror=function(){var q=F.error?F.error:F.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(y,c),y}function Qu(l,m){var c=this;l=I(l);var _=new p(function(y,v){c.ready().then(function(){Ve(c._dbInfo,S,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.delete(l);A.oncomplete=function(){y()},A.onerror=function(){v(O.error)},A.onabort=function(){var x=O.error?O.error:O.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Yu(l){var m=this,c=new p(function(_,y){m.ready().then(function(){Ve(m._dbInfo,S,function(v,E){if(v)return y(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var O=R.error?R.error:R.transaction.error;y(O)}}catch(O){y(O)}})}).catch(y)});return f(c,l),c}function Xu(l){var m=this,c=new p(function(_,y){m.ready().then(function(){Ve(m._dbInfo,H,function(v,E){if(v)return y(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.count();R.onsuccess=function(){_(R.result)},R.onerror=function(){y(R.error)}}catch(O){y(O)}})}).catch(y)});return f(c,l),c}function Zu(l,m){var c=this,_=new p(function(y,v){if(l<0){y(null);return}c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=!1,x=R.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){y(null);return}l===0||O?y(U.key):(O=!0,U.advance(l))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function ec(l){var m=this,c=new p(function(_,y){m.ready().then(function(){Ve(m._dbInfo,H,function(v,E){if(v)return y(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.openKeyCursor(),O=[];R.onsuccess=function(){var x=R.result;if(!x){_(O);return}O.push(x.key),x.continue()},R.onerror=function(){y(R.error)}}catch(x){y(x)}})}).catch(y)});return f(c,l),c}function tc(l,m){m=C.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,y;if(!l.name)y=p.reject("Invalid arguments");else{var v=l.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(l).then(function(A){var R=N[l.name],O=R.forages;R.db=A;for(var x=0;x<O.length;x++)O[x]._dbInfo.db=A;return A});l.storeName?y=E.then(function(A){if(A.objectStoreNames.contains(l.storeName)){var R=A.version+1;W(l);var O=N[l.name],x=O.forages;A.close();for(var U=0;U<x.length;U++){var F=x[U];F._dbInfo.db=null,F._dbInfo.version=R}var q=new p(function(z,ue){var oe=d.open(l.name,R);oe.onerror=function(Ne){var Qt=oe.result;Qt.close(),ue(Ne)},oe.onupgradeneeded=function(){var Ne=oe.result;Ne.deleteObjectStore(l.storeName)},oe.onsuccess=function(){var Ne=oe.result;Ne.close(),z(Ne)}});return q.then(function(z){O.db=z;for(var ue=0;ue<x.length;ue++){var oe=x[ue];oe._dbInfo.db=z,K(oe._dbInfo)}}).catch(function(z){throw(ee(l,z)||p.resolve()).catch(function(){}),z})}}):y=E.then(function(A){W(l);var R=N[l.name],O=R.forages;A.close();for(var x=0;x<O.length;x++){var U=O[x];U._dbInfo.db=null}var F=new p(function(q,z){var ue=d.deleteDatabase(l.name);ue.onerror=function(){var oe=ue.result;oe&&oe.close(),z(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},ue.onsuccess=function(){var oe=ue.result;oe&&oe.close(),q(oe)}});return F.then(function(q){R.db=q;for(var z=0;z<O.length;z++){var ue=O[z];K(ue._dbInfo)}}).catch(function(q){throw(ee(l,q)||p.resolve()).catch(function(){}),q})})}return f(y,m),y}var rc={_driver:"asyncStorage",_initStorage:qu,_support:g(),iterate:Ku,getItem:Wu,setItem:zu,removeItem:Qu,clear:Yu,length:Xu,key:Zu,keys:ec,dropInstance:tc};function nc(){return typeof openDatabase=="function"}var rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ic="~~local_forage_type~",aa=/^~~local_forage_type~([^~]+)~/,kr="__lfsc__:",ti=kr.length,ri="arbf",ni="blob",sa="si08",la="ui08",ua="uic8",ca="si16",da="si32",fa="ur16",ha="ui32",ma="fl32",pa="fl64",va=ti+ri.length,_a=Object.prototype.toString;function ga(l){var m=l.length*.75,c=l.length,_,y=0,v,E,A,R;l[l.length-1]==="="&&(m--,l[l.length-2]==="="&&m--);var O=new ArrayBuffer(m),x=new Uint8Array(O);for(_=0;_<c;_+=4)v=rt.indexOf(l[_]),E=rt.indexOf(l[_+1]),A=rt.indexOf(l[_+2]),R=rt.indexOf(l[_+3]),x[y++]=v<<2|E>>4,x[y++]=(E&15)<<4|A>>2,x[y++]=(A&3)<<6|R&63;return O}function ii(l){var m=new Uint8Array(l),c="",_;for(_=0;_<m.length;_+=3)c+=rt[m[_]>>2],c+=rt[(m[_]&3)<<4|m[_+1]>>4],c+=rt[(m[_+1]&15)<<2|m[_+2]>>6],c+=rt[m[_+2]&63];return m.length%3===2?c=c.substring(0,c.length-1)+"=":m.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function oc(l,m){var c="";if(l&&(c=_a.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&_a.call(l.buffer)==="[object ArrayBuffer]")){var _,y=kr;l instanceof ArrayBuffer?(_=l,y+=ri):(_=l.buffer,c==="[object Int8Array]"?y+=sa:c==="[object Uint8Array]"?y+=la:c==="[object Uint8ClampedArray]"?y+=ua:c==="[object Int16Array]"?y+=ca:c==="[object Uint16Array]"?y+=fa:c==="[object Int32Array]"?y+=da:c==="[object Uint32Array]"?y+=ha:c==="[object Float32Array]"?y+=ma:c==="[object Float64Array]"?y+=pa:m(new Error("Failed to get type for BinaryArray"))),m(y+ii(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=ic+l.type+"~"+ii(this.result);m(kr+ni+E)},v.readAsArrayBuffer(l)}else try{m(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),m(null,E)}}function ac(l){if(l.substring(0,ti)!==kr)return JSON.parse(l);var m=l.substring(va),c=l.substring(ti,va),_;if(c===ni&&aa.test(m)){var y=m.match(aa);_=y[1],m=m.substring(y[0].length)}var v=ga(m);switch(c){case ri:return v;case ni:return h([v],{type:_});case sa:return new Int8Array(v);case la:return new Uint8Array(v);case ua:return new Uint8ClampedArray(v);case ca:return new Int16Array(v);case fa:return new Uint16Array(v);case da:return new Int32Array(v);case ha:return new Uint32Array(v);case ma:return new Float32Array(v);case pa:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var oi={serialize:oc,deserialize:ac,stringToBuffer:ga,bufferToString:ii};function ya(l,m,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function sc(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var y=new p(function(v,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(A){return E(A)}c.db.transaction(function(A){ya(A,c,function(){m._dbInfo=c,v()},function(R,O){E(O)})},E)});return c.serializer=oi,y}function nt(l,m,c,_,y,v){l.executeSql(c,_,y,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(R,O){O.rows.length?v(R,A):ya(R,m,function(){R.executeSql(c,_,y,v)},v)},v):v(E,A)},v)}function lc(l,m){var c=this;l=I(l);var _=new p(function(y,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(R,O){var x=O.rows.length?O.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),y(x)},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function uc(l,m){var c=this,_=new p(function(y,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT * FROM "+E.storeName,[],function(R,O){for(var x=O.rows,U=x.length,F=0;F<U;F++){var q=x.item(F),z=q.value;if(z&&(z=E.serializer.deserialize(z)),z=l(z,q.key,F+1),z!==void 0){y(z);return}}y()},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function wa(l,m,c,_){var y=this;l=I(l);var v=new p(function(E,A){y.ready().then(function(){m===void 0&&(m=null);var R=m,O=y._dbInfo;O.serializer.serialize(m,function(x,U){U?A(U):O.db.transaction(function(F){nt(F,O,"INSERT OR REPLACE INTO "+O.storeName+" (key, value) VALUES (?, ?)",[l,x],function(){E(R)},function(q,z){A(z)})},function(F){if(F.code===F.QUOTA_ERR){if(_>0){E(wa.apply(y,[l,R,c,_-1]));return}A(F)}})})}).catch(A)});return f(v,c),v}function cc(l,m,c){return wa.apply(this,[l,m,c,1])}function dc(l,m){var c=this;l=I(l);var _=new p(function(y,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){y()},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function fc(l){var m=this,c=new p(function(_,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(A,R){y(R)})})}).catch(y)});return f(c,l),c}function hc(l){var m=this,c=new p(function(_,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(A,R){var O=R.rows.item(0).c;_(O)},function(A,R){y(R)})})}).catch(y)});return f(c,l),c}function mc(l,m){var c=this,_=new p(function(y,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(R,O){var x=O.rows.length?O.rows.item(0).key:null;y(x)},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function pc(l){var m=this,c=new p(function(_,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT key FROM "+v.storeName,[],function(A,R){for(var O=[],x=0;x<R.rows.length;x++)O.push(R.rows.item(x).key);_(O)},function(A,R){y(R)})})}).catch(y)});return f(c,l),c}function vc(l){return new p(function(m,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,v){for(var E=[],A=0;A<v.rows.length;A++)E.push(v.rows.item(A).name);m({db:l,storeNames:E})},function(y,v){c(v)})},function(_){c(_)})})}function _c(l,m){m=C.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,y;return l.name?y=new p(function(v){var E;l.name===c.name?E=_._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?v({db:E,storeNames:[l.storeName]}):v(vc(E))}).then(function(v){return new p(function(E,A){v.db.transaction(function(R){function O(q){return new p(function(z,ue){R.executeSql("DROP TABLE IF EXISTS "+q,[],function(){z()},function(oe,Ne){ue(Ne)})})}for(var x=[],U=0,F=v.storeNames.length;U<F;U++)x.push(O(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(q){A(q)})},function(R){A(R)})})}):y=p.reject("Invalid arguments"),f(y,m),y}var gc={_driver:"webSQLStorage",_initStorage:sc,_support:nc(),iterate:uc,getItem:lc,setItem:cc,removeItem:dc,clear:fc,length:hc,key:mc,keys:pc,dropInstance:_c};function yc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function ba(l,m){var c=l.name+"/";return l.storeName!==m.storeName&&(c+=l.storeName+"/"),c}function wc(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(m){return!0}}function bc(){return!wc()||localStorage.length>0}function Ec(l){var m=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=ba(l,m._defaultConfig),bc()?(m._dbInfo=c,c.serializer=oi,p.resolve()):p.reject()}function Ic(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var v=localStorage.key(y);v.indexOf(_)===0&&localStorage.removeItem(v)}});return f(c,l),c}function Ac(l,m){var c=this;l=I(l);var _=c.ready().then(function(){var y=c._dbInfo,v=localStorage.getItem(y.keyPrefix+l);return v&&(v=y.serializer.deserialize(v)),v});return f(_,m),_}function Sc(l,m){var c=this,_=c.ready().then(function(){for(var y=c._dbInfo,v=y.keyPrefix,E=v.length,A=localStorage.length,R=1,O=0;O<A;O++){var x=localStorage.key(O);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=y.serializer.deserialize(U)),U=l(U,x.substring(E),R++),U!==void 0)return U}}});return f(_,m),_}function Cc(l,m){var c=this,_=c.ready().then(function(){var y=c._dbInfo,v;try{v=localStorage.key(l)}catch(E){v=null}return v&&(v=v.substring(y.keyPrefix.length)),v});return f(_,m),_}function Rc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo,y=localStorage.length,v=[],E=0;E<y;E++){var A=localStorage.key(E);A.indexOf(_.keyPrefix)===0&&v.push(A.substring(_.keyPrefix.length))}return v});return f(c,l),c}function Oc(l){var m=this,c=m.keys().then(function(_){return _.length});return f(c,l),c}function kc(l,m){var c=this;l=I(l);var _=c.ready().then(function(){var y=c._dbInfo;localStorage.removeItem(y.keyPrefix+l)});return f(_,m),_}function Tc(l,m,c){var _=this;l=I(l);var y=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,A){var R=_._dbInfo;R.serializer.serialize(m,function(O,x){if(x)A(x);else try{localStorage.setItem(R.keyPrefix+l,O),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(U),A(U)}})})});return f(y,c),y}function xc(l,m){if(m=C.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,y;return l.name?y=new p(function(v){l.storeName?v(ba(l,_._defaultConfig)):v(l.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(v)===0&&localStorage.removeItem(A)}}):y=p.reject("Invalid arguments"),f(y,m),y}var Pc={_driver:"localStorageWrapper",_initStorage:Ec,_support:yc(),iterate:Sc,getItem:Ac,setItem:Tc,removeItem:kc,clear:Ic,length:Oc,key:Cc,keys:Rc,dropInstance:xc},Lc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Nc=function(m,c){for(var _=m.length,y=0;y<_;){if(Lc(m[y],c))return!0;y++}return!1},Ea=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},zt={},Ia={},wt={INDEXEDDB:rc,WEBSQL:gc,LOCALSTORAGE:Pc},Dc=[wt.INDEXEDDB._driver,wt.WEBSQL._driver,wt.LOCALSTORAGE._driver],Tr=["dropInstance"],ai=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Tr),Uc={description:"",driver:Dc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mc(l,m){l[m]=function(){var c=arguments;return l.ready().then(function(){return l[m].apply(l,c)})}}function si(){for(var l=1;l<arguments.length;l++){var m=arguments[l];if(m)for(var c in m)m.hasOwnProperty(c)&&(Ea(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Bc=function(){function l(m){s(this,l);for(var c in wt)if(wt.hasOwnProperty(c)){var _=wt[c],y=_._driver;this[c]=y,zt[y]||this.defineDriver(_)}this._defaultConfig=si({},Uc),this._config=si({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,y){var v=new p(function(E,A){try{var R=c._driver,O=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){A(O);return}for(var x=ai.concat("_initStorage"),U=0,F=x.length;U<F;U++){var q=x[U],z=!Nc(Tr,q);if((z||c[q])&&typeof c[q]!="function"){A(O);return}}var ue=function(){for(var Qt=function(Gc){return function(){var jc=new Error("Method "+Gc+" is not implemented by the current driver"),Aa=p.reject(jc);return f(Aa,arguments[arguments.length-1]),Aa}},li=0,Fc=Tr.length;li<Fc;li++){var ui=Tr[li];c[ui]||(c[ui]=Qt(ui))}};ue();var oe=function(Qt){zt[R]&&console.info("Redefining LocalForage driver: "+R),zt[R]=c,Ia[R]=Qt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(oe,A):oe(!!c._support):oe(!0)}catch(Ne){A(Ne)}});return b(v,_,y),v},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,y){var v=zt[c]?p.resolve(zt[c]):p.reject(new Error("Driver not found."));return b(v,_,y),v},l.prototype.getSerializer=function(c){var _=p.resolve(oi);return b(_,c),_},l.prototype.ready=function(c){var _=this,y=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(y,c,c),y},l.prototype.setDriver=function(c,_,y){var v=this;Ea(c)||(c=[c]);var E=this._getSupportedDrivers(c);function A(){v._config.driver=v.driver()}function R(U){return v._extend(U),A(),v._ready=v._initStorage(v._config),v._ready}function O(U){return function(){var F=0;function q(){for(;F<U.length;){var z=U[F];return F++,v._dbInfo=null,v._ready=null,v.getDriver(z).then(R).catch(q)}A();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return q()}}var x=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=x.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(F){v._driver=F._driver,A(),v._wrapLibraryMethodsWithReady(),v._initDriver=O(E)})}).catch(function(){A();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,_,y),this._driverSet},l.prototype.supports=function(c){return!!Ia[c]},l.prototype._extend=function(c){si(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],y=0,v=c.length;y<v;y++){var E=c[y];this.supports(E)&&_.push(E)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=ai.length;c<_;c++)Mc(this,ai[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),Jc=new Bc;i.exports=Jc},{3:3}]},{},[4])(4)})});var Rs=fi(dn=>{"use strict";j();rr();ot();var eo=_e(),lf=ze("levelFinished",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),duration:J.number().optional(),rating:J.number().optional(),score:J.number().optional(),variation:J.string().optional()})),implement:e=>P(dn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;De.info("onLevelFinished",r,n,i,o),yield Promise.all([We.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),We.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),uf=ze("gamePlayEnded",{paramsSchema:J.tuple(J.object({duration:J.number().optional(),rating:J.number().optional(),score:J.number(),variation:J.string().optional()})),implement:e=>P(dn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;De.info("onGamePlayEnded",t,r,n,i),yield Promise.all([We.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),We.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),cf=ze("levelUpgrade",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),name:J.string().optional()})),implement:r=>P(dn,[r],function*({levelId:e,name:t}){yield Promise.all([We.tracker("LevelUpgrade",{name:t,levelId:e}),We.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});eo.registerCommand("TaskTrackerSDK.levelFinished",lf);eo.registerCommand("TaskTrackerSDK.gamePlayEnded",uf);eo.registerCommand("TaskTrackerSDK.levelUpgrade",cf);ge("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,St,Os,to,df,fn,ro=Z(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},St=new Map,Os=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=St.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},to=!1,df=()=>{to||(window.addEventListener("message",Os),to=!0)},fn=(e,t)=>{df(),St.has(e)||St.set(e,new Set);let r=St.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&St.delete(e),St.size===0&&(window.removeEventListener("message",Os),to=!1)}}});var hn,mn,pn,vn,_n,ks,gn,yn,Ct,ff,ae,Rt,Ot,Me=Z(()=>{"use strict";j();hn="UNLOCK_OPTIONS_CHANGED",mn="INVOKE_PAYMENT",pn="ON_PAYMENT_RESULT",vn="ON_USE_MODAL_EVENT",_n="ON_USE_MODAL_RESULT",ks="ON_USE_MODAL_FREQUENCY",gn="ON_USE_UNLOGIN_MODAL_EVENT",yn="INVOKE_UNLOGIN_MODAL_EVENT",Ct=new Fe,ff=()=>({on:Ct.on.bind(Ct),off:Ct.off.bind(Ct),emit:Ct.emit.bind(Ct)}),ae=ff(),Rt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Ot={show:!0,minInterval:8*60*60*1e3}});var Cu=fi(Zo=>{"use strict";me();Me();ro();j();var Su={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};fn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Su[e.result],e.result),ae.emit(_n,{useModalResult:Su[e.result]})});ae.on(vn,(e,t)=>{var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:it()})});fn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(pn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});ae.on(mn,(e,t)=>P(Zo,null,function*(){var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:it()})}));fn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(gn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}),e.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(yn,e=>P(Zo,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:it(),type:e})}))});ot();me();rr();j();var Es=_e(),$d="env",qd="getSystemInfoSync",Wd=()=>{var i,o,a,s;let e={system:L.deviceInfo.system,platform:L.deviceInfo.platform.toLowerCase(),brand:L.deviceInfo.brand,pixelRatio:L.deviceInfo.pixelRatio,language:L.deviceInfo.lang,version:L.sdkInfo.jssdkVersion,appName:(i=L.hostInfo)==null?void 0:i.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},t=(o=L.hostInfo)==null?void 0:o.version;t&&(e=Oe(Q({},e),{version:t}));let r=(a=L.hostInfo)==null?void 0:a.appName;r&&(e=Oe(Q({},e),{appName:r}));let n=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=Oe(Q({},e),{SDKVersion:n})),e},Kd=mt(qd,{implement:Wd}),zd=mt($d,{implement:()=>Oe(Q({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});Es.registerCommand("API.env",zd);Es.registerCommand("API.getSystemInfoSync",Kd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});j();rr();$e();ot();var Qd="onJoliboxShow",Yd="onJoliboxHide",Xd="onReady",Qi=_e(),Yi=qa(ke),zi=!0,nr=!0,sn=0,ln=ji;function Zd(){let e=Date.now();if(e-sn<100)return;sn=e;let t=document.visibilityState==="visible";t!==zi&&(zi=t,ln.emit("visible",zi))}function Is(e){let t=Date.now();t-sn<100||(sn=t,e==="focus"&&!nr?nr=!0:e==="blur"&&nr&&(nr=!1),ln.emit("visible",nr))}document.addEventListener("visibilitychange",Zd);window.addEventListener("focus",()=>Is("focus"));window.addEventListener("blur",()=>Is("blur"));var ef=mt(Qd,{paramsSchema:J.tuple(J.function()),implement(e){let t=Yi(e);ln.on("visible",r=>{r&&t()})}}),tf=mt(Yd,{paramsSchema:J.tuple(J.function()),implement(e){let t=Yi(e);ln.on("visible",r=>{!r&&t()})}}),rf=mt(Xd,{paramsSchema:J.tuple(J.function()),implement(e){let t=Yi(e);ft.on("LifecycleEvent.onReady",r=>{t(r)})}});Qi.registerCommand("LifecycleSDK.onReady",rf);Qi.registerCommand("LifecycleSDK.onJoliboxShow",ef);Qi.registerCommand("LifecycleSDK.onJoliboxHide",tf);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});rr();j();It();me();var Cs=hi(Ss());var un=_e(),Zi=class{constructor(){this.httpClient=Be.create({baseUrl:L.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>L.mpId;this.getItem=t=>P(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>P(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>P(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>P(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Cs.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},cn=new Zi,nf=ze("getLocalStorage",{paramsSchema:J.tuple(J.string()),implement(e){return P(this,null,function*(){return yield cn.getItem(e)})}});un.registerCommand("StorageSDK.getItem",nf);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var of=ze("setStorage",{paramsSchema:J.tuple(J.string(),J.or(J.string(),J.boolean(),J.number())),implement(e,t){return P(this,null,function*(){return yield cn.setItem(e,t)})}});un.registerCommand("StorageSDK.setItem",of);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var af=ze("removeStorage",{paramsSchema:J.tuple(J.string()),implement(e){return P(this,null,function*(){return yield cn.removeItem(e)})}});un.registerCommand("StorageSDK.removeItem",af);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var sf=ze("clearStorage",{implement(){return P(this,null,function*(){return yield cn.clear()})}});un.registerCommand("StorageSDK.clear",sf);ge("storage.clear",{version:"1.0.0"});var ob=hi(Rs());ot();j();It();ro();me();Me();var Ts=L.testMode;function xs(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,u)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;Ts&&console.log(`handleReward ${u}`);let g=e.get(u),h=g?yield g(...o):d;return Ts&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:Rt,loginGuide:Ot}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:Rt,loginGuide:Ot}})}}}Me();j();var hf=()=>(e,t)=>{let r={JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return r[t]-r[e]},mf=e=>e.length?e.includes("JOLI_GEM")&&e.length<=1?["JOLI_GEM_ONLY"]:e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(hf()):["ADS"],Ps=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a,s;let r=["ADS"];try{let u=yield t.post("/api/games/unlock-options",{});if(u.code!=="SUCCESS")return r;console.log("-----res fetch reward-----",u),ae.emit(hn,{options:((n=u.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=u.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=u.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let d=((s=(a=u.data)==null?void 0:a.unlockOptions)==null?void 0:s.map(g=>g.type))||Array.from(r);return mf(d)}catch(u){return console.error("getRewardOptions error:",u),r}}))},Ls=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ae.emit(ks,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||Rt,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||Ot}),r.data&&ft.emit("onGlobalConfigChanged",{globalConfig:r.data}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||Rt,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||Ot}}))};var Ns=e=>t=>P(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});Me();function at(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=Q(Q({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Me();var Te=at(ae,hn);me();j();var no={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};j();var Qe=_e();Me();Me();var Ds=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Us=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-gem/balance",{query:{type:"GEM"}})).data});var kt={JOLI_COIN:{fetchBalance:Ds,getQuantity:e=>{var t,r,n;return(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_COIN"))==null?void 0:r.joliCoinChoices[0].joliCoinQuantity)!=null?n:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userJoliCoin)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userJoliCoin",isEnough:(e,t)=>{var r,n;return(n=(r=e==null?void 0:e.options)==null?void 0:r.some(i=>i.type==="JOLI_COIN"&&i.joliCoinChoices.some(o=>{var a;return o.joliCoinQuantity<=((a=t==null?void 0:t.balance)!=null?a:0)})))!=null?n:!1}},JOLI_GEM:{fetchBalance:Us,getQuantity:e=>{var t,r,n,i;return(i=(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(o=>o.type==="JOLI_GEM"))==null?void 0:r.joliGemChoices)==null?void 0:n.joliGemQuantity)!=null?i:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userGem)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userGem",isEnough:(e,t)=>{var r,n;return(n=(r=e==null?void 0:e.options)==null?void 0:r.some(i=>{var o,a,s;return i.type==="JOLI_GEM"&&((a=(o=i.joliGemChoices)==null?void 0:o.joliGemQuantity)!=null?a:0)<=((s=t==null?void 0:t.balance)!=null?s:0)}))!=null?n:!1}}};var wn=(e,t,r)=>{let{showUnlockWithCurrencyModal:n}=r;Qe.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){let i=yield Te.getData(),o=kt.JOLI_COIN,a=o.getCurrentUser(i),s=o.getQuantity(i),u=!!(a!=null&&a.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",i,u,s),(yield n({enableAutoDeduct:u,userCurrency:a,quantity:s,currency:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Tt=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,_n);return ae.emit(vn,e,{enableAutoDeduct:r.enableAutoDeduct,userCurrency:r.userCurrency,quantity:r.quantity,currency:r.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});Me();Me();var bn=(e,t,r)=>{let{httpClient:n,initiateAndAwaitPayment:i}=r;Qe.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var p;let o=yield Te.getData(),a=kt[t],s=yield a.fetchBalance(n),u=a.getQuantity(o),d=a.getCurrentUser(o),g=a.createUpdatedUser((p=s==null?void 0:s.balance)!=null?p:0,d.enableAutoDeduct),h=a.getUpdateKey();return Te.updateData({[h]:g}),console.log("-----unlockOptions payment-----",o,g,u),a.isEnough(o,g)?{result:"CONTINUE"}:{result:(yield i({userCurrency:g,currencyQuantity:u,currency:t}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},xt=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,pn);return ae.emit(mn,e,{userCurrency:r.userCurrency,quantity:r.currencyQuantity,currency:r.currency,enableAutoDeduct:r.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});me();Me();Me();j();var En=(e,t,r)=>{let{showUnloginModal:n,httpClient:i}=r;Qe.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var s,u,d;let o=(s=L.hostUserInfo)==null?void 0:s.isLogin,a=yield Te.getData();if(console.log("-----isLogin-----",!!o),!o){let g=yield n(t);if(console.log("-----unloginModalResult-----",g),g.result=="FAILED"||g.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:h,claimedRewardValue:p}=(u=g.rewards)!=null?u:{};if(g.result=="SUCCESS"){h&&p&&(yield Ma(3e3));let f=kt[t],b=yield f.fetchBalance(i),I=f.getQuantity(a),C=f.getCurrentUser(a),w=f.createUpdatedUser((d=b==null?void 0:b.balance)!=null?d:0,C.enableAutoDeduct),k=f.getUpdateKey();if(Te.updateData({[k]:w}),w.balance>=I)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},Pt=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,gn);return ae.emit(yn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:r}),yield n.getFreshData()});var pf=(e,t,r,{handlers:{handleUnlockSuccess:n,handleUnlockFailed:i,unlockOptionsHandler:o,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:s,showUnloginModal:u}})=>{En(e,"JOLI_COIN",{httpClient:t,showUnloginModal:u}),bn(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:a}),wn(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return g=>P(void 0,null,function*(){var h,p,f;try{let b=!0;for(let w of d){let k=yield Qe.executeCommand(w);if(b=b&&k.result!=="FAILED",k.result!=="CONTINUE")break}if(!b)return i==null||i(g),!1;let I=no[r],C=yield t.post(I.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${it()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",C),C.code=="SUCCESS"){try{(p=g.adBreakDone)==null||p.call(g,{breakType:g.type,breakName:"name"in g&&(h=g.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in g&&((f=g.adViewed)==null||f.call(g))}catch(w){console.error("-----unlockWithJolicoin adBreakDone error-----",w)}return n==null||n({quantity:C.data.quantity,balance:C.data.balance}),!0}return i==null||i(g),!1}catch(b){if(console.info("JolicoinRewardHandler error:",b),b instanceof Error&&b.message=="CANCEL")throw b;return i==null||i(g),!1}finally{o.clearCache()}})},io=(e,t,r)=>pf(e,t,"JOLI_COIN",r);var Ms=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=Tt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=xt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=Pt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return io("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Te,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:a}})};me();j();var st=xs();Ps(st);Ls(st);var Cn,B,js,so,vt,Bs,Hs,Vs,$s,lo,oo,ao,_f,ir={},qs=[],gf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,or=Array.isArray;function Ye(e,t){for(var r in t)e[r]=t[r];return e}function uo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ar(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Cn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return An(e,a,n,i,null)}function An(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++js:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function lt(e){return e.children}function xe(e,t){this.props=e,this.context=t}function Lt(e,t){if(t==null)return e.__?Lt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Lt(e):null}function Ws(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ws(e)}}function Js(e){(!e.__d&&(e.__d=!0)&&vt.push(e)&&!Sn.__r++||Bs!==B.debounceRendering)&&((Bs=B.debounceRendering)||Hs)(Sn)}function Sn(){for(var e,t,r,n,i,o,a,s=1;vt.length;)vt.length>s&&vt.sort(Vs),e=vt.shift(),s=vt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ye({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),co(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Lt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Qs(o,r,a),r.__e!=i&&Ws(r)));Sn.__r=0}function Ks(e,t,r,n,i,o,a,s,u,d,g){var h,p,f,b,I,C,w=n&&n.__k||qs,k=t.length;for(u=yf(r,t,w,u,k),h=0;h<k;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?ir:w[f.__i]||ir,f.__i=h,C=co(e,f,p,i,o,a,s,u,d,g),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&fo(p.ref,null,f),g.push(f.ref,f.__c||b,f)),I==null&&b!=null&&(I=b),4&f.__u||p.__k===f.__k?u=zs(f,u,e):typeof f.type=="function"&&C!==void 0?u=C:b&&(u=b.nextSibling),f.__u&=-7);return r.__e=I,u}function yf(e,t,r,n,i){var o,a,s,u,d,g=r.length,h=g,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?An(null,a,null,null,null):or(a)?An(lt,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?An(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=wf(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>g?p--:i<g&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<g;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Lt(s)),Xs(s,s));return n}function zs(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=zs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Lt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function sr(e,t){return t=t||[],e==null||typeof e=="boolean"||(or(e)?e.some(function(r){sr(r,t)}):t.push(e)),t}function wf(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function Fs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||gf.test(t)?r:r+"px"}function In(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Fs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Fs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace($s,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=lo,e.addEventListener(t,o?ao:oo,o)):e.removeEventListener(t,o?ao:oo,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Gs(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=lo++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function co(e,t,r,n,i,o,a,s,u,d){var g,h,p,f,b,I,C,w,k,N,G,H,S,D,T,M,W,K=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(g=B.__b)&&g(t);e:if(typeof K=="function")try{if(w=t.props,k="prototype"in K&&K.prototype.render,N=(g=K.contextType)&&n[g.__c],G=g?N?N.props.value:g.__:n,r.__c?C=(h=t.__c=r.__c).__=h.__E:(k?t.__c=h=new K(w,G):(t.__c=h=new xe(w,G),h.constructor=K,h.render=Ef),N&&N.sub(h),h.props=w,h.state||(h.state={}),h.context=G,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),k&&h.__s==null&&(h.__s=h.state),k&&K.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ye({},h.__s)),Ye(h.__s,K.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)k&&K.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),k&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(k&&K.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,G),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,G)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ee){ee&&(ee.__=t)}),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,G),k&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,I)})}if(h.context=G,h.props=w,h.__P=e,h.__e=!1,S=B.__r,D=0,k){for(h.state=h.__s,h.__d=!1,S&&S(t),g=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do h.__d=!1,S&&S(t),g=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++D<25);h.state=h.__s,h.getChildContext!=null&&(n=Ye(Ye({},n),h.getChildContext())),k&&!p&&h.getSnapshotBeforeUpdate!=null&&(I=h.getSnapshotBeforeUpdate(f,b)),M=g,g!=null&&g.type===lt&&g.key==null&&(M=Ys(g.props.children)),s=Ks(e,or(M)?M:[M],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),C&&(h.__E=h.__=null)}catch(ee){if(t.__v=null,u||o!=null)if(ee.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(W=o.length;W--;)uo(o[W]);else t.__e=r.__e,t.__k=r.__k;B.__e(ee,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=bf(r.__e,t,r,n,i,o,a,u,d);return(g=B.diffed)&&g(t),128&t.__u?void 0:s}function Qs(e,t,r){for(var n=0;n<r.length;n++)fo(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){B.__e(o,i.__v)}})}function Ys(e){return typeof e!="object"||e==null?e:or(e)?e.map(Ys):Ye({},e)}function bf(e,t,r,n,i,o,a,s,u){var d,g,h,p,f,b,I,C=r.props,w=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!k&&(k?f.localName==k:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(k==null)return document.createTextNode(w);e=document.createElementNS(i,k,w.is&&w),s&&(B.__m&&B.__m(t,o),s=!1),o=null}if(k===null)C===w||s&&e.data===w||(e.data=w);else{if(o=o&&Cn.call(e.childNodes),C=r.props||ir,!s&&o!=null)for(C={},d=0;d<e.attributes.length;d++)C[(f=e.attributes[d]).name]=f.value;for(d in C)if(f=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;In(e,d,null,f,i)}}for(d in w)f=w[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?g=f:d=="value"?b=f:d=="checked"?I=f:s&&typeof f!="function"||C[d]===f||In(e,d,f,C[d],i);if(g)s||h&&(g.__html===h.__html||g.__html===e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(h&&(e.innerHTML=""),Ks(t.type==="template"?e.content:e,or(p)?p:[p],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Lt(r,0),s,u),o!=null)for(d=o.length;d--;)uo(o[d]);s||(d="value",k=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||k=="progress"&&!b||k=="option"&&b!==C[d])&&In(e,d,b,C[d],i),d="checked",I!==void 0&&I!==e[d]&&In(e,d,I,C[d],i))}return e}function fo(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){B.__e(i,r)}}function Xs(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||fo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){B.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Xs(n[i],t,r||typeof e.type!="function");r||uo(e.__e),e.__c=e.__=e.__e=void 0}function Ef(e,t,r){return this.constructor(e,r)}function Zs(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],co(t,e=(!n&&r||t).__k=ar(lt,null,[e]),i||ir,ir,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?Cn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Qs(o,e,a)}Cn=qs.slice,B={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},js=0,so=function(e){return e!=null&&e.constructor==null},xe.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Js(this))},xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Js(this))},xe.prototype.render=lt,vt=[],Hs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vs=function(e,t){return e.__v.__b-t.__v.__b},Sn.__r=0,$s=/(PointerCapture)$|Capture$/i,lo=0,oo=Gs(!1),ao=Gs(!0),_f=0;var Nt,ie,ho,el,lr=0,ll=[],se=B,tl=se.__b,rl=se.__r,nl=se.diffed,il=se.__c,ol=se.unmount,al=se.__;function On(e,t){se.__h&&se.__h(ie,e,lr||t),lr=0;var r=ie.__H||(ie.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function kn(e){return lr=1,ul(cl,e)}function ul(e,t,r){var n=On(Nt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):cl(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ie,!ie.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var g=n.__c.__H.__.filter(function(p){return!!p.__c});if(g.every(function(p){return!p.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return g.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};ie.__f=!0;var o=ie.shouldComponentUpdate,a=ie.componentWillUpdate;ie.componentWillUpdate=function(s,u,d){if(this.__e){var g=o;o=void 0,i(s,u,d),o=g}a&&a.call(this,s,u,d)},ie.shouldComponentUpdate=i}return n.__N||n.__}function ur(e,t){var r=On(Nt++,3);!se.__s&&go(r.__H,t)&&(r.__=e,r.u=t,ie.__H.__h.push(r))}function po(e,t){var r=On(Nt++,4);!se.__s&&go(r.__H,t)&&(r.__=e,r.u=t,ie.__h.push(r))}function vo(e){return lr=5,cr(function(){return{current:e}},[])}function cr(e,t){var r=On(Nt++,7);return go(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function _o(e,t){return lr=8,cr(function(){return e},t)}function If(){for(var e;e=ll.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Rn),e.__H.__h.forEach(mo),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,tl&&tl(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),al&&al(e,t)},se.__r=function(e){rl&&rl(e),Nt=0;var t=(ie=e.__c).__H;t&&(ho===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Rn),t.__h.forEach(mo),t.__h=[],Nt=0)),ho=ie},se.diffed=function(e){nl&&nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ll.push(t)!==1&&el===se.requestAnimationFrame||((el=se.requestAnimationFrame)||Af)(If)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ho=ie=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Rn),r.__h=r.__h.filter(function(n){return!n.__||mo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),il&&il(e,t)},se.unmount=function(e){ol&&ol(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Rn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var sl=typeof requestAnimationFrame=="function";function Af(e){var t,r=function(){clearTimeout(n),sl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);sl&&(t=requestAnimationFrame(r))}function Rn(e){var t=ie,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ie=t}function mo(e){var t=ie;e.__c=e.__(),ie=t}function go(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function cl(e,t){return typeof t=="function"?t(e):t}function Cf(e,t){for(var r in t)e[r]=t[r];return e}function dl(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function fl(e,t){this.props=e,this.context=t}(fl.prototype=new xe).isPureReactComponent=!0,fl.prototype.shouldComponentUpdate=function(e,t){return dl(this.props,e)||dl(this.state,t)};var hl=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),hl&&hl(e)};var ow=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Rf=B.__e;B.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Rf(e,t,r,n)};var ml=B.unmount;function bl(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Cf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return bl(n,t,r)})),e}function El(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return El(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function yo(){this.__u=0,this.o=null,this.__b=null}function Il(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Tn(){this.i=null,this.l=null}B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ml&&ml(e)},(yo.prototype=new xe).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Il(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=El(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},yo.prototype.componentWillUnmount=function(){this.o=[]},yo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=bl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&ar(lt,null,e.fallback);return i&&(i.__u&=-33),[ar(lt,null,t.__a?null:e.children),i]};var pl=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(Tn.prototype=new xe).__a=function(e){var t=this,r=Il(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),pl(t,e,n)):i()};r?r(o):o()}},Tn.prototype.render=function(e){this.i=null,this.l=new Map;var t=sr(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Tn.prototype.componentDidUpdate=Tn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){pl(e,r,t)})};var Of=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,kf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Tf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xf=/[A-Z0-9]/g,Pf=typeof document!="undefined",Lf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function wo(e,t,r){return t.__k==null&&(t.textContent=""),Zs(e,t),typeof r=="function"&&r(),e?e.__c:null}xe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(xe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var vl=B.event;function Nf(){}function Df(){return this.cancelBubble}function Uf(){return this.defaultPrevented}B.event=function(e){return vl&&(e=vl(e)),e.persist=Nf,e.isPropagationStopped=Df,e.isDefaultPrevented=Uf,e.nativeEvent=e};var Al,Mf={enumerable:!1,configurable:!0,get:function(){return this.class}},_l=B.vnode;B.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||Pf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||Lf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":Tf.test(a)&&(a=u):u=a="oninput":o&&kf.test(a)?a=a.replace(xf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=sr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=sr(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Mf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Of,_l&&_l(e)};var gl=B.__r;B.__r=function(e){gl&&gl(e),Al=e.__c};var yl=B.diffed;B.diffed=function(e){yl&&yl(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Al=null};var Sl=Object.getOwnPropertySymbols,Bf=Object.prototype.hasOwnProperty,Jf=Object.prototype.propertyIsEnumerable,Ff=(e,t)=>{var r={};for(var n in e)Bf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sl)for(var n of Sl(e))t.indexOf(n)<0&&Jf.call(e,n)&&(r[n]=e[n]);return r},Ql=Object.defineProperty,Gf=Object.defineProperties,jf=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,Hf=Object.prototype.hasOwnProperty,Vf=Object.prototype.propertyIsEnumerable,Rl=(e,t,r)=>t in e?Ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$f=(e,t)=>{for(var r in t||(t={}))Hf.call(t,r)&&Rl(e,r,t[r]);if(Cl)for(var r of Cl(t))Vf.call(t,r)&&Rl(e,r,t[r]);return e},qf=(e,t)=>Gf(e,jf(t)),Wf=(e,t)=>{for(var r in t)Ql(e,r,{get:t[r],enumerable:!0})},Yl=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},Kf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}function zf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Qf(e){return typeof e=="string"}function Yf(e){return typeof e=="undefined"}function Xf(e){return Yf(e)||e===null}function Zf(e){return typeof e=="function"}function Xl(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var eh=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(eh||{});function dr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var th={log:dr("log"),warn:dr("warn"),info:dr("info"),error:dr("error"),debug:dr("debug")};Object.assign(globalThis,{logger:th});var Ol=Symbol.for("Jolibox.canIUseMap"),rh={};globalThis[Ol]||(globalThis[Ol]=rh);var kl=Symbol.for("Jolibox.canIUseMap.native"),nh={};globalThis[kl]||(globalThis[kl]=nh);var Zl=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Zl||{}),eu=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(eu||{}),tu=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(tu||{}),Tl=["name","params"],ih=["name","type","location","target","extra","timestamp","userId"],oh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Nn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function ah(e){let t=e.location?Nn(e.location,Tl):null,r=e.target?Nn(e.target,Tl):null;return Nn(qf($f({},e),{location:t,target:r}),ih)}function sh(e){let t=e.events.map(n=>ah(n)),r=Nn(e.device,oh);return[e.protocolVersion,t,r,e.project]}function lh(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}lh();var Mt=typeof window=="undefined",xl=()=>!Mt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Mt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Mt&&navigator.userAgent.includes("Android"),!Mt&&navigator.userAgent.includes("Mac"),!Mt&&navigator.userAgent.includes("FB_IAB"),!Mt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var Ro=class Oo{constructor(t){this.element=t,this.next=Oo.Undefined,this.prev=Oo.Undefined}};Ro.Undefined=new Ro(void 0);var re=Ro,uh=class{constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let e=this._first;for(;e!==re.Undefined;){let t=e.next;e.prev=re.Undefined,e.next=re.Undefined,e=t}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new re(e);if(this._first===re.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==re.Undefined&&e.next!==re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===re.Undefined&&e.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):e.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):e.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==re.Undefined;)yield e.element,e=e.next}},ch=0,fr=class{constructor(e){this.value=e,this.id=ch++}},vr=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof fr&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new fr(e);return this._listeners?this._listeners instanceof fr?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,g,h,p;if(!this._disposed){if(this._listeners instanceof fr)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(g=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||g.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof fr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},dh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new vr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new uh,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ko={};Wf(ko,{None:()=>fh,filter:()=>mh,once:()=>ru,toPromise:()=>hh});var fh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function hh(e){return new Promise(t=>ru(e)(t))}function ru(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function mh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new vr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var bo=Symbol.for("Jolibox.hostEmitter"),ph=()=>{let e=new dh;return globalThis[bo]||(globalThis[bo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[bo]};ph();function vh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)_h(e[n],t[n])}function _h(e,t){if(Qf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Zf(t)){try{if(e instanceof t)return}catch(r){}if(!Xf(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var To=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new vr,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return vh(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};To=Yl([Xl],To);var Pl=class{constructor(){this._onWillExecuteCommand=new vr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new vr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new To,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=zf(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Kf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ko.toPromise(ko.filter(this.registry.onDidRegisterCommand,i=>i===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};Pl=Yl([Xl],Pl);function Ae(e,t,r){return(t=gh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gh(e){var t=yh(e,"string");return typeof t=="symbol"?t:t+""}function yh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dt=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},xo=class{constructor(t){Ae(this,"context",void 0),Ae(this,"continueCallback",void 0),Ae(this,"adIsShowingCallback",void 0),Ae(this,"isBeforeAdCalled",!1),Ae(this,"isBeforeRewardCalled",!1),Ae(this,"isAdDismissedCalled",!1),Ae(this,"isAdViewedCalled",!1),Ae(this,"isAfterAdCalled",!1),Ae(this,"currentProvider",void 0),Ae(this,"currentClientParams",void 0),Ae(this,"adsHasResponse",!1),Ae(this,"videoChecker",window.document.createElement("video")),Ae(this,"contextInfo",void 0),Ae(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),xl()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Dt(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Dt(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),xl()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Dt(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Dt(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Dt(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let d=Dt(t);d==null||d(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,u,d,g,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(g=this.continueCallback)==null||g.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function xn(e,t,r){return(t=wh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wh(e){var t=bh(e,"string");return typeof t=="symbol"?t:t+""}function bh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Po=class{constructor(t){xn(this,"context",void 0),xn(this,"adBreakIsShowing",!1),xn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),xn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function Pn(e,t,r){return(t=Eh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eh(e){var t=Ih(e,"string");return typeof t=="symbol"?t:t+""}function Ih(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lo=class{constructor(t){Pn(this,"configs",null),Pn(this,"firstRun",!0),Pn(this,"context",void 0),Pn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return P(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function Xe(e,t,r){return(t=Ah(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ah(e){var t=Sh(e,"string");return typeof t=="symbol"?t:t+""}function Sh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var No=class{constructor(t,r){Xe(this,"name","ADSENSE"),Xe(this,"context",void 0),Xe(this,"contextInfo",void 0),Xe(this,"configured",!1),Xe(this,"initParams",void 0),Xe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Xe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Ff(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Xe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Xe(this,"adUnit",n=>P(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:g,fullWidthResponsive:h,style:p}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!f)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let I=typeof g=="object"&&Array.isArray(g)?g.join(", "):g,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",b),I&&C.setAttribute("data-ad-format",I),h&&C.setAttribute("data-full-width-responsive",h),p&&C.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",C.style.position="relative",f.appendChild(C),C.appendChild(w)}else f.appendChild(C),new MutationObserver(w=>{w.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let N=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return P(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function Ch(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Rh(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Oh=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Rh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Ch(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),we="-ms-",Fn="-moz-",V="-webkit-",nu="comm",zo="rule",Qo="decl",kh="@import",iu="@keyframes",Th="@layer",xh=Math.abs,$n=String.fromCharCode,Ph=Object.assign;function Lh(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function ou(e){return e.trim()}function Nh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function Do(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function _r(e,t,r){return e.slice(t,r)}function Ge(e){return e.length}function Yo(e){return e.length}function Ln(e,t){return t.push(e),e}function Dh(e,t){return e.map(t).join("")}var qn=1,Ft=1,au=0,Re=0,de=0,Gt="";function Wn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:qn,column:Ft,length:a,return:""}}function hr(e,t){return Ph(Wn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Uh(){return de}function Mh(){return de=Re>0?pe(Gt,--Re):0,Ft--,de===10&&(Ft=1,qn--),de}function Le(){return de=Re<au?pe(Gt,Re++):0,Ft++,de===10&&(Ft=1,qn++),de}function je(){return pe(Gt,Re)}function Dn(){return Re}function wr(e,t){return _r(Gt,e,t)}function gr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function su(e){return qn=Ft=1,au=Ge(Gt=e),Re=0,[]}function lu(e){return Gt="",e}function Un(e){return ou(wr(Re-1,Uo(e===91?e+2:e===40?e+1:e)))}function Bh(e){for(;(de=je())&&de<33;)Le();return gr(e)>2||gr(de)>3?"":" "}function Jh(e,t){for(;--t&&Le()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return wr(e,Dn()+(t<6&&je()==32&&Le()==32))}function Uo(e){for(;Le();)switch(de){case e:return Re;case 34:case 39:e!==34&&e!==39&&Uo(de);break;case 40:e===41&&Uo(e);break;case 92:Le();break}return Re}function Fh(e,t){for(;Le()&&e+de!==57&&!(e+de===84&&je()===47););return"/*"+wr(t,Re-1)+"*"+$n(e===47?e:Le())}function Gh(e){for(;!gr(je());)Le();return wr(e,Re)}function jh(e){return lu(Mn("",null,null,null,[""],e=su(e),0,[0],e))}function Mn(e,t,r,n,i,o,a,s,u){for(var d=0,g=0,h=a,p=0,f=0,b=0,I=1,C=1,w=1,k=0,N="",G=i,H=o,S=n,D=N;C;)switch(b=k,k=Le()){case 40:if(b!=108&&pe(D,h-1)==58){Do(D+=$(Un(k),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:D+=Un(k);break;case 9:case 10:case 13:case 32:D+=Bh(b);break;case 92:D+=Jh(Dn()-1,7);continue;case 47:switch(je()){case 42:case 47:Ln(Hh(Fh(Le(),Dn()),t,r),u);break;default:D+="/"}break;case 123*I:s[d++]=Ge(D)*w;case 125*I:case 59:case 0:switch(k){case 0:case 125:C=0;case 59+g:w==-1&&(D=$(D,/\f/g,"")),f>0&&Ge(D)-h&&Ln(f>32?Nl(D+";",n,r,h-1):Nl($(D," ","")+";",n,r,h-2),u);break;case 59:D+=";";default:if(Ln(S=Ll(D,t,r,d,g,i,s,N,G=[],H=[],h),o),k===123)if(g===0)Mn(D,t,S,S,G,o,h,s,H);else switch(p===99&&pe(D,3)===110?100:p){case 100:case 108:case 109:case 115:Mn(e,S,S,n&&Ln(Ll(e,S,S,0,0,i,s,N,i,G=[],h),H),i,H,h,s,n?G:H);break;default:Mn(D,S,S,S,[""],H,0,s,H)}}d=g=f=0,I=w=1,N=D="",h=a;break;case 58:h=1+Ge(D),f=b;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&Mh()==125)continue}switch(D+=$n(k),k*I){case 38:w=g>0?1:(D+="\f",-1);break;case 44:s[d++]=(Ge(D)-1)*w,w=1;break;case 64:je()===45&&(D+=Un(Le())),p=je(),g=h=Ge(N=D+=Gh(Dn())),k++;break;case 45:b===45&&Ge(D)==2&&(I=0)}}return o}function Ll(e,t,r,n,i,o,a,s,u,d,g){for(var h=i-1,p=i===0?o:[""],f=Yo(p),b=0,I=0,C=0;b<n;++b)for(var w=0,k=_r(e,h+1,h=xh(I=a[b])),N=e;w<f;++w)(N=ou(I>0?p[w]+" "+k:$(k,/&\f/g,p[w])))&&(u[C++]=N);return Wn(e,t,r,i===0?zo:s,u,d,g)}function Hh(e,t,r){return Wn(e,t,r,nu,$n(Uh()),_r(e,2,-2),0)}function Nl(e,t,r,n){return Wn(e,t,r,Qo,_r(e,0,n),_r(e,n+1,-1),n)}function Jt(e,t){for(var r="",n=Yo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Vh(e,t,r,n){switch(e.type){case Th:if(e.children.length)break;case kh:case Qo:return e.return=e.return||e.value;case nu:return"";case iu:return e.return=e.value+"{"+Jt(e.children,n)+"}";case zo:e.value=e.props.join(",")}return Ge(r=Jt(e.children,n))?e.return=e.value+"{"+r+"}":""}function $h(e){var t=Yo(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function qh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Wh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Kh=function(e,t,r){for(var n=0,i=0;n=i,i=je(),n===38&&i===12&&(t[r]=1),!gr(i);)Le();return wr(e,Re)},zh=function(e,t){var r=-1,n=44;do switch(gr(n)){case 0:n===38&&je()===12&&(t[r]=1),e[r]+=Kh(Re-1,t,r);break;case 2:e[r]+=Un(n);break;case 4:if(n===44){e[++r]=je()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=$n(n)}while(n=Le());return e},Qh=function(e,t){return lu(zh(su(e),t))},Dl=new WeakMap,Yh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Dl.get(r))&&!n){Dl.set(e,!0);for(var i=[],o=Qh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Xh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function uu(e,t){switch(Lh(e,t)){case 5103:return V+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return V+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return V+e+Fn+e+we+e+e;case 6828:case 4268:return V+e+we+e+e;case 6165:return V+e+we+"flex-"+e+e;case 5187:return V+e+$(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return V+e+we+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return V+e+we+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+we+$(e,"shrink","negative")+e;case 5292:return V+e+we+$(e,"basis","preferred-size")+e;case 6060:return V+"box-"+$(e,"-grow","")+V+e+we+$(e,"grow","positive")+e;case 4554:return V+$(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,V+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ge(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+Fn+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Do(e,"stretch")?uu($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,Ge(e)-3-(~Do(e,"!important")&&10))){case 107:return $(e,":",":"+V)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(pe(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+we+e+e}return e}var Zh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Qo:e.return=uu(e.value,e.length);break;case iu:return Jt([hr(e,{value:$(e.value,"@","@"+V)})],n);case zo:if(e.length)return Dh(e.props,function(i){switch(Nh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Jt([hr(e,{props:[$(i,/:(read-\w+)/,":"+Fn+"$1")]})],n);case"::placeholder":return Jt([hr(e,{props:[$(i,/:(plac\w+)/,":"+V+"input-$1")]}),hr(e,{props:[$(i,/:(plac\w+)/,":"+Fn+"$1")]}),hr(e,{props:[$(i,/:(plac\w+)/,we+"input-$1")]})],n)}return""})}},em=[Zh],tm=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(b){var I=b.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var n=e.stylisPlugins||em,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(b){for(var I=b.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)i[I[C]]=!0;a.push(b)});var s,u=[Yh,Xh];{var d,g=[Vh,qh(function(b){d.insert(b)})],h=$h(u.concat(n,g)),p=function(b){return Jt(jh(b),h)};s=function(b,I,C,w){d=C,p(b?b+"{"+I.styles+"}":I.styles),w&&(f.inserted[I.name]=!0)}}var f={key:t,sheet:new Oh({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function rm(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var nm={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},im=/[A-Z]|^ms/g,om=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cu=function(e){return e.charCodeAt(1)===45},Ul=function(e){return e!=null&&typeof e!="boolean"},Eo=Wh(function(e){return cu(e)?e:e.replace(im,"-$&").toLowerCase()}),Ml=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(om,function(r,n,i){return ut={name:n,styles:i,next:ut},n})}return nm[e]!==1&&!cu(e)&&typeof t=="number"&&t!==0?t+"px":t};function Gn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return ut={name:i.name,styles:i.styles,next:ut},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)ut={name:a.name,styles:a.styles,next:ut},a=a.next;var s=o.styles+";";return s}return am(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function am(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Gn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Ul(s)&&(n+=Eo(o)+":"+Ml(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)Ul(a[u])&&(n+=Eo(o)+":"+Ml(o,a[u])+";");else{var d=Gn(e,t,a);switch(o){case"animation":case"animationName":{n+=Eo(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Bl=/label:\s*([^\s;{]+)\s*(;|$)/g,ut;function Io(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";ut=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Gn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Gn(r,t,e[s]),n){var u=o;i+=u[s]}Bl.lastIndex=0;for(var d="",g;(g=Bl.exec(i))!==null;)d+="-"+g[1];var h=rm(i)+d;return{name:h,styles:i,next:ut}}function du(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var sm=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},lm=function(e,t,r){sm(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function Jl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Fl(e,t,r){var n=[],i=du(e,n,r);return n.length<2?r:i+t(n)}var um=function(e){var t=tm(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered,void 0);return lm(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered),g="animation-"+d.name;return Jl(t,{name:d.name,styles:"@keyframes "+g+"{"+d.styles+"}"}),g},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered);Jl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return Fl(t.registered,r,cm(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:du.bind(null,t.registered),merge:Fl.bind(null,t.registered,r)}},cm=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},dm=um({key:"css"}),jt=dm.css,Mo,Pe,Ao,Gl,jl=0,fu=[],fe=B,Hl=fe.__b,Vl=fe.__r,$l=fe.diffed,ql=fe.__c,Wl=fe.unmount,Kl=fe.__;function fm(e,t){fe.__h&&fe.__h(Pe,e,jl||t),jl=0;var r=Pe.__H||(Pe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function hu(e,t){var r=fm(Mo++,7);return pm(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function hm(){for(var e;e=fu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Bn),e.__H.__h.forEach(Bo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Pe=null,Hl&&Hl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kl&&Kl(e,t)},fe.__r=function(e){Vl&&Vl(e),Mo=0;var t=(Pe=e.__c).__H;t&&(Ao===Pe?(t.__h=[],Pe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Bn),t.__h.forEach(Bo),t.__h=[],Mo=0)),Ao=Pe},fe.diffed=function(e){$l&&$l(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fu.push(t)!==1&&Gl===fe.requestAnimationFrame||((Gl=fe.requestAnimationFrame)||mm)(hm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ao=Pe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Bn),r.__h=r.__h.filter(function(n){return!n.__||Bo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),ql&&ql(e,t)},fe.unmount=function(e){Wl&&Wl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Bn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var zl=typeof requestAnimationFrame=="function";function mm(e){var t,r=function(){clearTimeout(n),zl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);zl&&(t=requestAnimationFrame(r))}function Bn(e){var t=Pe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Pe=t}function Bo(e){var t=Pe;e.__c=e.__(),Pe=t}function pm(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var vm=Symbol.for("preact-signals");function Kn(){if(ct>1)ct--;else{for(var e,t=!1;mr!==void 0;){var r=mr;for(mr=void 0,Jo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&pu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Jo=0,ct--,t)throw e}}function Ce(e){if(ct>0)return e();ct++;try{return e()}finally{Kn()}}var Y=void 0,mr=void 0,ct=0,Jo=0,jn=0;function mu(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=vm;ve.prototype.h=function(){return!0};ve.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};ve.prototype.subscribe=function(e){var t=this;return Er(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=mu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Jo>100)throw new Error("Cycle detected");this.v=e,this.i++,jn++,ct++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kn()}}}});function X(e){return new ve(e)}function pu(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function vu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function _u(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Ht(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=jn-1,this.f=4}(Ht.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===jn))return!0;if(this.g=jn,this.f|=1,this.i>0&&!pu(this))return this.f&=-2,!0;var e=Y;try{vu(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,_u(this),this.f&=-2,!0};Ht.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ve.prototype.S.call(this,e)};Ht.prototype.U=function(e){if(this.t!==void 0&&(ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Ht.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Ht.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=mu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function pr(e){return new Ht(e)}function gu(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ct++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Xo(e),n}finally{Y=r,Kn()}}}function Xo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,gu(e)}function _m(e){if(Y!==this)throw new Error("Out-of-order effect");_u(this),Y=e,this.f&=-2,8&this.f&&Xo(this),Kn()}function br(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}br.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};br.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,gu(this),vu(this),ct++;var e=Y;return Y=this,_m.bind(this,e)};br.prototype.N=function(){2&this.f||(this.f|=2,this.o=mr,mr=this)};br.prototype.d=function(){this.f|=8,1&this.f||Xo(this)};function Er(e){var t=new br(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var yu,So,wu=[];Er(function(){yu=this.N})();function Vt(e,t){B[e]=t.bind(null,B[e]||function(){})}function Hn(e){So&&So(),So=e&&e.S()}function bu(e){var t=this,r=e.data,n=Eu(r);n.value=r;var i=hu(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=pr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),g=pr(function(){return!Array.isArray(d.value)&&!so(d.value)}),h=Er(function(){if(this.N=Iu,g.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[g,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}bu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:bu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Vt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof ve&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Vt("__r",function(e,t){Hn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Er(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Hn(r),e(t)});Vt("__e",function(e,t,r,n){Hn(),e(t,r,n)});Vt("diffed",function(e,t){Hn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],g=n[u];d===void 0?(d=gm(r,u,g,i),o[u]=d):d.o(g,i)}}}e(t)});function gm(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=X(r);return{o:function(a,s){o.value=a,n=s},d:Er(function(){this.N=Iu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Vt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Vt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});xe.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Eu(e){return hu(function(){return X(e)},[])}var ym=function(e){queueMicrotask(function(){queueMicrotask(e)})};function wm(){Ce(function(){for(var e;e=wu.shift();)yu.call(e)})}function Iu(){wu.push(this)===1&&(B.requestAnimationFrame||ym)(wm)}var be=jt`
|
|
4
4
|
inset: 0;
|
|
5
5
|
clear: none;
|
|
6
6
|
float: none;
|
|
@@ -18,8 +18,8 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
18
18
|
text-decoration: none;
|
|
19
19
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
20
20
|
'Helvetica Neue', sans-serif;
|
|
21
|
-
`;function
|
|
22
|
-
${
|
|
21
|
+
`;function bm(e,t){let r=vo(e);po(()=>{r.current=e},[e]),ur(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var Em=0;function le(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Em,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return B.vnode&&B.vnode(d),d}var Im=jt`
|
|
22
|
+
${be}
|
|
23
23
|
position: fixed;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
@@ -32,7 +32,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
32
32
|
height: 100vh;
|
|
33
33
|
|
|
34
34
|
.card-wrapper {
|
|
35
|
-
${
|
|
35
|
+
${be}
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
@@ -46,7 +46,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
46
46
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
47
47
|
|
|
48
48
|
.body {
|
|
49
|
-
${
|
|
49
|
+
${be}
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
width: 100%;
|
|
@@ -55,7 +55,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
.title {
|
|
58
|
-
${
|
|
58
|
+
${be}
|
|
59
59
|
text-align: center;
|
|
60
60
|
font-size: 16px;
|
|
61
61
|
font-weight: bold;
|
|
@@ -63,7 +63,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.content {
|
|
66
|
-
${
|
|
66
|
+
${be}
|
|
67
67
|
font-size: 14px;
|
|
68
68
|
color: #888;
|
|
69
69
|
margin-bottom: 16px;
|
|
@@ -71,13 +71,13 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.footer {
|
|
74
|
-
${
|
|
74
|
+
${be}
|
|
75
75
|
display: flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 40px;
|
|
79
79
|
button {
|
|
80
|
-
${
|
|
80
|
+
${be}
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
height: 100%;
|
|
@@ -93,8 +93,8 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,tt=X(null),Fo=X(""),
|
|
97
|
-
${
|
|
96
|
+
`,tt=X(null),Fo=X(""),Go=X(""),Jn=X(!1),Am=()=>{var e;(e=tt.value)==null||e.call(tt,!1)},Sm=()=>{var e;(e=tt.value)==null||e.call(tt,!0)},Cm=e=>P(void 0,null,function*(){let{title:t,content:r}=e;return tt.value&&(tt.value(!1),Ce(()=>{tt.value=null,Jn.value=!1})),Ce(()=>{Fo.value=t||"",Go.value=r||"",Jn.value=!0}),new Promise(n=>{tt.value=i=>{Ce(()=>{tt.value=null,Jn.value=!1,Fo.value="",Go.value=""}),n(i)}})}),Rm=()=>Jn.value?le("div",{className:Im,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:Fo.value}),le("div",{className:"content",children:Go.value})]}),le("div",{className:"footer",children:[le("button",{onClick:Am,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:Sm,className:"confirm-btm",children:"Confirm"})]})]})}):null,Om=jt`
|
|
97
|
+
${be}
|
|
98
98
|
position: relative;
|
|
99
99
|
display: flex;
|
|
100
100
|
align-items: center;
|
|
@@ -112,7 +112,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
button {
|
|
115
|
-
${
|
|
115
|
+
${be}
|
|
116
116
|
padding: 0 20px;
|
|
117
117
|
height: 30px;
|
|
118
118
|
line-height: 30px;
|
|
@@ -126,8 +126,8 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
126
126
|
cursor: not-allowed;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`,
|
|
130
|
-
${
|
|
129
|
+
`,km=()=>{let e=X(!1),t=X(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ce(()=>{t.value=Date.now(),e.value=!1})}}},Tm=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=Eu(t);bm(()=>{s.value>0?s.value-=1:Ce(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=pr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let f=Date.now()-o.value;return s.value>0&&t-s.value>=5&&f>=5e3}),d=pr(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let f=Date.now()-o.value;return s.value<=0&&f>=(t-1)*1e3&&t>5}),g=pr(()=>r==="interstitial"?!1:!u.value&&!d.value),h=()=>P(void 0,null,function*(){if(a.value=!0,!(yield Cm({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ce(()=>{a.value=!0,s.value=0,o.value=null})}),p=()=>{n("viewed"),Ce(()=>{a.value=!0,s.value=0,o.value=null})};return le("div",{className:Om,children:[s.value>0&&r!=="interstitial"&&le("div",{className:"timer",children:[s.value,"s"]}),le("button",{onClick:u.value?h:d.value?p:void 0,disabled:g.value,children:le("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:le("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},xm=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(!1),a=X(15),s=X(""),u=X("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},Pm=jt`
|
|
130
|
+
${be}
|
|
131
131
|
position: fixed;
|
|
132
132
|
z-index: 2147483647;
|
|
133
133
|
background: white;
|
|
@@ -137,7 +137,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
|
|
139
139
|
iframe {
|
|
140
|
-
${
|
|
140
|
+
${be}
|
|
141
141
|
flex: 1;
|
|
142
142
|
position: relative;
|
|
143
143
|
display: block;
|
|
@@ -145,8 +145,8 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
149
|
-
${
|
|
148
|
+
`,Lm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:g}=t,h=cr(()=>km(),[]),[p,f]=kn(!1),b=C=>{var w,k,N,G;s.value=!1,C==="dismiss"?(w=n.value)==null||w.call(n):C==="viewed"&&((k=i.value)==null||k.call(i)),(N=r.value)==null||N.call(r),(G=o.value)==null||G.call(o),f(!1)},I=_o(()=>{var C;p||(f(!0),(C=a.value)==null||C.call(a))},[p]);return ur(()=>{p&&(g.value==="reward"||g.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[p,g.value]),s.value?le("div",{className:Pm,children:[le(Tm,{mode:g.value,onClose:b,countdown:u.value,state:h}),s.value&&le("iframe",{src:d.value,onLoad:I,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),le(Rm,{})]}):null};function Ze(e,t,r){return(t=Nm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nm(e){var t=Dm(e,"string");return typeof t=="symbol"?t:t+""}function Dm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jo=class{constructor(t,r){Ze(this,"name","OKSPIN"),Ze(this,"initialized",!1),Ze(this,"initCompleter",null),Ze(this,"context",void 0),Ze(this,"initParams",void 0),Ze(this,"adsOverlay",null),Ze(this,"adsIsShowing",!1),Ze(this,"lastUnDisplayedAdBreak",null),Ze(this,"state",xm()),this.context=t,this.initParams=r}init(){return P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),wo(le(Lm,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return P(this,null,function*(){var n,i,o,a,s,u,d,g;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let h=()=>{var f;this.adsIsShowing=!1,(f=t.afterAd)==null||f.call(t)},p=()=>{var f;this.adsIsShowing=!1,(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ce(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=p,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let h=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},p={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},f=()=>{var w;this.adsIsShowing=!1,p.breakStatus="dismissed",(w=t.adDismissed)==null||w.call(t)},b=()=>{var w;this.adsIsShowing=!1,p.breakStatus="viewed",(w=t.adViewed)==null||w.call(t)},I=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,p)};Ce(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=f,this.state.adViewed.value=b,this.state.adBreakDone.value=I});let C=()=>{var w;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ce(()=>{var k;this.state.countdown.value=(k=r.params.countdown)!=null?k:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(g=t.beforeReward)==null||g.call(t,C);break}}})}},Bt={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Bt[e.data.type]&&Bt[e.data.type].forEach(t=>{t(e.data.data)})});var Ut=(e,t)=>{ur(()=>(Bt[e]||(Bt[e]=new Set),Bt[e].add(t),()=>{Bt[e].delete(t)}),[e,t])},Um=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(),a=X(),s=X(!1),u=X("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},Mm=jt`
|
|
149
|
+
${be}
|
|
150
150
|
position: fixed;
|
|
151
151
|
z-index: 2147483647;
|
|
152
152
|
background: white;
|
|
@@ -156,7 +156,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
156
156
|
flex-direction: column;
|
|
157
157
|
|
|
158
158
|
iframe {
|
|
159
|
-
${
|
|
159
|
+
${be}
|
|
160
160
|
flex: 1;
|
|
161
161
|
position: relative;
|
|
162
162
|
display: block;
|
|
@@ -164,8 +164,8 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
164
164
|
width: 100%;
|
|
165
165
|
height: 100%;
|
|
166
166
|
}
|
|
167
|
-
`,Um=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,h]=kn(!1),p=b=>{var A,R,w,x;h(!1),u.value=!1,b==="dismiss"?(A=n.value)==null||A.call(n):b==="viewed"&&((R=i.value)==null||R.call(i)),(w=r.value)==null||w.call(r),(x=o.value)==null||x.call(o)},f=()=>{var b;(b=a.value)==null||b.call(a)};return Pt("appsrockets_ad_dismissed",()=>p("dismiss")),Pt("appsrockets_ad_rewarded",()=>p("viewed")),Pt("appsrockets_ad_completed",()=>p("viewed")),Pt("appsrockets_ad_skipped",()=>p("viewed")),Pt("appsrockets_ad_clicked",b=>{var A;return(A=s.value)==null?void 0:A.call(s,b)}),Pt("appsrockets_ad_loaded",()=>h(!0)),u.value?le("div",{className:Lm,style:{display:y?"flex":"none"},children:u.value&&le("iframe",{src:d.value,onLoad:f,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};function et(e,t,r){return(t=Mm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mm(e){var t=Bm(e,"string");return typeof t=="symbol"?t:t+""}function Bm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vo=class{constructor(t,r){et(this,"name","APPSROCKETS"),et(this,"initialized",!1),et(this,"initCompleter",null),et(this,"context",void 0),et(this,"adsOverlay",null),et(this,"adsIsShowing",!1),et(this,"lastUnDisplayedAdBreak",null),et(this,"state",Nm()),et(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),yo(le(Um,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let h=p=>{var f,b;(b=(f=this.context).handleLinkClicked)==null||b.call(f,p)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let p=()=>{var A;this.adsIsShowing=!1,(A=t.afterAd)==null||A.call(t)},f=()=>{var A;this.adsIsShowing=!1,(A=t.adBreakDone)==null||A.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var A;this.adsIsShowing=!1,(A=t.adBreakDone)==null||A.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Re(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=b,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let p=()=>{var N;this.adsIsShowing=!1,(N=t.afterAd)==null||N.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var N;this.adsIsShowing=!1,f.breakStatus="dismissed",(N=t.adDismissed)==null||N.call(t)},A=()=>{var N;this.adsIsShowing=!1,f.breakStatus="viewed",(N=t.adViewed)==null||N.call(t)},R=()=>{var N;this.adsIsShowing=!1,(N=t.adBreakDone)==null||N.call(t,f)},w=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Re(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=A,this.state.adBreakDone.value=R,this.state.adLinkClicked.value=h,this.state.adError.value=w});let x=()=>{var N;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(N=t.adBreakDone)==null||N.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Re(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,x);break}}}},Au=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function ye(e,t,r){return(t=Fm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fm(e){var t=jm(e,"string");return typeof t=="symbol"?t:t+""}function jm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ho=class{constructor(t,r,n){ye(this,"adUnit",void 0),ye(this,"project",void 0),ye(this,"keyValue",void 0),ye(this,"adsContext",null),ye(this,"rewardedSlot",null),ye(this,"rewardedPayload",null),ye(this,"readyEvent",null),ye(this,"withCommand",function(){googletag.cmd.push(...arguments)}),ye(this,"init",()=>{var i;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var a;(a=this.rewardedSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.rewardedSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),ye(this,"destroy",i=>{var o,a;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(a=(o=this.adsContext)==null?void 0:o.adBreakDone)==null||a.call(o,i),this.adsContext=null}),ye(this,"reinit",i=>{this.destroy(i),this.init()}),ye(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),ye(this,"handleSlotClosed",i=>{var o,a;if(this.adsContext&&i.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit(s)})}}),ye(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),ye(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),ye(this,"requestAds",i=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=i,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var o,a,s;(a=(o=this.adsContext)==null?void 0:o.beforeAd)==null||a.call(o),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let o=a=>{a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,this.adsContext.beforeReward(()=>{var s,u,d;(u=(s=this.adsContext)==null?void 0:s.beforeAd)==null||u.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",o),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",o))},500)}})}),this.adUnit=t,this.project=r,this.keyValue=n,Au(),this.withCommand(()=>{this.init()})}};function Se(e,t,r){return(t=Jm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jm(e){var t=Vm(e,"string");return typeof t=="symbol"?t:t+""}function Vm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $o=class{constructor(t,r,n){var i=this;Se(this,"adUnit",void 0),Se(this,"project",void 0),Se(this,"keyValue",void 0),Se(this,"adsContext",null),Se(this,"gamingInterstitialSlot",null),Se(this,"readyEvent",null),Se(this,"isRetrying",!1),Se(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Se(this,"init",()=>{var o;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(o=this.gamingInterstitialSlot)==null||o.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),Se(this,"destroy",function(o){var a,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(a=i.adsContext)==null?void 0:a.onEnd)==null||s.call(a,o),i.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",i.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",i.handleSlotClosed),i.gamingInterstitialSlot&&(googletag.destroySlots([i.gamingInterstitialSlot]),i.gamingInterstitialSlot=null,i.readyEvent=null)}),Se(this,"reinit",function(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(o,a),i.init()}),Se(this,"handleSlotReady",o=>{this.gamingInterstitialSlot===o.slot&&(this.readyEvent=o)}),Se(this,"handleSlotClosed",o=>{var a,s;this.adsContext&&this.gamingInterstitialSlot===o.slot&&((s=(a=this.adsContext).afterAd)==null||s.call(a),this.withCommand(()=>{this.reinit("viewed")}))}),Se(this,"requestAds",o=>{this.withCommand(()=>{var a,s,u;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=o,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((a=o.beforeAd)==null||a.call(o),this.readyEvent.makeGameManualInterstitialVisible()):((u=(s=this.adsContext).onEnd)==null||u.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),Au(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function _t(e,t,r){return(t=Hm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hm(e){var t=$m(e,"string");return typeof t=="symbol"?t:t+""}function $m(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Go=class{constructor(t,r){_t(this,"name","GOOGLE_GPT"),_t(this,"context",void 0),_t(this,"contextInfo",void 0),_t(this,"initParams",void 0),_t(this,"rewardAdManager",void 0),_t(this,"interstitialManager",void 0),_t(this,"insertScript",()=>{let n="jolibox-google-gpt",i=document.getElementById(n);i||(i=window.document.createElement("script"),i.id=n,i.async=!0,i.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",i.crossOrigin="anonymous",document.head.appendChild(i))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,this.insertScript()}init(){return P(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,r=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,n=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new Ho(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new $o(r,n,this.initParams.keyValue))})}adConfig(t,r){}adBreak(t,r){var n,i,o;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:a})}});break}default:{if(!this.interstitialManager){(o=t.adBreakDone)==null||o.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:a})}});break}}}};function So(e,t,r){return(t=Gm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gm(e){var t=qm(e,"string");return typeof t=="symbol"?t:t+""}function qm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";So(this,"context",void 0),So(this,"placement","GAME"),So(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:eu.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Xl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Zl.WebSDK};return oh(i)}};function Ae(e,t,r){return(t=Km(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Km(e){var t=Wm(e,"string");return typeof t=="symbol"?t:t+""}function Wm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hn=class{constructor(t){Ae(this,"context",void 0),Ae(this,"adsTrackSerializer",void 0),Ae(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new qo(this.context)}getRequestContextData(t){var r,n;this.contextInfo=this.context.getContextInfo();let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},Ko=class{constructor(t,r){var n=this;Ae(this,"context",void 0),Ae(this,"contextInfo",void 0),Ae(this,"requestContext",void 0),Ae(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Ae(this,"pendingAFVAdsInfo",Promise.resolve(null)),Ae(this,"doFetchAdsInfo",i=>P(this,null,function*(){let o=i==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",a=i==="afv"?"REWARD_INTERSTITIAL":i==="reward"?"REWARD":"INTERSTITIAL",s=i==="afv"?void 0:"cached",{data:u,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(o),bizParams:this.requestContext.getRequestBizParams(),adsType:a,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:u}:null})),Ae(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Ae(this,"cacheInterstitialInfo",i=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(i).catch(()=>null)}),Ae(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Ae(this,"cacheNextAFGAdsInfo",i=>P(this,null,function*(){i==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(i)})),Ae(this,"getAFGAdsInfo",i=>P(this,null,function*(){let o=yield i==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(i),o})),Ae(this,"getAFVAdsInfo",function(){return P(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let i=yield n.pendingAFVAdsInfo;return n.cacheAFVInfo(),i}else return n.cacheAFVInfo(),yield n.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new Hn(t),r!=null&&r.reward&&this.cacheRewardInfo(),r!=null&&r.interstitial&&this.cacheInterstitialInfo("start"),r!=null&&r.afv&&this.cacheAFVInfo()}};function Fe(e,t,r){return(t=zm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zm(e){var t=Qm(e,"string");return typeof t=="symbol"?t:t+""}function Qm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gr=class{constructor(t){if(Fe(this,"context",void 0),Fe(this,"contextInfo",void 0),Fe(this,"providers",{}),Fe(this,"channelPolicy",void 0),Fe(this,"adsActionDetection",void 0),Fe(this,"requestContext",void 0),Fe(this,"adsRequest",void 0),Fe(this,"initialized",!1),Fe(this,"adsIsShowing",!1),Fe(this,"lastAdBreak",void 0),Fe(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new Po(this.context),this.adsActionDetection=new Oo(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Ko(t),this.requestContext=new Hn(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return P(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"GOOGLE_GPT":{let i=new Go(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new Do(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new Jo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Vo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return P(this,null,function*(){var r,n,i,o,a,s,u,d,y,h,p,f,b,A;let R=Date.now();if(R-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&R-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=R,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let w=yield this.adsRequest.getAFGAdsInfo(t.type),x=w==null?void 0:w.data,N=w==null?void 0:w.code;if(N==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var j,H,S,L;(j=t.beforeAd)==null||j.call(t),(H=t.adViewed)==null||H.call(t),(S=t.afterAd)==null||S.call(t),(L=t.adBreakDone)==null||L.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(u=t.beforeAd)==null||u.call(t),(d=t.afterAd)==null||d.call(t),(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!x||N!=="SUCCESS"){(h=t.adBreakDone)==null||h.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let j=x.sort((T,M)=>T.seq-M.seq);if(j.length===0){(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let H=!0,S=null,L=new To(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;j.length>0;){let T=j.shift(),M=this.providers[T.provider];if(M){let[K,W]=yield L.callAdBreakAndContinue(M,t,T,ee=>{var he;this.adsIsShowing=ee,(he=this.context.eventEmitter)==null||he.emit("isAdShowing",ee)});H=K,S=W}else H=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!H)break}H&&S&&((f=t.adBreakDone)==null||f.call(t,S))}}catch(w){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(A=this.context.eventEmitter)==null||A.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}};var Dy=Bt`
|
|
168
|
-
${
|
|
167
|
+
`,Bm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[g,h]=kn(!1),p=b=>{var I,C,w,k;h(!1),u.value=!1,b==="dismiss"?(I=n.value)==null||I.call(n):b==="viewed"&&((C=i.value)==null||C.call(i)),(w=r.value)==null||w.call(r),(k=o.value)==null||k.call(o)},f=()=>{var b;(b=a.value)==null||b.call(a)};return Ut("appsrockets_ad_dismissed",()=>p("dismiss")),Ut("appsrockets_ad_rewarded",()=>p("viewed")),Ut("appsrockets_ad_completed",()=>p("viewed")),Ut("appsrockets_ad_skipped",()=>p("viewed")),Ut("appsrockets_ad_clicked",b=>{var I;return(I=s.value)==null?void 0:I.call(s,b)}),Ut("appsrockets_ad_loaded",()=>h(!0)),u.value?le("div",{className:Mm,style:{display:g?"flex":"none"},children:u.value&&le("iframe",{src:d.value,onLoad:f,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};function et(e,t,r){return(t=Jm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jm(e){var t=Fm(e,"string");return typeof t=="symbol"?t:t+""}function Fm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ho=class{constructor(t,r){et(this,"name","APPSROCKETS"),et(this,"initialized",!1),et(this,"initCompleter",null),et(this,"context",void 0),et(this,"adsOverlay",null),et(this,"adsIsShowing",!1),et(this,"lastUnDisplayedAdBreak",null),et(this,"state",Um()),et(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),wo(le(Bm,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,o,a,s,u,d,g;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let h=p=>{var f,b;(b=(f=this.context).handleLinkClicked)==null||b.call(f,p)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let p=()=>{var I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},f=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ce(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=b,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let p=()=>{var N;this.adsIsShowing=!1,(N=t.afterAd)==null||N.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var N;this.adsIsShowing=!1,f.breakStatus="dismissed",(N=t.adDismissed)==null||N.call(t)},I=()=>{var N;this.adsIsShowing=!1,f.breakStatus="viewed",(N=t.adViewed)==null||N.call(t)},C=()=>{var N;this.adsIsShowing=!1,(N=t.adBreakDone)==null||N.call(t,f)},w=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ce(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=I,this.state.adBreakDone.value=C,this.state.adLinkClicked.value=h,this.state.adError.value=w});let k=()=>{var N;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(N=t.adBreakDone)==null||N.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ce(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(g=t.beforeReward)==null||g.call(t,k);break}}}},Au=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function ye(e,t,r){return(t=Gm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gm(e){var t=jm(e,"string");return typeof t=="symbol"?t:t+""}function jm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vo=class{constructor(t,r,n){ye(this,"adUnit",void 0),ye(this,"project",void 0),ye(this,"keyValue",void 0),ye(this,"adsContext",null),ye(this,"rewardedSlot",null),ye(this,"rewardedPayload",null),ye(this,"readyEvent",null),ye(this,"withCommand",function(){googletag.cmd.push(...arguments)}),ye(this,"init",()=>{var i;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var a;(a=this.rewardedSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.rewardedSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),ye(this,"destroy",i=>{var o,a;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(a=(o=this.adsContext)==null?void 0:o.adBreakDone)==null||a.call(o,i),this.adsContext=null}),ye(this,"reinit",i=>{this.destroy(i),this.init()}),ye(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),ye(this,"handleSlotClosed",i=>{var o,a;if(this.adsContext&&i.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit(s)})}}),ye(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),ye(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),ye(this,"requestAds",i=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=i,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var o,a,s;(a=(o=this.adsContext)==null?void 0:o.beforeAd)==null||a.call(o),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let o=a=>{a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,this.adsContext.beforeReward(()=>{var s,u,d;(u=(s=this.adsContext)==null?void 0:s.beforeAd)==null||u.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",o),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",o))},500)}})}),this.adUnit=t,this.project=r,this.keyValue=n,Au(),this.withCommand(()=>{this.init()})}};function Se(e,t,r){return(t=Hm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hm(e){var t=Vm(e,"string");return typeof t=="symbol"?t:t+""}function Vm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $o=class{constructor(t,r,n){var i=this;Se(this,"adUnit",void 0),Se(this,"project",void 0),Se(this,"keyValue",void 0),Se(this,"adsContext",null),Se(this,"gamingInterstitialSlot",null),Se(this,"readyEvent",null),Se(this,"isRetrying",!1),Se(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Se(this,"init",()=>{var o;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(o=this.gamingInterstitialSlot)==null||o.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),Se(this,"destroy",function(o){var a,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(a=i.adsContext)==null?void 0:a.onEnd)==null||s.call(a,o),i.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",i.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",i.handleSlotClosed),i.gamingInterstitialSlot&&(googletag.destroySlots([i.gamingInterstitialSlot]),i.gamingInterstitialSlot=null,i.readyEvent=null)}),Se(this,"reinit",function(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(o,a),i.init()}),Se(this,"handleSlotReady",o=>{this.gamingInterstitialSlot===o.slot&&(this.readyEvent=o)}),Se(this,"handleSlotClosed",o=>{var a,s;this.adsContext&&this.gamingInterstitialSlot===o.slot&&((s=(a=this.adsContext).afterAd)==null||s.call(a),this.withCommand(()=>{this.reinit("viewed")}))}),Se(this,"requestAds",o=>{this.withCommand(()=>{var a,s,u;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=o,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((a=o.beforeAd)==null||a.call(o),this.readyEvent.makeGameManualInterstitialVisible()):((u=(s=this.adsContext).onEnd)==null||u.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),Au(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function _t(e,t,r){return(t=$m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $m(e){var t=qm(e,"string");return typeof t=="symbol"?t:t+""}function qm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qo=class{constructor(t,r){_t(this,"name","GOOGLE_GPT"),_t(this,"context",void 0),_t(this,"contextInfo",void 0),_t(this,"initParams",void 0),_t(this,"rewardAdManager",void 0),_t(this,"interstitialManager",void 0),_t(this,"insertScript",()=>{let n="jolibox-google-gpt",i=document.getElementById(n);i||(i=window.document.createElement("script"),i.id=n,i.async=!0,i.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",i.crossOrigin="anonymous",document.head.appendChild(i))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,this.insertScript()}init(){return P(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,r=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,n=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new Vo(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new $o(r,n,this.initParams.keyValue))})}adConfig(t,r){}adBreak(t,r){var n,i,o;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:a})}});break}default:{if(!this.interstitialManager){(o=t.adBreakDone)==null||o.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:a})}});break}}}};function Co(e,t,r){return(t=Wm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wm(e){var t=Km(e,"string");return typeof t=="symbol"?t:t+""}function Km(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Co(this,"context",void 0),Co(this,"placement","GAME"),Co(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:tu.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Zl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:eu.WebSDK};return sh(i)}};function Ie(e,t,r){return(t=zm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zm(e){var t=Qm(e,"string");return typeof t=="symbol"?t:t+""}function Qm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vn=class{constructor(t){Ie(this,"context",void 0),Ie(this,"adsTrackSerializer",void 0),Ie(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new Wo(this.context)}getRequestContextData(t){var r,n;this.contextInfo=this.context.getContextInfo();let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},Ko=class{constructor(t,r){var n=this;Ie(this,"context",void 0),Ie(this,"contextInfo",void 0),Ie(this,"requestContext",void 0),Ie(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Ie(this,"pendingAFVAdsInfo",Promise.resolve(null)),Ie(this,"doFetchAdsInfo",i=>P(this,null,function*(){let o=i==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",a=i==="afv"?"REWARD_INTERSTITIAL":i==="reward"?"REWARD":"INTERSTITIAL",s=i==="afv"?void 0:"cached",{data:u,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(o),bizParams:this.requestContext.getRequestBizParams(),adsType:a,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:u}:null})),Ie(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Ie(this,"cacheInterstitialInfo",i=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(i).catch(()=>null)}),Ie(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Ie(this,"cacheNextAFGAdsInfo",i=>P(this,null,function*(){i==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(i)})),Ie(this,"getAFGAdsInfo",i=>P(this,null,function*(){let o=yield i==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(i),o})),Ie(this,"getAFVAdsInfo",function(){return P(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let i=yield n.pendingAFVAdsInfo;return n.cacheAFVInfo(),i}else return n.cacheAFVInfo(),yield n.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new Vn(t),r!=null&&r.reward&&this.cacheRewardInfo(),r!=null&&r.interstitial&&this.cacheInterstitialInfo("start"),r!=null&&r.afv&&this.cacheAFVInfo()}};function Je(e,t,r){return(t=Ym(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ym(e){var t=Xm(e,"string");return typeof t=="symbol"?t:t+""}function Xm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yr=class{constructor(t){if(Je(this,"context",void 0),Je(this,"contextInfo",void 0),Je(this,"providers",{}),Je(this,"channelPolicy",void 0),Je(this,"adsActionDetection",void 0),Je(this,"requestContext",void 0),Je(this,"adsRequest",void 0),Je(this,"initialized",!1),Je(this,"adsIsShowing",!1),Je(this,"lastAdBreak",void 0),Je(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new Lo(this.context),this.adsActionDetection=new Po(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Ko(t),this.requestContext=new Vn(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return P(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"GOOGLE_GPT":{let i=new qo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new No(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new jo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Ho(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return P(this,null,function*(){var r,n,i,o,a,s,u,d,g,h,p,f,b,I;let C=Date.now();if(C-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&C-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=C,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let w=yield this.adsRequest.getAFGAdsInfo(t.type),k=w==null?void 0:w.data,N=w==null?void 0:w.code;if(N==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var G,H,S,D;(G=t.beforeAd)==null||G.call(t),(H=t.adViewed)==null||H.call(t),(S=t.afterAd)==null||S.call(t),(D=t.adBreakDone)==null||D.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(u=t.beforeAd)==null||u.call(t),(d=t.afterAd)==null||d.call(t),(g=t.adBreakDone)==null||g.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!k||N!=="SUCCESS"){(h=t.adBreakDone)==null||h.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let G=k.sort((T,M)=>T.seq-M.seq);if(G.length===0){(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let H=!0,S=null,D=new xo(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;G.length>0;){let T=G.shift(),M=this.providers[T.provider];if(M){let[W,K]=yield D.callAdBreakAndContinue(M,t,T,ee=>{var he;this.adsIsShowing=ee,(he=this.context.eventEmitter)==null||he.emit("isAdShowing",ee)});H=W,S=K}else H=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!H)break}H&&S&&((f=t.adBreakDone)==null||f.call(t,S))}}catch(w){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(I=this.context.eventEmitter)==null||I.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}};var dw=jt`
|
|
168
|
+
${be}
|
|
169
169
|
position: fixed;
|
|
170
170
|
left: 0;
|
|
171
171
|
top: 0;
|
|
@@ -180,7 +180,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.ads-wrapper {
|
|
183
|
-
${
|
|
183
|
+
${be}
|
|
184
184
|
position: relative;
|
|
185
185
|
width: 100%;
|
|
186
186
|
height: 100%;
|
|
@@ -203,7 +203,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
.retry-button {
|
|
206
|
-
${
|
|
206
|
+
${be}
|
|
207
207
|
position: absolute;
|
|
208
208
|
width: 100%;
|
|
209
209
|
height: 100%;
|
|
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},rn=class extends ce{constructor(...t){super
|
|
|
213
213
|
cursor: pointer;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
`;me();var pb=di(Su());var Er=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var r,n;(n=(r=this.ads)==null?void 0:r.adConfig)==null||n.call(r,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Ar=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,o,a,s,u,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&t.data&&t.data.type==null){let h=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${h.type}`),h.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",h);break;case"huawei_quick_ads_on_message_ad_config":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",h)}break;case"huawei_quick_ads_on_message_ad_break":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p),b="noAdPreloaded",A=!1;switch(h.adsRes){case"viewed":b="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),A=!1;break;case"dismissed":b="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),A=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=h.adsRes,A=!0;break;case"breakDone":b=h.params,A=!0;break;case"beforeReward":(o=f==null?void 0:f.beforeReward)==null||o.call(f,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),A=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),A=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),A=!1;break}A&&((y=f==null?void 0:f.adBreakDone)==null||y.call(f,{breakType:(u=f.breakType)!=null?u:"",breakName:f.breakName,breakFormat:(d=f.breakFormat)!=null?d:"interstitial",breakStatus:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",h)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",h);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(r){console.error("init failed",r)}}adConfig(t){try{let r;t.onReady&&(r=++this.callbacksId,this.callbackMap.set(r,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",r,t)}catch(r){console.error("adConfig failed",r)}}adBreak(t){var r;try{let n=++this.callbacksId,i={};i.breakType=t.type,t.type!=="preroll"&&t.name&&(i.breakName=t.name),i.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(i.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(i.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(i.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(i.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(i.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(i.adViewed=t.adViewed),this.callbackMap.set(n,i),this.sendPostMessage("huawei_quick_ads_ad_break",n,t)}catch(n){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(r){console.error("adUnit failed",r)}}sendPostMessage(t,r,n){var i;try{if(!((i=window.system)!=null&&i.postMessage))throw new Error("window.system.postMessage is not available");let o=Q(Q({type:t},r!==void 0&&{callbackId:r}),n!==void 0&&{data:n});window.system.postMessage(JSON.stringify(o))}catch(o){throw console.error("sendPostMessage failed",o),o}}};var Ir=class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}getAdsInstance(){return e.getInstance()}init(){}adConfig(t){t.onReady&&t.onReady()}adBreak(t){var r;try{t.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var n;(n=t.beforeReward)==null||n.call(t,()=>{t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("rewarded").then(i=>{var o,a,s,u,d;(o=i==null?void 0:i.args)!=null&&o.success?(a=t.adViewed)==null||a.call(t):(s=t.adDismissed)==null||s.call(t),t.afterAd&&t.afterAd(),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(u=i==null?void 0:i.args)!=null&&u.success?"viewed":"dismissed"})}).catch(i=>{var o;console.log("showReward error => ",i),(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(n=>{var i;console.log("preloadAd error => ",n),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(t.type!=="preroll"&&t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var n;t.type!=="preroll"&&t.afterAd&&t.afterAd(),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(n){console.log("adBreak error => ",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};var gt=class{constructor(t,r){this.ads=t;this.httpClient=r}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return P(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Qe.getRewardsTypes(this.httpClient);yield Qe.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}};var Sr=class e extends gt{constructor(t,r){super(t,r),this.startTimes=Date.now()}adBreak(t){return P(this,null,function*(){var r,n;if(t.type!=="reward"){if(t.type==="preroll"){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let i=Date.now();if(console.log("FunmaxAdsHandler time => ",i-this.startTimes),i-this.startTimes<4e4){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}ka(e.prototype,this,"adBreak").call(this,t)})}};var Zo=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Er(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Ar.getInstance();break}case"gamedistribution":{this.cacheHandler=Ir.getInstance();break}case"funmax":{let r=new gr(this.context);this.cacheHandler=new Sr(r,Rr);break}default:{let r=new gr(this.context);this.cacheHandler=new gt(r,Rr);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Wn=_e(),Ru=new je,Rr=Be.create(),Ym={httpClient:Rr,checkNetwork:()=>Be.getNetworkStatus(),track:Le,eventEmitter:Ru,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=D.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=D.deviceInfo.did)!=null?r:"",adId:(n=D.deviceInfo.adId)!=null?n:"",sessionId:(i=D.sessionId)!=null?i:"",userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:D.mpId,testAdsMode:D.testAdsMode,channel:(s=D.joliSource)!=null?s:"",deviceBrand:D.deviceInfo.brand,deviceModel:D.deviceInfo.model,osType:Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=D.joliSource)!=null?u:""}}},Cu=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},Xm=new Zo(Ym),Cr=Xm.getAdsHandler(D.sdkEnvironment);Qe.registerRewardHandler("ADS",Ds(Cr.getAdsInstance()));Qe.registerRewardHandler("JOLI_COIN",Ls(Rr,{onUnlockSuccess:Cu.bind(void 0)}));Qe.registerRewardHandler("JOLI_COIN_ONLY",Us(Rr,{onUnlockSuccess:Cu.bind(void 0)}));Ru.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Wn.registerCommand("AdsSDK.init",e=>{Cr.init(e)});Wn.registerCommand("AdsSDK.adConfig",e=>{Cr.adConfig(e)});Wn.registerCommand("AdsSDK.adBreak",e=>{Cr.adBreak(e)});Wn.registerCommand("AdsSDK.adUnit",e=>{Cr.adUnit(e)});V();it();var ku=_e();ku.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Le("loadFinished",{duration:e})});ku.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});V();it();var Nu=-1,Qn=function(e){addEventListener("pageshow",function(t){t.persisted&&(Nu=t.timeStamp,e(t))},!0)},ta=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Yn=function(){var e=ta();return e&&e.activationStart||0},Vt=function(e,t){var r=ta(),n="navigate";return Nu>=0?n="back-forward-cache":r&&(document.prerendering||Yn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Lu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Ht=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Uu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Mu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Bu=function(e){var t=!1;return function(){t||(e(),t=!0)}},Jt=-1,xu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},zn=function(e){document.visibilityState==="hidden"&&Jt>-1&&(Jt=e.type==="visibilitychange"?e.timeStamp:0,Zm())},Tu=function(){addEventListener("visibilitychange",zn,!0),addEventListener("prerenderingchange",zn,!0)},Zm=function(){removeEventListener("visibilitychange",zn,!0),removeEventListener("prerenderingchange",zn,!0)},Fu=function(){return Jt<0&&(Jt=xu(),Tu(),Qn(function(){setTimeout(function(){Jt=xu(),Tu()},0)})),{get firstHiddenTime(){return Jt}}},ra=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ou=[1800,3e3],ju=function(e,t){t=t||{},ra(function(){var r,n=Fu(),i=Vt("FCP"),o=Lu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Yn(),0),i.entries.push(s),r(!0)))})});o&&(r=Ht(e,i,Ou,t.reportAllChanges),Qn(function(a){i=Vt("FCP"),r=Ht(e,i,Ou,t.reportAllChanges),Uu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var ep=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Bu(e),document.visibilityState==="hidden"?e():(r=t(e),Mu(e)),r};var Pu=[2500,4e3],ea={},Ju=function(e,t){t=t||{},ra(function(){var r,n=Fu(),i=Vt("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Yn(),0),i.entries=[d],r())})},a=Lu("largest-contentful-paint",o);if(a){r=Ht(e,i,Pu,t.reportAllChanges);var s=Bu(function(){ea[i.id]||(o(a.takeRecords()),a.disconnect(),ea[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return ep(s)},{once:!0,capture:!0})}),Mu(s),Qn(function(u){i=Vt("LCP"),r=Ht(e,i,Pu,t.reportAllChanges),Uu(function(){i.value=performance.now()-u.timeStamp,ea[i.id]=!0,r(!0)})})}})},Du=[800,1800],tp=function e(t){document.prerendering?ra(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Vu=function(e,t){t=t||{};var r=Vt("TTFB"),n=Ht(e,r,Du,t.reportAllChanges);tp(function(){var i=ta();i&&(r.value=Math.max(i.responseStart-Yn(),0),r.entries=[i],n(!0),Qn(function(){r=Vt("TTFB",0),(n=Ht(e,r,Du,t.reportAllChanges))(!0)}))})};me();At();Ge();function rp(){ju(e=>{Le("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Ju(e=>{Le("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Vu(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function np(){return P(this,null,function*(){let e=Be.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return xe(new Nr(t)),!1}})}function ip(){ft.on("onDocumentReady",e=>P(this,null,function*(){let t=yield np();D.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),ft.emit("LifecycleEvent.onReady",Q({},D.hostUserInfo?D.hostUserInfo:{isLogin:!1})),D.mpType==="game"&&Ke.start(Date.now()-e)}))}function Hu(){ip(),rp()}Hu();
|
|
216
|
+
`;me();var Kw=hi(Cu());var Ir=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var r,n;(n=(r=this.ads)==null?void 0:r.adConfig)==null||n.call(r,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Ar=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,o,a,s,u,d,g;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&t.data&&t.data.type==null){let h=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${h.type}`),h.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",h);break;case"huawei_quick_ads_on_message_ad_config":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",h)}break;case"huawei_quick_ads_on_message_ad_break":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p),b="noAdPreloaded",I=!1;switch(h.adsRes){case"viewed":b="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),I=!1;break;case"dismissed":b="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),I=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=h.adsRes,I=!0;break;case"breakDone":b=h.params,I=!0;break;case"beforeReward":(o=f==null?void 0:f.beforeReward)==null||o.call(f,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),I=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),I=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),I=!1;break}I&&((g=f==null?void 0:f.adBreakDone)==null||g.call(f,{breakType:(u=f.breakType)!=null?u:"",breakName:f.breakName,breakFormat:(d=f.breakFormat)!=null?d:"interstitial",breakStatus:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",h)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",h);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(r){console.error("init failed",r)}}adConfig(t){try{let r;t.onReady&&(r=++this.callbacksId,this.callbackMap.set(r,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",r,t)}catch(r){console.error("adConfig failed",r)}}adBreak(t){var r;try{let n=++this.callbacksId,i={};i.breakType=t.type,t.type!=="preroll"&&t.name&&(i.breakName=t.name),i.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(i.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(i.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(i.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(i.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(i.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(i.adViewed=t.adViewed),this.callbackMap.set(n,i),this.sendPostMessage("huawei_quick_ads_ad_break",n,t)}catch(n){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(r){console.error("adUnit failed",r)}}sendPostMessage(t,r,n){var i;try{if(!((i=window.system)!=null&&i.postMessage))throw new Error("window.system.postMessage is not available");let o=Q(Q({type:t},r!==void 0&&{callbackId:r}),n!==void 0&&{data:n});window.system.postMessage(JSON.stringify(o))}catch(o){throw console.error("sendPostMessage failed",o),o}}};var Sr=class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}getAdsInstance(){return e.getInstance()}init(){}adConfig(t){t.onReady&&t.onReady()}adBreak(t){var r;try{t.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var n;(n=t.beforeReward)==null||n.call(t,()=>{t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("rewarded").then(i=>{var o,a,s,u,d;(o=i==null?void 0:i.args)!=null&&o.success?(a=t.adViewed)==null||a.call(t):(s=t.adDismissed)==null||s.call(t),t.afterAd&&t.afterAd(),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(u=i==null?void 0:i.args)!=null&&u.success?"viewed":"dismissed"})}).catch(i=>{var o;console.log("showReward error => ",i),(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(n=>{var i;console.log("preloadAd error => ",n),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(t.type!=="preroll"&&t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var n;t.type!=="preroll"&&t.afterAd&&t.afterAd(),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(n){console.log("adBreak error => ",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};var gt=class{constructor(t,r){this.ads=t;this.httpClient=r}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return P(this,null,function*(){var r;if(t.type==="reward")try{let n=yield st.getRewardsTypes(this.httpClient);yield st.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}};var Cr=class e extends gt{constructor(t,r){super(t,r),this.startTimes=Date.now()}adBreak(t){return P(this,null,function*(){var r,n;if(t.type!=="reward"){if(t.type==="preroll"){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let i=Date.now();if(console.log("FunmaxAdsHandler time => ",i-this.startTimes),i-this.startTimes<4e4){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}ka(e.prototype,this,"adBreak").call(this,t)})}};var ea=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Ir(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Ar.getInstance();break}case"gamedistribution":{this.cacheHandler=Sr.getInstance();break}case"funmax":{let r=new yr(this.context);this.cacheHandler=new Cr(r,zn);break}default:{let r=new yr(this.context);this.cacheHandler=new gt(r,zn);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Qn=_e(),Ru=new Fe,zn=Be.create(),Zm={httpClient:zn,checkNetwork:()=>Be.getNetworkStatus(),track:Ue,eventEmitter:Ru,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=L.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=L.deviceInfo.did)!=null?r:"",adId:(n=L.deviceInfo.adId)!=null?n:"",sessionId:(i=L.sessionId)!=null?i:"",userId:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:L.mpId,testAdsMode:L.testAdsMode,channel:(s=L.joliSource)!=null?s:"",deviceBrand:L.deviceInfo.brand,deviceModel:L.deviceInfo.model,osType:Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=L.joliSource)!=null?u:""}}},ep=new ea(Zm),Rr=ep.getAdsHandler(L.sdkEnvironment);st.registerRewardHandler("ADS",Ns(Rr.getAdsInstance()));st.registerRewardHandler("JOLI_COIN",Ms(zn,{onUnlockSuccess:e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})}}));Ru.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Qn.registerCommand("AdsSDK.init",e=>{Rr.init(e)});Qn.registerCommand("AdsSDK.adConfig",e=>{Rr.adConfig(e)});Qn.registerCommand("AdsSDK.adBreak",e=>{Rr.adBreak(e)});Qn.registerCommand("AdsSDK.adUnit",e=>{Rr.adUnit(e)});j();ot();var Ou=_e();Ou.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Ue("loadFinished",{duration:e})});Ou.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});j();ot();var Nu=-1,Xn=function(e){addEventListener("pageshow",function(t){t.persisted&&(Nu=t.timeStamp,e(t))},!0)},ra=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Zn=function(){var e=ra();return e&&e.activationStart||0},qt=function(e,t){var r=ra(),n="navigate";return Nu>=0?n="back-forward-cache":r&&(document.prerendering||Zn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Du=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Wt=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Uu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Mu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Bu=function(e){var t=!1;return function(){t||(e(),t=!0)}},$t=-1,ku=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Yn=function(e){document.visibilityState==="hidden"&&$t>-1&&($t=e.type==="visibilitychange"?e.timeStamp:0,tp())},Tu=function(){addEventListener("visibilitychange",Yn,!0),addEventListener("prerenderingchange",Yn,!0)},tp=function(){removeEventListener("visibilitychange",Yn,!0),removeEventListener("prerenderingchange",Yn,!0)},Ju=function(){return $t<0&&($t=ku(),Tu(),Xn(function(){setTimeout(function(){$t=ku(),Tu()},0)})),{get firstHiddenTime(){return $t}}},na=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},xu=[1800,3e3],Fu=function(e,t){t=t||{},na(function(){var r,n=Ju(),i=qt("FCP"),o=Du("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Zn(),0),i.entries.push(s),r(!0)))})});o&&(r=Wt(e,i,xu,t.reportAllChanges),Xn(function(a){i=qt("FCP"),r=Wt(e,i,xu,t.reportAllChanges),Uu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var rp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Bu(e),document.visibilityState==="hidden"?e():(r=t(e),Mu(e)),r};var Pu=[2500,4e3],ta={},Gu=function(e,t){t=t||{},na(function(){var r,n=Ju(),i=qt("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Zn(),0),i.entries=[d],r())})},a=Du("largest-contentful-paint",o);if(a){r=Wt(e,i,Pu,t.reportAllChanges);var s=Bu(function(){ta[i.id]||(o(a.takeRecords()),a.disconnect(),ta[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return rp(s)},{once:!0,capture:!0})}),Mu(s),Xn(function(u){i=qt("LCP"),r=Wt(e,i,Pu,t.reportAllChanges),Uu(function(){i.value=performance.now()-u.timeStamp,ta[i.id]=!0,r(!0)})})}})},Lu=[800,1800],np=function e(t){document.prerendering?na(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},ju=function(e,t){t=t||{};var r=qt("TTFB"),n=Wt(e,r,Lu,t.reportAllChanges);np(function(){var i=ra();i&&(r.value=Math.max(i.responseStart-Zn(),0),r.entries=[i],n(!0),Xn(function(){r=qt("TTFB",0),(n=Wt(e,r,Lu,t.reportAllChanges))(!0)}))})};me();It();$e();function ip(){Fu(e=>{Ue("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Gu(e=>{Ue("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),ju(e=>{Ue("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function op(){return P(this,null,function*(){let e=Be.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return ke(new Nr(t)),!1}})}function ap(){ft.on("onDocumentReady",e=>P(this,null,function*(){let t=yield op();L.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),ft.emit("LifecycleEvent.onReady",Q({},L.hostUserInfo?L.hostUserInfo:{isLogin:!1})),L.mpType==="game"&&We.start(Date.now()-e)}))}function Hu(){ap(),ip()}Hu();
|
|
217
217
|
/*! Bundled license information:
|
|
218
218
|
|
|
219
219
|
localforage/dist/localforage.js:
|