@jolibox/implement 1.1.49 → 1.1.50
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 +9 -8
- package/dist/index.js +25 -25
- package/dist/index.native.js +48 -48
- package/dist/native/api/call-host-method.d.ts +1 -0
- package/dist/native/api/index.d.ts +1 -0
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/api-factory/index.ts +2 -2
- package/src/common/rewards/fetch-reward.ts +5 -0
- package/src/h5/api/task.ts +16 -10
- package/src/native/api/call-host-method.ts +64 -0
- package/src/native/api/index.ts +1 -0
- package/src/native/api/navigate.ts +1 -4
- package/src/native/api/task.ts +14 -8
- package/src/native/rewards/ui/unlogin-modal.ts +15 -5
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var jc=Object.create;var oi=Object.defineProperty,Jc=Object.defineProperties,Vc=Object.getOwnPropertyDescriptor,Hc=Object.getOwnPropertyDescriptors,$c=Object.getOwnPropertyNames,kr=Object.getOwnPropertySymbols,Ea=Object.getPrototypeOf,ai=Object.prototype.hasOwnProperty,Aa=Object.prototype.propertyIsEnumerable,Gc=Reflect.get;var wa=(e,t,r)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))ai.call(t,r)&&wa(e,r,t[r]);if(kr)for(var r of kr(t))Aa.call(t,r)&&wa(e,r,t[r]);return e},_e=(e,t)=>Jc(e,Hc(t));var Ht=(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 Ia=(e,t)=>{var r={};for(var n in e)ai.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kr)for(var n of kr(e))t.indexOf(n)<0&&Aa.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var si=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $c(t))!ai.call(e,i)&&i!==r&&oi(e,i,{get:()=>t[i],enumerable:!(n=Vc(t,i))||n.enumerable});return e};var li=(e,t,r)=>(r=e!=null?jc(Ea(e)):{},qc(t||!e||!e.__esModule?oi(r,"default",{value:e,enumerable:!0}):r,e));var Sa=(e,t,r)=>Gc(Ea(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function td(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Da(e){return new Promise(t=>setTimeout(t,e))}function vi(e){return typeof e=="string"}function Na(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function La(e){return typeof e=="object"&&Array.isArray(e)}function rd(e){return typeof e=="undefined"}function nd(e){return rd(e)||e===null}function id(e){return typeof e=="function"}function Ua(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Ma(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],l=o[a],d=r(s,l,a,i,o);d!==void 0?i[a]=d:ka(l)&&ka(s)?i[a]=n(Oa({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function ka(e){return e&&typeof e=="object"&&e.constructor===Object}function Ba(e,t){if(Array.isArray(e))return e.concat(t)}function Kt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!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,l&&!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 sd(e,t){return(...r)=>t(e,...r)}function Va(e){return t=>sd(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new ad(`${i}`))}})}function $t(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Tr(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 hd(e){let t=e.location?Tr(e.location,xa):null,r=e.target?Tr(e.target,xa):null;return Tr(Xc(Oa({},e),{location:t,target:r}),dd)}function wi(e){let t=e.events.map(n=>hd(n)),r=Tr(e.device,fd);return[e.protocolVersion,t,r,e.project]}function md(){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 Id(e){return new Promise(t=>Ga(e)(t))}function Ga(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Sd(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 Cd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)kd(e[n],t[n])}function kd(e,t){if(vi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(id(t)){try{if(e instanceof t)return}catch(r){}if(!nd(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 Td(){return typeof globalThis!="undefined"?globalThis[qa]:void 0}function xd(e){typeof globalThis!="undefined"&&(globalThis[qa]=e)}function ge(e=!1){let t=Td();if(!e&&t)return t;let r=new xr,n=new mi,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 xd(i),i}var pi,Kc,Wc,zc,Ra,Qc,Yc,Ca,Oa,Xc,Zc,Pa,ed,od,_i,gi,Fa,ja,ad,Ja,Or,Pr,yi,Ne,ci,ld,bi,Ta,ud,ut,bt,cd,xa,dd,fd,ct,pd,Ae,vd,_d,gd,Ha,Ei,Ai,yd,bd,$a,di,te,wd,Ed,Gt,qt,je,hi,Ad,ui,Rd,Wt,xr,mi,qa,H=Z(()=>{"use strict";pi=Object.defineProperty,Kc=Object.defineProperties,Wc=Object.getOwnPropertyDescriptor,zc=Object.getOwnPropertyDescriptors,Ra=Object.getOwnPropertySymbols,Qc=Object.prototype.hasOwnProperty,Yc=Object.prototype.propertyIsEnumerable,Ca=(e,t,r)=>t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oa=(e,t)=>{for(var r in t||(t={}))Qc.call(t,r)&&Ca(e,r,t[r]);if(Ra)for(var r of Ra(t))Yc.call(t,r)&&Ca(e,r,t[r]);return e},Xc=(e,t)=>Kc(e,zc(t)),Zc=(e,t)=>{for(var r in t)pi(e,r,{get:t[r],enumerable:!0})},Pa=(e,t,r,n)=>{for(var i=n>1?void 0:n?Wc(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&&pi(t,r,i),i},ed=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.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}od=(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))(od||{}),_i=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}},gi=class extends _i{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Fa=class extends _i{constructor(){super(...arguments),this.kind="USER_ERROR"}},ja=class extends Fa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ad=class extends Fa{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))}},Ja=class extends gi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Or=class extends gi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Pr=class extends _i{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}}},yi=class extends gi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:$t("log"),warn:$t("warn"),info:$t("info"),error:$t("error"),debug:$t("debug")};Object.assign(globalThis,{logger:Ne});ci=Symbol.for("Jolibox.canIUseMap"),ld={};globalThis[ci]||(globalThis[ci]=ld);bi={get config(){return globalThis[ci]}},Ta=Symbol.for("Jolibox.canIUseMap.native"),ud={};globalThis[Ta]||(globalThis[Ta]=ud);ut=(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))(ut||{}),bt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(bt||{}),cd=(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))(cd||{}),xa=["name","params"],dd=["name","type","location","target","extra","timestamp","userId"],fd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ct=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});md();pd=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ae={isiOS: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:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},vd=()=>Ae.isiOS?"iOS":Ae.isAndroid?"Android":Ae.isMac?"Mac":Ae.isFacebook?"Facebook":"PC",_d="device_id",gd="advertising_id",Ha=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ct()),window.__joliboxLocalStorage__.getItem(e)),Ei=()=>new URLSearchParams(window.location.search).get("deviceId")||Ha(_d),Ai=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ha(gd),yd=e=>e.charAt(0).toUpperCase()+e.slice(1),bd=()=>{var e;let t=new URLSearchParams(window.location.search);return yd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},$a=e=>{if(pd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=vd(),n=navigator.language,i=Ei(),o=Ai();return`${t} (${bd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},di=class fi{constructor(t){this.element=t,this.next=fi.Undefined,this.prev=fi.Undefined}};di.Undefined=new di(void 0);te=di,wd=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}},Ed=0,Gt=class{constructor(e){this.value=e,this.id=Ed++}},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 Gt&&(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,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Gt(t);return this._listeners?this._listeners instanceof Gt?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)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof Gt)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 Gt?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=l=>t(...l.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 l of s)t(...l.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 wd,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)}},hi={};Zc(hi,{None:()=>Ad,filter:()=>Sd,once:()=>Ga,toPromise:()=>Id});Ad=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});ui=Symbol.for("Jolibox.hostEmitter"),Rd=()=>{let e=new je;return globalThis[ui]||(globalThis[ui]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[ui]},Wt=Rd();xr=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 Cd(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}};xr=Pa([Ua],xr);mi=class{constructor(){this._onWillExecuteCommand=new qt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new qt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new xr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=td(3e4)),this._starActivation}executeCommand(e,...t){return ed(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),hi.toPromise(hi.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}}};mi=Pa([Ua],mi);qa=Symbol.for("Jolibox.commands")});function Te(e,t={}){Ii.emit("ERROR_REPORT",{error:e,options:t})}var Ii,dt,Ge=Z(()=>{"use strict";H();H();Ii=new je,dt=new je;Te.debounce=Kt(Te,50,{leading:!0})});var Si,Od,Ka,Wa,za=Z(()=>{"use strict";H();Ge();Si=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{}}},Od=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ka=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:Si(o),payloadJson:Si(a),signature:Si(s)}}else throw"joli_source is missing"}catch(r){return Te(new Ja(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Wa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Od(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Pd,Dr,Qa,Ri=Z(()=>{"use strict";H();Pd="1.1.49",Dr=()=>Pd,Qa=()=>{let e=Dr();return`${$a(e)}`}});function ki(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Dd,Ya,Ci,Xa,oe,Nd,D,me=Z(()=>{"use strict";H();za();Ri();H();Dd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Ei(),adId:Ai(),pixelRatio:window.devicePixelRatio||1,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Dr()},schema:window.location.href,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5"},Ci=(Ya=globalThis.joliboxJSCore)==null?void 0:Ya.env,oe=Object.assign({},(Xa=Ci==null?void 0:Ci())!=null?Xa:Dd);Nd=()=>{var f,b,A,R,w,T,N,F,V,S,L;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Ka(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.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=(T=(w=(R=oe.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?T:n,l=!!((F=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?F:o.get("testAdsMode")==="true"),d=(L=(S=(V=e==null?void 0:e.joliboxEnv)!=null?V: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 O;return(O=performance.timeOrigin)!=null?O:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Dr()},get mpType(){var O,M;return(M=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,M;return(M=(O=oe.clientSessionId)!=null?O:s)!=null?M:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-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 O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return ki("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":ki("gamedistribution","jolibox")?"gamedistribution":ki("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var z,ee,he;let O=(z=oe.deviceInfo.pixelRatio)!=null?z:1,M=(ee=oe.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,W=(he=oe.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/O:20,navigationBarHeight:W!==void 0?W/O:10}},onEnvConfigChanged:O=>{Ma(oe,O,Ba)},encodeJoliSourceQuery:O=>{var M,W;return t&&r?Wa($($({},e),O),(M=o.get("joliSource"))!=null?M:""):(W=o.get("joliSource"))!=null?W:""},setDoExitDirectly:()=>{p=!1}}},D=Nd()});var Ti,es,Ld,Ud,Za,Md,ts=Z(()=>{"use strict";H();Ge();me();H();Ti=!1,es=(e,t)=>e==null?!1:t in e,Ld=e=>es(e,"kind"),Ud=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Za=(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:Ud(e.name)},i=_e($({},n),{env:t.environment,isFromUser:r});r?dt.emit("GLOBAL_USER_ERROR",e,i):dt.emit("GLOBAL_ERROR",e,i)},Md=e=>es(e,"kind")&&e.kind==="USER_ERROR";Ii.on("ERROR_REPORT",({error:e,options:t})=>{if(Ti)return;Ti=!0;let r=Ld(e)&&e.raw?e.raw:e;try{let n=Md(e);Za(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new yi(`${i}, origin error: ${r.message}`);Ne.error(o),Za(new yi(o.message),{environment:t.environment},!1)}finally{Ti=!1}})});var xi,Oi=Z(()=>{"use strict";Ge();H();Ge();xi=e=>new ja(e)});function rs(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ia(d,["eventType"]),l=_e($({tag:n,eventType:o!=null?o:a!=null?a:ut.Other},t),{extra:$({},s)});n=="globalJsError"?Te(new Or(JSON.stringify(l))):e("systemLog",l,D.webviewId)};return r.debounce=Kt(r,500,{leading:!0}),r}function ns(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=Kt(t,500,{leading:!0}),t}var is=Z(()=>{"use strict";H();H();Ge();me()});function os(e,t){let r=rs(e,t),n=ns(r);return{track:r,trackPerformance:n}}var as=Z(()=>{"use strict";is()});var Pi=Z(()=>{"use strict"});var Nr,ss=Z(()=>{"use strict";me();H();H();Nr=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:[_e($({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(wi(d),n):yield this.doReport(wi(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Di=Z(()=>{"use strict";as();Pi();ss()});var Ni,ls,qe,Lr,Be,wt=Z(()=>{"use strict";Ri();me();H();Ni=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ls=AbortSignal.timeout)!=null||(AbortSignal.timeout=Ni);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 Lr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Lr=class{constructor(t){this.xua=Qa();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(),l=`${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(l,{method:"GET",headers:o,credentials:"include",signal:Ni(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,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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":Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Ni(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,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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=Lr;Be=qe.getInstance()});var Li,Ur,Ui=Z(()=>{"use strict";me();Di();wt();Li=class extends Nr{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)})}},Ur=new Li});var Bd,us=Z(()=>{"use strict";ts();H();Oi();H();Ui();me();Bd=(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:ut.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Ur.trackEvent(n,bt.WebSDK)};dt.on("GLOBAL_ERROR",(e,t)=>{Bd(t.tag,e)});dt.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var Mr,cs=Z(()=>{"use strict";Mr=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)},l=()=>{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():l())});let p=this.visible;return{start(){o||(o=!0,p?d():l())},stop(){o=!1,y(),h()}}}}});var Br,ds=Z(()=>{"use strict";me();cs();wt();Br=class extends Mr{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}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:$({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var fs,Fd,Le,jd,Mi,ft,nt=Z(()=>{"use strict";us();H();H();Di();Ui();ds();me();Pi();fs=ge(),Fd={type:bt.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Le,trackPerformance:jd}=os((...e)=>{var a,s,l,d;let[,t]=e,r=t,n=Na(r.extra)?r.extra:vi(r.extra)?JSON.parse(r.extra):{},i=_e($({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:ut.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(l=D.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Ur.trackEvent(o,bt.WebSDK)},Fd);fs.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{jd(e,t,r)});fs.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});Mi=new je,ft=new Br(Le,Mi)});function hs(e){let t=bi.config[e];return t||(t={},bi.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=$({},n)}}var ms=Z(()=>{"use strict";H()});function Bi(e){ps=e}function Fr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Fr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Fr(e[r]),t),{})}function Ke(e){return typeof e=="number"}function Fi(e){let t=ji(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function ji(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var ps,ce,jr,Jr,Vr,Hr,Et,$r,Gr,qr,Kr,Wr,zr,Qr,Yr,Xr,Zr,en,tn,Ji=Z(()=>{"use strict";ps=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(ps)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 ${Fi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Fr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Fr(this._default)}optional(){return this._optional=!0,this}};jr=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}},Jr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Vr=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}},Hr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Et=class extends ce{validate(t){return!0}},$r=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Gr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Kr=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 ${Fi(t)}`)}return!0}},Wr=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}},zr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(ji(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 l=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}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Qr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(ji(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}},Yr=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Fi(this.value),actual:r}):!0}},Xr=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}},
|
|
3
|
-
`);throw e.errors.length=0,Bi(!1),new TypeError(n)}}var j,Hi=Z(()=>{"use strict";Ji();Ji();j={object(e){return new Qr(e)},array(e){return new Wr(e)},tuple(...e){return new Zr(...e)},literal(e){return new Yr(e)},or(...e){return new Xr(...e)},symbol(){return new Hr},record(e){return new zr(e)},function(){return new qr},boolean(){return new Jr},string(){return new Vr},number(){return new jr},undefined(){return new $r},null(){return new Gr},unknown(){return new Et},any(){return new Et},as(){return new Et},arraybuffer(){return new en},enum(...e){return new Kr(...e)},typedarray(e){return new tn(e)}}});var rn,vs,_s=Z(()=>{"use strict";H();Ge();Hi();Oi();rn=1,vs=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:rn};rn+=1;let l="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Vi(i.paramsSchema,o,"params")}catch(T){throw xi(`${n}:fail ${T.message}`)}let A=i.implement(...o),R=A,w=`${n}:ok`;if(A&&"code"in A){let{code:T,data:N,message:F}=A;l=T,R=N,w=F}return{code:l,message:w,data:R}}catch(A){let R=A;y=(p=(h=R.code)!=null?h:R.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(f=R.message)!=null?f:R.errMsg)!=null?b:`${A}`;return d=`${n}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,Te(new Pr(d,y)),{code:l,message:d}}finally{let A=Date.now()-a;e("apiInvoked",_e($({},s),{duration:A,status:l}))}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,A;let a=La(o)?o:[o],s=Date.now(),l={method:n,trace_id:rn};rn+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Vi(i.paramsSchema,a,"params")}catch(T){throw xi(T.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:T,data:N,message:F}=w;y=T,d=F,w=N}return Object.assign(h,{code:y,message:d,data:w}),h}catch(R){let w=R,T=(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}`,F=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:F}),Te(new Pr(F,T)),h}finally{let R=Date.now()-s;e("apiInvoked",_e($({},l),{duration:R,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var We,ht,ye,zt=Z(()=>{"use strict";ms();nt();_s();Hi();({createAPI:We,createSyncAPI:ht}=vs(Le)),ye=hs("h5")});var ws=si((bs,Ki)=>{(function(e){if(typeof bs=="object"&&typeof Ki!="undefined")Ki.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 Ht=="function"&&Ht;if(!h&&p)return p(y,!0);if(l)return l(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 l=typeof Ht=="function"&&Ht,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,l;if(s){var d=0,y=new s(A),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=A,l=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=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)}:l=function(){setTimeout(A,0)};var f,b=[];function A(){f=!0;for(var w,T,N=b.length;N;){for(T=b,b=[],w=-1;++w<N;)T[w]();N=b.length}f=!1}i.exports=R;function R(w){b.push(w)===1&&!f&&l()}}).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 l={},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 O=new this.constructor(s);if(this.state!==h){var M=this.state===y?S:L;b(O,M,this.outcome)}else this.queue.push(new f(O,S,L));return O};function f(S,L,O){this.promise=S,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){l.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){l.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,L,O){a(function(){var M;try{M=L(O)}catch(W){return l.reject(S,W)}M===S?l.reject(S,new TypeError("Cannot resolve promise with itself")):l.resolve(S,M)})}l.resolve=function(S,L){var O=w(A,L);if(O.status==="error")return l.reject(S,O.value);var M=O.value;if(M)R(S,M);else{S.state=y,S.outcome=L;for(var W=-1,z=S.queue.length;++W<z;)S.queue[W].callFulfilled(L)}return S},l.reject=function(S,L){S.state=d,S.outcome=L;for(var O=-1,M=S.queue.length;++O<M;)S.queue[O].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 O=!1;function M(he){O||(O=!0,l.reject(S,he))}function W(he){O||(O=!0,l.resolve(S,he))}function z(){L(W,M)}var ee=w(z);ee.status==="error"&&M(ee.value)}function w(S,L){var O={};try{O.value=S(L),O.status="success"}catch(M){O.status="error",O.value=M}return O}p.resolve=T;function T(S){return S instanceof this?S:l.resolve(new this(s),S)}p.reject=N;function N(S){var L=new this(s);return l.reject(L,S)}p.all=F;function F(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=S.length,M=!1;if(!O)return this.resolve([]);for(var W=new Array(O),z=0,ee=-1,he=new this(s);++ee<O;)He(S[ee],ee);return he;function He(jt,Sr){L.resolve(jt).then(zn,function(gt){M||(M=!0,l.reject(he,gt))});function zn(gt){W[Sr]=gt,++z===O&&!M&&(M=!0,l.resolve(he,W))}}}p.race=V;function V(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=S.length,M=!1;if(!O)return this.resolve([]);for(var W=-1,z=new this(s);++W<O;)ee(S[W]);return z;function ee(he){L.resolve(he).then(function(He){M||(M=!0,l.resolve(z,He))},function(He){M||(M=!0,l.reject(z,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(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u};function s(u,m){if(!(u instanceof m))throw new TypeError("Cannot call a class as a function")}function l(){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(u){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var u=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(!u||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(u,m){u=u||[],m=m||{};try{return new Blob(u,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<u.length;g+=1)_.append(u[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(u,m){m&&u.then(function(c){m(null,c)},function(c){m(c)})}function b(u,m,c){typeof m=="function"&&u.then(m),typeof c=="function"&&u.catch(c)}function A(u){return typeof u!="string"&&(console.warn(u+" used as a key, but it is not a string."),u=String(u)),u}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",T=void 0,N={},F=Object.prototype.toString,V="readonly",S="readwrite";function L(u){for(var m=u.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=u.charCodeAt(g);return c}function O(u){return new p(function(m){var c=u.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(u){return typeof T=="boolean"?p.resolve(T):O(u).then(function(m){return T=m,T})}function W(u){var m=N[u.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 z(u){var m=N[u.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(u,m){var c=N[u.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(u,m){return new p(function(c,_){if(N[u.name]=N[u.name]||ta(),u.db)if(m)W(u),u.db.close();else return c(u.db);var g=[u.name];m&&g.push(u.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var I=v.result;try{I.createObjectStore(u.storeName),E.oldVersion<=1&&I.createObjectStore(w)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+u.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+u.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),z(u)}})}function He(u){return he(u,!1)}function jt(u){return he(u,!0)}function Sr(u,m){if(!u.db)return!0;var c=!u.db.objectStoreNames.contains(u.storeName),_=u.version<u.db.version,g=u.version>u.db.version;if(_&&(u.version!==m&&console.warn('The database "'+u.name+`" can't be downgraded from version `+u.db.version+" to version "+u.version+"."),u.version=u.db.version),g||c){if(c){var v=u.db.version+1;v>u.version&&(u.version=v)}return!0}return!1}function zn(u){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:u.type})},_.readAsBinaryString(u)})}function gt(u){var m=L(atob(u.data));return h([m],{type:u.type})}function ea(u){return u&&u.__local_forage_encoded_blob}function Ju(u){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,u,u),c}function Vu(u){W(u);for(var m=N[u.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return u.db=null,He(u).then(function(v){return u.db=v,Sr(u)?jt(u):v}).then(function(v){u.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(u,v),v})}function $e(u,m,c,_){_===void 0&&(_=1);try{var g=u.db.transaction(u.storeName,m);c(null,g)}catch(v){if(_>0&&(!u.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!u.db||v.name==="NotFoundError"&&!u.db.objectStoreNames.contains(u.storeName)&&u.version<=u.db.version)return u.db&&(u.version=u.db.version+1),jt(u)}).then(function(){return Vu(u).then(function(){$e(u,m,c,_-1)})}).catch(c);c(v)}}function ta(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hu(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=u[_];var g=N[c.name];g||(g=ta(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Ju);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(x){return c.db=x,Sr(c,m._defaultConfig.version)?jt(c):x}).then(function(x){c.db=g.db=x,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 $u(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,V,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.get(u);k.onsuccess=function(){var x=k.result;x===void 0&&(x=null),ea(x)&&(x=gt(x)),g(x)},k.onerror=function(){v(k.error)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Gu(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,V,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.openCursor(),x=1;k.onsuccess=function(){var U=k.result;if(U){var J=U.value;ea(J)&&(J=gt(J));var K=u(J,U.key,x++);K!==void 0?g(K):U.continue()}else g()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function qu(u,m,c){var _=this;u=A(u);var g=new p(function(v,E){var I;_.ready().then(function(){return I=_._dbInfo,F.call(m)==="[object Blob]"?M(I.db).then(function(C){return C?m:zn(m)}):m}).then(function(C){$e(_._dbInfo,S,function(k,x){if(k)return E(k);try{var U=x.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,u);x.oncomplete=function(){C===void 0&&(C=null),v(C)},x.onabort=x.onerror=function(){var K=J.error?J.error:J.transaction.error;E(K)}}catch(K){E(K)}})}).catch(E)});return f(g,c),g}function Ku(u,m){var c=this;u=A(u);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(u);I.oncomplete=function(){g()},I.onerror=function(){v(k.error)},I.onabort=function(){var x=k.error?k.error:k.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Wu(u){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,u),c}function zu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,V,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,u),c}function Qu(u,m){var c=this,_=new p(function(g,v){if(u<0){g(null);return}c.ready().then(function(){$e(c._dbInfo,V,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=!1,x=C.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){g(null);return}u===0||k?g(U.key):(k=!0,U.advance(u))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Yu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,V,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.openKeyCursor(),k=[];C.onsuccess=function(){var x=C.result;if(!x){_(k);return}k.push(x.key),x.continue()},C.onerror=function(){g(C.error)}}catch(x){g(x)}})}).catch(g)});return f(c,u),c}function Xu(u,m){m=R.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;if(!u.name)g=p.reject("Invalid arguments");else{var v=u.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(u).then(function(I){var C=N[u.name],k=C.forages;C.db=I;for(var x=0;x<k.length;x++)k[x]._dbInfo.db=I;return I});u.storeName?g=E.then(function(I){if(I.objectStoreNames.contains(u.storeName)){var C=I.version+1;W(u);var k=N[u.name],x=k.forages;I.close();for(var U=0;U<x.length;U++){var J=x[U];J._dbInfo.db=null,J._dbInfo.version=C}var K=new p(function(Q,ue){var ie=d.open(u.name,C);ie.onerror=function(De){var Vt=ie.result;Vt.close(),ue(De)},ie.onupgradeneeded=function(){var De=ie.result;De.deleteObjectStore(u.storeName)},ie.onsuccess=function(){var De=ie.result;De.close(),Q(De)}});return K.then(function(Q){k.db=Q;for(var ue=0;ue<x.length;ue++){var ie=x[ue];ie._dbInfo.db=Q,z(ie._dbInfo)}}).catch(function(Q){throw(ee(u,Q)||p.resolve()).catch(function(){}),Q})}}):g=E.then(function(I){W(u);var C=N[u.name],k=C.forages;I.close();for(var x=0;x<k.length;x++){var U=k[x];U._dbInfo.db=null}var J=new p(function(K,Q){var ue=d.deleteDatabase(u.name);ue.onerror=function(){var ie=ue.result;ie&&ie.close(),Q(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+u.name+'" until all open connections are closed')},ue.onsuccess=function(){var ie=ue.result;ie&&ie.close(),K(ie)}});return J.then(function(K){C.db=K;for(var Q=0;Q<k.length;Q++){var ue=k[Q];z(ue._dbInfo)}}).catch(function(K){throw(ee(u,K)||p.resolve()).catch(function(){}),K})})}return f(g,m),g}var Zu={_driver:"asyncStorage",_initStorage:Hu,_support:y(),iterate:Gu,getItem:$u,setItem:qu,removeItem:Ku,clear:Wu,length:zu,key:Qu,keys:Yu,dropInstance:Xu};function ec(){return typeof openDatabase=="function"}var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tc="~~local_forage_type~",ra=/^~~local_forage_type~([^~]+)~/,Rr="__lfsc__:",Qn=Rr.length,Yn="arbf",Xn="blob",na="si08",ia="ui08",oa="uic8",aa="si16",sa="si32",la="ur16",ua="ui32",ca="fl32",da="fl64",fa=Qn+Yn.length,ha=Object.prototype.toString;function ma(u){var m=u.length*.75,c=u.length,_,g=0,v,E,I,C;u[u.length-1]==="="&&(m--,u[u.length-2]==="="&&m--);var k=new ArrayBuffer(m),x=new Uint8Array(k);for(_=0;_<c;_+=4)v=tt.indexOf(u[_]),E=tt.indexOf(u[_+1]),I=tt.indexOf(u[_+2]),C=tt.indexOf(u[_+3]),x[g++]=v<<2|E>>4,x[g++]=(E&15)<<4|I>>2,x[g++]=(I&3)<<6|C&63;return k}function Zn(u){var m=new Uint8Array(u),c="",_;for(_=0;_<m.length;_+=3)c+=tt[m[_]>>2],c+=tt[(m[_]&3)<<4|m[_+1]>>4],c+=tt[(m[_+1]&15)<<2|m[_+2]>>6],c+=tt[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 rc(u,m){var c="";if(u&&(c=ha.call(u)),u&&(c==="[object ArrayBuffer]"||u.buffer&&ha.call(u.buffer)==="[object ArrayBuffer]")){var _,g=Rr;u instanceof ArrayBuffer?(_=u,g+=Yn):(_=u.buffer,c==="[object Int8Array]"?g+=na:c==="[object Uint8Array]"?g+=ia:c==="[object Uint8ClampedArray]"?g+=oa:c==="[object Int16Array]"?g+=aa:c==="[object Uint16Array]"?g+=la:c==="[object Int32Array]"?g+=sa:c==="[object Uint32Array]"?g+=ua:c==="[object Float32Array]"?g+=ca:c==="[object Float64Array]"?g+=da:m(new Error("Failed to get type for BinaryArray"))),m(g+Zn(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=tc+u.type+"~"+Zn(this.result);m(Rr+Xn+E)},v.readAsArrayBuffer(u)}else try{m(JSON.stringify(u))}catch(E){console.error("Couldn't convert value into a JSON string: ",u),m(null,E)}}function nc(u){if(u.substring(0,Qn)!==Rr)return JSON.parse(u);var m=u.substring(fa),c=u.substring(Qn,fa),_;if(c===Xn&&ra.test(m)){var g=m.match(ra);_=g[1],m=m.substring(g[0].length)}var v=ma(m);switch(c){case Yn:return v;case Xn:return h([v],{type:_});case na:return new Int8Array(v);case ia:return new Uint8Array(v);case oa:return new Uint8ClampedArray(v);case aa:return new Int16Array(v);case la:return new Uint16Array(v);case sa:return new Int32Array(v);case ua:return new Uint32Array(v);case ca:return new Float32Array(v);case da:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var ei={serialize:rc,deserialize:nc,stringToBuffer:ma,bufferToString:Zn};function pa(u,m,c,_){u.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function ic(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=typeof u[_]!="string"?u[_].toString():u[_];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){pa(I,c,function(){m._dbInfo=c,v()},function(C,k){E(k)})},E)});return c.serializer=ei,g}function rt(u,m,c,_,g,v){u.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):pa(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,I)},v)}function oc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[u],function(C,k){var x=k.rows.length?k.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),g(x)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ac(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT * FROM "+E.storeName,[],function(C,k){for(var x=k.rows,U=x.length,J=0;J<U;J++){var K=x.item(J),Q=K.value;if(Q&&(Q=E.serializer.deserialize(Q)),Q=u(Q,K.key,J+1),Q!==void 0){g(Q);return}}g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function va(u,m,c,_){var g=this;u=A(u);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(x,U){U?I(U):k.db.transaction(function(J){rt(J,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[u,x],function(){E(C)},function(K,Q){I(Q)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(va.apply(g,[u,C,c,_-1]));return}I(J)}})})}).catch(I)});return f(v,c),v}function sc(u,m,c){return va.apply(this,[u,m,c,1])}function lc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[u],function(){g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function uc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function cc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(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,u),c}function dc(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[u+1],function(C,k){var x=k.rows.length?k.rows.item(0).key:null;g(x)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function fc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(E,v,"SELECT key FROM "+v.storeName,[],function(I,C){for(var k=[],x=0;x<C.rows.length;x++)k.push(C.rows.item(x).key);_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function hc(u){return new p(function(m,c){u.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:u,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function mc(u,m){m=R.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;return u.name?g=new p(function(v){var E;u.name===c.name?E=_._dbInfo.db:E=openDatabase(u.name,"","",0),u.storeName?v({db:E,storeNames:[u.storeName]}):v(hc(E))}).then(function(v){return new p(function(E,I){v.db.transaction(function(C){function k(K){return new p(function(Q,ue){C.executeSql("DROP TABLE IF EXISTS "+K,[],function(){Q()},function(ie,De){ue(De)})})}for(var x=[],U=0,J=v.storeNames.length;U<J;U++)x.push(k(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(K){I(K)})},function(C){I(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var pc={_driver:"webSQLStorage",_initStorage:ic,_support:ec(),iterate:ac,getItem:oc,setItem:sc,removeItem:lc,clear:uc,length:cc,key:dc,keys:fc,dropInstance:mc};function vc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(u){return!1}}function _a(u,m){var c=u.name+"/";return u.storeName!==m.storeName&&(c+=u.storeName+"/"),c}function _c(){var u="_localforage_support_test";try{return localStorage.setItem(u,!0),localStorage.removeItem(u),!1}catch(m){return!0}}function gc(){return!_c()||localStorage.length>0}function yc(u){var m=this,c={};if(u)for(var _ in u)c[_]=u[_];return c.keyPrefix=_a(u,m._defaultConfig),gc()?(m._dbInfo=c,c.serializer=ei,p.resolve()):p.reject()}function bc(u){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,u),c}function wc(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+u);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function Ec(u,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 x=localStorage.key(k);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=g.serializer.deserialize(U)),U=u(U,x.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function Ac(u,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(u)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function Ic(u){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,u),c}function Sc(u){var m=this,c=m.keys().then(function(_){return _.length});return f(c,u),c}function Rc(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+u)});return f(_,m),_}function Cc(u,m,c){var _=this;u=A(u);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,x){if(x)I(x);else try{localStorage.setItem(C.keyPrefix+u,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 kc(u,m){if(m=R.apply(this,arguments),u=typeof u!="function"&&u||{},!u.name){var c=this.config();u.name=u.name||c.name,u.storeName=u.storeName||c.storeName}var _=this,g;return u.name?g=new p(function(v){u.storeName?v(_a(u,_._defaultConfig)):v(u.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 Tc={_driver:"localStorageWrapper",_initStorage:yc,_support:vc(),iterate:Ec,getItem:wc,setItem:Cc,removeItem:Rc,clear:bc,length:Sc,key:Ac,keys:Ic,dropInstance:kc},xc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Oc=function(m,c){for(var _=m.length,g=0;g<_;){if(xc(m[g],c))return!0;g++}return!1},ga=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},Jt={},ya={},yt={INDEXEDDB:Zu,WEBSQL:pc,LOCALSTORAGE:Tc},Pc=[yt.INDEXEDDB._driver,yt.WEBSQL._driver,yt.LOCALSTORAGE._driver],Cr=["dropInstance"],ti=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Cr),Dc={description:"",driver:Pc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Nc(u,m){u[m]=function(){var c=arguments;return u.ready().then(function(){return u[m].apply(u,c)})}}function ri(){for(var u=1;u<arguments.length;u++){var m=arguments[u];if(m)for(var c in m)m.hasOwnProperty(c)&&(ga(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Lc=function(){function u(m){s(this,u);for(var c in yt)if(yt.hasOwnProperty(c)){var _=yt[c],g=_._driver;this[c]=g,Jt[g]||this.defineDriver(_)}this._defaultConfig=ri({},Dc),this._config=ri({},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 u.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},u.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 x=ti.concat("_initStorage"),U=0,J=x.length;U<J;U++){var K=x[U],Q=!Oc(Cr,K);if((Q||c[K])&&typeof c[K]!="function"){I(k);return}}var ue=function(){for(var Vt=function(Bc){return function(){var Fc=new Error("Method "+Bc+" is not implemented by the current driver"),ba=p.reject(Fc);return f(ba,arguments[arguments.length-1]),ba}},ni=0,Mc=Cr.length;ni<Mc;ni++){var ii=Cr[ni];c[ii]||(c[ii]=Vt(ii))}};ue();var ie=function(Vt){Jt[C]&&console.info("Redefining LocalForage driver: "+C),Jt[C]=c,ya[C]=Vt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(De){I(De)}});return b(v,_,g),v},u.prototype.driver=function(){return this._driver||null},u.prototype.getDriver=function(c,_,g){var v=Jt[c]?p.resolve(Jt[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},u.prototype.getSerializer=function(c){var _=p.resolve(ei);return b(_,c),_},u.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},u.prototype.setDriver=function(c,_,g){var v=this;ga(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 K(){for(;J<U.length;){var Q=U[J];return J++,v._dbInfo=null,v._ready=null,v.getDriver(Q).then(C).catch(K)}I();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return K()}}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(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},u.prototype.supports=function(c){return!!ya[c]},u.prototype._extend=function(c){ri(this,c)},u.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},u.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=ti.length;c<_;c++)Nc(this,ti[c])},u.prototype.createInstance=function(c){return new u(c)},u}(),Uc=new Lc;i.exports=Uc},{3:3}]},{},[4])(4)})});var As=si(ln=>{"use strict";H();zt();nt();var zi=ge(),of=We("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()})),implement:e=>P(ln,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;Ne.info("onLevelFinished",r,n,i),yield Promise.all([ft.reporter({event:"COMPLETE_GAME_LEVEL"}),ft.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),af=We("gamePlayEnded",{paramsSchema:j.tuple(j.object({duration:j.number().optional(),rating:j.number().optional(),score:j.number()})),implement:e=>P(ln,null,function*(){let{duration:t,rating:r,score:n}=e;return Ne.info("onGamePlayEnded",t,r,n),ft.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),sf=We("levelUpgrade",{paramsSchema:j.tuple(j.object({levelId:j.or(j.string(),j.number()),name:j.string().optional()})),implement:r=>P(ln,[r],function*({levelId:e,name:t}){return ft.tracker("LevelUpgrade",{name:t,levelId:e})})});zi.registerCommand("TaskTrackerSDK.levelFinished",of);zi.registerCommand("TaskTrackerSDK.gamePlayEnded",af);zi.registerCommand("TaskTrackerSDK.levelUpgrade",sf);ye("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ye("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ye("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var mt,At,Is,Qi,lf,un,Yi=Z(()=>{"use strict";mt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},At=new Map,Is=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=At.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)}},Qi=!1,lf=()=>{Qi||(window.addEventListener("message",Is),Qi=!0)},un=(e,t)=>{lf(),At.has(e)||At.set(e,new Set);let r=At.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&At.delete(e),At.size===0&&(window.removeEventListener("message",Is),Qi=!1)}}});var cn,dn,fn,hn,mn,Ss,pn,vn,It,uf,ae,St,Rt,Ue=Z(()=>{"use strict";H();cn="UNLOCK_OPTIONS_CHANGED",dn="INVOKE_PAYMENT",fn="ON_PAYMENT_RESULT",hn="ON_USE_MODAL_EVENT",mn="ON_USE_MODAL_RESULT",Ss="ON_USE_MODAL_FREQUENCY",pn="ON_USE_UNLOGIN_MODAL_EVENT",vn="INVOKE_UNLOGIN_MODAL_EVENT",It=new je,uf=()=>({on:It.on.bind(It),off:It.off.bind(It),emit:It.emit.bind(It)}),ae=uf(),St={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Rt={show:!0,minInterval:8*60*60*1e3}});var Eu=si(zo=>{"use strict";me();Ue();Yi();H();var wu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};un("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",wu[e.result],e.result),ae.emit(mn,{useModalResult:wu[e.result]})});ae.on(hn,(e,t)=>{var r;mt("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:ct()})});un("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(fn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(dn,(e,t)=>P(zo,null,function*(){var r;mt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ct()})}));un("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(pn,{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(vn,e=>P(zo,null,function*(){mt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:ct(),type:e})}))});nt();me();zt();H();var gs=ge(),Vd="env",Hd="getSystemInfoSync",$d=()=>{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=_e($({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=_e($({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=_e($({},e),{SDKVersion:n})),e},Gd=ht(Hd,{implement:$d}),qd=ht(Vd,{implement:()=>_e($({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});gs.registerCommand("API.env",qd);gs.registerCommand("API.getSystemInfoSync",Gd);ye("env",{version:"1.0.0"});ye("getSystemInfoSync",{version:"1.0.0"});H();zt();Ge();nt();var Kd="onJoliboxShow",Wd="onJoliboxHide",zd="onReady",Gi=ge(),qi=Va(Te),$i=!0,Qt=!0,nn=0,on=Mi;function Qd(){let e=Date.now();if(e-nn<100)return;nn=e;let t=document.visibilityState==="visible";t!==$i&&($i=t,on.emit("visible",$i))}function ys(e){let t=Date.now();t-nn<100||(nn=t,e==="focus"&&!Qt?Qt=!0:e==="blur"&&Qt&&(Qt=!1),on.emit("visible",Qt))}document.addEventListener("visibilitychange",Qd);window.addEventListener("focus",()=>ys("focus"));window.addEventListener("blur",()=>ys("blur"));var Yd=ht(Kd,{paramsSchema:j.tuple(j.function()),implement(e){let t=qi(e);on.on("visible",r=>{r&&t()})}}),Xd=ht(Wd,{paramsSchema:j.tuple(j.function()),implement(e){let t=qi(e);on.on("visible",r=>{!r&&t()})}}),Zd=ht(zd,{paramsSchema:j.tuple(j.function()),implement(e){let t=qi(e);Wt.on("LifecycleEvent.onReady",r=>{t(r)})}});Gi.registerCommand("LifecycleSDK.onReady",Zd);Gi.registerCommand("LifecycleSDK.onJoliboxShow",Yd);Gi.registerCommand("LifecycleSDK.onJoliboxHide",Xd);ye("lifeCycle.onReady",{version:"1.0.0"});ye("lifeCycle.onJoliboxShow",{version:"1.0.0"});ye("lifeCycle.onJoliboxHide",{version:"1.0.0"});zt();H();wt();me();var Es=li(ws());var an=ge(),Wi=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=Es.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},sn=new Wi,ef=We("getLocalStorage",{paramsSchema:j.tuple(j.string()),implement(e){return P(this,null,function*(){return yield sn.getItem(e)})}});an.registerCommand("StorageSDK.getItem",ef);ye("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var tf=We("setStorage",{paramsSchema:j.tuple(j.string(),j.or(j.string(),j.boolean(),j.number())),implement(e,t){return P(this,null,function*(){return yield sn.setItem(e,t)})}});an.registerCommand("StorageSDK.setItem",tf);ye("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var rf=We("removeStorage",{paramsSchema:j.tuple(j.string()),implement(e){return P(this,null,function*(){return yield sn.removeItem(e)})}});an.registerCommand("StorageSDK.removeItem",rf);ye("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var nf=We("clearStorage",{implement(){return P(this,null,function*(){return yield sn.clear()})}});an.registerCommand("StorageSDK.clear",nf);ye("storage.clear",{version:"1.0.0"});var Eb=li(As());nt();H();wt();Yi();me();Ue();var Rs=D.testMode;function Cs(){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,l)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;Rs&&console.log(`handleReward ${l}`);let y=e.get(l),h=y?yield y(...o):d;return Rs&&console.log(`handleReward ${l} ${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:St,loginGuide:Rt}}})})},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:St,loginGuide:Rt}})}}}Ue();var cf=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,df=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(cf()):["ADS"],ks=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(cn,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let l=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return df(l)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Ts=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(Ss,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||St,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||Rt}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||St,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||Rt}}))};var xs=e=>t=>P(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});Ue();function it(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=$($({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Ue();var Me=it(ae,cn);me();H();H();var ot=ge();Ue();Ue();var Xi=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;ot.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,l,d,y;let n=yield Me.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(l=n==null?void 0:n.options)==null?void 0:l.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"}}))},Yt=(e,t)=>r=>P(void 0,null,function*(){let n=it(ae,mn);return ae.emit(hn,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var _n=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Os=(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 Zi=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;ot.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var l,d,y,h,p,f;let i=yield Me.getData(),o=yield _n(r),a=(y=(d=(l=i==null?void 0:i.options)==null?void 0:l.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),Os((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},Xt=(e,t)=>r=>P(void 0,null,function*(){let n=it(ae,fn);return ae.emit(dn,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});me();Ue();Ue();H();var eo=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;ot.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,l,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}=(l=(s=A.rewards)==null?void 0:s.jolicoin)!=null?l:{};if(A.result=="SUCCESS"){R&&w&&(yield Da(3e3));let T=yield _n(n),N=(h=(y=(d=o==null?void 0:o.options)==null?void 0:d.find(V=>V.type==="JOLI_COIN"))==null?void 0:y.joliCoinChoices[0].joliCoinQuantity)!=null?h:0,F={balance:(p=T==null?void 0:T.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:F}),F.balance>=N)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},Zt=(e,t)=>()=>P(void 0,null,function*(){let r=it(ae,pn);return ae.emit(vn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var gn=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>(eo(e,{httpClient:t,showUnloginModal:s}),Zi(e,{httpClient:t,initiateAndAwaitPayment:o}),Xi(e,{showUnlockWithJolicoinModal:a}),l=>P(void 0,null,function*(){var d,y,h;try{let p=!0,f=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];for(let A of f){let R=yield ot.executeCommand(A);if(p=p&&R.result!=="FAILED",R.result!=="CONTINUE")break}if(!p)return n==null||n(l),!1;let b=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ct()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});return console.log("-----unlockWithJolicoin request result-----",b),b.code=="SUCCESS"?((y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in l&&((h=l.adViewed)==null||h.call(l)),r==null||r({quantity:b.data.quantity,balance:b.data.balance}),!0):(n==null||n(l),!1)}catch(p){if(console.info("JolicoinRewardHandler error:",p),p instanceof Error&&p.message=="CANCEL")throw p;return n==null||n(l),!1}finally{i.clearCache()}}));var Ps=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=Yt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=Xt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=Zt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return gn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Ds=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=l=>{var d;r==null||r(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Yt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=Xt("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=Zt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return gn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var ze=Cs();ks(ze);Ts(ze);var En,B,Bs,no,pt,Ns,Fs,js,Js,io,to,ro,ff,er={},Vs=[],hf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,tr=Array.isArray;function Qe(e,t){for(var r in t)e[r]=t[r];return e}function oo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rr(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?En.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 bn(e,a,n,i,null)}function bn(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?++Bs:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function at(e){return e.children}function xe(e,t){this.props=e,this.context=t}function Ct(e,t){if(t==null)return e.__?Ct(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"?Ct(e):null}function Hs(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 Hs(e)}}function Ls(e){(!e.__d&&(e.__d=!0)&&pt.push(e)&&!wn.__r++||Ns!==B.debounceRendering)&&((Ns=B.debounceRendering)||Fs)(wn)}function wn(){for(var e,t,r,n,i,o,a,s=1;pt.length;)pt.length>s&&pt.sort(js),e=pt.shift(),s=pt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Qe({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),ao(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Ct(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,qs(o,r,a),r.__e!=i&&Hs(r)));wn.__r=0}function $s(e,t,r,n,i,o,a,s,l,d,y){var h,p,f,b,A,R,w=n&&n.__k||Vs,T=t.length;for(l=mf(r,t,w,l,T),h=0;h<T;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?er:w[f.__i]||er,f.__i=h,R=ao(e,f,p,i,o,a,s,l,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&so(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?l=Gs(f,l,e):typeof f.type=="function"&&R!==void 0?l=R:b&&(l=b.nextSibling),f.__u&=-7);return r.__e=A,l}function mf(e,t,r,n,i){var o,a,s,l,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"?(l=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?bn(null,a,null,null,null):tr(a)?bn(at,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?bn(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=pf(a,r,l,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!=l&&(d==l-1?p--:d==l+1?p++:(d>l?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=Ct(s)),Ws(s,s));return n}function Gs(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=Gs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Ct(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function nr(e,t){return t=t||[],e==null||typeof e=="boolean"||(tr(e)?e.some(function(r){nr(r,t)}):t.push(e)),t}function pf(e,t,r,n){var i,o,a=e.key,s=e.type,l=t[r];if(l===null&&e.key==null||l&&a==l.key&&s===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&a==l.key&&s===l.type)return i;i--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function Us(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||hf.test(t)?r:r+"px"}function yn(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||Us(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Us(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Js,"$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=io,e.addEventListener(t,o?ro:to,o)):e.removeEventListener(t,o?ro:to,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 Ms(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=io++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function ao(e,t,r,n,i,o,a,s,l,d){var y,h,p,f,b,A,R,w,T,N,F,V,S,L,O,M,W,z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof z=="function")try{if(w=t.props,T="prototype"in z&&z.prototype.render,N=(y=z.contextType)&&n[y.__c],F=y?N?N.props.value:y.__:n,r.__c?R=(h=t.__c=r.__c).__=h.__E:(T?t.__c=h=new z(w,F):(t.__c=h=new xe(w,F),h.constructor=z,h.render=_f),N&&N.sub(h),h.props=w,h.state||(h.state={}),h.context=F,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),T&&h.__s==null&&(h.__s=h.state),T&&z.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Qe({},h.__s)),Qe(h.__s,z.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)T&&z.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),T&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(T&&z.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,F),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,F)===!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)}),V=0;V<h._sb.length;V++)h.__h.push(h._sb[V]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,F),T&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,A)})}if(h.context=F,h.props=w,h.__P=e,h.__e=!1,S=B.__r,L=0,T){for(h.state=h.__s,h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);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=Qe(Qe({},n),h.getChildContext())),T&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,b)),M=y,y!=null&&y.type===at&&y.key==null&&(M=Ks(y.props.children)),s=$s(e,tr(M)?M:[M],t,r,n,i,o,a,s,l,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,l||o!=null)if(ee.then){for(t.__u|=l?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--;)oo(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=vf(r.__e,t,r,n,i,o,a,l,d);return(y=B.diffed)&&y(t),128&t.__u?void 0:s}function qs(e,t,r){for(var n=0;n<r.length;n++)so(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 Ks(e){return typeof e!="object"||e==null?e:tr(e)?e.map(Ks):Qe({},e)}function vf(e,t,r,n,i,o,a,s,l){var d,y,h,p,f,b,A,R=r.props,w=t.props,T=t.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="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==!!T&&(T?f.localName==T:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(T==null)return document.createTextNode(w);e=document.createElementNS(i,T,w.is&&w),s&&(B.__m&&B.__m(t,o),s=!1),o=null}if(T===null)R===w||s&&e.data===w||(e.data=w);else{if(o=o&&En.call(e.childNodes),R=r.props||er,!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;yn(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||yn(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=""),$s(t.type==="template"?e.content:e,tr(p)?p:[p],t,r,n,T=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Ct(r,0),s,l),o!=null)for(d=o.length;d--;)oo(o[d]);s||(d="value",T=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||T=="progress"&&!b||T=="option"&&b!==R[d])&&yn(e,d,b,R[d],i),d="checked",A!==void 0&&A!==e[d]&&yn(e,d,A,R[d],i))}return e}function so(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 Ws(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||so(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]&&Ws(n[i],t,r||typeof e.type!="function");r||oo(e.__e),e.__c=e.__=e.__e=void 0}function _f(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=[],ao(t,e=(!n&&r||t).__k=rr(at,null,[e]),i||er,er,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?En.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),qs(o,e,a)}En=Vs.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}},Bs=0,no=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=Qe({},this.state),typeof e=="function"&&(e=e(Qe({},r),this.props)),e&&Qe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ls(this))},xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ls(this))},xe.prototype.render=at,pt=[],Fs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,js=function(e,t){return e.__v.__b-t.__v.__b},wn.__r=0,Js=/(PointerCapture)$|Capture$/i,io=0,to=Ms(!1),ro=Ms(!0),ff=0;var kt,ne,lo,Qs,ir=0,il=[],se=B,Ys=se.__b,Xs=se.__r,Zs=se.diffed,el=se.__c,tl=se.unmount,rl=se.__;function In(e,t){se.__h&&se.__h(ne,e,ir||t),ir=0;var r=ne.__H||(ne.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Sn(e){return ir=1,ol(al,e)}function ol(e,t,r){var n=In(kt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):al(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],d=n.t(l,s);l!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ne,!ne.__f)){var i=function(s,l,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,l,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,l,d)||h};ne.__f=!0;var o=ne.shouldComponentUpdate,a=ne.componentWillUpdate;ne.componentWillUpdate=function(s,l,d){if(this.__e){var y=o;o=void 0,i(s,l,d),o=y}a&&a.call(this,s,l,d)},ne.shouldComponentUpdate=i}return n.__N||n.__}function or(e,t){var r=In(kt++,3);!se.__s&&mo(r.__H,t)&&(r.__=e,r.u=t,ne.__H.__h.push(r))}function co(e,t){var r=In(kt++,4);!se.__s&&mo(r.__H,t)&&(r.__=e,r.u=t,ne.__h.push(r))}function fo(e){return ir=5,ar(function(){return{current:e}},[])}function ar(e,t){var r=In(kt++,7);return mo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ho(e,t){return ir=8,ar(function(){return e},t)}function gf(){for(var e;e=il.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(An),e.__H.__h.forEach(uo),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ne=null,Ys&&Ys(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),rl&&rl(e,t)},se.__r=function(e){Xs&&Xs(e),kt=0;var t=(ne=e.__c).__H;t&&(lo===ne?(t.__h=[],ne.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(An),t.__h.forEach(uo),t.__h=[],kt=0)),lo=ne},se.diffed=function(e){Zs&&Zs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(il.push(t)!==1&&Qs===se.requestAnimationFrame||((Qs=se.requestAnimationFrame)||yf)(gf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),lo=ne=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(An),r.__h=r.__h.filter(function(n){return!n.__||uo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),el&&el(e,t)},se.unmount=function(e){tl&&tl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{An(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var nl=typeof requestAnimationFrame=="function";function yf(e){var t,r=function(){clearTimeout(n),nl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);nl&&(t=requestAnimationFrame(r))}function An(e){var t=ne,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ne=t}function uo(e){var t=ne;e.__c=e.__(),ne=t}function mo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function al(e,t){return typeof t=="function"?t(e):t}function wf(e,t){for(var r in t)e[r]=t[r];return e}function sl(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 ll(e,t){this.props=e,this.context=t}(ll.prototype=new xe).isPureReactComponent=!0,ll.prototype.shouldComponentUpdate=function(e,t){return sl(this.props,e)||sl(this.state,t)};var ul=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ul&&ul(e)};var Ay=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ef=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)}Ef(e,t,r,n)};var cl=B.unmount;function _l(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=wf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return _l(n,t,r)})),e}function gl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return gl(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 po(){this.__u=0,this.o=null,this.__b=null}function yl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Rn(){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),cl&&cl(e)},(po.prototype=new xe).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=yl(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 l=n.state.__a;n.__v.__k[0]=gl(l,l.__c.__P,l.__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)},po.prototype.componentWillUnmount=function(){this.o=[]},po.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]=_l(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&rr(at,null,e.fallback);return i&&(i.__u&=-33),[rr(at,null,t.__a?null:e.children),i]};var dl=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]}};(Rn.prototype=new xe).__a=function(e){var t=this,r=yl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),dl(t,e,n)):i()};r?r(o):o()}},Rn.prototype.render=function(e){this.i=null,this.l=new Map;var t=nr(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},Rn.prototype.componentDidUpdate=Rn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){dl(e,r,t)})};var Af=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,If=/^(?: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]/,Sf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Rf=/[A-Z0-9]/g,Cf=typeof document!="undefined",kf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function vo(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 fl=B.event;function Tf(){}function xf(){return this.cancelBubble}function Of(){return this.defaultPrevented}B.event=function(e){return fl&&(e=fl(e)),e.persist=Tf,e.isPropagationStopped=xf,e.isDefaultPrevented=Of,e.nativeEvent=e};var bl,Pf={enumerable:!1,configurable:!0,get:function(){return this.class}},hl=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||Cf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||kf(r.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":Sf.test(a)&&(a=l):l=a="oninput":o&&If.test(a)?a=a.replace(Rf,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=nr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=nr(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",Pf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Af,hl&&hl(e)};var ml=B.__r;B.__r=function(e){ml&&ml(e),bl=e.__c};var pl=B.diffed;B.diffed=function(e){pl&&pl(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),bl=null};var wl=Object.getOwnPropertySymbols,Df=Object.prototype.hasOwnProperty,Nf=Object.prototype.propertyIsEnumerable,Lf=(e,t)=>{var r={};for(var n in e)Df.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wl)for(var n of wl(e))t.indexOf(n)<0&&Nf.call(e,n)&&(r[n]=e[n]);return r},ql=Object.defineProperty,Uf=Object.defineProperties,Mf=Object.getOwnPropertyDescriptors,El=Object.getOwnPropertySymbols,Bf=Object.prototype.hasOwnProperty,Ff=Object.prototype.propertyIsEnumerable,Al=(e,t,r)=>t in e?ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jf=(e,t)=>{for(var r in t||(t={}))Bf.call(t,r)&&Al(e,r,t[r]);if(El)for(var r of El(t))Ff.call(t,r)&&Al(e,r,t[r]);return e},Jf=(e,t)=>Uf(e,Mf(t)),Vf=(e,t)=>{for(var r in t)ql(e,r,{get:t[r],enumerable:!0})},Kl=(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},Hf=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.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 $f(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Gf(e){return typeof e=="string"}function qf(e){return typeof e=="undefined"}function Kf(e){return qf(e)||e===null}function Wf(e){return typeof e=="function"}function Wl(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 zf=(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))(zf||{});function sr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Qf={log:sr("log"),warn:sr("warn"),info:sr("info"),error:sr("error"),debug:sr("debug")};Object.assign(globalThis,{logger:Qf});var Il=Symbol.for("Jolibox.canIUseMap"),Yf={};globalThis[Il]||(globalThis[Il]=Yf);var Sl=Symbol.for("Jolibox.canIUseMap.native"),Xf={};globalThis[Sl]||(globalThis[Sl]=Xf);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||{}),Ql=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ql||{}),Yl=(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))(Yl||{}),Rl=["name","params"],Zf=["name","type","location","target","extra","timestamp","userId"],eh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function xn(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 th(e){let t=e.location?xn(e.location,Rl):null,r=e.target?xn(e.target,Rl):null;return xn(Jf(jf({},e),{location:t,target:r}),Zf)}function rh(e){let t=e.events.map(n=>th(n)),r=xn(e.device,eh);return[e.protocolVersion,t,r,e.project]}function nh(){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}}nh();var Cl=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var Ao=class Io{constructor(t){this.element=t,this.next=Io.Undefined,this.prev=Io.Undefined}};Ao.Undefined=new Ao(void 0);var re=Ao,ih=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}},oh=0,lr=class{constructor(e){this.value=e,this.id=oh++}},fr=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 lr&&(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 l=new lr(e);return this._listeners?this._listeners instanceof lr?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(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 lr)this._listeners.id===l.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(l);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 lr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},ah=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 fr,o=l=>t(...l.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 l of s)t(...l.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 ih,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)}},So={};Vf(So,{None:()=>sh,filter:()=>uh,once:()=>Xl,toPromise:()=>lh});var sh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function lh(e){return new Promise(t=>Xl(e)(t))}function Xl(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 uh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new fr(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 _o=Symbol.for("Jolibox.hostEmitter"),ch=()=>{let e=new ah;return globalThis[_o]||(globalThis[_o]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[_o]};ch();function dh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)fh(e[n],t[n])}function fh(e,t){if(Gf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Wf(t)){try{if(e instanceof t)return}catch(r){}if(!Kf(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 Ro=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new fr,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 dh(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}};Ro=Kl([Wl],Ro);var kl=class{constructor(){this._onWillExecuteCommand=new fr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new fr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Ro,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=$f(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 Hf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),So.toPromise(So.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{}}};kl=Kl([Wl],kl);function Se(e,t,r){return(t=hh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hh(e){var t=mh(e,"string");return typeof t=="symbol"?t:t+""}function mh(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 Co=class{constructor(t){Se(this,"context",void 0),Se(this,"continueCallback",void 0),Se(this,"adIsShowingCallback",void 0),Se(this,"isBeforeAdCalled",!1),Se(this,"isBeforeRewardCalled",!1),Se(this,"isAdDismissedCalled",!1),Se(this,"isAdViewedCalled",!1),Se(this,"isAfterAdCalled",!1),Se(this,"currentProvider",void 0),Se(this,"currentClientParams",void 0),Se(this,"adsHasResponse",!1),Se(this,"videoChecker",window.document.createElement("video")),Se(this,"contextInfo",void 0),Se(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)),Cl()&&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),r()}),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;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Cl()&&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()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;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":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.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,l,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l: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 Cn(e,t,r){return(t=ph(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ph(e){var t=vh(e,"string");return typeof t=="symbol"?t:t+""}function vh(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 ko=class{constructor(t){Cn(this,"context",void 0),Cn(this,"adBreakIsShowing",!1),Cn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Cn(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 kn(e,t,r){return(t=_h(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _h(e){var t=gh(e,"string");return typeof t=="symbol"?t:t+""}function gh(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 To=class{constructor(t){kn(this,"configs",null),kn(this,"firstRun",!0),kn(this,"context",void 0),kn(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 Ye(e,t,r){return(t=yh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yh(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 xo=class{constructor(t,r){Ye(this,"name","ADSENSE"),Ye(this,"context",void 0),Ye(this,"contextInfo",void 0),Ye(this,"configured",!1),Ye(this,"initParams",void 0),Ye(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Ye(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Lf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Ye(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Ye(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:l,slot:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!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(T=>{if(T.type==="attributes"&&T.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 wh(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 Eh(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 Ah=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(Eh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=wh(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-",Un="-moz-",G="-webkit-",Zl="comm",Go="rule",qo="decl",Ih="@import",eu="@keyframes",Sh="@layer",Rh=Math.abs,Jn=String.fromCharCode,Ch=Object.assign;function kh(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 tu(e){return e.trim()}function Th(e,t){return(e=t.exec(e))?e[0]:e}function q(e,t,r){return e.replace(t,r)}function Oo(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function hr(e,t,r){return e.slice(t,r)}function Je(e){return e.length}function Ko(e){return e.length}function Tn(e,t){return t.push(e),e}function xh(e,t){return e.map(t).join("")}var Vn=1,Pt=1,ru=0,ke=0,de=0,Dt="";function Hn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Vn,column:Pt,length:a,return:""}}function ur(e,t){return Ch(Hn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Oh(){return de}function Ph(){return de=ke>0?pe(Dt,--ke):0,Pt--,de===10&&(Pt=1,Vn--),de}function Pe(){return de=ke<ru?pe(Dt,ke++):0,Pt++,de===10&&(Pt=1,Vn++),de}function Ve(){return pe(Dt,ke)}function On(){return ke}function vr(e,t){return hr(Dt,e,t)}function mr(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 nu(e){return Vn=Pt=1,ru=Je(Dt=e),ke=0,[]}function iu(e){return Dt="",e}function Pn(e){return tu(vr(ke-1,Po(e===91?e+2:e===40?e+1:e)))}function Dh(e){for(;(de=Ve())&&de<33;)Pe();return mr(e)>2||mr(de)>3?"":" "}function Nh(e,t){for(;--t&&Pe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return vr(e,On()+(t<6&&Ve()==32&&Pe()==32))}function Po(e){for(;Pe();)switch(de){case e:return ke;case 34:case 39:e!==34&&e!==39&&Po(de);break;case 40:e===41&&Po(e);break;case 92:Pe();break}return ke}function Lh(e,t){for(;Pe()&&e+de!==57&&!(e+de===84&&Ve()===47););return"/*"+vr(t,ke-1)+"*"+Jn(e===47?e:Pe())}function Uh(e){for(;!mr(Ve());)Pe();return vr(e,ke)}function Mh(e){return iu(Dn("",null,null,null,[""],e=nu(e),0,[0],e))}function Dn(e,t,r,n,i,o,a,s,l){for(var d=0,y=0,h=a,p=0,f=0,b=0,A=1,R=1,w=1,T=0,N="",F=i,V=o,S=n,L=N;R;)switch(b=T,T=Pe()){case 40:if(b!=108&&pe(L,h-1)==58){Oo(L+=q(Pn(T),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:L+=Pn(T);break;case 9:case 10:case 13:case 32:L+=Dh(b);break;case 92:L+=Nh(On()-1,7);continue;case 47:switch(Ve()){case 42:case 47:Tn(Bh(Lh(Pe(),On()),t,r),l);break;default:L+="/"}break;case 123*A:s[d++]=Je(L)*w;case 125*A:case 59:case 0:switch(T){case 0:case 125:R=0;case 59+y:w==-1&&(L=q(L,/\f/g,"")),f>0&&Je(L)-h&&Tn(f>32?xl(L+";",n,r,h-1):xl(q(L," ","")+";",n,r,h-2),l);break;case 59:L+=";";default:if(Tn(S=Tl(L,t,r,d,y,i,s,N,F=[],V=[],h),o),T===123)if(y===0)Dn(L,t,S,S,F,o,h,s,V);else switch(p===99&&pe(L,3)===110?100:p){case 100:case 108:case 109:case 115:Dn(e,S,S,n&&Tn(Tl(e,S,S,0,0,i,s,N,i,F=[],h),V),i,V,h,s,n?F:V);break;default:Dn(L,S,S,S,[""],V,0,s,V)}}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(T==123)--A;else if(T==125&&A++==0&&Ph()==125)continue}switch(L+=Jn(T),T*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+=Pn(Pe())),p=Ve(),y=h=Je(N=L+=Uh(On())),T++;break;case 45:b===45&&Je(L)==2&&(A=0)}}return o}function Tl(e,t,r,n,i,o,a,s,l,d,y){for(var h=i-1,p=i===0?o:[""],f=Ko(p),b=0,A=0,R=0;b<n;++b)for(var w=0,T=hr(e,h+1,h=Rh(A=a[b])),N=e;w<f;++w)(N=tu(A>0?p[w]+" "+T:q(T,/&\f/g,p[w])))&&(l[R++]=N);return Hn(e,t,r,i===0?Go:s,l,d,y)}function Bh(e,t,r){return Hn(e,t,r,Zl,Jn(Oh()),hr(e,2,-2),0)}function xl(e,t,r,n){return Hn(e,t,r,qo,hr(e,0,n),hr(e,n+1,-1),n)}function Ot(e,t){for(var r="",n=Ko(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Fh(e,t,r,n){switch(e.type){case Sh:if(e.children.length)break;case Ih:case qo:return e.return=e.return||e.value;case Zl:return"";case eu:return e.return=e.value+"{"+Ot(e.children,n)+"}";case Go:e.value=e.props.join(",")}return Je(r=Ot(e.children,n))?e.return=e.value+"{"+r+"}":""}function jh(e){var t=Ko(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 Jh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Vh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Hh=function(e,t,r){for(var n=0,i=0;n=i,i=Ve(),n===38&&i===12&&(t[r]=1),!mr(i);)Pe();return vr(e,ke)},$h=function(e,t){var r=-1,n=44;do switch(mr(n)){case 0:n===38&&Ve()===12&&(t[r]=1),e[r]+=Hh(ke-1,t,r);break;case 2:e[r]+=Pn(n);break;case 4:if(n===44){e[++r]=Ve()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Jn(n)}while(n=Pe());return e},Gh=function(e,t){return iu($h(nu(e),t))},Ol=new WeakMap,qh=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&&!Ol.get(r))&&!n){Ol.set(e,!0);for(var i=[],o=Gh(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var d=0;d<a.length;d++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Kh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function ou(e,t){switch(kh(e,t)){case 5103:return G+"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 G+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return G+e+Un+e+we+e+e;case 6828:case 4268:return G+e+we+e+e;case 6165:return G+e+we+"flex-"+e+e;case 5187:return G+e+q(e,/(\w+).+(:[^]+)/,G+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return G+e+we+"flex-item-"+q(e,/flex-|-self/,"")+e;case 4675:return G+e+we+"flex-line-pack"+q(e,/align-content|flex-|-self/,"")+e;case 5548:return G+e+we+q(e,"shrink","negative")+e;case 5292:return G+e+we+q(e,"basis","preferred-size")+e;case 6060:return G+"box-"+q(e,"-grow","")+G+e+we+q(e,"grow","positive")+e;case 4554:return G+q(e,/([^-])(transform)/g,"$1"+G+"$2")+e;case 6187:return q(q(q(e,/(zoom-|grab)/,G+"$1"),/(image-set)/,G+"$1"),e,"")+e;case 5495:case 3959:return q(e,/(image-set\([^]*)/,G+"$1$`$1");case 4968:return q(q(e,/(.+:)(flex-)?(.*)/,G+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+G+e+e;case 4095:case 3583:case 4068:case 2532:return q(e,/(.+)-inline(.+)/,G+"$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 q(e,/(.+:)(.+)-([^]+)/,"$1"+G+"$2-$3$1"+Un+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Oo(e,"stretch")?ou(q(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-(~Oo(e,"!important")&&10))){case 107:return q(e,":",":"+G)+e;case 101:return q(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+G+(pe(e,14)===45?"inline-":"")+"box$3$1"+G+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return G+e+we+q(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return G+e+we+q(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return G+e+we+q(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return G+e+we+e+e}return e}var Wh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case qo:e.return=ou(e.value,e.length);break;case eu:return Ot([ur(e,{value:q(e.value,"@","@"+G)})],n);case Go:if(e.length)return xh(e.props,function(i){switch(Th(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ot([ur(e,{props:[q(i,/:(read-\w+)/,":"+Un+"$1")]})],n);case"::placeholder":return Ot([ur(e,{props:[q(i,/:(plac\w+)/,":"+G+"input-$1")]}),ur(e,{props:[q(i,/:(plac\w+)/,":"+Un+"$1")]}),ur(e,{props:[q(i,/:(plac\w+)/,we+"input-$1")]})],n)}return""})}},zh=[Wh],Qh=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||zh,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,l=[qh,Kh];{var d,y=[Fh,Jh(function(b){d.insert(b)})],h=jh(l.concat(n,y)),p=function(b){return Ot(Mh(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 Ah({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 Yh(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 Xh={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},Zh=/[A-Z]|^ms/g,em=/_EMO_([^_]+?)_([^]*?)_EMO_/g,au=function(e){return e.charCodeAt(1)===45},Pl=function(e){return e!=null&&typeof e!="boolean"},go=Vh(function(e){return au(e)?e:e.replace(Zh,"-$&").toLowerCase()}),Dl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(em,function(r,n,i){return st={name:n,styles:i,next:st},n})}return Xh[e]!==1&&!au(e)&&typeof t=="number"&&t!==0?t+"px":t};function Mn(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 st={name:i.name,styles:i.styles,next:st},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)st={name:a.name,styles:a.styles,next:st},a=a.next;var s=o.styles+";";return s}return tm(e,t,r)}}var l=r;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function tm(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Mn(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]+"}":Pl(s)&&(n+=go(o)+":"+Dl(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)Pl(a[l])&&(n+=go(o)+":"+Dl(o,a[l])+";");else{var d=Mn(e,t,a);switch(o){case"animation":case"animationName":{n+=go(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Nl=/label:\s*([^\s;{]+)\s*(;|$)/g,st;function yo(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="";st=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Mn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Mn(r,t,e[s]),n){var l=o;i+=l[s]}Nl.lastIndex=0;for(var d="",y;(y=Nl.exec(i))!==null;)d+="-"+y[1];var h=Yh(i)+d;return{name:h,styles:i,next:st}}function su(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var rm=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},nm=function(e,t,r){rm(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 Ll(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Ul(e,t,r){var n=[],i=su(e,n,r);return n.length<2?r:i+t(n)}var im=function(e){var t=Qh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=yo(s,t.registered,void 0);return nm(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=yo(s,t.registered),y="animation-"+d.name;return Ll(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=yo(s,t.registered);Ll(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return Ul(t.registered,r,om(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:su.bind(null,t.registered),merge:Ul.bind(null,t.registered,r)}},om=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},am=im({key:"css"}),Nt=am.css,Do,Oe,bo,Ml,Bl=0,lu=[],fe=B,Fl=fe.__b,jl=fe.__r,Jl=fe.diffed,Vl=fe.__c,Hl=fe.unmount,$l=fe.__;function sm(e,t){fe.__h&&fe.__h(Oe,e,Bl||t),Bl=0;var r=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function uu(e,t){var r=sm(Do++,7);return cm(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function lm(){for(var e;e=lu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Nn),e.__H.__h.forEach(No),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Oe=null,Fl&&Fl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$l&&$l(e,t)},fe.__r=function(e){jl&&jl(e),Do=0;var t=(Oe=e.__c).__H;t&&(bo===Oe?(t.__h=[],Oe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Nn),t.__h.forEach(No),t.__h=[],Do=0)),bo=Oe},fe.diffed=function(e){Jl&&Jl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(lu.push(t)!==1&&Ml===fe.requestAnimationFrame||((Ml=fe.requestAnimationFrame)||um)(lm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),bo=Oe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Nn),r.__h=r.__h.filter(function(n){return!n.__||No(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),Vl&&Vl(e,t)},fe.unmount=function(e){Hl&&Hl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Nn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Gl=typeof requestAnimationFrame=="function";function um(e){var t,r=function(){clearTimeout(n),Gl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Gl&&(t=requestAnimationFrame(r))}function Nn(e){var t=Oe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Oe=t}function No(e){var t=Oe;e.__c=e.__(),Oe=t}function cm(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var dm=Symbol.for("preact-signals");function $n(){if(lt>1)lt--;else{for(var e,t=!1;cr!==void 0;){var r=cr;for(cr=void 0,Lo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&du(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Lo=0,lt--,t)throw e}}function Ce(e){if(lt>0)return e();lt++;try{return e()}finally{$n()}}var Y=void 0,cr=void 0,lt=0,Lo=0,Bn=0;function cu(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=dm;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 gr(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=cu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Lo>100)throw new Error("Cycle detected");this.v=e,this.i++,Bn++,lt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{$n()}}}});function X(e){return new ve(e)}function du(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 fu(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 hu(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 Lt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=Bn-1,this.f=4}(Lt.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Bn))return!0;if(this.g=Bn,this.f|=1,this.i>0&&!du(this))return this.f&=-2,!0;var e=Y;try{fu(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,hu(this),this.f&=-2,!0};Lt.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)};Lt.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)}};Lt.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(Lt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=cu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function dr(e){return new Lt(e)}function mu(e){var t=e.u;if(e.u=void 0,typeof t=="function"){lt++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Wo(e),n}finally{Y=r,$n()}}}function Wo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,mu(e)}function fm(e){if(Y!==this)throw new Error("Out-of-order effect");hu(this),Y=e,this.f&=-2,8&this.f&&Wo(this),$n()}function _r(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}_r.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()}};_r.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,mu(this),fu(this),lt++;var e=Y;return Y=this,fm.bind(this,e)};_r.prototype.N=function(){2&this.f||(this.f|=2,this.o=cr,cr=this)};_r.prototype.d=function(){this.f|=8,1&this.f||Wo(this)};function gr(e){var t=new _r(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var pu,wo,vu=[];gr(function(){pu=this.N})();function Ut(e,t){B[e]=t.bind(null,B[e]||function(){})}function Fn(e){wo&&wo(),wo=e&&e.S()}function _u(e){var t=this,r=e.data,n=gu(r);n.value=r;var i=uu(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=dr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=dr(function(){return!Array.isArray(d.value)&&!no(d.value)}),h=gr(function(){if(this.N=yu,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}_u.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:_u},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Ut("__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)});Ut("__r",function(e,t){Fn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return gr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Fn(r),e(t)});Ut("__e",function(e,t,r,n){Fn(),e(t,r,n)});Ut("diffed",function(e,t){Fn();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 l in n){var d=o[l],y=n[l];d===void 0?(d=hm(r,l,y,i),o[l]=d):d.o(y,i)}}}e(t)});function hm(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:gr(function(){this.N=yu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Ut("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)});Ut("__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 gu(e){return uu(function(){return X(e)},[])}var mm=function(e){queueMicrotask(function(){queueMicrotask(e)})};function pm(){Ce(function(){for(var e;e=vu.shift();)pu.call(e)})}function yu(){vu.push(this)===1&&(B.requestAnimationFrame||mm)(pm)}var Ee=Nt`
|
|
1
|
+
var Vc=Object.create;var si=Object.defineProperty,Hc=Object.defineProperties,$c=Object.getOwnPropertyDescriptor,Gc=Object.getOwnPropertyDescriptors,qc=Object.getOwnPropertyNames,Tr=Object.getOwnPropertySymbols,Ia=Object.getPrototypeOf,li=Object.prototype.hasOwnProperty,Sa=Object.prototype.propertyIsEnumerable,Kc=Reflect.get;var Aa=(e,t,r)=>t in e?si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))li.call(t,r)&&Aa(e,r,t[r]);if(Tr)for(var r of Tr(t))Sa.call(t,r)&&Aa(e,r,t[r]);return e},ke=(e,t)=>Hc(e,Gc(t));var qt=(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 Ra=(e,t)=>{var r={};for(var n in e)li.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tr)for(var n of Tr(e))t.indexOf(n)<0&&Sa.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var ui=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Wc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qc(t))!li.call(e,i)&&i!==r&&si(e,i,{get:()=>t[i],enumerable:!(n=$c(t,i))||n.enumerable});return e};var ci=(e,t,r)=>(r=e!=null?Vc(Ia(e)):{},Wc(t||!e||!e.__esModule?si(r,"default",{value:e,enumerable:!0}):r,e));var Ca=(e,t,r)=>Kc(Ia(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function nd(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function La(e){return new Promise(t=>setTimeout(t,e))}function gi(e){return typeof e=="string"}function Ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ma(e){return typeof e=="object"&&Array.isArray(e)}function id(e){return typeof e=="undefined"}function od(e){return id(e)||e===null}function ad(e){return typeof e=="function"}function Ba(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Fa(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],l=o[a],d=r(s,l,a,i,o);d!==void 0?i[a]=d:Ta(l)&&Ta(s)?i[a]=n(Da({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function Ta(e){return e&&typeof e=="object"&&e.constructor===Object}function ja(e,t){if(Array.isArray(e))return e.concat(t)}function Qt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!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,l&&!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 ud(e,t){return(...r)=>t(e,...r)}function $a(e){return t=>ud(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new ld(`${i}`))}})}function Kt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Or(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 pd(e){let t=e.location?Or(e.location,Pa):null,r=e.target?Or(e.target,Pa):null;return Or(ed(Da({},e),{location:t,target:r}),hd)}function Ai(e){let t=e.events.map(n=>pd(n)),r=Or(e.device,md);return[e.protocolVersion,t,r,e.project]}function vd(){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=>Ka(e)(t))}function Ka(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Cd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new zt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function xd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Td(e[n],t[n])}function Td(e,t){if(gi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(ad(t)){try{if(e instanceof t)return}catch(r){}if(!od(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 Od(){return typeof globalThis!="undefined"?globalThis[Wa]:void 0}function Pd(e){typeof globalThis!="undefined"&&(globalThis[Wa]=e)}function _e(e=!1){let t=Od();if(!e&&t)return t;let r=new Pr,n=new vi,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 Pd(i),i}var _i,zc,Qc,Yc,ka,Xc,Zc,xa,Da,ed,td,Na,rd,sd,yi,bi,Ja,Va,ld,Ha,Dr,Nr,wi,Ne,fi,cd,Ei,Oa,dd,ut,Et,fd,Pa,hd,md,ct,wt,_d,Ee,gd,yd,bd,Ga,Ii,Si,wd,Ed,qa,hi,te,Ad,Id,Wt,zt,je,pi,Sd,di,kd,dt,Pr,vi,Wa,V=Z(()=>{"use strict";_i=Object.defineProperty,zc=Object.defineProperties,Qc=Object.getOwnPropertyDescriptor,Yc=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertySymbols,Xc=Object.prototype.hasOwnProperty,Zc=Object.prototype.propertyIsEnumerable,xa=(e,t,r)=>t in e?_i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Da=(e,t)=>{for(var r in t||(t={}))Xc.call(t,r)&&xa(e,r,t[r]);if(ka)for(var r of ka(t))Zc.call(t,r)&&xa(e,r,t[r]);return e},ed=(e,t)=>zc(e,Yc(t)),td=(e,t)=>{for(var r in t)_i(e,r,{get:t[r],enumerable:!0})},Na=(e,t,r,n)=>{for(var i=n>1?void 0:n?Qc(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&&_i(t,r,i),i},rd=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.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}sd=(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))(sd||{}),yi=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}},bi=class extends yi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ja=class extends yi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Va=class extends Ja{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ld=class extends Ja{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))}},Ha=class extends bi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Dr=class extends bi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Nr=class extends yi{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}}},wi=class extends bi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:Kt("log"),warn:Kt("warn"),info:Kt("info"),error:Kt("error"),debug:Kt("debug")};Object.assign(globalThis,{logger:Ne});fi=Symbol.for("Jolibox.canIUseMap"),cd={};globalThis[fi]||(globalThis[fi]=cd);Ei={get config(){return globalThis[fi]}},Oa=Symbol.for("Jolibox.canIUseMap.native"),dd={};globalThis[Oa]||(globalThis[Oa]=dd);ut=(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))(ut||{}),Et=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Et||{}),fd=(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))(fd||{}),Pa=["name","params"],hd=["name","type","location","target","extra","timestamp","userId"],md=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ct=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});vd();wt=typeof window=="undefined",_d=()=>!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")},gd=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",yd="device_id",bd="advertising_id",Ga=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ct()),window.__joliboxLocalStorage__.getItem(e)),Ii=()=>new URLSearchParams(window.location.search).get("deviceId")||Ga(yd),Si=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ga(bd),wd=e=>e.charAt(0).toUpperCase()+e.slice(1),Ed=()=>{var e;let t=new URLSearchParams(window.location.search);return wd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},qa=e=>{if(_d())return window.navigator.userAgent;let t="JoliboxWebSDK",r=gd(),n=navigator.language,i=Ii(),o=Si();return`${t} (${Ed()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},hi=class mi{constructor(t){this.element=t,this.next=mi.Undefined,this.prev=mi.Undefined}};hi.Undefined=new hi(void 0);te=hi,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}},Id=0,Wt=class{constructor(e){this.value=e,this.id=Id++}},zt=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 Wt&&(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,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Wt(t);return this._listeners?this._listeners instanceof Wt?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)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof Wt)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 Wt?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 zt,o=l=>t(...l.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 l of s)t(...l.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)}},pi={};td(pi,{None:()=>Sd,filter:()=>Cd,once:()=>Ka,toPromise:()=>Rd});Sd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});di=Symbol.for("Jolibox.hostEmitter"),kd=()=>{let e=new je;return globalThis[di]||(globalThis[di]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[di]},dt=kd();Pr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new zt,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 xd(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}};Pr=Na([Ba],Pr);vi=class{constructor(){this._onWillExecuteCommand=new zt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new zt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Pr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=nd(3e4)),this._starActivation}executeCommand(e,...t){return rd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),pi.toPromise(pi.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}}};vi=Na([Ba],vi);Wa=Symbol.for("Jolibox.commands")});function xe(e,t={}){Ri.emit("ERROR_REPORT",{error:e,options:t})}var Ri,ft,Ge=Z(()=>{"use strict";V();V();Ri=new je,ft=new je;xe.debounce=Qt(xe,50,{leading:!0})});var Ci,Dd,za,Qa,Ya=Z(()=>{"use strict";V();Ge();Ci=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{}}},Dd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},za=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:Ci(o),payloadJson:Ci(a),signature:Ci(s)}}else throw"joli_source is missing"}catch(r){return xe(new Ha(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Qa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Dd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Nd,Lr,Xa,ki=Z(()=>{"use strict";V();Nd="1.1.50",Lr=()=>Nd,Xa=()=>{let e=Lr();return`${qa(e)}`}});function Ti(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Ld,Za,xi,es,oe,Ud,D,me=Z(()=>{"use strict";V();Ya();ki();V();Ld={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Ii(),adId:Si(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Lr()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},xi=(Za=globalThis.joliboxJSCore)==null?void 0:Za.env,oe=Object.assign({},(es=xi==null?void 0:xi())!=null?es:Ld);Ud=()=>{var f,b,A,R,w,x,N,j,H,S,L;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?za(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.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=oe.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?x:n,l=!!((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 O;return(O=performance.timeOrigin)!=null?O:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Lr()},get mpType(){var O,M;return(M=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,M;return(M=(O=oe.clientSessionId)!=null?O:s)!=null?M:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-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 O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Ti("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Ti("gamedistribution","jolibox")?"gamedistribution":Ti("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var W,ee,he;let O=(W=oe.deviceInfo.pixelRatio)!=null?W:1,M=(ee=oe.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,K=(he=oe.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/O:20,navigationBarHeight:K!==void 0?K/O:10}},onEnvConfigChanged:O=>{Fa(oe,O,ja)},encodeJoliSourceQuery:O=>{var M,K;return t&&r?Qa(Q(Q({},e),O),(M=o.get("joliSource"))!=null?M:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},D=Ud()});var Oi,rs,Md,Bd,ts,Fd,ns=Z(()=>{"use strict";V();Ge();me();V();Oi=!1,rs=(e,t)=>e==null?!1:t in e,Md=e=>rs(e,"kind"),Bd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},ts=(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:Bd(e.name)},i=ke(Q({},n),{env:t.environment,isFromUser:r});r?ft.emit("GLOBAL_USER_ERROR",e,i):ft.emit("GLOBAL_ERROR",e,i)},Fd=e=>rs(e,"kind")&&e.kind==="USER_ERROR";Ri.on("ERROR_REPORT",({error:e,options:t})=>{if(Oi)return;Oi=!0;let r=Md(e)&&e.raw?e.raw:e;try{let n=Fd(e);ts(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new wi(`${i}, origin error: ${r.message}`);Ne.error(o),ts(new wi(o.message),{environment:t.environment},!1)}finally{Oi=!1}})});var Pi,Di=Z(()=>{"use strict";Ge();V();Ge();Pi=e=>new Va(e)});function is(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ra(d,["eventType"]),l=ke(Q({tag:n,eventType:o!=null?o:a!=null?a:ut.Other},t),{extra:Q({},s)});n=="globalJsError"?xe(new Dr(JSON.stringify(l))):e("systemLog",l,D.webviewId)};return r.debounce=Qt(r,500,{leading:!0}),r}function os(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=Qt(t,500,{leading:!0}),t}var as=Z(()=>{"use strict";V();V();Ge();me()});function ss(e,t){let r=is(e,t),n=os(r);return{track:r,trackPerformance:n}}var ls=Z(()=>{"use strict";as()});var Ni=Z(()=>{"use strict"});var Ur,us=Z(()=>{"use strict";me();V();V();Ur=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(Ai(d),n):yield this.doReport(Ai(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Li=Z(()=>{"use strict";ls();Ni();us()});var Ui,cs,qe,Mr,Be,At=Z(()=>{"use strict";ki();me();V();Ui=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(cs=AbortSignal.timeout)!=null||(AbortSignal.timeout=Ui);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 Mr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Mr=class{constructor(t){this.xua=Xa();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(),l=`${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(l,{method:"GET",headers:o,credentials:"include",signal:Ui(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,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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:Ui(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,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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=Mr;Be=qe.getInstance()});var Mi,Br,Bi=Z(()=>{"use strict";me();Li();At();Mi=class extends Ur{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)})}},Br=new Mi});var jd,ds=Z(()=>{"use strict";ns();V();Di();V();Bi();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:ut.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Br.trackEvent(n,Et.WebSDK)};ft.on("GLOBAL_ERROR",(e,t)=>{jd(t.tag,e)});ft.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var Fr,fs=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)},l=()=>{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():l())});let p=this.visible;return{start(){o||(o=!0,p?d():l())},stop(){o=!1,y(),h()}}}}});var jr,hs=Z(()=>{"use strict";me();fs();At();jr=class extends Fr{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}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var ms,Jd,Le,Vd,Fi,ht,nt=Z(()=>{"use strict";ds();V();V();Li();Bi();hs();me();Ni();ms=_e(),Jd={type:Et.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Le,trackPerformance:Vd}=ss((...e)=>{var a,s,l,d;let[,t]=e,r=t,n=Ua(r.extra)?r.extra:gi(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:ut.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(l=D.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Br.trackEvent(o,Et.WebSDK)},Jd);ms.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Vd(e,t,r)});ms.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});Fi=new je,ht=new jr(Le,Fi)});function ps(e){let t=Ei.config[e];return t||(t={},Ei.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var vs=Z(()=>{"use strict";V()});function ji(e){_s=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 Ji(e){let t=Vi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Vi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var _s,ce,Vr,Hr,$r,Gr,It,qr,Kr,Wr,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,Hi=Z(()=>{"use strict";_s=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(_s)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 ${Ji(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}};Vr=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}},Hr=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}},Gr=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}},qr=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}},Wr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},zr=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 ${Ji(t)}`)}return!0}},Qr=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}},Yr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Vi(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 l=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}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Xr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Vi(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}},Zr=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Ji(this.value),actual:r}):!0}},en=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}},tn=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}},rn=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},nn=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 $i(e,t,r="param"){if(e.errors=[],e.path=r,ji(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,ji(!1),new TypeError(n)}}var F,Gi=Z(()=>{"use strict";Hi();Hi();F={object(e){return new Xr(e)},array(e){return new Qr(e)},tuple(...e){return new tn(...e)},literal(e){return new Zr(e)},or(...e){return new en(...e)},symbol(){return new Gr},record(e){return new Yr(e)},function(){return new Wr},boolean(){return new Hr},string(){return new $r},number(){return new Vr},undefined(){return new qr},null(){return new Kr},unknown(){return new It},any(){return new It},as(){return new It},arraybuffer(){return new rn},enum(...e){return new zr(...e)},typedarray(e){return new nn(e)}}});var on,gs,ys=Z(()=>{"use strict";V();Ge();Gi();Di();on=1,gs=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:on};on+=1;let l="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{$i(i.paramsSchema,o,"params")}catch(x){throw Pi(`${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;l=x,R=N,w=j}return{code:l,message:w,data:R}}catch(A){let R=A;y=(p=(h=R.code)!=null?h:R.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(f=R.message)!=null?f:R.errMsg)!=null?b:`${A}`;return d=`${n}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,xe(new Nr(d,y)),{code:l,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=Ma(o)?o:[o],s=Date.now(),l={method:n,trace_id:on};on+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{$i(i.paramsSchema,a,"params")}catch(x){throw Pi(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 Nr(j,x)),h}finally{let R=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var We,mt,ge,Yt=Z(()=>{"use strict";vs();nt();ys();Gi();({createAPI:We,createSyncAPI:mt}=gs(Le)),ge=ps("h5")});var As=ui((Es,zi)=>{(function(e){if(typeof Es=="object"&&typeof zi!="undefined")zi.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 qt=="function"&&qt;if(!h&&p)return p(y,!0);if(l)return l(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 l=typeof qt=="function"&&qt,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,l;if(s){var d=0,y=new s(A),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=A,l=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=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)}:l=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&&l()}}).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 l={},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 O=new this.constructor(s);if(this.state!==h){var M=this.state===y?S:L;b(O,M,this.outcome)}else this.queue.push(new f(O,S,L));return O};function f(S,L,O){this.promise=S,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){l.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){l.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,L,O){a(function(){var M;try{M=L(O)}catch(K){return l.reject(S,K)}M===S?l.reject(S,new TypeError("Cannot resolve promise with itself")):l.resolve(S,M)})}l.resolve=function(S,L){var O=w(A,L);if(O.status==="error")return l.reject(S,O.value);var M=O.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},l.reject=function(S,L){S.state=d,S.outcome=L;for(var O=-1,M=S.queue.length;++O<M;)S.queue[O].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 O=!1;function M(he){O||(O=!0,l.reject(S,he))}function K(he){O||(O=!0,l.resolve(S,he))}function W(){L(K,M)}var ee=w(W);ee.status==="error"&&M(ee.value)}function w(S,L){var O={};try{O.value=S(L),O.status="success"}catch(M){O.status="error",O.value=M}return O}p.resolve=x;function x(S){return S instanceof this?S:l.resolve(new this(s),S)}p.reject=N;function N(S){var L=new this(s);return l.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 O=S.length,M=!1;if(!O)return this.resolve([]);for(var K=new Array(O),W=0,ee=-1,he=new this(s);++ee<O;)He(S[ee],ee);return he;function He(Ht,Cr){L.resolve(Ht).then(Yn,function(yt){M||(M=!0,l.reject(he,yt))});function Yn(yt){K[Cr]=yt,++W===O&&!M&&(M=!0,l.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 O=S.length,M=!1;if(!O)return this.resolve([]);for(var K=-1,W=new this(s);++K<O;)ee(S[K]);return W;function ee(he){L.resolve(he).then(function(He){M||(M=!0,l.resolve(W,He))},function(He){M||(M=!0,l.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(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u};function s(u,m){if(!(u instanceof m))throw new TypeError("Cannot call a class as a function")}function l(){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(u){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var u=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(!u||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(u,m){u=u||[],m=m||{};try{return new Blob(u,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<u.length;g+=1)_.append(u[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(u,m){m&&u.then(function(c){m(null,c)},function(c){m(c)})}function b(u,m,c){typeof m=="function"&&u.then(m),typeof c=="function"&&u.catch(c)}function A(u){return typeof u!="string"&&(console.warn(u+" used as a key, but it is not a string."),u=String(u)),u}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(u){for(var m=u.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=u.charCodeAt(g);return c}function O(u){return new p(function(m){var c=u.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(u){return typeof x=="boolean"?p.resolve(x):O(u).then(function(m){return x=m,x})}function K(u){var m=N[u.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(u){var m=N[u.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(u,m){var c=N[u.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(u,m){return new p(function(c,_){if(N[u.name]=N[u.name]||na(),u.db)if(m)K(u),u.db.close();else return c(u.db);var g=[u.name];m&&g.push(u.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var I=v.result;try{I.createObjectStore(u.storeName),E.oldVersion<=1&&I.createObjectStore(w)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+u.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+u.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(u)}})}function He(u){return he(u,!1)}function Ht(u){return he(u,!0)}function Cr(u,m){if(!u.db)return!0;var c=!u.db.objectStoreNames.contains(u.storeName),_=u.version<u.db.version,g=u.version>u.db.version;if(_&&(u.version!==m&&console.warn('The database "'+u.name+`" can't be downgraded from version `+u.db.version+" to version "+u.version+"."),u.version=u.db.version),g||c){if(c){var v=u.db.version+1;v>u.version&&(u.version=v)}return!0}return!1}function Yn(u){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:u.type})},_.readAsBinaryString(u)})}function yt(u){var m=L(atob(u.data));return h([m],{type:u.type})}function ra(u){return u&&u.__local_forage_encoded_blob}function Hu(u){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,u,u),c}function $u(u){K(u);for(var m=N[u.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return u.db=null,He(u).then(function(v){return u.db=v,Cr(u)?Ht(u):v}).then(function(v){u.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(u,v),v})}function $e(u,m,c,_){_===void 0&&(_=1);try{var g=u.db.transaction(u.storeName,m);c(null,g)}catch(v){if(_>0&&(!u.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!u.db||v.name==="NotFoundError"&&!u.db.objectStoreNames.contains(u.storeName)&&u.version<=u.db.version)return u.db&&(u.version=u.db.version+1),Ht(u)}).then(function(){return $u(u).then(function(){$e(u,m,c,_-1)})}).catch(c);c(v)}}function na(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Gu(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=u[_];var g=N[c.name];g||(g=na(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Hu);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(T){return c.db=T,Cr(c,m._defaultConfig.version)?Ht(c):T}).then(function(T){c.db=g.db=T,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 qu(u,m){var c=this;u=A(u);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(u);k.onsuccess=function(){var T=k.result;T===void 0&&(T=null),ra(T)&&(T=yt(T)),g(T)},k.onerror=function(){v(k.error)}}catch(T){v(T)}})}).catch(v)});return f(_,m),_}function Ku(u,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(),T=1;k.onsuccess=function(){var U=k.result;if(U){var J=U.value;ra(J)&&(J=yt(J));var q=u(J,U.key,T++);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 Wu(u,m,c){var _=this;u=A(u);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:Yn(m)}):m}).then(function(C){$e(_._dbInfo,S,function(k,T){if(k)return E(k);try{var U=T.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,u);T.oncomplete=function(){C===void 0&&(C=null),v(C)},T.onabort=T.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 zu(u,m){var c=this;u=A(u);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(u);I.oncomplete=function(){g()},I.onerror=function(){v(k.error)},I.onabort=function(){var T=k.error?k.error:k.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return f(_,m),_}function Qu(u){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,u),c}function Yu(u){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,u),c}function Xu(u,m){var c=this,_=new p(function(g,v){if(u<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,T=C.openKeyCursor();T.onsuccess=function(){var U=T.result;if(!U){g(null);return}u===0||k?g(U.key):(k=!0,U.advance(u))},T.onerror=function(){v(T.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Zu(u){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 T=C.result;if(!T){_(k);return}k.push(T.key),T.continue()},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return f(c,u),c}function ec(u,m){m=R.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;if(!u.name)g=p.reject("Invalid arguments");else{var v=u.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(u).then(function(I){var C=N[u.name],k=C.forages;C.db=I;for(var T=0;T<k.length;T++)k[T]._dbInfo.db=I;return I});u.storeName?g=E.then(function(I){if(I.objectStoreNames.contains(u.storeName)){var C=I.version+1;K(u);var k=N[u.name],T=k.forages;I.close();for(var U=0;U<T.length;U++){var J=T[U];J._dbInfo.db=null,J._dbInfo.version=C}var q=new p(function(z,ue){var ie=d.open(u.name,C);ie.onerror=function(De){var Gt=ie.result;Gt.close(),ue(De)},ie.onupgradeneeded=function(){var De=ie.result;De.deleteObjectStore(u.storeName)},ie.onsuccess=function(){var De=ie.result;De.close(),z(De)}});return q.then(function(z){k.db=z;for(var ue=0;ue<T.length;ue++){var ie=T[ue];ie._dbInfo.db=z,W(ie._dbInfo)}}).catch(function(z){throw(ee(u,z)||p.resolve()).catch(function(){}),z})}}):g=E.then(function(I){K(u);var C=N[u.name],k=C.forages;I.close();for(var T=0;T<k.length;T++){var U=k[T];U._dbInfo.db=null}var J=new p(function(q,z){var ue=d.deleteDatabase(u.name);ue.onerror=function(){var ie=ue.result;ie&&ie.close(),z(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+u.name+'" until all open connections are closed')},ue.onsuccess=function(){var ie=ue.result;ie&&ie.close(),q(ie)}});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(u,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var tc={_driver:"asyncStorage",_initStorage:Gu,_support:y(),iterate:Ku,getItem:qu,setItem:Wu,removeItem:zu,clear:Qu,length:Yu,key:Xu,keys:Zu,dropInstance:ec};function rc(){return typeof openDatabase=="function"}var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nc="~~local_forage_type~",ia=/^~~local_forage_type~([^~]+)~/,kr="__lfsc__:",Xn=kr.length,Zn="arbf",ei="blob",oa="si08",aa="ui08",sa="uic8",la="si16",ua="si32",ca="ur16",da="ui32",fa="fl32",ha="fl64",ma=Xn+Zn.length,pa=Object.prototype.toString;function va(u){var m=u.length*.75,c=u.length,_,g=0,v,E,I,C;u[u.length-1]==="="&&(m--,u[u.length-2]==="="&&m--);var k=new ArrayBuffer(m),T=new Uint8Array(k);for(_=0;_<c;_+=4)v=tt.indexOf(u[_]),E=tt.indexOf(u[_+1]),I=tt.indexOf(u[_+2]),C=tt.indexOf(u[_+3]),T[g++]=v<<2|E>>4,T[g++]=(E&15)<<4|I>>2,T[g++]=(I&3)<<6|C&63;return k}function ti(u){var m=new Uint8Array(u),c="",_;for(_=0;_<m.length;_+=3)c+=tt[m[_]>>2],c+=tt[(m[_]&3)<<4|m[_+1]>>4],c+=tt[(m[_+1]&15)<<2|m[_+2]>>6],c+=tt[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 ic(u,m){var c="";if(u&&(c=pa.call(u)),u&&(c==="[object ArrayBuffer]"||u.buffer&&pa.call(u.buffer)==="[object ArrayBuffer]")){var _,g=kr;u instanceof ArrayBuffer?(_=u,g+=Zn):(_=u.buffer,c==="[object Int8Array]"?g+=oa:c==="[object Uint8Array]"?g+=aa:c==="[object Uint8ClampedArray]"?g+=sa:c==="[object Int16Array]"?g+=la:c==="[object Uint16Array]"?g+=ca:c==="[object Int32Array]"?g+=ua:c==="[object Uint32Array]"?g+=da:c==="[object Float32Array]"?g+=fa:c==="[object Float64Array]"?g+=ha:m(new Error("Failed to get type for BinaryArray"))),m(g+ti(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=nc+u.type+"~"+ti(this.result);m(kr+ei+E)},v.readAsArrayBuffer(u)}else try{m(JSON.stringify(u))}catch(E){console.error("Couldn't convert value into a JSON string: ",u),m(null,E)}}function oc(u){if(u.substring(0,Xn)!==kr)return JSON.parse(u);var m=u.substring(ma),c=u.substring(Xn,ma),_;if(c===ei&&ia.test(m)){var g=m.match(ia);_=g[1],m=m.substring(g[0].length)}var v=va(m);switch(c){case Zn:return v;case ei:return h([v],{type:_});case oa:return new Int8Array(v);case aa:return new Uint8Array(v);case sa:return new Uint8ClampedArray(v);case la:return new Int16Array(v);case ca:return new Uint16Array(v);case ua:return new Int32Array(v);case da:return new Uint32Array(v);case fa:return new Float32Array(v);case ha:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var ri={serialize:ic,deserialize:oc,stringToBuffer:va,bufferToString:ti};function _a(u,m,c,_){u.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function ac(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=typeof u[_]!="string"?u[_].toString():u[_];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){_a(I,c,function(){m._dbInfo=c,v()},function(C,k){E(k)})},E)});return c.serializer=ri,g}function rt(u,m,c,_,g,v){u.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):_a(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,I)},v)}function sc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[u],function(C,k){var T=k.rows.length?k.rows.item(0).value:null;T&&(T=E.serializer.deserialize(T)),g(T)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function lc(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT * FROM "+E.storeName,[],function(C,k){for(var T=k.rows,U=T.length,J=0;J<U;J++){var q=T.item(J),z=q.value;if(z&&(z=E.serializer.deserialize(z)),z=u(z,q.key,J+1),z!==void 0){g(z);return}}g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ga(u,m,c,_){var g=this;u=A(u);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(T,U){U?I(U):k.db.transaction(function(J){rt(J,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[u,T],function(){E(C)},function(q,z){I(z)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(ga.apply(g,[u,C,c,_-1]));return}I(J)}})})}).catch(I)});return f(v,c),v}function uc(u,m,c){return ga.apply(this,[u,m,c,1])}function cc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[u],function(){g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function dc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function fc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(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,u),c}function hc(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){rt(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[u+1],function(C,k){var T=k.rows.length?k.rows.item(0).key:null;g(T)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function mc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){rt(E,v,"SELECT key FROM "+v.storeName,[],function(I,C){for(var k=[],T=0;T<C.rows.length;T++)k.push(C.rows.item(T).key);_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function pc(u){return new p(function(m,c){u.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:u,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function vc(u,m){m=R.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;return u.name?g=new p(function(v){var E;u.name===c.name?E=_._dbInfo.db:E=openDatabase(u.name,"","",0),u.storeName?v({db:E,storeNames:[u.storeName]}):v(pc(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(ie,De){ue(De)})})}for(var T=[],U=0,J=v.storeNames.length;U<J;U++)T.push(k(v.storeNames[U]));p.all(T).then(function(){E()}).catch(function(q){I(q)})},function(C){I(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var _c={_driver:"webSQLStorage",_initStorage:ac,_support:rc(),iterate:lc,getItem:sc,setItem:uc,removeItem:cc,clear:dc,length:fc,key:hc,keys:mc,dropInstance:vc};function gc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(u){return!1}}function ya(u,m){var c=u.name+"/";return u.storeName!==m.storeName&&(c+=u.storeName+"/"),c}function yc(){var u="_localforage_support_test";try{return localStorage.setItem(u,!0),localStorage.removeItem(u),!1}catch(m){return!0}}function bc(){return!yc()||localStorage.length>0}function wc(u){var m=this,c={};if(u)for(var _ in u)c[_]=u[_];return c.keyPrefix=ya(u,m._defaultConfig),bc()?(m._dbInfo=c,c.serializer=ri,p.resolve()):p.reject()}function Ec(u){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,u),c}function Ac(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+u);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function Ic(u,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 T=localStorage.key(k);if(T.indexOf(v)===0){var U=localStorage.getItem(T);if(U&&(U=g.serializer.deserialize(U)),U=u(U,T.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function Sc(u,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(u)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function Rc(u){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,u),c}function Cc(u){var m=this,c=m.keys().then(function(_){return _.length});return f(c,u),c}function kc(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+u)});return f(_,m),_}function xc(u,m,c){var _=this;u=A(u);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,T){if(T)I(T);else try{localStorage.setItem(C.keyPrefix+u,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 Tc(u,m){if(m=R.apply(this,arguments),u=typeof u!="function"&&u||{},!u.name){var c=this.config();u.name=u.name||c.name,u.storeName=u.storeName||c.storeName}var _=this,g;return u.name?g=new p(function(v){u.storeName?v(ya(u,_._defaultConfig)):v(u.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 Oc={_driver:"localStorageWrapper",_initStorage:wc,_support:gc(),iterate:Ic,getItem:Ac,setItem:xc,removeItem:kc,clear:Ec,length:Cc,key:Sc,keys:Rc,dropInstance:Tc},Pc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Dc=function(m,c){for(var _=m.length,g=0;g<_;){if(Pc(m[g],c))return!0;g++}return!1},ba=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},$t={},wa={},bt={INDEXEDDB:tc,WEBSQL:_c,LOCALSTORAGE:Oc},Nc=[bt.INDEXEDDB._driver,bt.WEBSQL._driver,bt.LOCALSTORAGE._driver],xr=["dropInstance"],ni=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(xr),Lc={description:"",driver:Nc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Uc(u,m){u[m]=function(){var c=arguments;return u.ready().then(function(){return u[m].apply(u,c)})}}function ii(){for(var u=1;u<arguments.length;u++){var m=arguments[u];if(m)for(var c in m)m.hasOwnProperty(c)&&(ba(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Mc=function(){function u(m){s(this,u);for(var c in bt)if(bt.hasOwnProperty(c)){var _=bt[c],g=_._driver;this[c]=g,$t[g]||this.defineDriver(_)}this._defaultConfig=ii({},Lc),this._config=ii({},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 u.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},u.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 T=ni.concat("_initStorage"),U=0,J=T.length;U<J;U++){var q=T[U],z=!Dc(xr,q);if((z||c[q])&&typeof c[q]!="function"){I(k);return}}var ue=function(){for(var Gt=function(jc){return function(){var Jc=new Error("Method "+jc+" is not implemented by the current driver"),Ea=p.reject(Jc);return f(Ea,arguments[arguments.length-1]),Ea}},oi=0,Fc=xr.length;oi<Fc;oi++){var ai=xr[oi];c[ai]||(c[ai]=Gt(ai))}};ue();var ie=function(Gt){$t[C]&&console.info("Redefining LocalForage driver: "+C),$t[C]=c,wa[C]=Gt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(De){I(De)}});return b(v,_,g),v},u.prototype.driver=function(){return this._driver||null},u.prototype.getDriver=function(c,_,g){var v=$t[c]?p.resolve($t[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},u.prototype.getSerializer=function(c){var _=p.resolve(ri);return b(_,c),_},u.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},u.prototype.setDriver=function(c,_,g){var v=this;ba(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 T=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=T.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},u.prototype.supports=function(c){return!!wa[c]},u.prototype._extend=function(c){ii(this,c)},u.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},u.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=ni.length;c<_;c++)Uc(this,ni[c])},u.prototype.createInstance=function(c){return new u(c)},u}(),Bc=new Mc;i.exports=Bc},{3:3}]},{},[4])(4)})});var Ss=ui(cn=>{"use strict";V();Yt();nt();var Yi=_e(),sf=We("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(cn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;Ne.info("onLevelFinished",r,n,i,o),yield Promise.all([ht.reporter({event:"COMPLETE_GAME_LEVEL"}),ht.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),lf=We("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number(),variation:F.string().optional()})),implement:e=>P(cn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;return Ne.info("onGamePlayEnded",t,r,n,i),ht.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i})})}),uf=We("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>P(cn,[r],function*({levelId:e,name:t}){return ht.tracker("LevelUpgrade",{name:t,levelId:e})})});Yi.registerCommand("TaskTrackerSDK.levelFinished",sf);Yi.registerCommand("TaskTrackerSDK.gamePlayEnded",lf);Yi.registerCommand("TaskTrackerSDK.levelUpgrade",uf);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,Rs,Xi,cf,dn,Zi=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,Rs=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)}},Xi=!1,cf=()=>{Xi||(window.addEventListener("message",Rs),Xi=!0)},dn=(e,t)=>{cf(),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",Rs),Xi=!1)}}});var fn,hn,mn,pn,vn,Cs,_n,gn,Rt,df,ae,Ct,kt,Ue=Z(()=>{"use strict";V();fn="UNLOCK_OPTIONS_CHANGED",hn="INVOKE_PAYMENT",mn="ON_PAYMENT_RESULT",pn="ON_USE_MODAL_EVENT",vn="ON_USE_MODAL_RESULT",Cs="ON_USE_MODAL_FREQUENCY",_n="ON_USE_UNLOGIN_MODAL_EVENT",gn="INVOKE_UNLOGIN_MODAL_EVENT",Rt=new je,df=()=>({on:Rt.on.bind(Rt),off:Rt.off.bind(Rt),emit:Rt.emit.bind(Rt)}),ae=df(),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 Iu=ui(Yo=>{"use strict";me();Ue();Zi();V();var Au={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};dn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Au[e.result],e.result),ae.emit(vn,{useModalResult:Au[e.result]})});ae.on(pn,(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:ct()})});dn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(mn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(hn,(e,t)=>P(Yo,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:ct()})}));dn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(_n,{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(gn,e=>P(Yo,null,function*(){pt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:ct(),type:e})}))});nt();me();Yt();V();var bs=_e(),$d="env",Gd="getSystemInfoSync",qd=()=>{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},Kd=mt(Gd,{implement:qd}),Wd=mt($d,{implement:()=>ke(Q({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});bs.registerCommand("API.env",Wd);bs.registerCommand("API.getSystemInfoSync",Kd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});V();Yt();Ge();nt();var zd="onJoliboxShow",Qd="onJoliboxHide",Yd="onReady",Ki=_e(),Wi=$a(xe),qi=!0,Xt=!0,an=0,sn=Fi;function Xd(){let e=Date.now();if(e-an<100)return;an=e;let t=document.visibilityState==="visible";t!==qi&&(qi=t,sn.emit("visible",qi))}function ws(e){let t=Date.now();t-an<100||(an=t,e==="focus"&&!Xt?Xt=!0:e==="blur"&&Xt&&(Xt=!1),sn.emit("visible",Xt))}document.addEventListener("visibilitychange",Xd);window.addEventListener("focus",()=>ws("focus"));window.addEventListener("blur",()=>ws("blur"));var Zd=mt(zd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Wi(e);sn.on("visible",r=>{r&&t()})}}),ef=mt(Qd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Wi(e);sn.on("visible",r=>{!r&&t()})}}),tf=mt(Yd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Wi(e);dt.on("LifecycleEvent.onReady",r=>{t(r)})}});Ki.registerCommand("LifecycleSDK.onReady",tf);Ki.registerCommand("LifecycleSDK.onJoliboxShow",Zd);Ki.registerCommand("LifecycleSDK.onJoliboxHide",ef);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});Yt();V();At();me();var Is=ci(As());var ln=_e(),Qi=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=Is.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},un=new Qi,rf=We("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield un.getItem(e)})}});ln.registerCommand("StorageSDK.getItem",rf);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var nf=We("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return P(this,null,function*(){return yield un.setItem(e,t)})}});ln.registerCommand("StorageSDK.setItem",nf);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var of=We("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield un.removeItem(e)})}});ln.registerCommand("StorageSDK.removeItem",of);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var af=We("clearStorage",{implement(){return P(this,null,function*(){return yield un.clear()})}});ln.registerCommand("StorageSDK.clear",af);ge("storage.clear",{version:"1.0.0"});var Sb=ci(Ss());nt();V();At();Zi();me();Ue();var ks=D.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,l)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;ks&&console.log(`handleReward ${l}`);let y=e.get(l),h=y?yield y(...o):d;return ks&&console.log(`handleReward ${l} ${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 ff=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,hf=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(ff()):["ADS"],Ts=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(fn,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let l=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return hf(l)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Os=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(Cs,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||Ct,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||kt}),dt.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 Ps=e=>t=>P(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});Ue();function it(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=it(ae,fn);me();V();V();var ot=_e();Ue();Ue();var eo=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;ot.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,l,d,y;let n=yield Me.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(l=n==null?void 0:n.options)==null?void 0:l.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"}}))},Zt=(e,t)=>r=>P(void 0,null,function*(){let n=it(ae,vn);return ae.emit(pn,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var yn=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Ds=(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 to=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;ot.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var l,d,y,h,p,f;let i=yield Me.getData(),o=yield yn(r),a=(y=(d=(l=i==null?void 0:i.options)==null?void 0:l.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),Ds((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},er=(e,t)=>r=>P(void 0,null,function*(){let n=it(ae,mn);return ae.emit(hn,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 ro=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;ot.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,l,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}=(l=(s=A.rewards)==null?void 0:s.jolicoin)!=null?l:{};if(A.result=="SUCCESS"){R&&w&&(yield La(3e3));let x=yield yn(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"}}))},tr=(e,t)=>()=>P(void 0,null,function*(){let r=it(ae,_n);return ae.emit(gn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var bn=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>(ro(e,{httpClient:t,showUnloginModal:s}),to(e,{httpClient:t,initiateAndAwaitPayment:o}),eo(e,{showUnlockWithJolicoinModal:a}),l=>P(void 0,null,function*(){var d,y,h;try{let p=!0,f=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];for(let A of f){let R=yield ot.executeCommand(A);if(p=p&&R.result!=="FAILED",R.result!=="CONTINUE")break}if(!p)return n==null||n(l),!1;let b=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ct()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});return console.log("-----unlockWithJolicoin request result-----",b),b.code=="SUCCESS"?((y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in l&&((h=l.adViewed)==null||h.call(l)),r==null||r({quantity:b.data.quantity,balance:b.data.balance}),!0):(n==null||n(l),!1)}catch(p){if(console.info("JolicoinRewardHandler error:",p),p instanceof Error&&p.message=="CANCEL")throw p;return n==null||n(l),!1}finally{i.clearCache()}}));var Ns=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=Zt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=er("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=tr("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return bn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Ls=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=l=>{var d;r==null||r(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Zt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=er("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=tr("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return bn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var ze=xs();Ts(ze);Os(ze);var In,B,js,oo,vt,Us,Js,Vs,Hs,ao,no,io,mf,rr={},$s=[],pf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nr=Array.isArray;function Qe(e,t){for(var r in t)e[r]=t[r];return e}function so(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ir(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?In.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 En(e,a,n,i,null)}function En(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 at(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 Gs(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 Gs(e)}}function Ms(e){(!e.__d&&(e.__d=!0)&&vt.push(e)&&!An.__r++||Us!==B.debounceRendering)&&((Us=B.debounceRendering)||Js)(An)}function An(){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=Qe({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),lo(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,Ws(o,r,a),r.__e!=i&&Gs(r)));An.__r=0}function qs(e,t,r,n,i,o,a,s,l,d,y){var h,p,f,b,A,R,w=n&&n.__k||$s,x=t.length;for(l=vf(r,t,w,l,x),h=0;h<x;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?rr:w[f.__i]||rr,f.__i=h,R=lo(e,f,p,i,o,a,s,l,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&uo(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?l=Ks(f,l,e):typeof f.type=="function"&&R!==void 0?l=R:b&&(l=b.nextSibling),f.__u&=-7);return r.__e=A,l}function vf(e,t,r,n,i){var o,a,s,l,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"?(l=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?En(null,a,null,null,null):nr(a)?En(at,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?En(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=_f(a,r,l,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!=l&&(d==l-1?p--:d==l+1?p++:(d>l?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)),Qs(s,s));return n}function Ks(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=Ks(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 or(e,t){return t=t||[],e==null||typeof e=="boolean"||(nr(e)?e.some(function(r){or(r,t)}):t.push(e)),t}function _f(e,t,r,n){var i,o,a=e.key,s=e.type,l=t[r];if(l===null&&e.key==null||l&&a==l.key&&s===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&a==l.key&&s===l.type)return i;i--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function Bs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||pf.test(t)?r:r+"px"}function wn(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||Bs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Bs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Hs,"$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=ao,e.addEventListener(t,o?io:no,o)):e.removeEventListener(t,o?io:no,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 Fs(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=ao++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function lo(e,t,r,n,i,o,a,s,l,d){var y,h,p,f,b,A,R,w,x,N,j,H,S,L,O,M,K,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(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=yf),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=Qe({},h.__s)),Qe(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),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);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=Qe(Qe({},n),h.getChildContext())),x&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,b)),M=y,y!=null&&y.type===at&&y.key==null&&(M=zs(y.props.children)),s=qs(e,nr(M)?M:[M],t,r,n,i,o,a,s,l,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,l||o!=null)if(ee.then){for(t.__u|=l?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--;)so(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=gf(r.__e,t,r,n,i,o,a,l,d);return(y=B.diffed)&&y(t),128&t.__u?void 0:s}function Ws(e,t,r){for(var n=0;n<r.length;n++)uo(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 zs(e){return typeof e!="object"||e==null?e:nr(e)?e.map(zs):Qe({},e)}function gf(e,t,r,n,i,o,a,s,l){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&&In.call(e.childNodes),R=r.props||rr,!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;wn(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||wn(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=""),qs(t.type==="template"?e.content:e,nr(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,l),o!=null)for(d=o.length;d--;)so(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])&&wn(e,d,b,R[d],i),d="checked",A!==void 0&&A!==e[d]&&wn(e,d,A,R[d],i))}return e}function uo(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 Qs(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||uo(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]&&Qs(n[i],t,r||typeof e.type!="function");r||so(e.__e),e.__c=e.__=e.__e=void 0}function yf(e,t,r){return this.constructor(e,r)}function Ys(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=[],lo(t,e=(!n&&r||t).__k=ir(at,null,[e]),i||rr,rr,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?In.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Ws(o,e,a)}In=$s.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,oo=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=Qe({},this.state),typeof e=="function"&&(e=e(Qe({},r),this.props)),e&&Qe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ms(this))},Te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ms(this))},Te.prototype.render=at,vt=[],Js=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vs=function(e,t){return e.__v.__b-t.__v.__b},An.__r=0,Hs=/(PointerCapture)$|Capture$/i,ao=0,no=Fs(!1),io=Fs(!0),mf=0;var Tt,ne,co,Xs,ar=0,al=[],se=B,Zs=se.__b,el=se.__r,tl=se.diffed,rl=se.__c,nl=se.unmount,il=se.__;function Rn(e,t){se.__h&&se.__h(ne,e,ar||t),ar=0;var r=ne.__H||(ne.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Cn(e){return ar=1,sl(ll,e)}function sl(e,t,r){var n=Rn(Tt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ll(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],d=n.t(l,s);l!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ne,!ne.__f)){var i=function(s,l,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,l,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,l,d)||h};ne.__f=!0;var o=ne.shouldComponentUpdate,a=ne.componentWillUpdate;ne.componentWillUpdate=function(s,l,d){if(this.__e){var y=o;o=void 0,i(s,l,d),o=y}a&&a.call(this,s,l,d)},ne.shouldComponentUpdate=i}return n.__N||n.__}function sr(e,t){var r=Rn(Tt++,3);!se.__s&&vo(r.__H,t)&&(r.__=e,r.u=t,ne.__H.__h.push(r))}function ho(e,t){var r=Rn(Tt++,4);!se.__s&&vo(r.__H,t)&&(r.__=e,r.u=t,ne.__h.push(r))}function mo(e){return ar=5,lr(function(){return{current:e}},[])}function lr(e,t){var r=Rn(Tt++,7);return vo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function po(e,t){return ar=8,lr(function(){return e},t)}function bf(){for(var e;e=al.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Sn),e.__H.__h.forEach(fo),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ne=null,Zs&&Zs(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),il&&il(e,t)},se.__r=function(e){el&&el(e),Tt=0;var t=(ne=e.__c).__H;t&&(co===ne?(t.__h=[],ne.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Sn),t.__h.forEach(fo),t.__h=[],Tt=0)),co=ne},se.diffed=function(e){tl&&tl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(al.push(t)!==1&&Xs===se.requestAnimationFrame||((Xs=se.requestAnimationFrame)||wf)(bf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),co=ne=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Sn),r.__h=r.__h.filter(function(n){return!n.__||fo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),rl&&rl(e,t)},se.unmount=function(e){nl&&nl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Sn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var ol=typeof requestAnimationFrame=="function";function wf(e){var t,r=function(){clearTimeout(n),ol&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ol&&(t=requestAnimationFrame(r))}function Sn(e){var t=ne,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ne=t}function fo(e){var t=ne;e.__c=e.__(),ne=t}function vo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function ll(e,t){return typeof t=="function"?t(e):t}function Af(e,t){for(var r in t)e[r]=t[r];return e}function ul(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 cl(e,t){this.props=e,this.context=t}(cl.prototype=new Te).isPureReactComponent=!0,cl.prototype.shouldComponentUpdate=function(e,t){return ul(this.props,e)||ul(this.state,t)};var dl=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),dl&&dl(e)};var Ry=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var If=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)}If(e,t,r,n)};var fl=B.unmount;function yl(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=Af({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return yl(n,t,r)})),e}function bl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return bl(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 _o(){this.__u=0,this.o=null,this.__b=null}function wl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function kn(){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),fl&&fl(e)},(_o.prototype=new Te).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=wl(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 l=n.state.__a;n.__v.__k[0]=bl(l,l.__c.__P,l.__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)},_o.prototype.componentWillUnmount=function(){this.o=[]},_o.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]=yl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&ir(at,null,e.fallback);return i&&(i.__u&=-33),[ir(at,null,t.__a?null:e.children),i]};var hl=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]}};(kn.prototype=new Te).__a=function(e){var t=this,r=wl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),hl(t,e,n)):i()};r?r(o):o()}},kn.prototype.render=function(e){this.i=null,this.l=new Map;var t=or(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},kn.prototype.componentDidUpdate=kn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){hl(e,r,t)})};var Sf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Rf=/^(?: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]/,Cf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,kf=/[A-Z0-9]/g,xf=typeof document!="undefined",Tf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function go(e,t,r){return t.__k==null&&(t.textContent=""),Ys(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 ml=B.event;function Of(){}function Pf(){return this.cancelBubble}function Df(){return this.defaultPrevented}B.event=function(e){return ml&&(e=ml(e)),e.persist=Of,e.isPropagationStopped=Pf,e.isDefaultPrevented=Df,e.nativeEvent=e};var El,Nf={enumerable:!1,configurable:!0,get:function(){return this.class}},pl=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||xf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||Tf(r.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":Cf.test(a)&&(a=l):l=a="oninput":o&&Rf.test(a)?a=a.replace(kf,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=or(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=or(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",Nf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Sf,pl&&pl(e)};var vl=B.__r;B.__r=function(e){vl&&vl(e),El=e.__c};var _l=B.diffed;B.diffed=function(e){_l&&_l(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),El=null};var Al=Object.getOwnPropertySymbols,Lf=Object.prototype.hasOwnProperty,Uf=Object.prototype.propertyIsEnumerable,Mf=(e,t)=>{var r={};for(var n in e)Lf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Al)for(var n of Al(e))t.indexOf(n)<0&&Uf.call(e,n)&&(r[n]=e[n]);return r},Wl=Object.defineProperty,Bf=Object.defineProperties,Ff=Object.getOwnPropertyDescriptors,Il=Object.getOwnPropertySymbols,jf=Object.prototype.hasOwnProperty,Jf=Object.prototype.propertyIsEnumerable,Sl=(e,t,r)=>t in e?Wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vf=(e,t)=>{for(var r in t||(t={}))jf.call(t,r)&&Sl(e,r,t[r]);if(Il)for(var r of Il(t))Jf.call(t,r)&&Sl(e,r,t[r]);return e},Hf=(e,t)=>Bf(e,Ff(t)),$f=(e,t)=>{for(var r in t)Wl(e,r,{get:t[r],enumerable:!0})},zl=(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},Gf=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.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 qf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Kf(e){return typeof e=="string"}function Wf(e){return typeof e=="undefined"}function zf(e){return Wf(e)||e===null}function Qf(e){return typeof e=="function"}function Ql(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 Yf=(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))(Yf||{});function ur(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Xf={log:ur("log"),warn:ur("warn"),info:ur("info"),error:ur("error"),debug:ur("debug")};Object.assign(globalThis,{logger:Xf});var Rl=Symbol.for("Jolibox.canIUseMap"),Zf={};globalThis[Rl]||(globalThis[Rl]=Zf);var Cl=Symbol.for("Jolibox.canIUseMap.native"),eh={};globalThis[Cl]||(globalThis[Cl]=eh);var Yl=(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))(Yl||{}),Xl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Xl||{}),Zl=(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))(Zl||{}),kl=["name","params"],th=["name","type","location","target","extra","timestamp","userId"],rh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Pn(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 nh(e){let t=e.location?Pn(e.location,kl):null,r=e.target?Pn(e.target,kl):null;return Pn(Hf(Vf({},e),{location:t,target:r}),th)}function ih(e){let t=e.events.map(n=>nh(n)),r=Pn(e.device,rh);return[e.protocolVersion,t,r,e.project]}function oh(){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}}oh();var Pt=typeof window=="undefined",xl=()=>!Pt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Pt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Pt&&navigator.userAgent.includes("Android"),!Pt&&navigator.userAgent.includes("Mac"),!Pt&&navigator.userAgent.includes("FB_IAB"),!Pt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var So=class Ro{constructor(t){this.element=t,this.next=Ro.Undefined,this.prev=Ro.Undefined}};So.Undefined=new So(void 0);var re=So,ah=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}},sh=0,cr=class{constructor(e){this.value=e,this.id=sh++}},mr=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 cr&&(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 l=new cr(e);return this._listeners?this._listeners instanceof cr?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(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 cr)this._listeners.id===l.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(l);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 cr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},lh=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 mr,o=l=>t(...l.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 l of s)t(...l.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 ah,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)}},Co={};$f(Co,{None:()=>uh,filter:()=>dh,once:()=>eu,toPromise:()=>ch});var uh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function ch(e){return new Promise(t=>eu(e)(t))}function eu(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 dh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new mr(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 yo=Symbol.for("Jolibox.hostEmitter"),fh=()=>{let e=new lh;return globalThis[yo]||(globalThis[yo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[yo]};fh();function hh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)mh(e[n],t[n])}function mh(e,t){if(Kf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Qf(t)){try{if(e instanceof t)return}catch(r){}if(!zf(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 ko=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new mr,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 hh(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}};ko=zl([Ql],ko);var Tl=class{constructor(){this._onWillExecuteCommand=new mr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new mr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ko,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=qf(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 Gf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Co.toPromise(Co.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{}}};Tl=zl([Ql],Tl);function Ie(e,t,r){return(t=ph(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ph(e){var t=vh(e,"string");return typeof t=="symbol"?t:t+""}function vh(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 xo=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)),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),r()}),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;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((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()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;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":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.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,l,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l: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 xn(e,t,r){return(t=_h(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _h(e){var t=gh(e,"string");return typeof t=="symbol"?t:t+""}function gh(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 To=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 Tn(e,t,r){return(t=yh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yh(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 Oo=class{constructor(t){Tn(this,"configs",null),Tn(this,"firstRun",!0),Tn(this,"context",void 0),Tn(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 Ye(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=Eh(e,"string");return typeof t=="symbol"?t:t+""}function Eh(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,r){Ye(this,"name","ADSENSE"),Ye(this,"context",void 0),Ye(this,"contextInfo",void 0),Ye(this,"configured",!1),Ye(this,"initParams",void 0),Ye(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Ye(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Mf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Ye(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Ye(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:l,slot:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!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 Ah(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 Ih(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 Sh=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(Ih(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Ah(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-",Bn="-moz-",$="-webkit-",tu="comm",Ko="rule",Wo="decl",Rh="@import",ru="@keyframes",Ch="@layer",kh=Math.abs,Hn=String.fromCharCode,xh=Object.assign;function Th(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 nu(e){return e.trim()}function Oh(e,t){return(e=t.exec(e))?e[0]:e}function G(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 pr(e,t,r){return e.slice(t,r)}function Je(e){return e.length}function zo(e){return e.length}function On(e,t){return t.push(e),e}function Ph(e,t){return e.map(t).join("")}var $n=1,Lt=1,iu=0,Ce=0,de=0,Ut="";function Gn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:$n,column:Lt,length:a,return:""}}function dr(e,t){return xh(Gn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Dh(){return de}function Nh(){return de=Ce>0?pe(Ut,--Ce):0,Lt--,de===10&&(Lt=1,$n--),de}function Pe(){return de=Ce<iu?pe(Ut,Ce++):0,Lt++,de===10&&(Lt=1,$n++),de}function Ve(){return pe(Ut,Ce)}function Dn(){return Ce}function gr(e,t){return pr(Ut,e,t)}function vr(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 ou(e){return $n=Lt=1,iu=Je(Ut=e),Ce=0,[]}function au(e){return Ut="",e}function Nn(e){return nu(gr(Ce-1,No(e===91?e+2:e===40?e+1:e)))}function Lh(e){for(;(de=Ve())&&de<33;)Pe();return vr(e)>2||vr(de)>3?"":" "}function Uh(e,t){for(;--t&&Pe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return gr(e,Dn()+(t<6&&Ve()==32&&Pe()==32))}function No(e){for(;Pe();)switch(de){case e:return Ce;case 34:case 39:e!==34&&e!==39&&No(de);break;case 40:e===41&&No(e);break;case 92:Pe();break}return Ce}function Mh(e,t){for(;Pe()&&e+de!==57&&!(e+de===84&&Ve()===47););return"/*"+gr(t,Ce-1)+"*"+Hn(e===47?e:Pe())}function Bh(e){for(;!vr(Ve());)Pe();return gr(e,Ce)}function Fh(e){return au(Ln("",null,null,null,[""],e=ou(e),0,[0],e))}function Ln(e,t,r,n,i,o,a,s,l){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){Do(L+=G(Nn(x),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:L+=Nn(x);break;case 9:case 10:case 13:case 32:L+=Lh(b);break;case 92:L+=Uh(Dn()-1,7);continue;case 47:switch(Ve()){case 42:case 47:On(jh(Mh(Pe(),Dn()),t,r),l);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&&On(f>32?Pl(L+";",n,r,h-1):Pl(G(L," ","")+";",n,r,h-2),l);break;case 59:L+=";";default:if(On(S=Ol(L,t,r,d,y,i,s,N,j=[],H=[],h),o),x===123)if(y===0)Ln(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:Ln(e,S,S,n&&On(Ol(e,S,S,0,0,i,s,N,i,j=[],h),H),i,H,h,s,n?j:H);break;default:Ln(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&&Nh()==125)continue}switch(L+=Hn(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+=Nn(Pe())),p=Ve(),y=h=Je(N=L+=Bh(Dn())),x++;break;case 45:b===45&&Je(L)==2&&(A=0)}}return o}function Ol(e,t,r,n,i,o,a,s,l,d,y){for(var h=i-1,p=i===0?o:[""],f=zo(p),b=0,A=0,R=0;b<n;++b)for(var w=0,x=pr(e,h+1,h=kh(A=a[b])),N=e;w<f;++w)(N=nu(A>0?p[w]+" "+x:G(x,/&\f/g,p[w])))&&(l[R++]=N);return Gn(e,t,r,i===0?Ko:s,l,d,y)}function jh(e,t,r){return Gn(e,t,r,tu,Hn(Dh()),pr(e,2,-2),0)}function Pl(e,t,r,n){return Gn(e,t,r,Wo,pr(e,0,n),pr(e,n+1,-1),n)}function Nt(e,t){for(var r="",n=zo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Jh(e,t,r,n){switch(e.type){case Ch:if(e.children.length)break;case Rh:case Wo:return e.return=e.return||e.value;case tu:return"";case ru:return e.return=e.value+"{"+Nt(e.children,n)+"}";case Ko:e.value=e.props.join(",")}return Je(r=Nt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Vh(e){var t=zo(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 Hh(e){return function(t){t.root||(t=t.return)&&e(t)}}function $h(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Gh=function(e,t,r){for(var n=0,i=0;n=i,i=Ve(),n===38&&i===12&&(t[r]=1),!vr(i);)Pe();return gr(e,Ce)},qh=function(e,t){var r=-1,n=44;do switch(vr(n)){case 0:n===38&&Ve()===12&&(t[r]=1),e[r]+=Gh(Ce-1,t,r);break;case 2:e[r]+=Nn(n);break;case 4:if(n===44){e[++r]=Ve()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Hn(n)}while(n=Pe());return e},Kh=function(e,t){return au(qh(ou(e),t))},Dl=new WeakMap,Wh=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=Kh(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var d=0;d<a.length;d++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},zh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function su(e,t){switch(Th(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+Bn+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"+Bn+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Do(e,"stretch")?su(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-(~Do(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 Qh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Wo:e.return=su(e.value,e.length);break;case ru:return Nt([dr(e,{value:G(e.value,"@","@"+$)})],n);case Ko:if(e.length)return Ph(e.props,function(i){switch(Oh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Nt([dr(e,{props:[G(i,/:(read-\w+)/,":"+Bn+"$1")]})],n);case"::placeholder":return Nt([dr(e,{props:[G(i,/:(plac\w+)/,":"+$+"input-$1")]}),dr(e,{props:[G(i,/:(plac\w+)/,":"+Bn+"$1")]}),dr(e,{props:[G(i,/:(plac\w+)/,be+"input-$1")]})],n)}return""})}},Yh=[Qh],Xh=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||Yh,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,l=[Wh,zh];{var d,y=[Jh,Hh(function(b){d.insert(b)})],h=Vh(l.concat(n,y)),p=function(b){return Nt(Fh(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 Sh({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 Zh(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 em={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},tm=/[A-Z]|^ms/g,rm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lu=function(e){return e.charCodeAt(1)===45},Nl=function(e){return e!=null&&typeof e!="boolean"},bo=$h(function(e){return lu(e)?e:e.replace(tm,"-$&").toLowerCase()}),Ll=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(rm,function(r,n,i){return st={name:n,styles:i,next:st},n})}return em[e]!==1&&!lu(e)&&typeof t=="number"&&t!==0?t+"px":t};function Fn(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 st={name:i.name,styles:i.styles,next:st},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)st={name:a.name,styles:a.styles,next:st},a=a.next;var s=o.styles+";";return s}return nm(e,t,r)}}var l=r;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function nm(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Fn(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]+"}":Nl(s)&&(n+=bo(o)+":"+Ll(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)Nl(a[l])&&(n+=bo(o)+":"+Ll(o,a[l])+";");else{var d=Fn(e,t,a);switch(o){case"animation":case"animationName":{n+=bo(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Ul=/label:\s*([^\s;{]+)\s*(;|$)/g,st;function wo(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="";st=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Fn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Fn(r,t,e[s]),n){var l=o;i+=l[s]}Ul.lastIndex=0;for(var d="",y;(y=Ul.exec(i))!==null;)d+="-"+y[1];var h=Zh(i)+d;return{name:h,styles:i,next:st}}function uu(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var im=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},om=function(e,t,r){im(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 Ml(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Bl(e,t,r){var n=[],i=uu(e,n,r);return n.length<2?r:i+t(n)}var am=function(e){var t=Xh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=wo(s,t.registered,void 0);return om(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=wo(s,t.registered),y="animation-"+d.name;return Ml(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=wo(s,t.registered);Ml(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return Bl(t.registered,r,sm(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:uu.bind(null,t.registered),merge:Bl.bind(null,t.registered,r)}},sm=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},lm=am({key:"css"}),Mt=lm.css,Lo,Oe,Eo,Fl,jl=0,cu=[],fe=B,Jl=fe.__b,Vl=fe.__r,Hl=fe.diffed,$l=fe.__c,Gl=fe.unmount,ql=fe.__;function um(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 du(e,t){var r=um(Lo++,7);return fm(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function cm(){for(var e;e=cu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Un),e.__H.__h.forEach(Uo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Oe=null,Jl&&Jl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ql&&ql(e,t)},fe.__r=function(e){Vl&&Vl(e),Lo=0;var t=(Oe=e.__c).__H;t&&(Eo===Oe?(t.__h=[],Oe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Un),t.__h.forEach(Uo),t.__h=[],Lo=0)),Eo=Oe},fe.diffed=function(e){Hl&&Hl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cu.push(t)!==1&&Fl===fe.requestAnimationFrame||((Fl=fe.requestAnimationFrame)||dm)(cm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Eo=Oe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Un),r.__h=r.__h.filter(function(n){return!n.__||Uo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),$l&&$l(e,t)},fe.unmount=function(e){Gl&&Gl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Un(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Kl=typeof requestAnimationFrame=="function";function dm(e){var t,r=function(){clearTimeout(n),Kl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Kl&&(t=requestAnimationFrame(r))}function Un(e){var t=Oe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Oe=t}function Uo(e){var t=Oe;e.__c=e.__(),Oe=t}function fm(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var hm=Symbol.for("preact-signals");function qn(){if(lt>1)lt--;else{for(var e,t=!1;fr!==void 0;){var r=fr;for(fr=void 0,Mo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&hu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Mo=0,lt--,t)throw e}}function Re(e){if(lt>0)return e();lt++;try{return e()}finally{qn()}}var Y=void 0,fr=void 0,lt=0,Mo=0,jn=0;function fu(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=hm;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 br(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=fu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Mo>100)throw new Error("Cycle detected");this.v=e,this.i++,jn++,lt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{qn()}}}});function X(e){return new ve(e)}function hu(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 mu(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 pu(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 Bt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=jn-1,this.f=4}(Bt.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&&!hu(this))return this.f&=-2,!0;var e=Y;try{mu(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,pu(this),this.f&=-2,!0};Bt.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)};Bt.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)}};Bt.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(Bt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=fu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function hr(e){return new Bt(e)}function vu(e){var t=e.u;if(e.u=void 0,typeof t=="function"){lt++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Qo(e),n}finally{Y=r,qn()}}}function Qo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,vu(e)}function mm(e){if(Y!==this)throw new Error("Out-of-order effect");pu(this),Y=e,this.f&=-2,8&this.f&&Qo(this),qn()}function yr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}yr.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()}};yr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,vu(this),mu(this),lt++;var e=Y;return Y=this,mm.bind(this,e)};yr.prototype.N=function(){2&this.f||(this.f|=2,this.o=fr,fr=this)};yr.prototype.d=function(){this.f|=8,1&this.f||Qo(this)};function br(e){var t=new yr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var _u,Ao,gu=[];br(function(){_u=this.N})();function Ft(e,t){B[e]=t.bind(null,B[e]||function(){})}function Jn(e){Ao&&Ao(),Ao=e&&e.S()}function yu(e){var t=this,r=e.data,n=bu(r);n.value=r;var i=du(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=hr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=hr(function(){return!Array.isArray(d.value)&&!oo(d.value)}),h=br(function(){if(this.N=wu,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}yu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:yu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Ft("__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)});Ft("__r",function(e,t){Jn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return br(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Jn(r),e(t)});Ft("__e",function(e,t,r,n){Jn(),e(t,r,n)});Ft("diffed",function(e,t){Jn();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 l in n){var d=o[l],y=n[l];d===void 0?(d=pm(r,l,y,i),o[l]=d):d.o(y,i)}}}e(t)});function pm(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:br(function(){this.N=wu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Ft("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)});Ft("__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 bu(e){return du(function(){return X(e)},[])}var vm=function(e){queueMicrotask(function(){queueMicrotask(e)})};function _m(){Re(function(){for(var e;e=gu.shift();)_u.call(e)})}function wu(){gu.push(this)===1&&(B.requestAnimationFrame||vm)(_m)}var we=Mt`
|
|
4
4
|
inset: 0;
|
|
5
5
|
clear: none;
|
|
6
6
|
float: none;
|
|
@@ -18,8 +18,8 @@ or `);this.errors.push(o)}return n}},Zr=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 gm(e,t){let r=mo(e);ho(()=>{r.current=e},[e]),sr(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var ym=0;function le(e,t,r,n,i,o){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var d={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ym,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return B.vnode&&B.vnode(d),d}var bm=Mt`
|
|
22
|
+
${we}
|
|
23
23
|
position: fixed;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
@@ -32,7 +32,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
32
32
|
height: 100vh;
|
|
33
33
|
|
|
34
34
|
.card-wrapper {
|
|
35
|
-
${
|
|
35
|
+
${we}
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
@@ -46,7 +46,7 @@ or `);this.errors.push(o)}return n}},Zr=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
|
+
${we}
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
width: 100%;
|
|
@@ -55,7 +55,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
.title {
|
|
58
|
-
${
|
|
58
|
+
${we}
|
|
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}},Zr=class extends ce{constructor(...t){super
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.content {
|
|
66
|
-
${
|
|
66
|
+
${we}
|
|
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}},Zr=class extends ce{constructor(...t){super
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.footer {
|
|
74
|
-
${
|
|
74
|
+
${we}
|
|
75
75
|
display: flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 40px;
|
|
79
79
|
button {
|
|
80
|
-
${
|
|
80
|
+
${we}
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
height: 100%;
|
|
@@ -93,8 +93,8 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,et=X(null),
|
|
97
|
-
${
|
|
96
|
+
`,et=X(null),Bo=X(""),Fo=X(""),Mn=X(!1),wm=()=>{var e;(e=et.value)==null||e.call(et,!1)},Em=()=>{var e;(e=et.value)==null||e.call(et,!0)},Am=e=>P(void 0,null,function*(){let{title:t,content:r}=e;return et.value&&(et.value(!1),Re(()=>{et.value=null,Mn.value=!1})),Re(()=>{Bo.value=t||"",Fo.value=r||"",Mn.value=!0}),new Promise(n=>{et.value=i=>{Re(()=>{et.value=null,Mn.value=!1,Bo.value="",Fo.value=""}),n(i)}})}),Im=()=>Mn.value?le("div",{className:bm,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:Bo.value}),le("div",{className:"content",children:Fo.value})]}),le("div",{className:"footer",children:[le("button",{onClick:wm,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:Em,className:"confirm-btm",children:"Confirm"})]})]})}):null,Sm=Mt`
|
|
97
|
+
${we}
|
|
98
98
|
position: relative;
|
|
99
99
|
display: flex;
|
|
100
100
|
align-items: center;
|
|
@@ -112,7 +112,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
button {
|
|
115
|
-
${
|
|
115
|
+
${we}
|
|
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}},Zr=class extends ce{constructor(...t){super
|
|
|
126
126
|
cursor: not-allowed;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`,
|
|
130
|
-
${
|
|
129
|
+
`,Rm=()=>{let e=X(!1),t=X(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Re(()=>{t.value=Date.now(),e.value=!1})}}},Cm=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=bu(t);gm(()=>{s.value>0?s.value-=1:Re(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let l=hr(()=>{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=hr(()=>{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}),y=hr(()=>r==="interstitial"?!1:!l.value&&!d.value),h=()=>P(void 0,null,function*(){if(a.value=!0,!(yield Am({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Re(()=>{a.value=!0,s.value=0,o.value=null})}),p=()=>{n("viewed"),Re(()=>{a.value=!0,s.value=0,o.value=null})};return le("div",{className:Sm,children:[s.value>0&&r!=="interstitial"&&le("div",{className:"timer",children:[s.value,"s"]}),le("button",{onClick:l.value?h:d.value?p:void 0,disabled:y.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"})})})]})},km=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(!1),a=X(15),s=X(""),l=X("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:l}},xm=Mt`
|
|
130
|
+
${we}
|
|
131
131
|
position: fixed;
|
|
132
132
|
z-index: 2147483647;
|
|
133
133
|
background: white;
|
|
@@ -137,7 +137,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
|
|
139
139
|
iframe {
|
|
140
|
-
${
|
|
140
|
+
${we}
|
|
141
141
|
flex: 1;
|
|
142
142
|
position: relative;
|
|
143
143
|
display: block;
|
|
@@ -145,8 +145,8 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
149
|
-
${
|
|
148
|
+
`,Tm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:l,src:d,mode:y}=t,h=lr(()=>Rm(),[]),[p,f]=Cn(!1),b=R=>{var w,x,N,j;s.value=!1,R==="dismiss"?(w=n.value)==null||w.call(n):R==="viewed"&&((x=i.value)==null||x.call(i)),(N=r.value)==null||N.call(r),(j=o.value)==null||j.call(o),f(!1)},A=po(()=>{var R;p||(f(!0),(R=a.value)==null||R.call(a))},[p]);return sr(()=>{p&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[p,y.value]),s.value?le("div",{className:xm,children:[le(Cm,{mode:y.value,onClose:b,countdown:l.value,state:h}),s.value&&le("iframe",{src:d.value,onLoad:A,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(Im,{})]}):null};function Xe(e,t,r){return(t=Om(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Om(e){var t=Pm(e,"string");return typeof t=="symbol"?t:t+""}function Pm(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){Xe(this,"name","OKSPIN"),Xe(this,"initialized",!1),Xe(this,"initCompleter",null),Xe(this,"context",void 0),Xe(this,"initParams",void 0),Xe(this,"adsOverlay",null),Xe(this,"adsIsShowing",!1),Xe(this,"lastUnDisplayedAdBreak",null),Xe(this,"state",km()),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"),go(le(Tm,{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,l,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}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"})};Re(()=>{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&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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)},A=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,p)};Re(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=f,this.state.adViewed.value=b,this.state.adBreakDone.value=A});let R=()=>{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,Re(()=>{var x;this.state.countdown.value=(x=r.params.countdown)!=null?x:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,R);break}}})}},Dt={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Dt[e.data.type]&&Dt[e.data.type].forEach(t=>{t(e.data.data)})});var Ot=(e,t)=>{sr(()=>(Dt[e]||(Dt[e]=new Set),Dt[e].add(t),()=>{Dt[e].delete(t)}),[e,t])},Dm=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(),a=X(),s=X(!1),l=X("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:l}},Nm=Mt`
|
|
149
|
+
${we}
|
|
150
150
|
position: fixed;
|
|
151
151
|
z-index: 2147483647;
|
|
152
152
|
background: white;
|
|
@@ -156,7 +156,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
156
156
|
flex-direction: column;
|
|
157
157
|
|
|
158
158
|
iframe {
|
|
159
|
-
${
|
|
159
|
+
${we}
|
|
160
160
|
flex: 1;
|
|
161
161
|
position: relative;
|
|
162
162
|
display: block;
|
|
@@ -164,8 +164,8 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
164
164
|
width: 100%;
|
|
165
165
|
height: 100%;
|
|
166
166
|
}
|
|
167
|
-
`,Dm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:l,src:d}=t,[y,h]=Sn(!1),p=b=>{var A,R,w,T;h(!1),l.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),(T=o.value)==null||T.call(o)},f=()=>{var b;(b=a.value)==null||b.call(a)};return Tt("appsrockets_ad_dismissed",()=>p("dismiss")),Tt("appsrockets_ad_rewarded",()=>p("viewed")),Tt("appsrockets_ad_completed",()=>p("viewed")),Tt("appsrockets_ad_skipped",()=>p("viewed")),Tt("appsrockets_ad_clicked",b=>{var A;return(A=s.value)==null?void 0:A.call(s,b)}),Tt("appsrockets_ad_loaded",()=>h(!0)),l.value?le("div",{className:Pm,style:{display:y?"flex":"none"},children:l.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 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=Lm(e,"string");return typeof t=="symbol"?t:t+""}function Lm(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 Fo=class{constructor(t,r){Ze(this,"name","APPSROCKETS"),Ze(this,"initialized",!1),Ze(this,"initCompleter",null),Ze(this,"context",void 0),Ze(this,"adsOverlay",null),Ze(this,"adsIsShowing",!1),Ze(this,"lastUnDisplayedAdBreak",null),Ze(this,"state",Om()),Ze(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"),vo(le(Dm,{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,l,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"})};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&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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"};Ce(()=>{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 T=()=>{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,(y=t.beforeReward)==null||y.call(t,T);break}}}},bu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function be(e,t,r){return(t=Um(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Um(e){var t=Mm(e,"string");return typeof t=="symbol"?t:t+""}function Mm(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,n){be(this,"adUnit",void 0),be(this,"project",void 0),be(this,"keyValue",void 0),be(this,"adsContext",null),be(this,"rewardedSlot",null),be(this,"rewardedPayload",null),be(this,"readyEvent",null),be(this,"withCommand",function(){googletag.cmd.push(...arguments)}),be(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))}),be(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}),be(this,"reinit",i=>{this.destroy(i),this.init()}),be(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),be(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)})}}),be(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),be(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),be(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,l,d;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.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,bu(),this.withCommand(()=>{this.init()})}};function Re(e,t,r){return(t=Bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bm(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 Jo=class{constructor(t,r,n){var i=this;Re(this,"adUnit",void 0),Re(this,"project",void 0),Re(this,"keyValue",void 0),Re(this,"adsContext",null),Re(this,"gamingInterstitialSlot",null),Re(this,"readyEvent",null),Re(this,"isRetrying",!1),Re(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Re(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))}),Re(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)}),Re(this,"reinit",function(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(o,a),i.init()}),Re(this,"handleSlotReady",o=>{this.gamingInterstitialSlot===o.slot&&(this.readyEvent=o)}),Re(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")}))}),Re(this,"requestAds",o=>{this.withCommand(()=>{var a,s,l;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()):((l=(s=this.adsContext).onEnd)==null||l.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)))})}),bu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function vt(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=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){vt(this,"name","GOOGLE_GPT"),vt(this,"context",void 0),vt(this,"contextInfo",void 0),vt(this,"initParams",void 0),vt(this,"rewardAdManager",void 0),vt(this,"interstitialManager",void 0),vt(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 jo(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new Jo(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 Eo(e,t,r){return(t=Vm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vm(e){var t=Hm(e,"string");return typeof t=="symbol"?t:t+""}function Hm(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){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Eo(this,"context",void 0),Eo(this,"placement","GAME"),Eo(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:Yl.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:Ql.WebSDK};return rh(i)}};function Ie(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=Gm(e,"string");return typeof t=="symbol"?t:t+""}function Gm(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 jn=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 Ho(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}}},$o=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:l,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:l}: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 jn(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=qm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qm(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 pr=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 To(this.context),this.adsActionDetection=new ko(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new $o(t),this.requestContext=new jn(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 Vo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new xo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new Bo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Fo(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,l,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),T=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 F,V,S,L;(F=t.beforeAd)==null||F.call(t),(V=t.adViewed)==null||V.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:{(l=t.beforeAd)==null||l.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(!T||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 F=T.sort((O,M)=>O.seq-M.seq);if(F.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 V=!0,S=null,L=new Co(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;F.length>0;){let O=F.shift(),M=this.providers[O.provider];if(M){let[W,z]=yield L.callAdBreakAndContinue(M,t,O,ee=>{var he;this.adsIsShowing=ee,(he=this.context.eventEmitter)==null||he.emit("isAdShowing",ee)});V=W,S=z}else V=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!V)break}V&&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 Ty=Nt`
|
|
168
|
-
${
|
|
167
|
+
`,Lm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:l,src:d}=t,[y,h]=Cn(!1),p=b=>{var A,R,w,x;h(!1),l.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 Ot("appsrockets_ad_dismissed",()=>p("dismiss")),Ot("appsrockets_ad_rewarded",()=>p("viewed")),Ot("appsrockets_ad_completed",()=>p("viewed")),Ot("appsrockets_ad_skipped",()=>p("viewed")),Ot("appsrockets_ad_clicked",b=>{var A;return(A=s.value)==null?void 0:A.call(s,b)}),Ot("appsrockets_ad_loaded",()=>h(!0)),l.value?le("div",{className:Nm,style:{display:y?"flex":"none"},children:l.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 Ze(e,t,r){return(t=Um(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Um(e){var t=Mm(e,"string");return typeof t=="symbol"?t:t+""}function Mm(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","APPSROCKETS"),Ze(this,"initialized",!1),Ze(this,"initCompleter",null),Ze(this,"context",void 0),Ze(this,"adsOverlay",null),Ze(this,"adsIsShowing",!1),Ze(this,"lastUnDisplayedAdBreak",null),Ze(this,"state",Dm()),Ze(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"),go(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){var n,i,o,a,s,l,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&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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}}}},Eu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function ye(e,t,r){return(t=Bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bm(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 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,l,d;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.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,Eu(),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=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){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,l;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()):((l=(s=this.adsContext).onEnd)==null||l.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)))})}),Eu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function _t(e,t,r){return(t=Vm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vm(e){var t=Hm(e,"string");return typeof t=="symbol"?t:t+""}function Hm(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){_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 Ho(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 Io(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=Gm(e,"string");return typeof t=="symbol"?t:t+""}function Gm(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){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Io(this,"context",void 0),Io(this,"placement","GAME"),Io(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:Zl.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:Yl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Xl.WebSDK};return ih(i)}};function Ae(e,t,r){return(t=qm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qm(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 Vn=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 Go(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}}},qo=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:l,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:l}: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 Vn(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=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=zm(e,"string");return typeof t=="symbol"?t:t+""}function zm(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 _r=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 Oo(this.context),this.adsActionDetection=new To(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new qo(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 $o(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new Po(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 Jo(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,l,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:{(l=t.beforeAd)==null||l.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((O,M)=>O.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 xo(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;j.length>0;){let O=j.shift(),M=this.providers[O.provider];if(M){let[K,W]=yield L.callAdBreakAndContinue(M,t,O,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 Py=Mt`
|
|
168
|
+
${we}
|
|
169
169
|
position: fixed;
|
|
170
170
|
left: 0;
|
|
171
171
|
top: 0;
|
|
@@ -180,7 +180,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.ads-wrapper {
|
|
183
|
-
${
|
|
183
|
+
${we}
|
|
184
184
|
position: relative;
|
|
185
185
|
width: 100%;
|
|
186
186
|
height: 100%;
|
|
@@ -203,7 +203,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
.retry-button {
|
|
206
|
-
${
|
|
206
|
+
${we}
|
|
207
207
|
position: absolute;
|
|
208
208
|
width: 100%;
|
|
209
209
|
height: 100%;
|
|
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},Zr=class extends ce{constructor(...t){super
|
|
|
213
213
|
cursor: pointer;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
`;me();var db=li(Eu());var yr=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 br=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,l,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:(l=f.breakType)!=null?l:"",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=$($({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 wr=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,l,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:(l=i==null?void 0:i.args)!=null&&l.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 _t=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 ze.getRewardsTypes(this.httpClient);yield ze.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 Er=class e extends _t{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}}Sa(e.prototype,this,"adBreak").call(this,t)})}};var Qo=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new yr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=br.getInstance();break}case"gamedistribution":{this.cacheHandler=wr.getInstance();break}case"funmax":{let r=new pr(this.context);this.cacheHandler=new Er(r,Ar);break}default:{let r=new pr(this.context);this.cacheHandler=new _t(r,Ar);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Gn=ge(),Au=new je,Ar=Be.create(),Wm={httpClient:Ar,checkNetwork:()=>Be.getNetworkStatus(),track:Le,eventEmitter:Au,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,l;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:Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=D.joliSource)!=null?l:""}}},Iu=e=>{mt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},zm=new Qo(Wm),Ir=zm.getAdsHandler(D.sdkEnvironment);ze.registerRewardHandler("ADS",xs(Ir.getAdsInstance()));ze.registerRewardHandler("JOLI_COIN",Ps(Ar,{onUnlockSuccess:Iu.bind(void 0)}));ze.registerRewardHandler("JOLI_COIN_ONLY",Ds(Ar,{onUnlockSuccess:Iu.bind(void 0)}));Au.on("isAdShowing",e=>{mt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Gn.registerCommand("AdsSDK.init",e=>{Ir.init(e)});Gn.registerCommand("AdsSDK.adConfig",e=>{Ir.adConfig(e)});Gn.registerCommand("AdsSDK.adBreak",e=>{Ir.adBreak(e)});Gn.registerCommand("AdsSDK.adUnit",e=>{Ir.adUnit(e)});H();nt();var Su=ge();Su.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Le("loadFinished",{duration:e})});Su.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});H();nt();var Ou=-1,Kn=function(e){addEventListener("pageshow",function(t){t.persisted&&(Ou=t.timeStamp,e(t))},!0)},Xo=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Wn=function(){var e=Xo();return e&&e.activationStart||0},Bt=function(e,t){var r=Xo(),n="navigate";return Ou>=0?n="back-forward-cache":r&&(document.prerendering||Wn()>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}},Pu=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){}},Ft=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,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Du=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Nu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Lu=function(e){var t=!1;return function(){t||(e(),t=!0)}},Mt=-1,Ru=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},qn=function(e){document.visibilityState==="hidden"&&Mt>-1&&(Mt=e.type==="visibilitychange"?e.timeStamp:0,Qm())},Cu=function(){addEventListener("visibilitychange",qn,!0),addEventListener("prerenderingchange",qn,!0)},Qm=function(){removeEventListener("visibilitychange",qn,!0),removeEventListener("prerenderingchange",qn,!0)},Uu=function(){return Mt<0&&(Mt=Ru(),Cu(),Kn(function(){setTimeout(function(){Mt=Ru(),Cu()},0)})),{get firstHiddenTime(){return Mt}}},Zo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},ku=[1800,3e3],Mu=function(e,t){t=t||{},Zo(function(){var r,n=Uu(),i=Bt("FCP"),o=Pu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Wn(),0),i.entries.push(s),r(!0)))})});o&&(r=Ft(e,i,ku,t.reportAllChanges),Kn(function(a){i=Bt("FCP"),r=Ft(e,i,ku,t.reportAllChanges),Du(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Ym=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Lu(e),document.visibilityState==="hidden"?e():(r=t(e),Nu(e)),r};var Tu=[2500,4e3],Yo={},Bu=function(e,t){t=t||{},Zo(function(){var r,n=Uu(),i=Bt("LCP"),o=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Wn(),0),i.entries=[d],r())})},a=Pu("largest-contentful-paint",o);if(a){r=Ft(e,i,Tu,t.reportAllChanges);var s=Lu(function(){Yo[i.id]||(o(a.takeRecords()),a.disconnect(),Yo[i.id]=!0,r(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return Ym(s)},{once:!0,capture:!0})}),Nu(s),Kn(function(l){i=Bt("LCP"),r=Ft(e,i,Tu,t.reportAllChanges),Du(function(){i.value=performance.now()-l.timeStamp,Yo[i.id]=!0,r(!0)})})}})},xu=[800,1800],Xm=function e(t){document.prerendering?Zo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Fu=function(e,t){t=t||{};var r=Bt("TTFB"),n=Ft(e,r,xu,t.reportAllChanges);Xm(function(){var i=Xo();i&&(r.value=Math.max(i.responseStart-Wn(),0),r.entries=[i],n(!0),Kn(function(){r=Bt("TTFB",0),(n=Ft(e,r,xu,t.reportAllChanges))(!0)}))})};me();wt();Ge();function Zm(){Mu(e=>{Le("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Bu(e=>{Le("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Fu(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function ep(){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 Te(new Or(t)),!1}})}function tp(){Wt.on("onDocumentReady",e=>P(this,null,function*(){let t=yield ep();D.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),Wt.emit("LifecycleEvent.onReady",$({},D.hostUserInfo?D.hostUserInfo:{isLogin:!1})),D.mpType==="game"&&ft.start(Date.now()-e)}))}function ju(){tp(),Zm()}ju();
|
|
216
|
+
`;me();var mb=ci(Iu());var wr=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 Er=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,l,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:(l=f.breakType)!=null?l:"",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 Ar=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,l,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:(l=i==null?void 0:i.args)!=null&&l.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 ze.getRewardsTypes(this.httpClient);yield ze.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 Ir=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}}Ca(e.prototype,this,"adBreak").call(this,t)})}};var Xo=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new wr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Er.getInstance();break}case"gamedistribution":{this.cacheHandler=Ar.getInstance();break}case"funmax":{let r=new _r(this.context);this.cacheHandler=new Ir(r,Sr);break}default:{let r=new _r(this.context);this.cacheHandler=new gt(r,Sr);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Kn=_e(),Su=new je,Sr=Be.create(),Qm={httpClient:Sr,checkNetwork:()=>Be.getNetworkStatus(),track:Le,eventEmitter:Su,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,l;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:(l=D.joliSource)!=null?l:""}}},Ru=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},Ym=new Xo(Qm),Rr=Ym.getAdsHandler(D.sdkEnvironment);ze.registerRewardHandler("ADS",Ps(Rr.getAdsInstance()));ze.registerRewardHandler("JOLI_COIN",Ns(Sr,{onUnlockSuccess:Ru.bind(void 0)}));ze.registerRewardHandler("JOLI_COIN_ONLY",Ls(Sr,{onUnlockSuccess:Ru.bind(void 0)}));Su.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Kn.registerCommand("AdsSDK.init",e=>{Rr.init(e)});Kn.registerCommand("AdsSDK.adConfig",e=>{Rr.adConfig(e)});Kn.registerCommand("AdsSDK.adBreak",e=>{Rr.adBreak(e)});Kn.registerCommand("AdsSDK.adUnit",e=>{Rr.adUnit(e)});V();nt();var Cu=_e();Cu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Le("loadFinished",{duration:e})});Cu.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});V();nt();var Du=-1,zn=function(e){addEventListener("pageshow",function(t){t.persisted&&(Du=t.timeStamp,e(t))},!0)},ea=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Qn=function(){var e=ea();return e&&e.activationStart||0},Jt=function(e,t){var r=ea(),n="navigate";return Du>=0?n="back-forward-cache":r&&(document.prerendering||Qn()>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}},Nu=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){}},Vt=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,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Lu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Uu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Mu=function(e){var t=!1;return function(){t||(e(),t=!0)}},jt=-1,ku=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Wn=function(e){document.visibilityState==="hidden"&&jt>-1&&(jt=e.type==="visibilitychange"?e.timeStamp:0,Xm())},xu=function(){addEventListener("visibilitychange",Wn,!0),addEventListener("prerenderingchange",Wn,!0)},Xm=function(){removeEventListener("visibilitychange",Wn,!0),removeEventListener("prerenderingchange",Wn,!0)},Bu=function(){return jt<0&&(jt=ku(),xu(),zn(function(){setTimeout(function(){jt=ku(),xu()},0)})),{get firstHiddenTime(){return jt}}},ta=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Tu=[1800,3e3],Fu=function(e,t){t=t||{},ta(function(){var r,n=Bu(),i=Jt("FCP"),o=Nu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Qn(),0),i.entries.push(s),r(!0)))})});o&&(r=Vt(e,i,Tu,t.reportAllChanges),zn(function(a){i=Jt("FCP"),r=Vt(e,i,Tu,t.reportAllChanges),Lu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Zm=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Mu(e),document.visibilityState==="hidden"?e():(r=t(e),Uu(e)),r};var Ou=[2500,4e3],Zo={},ju=function(e,t){t=t||{},ta(function(){var r,n=Bu(),i=Jt("LCP"),o=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Qn(),0),i.entries=[d],r())})},a=Nu("largest-contentful-paint",o);if(a){r=Vt(e,i,Ou,t.reportAllChanges);var s=Mu(function(){Zo[i.id]||(o(a.takeRecords()),a.disconnect(),Zo[i.id]=!0,r(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return Zm(s)},{once:!0,capture:!0})}),Uu(s),zn(function(l){i=Jt("LCP"),r=Vt(e,i,Ou,t.reportAllChanges),Lu(function(){i.value=performance.now()-l.timeStamp,Zo[i.id]=!0,r(!0)})})}})},Pu=[800,1800],ep=function e(t){document.prerendering?ta(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=Jt("TTFB"),n=Vt(e,r,Pu,t.reportAllChanges);ep(function(){var i=ea();i&&(r.value=Math.max(i.responseStart-Qn(),0),r.entries=[i],n(!0),zn(function(){r=Jt("TTFB",0),(n=Vt(e,r,Pu,t.reportAllChanges))(!0)}))})};me();At();Ge();function tp(){Fu(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})}),Ju(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function rp(){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 Dr(t)),!1}})}function np(){dt.on("onDocumentReady",e=>P(this,null,function*(){let t=yield rp();D.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),dt.emit("LifecycleEvent.onReady",Q({},D.hostUserInfo?D.hostUserInfo:{isLogin:!1})),D.mpType==="game"&&ht.start(Date.now()-e)}))}function Vu(){np(),tp()}Vu();
|
|
217
217
|
/*! Bundled license information:
|
|
218
218
|
|
|
219
219
|
localforage/dist/localforage.js:
|