@jolibox/implement 1.1.13-beta.3 → 1.1.13-beta.4
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 +5 -5
- package/dist/common/ads/anti-cheating.d.ts +5 -0
- package/dist/index.js +3 -3
- package/dist/index.native.js +5 -5
- package/implement.build.log +2 -2
- package/package.json +4 -4
- package/src/common/ads/anti-cheating.test.ts +4 -2
- package/src/common/ads/anti-cheating.ts +10 -4
- package/src/h5/http/utils/__tests__/xua.test.ts +1 -1
- package/src/native/api/ads.ts +1 -1
package/dist/index.native.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ts=Object.create;var Ye=Object.defineProperty,rs=Object.defineProperties,ns=Object.getOwnPropertyDescriptor,os=Object.getOwnPropertyDescriptors,is=Object.getOwnPropertyNames,Qe=Object.getOwnPropertySymbols,ss=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var un=(e,t,r)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))zt.call(t,r)&&un(e,r,t[r]);if(Qe)for(var r of Qe(t))dn.call(t,r)&&un(e,r,t[r]);return e},N=(e,t)=>rs(e,os(t));var Z=(e,t)=>{var r={};for(var n in e)zt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qe)for(var n of Qe(e))t.indexOf(n)<0&&dn.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var pn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},as=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of is(t))!zt.call(e,o)&&o!==r&&Ye(e,o,{get:()=>t[o],enumerable:!(n=ns(t,o))||n.enumerable});return e};var fn=(e,t,r)=>(r=e!=null?ts(ss(e)):{},as(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e));var E=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});function ms(e){return!!(e!=null&&e.__nativeBuffers__)}function rr(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!ms(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let o;n.value?o=n.value:n.base64&&(o=fs(n.base64)),typeof o!="undefined"&&o instanceof ArrayBuffer&&(e[n.key]=o)}}return e}function _s(e={},t=!1){let r=e,n=[];for(let[o,i]of Object.entries(r))if(i!==void 0&&i instanceof ArrayBuffer&&i.byteLength!==void 0){let s=t?{value:i,key:o}:{base64:hs(i),key:o};n.push(s),delete r[o]}return n.length>0&&(r.__nativeBuffers__=n),r}function ks(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function In(e){return typeof e=="string"}function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ts(e){return typeof e=="undefined"}function Is(e){return Ts(e)||e===null}function xn(e){return typeof e=="function"}function xs(e){return Oe(e)&&xn(e.then)}function Rn(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function Ne(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function $s(e){return new Promise(t=>An(e)(t))}function An(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Hs(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Ue(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function Vs(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Js(e[n],t[n])}function Js(e,t){if(In(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(xn(t)){try{if(e instanceof t)return}catch(r){}if(!Is(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 yn(e,t){return`[${e}]:${t}`}function Qs(e,t){bn||(Xt=new Ze({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(o){e.invoke("track",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),Zt=new Ze({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(o){e.invoke("track",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),er=new Ze({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(o){e.invoke("track",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),t("onJoliboxEnterBackground",()=>{Xt.flush(),Zt.flush(),er.flush()}),bn=!0);function r(o){var i,s;let{method:a,args:l,startTime:c,isForeground:d,errMsg:u=`${a}:fail no errMsg`,errNo:p=0,__timing:m={receiveJSInvoke:0,invokeCallback:0}}=o,{receiveJSInvoke:g,invokeCallback:b}=m,h=(s=(i=u.match(/\S:(\S+)\s?/))==null?void 0:i[1])!=null?s:"fail";Xt.report({status:h,method:n(a,l),errNo:`${p}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&g&&b&&(Zt.report({status:h,method:a,isForeground:d,duration:Number((g-c).toFixed(3))}),er.report({status:h,method:a,isForeground:d,duration:Number((Date.now()-b).toFixed(3))}))}function n(o,i){return(o==="callHostMethod"||o==="callHostMethodSync")&&i!=null&&i.method?`${o}-${i.method}`:o}return r}function Xs(e,t){let r=0,n=!0,o=new Map,i=Qs(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,tr.forEach(l=>lr(this,[l],function*({method:c,args:d,resolve:u}){let p=yield a(c,d);u(p)})),tr.length=0});let s=(l,c)=>{let d=o.get(Number(l));if(!d)return;let u=rr(c);d(u),o.delete(Number(l))},a=(l,c)=>{var d,u;let p=Date.now(),m=`${n}`;r+=1;let g=new Ss;if(o.set(r,g.resolve),!n&&qs.includes(l))return new Promise(R=>{tr.push({method:l,args:c,resolve:R})});let b=ds(me({},{method:l,startTime:p,args:c,isForeground:m}),{invokeType:"js-bridge"}),h=!Ys&&Gs.includes(l),_=_s(c,h),v=h?_:JSON.stringify(_),S;if(l.endsWith("Sync")||Ws.includes(l)?S=(d=e.call)==null?void 0:d.call(e,l,_,r):typeof v=="string"?S=e.invoke(l,v,r):S=(u=e.call)==null?void 0:u.call(e,l,v,r),S){try{typeof S=="string"&&(S=JSON.parse(S)),S=rr(S)}catch(R){ur.error(R)}return o.delete(r),S.errorCode&&(S.errorCode=yn(l,S.errorCode)),i(me(me({},b),S)),S}return l.endsWith("Sync")&&o.delete(r),g.promise.then(R=>(R.errorCode&&(R.errorCode=yn(l,R.errorCode)),i(me(me({},b),R)),R))};return{invokeNative:a,applyNative:(l,c)=>{let d=a(l,c);return xs(d)?d.then(u=>wn(l,u)):wn(l,d)},invokeHandler:s}}function wn(e,t){if(!Oe(t)){ur.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:o,errorType:i,errorCode:s}=r,a=ps(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new Ps(n,o,i,s);return a}function Zs(e){let t=new ir,r=new ir,n=new Ze({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(o){e.invoke("track",JSON.stringify({event:"reportMetrics",data:o}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),{onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(o,i,s){let a=rr(i),l;if(a.__extra){l=a.params;let{type:c,startTime:d}=a.__extra;n.report({type:c,event:o,duration:Date.now()-d})}else l=a;if(o===Cn){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(De.length),u,s)}catch(p){}});return}if(o.startsWith(De)){r.emit(o.slice(De.length),l,s);return}t.emit(o,l,s)}}}function ea(e){let t=new Map,r;return(n,o,i,s)=>{if(s){let l=i?[i]:"*";e.publish(`${De}${n}`,o,l);return}r||(r=Promise.resolve().then(()=>{t.forEach((l,c)=>{try{let d=c?[c]:"*";e.publish(Cn,l,d)}catch(d){}}),r=void 0,t.clear()}));let a=t.get(i);a||(a=[],t.set(i,a)),a.push([`${De}${n}`,o])}}function ta(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:o,unsubscribe:i}=Zs(e),{invokeNative:s,invokeHandler:a,applyNative:l}=Xs(e,r),c=ea(e);return{invokeHandler:a,subscribeHandler:t,applyNative:l,invokeNative:s,onNative:r,offNative:n,publish:c,subscribe:o,unsubscribe:i}}function Pn(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var ls,cs,us,et,kn,Sn,hn,me,ds,ps,lr,fs,hs,cr,gs,_n,vs,ys,gn,bs,ws,Tn,Es,Ss,Rs,As,tt,Cs,Ps,Ns,Qt,ur,Os,Ds,Us,Ls,Fs,Dc,nr,U,js,Ms,Xe,Ue,ir,sr,Bs,Yt,Ks,Uc,ar,vn,Lc,De,Gs,qs,Ws,Cn,zs,Ze,bn,Xt,Zt,er,tr,Ys,dr,le,Nn,On,ra,Dn,En,Q,O,re,Fc,na,Un,jc,Mc,G=k(()=>{"use strict";ls=Object.defineProperty,cs=Object.defineProperties,us=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,kn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,hn=(e,t,r)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,me=(e,t)=>{for(var r in t||(t={}))kn.call(t,r)&&hn(e,r,t[r]);if(et)for(var r of et(t))Sn.call(t,r)&&hn(e,r,t[r]);return e},ds=(e,t)=>cs(e,us(t)),ps=(e,t)=>{var r={};for(var n in e)kn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&et)for(var n of et(e))t.indexOf(n)<0&&Sn.call(e,n)&&(r[n]=e[n]);return r},lr=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});fs=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer};hs=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let o=0;o<n;o++)t+=String.fromCharCode(r[o]);return btoa(t)};cr=Object.defineProperty,gs=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertySymbols,vs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,gn=(e,t,r)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t)=>{for(var r in t||(t={}))vs.call(t,r)&&gn(e,r,t[r]);if(_n)for(var r of _n(t))ys.call(t,r)&&gn(e,r,t[r]);return e},ws=(e,t)=>{for(var r in t)cr(e,r,{get:t[r],enumerable:!0})},Tn=(e,t,r,n)=>{for(var o=n>1?void 0:n?gs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cr(t,r,o),o},Es=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((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 o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,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}Ss=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};Rs=(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))(Rs||{}),As=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}},tt=class extends As{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Cs=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},Ps=class extends tt{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},Ns=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},Qt=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};ur={log:Ne("log"),warn:Ne("warn"),info:Ne("info"),error:Ne("error"),debug:Ne("debug")};Object.assign(globalThis,{logger:ur});Os=Symbol.for("Jolibox.canIUseMap"),Ds={};globalThis[Os]=Ds;Us=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Us||{}),Ls=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ls||{}),Fs=(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))(Fs||{}),Dc={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")},nr=class or{constructor(t){this.element=t,this.next=or.Undefined,this.prev=or.Undefined}};nr.Undefined=new nr(void 0);U=nr,js=class{constructor(){this._first=U.Undefined,this._last=U.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===U.Undefined}clear(){let e=this._first;for(;e!==U.Undefined;){let t=e.next;e.prev=U.Undefined,e.next=U.Undefined,e=t}this._first=U.Undefined,this._last=U.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new U(e);if(this._first===U.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==U.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==U.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==U.Undefined&&e.next!==U.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===U.Undefined&&e.next===U.Undefined?(this._first=U.Undefined,this._last=U.Undefined):e.next===U.Undefined?(this._last=this._last.prev,this._last.next=U.Undefined):e.prev===U.Undefined&&(this._first=this._first.next,this._first.prev=U.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==U.Undefined;)yield e.element,e=e.next}},Ms=0,Xe=class{constructor(e){this.value=e,this.id=Ms++}},Ue=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 Xe&&(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,o,i,s,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Xe(t);this._listeners?this._listeners instanceof Xe?this._listeners=[this._listeners,c]:this._listeners.push(c):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=c,(s=(i=this.options)==null?void 0:i.onDidFirstListener)==null||s.call(i,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++}),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(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Xe?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},ir=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Ue,o=s=>t(...s.args);this.listerHandlerMap.set(t,o),n.event(o),this.listeners.set(e,n);let i=this.cachedEventQueue.get(e);if(i)for(;i.size>0;)n.fire(bs({event:e},i.shift()))}off(e,t){let r=this.listeners.get(e);if(r){let n=this.listerHandlerMap.get(t);r.dispose(n)}}emit(e,...t){let r=this.listeners.get(e);if(r)r.fire({event:e,args:t});else{let n=this.cachedEventQueue.get(e);n||(n=new js,this.cachedEventQueue.set(e,n)),n.push({args:t})}}},sr={};ws(sr,{None:()=>Bs,filter:()=>Hs,once:()=>An,toPromise:()=>$s});Bs=()=>{console.log("[Jolibox SDK] None Event")};Yt=Symbol.for("Jolibox.hostEmitter"),Ks=()=>{let e=new ir;return globalThis[Yt]||(globalThis[Yt]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[Yt]},Uc=Ks();ar=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ue,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 o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return Vs(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}};ar=Tn([Rn],ar);vn=class{constructor(){this._onWillExecuteCommand=new Ue,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Ue,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ar,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ks(3e4)),this._starActivation}executeCommand(e,...t){return Es(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),sr.toPromise(sr.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}}};vn=Tn([Rn],vn);Lc=Symbol.for("Jolibox.commands");De="custom_event_",Gs=[],qs=[],Ws=["env","createRequestTask","login"],Cn="__batch_event__",zs=e=>e==="pv"?e:"default",Ze=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:o,metricName:i,type:s}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=o,this.metricName=i,this.type=zs(s)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,o,i)=>{let s=n.shift();if(s){let a=i[s];r[a]||(r[a]={}),t(r[a],n,o,i)}else r[o]||(r[o]=[]),r[o].push(i[o])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,o,i,s)=>{let a=o.shift();if(!a&&Oe(s))throw new Qt(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(a){let l=[];if(Oe(s))l.push(...Object.keys(s));else if(In(s)){if(o.length>0)throw new Qt(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(s)}else throw new Qt(`expected metric value to be a string, but got a(n) ${typeof s}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=Oe(s)?s[c]:s;t(n[c],[...o],i,d)})}else n[i]?n[i]++:n[i]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},bn=!1;tr=[],Ys=!1;le={trigger(){},exit(){return Promise.resolve(!1)},onReady(e){le.trigger=e},onDoExit(e){le.exit=e}},Nn=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new Cs("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(window.webkit){let e=window.webkit.messageHandlers,t=(o="")=>{le.trigger(),e.onDocumentReady.postMessage({path:o})},r=o=>lr(void 0,null,function*(){let i=yield le.exit();e.doExit.postMessage({uuid:o,shouldInterrupt:i})});dr={onDocumentReady:t,doExit:r,invoke(o,i,s){e.invoke.postMessage({event:o,paramsString:i,callbackId:s})},publish(o,i,s){let a=Pn(i,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:o,paramsString:JSON.stringify(a),webviewIds:s}))},call(o,i,s){let a=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(i),callbackId:s}));if(a)return JSON.parse(a)}};let n={onDocumentReady:t,env:Nn,doExit:r};globalThis.joliboxJSCore=me({},n)}if(window.JoliAndroidSDKBridge){let e=window.JoliAndroidSDKBridge,t=(o="")=>{le.trigger(),e.onDocumentReady(JSON.stringify({path:o}))},r=o=>lr(void 0,null,function*(){let i=yield le.exit();e.doExit(JSON.stringify({uuid:o,shouldInterrupt:i}))});dr={onDocumentReady:t,invoke(o,i,s){e.invoke(JSON.stringify({event:o,paramsString:i,callbackId:s}))},doExit:r,publish(o,i,s){let a=Pn(i,"joliboxJSCore");e.publish({event:o,paramsString:JSON.stringify(a),webviewIds:s})},call(o,i,s){let a=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(i),callbackId:s}));if(a)return JSON.parse(a)}};let n={onDocumentReady:t,env:Nn,doExit:r};globalThis.joliboxJSCore=me({},n)}On=dr;if(!On)throw new Ns("No joliboxJScore is found, native bridge not found.");ra=me({},On),Dn=ta(ra),{invokeHandler:En}=Dn,{applyNative:Q,invokeNative:O,onNative:re,offNative:Fc,subscribeHandler:na,publish:Un,subscribe:jc,unsubscribe:Mc}=Dn;globalThis.joliboxJSBridge={callHandler:En,invokeHandler:En,subscribeHandler:na}});function ca(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function je(e){return typeof e=="string"}function ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function $n(e){return typeof e=="object"&&Array.isArray(e)}function Me(e){return e===!0||e===!1}function ua(e){return typeof e=="undefined"}function da(e){return ua(e)||e===null}function pa(e){return typeof e=="function"}function Hn(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function Kn(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(o,i){for(let s in i)if(Object.prototype.hasOwnProperty.call(i,s)){let a=o[s],l=i[s],c=r(a,l,s,o,i);c!==void 0?o[s]=c:jn(l)&&jn(a)?o[s]=n(Mn({},a),l):Array.isArray(l)&&Array.isArray(a)?o[s]=[...a,...l]:o[s]=l}return o}return n(e,t)}function jn(e){return e&&typeof e=="object"&&e.constructor===Object}function Vn(e,t){if(Array.isArray(e))return e.concat(t)}function Be(e,t,r={}){let n=null,o,i,s,{leading:a=!1,trailing:l=!0}=r,c=()=>(s=e.apply(i,o),o=void 0,i=void 0,s),d=function(...u){o=u,i=this;let p=a&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&c()},t),p)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,o=i=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function fa(e,t){return(...r)=>t(e,...r)}function it(e){return t=>fa(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(o){e(new $e(`${o}`))}})}function Le(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Ra(e){return new Promise(t=>Xn(e)(t))}function Xn(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Aa(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Fe(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function Pa(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Na(e[n],t[n])}function Na(e,t){if(je(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(pa(t)){try{if(e instanceof t)return}catch(r){}if(!da(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 j(){if(globalThis[mr])return globalThis[mr];let e=new ot,t=new gr,r={registerCommand(n,o,i){e.registerCommand({id:n,handler:o,metadata:i})},executeCommand(n,...o){return t.executeCommand(n,...o)},excuteCommandSync(n,...o){return t.executeCommandThowErr(n,...o)}};return globalThis[mr]=r,r}var vr,oa,Ln,ia,sa,Fn,Mn,aa,Bn,la,fe,ma,yr,br,Jn,Gn,$e,qn,Wn,He,wr,ne,zn,ha,Er,_a,kr,ga,va,rt,ya,ba,wa,Qn,Sr,Ea,ka,Sa,Yn,fr,L,Ta,Ia,nt,Fe,he,_r,xa,pr,Ca,ce,ot,gr,mr,P=k(()=>{"use strict";vr=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Fn=(e,t,r)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mn=(e,t)=>{for(var r in t||(t={}))ia.call(t,r)&&Fn(e,r,t[r]);if(Ln)for(var r of Ln(t))sa.call(t,r)&&Fn(e,r,t[r]);return e},aa=(e,t)=>{for(var r in t)vr(e,r,{get:t[r],enumerable:!0})},Bn=(e,t,r,n)=>{for(var o=n>1?void 0:n?oa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vr(t,r,o),o},la=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((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 o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,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}fe=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};ma=(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))(ma||{}),yr=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}},br=class extends yr{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Jn=class extends yr{constructor(){super(...arguments),this.kind="USER_ERROR"}},Gn=class extends Jn{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},$e=class extends Jn{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))}},qn=class extends br{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Wn=class extends br{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},He=class extends yr{constructor(e,t,r,n,o){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),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},wr=class extends br{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};ne={log:Le("log"),warn:Le("warn"),info:Le("info"),error:Le("error"),debug:Le("debug")};Object.assign(globalThis,{logger:ne});zn=Symbol.for("Jolibox.canIUseMap"),ha={};globalThis[zn]=ha;Er={get config(){return globalThis[zn]}},_a=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(_a||{}),kr=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(kr||{}),ga=(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))(ga||{}),va=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),rt={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")},ya=()=>rt.isiOS?"iOS":rt.isAndroid?"Android":rt.isMac?"Mac":rt.isFacebook?"Facebook":"PC",ba="device_id",wa="advertising_id",Qn=e=>(localStorage.getItem(e)||localStorage.setItem(e,va()),localStorage.getItem(e)),Sr=()=>Qn(ba),Ea=()=>Qn(wa),ka=e=>e.charAt(0).toUpperCase()+e.slice(1),Sa=()=>{var e;let t=new URLSearchParams(window.location.search);return ka((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Yn=e=>{let t="JoliboxWebSDK",r=ya(),n=navigator.language,o=Sr(),i=Ea();return`${t} (${Sa()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${o} adid/${i} version/${e||""}`},fr=class hr{constructor(t){this.element=t,this.next=hr.Undefined,this.prev=hr.Undefined}};fr.Undefined=new fr(void 0);L=fr,Ta=class{constructor(){this._first=L.Undefined,this._last=L.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===L.Undefined}clear(){let e=this._first;for(;e!==L.Undefined;){let t=e.next;e.prev=L.Undefined,e.next=L.Undefined,e=t}this._first=L.Undefined,this._last=L.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new L(e);if(this._first===L.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==L.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==L.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==L.Undefined&&e.next!==L.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===L.Undefined&&e.next===L.Undefined?(this._first=L.Undefined,this._last=L.Undefined):e.next===L.Undefined?(this._last=this._last.prev,this._last.next=L.Undefined):e.prev===L.Undefined&&(this._first=this._first.next,this._first.prev=L.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==L.Undefined;)yield e.element,e=e.next}},Ia=0,nt=class{constructor(e){this.value=e,this.id=Ia++}},Fe=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 nt&&(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,o,i,s,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new nt(t);this._listeners?this._listeners instanceof nt?this._listeners=[this._listeners,c]:this._listeners.push(c):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=c,(s=(i=this.options)==null?void 0:i.onDidFirstListener)==null||s.call(i,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++}),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(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof nt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},he=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Fe,o=s=>t(...s.args);this.listerHandlerMap.set(t,o),n.event(o),this.listeners.set(e,n);let i=this.cachedEventQueue.get(e);if(i)for(;i.size>0;)n.fire(Mn({event:e},i.shift()))}off(e,t){let r=this.listeners.get(e);if(r){let n=this.listerHandlerMap.get(t);r.dispose(n)}}emit(e,...t){let r=this.listeners.get(e);if(r)r.fire({event:e,args:t});else{let n=this.cachedEventQueue.get(e);n||(n=new Ta,this.cachedEventQueue.set(e,n)),n.push({args:t})}}},_r={};aa(_r,{None:()=>xa,filter:()=>Aa,once:()=>Xn,toPromise:()=>Ra});xa=()=>{console.log("[Jolibox SDK] None Event")};pr=Symbol.for("Jolibox.hostEmitter"),Ca=()=>{let e=new he;return globalThis[pr]||(globalThis[pr]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[pr]},ce=Ca();ot=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Fe,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 o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return Pa(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}};ot=Bn([Hn],ot);gr=class{constructor(){this._onWillExecuteCommand=new Fe,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Fe,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ot,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ca(3e4)),this._starActivation}executeCommand(e,...t){return la(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),_r.toPromise(_r.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}}};gr=Bn([Hn],gr);mr=Symbol.for("Jolibox.commands")});function K(e,t={}){Tr.emit("ERROR_REPORT",{error:e,options:t})}var Tr,be,oe=k(()=>{"use strict";P();P();Tr=new he,be=new he;K.debounce=Be(K,50,{leading:!0})});var Ir,Oa,Zn,eo,to=k(()=>{"use strict";P();oe();Ir=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(o){return{}}},Oa=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Zn=e=>{var t;try{let o=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(o!=null&&o.length){let[i,s,a]=o;return{headerJson:Ir(i),payloadJson:Ir(s),signature:Ir(a)}}else throw"joli_source is missing"}catch(r){return K(new qn(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},eo=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],o=Oa(e),i=r[2];return`${n}.${o}.${i}`}return t}});var Da,st,ro,xr=k(()=>{"use strict";P();Da="1.1.13-beta.3",st=()=>Da,ro=()=>{let e=st();return`${Yn(e)}`}});var Ua,no,Rr,oo,V,La,y,J=k(()=>{"use strict";P();to();xr();P();Ua={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Sr(),pixelRatio:window.devicePixelRatio||1,platform:"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:st()},schema:window.location.href,platform:"h5"},Rr=(no=globalThis.joliboxJSCore)==null?void 0:no.env,V=Object.assign({},(oo=Rr==null?void 0:Rr())!=null?oo:Ua),La=()=>{var p,m,g,b,h,_,v,S,R;let{payloadJson:e,headerJson:t,signature:r}=V.schema.length?Zn(V.schema):{},n=`${V.deviceInfo.did}-${new Date().getTime()}`,i=new URL(V.schema.length?V.schema:window.location.href).searchParams,s=(g=(m=(p=i.get("mpId"))!=null?p:i.get("appId"))!=null?m:i.get("gameId"))!=null?g:"",a=(_=(h=(b=V.clientSessionId)!=null?b:e==null?void 0:e.sessionId)!=null?h:i.get("sessionId"))!=null?_:n,l=!!((v=e==null?void 0:e.testAdsMode)!=null?v:i.get("testAdsMode")==="true"),c=(R=(S=e==null?void 0:e.joliboxEnv)!=null?S:i.get("joliboxEnv"))!=null?R:"production",d=c==="staging",u=t==null?void 0:t.channel;return{get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var A;return(A=i.get("joliSource"))!=null?A:null},get mpId(){var A;return(A=s!=null?s:e==null?void 0:e.id)!=null?A:""},get mpVersion(){var A;return(A=t==null?void 0:t.ver)!=null?A:st()},get mpType(){var A,C;return(C=(A=t==null?void 0:t.__mpType)!=null?A:e==null?void 0:e.__mpType)!=null?C:"game"},get platform(){var A;return(A=V.platform)!=null?A:V.deviceInfo.platform},get deviceInfo(){return V.deviceInfo},get sdkInfo(){return V.sdkInfo},get hostInfo(){return V.hostInfo},get hostUserInfo(){return V.hostUserInfo},get sessionId(){var A,C;return(C=(A=V.clientSessionId)!=null?A:a)!=null?C:n},get channel(){return u},get webviewId(){var A;return(A=V.webviewId)!=null?A:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return d?"https://stg-api.jolibox.com":"https://api.jolibox.com"},onEnvConfigChanged:A=>{Kn(V,A,Vn)},encodeJoliSourceQuery:A=>{var C,H;return t&&r?eo(w(w({},e),A),(C=i.get("joliSource"))!=null?C:""):(H=i.get("joliSource"))!=null?H:""}}},y=La()});var Ar,so,Fa,ja,io,Ma,ao=k(()=>{"use strict";P();oe();J();P();Ar=!1,so=(e,t)=>e==null?!1:t in e,Fa=e=>so(e,"kind"),ja=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},io=(e,t={},r)=>{var i,s,a;let n={user_id:(s=(i=y.hostUserInfo)==null?void 0:i.uid)!=null?s:"",device_id:(a=y.deviceInfo.did)!=null?a:"",timestamp:Date.now(),tag:ja(e.name)},o=N(w({},n),{env:t.environment,isFromUser:r});r?be.emit("GLOBAL_USER_ERROR",e,o):be.emit("GLOBAL_ERROR",e,o)},Ma=e=>so(e,"kind")&&e.kind==="USER_ERROR";Tr.on("ERROR_REPORT",({error:e,options:t})=>{if(Ar)return;Ar=!0;let r=Fa(e)&&e.raw?e.raw:e;try{let n=Ma(e);io(e,t,n)}catch(n){let o=n instanceof Error?n.message:String(n),i=new wr(`${o}, origin error: ${r.message}`);ne.error(i),io(new wr(i.message),{environment:t.environment},!1)}finally{Ar=!1}})});var _e,Cr,Ie=k(()=>{"use strict";oe();P();oe();_e=(e,t)=>{var r,n;return new He((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},Cr=e=>new Gn(e)});var lo=k(()=>{"use strict";ao();Ie();P();G();be.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};O("trackAsync",{event:"reportJsError",data:r})});be.on("GLOBAL_USER_ERROR",(e,t)=>{ne.log("UserError",e,t)})});var Pr=k(()=>{"use strict"});function co(e,t){let r=(n,o,i)=>{let s=N(w({tag:n},t),{extra:w({},o)});n=="globalJsError"?K(new Wn(JSON.stringify(s))):e("systemLog",s,i)};return r.debounce=Be(r,500,{leading:!0}),r}function uo(e){let t=(r,n,o)=>{var a;let i=(a=o&&JSON.stringify(o))!=null?a:0,s={speed_value_type:r,total_duration:n};i&&Object.assign(s,{extra:i}),e("joliboxSpeedAnalysis",s)};return t.debounce=Be(t,500,{leading:!0}),t}var po=k(()=>{"use strict";P();P();oe()});function mo(e,t){let r=co(e,t),n=uo(r);return{track:r,trackPerformance:n}}var fo=k(()=>{"use strict";po()});var ho=k(()=>{"use strict";J();P();P()});var _o=k(()=>{"use strict";fo();Pr();ho()});var at,go=k(()=>{"use strict";at=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,o,i=!1,s=0,a=()=>{if(!i)return;let m=Date.now(),g=m-r;g>=this.interval&&(this.visible&&(s+=g,t(s)),r=m),n=requestAnimationFrame(a)},l=()=>{d(),r=Date.now(),o=window.setInterval(()=>{if(!i)return;let m=Date.now();m-r>=this.interval&&(r=m)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(a)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",m=>{i&&(console.log("visible",m),m?c():l())});let p=this.visible;return{start(){i||(i=!0,p?c():l())},stop(){i=!1,d(),u()}}}}});var Nr=k(()=>{"use strict"});function yo(e,t,r){let{response:n,startTime:o,endTime:i,requestFrom:s}=r,{errMsg:a="",profile:l={}}=n,d={duration:i-o,request_type:e,url:t.split("?")[0],result:r.state,error_msg:r.state==="fail"?a:"",socket_reused:l.socketReused?1:0,request_from:s};(s==="public"&&vo<$a||s==="inner")&&(d.joli_request_number=vo++,setTimeout(()=>{Y("joliboxNetRequestResult",d)},500))}var vo,$a,bo=k(()=>{"use strict";Nr();ge();vo=0,$a=10});function lt(e,t,r){var l,c,d;let n=new Map,o=(l=r==null?void 0:r.baseUrl)!=null?l:"https://api.jolibox.com",i=(c=r==null?void 0:r.type)!=null?c:"public",s=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return re("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let p=n.get(u.requestTaskId);if(p)if(u.state==="success"){let m=u,{requestTaskId:b,state:h}=m,_=Z(m,["requestTaskId","state"]);p.resolve(_),n.delete(b)}else if(u.state==="fail"){let g=u,{requestTaskId:b,state:h}=g,_=Z(g,["requestTaskId","state"]);p.reject(_),n.delete(b)}else ne.warn("onRequestTaskStateChange unknown event",u)}),ce.on("onLoginComplete",({isLogin:u,token:p})=>{u&&p&&(s["X-JOLI-TOKEN"]=p)}),(m,...g)=>E(this,[m,...g],function*(u,p={}){let b=Date.now(),h=Ha(u,N(w({},p),{baseUrl:o})),{method:_="GET",responseType:v="text",dataType:S="json",timeout:R,enableCache:A=!1,appendHostCookie:C=!0}=p,H=Object.assign({"content-type":"application/json"},s,p.header),z={url:h,method:_,header:H,enableCache:A,responseType:v,appendHostCookie:C};if(_=="POST"||_=="PUT"){let te=Va(p.data,H["content-type"]);z.data=te}R&&Object.assign(z,{timeout:R});let{data:{requestTaskId:se}}=O(e,z);if(typeof se!="string")throw _e({code:-1,msg:"requestTaskId is not a string"});let Te=(te,ae)=>{yo("request",h,{state:te,startTime:b,endTime:Date.now(),params:z,response:ae,requestId:se,requestFrom:i=="public"?"public":"inner"})},{resolve:X,reject:ve,promise:Yi}=new fe;n.set(se,{resolve:X,reject:ve});try{let te=yield Yi;Te("success",te);let{data:ae}=te;return S==="json"&&typeof ae=="string"&&(ae=Ka(ae)),{url:h,timeout:R,method:_,response:N(w({},te),{data:ae})}}catch(te){let ae=te;if(ye(ae)){let{errMsg:ze,prefetchDetail:Xi,isPrefetch:Zi,errNo:es}=ae;je(ze)&&(Te("fail",{errMsg:ze,isPrefetch:Zi,prefetchDetail:Xi}),K(_e({code:-1,msg:ze},{errNo:es,errMsg:ze})))}throw te}})}function Ka(e){try{return JSON.parse(e.trim())}catch(t){return e}}function Va(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var Ha,Or=k(()=>{"use strict";P();bo();Nr();G();oe();Ie();Ha=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,o=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${o?`?${o}`:""}`:`${e}${o?`?${o}`:""}`}});var Dr,wo,q,xe=k(()=>{"use strict";xr();Or();J();Dr={"x-user-agent":ro()};(wo=y.hostUserInfo)!=null&&wo.token&&(Dr["x-joli-token"]=y.hostUserInfo.token);y.joliSource&&(Dr["x-joli-source"]=y.joliSource);q=lt("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:y.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com",defaultHeaders:Dr})});var ct,Eo=k(()=>{"use strict";J();go();xe();G();ct=class extends at{constructor(t,r,n){super(r,n),this.gameId=y.mpId,this.sessionId=y.sessionId,this.track=t}reporter(t){return E(this,null,function*(){let{event:r,params:n}=t,o=[];o.push(q("/api/base/app-event",{method:"POST",data:{eventType:r,gameInfo:w({gameId:this.gameId,sessionId:this.sessionId},n)}})),yield Promise.all(o)})}reportToNative(t){return E(this,null,function*(){let{event:r,params:n}=t;yield Q("userTrackAsync",{event:r,params:w({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var xo={};mn(xo,{nativeTaskEmitter:()=>Ke,taskTracker:()=>W,track:()=>Y,trackPerformance:()=>To});var Ja,ko,So,Y,To,Io,Ke,W,ge=k(()=>{"use strict";lo();P();Pr();_o();J();Eo();G();Ja=(e,t,r)=>{var s,a;let n=t,o=ye(n.extra)?n.extra:je(n.extra)?JSON.parse(n.extra):{},i=N(w({},o),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(a=n.mp_version)!=null?a:""});O("trackAsync",{event:e,data:i,webviewId:r})},{track:Y,trackPerformance:To}=mo(Ja,{type:kr.AppSDK,platform:"native",jssdk_version:(So=(ko=y.sdkInfo)==null?void 0:ko.jssdkVersion)!=null?So:"1.0.0",mp_id:y.mpId,mp_version:y.mpVersion}),Io=j();Io.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{To(e,t,r)});Io.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Y(e,t)});Ke=new he,W=new ct(Y,Ke)});function Ro(){let e=null,t=window.fetch,r=()=>{e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let i=`
|
|
1
|
+
var ts=Object.create;var Ye=Object.defineProperty,rs=Object.defineProperties,ns=Object.getOwnPropertyDescriptor,os=Object.getOwnPropertyDescriptors,is=Object.getOwnPropertyNames,Qe=Object.getOwnPropertySymbols,ss=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var un=(e,t,r)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))zt.call(t,r)&&un(e,r,t[r]);if(Qe)for(var r of Qe(t))dn.call(t,r)&&un(e,r,t[r]);return e},N=(e,t)=>rs(e,os(t));var Z=(e,t)=>{var r={};for(var n in e)zt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qe)for(var n of Qe(e))t.indexOf(n)<0&&dn.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var pn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},as=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of is(t))!zt.call(e,o)&&o!==r&&Ye(e,o,{get:()=>t[o],enumerable:!(n=ns(t,o))||n.enumerable});return e};var fn=(e,t,r)=>(r=e!=null?ts(ss(e)):{},as(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e));var E=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});function ms(e){return!!(e!=null&&e.__nativeBuffers__)}function rr(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!ms(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let o;n.value?o=n.value:n.base64&&(o=fs(n.base64)),typeof o!="undefined"&&o instanceof ArrayBuffer&&(e[n.key]=o)}}return e}function _s(e={},t=!1){let r=e,n=[];for(let[o,i]of Object.entries(r))if(i!==void 0&&i instanceof ArrayBuffer&&i.byteLength!==void 0){let s=t?{value:i,key:o}:{base64:hs(i),key:o};n.push(s),delete r[o]}return n.length>0&&(r.__nativeBuffers__=n),r}function ks(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function xn(e){return typeof e=="string"}function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ts(e){return typeof e=="undefined"}function xs(e){return Ts(e)||e===null}function In(e){return typeof e=="function"}function Is(e){return Oe(e)&&In(e.then)}function Rn(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function Ne(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function $s(e){return new Promise(t=>An(e)(t))}function An(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Hs(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Le(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function Vs(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Js(e[n],t[n])}function Js(e,t){if(xn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(In(t)){try{if(e instanceof t)return}catch(r){}if(!xs(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 yn(e,t){return`[${e}]:${t}`}function Qs(e,t){bn||(Xt=new Ze({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(o){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),Zt=new Ze({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(o){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),er=new Ze({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(o){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:o}),-1)}}),t("onJoliboxEnterBackground",()=>{Xt.flush(),Zt.flush(),er.flush()}),bn=!0);function r(o){var i,s;let{method:a,args:l,startTime:c,isForeground:d,errMsg:u=`${a}:fail no errMsg`,errNo:p=0,__timing:m={receiveJSInvoke:0,invokeCallback:0}}=o,{receiveJSInvoke:g,invokeCallback:b}=m,h=(s=(i=u.match(/\S:(\S+)\s?/))==null?void 0:i[1])!=null?s:"fail";Xt.report({status:h,method:n(a,l),errNo:`${p}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&g&&b&&(Zt.report({status:h,method:a,isForeground:d,duration:Number((g-c).toFixed(3))}),er.report({status:h,method:a,isForeground:d,duration:Number((Date.now()-b).toFixed(3))}))}function n(o,i){return(o==="callHostMethod"||o==="callHostMethodSync")&&i!=null&&i.method?`${o}-${i.method}`:o}return r}function Xs(e,t){let r=0,n=!0,o=new Map,i=Qs(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,tr.forEach(l=>lr(this,[l],function*({method:c,args:d,resolve:u}){let p=yield a(c,d);u(p)})),tr.length=0});let s=(l,c)=>{let d=o.get(Number(l));if(!d)return;let u=rr(c);d(u),o.delete(Number(l))},a=(l,c)=>{var d,u;let p=Date.now(),m=`${n}`;r+=1;let g=new Ss;if(o.set(r,g.resolve),!n&&qs.includes(l))return new Promise(R=>{tr.push({method:l,args:c,resolve:R})});let b=ds(me({},{method:l,startTime:p,args:c,isForeground:m}),{invokeType:"js-bridge"}),h=!Ys&&Gs.includes(l),_=_s(c,h),v=h?_:JSON.stringify(_),S;if(l.endsWith("Sync")||Ws.includes(l)?S=(d=e.call)==null?void 0:d.call(e,l,_,r):typeof v=="string"?S=e.invoke(l,v,r):S=(u=e.call)==null?void 0:u.call(e,l,v,r),S){try{typeof S=="string"&&(S=JSON.parse(S)),S=rr(S)}catch(R){ur.error(R)}return o.delete(r),S.errorCode&&(S.errorCode=yn(l,S.errorCode)),i(me(me({},b),S)),S}return l.endsWith("Sync")&&o.delete(r),g.promise.then(R=>(R.errorCode&&(R.errorCode=yn(l,R.errorCode)),i(me(me({},b),R)),R))};return{invokeNative:a,applyNative:(l,c)=>{let d=a(l,c);return Is(d)?d.then(u=>wn(l,u)):wn(l,d)},invokeHandler:s}}function wn(e,t){if(!Oe(t)){ur.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:o,errorType:i,errorCode:s}=r,a=ps(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new Ps(n,o,i,s);return a}function Zs(e){let t=new ir,r=new ir,n=new Ze({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(o){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:o}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),{onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(o,i,s){let a=rr(i),l;if(a.__extra){l=a.params;let{type:c,startTime:d}=a.__extra;n.report({type:c,event:o,duration:Date.now()-d})}else l=a;if(o===Cn){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(De.length),u,s)}catch(p){}});return}if(o.startsWith(De)){r.emit(o.slice(De.length),l,s);return}t.emit(o,l,s)}}}function ea(e){let t=new Map,r;return(n,o,i,s)=>{if(s){let l=i?[i]:"*";e.publish(`${De}${n}`,o,l);return}r||(r=Promise.resolve().then(()=>{t.forEach((l,c)=>{try{let d=c?[c]:"*";e.publish(Cn,l,d)}catch(d){}}),r=void 0,t.clear()}));let a=t.get(i);a||(a=[],t.set(i,a)),a.push([`${De}${n}`,o])}}function ta(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:o,unsubscribe:i}=Zs(e),{invokeNative:s,invokeHandler:a,applyNative:l}=Xs(e,r),c=ea(e);return{invokeHandler:a,subscribeHandler:t,applyNative:l,invokeNative:s,onNative:r,offNative:n,publish:c,subscribe:o,unsubscribe:i}}function Pn(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var ls,cs,us,et,kn,Sn,hn,me,ds,ps,lr,fs,hs,cr,gs,_n,vs,ys,gn,bs,ws,Tn,Es,Ss,Rs,As,tt,Cs,Ps,Ns,Qt,ur,Os,Ds,Ls,Us,Fs,Dc,nr,L,js,Ms,Xe,Le,ir,sr,Bs,Yt,Ks,Lc,ar,vn,Uc,De,Gs,qs,Ws,Cn,zs,Ze,bn,Xt,Zt,er,tr,Ys,dr,le,Nn,On,ra,Dn,En,Q,O,re,Fc,na,Ln,jc,Mc,G=k(()=>{"use strict";ls=Object.defineProperty,cs=Object.defineProperties,us=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,kn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,hn=(e,t,r)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,me=(e,t)=>{for(var r in t||(t={}))kn.call(t,r)&&hn(e,r,t[r]);if(et)for(var r of et(t))Sn.call(t,r)&&hn(e,r,t[r]);return e},ds=(e,t)=>cs(e,us(t)),ps=(e,t)=>{var r={};for(var n in e)kn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&et)for(var n of et(e))t.indexOf(n)<0&&Sn.call(e,n)&&(r[n]=e[n]);return r},lr=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});fs=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer};hs=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let o=0;o<n;o++)t+=String.fromCharCode(r[o]);return btoa(t)};cr=Object.defineProperty,gs=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertySymbols,vs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,gn=(e,t,r)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t)=>{for(var r in t||(t={}))vs.call(t,r)&&gn(e,r,t[r]);if(_n)for(var r of _n(t))ys.call(t,r)&&gn(e,r,t[r]);return e},ws=(e,t)=>{for(var r in t)cr(e,r,{get:t[r],enumerable:!0})},Tn=(e,t,r,n)=>{for(var o=n>1?void 0:n?gs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cr(t,r,o),o},Es=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((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 o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,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}Ss=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};Rs=(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))(Rs||{}),As=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}},tt=class extends As{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Cs=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},Ps=class extends tt{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},Ns=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},Qt=class extends tt{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};ur={log:Ne("log"),warn:Ne("warn"),info:Ne("info"),error:Ne("error"),debug:Ne("debug")};Object.assign(globalThis,{logger:ur});Os=Symbol.for("Jolibox.canIUseMap"),Ds={};globalThis[Os]=Ds;Ls=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Ls||{}),Us=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Us||{}),Fs=(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))(Fs||{}),Dc={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")},nr=class or{constructor(t){this.element=t,this.next=or.Undefined,this.prev=or.Undefined}};nr.Undefined=new nr(void 0);L=nr,js=class{constructor(){this._first=L.Undefined,this._last=L.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===L.Undefined}clear(){let e=this._first;for(;e!==L.Undefined;){let t=e.next;e.prev=L.Undefined,e.next=L.Undefined,e=t}this._first=L.Undefined,this._last=L.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new L(e);if(this._first===L.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==L.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==L.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==L.Undefined&&e.next!==L.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===L.Undefined&&e.next===L.Undefined?(this._first=L.Undefined,this._last=L.Undefined):e.next===L.Undefined?(this._last=this._last.prev,this._last.next=L.Undefined):e.prev===L.Undefined&&(this._first=this._first.next,this._first.prev=L.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==L.Undefined;)yield e.element,e=e.next}},Ms=0,Xe=class{constructor(e){this.value=e,this.id=Ms++}},Le=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 Xe&&(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,o,i,s,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Xe(t);this._listeners?this._listeners instanceof Xe?this._listeners=[this._listeners,c]:this._listeners.push(c):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=c,(s=(i=this.options)==null?void 0:i.onDidFirstListener)==null||s.call(i,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++}),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(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Xe?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},ir=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Le,o=s=>t(...s.args);this.listerHandlerMap.set(t,o),n.event(o),this.listeners.set(e,n);let i=this.cachedEventQueue.get(e);if(i)for(;i.size>0;)n.fire(bs({event:e},i.shift()))}off(e,t){let r=this.listeners.get(e);if(r){let n=this.listerHandlerMap.get(t);r.dispose(n)}}emit(e,...t){let r=this.listeners.get(e);if(r)r.fire({event:e,args:t});else{let n=this.cachedEventQueue.get(e);n||(n=new js,this.cachedEventQueue.set(e,n)),n.push({args:t})}}},sr={};ws(sr,{None:()=>Bs,filter:()=>Hs,once:()=>An,toPromise:()=>$s});Bs=()=>{console.log("[Jolibox SDK] None Event")};Yt=Symbol.for("Jolibox.hostEmitter"),Ks=()=>{let e=new ir;return globalThis[Yt]||(globalThis[Yt]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[Yt]},Lc=Ks();ar=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Le,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 o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return Vs(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}};ar=Tn([Rn],ar);vn=class{constructor(){this._onWillExecuteCommand=new Le,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ar,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ks(3e4)),this._starActivation}executeCommand(e,...t){return Es(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),sr.toPromise(sr.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}}};vn=Tn([Rn],vn);Uc=Symbol.for("Jolibox.commands");De="custom_event_",Gs=[],qs=[],Ws=["env","createRequestTask","login"],Cn="__batch_event__",zs=e=>e==="pv"?e:"default",Ze=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:o,metricName:i,type:s}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=o,this.metricName=i,this.type=zs(s)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,o,i)=>{let s=n.shift();if(s){let a=i[s];r[a]||(r[a]={}),t(r[a],n,o,i)}else r[o]||(r[o]=[]),r[o].push(i[o])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,o,i,s)=>{let a=o.shift();if(!a&&Oe(s))throw new Qt(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(a){let l=[];if(Oe(s))l.push(...Object.keys(s));else if(xn(s)){if(o.length>0)throw new Qt(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(s)}else throw new Qt(`expected metric value to be a string, but got a(n) ${typeof s}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=Oe(s)?s[c]:s;t(n[c],[...o],i,d)})}else n[i]?n[i]++:n[i]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},bn=!1;tr=[],Ys=!1;le={trigger(){},exit(){return Promise.resolve(!1)},onReady(e){le.trigger=e},onDoExit(e){le.exit=e}},Nn=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new Cs("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(window.webkit){let e=window.webkit.messageHandlers,t=(o="")=>{le.trigger(),e.onDocumentReady.postMessage({path:o})},r=o=>lr(void 0,null,function*(){let i=yield le.exit();e.doExit.postMessage({uuid:o,shouldInterrupt:i})});dr={onDocumentReady:t,doExit:r,invoke(o,i,s){e.invoke.postMessage({event:o,paramsString:i,callbackId:s})},publish(o,i,s){let a=Pn(i,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:o,paramsString:JSON.stringify(a),webviewIds:s}))},call(o,i,s){let a=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(i),callbackId:s}));if(a)return JSON.parse(a)}};let n={onDocumentReady:t,env:Nn,doExit:r};globalThis.joliboxJSCore=me({},n)}if(window.JoliAndroidSDKBridge){let e=window.JoliAndroidSDKBridge,t=(o="")=>{le.trigger(),e.onDocumentReady(JSON.stringify({path:o}))},r=o=>lr(void 0,null,function*(){let i=yield le.exit();e.doExit(JSON.stringify({uuid:o,shouldInterrupt:i}))});dr={onDocumentReady:t,invoke(o,i,s){e.invoke(JSON.stringify({event:o,paramsString:i,callbackId:s}))},doExit:r,publish(o,i,s){let a=Pn(i,"joliboxJSCore");e.publish({event:o,paramsString:JSON.stringify(a),webviewIds:s})},call(o,i,s){let a=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(i),callbackId:s}));if(a)return JSON.parse(a)}};let n={onDocumentReady:t,env:Nn,doExit:r};globalThis.joliboxJSCore=me({},n)}On=dr;if(!On)throw new Ns("No joliboxJScore is found, native bridge not found.");ra=me({},On),Dn=ta(ra),{invokeHandler:En}=Dn,{applyNative:Q,invokeNative:O,onNative:re,offNative:Fc,subscribeHandler:na,publish:Ln,subscribe:jc,unsubscribe:Mc}=Dn;globalThis.joliboxJSBridge={callHandler:En,invokeHandler:En,subscribeHandler:na}});function ca(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function je(e){return typeof e=="string"}function ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function $n(e){return typeof e=="object"&&Array.isArray(e)}function Me(e){return e===!0||e===!1}function ua(e){return typeof e=="undefined"}function da(e){return ua(e)||e===null}function pa(e){return typeof e=="function"}function Hn(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function Kn(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(o,i){for(let s in i)if(Object.prototype.hasOwnProperty.call(i,s)){let a=o[s],l=i[s],c=r(a,l,s,o,i);c!==void 0?o[s]=c:jn(l)&&jn(a)?o[s]=n(Mn({},a),l):Array.isArray(l)&&Array.isArray(a)?o[s]=[...a,...l]:o[s]=l}return o}return n(e,t)}function jn(e){return e&&typeof e=="object"&&e.constructor===Object}function Vn(e,t){if(Array.isArray(e))return e.concat(t)}function Be(e,t,r={}){let n=null,o,i,s,{leading:a=!1,trailing:l=!0}=r,c=()=>(s=e.apply(i,o),o=void 0,i=void 0,s),d=function(...u){o=u,i=this;let p=a&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&c()},t),p)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,o=i=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function fa(e,t){return(...r)=>t(e,...r)}function it(e){return t=>fa(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(o){e(new $e(`${o}`))}})}function Ue(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Ra(e){return new Promise(t=>Xn(e)(t))}function Xn(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Aa(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Fe(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function Pa(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Na(e[n],t[n])}function Na(e,t){if(je(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(pa(t)){try{if(e instanceof t)return}catch(r){}if(!da(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 j(){if(globalThis[mr])return globalThis[mr];let e=new ot,t=new gr,r={registerCommand(n,o,i){e.registerCommand({id:n,handler:o,metadata:i})},executeCommand(n,...o){return t.executeCommand(n,...o)},excuteCommandSync(n,...o){return t.executeCommandThowErr(n,...o)}};return globalThis[mr]=r,r}var vr,oa,Un,ia,sa,Fn,Mn,aa,Bn,la,fe,ma,yr,br,Jn,Gn,$e,qn,Wn,He,wr,ne,zn,ha,Er,_a,kr,ga,va,rt,ya,ba,wa,Qn,Sr,Ea,ka,Sa,Yn,fr,U,Ta,xa,nt,Fe,he,_r,Ia,pr,Ca,ce,ot,gr,mr,P=k(()=>{"use strict";vr=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,Un=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Fn=(e,t,r)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mn=(e,t)=>{for(var r in t||(t={}))ia.call(t,r)&&Fn(e,r,t[r]);if(Un)for(var r of Un(t))sa.call(t,r)&&Fn(e,r,t[r]);return e},aa=(e,t)=>{for(var r in t)vr(e,r,{get:t[r],enumerable:!0})},Bn=(e,t,r,n)=>{for(var o=n>1?void 0:n?oa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vr(t,r,o),o},la=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((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 o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,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}fe=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};ma=(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))(ma||{}),yr=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}},br=class extends yr{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Jn=class extends yr{constructor(){super(...arguments),this.kind="USER_ERROR"}},Gn=class extends Jn{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},$e=class extends Jn{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))}},qn=class extends br{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Wn=class extends br{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},He=class extends yr{constructor(e,t,r,n,o){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),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},wr=class extends br{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};ne={log:Ue("log"),warn:Ue("warn"),info:Ue("info"),error:Ue("error"),debug:Ue("debug")};Object.assign(globalThis,{logger:ne});zn=Symbol.for("Jolibox.canIUseMap"),ha={};globalThis[zn]=ha;Er={get config(){return globalThis[zn]}},_a=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(_a||{}),kr=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(kr||{}),ga=(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))(ga||{}),va=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),rt={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")},ya=()=>rt.isiOS?"iOS":rt.isAndroid?"Android":rt.isMac?"Mac":rt.isFacebook?"Facebook":"PC",ba="device_id",wa="advertising_id",Qn=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,va()),window.__joliboxLocalStorage__.getItem(e)),Sr=()=>Qn(ba),Ea=()=>Qn(wa),ka=e=>e.charAt(0).toUpperCase()+e.slice(1),Sa=()=>{var e;let t=new URLSearchParams(window.location.search);return ka((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Yn=e=>{let t="JoliboxWebSDK",r=ya(),n=navigator.language,o=Sr(),i=Ea();return`${t} (${Sa()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${o} adid/${i} version/${e||""}`},fr=class hr{constructor(t){this.element=t,this.next=hr.Undefined,this.prev=hr.Undefined}};fr.Undefined=new fr(void 0);U=fr,Ta=class{constructor(){this._first=U.Undefined,this._last=U.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===U.Undefined}clear(){let e=this._first;for(;e!==U.Undefined;){let t=e.next;e.prev=U.Undefined,e.next=U.Undefined,e=t}this._first=U.Undefined,this._last=U.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new U(e);if(this._first===U.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==U.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==U.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==U.Undefined&&e.next!==U.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===U.Undefined&&e.next===U.Undefined?(this._first=U.Undefined,this._last=U.Undefined):e.next===U.Undefined?(this._last=this._last.prev,this._last.next=U.Undefined):e.prev===U.Undefined&&(this._first=this._first.next,this._first.prev=U.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==U.Undefined;)yield e.element,e=e.next}},xa=0,nt=class{constructor(e){this.value=e,this.id=xa++}},Fe=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 nt&&(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,o,i,s,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new nt(t);this._listeners?this._listeners instanceof nt?this._listeners=[this._listeners,c]:this._listeners.push(c):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=c,(s=(i=this.options)==null?void 0:i.onDidFirstListener)==null||s.call(i,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++}),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(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof nt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},he=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Fe,o=s=>t(...s.args);this.listerHandlerMap.set(t,o),n.event(o),this.listeners.set(e,n);let i=this.cachedEventQueue.get(e);if(i)for(;i.size>0;)n.fire(Mn({event:e},i.shift()))}off(e,t){let r=this.listeners.get(e);if(r){let n=this.listerHandlerMap.get(t);r.dispose(n)}}emit(e,...t){let r=this.listeners.get(e);if(r)r.fire({event:e,args:t});else{let n=this.cachedEventQueue.get(e);n||(n=new Ta,this.cachedEventQueue.set(e,n)),n.push({args:t})}}},_r={};aa(_r,{None:()=>Ia,filter:()=>Aa,once:()=>Xn,toPromise:()=>Ra});Ia=()=>{console.log("[Jolibox SDK] None Event")};pr=Symbol.for("Jolibox.hostEmitter"),Ca=()=>{let e=new he;return globalThis[pr]||(globalThis[pr]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[pr]},ce=Ca();ot=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Fe,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 o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return Pa(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}};ot=Bn([Hn],ot);gr=class{constructor(){this._onWillExecuteCommand=new Fe,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Fe,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ot,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ca(3e4)),this._starActivation}executeCommand(e,...t){return la(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),_r.toPromise(_r.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}}};gr=Bn([Hn],gr);mr=Symbol.for("Jolibox.commands")});function K(e,t={}){Tr.emit("ERROR_REPORT",{error:e,options:t})}var Tr,be,oe=k(()=>{"use strict";P();P();Tr=new he,be=new he;K.debounce=Be(K,50,{leading:!0})});var xr,Oa,Zn,eo,to=k(()=>{"use strict";P();oe();xr=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(o){return{}}},Oa=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Zn=e=>{var t;try{let o=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(o!=null&&o.length){let[i,s,a]=o;return{headerJson:xr(i),payloadJson:xr(s),signature:xr(a)}}else throw"joli_source is missing"}catch(r){return K(new qn(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},eo=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],o=Oa(e),i=r[2];return`${n}.${o}.${i}`}return t}});var Da,st,ro,Ir=k(()=>{"use strict";P();Da="1.1.13-beta.4",st=()=>Da,ro=()=>{let e=st();return`${Yn(e)}`}});var La,no,Rr,oo,V,Ua,y,J=k(()=>{"use strict";P();to();Ir();P();La={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Sr(),pixelRatio:window.devicePixelRatio||1,platform:"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:st()},schema:window.location.href,platform:"h5"},Rr=(no=globalThis.joliboxJSCore)==null?void 0:no.env,V=Object.assign({},(oo=Rr==null?void 0:Rr())!=null?oo:La),Ua=()=>{var p,m,g,b,h,_,v,S,R;let{payloadJson:e,headerJson:t,signature:r}=V.schema.length?Zn(V.schema):{},n=`${V.deviceInfo.did}-${new Date().getTime()}`,i=new URL(V.schema.length?V.schema:window.location.href).searchParams,s=(g=(m=(p=i.get("mpId"))!=null?p:i.get("appId"))!=null?m:i.get("gameId"))!=null?g:"",a=(_=(h=(b=V.clientSessionId)!=null?b:e==null?void 0:e.sessionId)!=null?h:i.get("sessionId"))!=null?_:n,l=!!((v=e==null?void 0:e.testAdsMode)!=null?v:i.get("testAdsMode")==="true"),c=(R=(S=e==null?void 0:e.joliboxEnv)!=null?S:i.get("joliboxEnv"))!=null?R:"production",d=c==="staging",u=t==null?void 0:t.channel;return{get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var A;return(A=i.get("joliSource"))!=null?A:null},get mpId(){var A;return(A=s!=null?s:e==null?void 0:e.id)!=null?A:""},get mpVersion(){var A;return(A=t==null?void 0:t.ver)!=null?A:st()},get mpType(){var A,C;return(C=(A=t==null?void 0:t.__mpType)!=null?A:e==null?void 0:e.__mpType)!=null?C:"game"},get platform(){var A;return(A=V.platform)!=null?A:V.deviceInfo.platform},get deviceInfo(){return V.deviceInfo},get sdkInfo(){return V.sdkInfo},get hostInfo(){return V.hostInfo},get hostUserInfo(){return V.hostUserInfo},get sessionId(){var A,C;return(C=(A=V.clientSessionId)!=null?A:a)!=null?C:n},get channel(){return u},get webviewId(){var A;return(A=V.webviewId)!=null?A:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return d?"https://stg-api.jolibox.com":"https://api.jolibox.com"},onEnvConfigChanged:A=>{Kn(V,A,Vn)},encodeJoliSourceQuery:A=>{var C,H;return t&&r?eo(w(w({},e),A),(C=i.get("joliSource"))!=null?C:""):(H=i.get("joliSource"))!=null?H:""}}},y=Ua()});var Ar,so,Fa,ja,io,Ma,ao=k(()=>{"use strict";P();oe();J();P();Ar=!1,so=(e,t)=>e==null?!1:t in e,Fa=e=>so(e,"kind"),ja=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},io=(e,t={},r)=>{var i,s,a;let n={user_id:(s=(i=y.hostUserInfo)==null?void 0:i.uid)!=null?s:"",device_id:(a=y.deviceInfo.did)!=null?a:"",timestamp:Date.now(),tag:ja(e.name)},o=N(w({},n),{env:t.environment,isFromUser:r});r?be.emit("GLOBAL_USER_ERROR",e,o):be.emit("GLOBAL_ERROR",e,o)},Ma=e=>so(e,"kind")&&e.kind==="USER_ERROR";Tr.on("ERROR_REPORT",({error:e,options:t})=>{if(Ar)return;Ar=!0;let r=Fa(e)&&e.raw?e.raw:e;try{let n=Ma(e);io(e,t,n)}catch(n){let o=n instanceof Error?n.message:String(n),i=new wr(`${o}, origin error: ${r.message}`);ne.error(i),io(new wr(i.message),{environment:t.environment},!1)}finally{Ar=!1}})});var _e,Cr,xe=k(()=>{"use strict";oe();P();oe();_e=(e,t)=>{var r,n;return new He((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},Cr=e=>new Gn(e)});var lo=k(()=>{"use strict";ao();xe();P();G();be.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};O("trackAsync",{event:"reportJsError",data:r})});be.on("GLOBAL_USER_ERROR",(e,t)=>{ne.log("UserError",e,t)})});var Pr=k(()=>{"use strict"});function co(e,t){let r=(n,o,i)=>{let s=N(w({tag:n},t),{extra:w({},o)});n=="globalJsError"?K(new Wn(JSON.stringify(s))):e("systemLog",s,i)};return r.debounce=Be(r,500,{leading:!0}),r}function uo(e){let t=(r,n,o)=>{var a;let i=(a=o&&JSON.stringify(o))!=null?a:0,s={speed_value_type:r,total_duration:n};i&&Object.assign(s,{extra:i}),e("joliboxSpeedAnalysis",s)};return t.debounce=Be(t,500,{leading:!0}),t}var po=k(()=>{"use strict";P();P();oe()});function mo(e,t){let r=co(e,t),n=uo(r);return{track:r,trackPerformance:n}}var fo=k(()=>{"use strict";po()});var ho=k(()=>{"use strict";J();P();P()});var _o=k(()=>{"use strict";fo();Pr();ho()});var at,go=k(()=>{"use strict";at=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,o,i=!1,s=0,a=()=>{if(!i)return;let m=Date.now(),g=m-r;g>=this.interval&&(this.visible&&(s+=g,t(s)),r=m),n=requestAnimationFrame(a)},l=()=>{d(),r=Date.now(),o=window.setInterval(()=>{if(!i)return;let m=Date.now();m-r>=this.interval&&(r=m)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(a)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",m=>{i&&(console.log("visible",m),m?c():l())});let p=this.visible;return{start(){i||(i=!0,p?c():l())},stop(){i=!1,d(),u()}}}}});var Nr=k(()=>{"use strict"});function yo(e,t,r){let{response:n,startTime:o,endTime:i,requestFrom:s}=r,{errMsg:a="",profile:l={}}=n,d={duration:i-o,request_type:e,url:t.split("?")[0],result:r.state,error_msg:r.state==="fail"?a:"",socket_reused:l.socketReused?1:0,request_from:s};(s==="public"&&vo<$a||s==="inner")&&(d.joli_request_number=vo++,setTimeout(()=>{Y("joliboxNetRequestResult",d)},500))}var vo,$a,bo=k(()=>{"use strict";Nr();ge();vo=0,$a=10});function lt(e,t,r){var l,c,d;let n=new Map,o=(l=r==null?void 0:r.baseUrl)!=null?l:"https://api.jolibox.com",i=(c=r==null?void 0:r.type)!=null?c:"public",s=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return re("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let p=n.get(u.requestTaskId);if(p)if(u.state==="success"){let m=u,{requestTaskId:b,state:h}=m,_=Z(m,["requestTaskId","state"]);p.resolve(_),n.delete(b)}else if(u.state==="fail"){let g=u,{requestTaskId:b,state:h}=g,_=Z(g,["requestTaskId","state"]);p.reject(_),n.delete(b)}else ne.warn("onRequestTaskStateChange unknown event",u)}),ce.on("onLoginComplete",({isLogin:u,token:p})=>{u&&p&&(s["X-JOLI-TOKEN"]=p)}),(m,...g)=>E(this,[m,...g],function*(u,p={}){let b=Date.now(),h=Ha(u,N(w({},p),{baseUrl:o})),{method:_="GET",responseType:v="text",dataType:S="json",timeout:R,enableCache:A=!1,appendHostCookie:C=!0}=p,H=Object.assign({"content-type":"application/json"},s,p.header),z={url:h,method:_,header:H,enableCache:A,responseType:v,appendHostCookie:C};if(_=="POST"||_=="PUT"){let te=Va(p.data,H["content-type"]);z.data=te}R&&Object.assign(z,{timeout:R});let{data:{requestTaskId:se}}=O(e,z);if(typeof se!="string")throw _e({code:-1,msg:"requestTaskId is not a string"});let Te=(te,ae)=>{yo("request",h,{state:te,startTime:b,endTime:Date.now(),params:z,response:ae,requestId:se,requestFrom:i=="public"?"public":"inner"})},{resolve:X,reject:ve,promise:Yi}=new fe;n.set(se,{resolve:X,reject:ve});try{let te=yield Yi;Te("success",te);let{data:ae}=te;return S==="json"&&typeof ae=="string"&&(ae=Ka(ae)),{url:h,timeout:R,method:_,response:N(w({},te),{data:ae})}}catch(te){let ae=te;if(ye(ae)){let{errMsg:ze,prefetchDetail:Xi,isPrefetch:Zi,errNo:es}=ae;je(ze)&&(Te("fail",{errMsg:ze,isPrefetch:Zi,prefetchDetail:Xi}),K(_e({code:-1,msg:ze},{errNo:es,errMsg:ze})))}throw te}})}function Ka(e){try{return JSON.parse(e.trim())}catch(t){return e}}function Va(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var Ha,Or=k(()=>{"use strict";P();bo();Nr();G();oe();xe();Ha=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,o=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${o?`?${o}`:""}`:`${e}${o?`?${o}`:""}`}});var Dr,wo,q,Ie=k(()=>{"use strict";Ir();Or();J();Dr={"x-user-agent":ro()};(wo=y.hostUserInfo)!=null&&wo.token&&(Dr["x-joli-token"]=y.hostUserInfo.token);y.joliSource&&(Dr["x-joli-source"]=y.joliSource);q=lt("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:y.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com",defaultHeaders:Dr})});var ct,Eo=k(()=>{"use strict";J();go();Ie();G();ct=class extends at{constructor(t,r,n){super(r,n),this.gameId=y.mpId,this.sessionId=y.sessionId,this.track=t}reporter(t){return E(this,null,function*(){let{event:r,params:n}=t,o=[];o.push(q("/api/base/app-event",{method:"POST",data:{eventType:r,gameInfo:w({gameId:this.gameId,sessionId:this.sessionId},n)}})),yield Promise.all(o)})}reportToNative(t){return E(this,null,function*(){let{event:r,params:n}=t;yield Q("userTrackAsync",{event:r,params:w({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var Io={};mn(Io,{nativeTaskEmitter:()=>Ke,taskTracker:()=>W,track:()=>Y,trackPerformance:()=>To});var Ja,ko,So,Y,To,xo,Ke,W,ge=k(()=>{"use strict";lo();P();Pr();_o();J();Eo();G();Ja=(e,t,r)=>{var s,a;let n=t,o=ye(n.extra)?n.extra:je(n.extra)?JSON.parse(n.extra):{},i=N(w({},o),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(a=n.mp_version)!=null?a:""});O("trackAsync",{event:e,data:i,webviewId:r})},{track:Y,trackPerformance:To}=mo(Ja,{type:kr.AppSDK,platform:"native",jssdk_version:(So=(ko=y.sdkInfo)==null?void 0:ko.jssdkVersion)!=null?So:"1.0.0",mp_id:y.mpId,mp_version:y.mpVersion}),xo=j();xo.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{To(e,t,r)});xo.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Y(e,t)});Ke=new he,W=new ct(Y,Ke)});function Ro(){let e=null,t=window.fetch,r=()=>{e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let i=`
|
|
2
2
|
html[data-jolibox-root] {
|
|
3
3
|
height: 100%;
|
|
4
4
|
margin: 0;
|
|
@@ -16,7 +16,7 @@ var ts=Object.create;var Ye=Object.defineProperty,rs=Object.defineProperties,ns=
|
|
|
16
16
|
min-height: 100dvh;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
`;e.textContent=i;let s=document.head||document.getElementsByTagName("head")[0];s.insertBefore(e,s.firstChild),document.documentElement.setAttribute("data-jolibox-root","")},n=()=>{function i(a){return E(this,null,function*(){let l=a instanceof URL?a.href:a,c=new Promise((d,u)=>{let p=new XMLHttpRequest;p.open("GET",l),p.responseType="arraybuffer",p.addEventListener("load",()=>d(p.response)),p.addEventListener("error",u),p.send()});try{let d=yield c;return new Response(d,{headers:new Headers([["Content-Type","application/wasm"]])}).clone()}catch(d){throw console.error("Failed to load wasm:",d),d}})}let s=window.fetch;window.fetch=(a,l)=>{let c=a instanceof URL?a.href:a.toString();return c.endsWith(".wasm")?i(c):s(a,l)}},o=()=>{e!=null&&e.parentNode&&(e.parentNode.removeChild(e),e=null),document.documentElement.removeAttribute("data-jolibox-root"),window.fetch=t};return r(),n(),o}var Ao=k(()=>{"use strict"});var ut,Co=k(()=>{"use strict";ut=class{constructor(t){this.track=t;this.adBreakIsShowing=!1;this.reportPageJumpOut=()=>{this.track("AdBreakJumpOut",{context:"AdsActionDetection"})};this.reportPageHide=()=>{this.track("AdBreakHide",{context:"AdsActionDetection"})};window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}}});var dt,Ga,qa,Wa,za,Po=k(()=>{"use strict";dt=class{constructor(t,r,n,o){this.track=t;this.httpClient=r;this.checkNetwork=n;this.checkAdsDisplayPermission=t=>{if(!this.checkNetwork())return{reason:"NETWORK_NOT_OK"};let r=this.checkShouldBanInitial();if(r)return{reason:r};let n=this.checkShouldBanForSession(t);if(n)return{reason:n};let o=this.checkShouldBanHighFreq(t);if(o)return o;let i=this.checkShouldBanForTime(t);return i?{reason:i}:{reason:"ALLOWED"}};var p,m,g,b,h,_,v;let i=(p=o==null?void 0:o.maxAllowedAdsForTime)!=null?p:8,s=(m=o==null?void 0:o.banForTimeThreshold)!=null?m:6e4,a=(g=o==null?void 0:o.bannedReleaseTime)!=null?g:6e4,l=(b=o==null?void 0:o.maxAllowedAdsForSession)!=null?b:200,c=(h=o==null?void 0:o.banForSessionThreshold)!=null?h:6e5,d=(_=o==null?void 0:o.initialThreshold)!=null?_:2e3,u=(v=o==null?void 0:o.highFreqThreshold)!=null?v:2e3;this.checkShouldBanInitial=Wa(d),this.checkShouldBanHighFreq=za(u),this.checkShouldBanForTime=qa(i,s,a),this.checkShouldBanForSession=Ga(l,c)}report(t,r){let n=r?{reason:t,count:r}:{reason:t};this.track("PreventAdsCheating",n),this.httpClient.post("/api/base/app-event",{data:{eventType:"PREVENT_ADS_CHEATING",adsInfo:n}})}},Ga=(e,t)=>{let r=!1,n=[];return i=>{if(r)return"BANNED_FOR_SESSION";let s=Date.now();if(n=n.concat({timestamp:s,type:i}),n.length!==1&&(n.length>e&&(n=n.slice(-e)),n.length===e&&s-n[0].timestamp<=t))return r=!0,"BANNED_FOR_SESSION"}},qa=(e,t,r)=>{let n=null,o=d=>{n&&(window.clearTimeout(n),n=null),n=window.setTimeout(()=>{l.value=!1,n=null},d)},i="jolibox-sdk-ads-callbreak-timestamps",s="jolibox-sdk-ads-ban-for-time",a={_records:[],init(){var d;try{let u=JSON.parse((d=window.localStorage.getItem(i))!=null?d:"[]");Array.isArray(u)?this._records=u:this._records=[]}catch(u){this._records=[]}},get values(){return this._records},set values(d){try{window.localStorage.setItem(i,JSON.stringify(d))}catch(u){}this._records=d}},l={_record:!1,init(){var d;try{let u=JSON.parse((d=window.localStorage.getItem(s))!=null?d:"false");typeof u=="boolean"&&(this._record=u)}catch(u){this._record=!1}if(this._record){let u=a.values[a.values.length-1],p=u?Date.now()-u.timestamp:r;p<=r&&p>0?o(p):this._record=!1}},get value(){return this._record},set value(d){try{window.localStorage.setItem(s,JSON.stringify(d))}catch(u){}this._record=d}};return a.init(),l.init(),d=>{if(l.value)return"WAITING_BANNED_RELEASE";let u=Date.now();if(a.values=a.values.concat({timestamp:u,type:d}),a.values.length!==1&&(a.values.length>e&&(a.values=a.values.slice(-e)),a.values.length===e&&u-a.values[0].timestamp<=t))return l.value=!0,o(r),"BANNED_FOR_TIME"}},Wa=e=>{let t=Date.now();return()=>{if(Date.now()-t<=e)return"BLOCK_INITIAL"}},za=(e=2e3)=>{let t=0,r=null;return o=>{if(o==="reward"){if(r)return t+=1,{reason:"HOLDING_HIGH_FREQ",info:{count:t}};r=window.setTimeout(()=>{r&&(window.clearTimeout(r),r=0,t=0)},e)}}}});var pt,No=k(()=>{"use strict";J();pt=class{constructor(t){this.httpClient=t;this.configs=null;this.firstRun=!0;this.init()}init(){return E(this,null,function*(){try{this.configs=yield this.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config")}catch(t){}})}shouldBypassCallingInterstitial(){var r,n;let t;if(!this.configs)this.init(),t=!this.firstRun;else{let o=(r=y.channel)!=null?r:"",i=this.configs[o],s=(n=i==null?void 0:i.interstitialRate)!=null?n:1;t=Math.random()<s}return this.firstRun=!1,t}}});var Re,mt,Ur=k(()=>{"use strict";Co();Po();J();No();P();Re=new he,mt=class{constructor(t,r,n){this.track=t;this.httpClient=r;this.checkNetwork=n;this.configured=!1;this.config={};this.getGameId=()=>y.mpId;this.getTestAdsMode=()=>y.testAdsMode;this.asyncLoad=()=>E(this,null,function*(){var s,a,l,c,d;let t="ca-pub-7171363994453626",r,n,o=window.encodeURIComponent(window.btoa((s=this.getGameId())!=null?s:"")),i=(a=this.getTestAdsMode())!=null?a:!1;try{let u=yield this.httpClient.get("/public/ads",{query:{objectId:o,testAdsMode:`${i}`}});t=(l=u.data)==null?void 0:l.clientId,r=(c=u.data)==null?void 0:c.channelId,n=(d=u.data)==null?void 0:d.unitId}catch(u){console.error("Failed to fetch client info",u)}this.clientId=t,this.channelId=r,this.unitId=n});this.asyncInit=t=>E(this,null,function*(){var o;if(typeof window=="undefined")return;yield this.asyncLoad();let r="google-adsense",n=(o=this.getTestAdsMode())!=null?o:!1;if(!document.getElementById(r)&&this.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.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.channelId&&i.setAttribute("data-ad-channel",this.channelId),document.head.appendChild(i),this.track("LoadAdsenseCompleted",null)}});this.push=(t={})=>{window.adsbygoogle.push(t)};this.wrapAdBreakParams=t=>{let r=!1,n=t.adBreakDone,o=s=>{var a;r=!0,this.adsActionDetection.adBreakIsShowing=!1,this.track("CallAdBreakDone",{breakType:s.breakType,breakName:(a=s.breakName)!=null?a:"",breakFormat:s.breakFormat,breakStatus:s.breakStatus}),n&&n(s)};if(t.adBreakDone=o,t.type==="reward"){let s=t.beforeReward,a=c=>()=>{this.track("CallShowAdFn",null),c()},l=c=>{r=!0,s&&s(a(c))};t.beforeReward=l,window.setTimeout(()=>{var c,d;r||(this.track("CallAdBreakTimeout",{type:t.type}),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:(c=t.name)!=null?c:"",breakFormat:"reward",breakStatus:"timeout"}))},1e4)}if((s=>s.type==="preroll")(t)){Re.emit("isAdShowing",!0);let s=t.adBreakDone,a=l=>{Re.emit("isAdShowing",!1),s&&s(l)};return N(w({},t),{adBreakDone:a})}else{let s=t.beforeAd,a=t.afterAd,l=()=>{var d;r=!0,Re.emit("isAdShowing",!0),this.track("CallBeforeAd",{type:t.type,name:(d=t.name)!=null?d:""}),s&&s()},c=()=>{var d;r=!0,Re.emit("isAdShowing",!1),this.track("CallAfterAd",{type:t.type,name:(d=t.name)!=null?d:""}),a&&a()};return N(w({},t),{beforeAd:l,afterAd:c})}};this.adConfig=t=>{let o=t,{onReady:r}=o,n=Z(o,["onReady"]);this.track("CallAdConfig",n),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(t))};this.adBreak=t=>{var a,l,c,d,u,p;if(!this.getGameId()){console.warn("Game ID is not set, skip calling adBreak");return}if(t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}let{reason:r,info:n}=this.antiCheating.checkAdsDisplayPermission(t.type==="reward"?"reward":"interstitial");switch(r){case"NETWORK_NOT_OK":case"BANNED_FOR_SESSION":(l=t.adBreakDone)==null||l.call(t,{breakType:t.type,breakName:r,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"}),this.antiCheating.report(r);return;case"BLOCK_INITIAL":case"BANNED_FOR_TIME":case"WAITING_BANNED_RELEASE":(c=t.adBreakDone)==null||c.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"}),this.antiCheating.report(r);return;case"HOLDING_HIGH_FREQ":(u=t.adBreakDone)==null||u.call(t,{breakFormat:t.type==="reward"?"reward":"interstitial",breakName:"",breakStatus:((d=n==null?void 0:n.count)!=null?d:0)>6?"other":"frequencyCapped",breakType:t.type}),n!=null&&n.count&&n.count!==0&&n.count%3===0&&this.antiCheating.report(r,n==null?void 0:n.count);return;default:break}let o=t.type,i;switch(o){case"preroll":i={type:o};break;case"start":case"pause":case"next":case"browse":case"reward":i={type:o,name:(p=t.name)!=null?p:""};break}this.adsActionDetection.adBreakIsShowing=!0,this.track("CallAdBreak",i);let s=this.wrapAdBreakParams(t);this.push(s),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")};this.adUnit=t=>E(this,null,function*(){var p,m,g,b;if(this.track("CallAdUnit",{adFormat:(m=(p=t.adFormat)==null?void 0:p.toString())!=null?m:null,fullWidthResponsive:(g=t.fullWidthResponsive)!=null?g:null}),this.clientId||(yield this.asyncLoad()),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:r,slot:n,adFormat:o,fullWidthResponsive:i,style:s}=t,a;if(!r)throw new Error("targeting element is required");if(typeof r=="string"?a=document.querySelector(r):a=r,!a)throw new Error("targeting element not found");let l=n;if(l||(l=this.unitId),!l)throw new Error("slot is required");let c=typeof o=="object"&&Array.isArray(o)?o.join(", "):o,d=document.createElement("ins");if(d.className="adsbygoogle",d.id="jolibox-ads",d.style.display="block",d.setAttribute("data-ad-client",this.clientId),d.setAttribute("data-ad-slot",l),c&&d.setAttribute("data-ad-format",c),i&&d.setAttribute("data-full-width-responsive",i),s&&d.setAttribute("style",s),(b=this.getTestAdsMode())!=null?b:!1){let h=document.createElement("div");h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.backgroundColor="rgba(0, 0, 0, 0.5)",h.style.color="white",h.innerHTML="Test Ad",d.style.position="relative",a.appendChild(d),d.appendChild(h)}else a.appendChild(d),new MutationObserver(_=>{_.forEach(v=>{if(v.type==="attributes"&&v.attributeName==="data-ad-status"){let S=d.getAttribute("data-ad-status");this.track("AdSenseUnitStatusChanged",{status:S!=null?S:"null"})}})}).observe(d,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})});this.antiCheating=new dt(t,r,n),this.adsActionDetection=new ut(this.track),this.channelPolicy=new pt(r)}init(t){this.track("CallAdsInit",null),typeof window!="undefined"&&(this.config=t!=null?t:{},window.adsbygoogle=window.adsbygoogle||[],this.asyncInit(t))}}});function ue(e,t){for(var r in t)e[r]=t[r];return e}function qr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ee(e,t,r){var n,o,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?wt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return _t(e,s,n,o,null)}function _t(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o!=null?o:++Zo,__i:-1,__u:0};return o==null&&T.vnode!=null&&T.vnode(i),i}function ke(e){return e.children}function de(e,t){this.props=e,this.context=t}function Ae(e,t){if(t==null)return e.__?Ae(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"?Ae(e):null}function oi(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 oi(e)}}function Do(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!vt.__r++||Oo!==T.debounceRendering)&&((Oo=T.debounceRendering)||ei)(vt)}function vt(){for(var e,t,r,n,o,i,s,a=1;we.length;)we.length>a&&we.sort(ti),e=we.shift(),a=we.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,i=[],s=[],t.__P&&((r=ue({},n)).__v=n.__v+1,T.vnode&&T.vnode(r),Wr(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,i,o!=null?o:Ae(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,ai(i,r,s),r.__e!=o&&oi(r)));vt.__r=0}function ii(e,t,r,n,o,i,s,a,l,c,d){var u,p,m,g,b,h,_=n&&n.__k||ni,v=t.length;for(l=Ya(r,t,_,l,v),u=0;u<v;u++)(m=r.__k[u])!=null&&(p=m.__i===-1?Je:_[m.__i]||Je,m.__i=u,h=Wr(e,m,p,o,i,s,a,l,c,d),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&zr(p.ref,null,m),d.push(m.ref,m.__c||g,m)),b==null&&g!=null&&(b=g),4&m.__u||p.__k===m.__k?l=si(m,l,e):typeof m.type=="function"&&h!==void 0?l=h:g&&(l=g.nextSibling),m.__u&=-7);return r.__e=b,l}function Ya(e,t,r,n,o){var i,s,a,l,c,d=r.length,u=d,p=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=i+p,(s=e.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?_t(null,s,null,null,null):We(s)?_t(ke,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?_t(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(c=s.__i=Xa(s,r,l,u))!==-1&&(u--,(a=r[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&(o>d?p--:o<d&&p++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?p--:c==l+1?p++:(c>l?p--:p++,s.__u|=4))):e.__k[i]=null;if(u)for(i=0;i<d;i++)(a=r[i])!=null&&!(2&a.__u)&&(a.__e==n&&(n=Ae(a)),ci(a,a));return n}function si(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=si(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Ae(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function yt(e,t){return t=t||[],e==null||typeof e=="boolean"||(We(e)?e.some(function(r){yt(r,t)}):t.push(e)),t}function Xa(e,t,r,n){var o,i,s=e.key,a=e.type,l=t[r];if(l===null&&e.key==null||l&&s==l.key&&a===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;){if(o>=0){if((l=t[o])&&!(2&l.__u)&&s==l.key&&a===l.type)return o;o--}if(i<t.length){if((l=t[i])&&!(2&l.__u)&&s==l.key&&a===l.type)return i;i++}}return-1}function Uo(e,t,r){t[0]=="-"?e.setProperty(t,r!=null?r:""):e[t]=r==null?"":typeof r!="number"||Qa.test(t)?r:r+"px"}function ft(e,t,r,n,o){var i;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||Uo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Uo(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ri,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.t=n.t:(r.t=Gr,e.addEventListener(t,i?Br:Mr,i)):e.removeEventListener(t,i?Br:Mr,i);else{if(o=="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(s){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Lo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Gr++;else if(t.u<r.t)return;return r(T.event?T.event(t):t)}}}function Wr(e,t,r,n,o,i,s,a,l,c){var d,u,p,m,g,b,h,_,v,S,R,A,C,H,z,se,Te,X=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=t.__e=r.__e]),(d=T.__b)&&d(t);e:if(typeof X=="function")try{if(_=t.props,v="prototype"in X&&X.prototype.render,S=(d=X.contextType)&&n[d.__c],R=d?S?S.props.value:d.__:n,r.__c?h=(u=t.__c=r.__c).__=u.__E:(v?t.__c=u=new X(_,R):(t.__c=u=new de(_,R),u.constructor=X,u.render=el),S&&S.sub(u),u.props=_,u.state||(u.state={}),u.context=R,u.__n=n,p=u.__d=!0,u.__h=[],u._sb=[]),v&&u.__s==null&&(u.__s=u.state),v&&X.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ue({},u.__s)),ue(u.__s,X.getDerivedStateFromProps(_,u.__s))),m=u.props,g=u.state,u.__v=t,p)v&&X.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),v&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(v&&X.getDerivedStateFromProps==null&&_!==m&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(_,R),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(_,u.__s,R)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ve){ve&&(ve.__=t)}),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(_,u.__s,R),v&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(m,g,b)})}if(u.context=R,u.props=_,u.__P=e,u.__e=!1,C=T.__r,H=0,v){for(u.state=u.__s,u.__d=!1,C&&C(t),d=u.render(u.props,u.state,u.context),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[]}else do u.__d=!1,C&&C(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++H<25);u.state=u.__s,u.getChildContext!=null&&(n=ue(ue({},n),u.getChildContext())),v&&!p&&u.getSnapshotBeforeUpdate!=null&&(b=u.getSnapshotBeforeUpdate(m,g)),se=d,d!=null&&d.type===ke&&d.key==null&&(se=li(d.props.children)),a=ii(e,We(se)?se:[se],t,r,n,o,i,s,a,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),h&&(u.__E=u.__=null)}catch(ve){if(t.__v=null,l||i!=null)if(ve.then){for(t.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else for(Te=i.length;Te--;)qr(i[Te]);else t.__e=r.__e,t.__k=r.__k;T.__e(ve,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Za(r.__e,t,r,n,o,i,s,l,c);return(d=T.diffed)&&d(t),128&t.__u?void 0:a}function ai(e,t,r){for(var n=0;n<r.length;n++)zr(r[n],r[++n],r[++n]);T.__c&&T.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){T.__e(i,o.__v)}})}function li(e){return typeof e!="object"||e==null?e:We(e)?e.map(li):ue({},e)}function Za(e,t,r,n,o,i,s,a,l){var c,d,u,p,m,g,b,h=r.props,_=t.props,v=t.type;if(v=="svg"?o="http://www.w3.org/2000/svg":v=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((m=i[c])&&"setAttribute"in m==!!v&&(v?m.localName==v:m.nodeType==3)){e=m,i[c]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(o,v,_.is&&_),a&&(T.__m&&T.__m(t,i),a=!1),i=null}if(v===null)h===_||a&&e.data===_||(e.data=_);else{if(i=i&&wt.call(e.childNodes),h=r.props||Je,!a&&i!=null)for(h={},c=0;c<e.attributes.length;c++)h[(m=e.attributes[c]).name]=m.value;for(c in h)if(m=h[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=m;else if(!(c in _)){if(c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _)continue;ft(e,c,null,m,o)}}for(c in _)m=_[c],c=="children"?p=m:c=="dangerouslySetInnerHTML"?d=m:c=="value"?g=m:c=="checked"?b=m:a&&typeof m!="function"||h[c]===m||ft(e,c,m,h[c],o);if(d)a||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),ii(t.type==="template"?e.content:e,We(p)?p:[p],t,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:r.__k&&Ae(r,0),a,l),i!=null)for(c=i.length;c--;)qr(i[c]);a||(c="value",v=="progress"&&g==null?e.removeAttribute("value"):g!==void 0&&(g!==e[c]||v=="progress"&&!g||v=="option"&&g!==h[c])&&ft(e,c,g,h[c],o),c="checked",b!==void 0&&b!==e[c]&&ft(e,c,b,h[c],o))}return e}function zr(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(o){T.__e(o,r)}}function ci(e,t,r){var n,o;if(T.unmount&&T.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||zr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){T.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&ci(n[o],t,r||typeof e.type!="function");r||qr(e.__e),e.__c=e.__=e.__e=void 0}function el(e,t,r){return this.constructor(e,r)}function $r(e,t,r){var n,o,i,s;t==document&&(t=document.documentElement),T.__&&T.__(e,t),o=(n=!1)?null:t.__k,i=[],s=[],Wr(t,e=t.__k=Ee(ke,null,[e]),o||Je,Je,t.namespaceURI,o?null:t.firstChild?wt.call(t.childNodes):null,i,o?o.__e:t.firstChild,n,s),ai(i,e,s)}function Qr(e,t){M.__h&&M.__h(F,e,qe||t),qe=0;var r=F.__H||(F.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Hr(e){return qe=1,tl(mi,e)}function tl(e,t,r){var n=Qr(Ge++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):mi(void 0,t),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=F,!F.__f)){var o=function(a,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,a,l,c);var u=n.__c.props!==a;return d.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(u=!0)}}),i&&i.call(this,a,l,c)||u};F.__f=!0;var i=F.shouldComponentUpdate,s=F.componentWillUpdate;F.componentWillUpdate=function(a,l,c){if(this.__e){var d=i;i=void 0,o(a,l,c),i=d}s&&s.call(this,a,l,c)},F.shouldComponentUpdate=o}return n.__N||n.__}function Ve(e,t){var r=Qr(Ge++,3);!M.__s&&pi(r.__H,t)&&(r.__=e,r.u=t,F.__H.__h.push(r))}function bt(e){return qe=5,di(function(){return{current:e}},[])}function di(e,t){var r=Qr(Ge++,7);return pi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ee(e,t){return qe=8,di(function(){return e},t)}function rl(){for(var e;e=ui.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gt),e.__H.__h.forEach(Kr),e.__H.__h=[]}catch(t){e.__H.__h=[],M.__e(t,e.__v)}}function nl(e){var t,r=function(){clearTimeout(n),Vo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Vo&&(t=requestAnimationFrame(r))}function gt(e){var t=F,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),F=t}function Kr(e){var t=F;e.__c=e.__(),F=t}function pi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function mi(e,t){return typeof t=="function"?t(e):t}function fi(e,t){for(var r in t)e[r]=t[r];return e}function Vr(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 Jo(e,t){this.props=e,this.context=t}function ol(e,t){function r(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Vr(this.props,o)}function n(o){return this.shouldComponentUpdate=r,Ee(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}function sl(e){function t(r){var n=fi({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=il,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function hi(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=fi({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return hi(n,t,r)})),e}function _i(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return _i(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 Fr(){this.__u=0,this.o=null,this.__b=null}function gi(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ht(){this.i=null,this.l=null}function fl(){}function hl(){return this.cancelBubble}function _l(){return this.defaultPrevented}function x(e,t,r,n,o,i){t||(t={});var s,a,l=t;if("ref"in l)for(a in l={},t)a=="ref"?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--vl,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return T.vnode&&T.vnode(c),c}function Il(a){var l=a,{elementTag:e="Image",src:t="",children:r,handleExposure:n,className:o,imgStyle:i}=l,s=Z(l,["elementTag","src","children","handleExposure","className","imgStyle"]);let c=Tl(()=>{t&&n()});return e==="Image"?x("div",{className:o,style:{borderRadius:"8px"},children:Ee("img",N(w({},s),{ref:c,src:t!=null?t:"",style:w({display:"block",width:"100%",height:"auto",objectFit:"contain",maxWidth:"100%",maxHeight:"100%",borderRadius:"8px"},i||{})}))}):x("div",N(w({},s),{ref:c,className:o,children:r}))}function xl(e,t){if(!e)return null;let r=Array.isArray(t)?t[0]:t,n=Array.isArray(t)?t[1]:0;return Array.isArray(e)?e.map((o,i)=>o&&typeof o=="object"&&"type"in o?Ee(o.type,N(w({},o.props),{style:N(w({},o.props.style||{}),{paddingLeft:r>0?`${r/2}px`:void 0,paddingRight:r>0?`${r/2}px`:void 0,paddingTop:n>0?`${n/2}px`:void 0,paddingBottom:n>0?`${n/2}px`:void 0}),key:o.key||i})):o):e&&typeof e=="object"&&"type"in e?Ee(e.type,N(w({},e.props),{style:N(w({},e.props.style||{}),{paddingLeft:r>0?`${r/2}px`:void 0,paddingRight:r>0?`${r/2}px`:void 0,paddingTop:n>0?`${n/2}px`:void 0,paddingBottom:n>0?`${n/2}px`:void 0})})):e}var wt,T,Zo,we,Oo,ei,ti,ri,Gr,Mr,Br,Je,ni,Qa,We,Ge,F,Lr,Fo,qe,ui,M,jo,Mo,Bo,$o,Ho,Ko,Vo,Go,il,al,qo,Wo,ll,cl,ul,dl,pl,ml,zo,gl,Qo,Yo,Xo,vl,jr,yl,bl,wl,El,kl,Sl,Tl,vi,yi,Rl,Al,Cl,Pl,Jr,Nl,bi,wi=k(()=>{"use strict";Je={},ni=[],Qa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,We=Array.isArray;wt=ni.slice,T={__e:function(e,t,r,n){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Zo=0,de.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ue({},this.state),typeof e=="function"&&(e=e(ue({},r),this.props)),e&&ue(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Do(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Do(this))},de.prototype.render=ke,we=[],ei=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ti=function(e,t){return e.__v.__b-t.__v.__b},vt.__r=0,ri=/(PointerCapture)$|Capture$/i,Gr=0,Mr=Lo(!1),Br=Lo(!0);qe=0,ui=[],M=T,jo=M.__b,Mo=M.__r,Bo=M.diffed,$o=M.__c,Ho=M.unmount,Ko=M.__;M.__b=function(e){F=null,jo&&jo(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ko&&Ko(e,t)},M.__r=function(e){Mo&&Mo(e),Ge=0;var t=(F=e.__c).__H;t&&(Lr===F?(t.__h=[],F.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(gt),t.__h.forEach(Kr),t.__h=[],Ge=0)),Lr=F},M.diffed=function(e){Bo&&Bo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ui.push(t)!==1&&Fo===M.requestAnimationFrame||((Fo=M.requestAnimationFrame)||nl)(rl)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Lr=F=null},M.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gt),r.__h=r.__h.filter(function(n){return!n.__||Kr(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],M.__e(n,r.__v)}}),$o&&$o(e,t)},M.unmount=function(e){Ho&&Ho(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gt(n)}catch(o){t=o}}),r.__H=void 0,t&&M.__e(t,r.__v))};Vo=typeof requestAnimationFrame=="function";(Jo.prototype=new de).isPureReactComponent=!0,Jo.prototype.shouldComponentUpdate=function(e,t){return Vr(this.props,e)||Vr(this.state,t)};Go=T.__b;T.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Go&&Go(e)};il=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;al=T.__e;T.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}al(e,t,r,n)};qo=T.unmount;T.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qo&&qo(e)},(Fr.prototype=new de).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=gi(n.__v),i=!1,s=function(){i||(i=!0,r.__R=null,o?o(a):a())};r.__R=s;var a=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=_i(l,l.__c.__P,l.__c.__O)}var c;for(n.setState({__a:n.__b=null});c=n.o.pop();)c.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},Fr.prototype.componentWillUnmount=function(){this.o=[]},Fr.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]=hi(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&Ee(ke,null,e.fallback);return o&&(o.__u&=-33),[Ee(ke,null,t.__a?null:e.children),o]};Wo=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]}};(ht.prototype=new de).__a=function(e){var t=this,r=gi(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Wo(t,e,n)):o()};r?r(i):i()}},ht.prototype.render=function(e){this.i=null,this.l=new Map;var t=yt(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},ht.prototype.componentDidUpdate=ht.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Wo(e,r,t)})};ll=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,cl=/^(?: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]/,ul=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,dl=/[A-Z0-9]/g,pl=typeof document<"u",ml=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};de.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(de.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});zo=T.event;T.event=function(e){return zo&&(e=zo(e)),e.persist=fl,e.isPropagationStopped=hl,e.isDefaultPrevented=_l,e.nativeEvent=e};gl={enumerable:!1,configurable:!0,get:function(){return this.class}},Qo=T.vnode;T.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")===-1;for(var s in r){var a=r[s];if(!(s==="value"&&"defaultValue"in r&&a==null||pl&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||ml(r.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":ul.test(s)&&(s=l):l=s="oninput":i&&cl.test(s)?s=s.replace(dl,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&o[s=l]&&(s="oninputCapture"),o[s]=a}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=yt(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=yt(r.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",gl)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=ll,Qo&&Qo(e)};Yo=T.__r;T.__r=function(e){Yo&&Yo(e),e.__c};Xo=T.diffed;T.diffed=function(e){Xo&&Xo(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)};vl=0;jr={drawerBackdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"flex-end",zIndex:1e3,overflow:"hidden",touchAction:"none"},drawer:{backgroundColor:"white",borderRadius:"16px 16px 0 0",width:"100%",maxWidth:"100%",overflowY:"auto",position:"relative",boxShadow:"0 -2px 10px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",margin:"0 auto"},drawerContent:{flex:1,width:"100%",height:"100%",overflow:"auto",margin:"0 auto"}},yl=`
|
|
19
|
+
`;e.textContent=i;let s=document.head||document.getElementsByTagName("head")[0];s.insertBefore(e,s.firstChild),document.documentElement.setAttribute("data-jolibox-root","")},n=()=>{function i(a){return E(this,null,function*(){let l=a instanceof URL?a.href:a,c=new Promise((d,u)=>{let p=new XMLHttpRequest;p.open("GET",l),p.responseType="arraybuffer",p.addEventListener("load",()=>d(p.response)),p.addEventListener("error",u),p.send()});try{let d=yield c;return new Response(d,{headers:new Headers([["Content-Type","application/wasm"]])}).clone()}catch(d){throw console.error("Failed to load wasm:",d),d}})}let s=window.fetch;window.fetch=(a,l)=>{let c=a instanceof URL?a.href:a.toString();return c.endsWith(".wasm")?i(c):s(a,l)}},o=()=>{e!=null&&e.parentNode&&(e.parentNode.removeChild(e),e=null),document.documentElement.removeAttribute("data-jolibox-root"),window.fetch=t};return r(),n(),o}var Ao=k(()=>{"use strict"});var ut,Co=k(()=>{"use strict";ut=class{constructor(t){this.track=t;this.adBreakIsShowing=!1;this.reportPageJumpOut=()=>{this.track("AdBreakJumpOut",{context:"AdsActionDetection"})};this.reportPageHide=()=>{this.track("AdBreakHide",{context:"AdsActionDetection"})};window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}}});var dt,Ga,qa,Wa,za,Po=k(()=>{"use strict";dt=class{constructor(t,r,n,o){this.track=t;this.httpClient=r;this.checkNetwork=n;this.checkAdsDisplayPermission=t=>{if(!this.checkNetwork())return{reason:"NETWORK_NOT_OK"};let r=this.checkShouldBanInitial();if(r)return{reason:r};let n=this.checkShouldBanForSession(t);if(n)return{reason:n};let o=this.checkShouldBanHighFreq(t);if(o)return o;let i=this.checkShouldBanForTime(t);return i?{reason:i}:{reason:"ALLOWED"}};var p,m,g,b,h,_,v;let i=(p=o==null?void 0:o.maxAllowedAdsForTime)!=null?p:8,s=(m=o==null?void 0:o.banForTimeThreshold)!=null?m:6e4,a=(g=o==null?void 0:o.bannedReleaseTime)!=null?g:6e4,l=(b=o==null?void 0:o.maxAllowedAdsForSession)!=null?b:200,c=(h=o==null?void 0:o.banForSessionThreshold)!=null?h:6e5,d=(_=o==null?void 0:o.initialThreshold)!=null?_:2e3,u=(v=o==null?void 0:o.highFreqThreshold)!=null?v:2e3;this.checkShouldBanInitial=Wa(d),this.checkShouldBanHighFreq=za(u),this.checkShouldBanForTime=qa(i,s,a),this.checkShouldBanForSession=Ga(l,c)}report(t,r){let n=r?{reason:t,count:r}:{reason:t};this.track("PreventAdsCheating",n),this.httpClient.post("/api/base/app-event",{data:{eventType:"PREVENT_ADS_CHEATING",adsInfo:n}})}},Ga=(e,t)=>{let r=!1,n=[];return i=>{if(r)return"BANNED_FOR_SESSION";let s=Date.now();if(n=n.concat({timestamp:s,type:i}),n.length!==1&&(n.length>e&&(n=n.slice(-e)),n.length===e&&s-n[0].timestamp<=t))return r=!0,"BANNED_FOR_SESSION"}},qa=(e,t,r)=>{let n=null,o=d=>{n&&(window.clearTimeout(n),n=null),n=window.setTimeout(()=>{l.value=!1,n=null},d)},i="jolibox-sdk-ads-callbreak-timestamps",s="jolibox-sdk-ads-ban-for-time",a={_records:[],init(){var d;try{let u=JSON.parse((d=window.__joliboxLocalStorage__.getItem(i))!=null?d:"[]");Array.isArray(u)?this._records=u:this._records=[]}catch(u){this._records=[]}},get values(){return this._records},set values(d){try{window.__joliboxLocalStorage__.setItem(i,JSON.stringify(d))}catch(u){}this._records=d}},l={_record:!1,init(){var d;try{let u=JSON.parse((d=window.__joliboxLocalStorage__.getItem(s))!=null?d:"false");typeof u=="boolean"&&(this._record=u)}catch(u){this._record=!1}if(this._record){let u=a.values[a.values.length-1],p=u?Date.now()-u.timestamp:r;p<=r&&p>0?o(p):this._record=!1}},get value(){return this._record},set value(d){try{window.__joliboxLocalStorage__.setItem(s,JSON.stringify(d))}catch(u){}this._record=d}};return a.init(),l.init(),d=>{if(l.value)return"WAITING_BANNED_RELEASE";let u=Date.now();if(a.values=a.values.concat({timestamp:u,type:d}),a.values.length!==1&&(a.values.length>e&&(a.values=a.values.slice(-e)),a.values.length===e&&u-a.values[0].timestamp<=t))return l.value=!0,o(r),"BANNED_FOR_TIME"}},Wa=e=>{let t=Date.now();return()=>{if(Date.now()-t<=e)return"BLOCK_INITIAL"}},za=(e=2e3)=>{let t=0,r=null;return o=>{if(o==="reward"){if(r)return t+=1,{reason:"HOLDING_HIGH_FREQ",info:{count:t}};r=window.setTimeout(()=>{r&&(window.clearTimeout(r),r=0,t=0)},e)}}}});var pt,No=k(()=>{"use strict";J();pt=class{constructor(t){this.httpClient=t;this.configs=null;this.firstRun=!0;this.init()}init(){return E(this,null,function*(){try{this.configs=yield this.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config")}catch(t){}})}shouldBypassCallingInterstitial(){var r,n;let t;if(!this.configs)this.init(),t=!this.firstRun;else{let o=(r=y.channel)!=null?r:"",i=this.configs[o],s=(n=i==null?void 0:i.interstitialRate)!=null?n:1;t=Math.random()<s}return this.firstRun=!1,t}}});var Re,mt,Lr=k(()=>{"use strict";Co();Po();J();No();P();Re=new he,mt=class{constructor(t,r,n){this.track=t;this.httpClient=r;this.checkNetwork=n;this.configured=!1;this.config={};this.getGameId=()=>y.mpId;this.getTestAdsMode=()=>y.testAdsMode;this.asyncLoad=()=>E(this,null,function*(){var s,a,l,c,d;let t="ca-pub-7171363994453626",r,n,o=window.encodeURIComponent(window.btoa((s=this.getGameId())!=null?s:"")),i=(a=this.getTestAdsMode())!=null?a:!1;try{let u=yield this.httpClient.get("/public/ads",{query:{objectId:o,testAdsMode:`${i}`}});t=(l=u.data)==null?void 0:l.clientId,r=(c=u.data)==null?void 0:c.channelId,n=(d=u.data)==null?void 0:d.unitId}catch(u){console.error("Failed to fetch client info",u)}this.clientId=t,this.channelId=r,this.unitId=n});this.asyncInit=t=>E(this,null,function*(){var o;if(typeof window=="undefined")return;yield this.asyncLoad();let r="google-adsense",n=(o=this.getTestAdsMode())!=null?o:!1;if(!document.getElementById(r)&&this.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.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.channelId&&i.setAttribute("data-ad-channel",this.channelId),document.head.appendChild(i),this.track("LoadAdsenseCompleted",null)}});this.push=(t={})=>{window.adsbygoogle.push(t)};this.wrapAdBreakParams=t=>{let r=!1,n=t.adBreakDone,o=s=>{var a;r=!0,this.adsActionDetection.adBreakIsShowing=!1,this.track("CallAdBreakDone",{breakType:s.breakType,breakName:(a=s.breakName)!=null?a:"",breakFormat:s.breakFormat,breakStatus:s.breakStatus}),n&&n(s)};if(t.adBreakDone=o,t.type==="reward"){let s=t.beforeReward,a=c=>()=>{this.track("CallShowAdFn",null),c()},l=c=>{r=!0,s&&s(a(c))};t.beforeReward=l,window.setTimeout(()=>{var c,d;r||(this.track("CallAdBreakTimeout",{type:t.type}),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:(c=t.name)!=null?c:"",breakFormat:"reward",breakStatus:"timeout"}))},1e4)}if((s=>s.type==="preroll")(t)){Re.emit("isAdShowing",!0);let s=t.adBreakDone,a=l=>{Re.emit("isAdShowing",!1),s&&s(l)};return N(w({},t),{adBreakDone:a})}else{let s=t.beforeAd,a=t.afterAd,l=()=>{var d;r=!0,Re.emit("isAdShowing",!0),this.track("CallBeforeAd",{type:t.type,name:(d=t.name)!=null?d:""}),s&&s()},c=()=>{var d;r=!0,Re.emit("isAdShowing",!1),this.track("CallAfterAd",{type:t.type,name:(d=t.name)!=null?d:""}),a&&a()};return N(w({},t),{beforeAd:l,afterAd:c})}};this.adConfig=t=>{let o=t,{onReady:r}=o,n=Z(o,["onReady"]);this.track("CallAdConfig",n),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(t))};this.adBreak=t=>{var a,l,c,d,u,p;if(!this.getGameId()){console.warn("Game ID is not set, skip calling adBreak");return}if(t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}let{reason:r,info:n}=this.antiCheating.checkAdsDisplayPermission(t.type==="reward"?"reward":"interstitial");switch(r){case"NETWORK_NOT_OK":case"BANNED_FOR_SESSION":(l=t.adBreakDone)==null||l.call(t,{breakType:t.type,breakName:r,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"}),this.antiCheating.report(r);return;case"BLOCK_INITIAL":case"BANNED_FOR_TIME":case"WAITING_BANNED_RELEASE":(c=t.adBreakDone)==null||c.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"}),this.antiCheating.report(r);return;case"HOLDING_HIGH_FREQ":(u=t.adBreakDone)==null||u.call(t,{breakFormat:t.type==="reward"?"reward":"interstitial",breakName:"",breakStatus:((d=n==null?void 0:n.count)!=null?d:0)>6?"other":"frequencyCapped",breakType:t.type}),n!=null&&n.count&&n.count!==0&&n.count%3===0&&this.antiCheating.report(r,n==null?void 0:n.count);return;default:break}let o=t.type,i;switch(o){case"preroll":i={type:o};break;case"start":case"pause":case"next":case"browse":case"reward":i={type:o,name:(p=t.name)!=null?p:""};break}this.adsActionDetection.adBreakIsShowing=!0,this.track("CallAdBreak",i);let s=this.wrapAdBreakParams(t);this.push(s),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")};this.adUnit=t=>E(this,null,function*(){var p,m,g,b;if(this.track("CallAdUnit",{adFormat:(m=(p=t.adFormat)==null?void 0:p.toString())!=null?m:null,fullWidthResponsive:(g=t.fullWidthResponsive)!=null?g:null}),this.clientId||(yield this.asyncLoad()),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:r,slot:n,adFormat:o,fullWidthResponsive:i,style:s}=t,a;if(!r)throw new Error("targeting element is required");if(typeof r=="string"?a=document.querySelector(r):a=r,!a)throw new Error("targeting element not found");let l=n;if(l||(l=this.unitId),!l)throw new Error("slot is required");let c=typeof o=="object"&&Array.isArray(o)?o.join(", "):o,d=document.createElement("ins");if(d.className="adsbygoogle",d.id="jolibox-ads",d.style.display="block",d.setAttribute("data-ad-client",this.clientId),d.setAttribute("data-ad-slot",l),c&&d.setAttribute("data-ad-format",c),i&&d.setAttribute("data-full-width-responsive",i),s&&d.setAttribute("style",s),(b=this.getTestAdsMode())!=null?b:!1){let h=document.createElement("div");h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.backgroundColor="rgba(0, 0, 0, 0.5)",h.style.color="white",h.innerHTML="Test Ad",d.style.position="relative",a.appendChild(d),d.appendChild(h)}else a.appendChild(d),new MutationObserver(_=>{_.forEach(v=>{if(v.type==="attributes"&&v.attributeName==="data-ad-status"){let S=d.getAttribute("data-ad-status");this.track("AdSenseUnitStatusChanged",{status:S!=null?S:"null"})}})}).observe(d,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})});this.antiCheating=new dt(t,r,n),this.adsActionDetection=new ut(this.track),this.channelPolicy=new pt(r)}init(t){this.track("CallAdsInit",null),typeof window!="undefined"&&(this.config=t!=null?t:{},window.adsbygoogle=window.adsbygoogle||[],this.asyncInit(t))}}});function ue(e,t){for(var r in t)e[r]=t[r];return e}function qr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ee(e,t,r){var n,o,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?wt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return _t(e,s,n,o,null)}function _t(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o!=null?o:++Zo,__i:-1,__u:0};return o==null&&T.vnode!=null&&T.vnode(i),i}function ke(e){return e.children}function de(e,t){this.props=e,this.context=t}function Ae(e,t){if(t==null)return e.__?Ae(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"?Ae(e):null}function oi(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 oi(e)}}function Do(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!vt.__r++||Oo!==T.debounceRendering)&&((Oo=T.debounceRendering)||ei)(vt)}function vt(){for(var e,t,r,n,o,i,s,a=1;we.length;)we.length>a&&we.sort(ti),e=we.shift(),a=we.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,i=[],s=[],t.__P&&((r=ue({},n)).__v=n.__v+1,T.vnode&&T.vnode(r),Wr(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,i,o!=null?o:Ae(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,ai(i,r,s),r.__e!=o&&oi(r)));vt.__r=0}function ii(e,t,r,n,o,i,s,a,l,c,d){var u,p,m,g,b,h,_=n&&n.__k||ni,v=t.length;for(l=Ya(r,t,_,l,v),u=0;u<v;u++)(m=r.__k[u])!=null&&(p=m.__i===-1?Je:_[m.__i]||Je,m.__i=u,h=Wr(e,m,p,o,i,s,a,l,c,d),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&zr(p.ref,null,m),d.push(m.ref,m.__c||g,m)),b==null&&g!=null&&(b=g),4&m.__u||p.__k===m.__k?l=si(m,l,e):typeof m.type=="function"&&h!==void 0?l=h:g&&(l=g.nextSibling),m.__u&=-7);return r.__e=b,l}function Ya(e,t,r,n,o){var i,s,a,l,c,d=r.length,u=d,p=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=i+p,(s=e.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?_t(null,s,null,null,null):We(s)?_t(ke,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?_t(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(c=s.__i=Xa(s,r,l,u))!==-1&&(u--,(a=r[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&(o>d?p--:o<d&&p++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?p--:c==l+1?p++:(c>l?p--:p++,s.__u|=4))):e.__k[i]=null;if(u)for(i=0;i<d;i++)(a=r[i])!=null&&!(2&a.__u)&&(a.__e==n&&(n=Ae(a)),ci(a,a));return n}function si(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=si(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Ae(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function yt(e,t){return t=t||[],e==null||typeof e=="boolean"||(We(e)?e.some(function(r){yt(r,t)}):t.push(e)),t}function Xa(e,t,r,n){var o,i,s=e.key,a=e.type,l=t[r];if(l===null&&e.key==null||l&&s==l.key&&a===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;){if(o>=0){if((l=t[o])&&!(2&l.__u)&&s==l.key&&a===l.type)return o;o--}if(i<t.length){if((l=t[i])&&!(2&l.__u)&&s==l.key&&a===l.type)return i;i++}}return-1}function Lo(e,t,r){t[0]=="-"?e.setProperty(t,r!=null?r:""):e[t]=r==null?"":typeof r!="number"||Qa.test(t)?r:r+"px"}function ft(e,t,r,n,o){var i;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||Lo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Lo(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ri,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.t=n.t:(r.t=Gr,e.addEventListener(t,i?Br:Mr,i)):e.removeEventListener(t,i?Br:Mr,i);else{if(o=="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(s){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Uo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Gr++;else if(t.u<r.t)return;return r(T.event?T.event(t):t)}}}function Wr(e,t,r,n,o,i,s,a,l,c){var d,u,p,m,g,b,h,_,v,S,R,A,C,H,z,se,Te,X=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=t.__e=r.__e]),(d=T.__b)&&d(t);e:if(typeof X=="function")try{if(_=t.props,v="prototype"in X&&X.prototype.render,S=(d=X.contextType)&&n[d.__c],R=d?S?S.props.value:d.__:n,r.__c?h=(u=t.__c=r.__c).__=u.__E:(v?t.__c=u=new X(_,R):(t.__c=u=new de(_,R),u.constructor=X,u.render=el),S&&S.sub(u),u.props=_,u.state||(u.state={}),u.context=R,u.__n=n,p=u.__d=!0,u.__h=[],u._sb=[]),v&&u.__s==null&&(u.__s=u.state),v&&X.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ue({},u.__s)),ue(u.__s,X.getDerivedStateFromProps(_,u.__s))),m=u.props,g=u.state,u.__v=t,p)v&&X.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),v&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(v&&X.getDerivedStateFromProps==null&&_!==m&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(_,R),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(_,u.__s,R)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ve){ve&&(ve.__=t)}),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(_,u.__s,R),v&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(m,g,b)})}if(u.context=R,u.props=_,u.__P=e,u.__e=!1,C=T.__r,H=0,v){for(u.state=u.__s,u.__d=!1,C&&C(t),d=u.render(u.props,u.state,u.context),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[]}else do u.__d=!1,C&&C(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++H<25);u.state=u.__s,u.getChildContext!=null&&(n=ue(ue({},n),u.getChildContext())),v&&!p&&u.getSnapshotBeforeUpdate!=null&&(b=u.getSnapshotBeforeUpdate(m,g)),se=d,d!=null&&d.type===ke&&d.key==null&&(se=li(d.props.children)),a=ii(e,We(se)?se:[se],t,r,n,o,i,s,a,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),h&&(u.__E=u.__=null)}catch(ve){if(t.__v=null,l||i!=null)if(ve.then){for(t.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else for(Te=i.length;Te--;)qr(i[Te]);else t.__e=r.__e,t.__k=r.__k;T.__e(ve,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Za(r.__e,t,r,n,o,i,s,l,c);return(d=T.diffed)&&d(t),128&t.__u?void 0:a}function ai(e,t,r){for(var n=0;n<r.length;n++)zr(r[n],r[++n],r[++n]);T.__c&&T.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){T.__e(i,o.__v)}})}function li(e){return typeof e!="object"||e==null?e:We(e)?e.map(li):ue({},e)}function Za(e,t,r,n,o,i,s,a,l){var c,d,u,p,m,g,b,h=r.props,_=t.props,v=t.type;if(v=="svg"?o="http://www.w3.org/2000/svg":v=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((m=i[c])&&"setAttribute"in m==!!v&&(v?m.localName==v:m.nodeType==3)){e=m,i[c]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(o,v,_.is&&_),a&&(T.__m&&T.__m(t,i),a=!1),i=null}if(v===null)h===_||a&&e.data===_||(e.data=_);else{if(i=i&&wt.call(e.childNodes),h=r.props||Je,!a&&i!=null)for(h={},c=0;c<e.attributes.length;c++)h[(m=e.attributes[c]).name]=m.value;for(c in h)if(m=h[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=m;else if(!(c in _)){if(c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _)continue;ft(e,c,null,m,o)}}for(c in _)m=_[c],c=="children"?p=m:c=="dangerouslySetInnerHTML"?d=m:c=="value"?g=m:c=="checked"?b=m:a&&typeof m!="function"||h[c]===m||ft(e,c,m,h[c],o);if(d)a||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),ii(t.type==="template"?e.content:e,We(p)?p:[p],t,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:r.__k&&Ae(r,0),a,l),i!=null)for(c=i.length;c--;)qr(i[c]);a||(c="value",v=="progress"&&g==null?e.removeAttribute("value"):g!==void 0&&(g!==e[c]||v=="progress"&&!g||v=="option"&&g!==h[c])&&ft(e,c,g,h[c],o),c="checked",b!==void 0&&b!==e[c]&&ft(e,c,b,h[c],o))}return e}function zr(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(o){T.__e(o,r)}}function ci(e,t,r){var n,o;if(T.unmount&&T.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||zr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){T.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&ci(n[o],t,r||typeof e.type!="function");r||qr(e.__e),e.__c=e.__=e.__e=void 0}function el(e,t,r){return this.constructor(e,r)}function $r(e,t,r){var n,o,i,s;t==document&&(t=document.documentElement),T.__&&T.__(e,t),o=(n=!1)?null:t.__k,i=[],s=[],Wr(t,e=t.__k=Ee(ke,null,[e]),o||Je,Je,t.namespaceURI,o?null:t.firstChild?wt.call(t.childNodes):null,i,o?o.__e:t.firstChild,n,s),ai(i,e,s)}function Qr(e,t){M.__h&&M.__h(F,e,qe||t),qe=0;var r=F.__H||(F.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Hr(e){return qe=1,tl(mi,e)}function tl(e,t,r){var n=Qr(Ge++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):mi(void 0,t),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=F,!F.__f)){var o=function(a,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,a,l,c);var u=n.__c.props!==a;return d.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(u=!0)}}),i&&i.call(this,a,l,c)||u};F.__f=!0;var i=F.shouldComponentUpdate,s=F.componentWillUpdate;F.componentWillUpdate=function(a,l,c){if(this.__e){var d=i;i=void 0,o(a,l,c),i=d}s&&s.call(this,a,l,c)},F.shouldComponentUpdate=o}return n.__N||n.__}function Ve(e,t){var r=Qr(Ge++,3);!M.__s&&pi(r.__H,t)&&(r.__=e,r.u=t,F.__H.__h.push(r))}function bt(e){return qe=5,di(function(){return{current:e}},[])}function di(e,t){var r=Qr(Ge++,7);return pi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ee(e,t){return qe=8,di(function(){return e},t)}function rl(){for(var e;e=ui.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gt),e.__H.__h.forEach(Kr),e.__H.__h=[]}catch(t){e.__H.__h=[],M.__e(t,e.__v)}}function nl(e){var t,r=function(){clearTimeout(n),Vo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Vo&&(t=requestAnimationFrame(r))}function gt(e){var t=F,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),F=t}function Kr(e){var t=F;e.__c=e.__(),F=t}function pi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function mi(e,t){return typeof t=="function"?t(e):t}function fi(e,t){for(var r in t)e[r]=t[r];return e}function Vr(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 Jo(e,t){this.props=e,this.context=t}function ol(e,t){function r(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Vr(this.props,o)}function n(o){return this.shouldComponentUpdate=r,Ee(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}function sl(e){function t(r){var n=fi({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=il,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function hi(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=fi({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return hi(n,t,r)})),e}function _i(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return _i(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 Fr(){this.__u=0,this.o=null,this.__b=null}function gi(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ht(){this.i=null,this.l=null}function fl(){}function hl(){return this.cancelBubble}function _l(){return this.defaultPrevented}function I(e,t,r,n,o,i){t||(t={});var s,a,l=t;if("ref"in l)for(a in l={},t)a=="ref"?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--vl,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return T.vnode&&T.vnode(c),c}function xl(a){var l=a,{elementTag:e="Image",src:t="",children:r,handleExposure:n,className:o,imgStyle:i}=l,s=Z(l,["elementTag","src","children","handleExposure","className","imgStyle"]);let c=Tl(()=>{t&&n()});return e==="Image"?I("div",{className:o,style:{borderRadius:"8px"},children:Ee("img",N(w({},s),{ref:c,src:t!=null?t:"",style:w({display:"block",width:"100%",height:"auto",objectFit:"contain",maxWidth:"100%",maxHeight:"100%",borderRadius:"8px"},i||{})}))}):I("div",N(w({},s),{ref:c,className:o,children:r}))}function Il(e,t){if(!e)return null;let r=Array.isArray(t)?t[0]:t,n=Array.isArray(t)?t[1]:0;return Array.isArray(e)?e.map((o,i)=>o&&typeof o=="object"&&"type"in o?Ee(o.type,N(w({},o.props),{style:N(w({},o.props.style||{}),{paddingLeft:r>0?`${r/2}px`:void 0,paddingRight:r>0?`${r/2}px`:void 0,paddingTop:n>0?`${n/2}px`:void 0,paddingBottom:n>0?`${n/2}px`:void 0}),key:o.key||i})):o):e&&typeof e=="object"&&"type"in e?Ee(e.type,N(w({},e.props),{style:N(w({},e.props.style||{}),{paddingLeft:r>0?`${r/2}px`:void 0,paddingRight:r>0?`${r/2}px`:void 0,paddingTop:n>0?`${n/2}px`:void 0,paddingBottom:n>0?`${n/2}px`:void 0})})):e}var wt,T,Zo,we,Oo,ei,ti,ri,Gr,Mr,Br,Je,ni,Qa,We,Ge,F,Ur,Fo,qe,ui,M,jo,Mo,Bo,$o,Ho,Ko,Vo,Go,il,al,qo,Wo,ll,cl,ul,dl,pl,ml,zo,gl,Qo,Yo,Xo,vl,jr,yl,bl,wl,El,kl,Sl,Tl,vi,yi,Rl,Al,Cl,Pl,Jr,Nl,bi,wi=k(()=>{"use strict";Je={},ni=[],Qa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,We=Array.isArray;wt=ni.slice,T={__e:function(e,t,r,n){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Zo=0,de.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ue({},this.state),typeof e=="function"&&(e=e(ue({},r),this.props)),e&&ue(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Do(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Do(this))},de.prototype.render=ke,we=[],ei=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ti=function(e,t){return e.__v.__b-t.__v.__b},vt.__r=0,ri=/(PointerCapture)$|Capture$/i,Gr=0,Mr=Uo(!1),Br=Uo(!0);qe=0,ui=[],M=T,jo=M.__b,Mo=M.__r,Bo=M.diffed,$o=M.__c,Ho=M.unmount,Ko=M.__;M.__b=function(e){F=null,jo&&jo(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ko&&Ko(e,t)},M.__r=function(e){Mo&&Mo(e),Ge=0;var t=(F=e.__c).__H;t&&(Ur===F?(t.__h=[],F.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(gt),t.__h.forEach(Kr),t.__h=[],Ge=0)),Ur=F},M.diffed=function(e){Bo&&Bo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ui.push(t)!==1&&Fo===M.requestAnimationFrame||((Fo=M.requestAnimationFrame)||nl)(rl)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ur=F=null},M.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gt),r.__h=r.__h.filter(function(n){return!n.__||Kr(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],M.__e(n,r.__v)}}),$o&&$o(e,t)},M.unmount=function(e){Ho&&Ho(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gt(n)}catch(o){t=o}}),r.__H=void 0,t&&M.__e(t,r.__v))};Vo=typeof requestAnimationFrame=="function";(Jo.prototype=new de).isPureReactComponent=!0,Jo.prototype.shouldComponentUpdate=function(e,t){return Vr(this.props,e)||Vr(this.state,t)};Go=T.__b;T.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Go&&Go(e)};il=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;al=T.__e;T.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}al(e,t,r,n)};qo=T.unmount;T.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qo&&qo(e)},(Fr.prototype=new de).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=gi(n.__v),i=!1,s=function(){i||(i=!0,r.__R=null,o?o(a):a())};r.__R=s;var a=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=_i(l,l.__c.__P,l.__c.__O)}var c;for(n.setState({__a:n.__b=null});c=n.o.pop();)c.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},Fr.prototype.componentWillUnmount=function(){this.o=[]},Fr.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]=hi(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&Ee(ke,null,e.fallback);return o&&(o.__u&=-33),[Ee(ke,null,t.__a?null:e.children),o]};Wo=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]}};(ht.prototype=new de).__a=function(e){var t=this,r=gi(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Wo(t,e,n)):o()};r?r(i):i()}},ht.prototype.render=function(e){this.i=null,this.l=new Map;var t=yt(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},ht.prototype.componentDidUpdate=ht.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Wo(e,r,t)})};ll=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,cl=/^(?: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]/,ul=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,dl=/[A-Z0-9]/g,pl=typeof document<"u",ml=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};de.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(de.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});zo=T.event;T.event=function(e){return zo&&(e=zo(e)),e.persist=fl,e.isPropagationStopped=hl,e.isDefaultPrevented=_l,e.nativeEvent=e};gl={enumerable:!1,configurable:!0,get:function(){return this.class}},Qo=T.vnode;T.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")===-1;for(var s in r){var a=r[s];if(!(s==="value"&&"defaultValue"in r&&a==null||pl&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||ml(r.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":ul.test(s)&&(s=l):l=s="oninput":i&&cl.test(s)?s=s.replace(dl,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&o[s=l]&&(s="oninputCapture"),o[s]=a}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=yt(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=yt(r.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",gl)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=ll,Qo&&Qo(e)};Yo=T.__r;T.__r=function(e){Yo&&Yo(e),e.__c};Xo=T.diffed;T.diffed=function(e){Xo&&Xo(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)};vl=0;jr={drawerBackdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"flex-end",zIndex:1e3,overflow:"hidden",touchAction:"none"},drawer:{backgroundColor:"white",borderRadius:"16px 16px 0 0",width:"100%",maxWidth:"100%",overflowY:"auto",position:"relative",boxShadow:"0 -2px 10px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",margin:"0 auto"},drawerContent:{flex:1,width:"100%",height:"100%",overflow:"auto",margin:"0 auto"}},yl=`
|
|
20
20
|
@keyframes fadeIn {
|
|
21
21
|
from { opacity: 0; }
|
|
22
22
|
to { opacity: 1; }
|
|
@@ -52,7 +52,7 @@ var ts=Object.create;var Ye=Object.defineProperty,rs=Object.defineProperties,ns=
|
|
|
52
52
|
.drawer-leave {
|
|
53
53
|
animation: slideDown 0.3s ease forwards;
|
|
54
54
|
}
|
|
55
|
-
`,bl=({children:e,isOpen:t=!1,onClose:r,height:n="50%",className:o="",backdropColor:i},s)=>{let[a,l]=Hr(t),[c,d]=Hr(null),u=bt(null),p=bt(!1);Ve(()=>{let C=document.createElement("style");return C.innerHTML=yl,document.head.appendChild(C),()=>{document.head.removeChild(C)}},[]),Ve(()=>{t!==a&&!p.current&&(l(t),d(t?"enter":"leave"))},[t,a]);let m=ee(()=>{c==="leave"&&(d(null),l(!1),p.current=!1)},[c]),g=ee(C=>{C.preventDefault(),C.stopPropagation(),C.target===u.current&&h()},[]),b=ee(()=>{p.current=!1,l(!0),d("enter")},[]),h=ee(()=>{p.current=!0,d("leave"),r&&r()},[r]),_=ee(()=>a&&!p.current,[a]);if(Ve(()=>{if(s){let C={show:b,hide:h,isOpen:_};typeof s=="function"?s(C):s&&(s.current=C)}},[b,h,_,s]),!a&&!c)return null;let v=N(w({},jr.drawer),{height:typeof n=="number"?`${n}px`:n,backgroundColor:i||"rgba(255, 255, 255, 1)"}),S=w({},jr.drawerBackdrop),R=c?`drawer-${c}`:"",A=c?`backdrop-${c}`:"";return
|
|
55
|
+
`,bl=({children:e,isOpen:t=!1,onClose:r,height:n="50%",className:o="",backdropColor:i},s)=>{let[a,l]=Hr(t),[c,d]=Hr(null),u=bt(null),p=bt(!1);Ve(()=>{let C=document.createElement("style");return C.innerHTML=yl,document.head.appendChild(C),()=>{document.head.removeChild(C)}},[]),Ve(()=>{t!==a&&!p.current&&(l(t),d(t?"enter":"leave"))},[t,a]);let m=ee(()=>{c==="leave"&&(d(null),l(!1),p.current=!1)},[c]),g=ee(C=>{C.preventDefault(),C.stopPropagation(),C.target===u.current&&h()},[]),b=ee(()=>{p.current=!1,l(!0),d("enter")},[]),h=ee(()=>{p.current=!0,d("leave"),r&&r()},[r]),_=ee(()=>a&&!p.current,[a]);if(Ve(()=>{if(s){let C={show:b,hide:h,isOpen:_};typeof s=="function"?s(C):s&&(s.current=C)}},[b,h,_,s]),!a&&!c)return null;let v=N(w({},jr.drawer),{height:typeof n=="number"?`${n}px`:n,backgroundColor:i||"rgba(255, 255, 255, 1)"}),S=w({},jr.drawerBackdrop),R=c?`drawer-${c}`:"",A=c?`backdrop-${c}`:"";return I("div",{ref:u,style:S,className:A,onClick:g,onTouchMove:C=>C.preventDefault(),children:I("div",{style:v,className:`${R} ${o}`,onAnimationEnd:m,onTouchMove:C=>C.stopPropagation(),children:I("div",{style:jr.drawerContent,children:e})})})},wl=sl(bl),El=({title:e,content:t,noHeader:r,padding:n="16px",footerButtons:o,onClose:i})=>{let s={container:{display:"flex",flexDirection:"column",height:"100%",width:"100%",maxWidth:"440px",margin:"0 auto"},header:{padding:"16px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"},content:{padding:n,flex:1,overflow:"auto"},footer:{padding:"16px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"8px"},closeButton:{background:"none",border:"none",cursor:"pointer",fontSize:"20px"},button:{padding:"8px 16px",borderRadius:"4px",border:"1px solid #ddd",cursor:"pointer"}};return I("div",{style:s.container,children:[!r&&I("div",{style:s.header,children:[I("h3",{children:e}),I("button",{style:s.closeButton,onClick:i,children:"\xD7"})]}),I("div",{style:s.content,children:t}),o&&o.length>0&&I("div",{style:s.footer,children:o.map((a,l)=>I("button",{style:N(w({},s.button),{backgroundColor:a.variant==="primary"?"#1677ff":"#fff",color:a.variant==="primary"?"#fff":"#333"}),onClick:c=>{var d;return(d=a.onClick)==null?void 0:d.call(a,c,{hide:i})},children:a.text},l))})]})},kl=(()=>{let e=null;return()=>(e||(e=document.createElement("div"),e.id=`jolibox-ui-modal-container-${Math.random().toString(36).substring(2,15)}`,document.body.appendChild(e)),e)})(),Sl=e=>{let t=kl(),r=null,n=!1,o=!1,i=()=>{o||(n=!1,e.onClose&&e.onClose(),a())},s=()=>window.innerWidth>window.innerHeight,a=()=>{$r(I(wl,{ref:c=>{r=c},isOpen:n,onClose:i,height:s()?"90vh":"50vh",backdropColor:e.backdropColor,children:I(El,N(w({},e),{onClose:i}))}),t)},l=()=>{!o&&n&&a()};return window.addEventListener("resize",l),a(),{show:()=>{o||(n=!0,a(),setTimeout(()=>{r&&(r.show(),e.onOpen&&e.onOpen())},0))},hide:()=>{o||r&&r.hide()},isOpen:()=>n,destroy:()=>{o=!0,window.removeEventListener("resize",l),r&&r.hide(),setTimeout(()=>{$r(null,t)},300)}}},Tl=(e,t={threshold:.6})=>{let r=bt(null),n=bt(!1),o=ee(i=>{let[s]=i;s.isIntersecting&&!n.current?(n.current=!0,e()):s.isIntersecting||(n.current=!1)},[e]);return Ve(()=>{if(r.current){let i=new IntersectionObserver(o,t);return i.observe(r.current),()=>{r.current&&i.unobserve(r.current)}}},[o,t]),r};vi=i=>{var s=i,{children:e,fluid:t=!1,className:r="",style:n={}}=s,o=Z(s,["children","fluid","className","style"]);let a=w({width:"100%",marginLeft:"auto",marginRight:"auto",paddingLeft:"15px",paddingRight:"15px",boxSizing:"border-box",maxWidth:t?"100%":void 0},n);return I("div",N(w({className:r,style:a},o),{children:e}))},yi=a=>{var l=a,{children:e,gutter:t=0,justify:r="start",align:n="top",className:o="",style:i={}}=l,s=Z(l,["children","gutter","justify","align","className","style"]);let c={start:"flex-start",end:"flex-end",center:"center","space-around":"space-around","space-between":"space-between"},d={top:"flex-start",middle:"center",bottom:"flex-end"},u=w({display:"flex",flexWrap:"wrap",boxSizing:"border-box",justifyContent:c[r],alignItems:d[n]},i);if(t){let m=Array.isArray(t)?t[0]:t,g=Array.isArray(t)?t[1]:0;m>0&&(u.marginLeft=`-${m/2}px`,u.marginRight=`-${m/2}px`),g>0&&(u.marginTop=`-${g/2}px`,u.marginBottom=`-${g/2}px`)}let p=t?Il(e,t):e;return I("div",N(w({className:o,style:u},s),{children:p}))};Rl=u=>{var p=u,{children:e,span:t,offset:r,xs:n,sm:o,md:i,lg:s,xl:a,className:l="",style:c={}}=p,d=Z(p,["children","span","offset","xs","sm","md","lg","xl","className","style"]);let m=w({position:"relative",width:"100%",paddingLeft:"15px",paddingRight:"15px",boxSizing:"border-box"},c);if(t!==void 0){let g=t/24*100;m.flex=`0 0 ${g}%`,m.maxWidth=`${g}%`}return r!==void 0&&(m.marginLeft=`${r/24*100}%`),I("div",N(w({className:l,style:m},d),{children:e}))},Al=({game:e,layerName:t,routeMode:r,onGameClick:n})=>{var s,a;let o=ee(l=>{l.preventDefault(),n==null||n(e)},[n,e]),i=ee(()=>{},[e,t]);return I(Rl,{span:8,className:"relative px-[4px] box-border mb-[8px]",style:{marginBottom:"8px"},onClick:o,role:"button",tabIndex:0,onTouchEnd:o,children:[I("div",{className:"relative w-full mb-[2px] ion-no-margin",children:I(xl,{src:(a=(s=e.logo)!=null?s:e.cover)!=null?a:"",className:"w-full h-full absolute top-0 left-0 aspect-square rounded-[8px] object-cover",style:{display:"block",objectFit:"cover"},handleExposure:i})}),I("div",{className:"block text-white max-w-full text-[15px] leading-[1.2] overflow-hidden whitespace-nowrap text-ellipsis font-normal break-words",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-word",color:"white",maxWidth:"100%",fontSize:"15px",lineHeight:1.2,fontWeight:"normal"},children:e.name})]},e.gameId)},Cl=i=>{var s=i,{list:e,routeMode:t,layerName:r,onGameClick:n}=s,o=Z(s,["list","routeMode","layerName","onGameClick"]);return I(vi,{className:"w-full max-w-[440px] mx-auto flex-grow overflow-y-auto",children:I(yi,{gutter:8,className:"flex-wrap",children:e==null?void 0:e.map(a=>I(Al,{game:a,routeMode:t,layerName:r,onGameClick:n},a.gameId))})})},Pl=ol(Cl),Jr=(e=>(e.Dismiss="DISMISS",e.Quit="QUIT",e))(Jr||{}),Nl=e=>{let{games:t,title:r,buttons:n,onClose:o}=e,[i,s]=Hr(null),a=ee(d=>{o==null||o({type:d.type===Jr.Quit?"quit":"dismiss"})},[o]),l=ee(d=>{o==null||o({type:"navigate",data:{game:d}})},[o]);if(!t.length)return I(ke,{});let c=ee(d=>{if(d!==null&&!d.shadowRoot){let u=d.attachShadow({mode:"open"}),p=document.createElement("style");p.textContent=`
|
|
56
56
|
.recommend-panel {
|
|
57
57
|
background-color: #1a1a1a;
|
|
58
58
|
width: 100%;
|
|
@@ -122,6 +122,6 @@ var ts=Object.create;var Ye=Object.defineProperty,rs=Object.defineProperties,ns=
|
|
|
122
122
|
background-color: #7817FF;
|
|
123
123
|
color: #fff;
|
|
124
124
|
}
|
|
125
|
-
`;let m=document.createElement("div");m.id="recommend-panel-content",u.appendChild(p),u.appendChild(m),s(u)}},[]);return Ve(()=>{if(i){let d=i.getElementById("recommend-panel-content");d&&$r(x("div",{className:"recommend-panel",children:x("div",{className:"container",children:[x("p",{className:"title",children:r}),x("div",{className:"games-container",children:x(Pl,{list:t||[],routeMode:"REDIRECT",layerName:"RecommendedGuide",onGameClick:l})}),x("div",{className:"buttons-container",children:x(vi,{children:x(yi,{gutter:10,children:(n!=null?n:[]).map((u,p)=>x("div",{className:"button-wrapper",children:x("button",{className:`button ${u.type===Jr.Quit?"quit-button":"action-button"}`,onClick:()=>a(u),children:u.text})},p))})})})]})}),d)}},[i,t,r,n,a,l]),x("div",{ref:c})},bi=e=>{let t=Sl({title:e.title,content:x(Nl,{games:e.games,title:e.title,buttons:e.buttons,onClose:e.onClose}),backdropColor:"#1a1a1a",placement:"bottom",noHeader:!0,padding:"0px",onClose:()=>{console.log("onClose")},onOpen:e.onOpen});return t.show(),t}});function Ei(){return E(this,null,function*(){if(Yr)return Yr;let t=`${y.testMode?"https://stg-game.jolibox.com":"https://game.jolibox.com"}/api/user-retention/exit-recommendations?objectId=${y.mpId}&from=GAME_DETAIL`,{response:{data:r}}=yield q(t);return Yr=r,r})}function ki(){return E(this,null,function*(){let e=new fe;if(y.mpType!=="game")return e.resolve(!1),e.promise;let t=yield Ei();if(t.code!=="SUCCESS")return e.resolve(!1),e.promise;let{gameListInfo:r,title:n,buttons:o}=t.data,i=bi({games:r.games,title:n,buttons:o,onClose:s=>{var a;switch(s.type){case"quit":e.resolve(!1);break;case"dismiss":e.resolve(!0),i.hide();break;case"navigate":(a=s.data)!=null&&a.game?Ol(s.data.game):e.resolve(!0),i.hide();break;default:e.resolve(!0);break}}});return e.promise})}var Yr,Ol,Si=k(()=>{"use strict";J();G();P();wi();xe();Yr=null;Ei();Ol=e=>{var s;let{data:t}=O("envSync"),r=new URL(t.schema),n=new URLSearchParams(r.search);n.set("gameId",e.gameId),n.set("joliSource",y.encodeJoliSourceQuery({__mpType:"game",__orientation:(s=e.orientation)!=null?s:"VERTICAL"}));let i=`${`https://${e.gameId}.content.jolibox.com/`}index.html?${n.toString()}`;O("openSchemaSync",{schema:i})}});var Ti={};mn(Ti,{config:()=>Bl});function Dl(){Re.on("isAdShowing",e=>{kt=e,Me(kt)&&O("updateContainerConfigSync",{displayCapsuleButton:!kt,webviewId:y.webviewId})})}function Ul(){ce.on("onDocumentReady",()=>{var e;(e=globalThis.joliboxJSCore)==null||e.onDocumentReady(window.location.href),Y("onDocumentReady",{start_timestamp:Tt,timestamp:Date.now()})})}function Ll(e){y.mpType==="game"&&W.start(e)}function Fl(){re("onJoliboxServiceReady",({runtimeInfo:e,loadDuration:t})=>{e&&y.onEnvConfigChanged({hostUserInfo:e}),ce.emit("LifecycleEvent.onReady",w({},y.hostUserInfo?y.hostUserInfo:{isLogin:!1})),Y("joliboxServiceReady",{start_timestamp:Tt,timestamp:Date.now()}),Ll(t)}),re("onBeforeExit",({uuid:e})=>{var t;(t=globalThis.joliboxJSCore)==null||t.doExit(e)})}function jl(){let e=()=>{Y("onBeforeExit",{timestamp:Date.now()}),Et==null||Et(),W.close(Date.now()-Tt)};le.onDoExit(()=>E(this,null,function*(){return kt?!0:Me(y.shouldInterupt)?(y.shouldInterupt||e(),y.shouldInterupt):St!=null&&St.canShowRecommended&&(yield ki())?!0:(e(),!1)}))}function Ml(){return E(this,null,function*(){let e=`${y.baseApiHost}/api/fe-configs/js-sdk/basic-meta`,{response:{data:t}}=yield q(e);t&&(St=t)})}function Bl(){Tt=Date.now(),Fl(),Dl(),jl(),Ul(),Ml(),Et=Ro()}var Et,Tt,kt,St,Ii=k(()=>{"use strict";G();J();P();ge();Ao();Ur();Si();xe();kt=!1,St=null;le.onReady(()=>{})});function xi(e){let t=Er.config[e];return t||(t={},Er.config[e]=t),(r,n)=>{if(t[r]){ne.warn(`[can i use] ${r} already registered`);return}t[r]=w({},n)}}var Ri=k(()=>{"use strict";P()});function Xr(e){Ai=e}function It(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>It(t)):Object.keys(e).reduce((t,r)=>(t[r]=It(e[r]),t),{})}function pe(e){return typeof e=="number"}function Zr(e){let t=en(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function en(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ai,B,xt,Rt,At,Ct,Ce,Pt,Nt,Ot,Dt,Ut,Lt,Ft,jt,Mt,Bt,$t,Ht,tn=k(()=>{"use strict";Ai=!1;B=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ai)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 ${Zr(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return It(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:It(this._default)}optional(){return this._optional=!0,this}};xt=class extends B{validate(t){return this._optional&&t===void 0?!0:pe(t)?pe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):pe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):pe(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}},Rt=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},At=class extends B{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(pe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(pe(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}},Ct=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Ce=class extends B{validate(t){return!0}},Pt=class extends B{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Nt=class extends B{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Ot=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Dt=class extends B{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 ${Zr(t)}`)}return!0}},Ut=class extends B{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(pe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(pe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(pe(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 o=!0;if(r.forEach((i,s)=>{if(n.path=`${this.path}[${s}]`,n.errors=this.errors,i===void 0&&n.hasDefault){r[s]=n.defaultValue;return}n.validate(i)||(n.hasFallback?r[s]=n.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let s in r)i.has(r[s])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(r[s])}] and ${this.path}[${s}] are identical)`):i.set(r[s],s)}return o}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}},Lt=class extends B{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(en(r)!=="object")return this.fail({expect:"object",actual:r});let o=r,i=this._value;i.errors=this.errors;let s=!0;for(let a in o){let l=o[a];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(a)?i.path=`${this.path}.${a}`:i.path=`${this.path}["${a}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){o[a]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?o[a]=i.fallbackValue:s=!1)}}return s}},Ft=class extends B{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(en(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,o=!0;for(let i in this._object){let s=n[i],a=this._object[i];if(a.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?a.path=`${this.path}.${i}`:a.path=`${this.path}["${i}"]`,!(a._optional&&s===void 0)){if(s===void 0&&a.hasDefault){n[i]=a.defaultValue;continue}a.validate(s)||(a.hasFallback?n[i]=a.fallbackValue:o=!1)}}return o}},jt=class extends B{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Zr(this.value),actual:r}):!0}},Mt=class extends B{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,o=this._items.length;for(let i=0;i<o;i++){let s=this._items[i];if(s.errors=[],s.path=this.path,!s.validate(t))r.push(s.errors.join("; "));else if(!n){n=!0;break}}if(!n){let i=r.join(`
|
|
125
|
+
`;let m=document.createElement("div");m.id="recommend-panel-content",u.appendChild(p),u.appendChild(m),s(u)}},[]);return Ve(()=>{if(i){let d=i.getElementById("recommend-panel-content");d&&$r(I("div",{className:"recommend-panel",children:I("div",{className:"container",children:[I("p",{className:"title",children:r}),I("div",{className:"games-container",children:I(Pl,{list:t||[],routeMode:"REDIRECT",layerName:"RecommendedGuide",onGameClick:l})}),I("div",{className:"buttons-container",children:I(vi,{children:I(yi,{gutter:10,children:(n!=null?n:[]).map((u,p)=>I("div",{className:"button-wrapper",children:I("button",{className:`button ${u.type===Jr.Quit?"quit-button":"action-button"}`,onClick:()=>a(u),children:u.text})},p))})})})]})}),d)}},[i,t,r,n,a,l]),I("div",{ref:c})},bi=e=>{let t=Sl({title:e.title,content:I(Nl,{games:e.games,title:e.title,buttons:e.buttons,onClose:e.onClose}),backdropColor:"#1a1a1a",placement:"bottom",noHeader:!0,padding:"0px",onClose:()=>{console.log("onClose")},onOpen:e.onOpen});return t.show(),t}});function Ei(){return E(this,null,function*(){if(Yr)return Yr;let t=`${y.testMode?"https://stg-game.jolibox.com":"https://game.jolibox.com"}/api/user-retention/exit-recommendations?objectId=${y.mpId}&from=GAME_DETAIL`,{response:{data:r}}=yield q(t);return Yr=r,r})}function ki(){return E(this,null,function*(){let e=new fe;if(y.mpType!=="game")return e.resolve(!1),e.promise;let t=yield Ei();if(t.code!=="SUCCESS")return e.resolve(!1),e.promise;let{gameListInfo:r,title:n,buttons:o}=t.data,i=bi({games:r.games,title:n,buttons:o,onClose:s=>{var a;switch(s.type){case"quit":e.resolve(!1);break;case"dismiss":e.resolve(!0),i.hide();break;case"navigate":(a=s.data)!=null&&a.game?Ol(s.data.game):e.resolve(!0),i.hide();break;default:e.resolve(!0);break}}});return e.promise})}var Yr,Ol,Si=k(()=>{"use strict";J();G();P();wi();Ie();Yr=null;Ei();Ol=e=>{var s;let{data:t}=O("envSync"),r=new URL(t.schema),n=new URLSearchParams(r.search);n.set("gameId",e.gameId),n.set("joliSource",y.encodeJoliSourceQuery({__mpType:"game",__orientation:(s=e.orientation)!=null?s:"VERTICAL"}));let i=`${`https://${e.gameId}.content.jolibox.com/`}index.html?${n.toString()}`;O("openSchemaSync",{schema:i})}});var Ti={};mn(Ti,{config:()=>Bl});function Dl(){Re.on("isAdShowing",e=>{kt=e,Me(kt)&&O("updateContainerConfigSync",{displayCapsuleButton:!kt,webviewId:y.webviewId})})}function Ll(){ce.on("onDocumentReady",()=>{var e;(e=globalThis.joliboxJSCore)==null||e.onDocumentReady(window.location.href),Y("onDocumentReady",{start_timestamp:Tt,timestamp:Date.now()})})}function Ul(e){y.mpType==="game"&&W.start(e)}function Fl(){re("onJoliboxServiceReady",({runtimeInfo:e,loadDuration:t})=>{e&&y.onEnvConfigChanged({hostUserInfo:e}),ce.emit("LifecycleEvent.onReady",w({},y.hostUserInfo?y.hostUserInfo:{isLogin:!1})),Y("joliboxServiceReady",{start_timestamp:Tt,timestamp:Date.now()}),Ul(t)}),re("onBeforeExit",({uuid:e})=>{var t;(t=globalThis.joliboxJSCore)==null||t.doExit(e)})}function jl(){let e=()=>{Y("onBeforeExit",{timestamp:Date.now()}),Et==null||Et(),W.close(Date.now()-Tt)};le.onDoExit(()=>E(this,null,function*(){return kt?!0:Me(y.shouldInterupt)?(y.shouldInterupt||e(),y.shouldInterupt):St!=null&&St.canShowRecommended&&(yield ki())?!0:(e(),!1)}))}function Ml(){return E(this,null,function*(){let e=`${y.baseApiHost}/api/fe-configs/js-sdk/basic-meta`,{response:{data:t}}=yield q(e);t&&(St=t)})}function Bl(){Tt=Date.now(),Fl(),Dl(),jl(),Ll(),Ml(),Et=Ro()}var Et,Tt,kt,St,xi=k(()=>{"use strict";G();J();P();ge();Ao();Lr();Si();Ie();kt=!1,St=null;le.onReady(()=>{})});function Ii(e){let t=Er.config[e];return t||(t={},Er.config[e]=t),(r,n)=>{if(t[r]){ne.warn(`[can i use] ${r} already registered`);return}t[r]=w({},n)}}var Ri=k(()=>{"use strict";P()});function Xr(e){Ai=e}function xt(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>xt(t)):Object.keys(e).reduce((t,r)=>(t[r]=xt(e[r]),t),{})}function pe(e){return typeof e=="number"}function Zr(e){let t=en(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function en(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ai,B,It,Rt,At,Ct,Ce,Pt,Nt,Ot,Dt,Lt,Ut,Ft,jt,Mt,Bt,$t,Ht,tn=k(()=>{"use strict";Ai=!1;B=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ai)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 ${Zr(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return xt(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:xt(this._default)}optional(){return this._optional=!0,this}};It=class extends B{validate(t){return this._optional&&t===void 0?!0:pe(t)?pe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):pe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):pe(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}},Rt=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},At=class extends B{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(pe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(pe(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}},Ct=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Ce=class extends B{validate(t){return!0}},Pt=class extends B{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Nt=class extends B{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Ot=class extends B{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Dt=class extends B{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 ${Zr(t)}`)}return!0}},Lt=class extends B{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(pe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(pe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(pe(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 o=!0;if(r.forEach((i,s)=>{if(n.path=`${this.path}[${s}]`,n.errors=this.errors,i===void 0&&n.hasDefault){r[s]=n.defaultValue;return}n.validate(i)||(n.hasFallback?r[s]=n.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let s in r)i.has(r[s])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(r[s])}] and ${this.path}[${s}] are identical)`):i.set(r[s],s)}return o}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}},Ut=class extends B{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(en(r)!=="object")return this.fail({expect:"object",actual:r});let o=r,i=this._value;i.errors=this.errors;let s=!0;for(let a in o){let l=o[a];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(a)?i.path=`${this.path}.${a}`:i.path=`${this.path}["${a}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){o[a]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?o[a]=i.fallbackValue:s=!1)}}return s}},Ft=class extends B{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(en(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,o=!0;for(let i in this._object){let s=n[i],a=this._object[i];if(a.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?a.path=`${this.path}.${i}`:a.path=`${this.path}["${i}"]`,!(a._optional&&s===void 0)){if(s===void 0&&a.hasDefault){n[i]=a.defaultValue;continue}a.validate(s)||(a.hasFallback?n[i]=a.fallbackValue:o=!1)}}return o}},jt=class extends B{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Zr(this.value),actual:r}):!0}},Mt=class extends B{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,o=this._items.length;for(let i=0;i<o;i++){let s=this._items[i];if(s.errors=[],s.path=this.path,!s.validate(t))r.push(s.errors.join("; "));else if(!n){n=!0;break}}if(!n){let i=r.join(`
|
|
126
126
|
or `);this.errors.push(i)}return n}},Bt=class extends B{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let o=t[n];if(o._optional||o.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,o)=>{if(n.path=`${this.path}[${o}]`,n.errors=this.errors,t[o]===void 0&&n.hasDefault){t[o]=n.defaultValue;return}n.validate(t[o])||(n.hasFallback?t[o]=n._fallback:r=!1)}),r}},$t=class extends B{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Ht=class extends B{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 rn(e,t,r="param"){if(e.errors=[],e.path=r,Xr(!0),!e.validate(t)){let n=e.errors.join(`
|
|
127
|
-
`);throw e.errors.length=0,Xr(!1),new TypeError(n)}}var f,nn=k(()=>{"use strict";tn();tn();f={object(e){return new Ft(e)},array(e){return new Ut(e)},tuple(...e){return new Bt(...e)},literal(e){return new jt(e)},or(...e){return new Mt(...e)},symbol(){return new Ct},record(e){return new Lt(e)},function(){return new Ot},boolean(){return new Rt},string(){return new At},number(){return new xt},undefined(){return new Pt},null(){return new Nt},unknown(){return new Ce},any(){return new Ce},as(){return new Ce},arraybuffer(){return new $t},enum(...e){return new Dt(...e)},typedarray(e){return new Ht(e)}}});var Kt,Ci,Pi=k(()=>{"use strict";P();oe();nn();Ie();Kt=1,Ci=e=>{function t(n,o){return(...i)=>{var u,p,m,g;let s=Date.now(),a={method:n,trace_id:Kt};Kt+=1;let l="SUCCESS",c=`${n}:ok`,d=0;try{if(o.paramsSchema)try{rn(o.paramsSchema,i,"params")}catch(v){throw Cr(`${n}:fail ${v.message}`)}let b=o.implement(...i),h=b,_=`${n}:ok`;if(b&&"code"in b){let{code:v,data:S,message:R}=b;l=v,h=S,_=R}return{code:l,message:_,data:h}}catch(b){let h=b;d=(p=(u=h.code)!=null?u:h.errNo)!=null?p:2e3,l="FAILURE";let _=(g=(m=h.message)!=null?m:h.errMsg)!=null?g:`${b}`;return c=`${n}:${l} ${_.replace(/^\S+:(fail|cancel)\s?/,"")}`,K(new He(c,d)),{code:l,message:c}}finally{let b=Date.now()-s;e("apiInvoked",N(w({},a),{duration:b,status:l}))}}}function r(n,o){return(...i)=>E(this,null,function*(){var p,m,g,b;let s=$n(i)?i:[i],a=Date.now(),l={method:n,trace_id:Kt};Kt+=1;let c=`${n}:ok`,d="SUCCESS",u={code:d,message:c};try{if(o.paramsSchema)try{rn(o.paramsSchema,s,"params")}catch(v){throw Cr(v.message)}let _=yield o.implement(...s);if(_&&"code"in _){let{code:v,data:S,message:R}=_;d=v,c=R,_=S}return Object.assign(u,{code:d,message:c,data:_}),u}catch(h){let _=h,v=(m=(p=_.code)!=null?p:_.errNo)!=null?m:2e3;d="FAILURE";let S=(b=(g=_.message)!=null?g:_.errMsg)!=null?b:`${h}`,R=`${n}:${d} ${S.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(u,{code:d,message:R}),K(new He(R,v)),u}finally{let h=Date.now()-a;e("apiInvoked",N(w({},l),{duration:h,status:d}))}})}return{createAPI:r,createSyncAPI:t}}});var $,D,I,ie=k(()=>{"use strict";Ri();ge();Pi();nn();({createAPI:$,createSyncAPI:D}=Ci(Y)),I=xi("native")});var Ni,Hl,Kl,Vl,Jl,Oi=k(()=>{"use strict";P();ie();G();Ni=j(),Hl="env",Kl="getSystemInfoSync",Vl=D(Kl,{implement:()=>{var r;let e=O("envSync"),{data:t}=e;return{system:t.deviceInfo.system,platform:t.deviceInfo.platform,version:t.sdkInfo.jssdkVersion,pixelRatio:t.deviceInfo.pixelRatio,language:t.deviceInfo.lang,brand:t.deviceInfo.brand,appName:(r=t.hostInfo)==null?void 0:r.appName,SDKVersion:t.sdkInfo.jssdkVersion}}}),Jl=D(Hl,{implement:()=>{var t;let e=O("envSync");return(t=e==null?void 0:e.data)!=null?t:void 0}});Ni.registerCommand("API.getSystemInfoSync",Vl);Ni.registerCommand("API.env",Jl);I("env",{version:"1.0.0"});I("getSystemInfoSync",{version:"1.0.0"})});var Di=pn(on=>{"use strict";P();ie();oe();G();ge();J();var Gl="exitGame",ql="onReady",Wl="onJoliboxShow",zl="onJoliboxHide",Vt=j(),Jt=it(K),Ql=$(Gl,{paramsSchema:f.tuple(f.function(),f.boolean().optional().default(!1)),implement:(e,t=!1)=>E(on,null,function*(){Jt(e).call(on),Me(y.shouldInterupt)&&!y.shouldInterupt&&y.from&&Un("onRetentionResult",{shouldStay:t},y.from,!0),yield Q("exitAppAsync")})}),Yl=D(Wl,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);re("onJoliboxEnterForeground",()=>{t.call(this),Ke.emit("visible",!0)})}}),Xl=D(zl,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);re("onJoliboxEnterBackground",()=>{t.call(this),Ke.emit("visible",!1)})}}),Zl=D(ql,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);ce.on("LifecycleEvent.onReady",r=>{t(r)})}});Vt.registerCommand("LifecycleSDK.exit",Ql);Vt.registerCommand("LifecycleSDK.onReady",Zl);Vt.registerCommand("LifecycleSDK.onJoliboxShow",Yl);Vt.registerCommand("LifecycleSDK.onJoliboxHide",Xl);I("lifeCycle.exit",{version:"1.0.0"});I("lifeCycle.onReady",{version:"1.0.0"});I("lifeCycle.onJoliboxShow",{version:"1.0.0"});I("lifeCycle.onJoliboxHide",{version:"1.0.0"})});function Ui(e){let t={};if(!ye(e))return t;for(let[r,n]of Object.entries(e)){let o=r.toLocaleLowerCase();n?typeof n=="object"?t[o]=Object.prototype.toString.call(n):t[o]=String(n):t[o]=""}return t}function Li(e="GET"){if(e==="")return"POST";let t=e.toUpperCase();return["GET","OPTIONS","HEAD","POST","PUT","DELETE","TRACE","CONNECT","PATCH"].includes(t)?t:"GET"}function Fi(e,t=!1){if(e)return t||e>0&&e<=6e4?Math.ceil(e):6e4}function ji(e,t,r){if(["POST","PUT","PATCH"].includes(t)||!ye(r))return e;let[n,o=""]=e.split("?"),i=new URLSearchParams(o);for(let[a,l]of Object.entries(r))l!=null&&i.append(a,String(l));let s=i.toString();return s?`${n}?${s}`:n}var Mi=k(()=>{"use strict";P()});var ec,tc,sn,an,Bi,rc,nc,oc,$i=k(()=>{"use strict";Ie();Or();ie();Mi();P();oe();J();ec=15,tc=lt("createRequestTaskSync","operateRequestTaskSync",{type:"public",baseUrl:y.baseApiHost}),sn=0,an=[],Bi=it(K),rc=(e,t)=>{let r=e.filter(t),n=e.filter(o=>!t(o));return e.length=0,e.push(...n),r},nc=e=>{let t=new fe,r=()=>{};return D("request",{paramsSchema:f.tuple(f.object({url:f.string(),method:f.string(),headers:f.object(),data:f.object().optional(),query:f.object().optional(),dataType:f.string().default("json"),responseType:f.string().default("text"),enableCache:f.boolean().default(!1),appendHostCookie:f.boolean().default(!0),timeout:f.number().default(3e4),success:f.function(),fail:f.function()})),implement(o){let i=()=>E(this,null,function*(){var a,l;let s=Bi(o.fail);try{if(sn+=1,t.state!=="pending")return;let{data:c,dataType:d,responseType:u,enableCache:p,appendHostCookie:m}=o,g=Ui(o.headers),b=Li(o.method),h=Fi(o.timeout),_=ji(o.url,b,c),v=Bi(o.success),S=Object.assign({},o,{method:b,header:g,data:b==="GET"||b==="HEAD"?void 0:c,enableCache:p,query:(a=o.query)!=null?a:{},dataType:d,responseType:u,appendHostCookie:m});h&&(S.timeout=h);let R=tc(_,S);{let{response:A}=yield R,{code:C,data:H,message:z}=A;if(H&&typeof H=="object"&&"status"in H&&H.status!==200)throw _e({code:H.status||-1,msg:`request:fail status ${H.status}`});t.resolve({code:C!=null?C:"SUCCESS",data:H,message:z!=null?z:"request:ok"}),v({code:"SUCCESS",message:"request:ok",data:H})}}catch(c){t.reject(c),s({code:"FAILURE",message:"httpRequst: failed"})}finally{sn-=1,(l=an.shift())==null||l()}});return sn>=ec?(r=()=>{rc(an,s=>s===i)},an.push(i)):i(),t.promise}})(e),{abort(){t.reject(_e({code:-1,msg:"request:fail abort"})),r()}}},oc=j();oc.registerCommand("HttpSDK.request",nc);I("request",{version:"1.0.0"})});function uc(e){let t=Object.prototype.toString.call(e).split(" ")[1].split("]")[0].toLocaleLowerCase();return cc.includes(t)?t:""}function dc(e,t){try{switch(t){case"string":return e;case"object":return JSON.parse(e);case"number":return parseFloat(e);case"boolean":return e==="true";default:return""}}catch(r){return""}}function pc(e,t){try{switch(t){case"string":case"number":case"boolean":return`${e}`;case"object":return JSON.stringify(e);default:return""}}catch(r){return""}}var Gt,ic,sc,ac,lc,Am,Cm,cc,Hi=k(()=>{"use strict";ie();G();P();xe();J();Gt=j(),ic=$("getLocalStorage",{paramsSchema:f.tuple(f.string()),implement(e){return E(this,null,function*(){let{response:t}=yield q(`/api/games/user-storage/${y.mpId}`,{method:"GET",responseType:"json",appendHostCookie:!0,query:{key:e}}),{data:{code:r,message:n,data:o}}=yield t;if(r==="SUCCESS")return{code:r,message:n,data:o==null?void 0:o.value};try{let{data:{data:i,dataType:s}}=yield Q("getLocalStorageAsync",{key:e}),a=dc(i,s);return{code:r,message:`${n}. fallback to native`,data:a}}catch(i){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get local storage failed",data:null}}})}});Gt.registerCommand("StorageSDK.getItem",ic);I("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});sc=$("setStorage",{paramsSchema:f.tuple(f.string(),f.or(f.string(),f.boolean(),f.number())),implement(e,t){return E(this,null,function*(){let r=y.mpId,n=typeof t=="string"?t:String(t),{response:o}=yield q(`/api/games/user-storage/${r}`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e,value:n}}),{data:{code:i,message:s}}=o,a=uc(t),l=pc(t,a);return yield Q("setLocalStorageAsync",{key:e,data:l,dataType:a}),i=="SUCCESS"?{code:i,message:s}:{code:i,message:`${s}. fallback to native`}})}});Gt.registerCommand("StorageSDK.setItem",sc);I("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});ac=$("removeStorage",{paramsSchema:f.tuple(f.string()),implement(e){return E(this,null,function*(){let t=y.mpId,{response:r}=yield q(`/api/games/user-storage/${t}/remove`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e}}),{data:{code:n,message:o}}=r;return yield Q("removeLocalStorageAsync",{key:e}),n==="SUCCESS"?{code:n,message:o}:{code:n,message:"[Jolibox SDK] remove item succ"}})}});Gt.registerCommand("StorageSDK.removeItem",ac);I("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});lc=$("clearStorage",{implement(){return E(this,null,function*(){let e=y.mpId,{response:t}=yield q(`/api/games/user-storage/${e}/clear`,{method:"POST",appendHostCookie:!0});Q("clearLocalStorageAsync");let{data:{code:r,message:n}}=t;return r==="SUCCESS"?{code:r,message:n}:{code:r,message:`${n}.fallback to native`}})}});Gt.registerCommand("StorageSDK.clear",lc);I("storage.clear",{version:"1.0.0"});Am=$("getStorageInfo",{implement(){return E(this,null,function*(){let{data:e}=yield Q("getStorageInfoAsync");return e})}});I("getStorageInfo",{version:"1.0.0",success:{keys:"1.0.0",currentSize:"1.0.0",limitSize:"1.0.0"}});Cm=D("getStorageInfoSync",{implement(){return O("getStorageInfoSync")}}),cc=["string","number","boolean","object",""]});var mc,fc,hc,ln,Ki=k(()=>{"use strict";P();G();ie();mc=D("showKeyboard",{paramsSchema:f.tuple(f.object({defaultValue:f.string().optional().default(""),multiple:f.boolean().optional().default(!1),maxLength:f.unknown().optional().default(1e5)})),implement(e){var n;let t=Math.floor((n=Number(e.maxLength))!=null?n:1e5),{defaultValue:r}=e;r&&t&&(r=r.slice(0,t)),O("showKeyboardSync",N(w({},e),{defaultValue:r,maxLength:t}))}});I("keyboard.showKeyboard",{version:"1.0.0",properties:{params:{defaultValue:"1.0.0",multiple:"1.0.0",confirmHold:"1.0.0",confirmType:"1.0.0",maxLength:"1.0.0"}},success:{errMsg:"1.0.0"}});fc=D("updateKeyboard",{paramsSchema:f.tuple(f.object({value:f.string()})),implement(e){O("updateKeyboardSync",e)}});I("keyboard.updateKeyboard",{version:"1.0.0",properties:{params:{value:"1.0.0"}}});hc=D("hideKeyboard",{implement(){O("hideKeyboardSync")}});I("keyboard.hideKeyboard",{version:"1.0.0"});ln=j();ln.registerCommand("KeyboardSDK.showKeyboard",mc);ln.registerCommand("KeyboardSDK.updateKeyboard",fc);ln.registerCommand("KeyboardSDK.hideKeyboard",hc)});var Vi=pn(Se=>{"use strict";P();ie();ge();var Pe=j(),_c=$("levelFinished",{paramsSchema:f.tuple(f.string(),f.object({result:f.boolean(),duration:f.number()})),implement:(e,t)=>E(Se,null,function*(){let{result:r,duration:n}=t,o=[];o.push(W.tracker("LevelFinished",{levelId:e,result:r,duration:n})),o.push(W.reporter({event:"COMPLETE_GAME_LEVEL"})),yield Promise.all(o)})}),gc=$("taskFinished",{paramsSchema:f.tuple(f.string(),f.object({duration:f.number()})),implement:(e,t)=>E(Se,null,function*(){let{duration:r}=t;return yield W.reportToNative({event:"TaskFinished",params:{duration:r,taskId:e}})})}),vc=$("levelUpgrade",{paramsSchema:f.tuple(f.string(),f.string()),implement:(e,t)=>E(Se,null,function*(){let r=[];r.push(W.reportToNative({event:"LevelUpgrade",params:{name:t,levelId:e}})),yield Promise.all(r)})}),yc=$("onHistoryUserLevel",{paramsSchema:f.tuple(f.number()),implement:e=>E(Se,null,function*(){return yield W.reportToNative({event:"HistoryUserLevel",params:{level:e}})})}),bc=$("onHistoryUserScore",{paramsSchema:f.tuple(f.number()),implement:e=>E(Se,null,function*(){return yield W.reportToNative({event:"HistoryUserScore",params:{score:e}})})}),wc=$("taskEvent",{paramsSchema:f.tuple(f.string(),f.object({tools:f.array(f.object({id:f.string(),name:f.string(),count:f.number(),description:f.string().optional(),price:f.object({amount:f.number(),unit:f.string()}).optional()})).optional(),awards:f.array(f.object({id:f.string(),name:f.string()})).optional()})),implement:(e,t)=>E(Se,null,function*(){var n,o;let r=[];r.push(W.reportToNative({event:"TaskEvent",params:w({taskId:e},t)})),(o=(n=t.tools)==null?void 0:n.length)!=null&&o&&(r.push(W.reporter({event:"USE_GAME_ITEM"})),r.push(W.reportToNative({event:"UseGameItem",params:w({taskId:e},t)}))),yield Promise.all(r)})});Pe.registerCommand("TaskTrackerSDK.levelFinished",_c);Pe.registerCommand("TaskTrackerSDK.taskFinished",gc);Pe.registerCommand("TaskTrackerSDK.levelUpgrade",vc);Pe.registerCommand("TaskTrackerSDK.historyUserLevel",yc);Pe.registerCommand("TaskTrackerSDK.historyUserScore",bc);Pe.registerCommand("TaskTrackerSDK.taskEvent",wc);I("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});I("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});I("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});I("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});I("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});I("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});var Ec,kc,Ji,Gi=k(()=>{"use strict";J();G();ie();P();Ie();I("login",{version:"1.0.0",properties:{force:"1.0.0"},success:{errMsg:"1.0.0",code:"1.0.0",token:"1.0.0",isLogin:"1.0.0"}});I("checkSession",{version:"1.0.0",success:{errMsg:"1.0.0"}});Ec=$("login",{implement(){return E(this,null,function*(){var s;let{data:{isLogin:e}}=yield Q("checkLoginAsync");if(e)return{isLogin:!0,token:(s=y.hostUserInfo)==null?void 0:s.token};re("onLoginStateChange",({isLogin:a,token:l,uuid:c})=>{c==r&&o({isLogin:a,token:l})});let t=O("loginSync"),{data:{uuid:r}}=t;if(!r)throw _e({code:-1,msg:"login failed"});let{promise:n,resolve:o}=new fe,i=yield n;return y.onEnvConfigChanged({hostUserInfo:i}),ce.emit("onLoginComplete",i),i})}}),kc=$("checkSession",{implement(){return E(this,null,function*(){let{data:{isLogin:e}}=yield Q("checkLoginAsync");return{isLogin:e}})}}),Ji=j();Ji.registerCommand("API.login",Ec);Ji.registerCommand("API.checkSession",kc)});var qt,Sc,Wt,Tc,Ic,xc,Rc,qi=k(()=>{"use strict";P();ie();Ur();ge();xe();G();qt=j(),Sc=()=>{let{data:e}=O("getNetworkStatusSync");return!!(e!=null&&e.isConnected)},Wt=new mt(Y,{get:(e,t)=>q(e,w({method:"GET",responseType:"json",appendHostCookie:!0},t)).then(r=>r.response.data),post:(e,t,r)=>q(e,w({method:"POST",responseType:"json",appendHostCookie:!0},r)).then(n=>n.response.data)},Sc),Tc=D("adInit",{implement:e=>{Wt.init(e)}}),Ic=D("adConfig",{implement:e=>{Wt.adConfig(e)}}),xc=D("adBreak",{implement:e=>{Wt.adBreak(e)}}),Rc=D("adUnit",{implement:e=>{Wt.adUnit(e)}});qt.registerCommand("AdsSDK.init",Tc);qt.registerCommand("AdsSDK.adConfig",Ic);qt.registerCommand("AdsSDK.adBreak",xc);qt.registerCommand("AdsSDK.adUnit",Rc);I("AdsSDK.init",{version:"1.0.0"});I("AdsSDK.adConfig",{version:"1.0.0"});I("AdsSDK.adBreak",{version:"1.0.0"});I("AdsSDK.adUnit",{version:"1.0.0"})});var cn,Ac,Cc,Pc,Wi=k(()=>{"use strict";P();G();ie();J();cn=j(),Ac=D("openSchemaSync",{paramsSchema:f.tuple(f.string()),implement:e=>{let t=e;e.match(/^https?:\/\//)||(t=`https://${y.mpId}.app.jolibox.com${e.startsWith("/")?"":"/"}${e}`);let r=O("openSchemaSync",{schema:t});if(r.errNo!==0)throw new $e(r.errMsg,r.errNo)}}),Cc=D("openPageSync",{paramsSchema:f.tuple(f.string()),implement:e=>{let{errNo:t,errMsg:r,data:n}=O("openPageSync",{url:e});if(t!==0||!n)throw new $e(r,t);return{webviewId:n.webviewId}}}),Pc=D("closePageSync",{paramsSchema:f.tuple(f.number()),implement:e=>{let{errNo:t,errMsg:r}=O("closePageSync",{webviewId:e});if(t!==0)throw new $e(r,t)}});cn.registerCommand("RouterSDK.openSchema",Ac);cn.registerCommand("RouterSDK.openPage",Cc);cn.registerCommand("RouterSDK.closePage",Pc);I("router.openSchema",{version:"1.1.10"});I("router.openPage",{version:"1.1.10"});I("router.closePage",{version:"1.1.10"})});var Nc={};var ff,vf,zi=k(()=>{"use strict";Oi();ff=fn(Di());$i();Hi();Ki();vf=fn(Vi());Gi();qi();Wi()});var Qi=Symbol.for("JOLIBOX_IMPLEMENT_INIT");if(window[Qi])throw console.info("Jolibox Implement Already Initialized"),new Error("Jolibox Implement Already Initialized");window[Qi]=!0;E(void 0,null,function*(){let[{config:e}]=yield Promise.all([Promise.resolve().then(()=>(Ii(),Ti)),Promise.resolve().then(()=>(zi(),Nc)),Promise.resolve().then(()=>(ge(),xo))]);e()});
|
|
127
|
+
`);throw e.errors.length=0,Xr(!1),new TypeError(n)}}var f,nn=k(()=>{"use strict";tn();tn();f={object(e){return new Ft(e)},array(e){return new Lt(e)},tuple(...e){return new Bt(...e)},literal(e){return new jt(e)},or(...e){return new Mt(...e)},symbol(){return new Ct},record(e){return new Ut(e)},function(){return new Ot},boolean(){return new Rt},string(){return new At},number(){return new It},undefined(){return new Pt},null(){return new Nt},unknown(){return new Ce},any(){return new Ce},as(){return new Ce},arraybuffer(){return new $t},enum(...e){return new Dt(...e)},typedarray(e){return new Ht(e)}}});var Kt,Ci,Pi=k(()=>{"use strict";P();oe();nn();xe();Kt=1,Ci=e=>{function t(n,o){return(...i)=>{var u,p,m,g;let s=Date.now(),a={method:n,trace_id:Kt};Kt+=1;let l="SUCCESS",c=`${n}:ok`,d=0;try{if(o.paramsSchema)try{rn(o.paramsSchema,i,"params")}catch(v){throw Cr(`${n}:fail ${v.message}`)}let b=o.implement(...i),h=b,_=`${n}:ok`;if(b&&"code"in b){let{code:v,data:S,message:R}=b;l=v,h=S,_=R}return{code:l,message:_,data:h}}catch(b){let h=b;d=(p=(u=h.code)!=null?u:h.errNo)!=null?p:2e3,l="FAILURE";let _=(g=(m=h.message)!=null?m:h.errMsg)!=null?g:`${b}`;return c=`${n}:${l} ${_.replace(/^\S+:(fail|cancel)\s?/,"")}`,K(new He(c,d)),{code:l,message:c}}finally{let b=Date.now()-s;e("apiInvoked",N(w({},a),{duration:b,status:l}))}}}function r(n,o){return(...i)=>E(this,null,function*(){var p,m,g,b;let s=$n(i)?i:[i],a=Date.now(),l={method:n,trace_id:Kt};Kt+=1;let c=`${n}:ok`,d="SUCCESS",u={code:d,message:c};try{if(o.paramsSchema)try{rn(o.paramsSchema,s,"params")}catch(v){throw Cr(v.message)}let _=yield o.implement(...s);if(_&&"code"in _){let{code:v,data:S,message:R}=_;d=v,c=R,_=S}return Object.assign(u,{code:d,message:c,data:_}),u}catch(h){let _=h,v=(m=(p=_.code)!=null?p:_.errNo)!=null?m:2e3;d="FAILURE";let S=(b=(g=_.message)!=null?g:_.errMsg)!=null?b:`${h}`,R=`${n}:${d} ${S.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(u,{code:d,message:R}),K(new He(R,v)),u}finally{let h=Date.now()-a;e("apiInvoked",N(w({},l),{duration:h,status:d}))}})}return{createAPI:r,createSyncAPI:t}}});var $,D,x,ie=k(()=>{"use strict";Ri();ge();Pi();nn();({createAPI:$,createSyncAPI:D}=Ci(Y)),x=Ii("native")});var Ni,Hl,Kl,Vl,Jl,Oi=k(()=>{"use strict";P();ie();G();Ni=j(),Hl="env",Kl="getSystemInfoSync",Vl=D(Kl,{implement:()=>{var r;let e=O("envSync"),{data:t}=e;return{system:t.deviceInfo.system,platform:t.deviceInfo.platform,version:t.sdkInfo.jssdkVersion,pixelRatio:t.deviceInfo.pixelRatio,language:t.deviceInfo.lang,brand:t.deviceInfo.brand,appName:(r=t.hostInfo)==null?void 0:r.appName,SDKVersion:t.sdkInfo.jssdkVersion}}}),Jl=D(Hl,{implement:()=>{var t;let e=O("envSync");return(t=e==null?void 0:e.data)!=null?t:void 0}});Ni.registerCommand("API.getSystemInfoSync",Vl);Ni.registerCommand("API.env",Jl);x("env",{version:"1.0.0"});x("getSystemInfoSync",{version:"1.0.0"})});var Di=pn(on=>{"use strict";P();ie();oe();G();ge();J();var Gl="exitGame",ql="onReady",Wl="onJoliboxShow",zl="onJoliboxHide",Vt=j(),Jt=it(K),Ql=$(Gl,{paramsSchema:f.tuple(f.function(),f.boolean().optional().default(!1)),implement:(e,t=!1)=>E(on,null,function*(){Jt(e).call(on),Me(y.shouldInterupt)&&!y.shouldInterupt&&y.from&&Ln("onRetentionResult",{shouldStay:t},y.from,!0),yield Q("exitAppAsync")})}),Yl=D(Wl,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);re("onJoliboxEnterForeground",()=>{t.call(this),Ke.emit("visible",!0)})}}),Xl=D(zl,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);re("onJoliboxEnterBackground",()=>{t.call(this),Ke.emit("visible",!1)})}}),Zl=D(ql,{paramsSchema:f.tuple(f.function()),implement(e){let t=Jt(e);ce.on("LifecycleEvent.onReady",r=>{t(r)})}});Vt.registerCommand("LifecycleSDK.exit",Ql);Vt.registerCommand("LifecycleSDK.onReady",Zl);Vt.registerCommand("LifecycleSDK.onJoliboxShow",Yl);Vt.registerCommand("LifecycleSDK.onJoliboxHide",Xl);x("lifeCycle.exit",{version:"1.0.0"});x("lifeCycle.onReady",{version:"1.0.0"});x("lifeCycle.onJoliboxShow",{version:"1.0.0"});x("lifeCycle.onJoliboxHide",{version:"1.0.0"})});function Li(e){let t={};if(!ye(e))return t;for(let[r,n]of Object.entries(e)){let o=r.toLocaleLowerCase();n?typeof n=="object"?t[o]=Object.prototype.toString.call(n):t[o]=String(n):t[o]=""}return t}function Ui(e="GET"){if(e==="")return"POST";let t=e.toUpperCase();return["GET","OPTIONS","HEAD","POST","PUT","DELETE","TRACE","CONNECT","PATCH"].includes(t)?t:"GET"}function Fi(e,t=!1){if(e)return t||e>0&&e<=6e4?Math.ceil(e):6e4}function ji(e,t,r){if(["POST","PUT","PATCH"].includes(t)||!ye(r))return e;let[n,o=""]=e.split("?"),i=new URLSearchParams(o);for(let[a,l]of Object.entries(r))l!=null&&i.append(a,String(l));let s=i.toString();return s?`${n}?${s}`:n}var Mi=k(()=>{"use strict";P()});var ec,tc,sn,an,Bi,rc,nc,oc,$i=k(()=>{"use strict";xe();Or();ie();Mi();P();oe();J();ec=15,tc=lt("createRequestTaskSync","operateRequestTaskSync",{type:"public",baseUrl:y.baseApiHost}),sn=0,an=[],Bi=it(K),rc=(e,t)=>{let r=e.filter(t),n=e.filter(o=>!t(o));return e.length=0,e.push(...n),r},nc=e=>{let t=new fe,r=()=>{};return D("request",{paramsSchema:f.tuple(f.object({url:f.string(),method:f.string(),headers:f.object(),data:f.object().optional(),query:f.object().optional(),dataType:f.string().default("json"),responseType:f.string().default("text"),enableCache:f.boolean().default(!1),appendHostCookie:f.boolean().default(!0),timeout:f.number().default(3e4),success:f.function(),fail:f.function()})),implement(o){let i=()=>E(this,null,function*(){var a,l;let s=Bi(o.fail);try{if(sn+=1,t.state!=="pending")return;let{data:c,dataType:d,responseType:u,enableCache:p,appendHostCookie:m}=o,g=Li(o.headers),b=Ui(o.method),h=Fi(o.timeout),_=ji(o.url,b,c),v=Bi(o.success),S=Object.assign({},o,{method:b,header:g,data:b==="GET"||b==="HEAD"?void 0:c,enableCache:p,query:(a=o.query)!=null?a:{},dataType:d,responseType:u,appendHostCookie:m});h&&(S.timeout=h);let R=tc(_,S);{let{response:A}=yield R,{code:C,data:H,message:z}=A;if(H&&typeof H=="object"&&"status"in H&&H.status!==200)throw _e({code:H.status||-1,msg:`request:fail status ${H.status}`});t.resolve({code:C!=null?C:"SUCCESS",data:H,message:z!=null?z:"request:ok"}),v({code:"SUCCESS",message:"request:ok",data:H})}}catch(c){t.reject(c),s({code:"FAILURE",message:"httpRequst: failed"})}finally{sn-=1,(l=an.shift())==null||l()}});return sn>=ec?(r=()=>{rc(an,s=>s===i)},an.push(i)):i(),t.promise}})(e),{abort(){t.reject(_e({code:-1,msg:"request:fail abort"})),r()}}},oc=j();oc.registerCommand("HttpSDK.request",nc);x("request",{version:"1.0.0"})});function uc(e){let t=Object.prototype.toString.call(e).split(" ")[1].split("]")[0].toLocaleLowerCase();return cc.includes(t)?t:""}function dc(e,t){try{switch(t){case"string":return e;case"object":return JSON.parse(e);case"number":return parseFloat(e);case"boolean":return e==="true";default:return""}}catch(r){return""}}function pc(e,t){try{switch(t){case"string":case"number":case"boolean":return`${e}`;case"object":return JSON.stringify(e);default:return""}}catch(r){return""}}var Gt,ic,sc,ac,lc,Am,Cm,cc,Hi=k(()=>{"use strict";ie();G();P();Ie();J();Gt=j(),ic=$("getLocalStorage",{paramsSchema:f.tuple(f.string()),implement(e){return E(this,null,function*(){let{response:t}=yield q(`/api/games/user-storage/${y.mpId}`,{method:"GET",responseType:"json",appendHostCookie:!0,query:{key:e}}),{data:{code:r,message:n,data:o}}=yield t;if(r==="SUCCESS")return{code:r,message:n,data:o==null?void 0:o.value};try{let{data:{data:i,dataType:s}}=yield Q("getLocalStorageAsync",{key:e}),a=dc(i,s);return{code:r,message:`${n}. fallback to native`,data:a}}catch(i){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get local storage failed",data:null}}})}});Gt.registerCommand("StorageSDK.getItem",ic);x("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});sc=$("setStorage",{paramsSchema:f.tuple(f.string(),f.or(f.string(),f.boolean(),f.number())),implement(e,t){return E(this,null,function*(){let r=y.mpId,n=typeof t=="string"?t:String(t),{response:o}=yield q(`/api/games/user-storage/${r}`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e,value:n}}),{data:{code:i,message:s}}=o,a=uc(t),l=pc(t,a);return yield Q("setLocalStorageAsync",{key:e,data:l,dataType:a}),i=="SUCCESS"?{code:i,message:s}:{code:i,message:`${s}. fallback to native`}})}});Gt.registerCommand("StorageSDK.setItem",sc);x("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});ac=$("removeStorage",{paramsSchema:f.tuple(f.string()),implement(e){return E(this,null,function*(){let t=y.mpId,{response:r}=yield q(`/api/games/user-storage/${t}/remove`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e}}),{data:{code:n,message:o}}=r;return yield Q("removeLocalStorageAsync",{key:e}),n==="SUCCESS"?{code:n,message:o}:{code:n,message:"[Jolibox SDK] remove item succ"}})}});Gt.registerCommand("StorageSDK.removeItem",ac);x("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});lc=$("clearStorage",{implement(){return E(this,null,function*(){let e=y.mpId,{response:t}=yield q(`/api/games/user-storage/${e}/clear`,{method:"POST",appendHostCookie:!0});Q("clearLocalStorageAsync");let{data:{code:r,message:n}}=t;return r==="SUCCESS"?{code:r,message:n}:{code:r,message:`${n}.fallback to native`}})}});Gt.registerCommand("StorageSDK.clear",lc);x("storage.clear",{version:"1.0.0"});Am=$("getStorageInfo",{implement(){return E(this,null,function*(){let{data:e}=yield Q("getStorageInfoAsync");return e})}});x("getStorageInfo",{version:"1.0.0",success:{keys:"1.0.0",currentSize:"1.0.0",limitSize:"1.0.0"}});Cm=D("getStorageInfoSync",{implement(){return O("getStorageInfoSync")}}),cc=["string","number","boolean","object",""]});var mc,fc,hc,ln,Ki=k(()=>{"use strict";P();G();ie();mc=D("showKeyboard",{paramsSchema:f.tuple(f.object({defaultValue:f.string().optional().default(""),multiple:f.boolean().optional().default(!1),maxLength:f.unknown().optional().default(1e5)})),implement(e){var n;let t=Math.floor((n=Number(e.maxLength))!=null?n:1e5),{defaultValue:r}=e;r&&t&&(r=r.slice(0,t)),O("showKeyboardSync",N(w({},e),{defaultValue:r,maxLength:t}))}});x("keyboard.showKeyboard",{version:"1.0.0",properties:{params:{defaultValue:"1.0.0",multiple:"1.0.0",confirmHold:"1.0.0",confirmType:"1.0.0",maxLength:"1.0.0"}},success:{errMsg:"1.0.0"}});fc=D("updateKeyboard",{paramsSchema:f.tuple(f.object({value:f.string()})),implement(e){O("updateKeyboardSync",e)}});x("keyboard.updateKeyboard",{version:"1.0.0",properties:{params:{value:"1.0.0"}}});hc=D("hideKeyboard",{implement(){O("hideKeyboardSync")}});x("keyboard.hideKeyboard",{version:"1.0.0"});ln=j();ln.registerCommand("KeyboardSDK.showKeyboard",mc);ln.registerCommand("KeyboardSDK.updateKeyboard",fc);ln.registerCommand("KeyboardSDK.hideKeyboard",hc)});var Vi=pn(Se=>{"use strict";P();ie();ge();var Pe=j(),_c=$("levelFinished",{paramsSchema:f.tuple(f.string(),f.object({result:f.boolean(),duration:f.number()})),implement:(e,t)=>E(Se,null,function*(){let{result:r,duration:n}=t,o=[];o.push(W.tracker("LevelFinished",{levelId:e,result:r,duration:n})),o.push(W.reporter({event:"COMPLETE_GAME_LEVEL"})),yield Promise.all(o)})}),gc=$("taskFinished",{paramsSchema:f.tuple(f.string(),f.object({duration:f.number()})),implement:(e,t)=>E(Se,null,function*(){let{duration:r}=t;return yield W.reportToNative({event:"TaskFinished",params:{duration:r,taskId:e}})})}),vc=$("levelUpgrade",{paramsSchema:f.tuple(f.string(),f.string()),implement:(e,t)=>E(Se,null,function*(){let r=[];r.push(W.reportToNative({event:"LevelUpgrade",params:{name:t,levelId:e}})),yield Promise.all(r)})}),yc=$("onHistoryUserLevel",{paramsSchema:f.tuple(f.number()),implement:e=>E(Se,null,function*(){return yield W.reportToNative({event:"HistoryUserLevel",params:{level:e}})})}),bc=$("onHistoryUserScore",{paramsSchema:f.tuple(f.number()),implement:e=>E(Se,null,function*(){return yield W.reportToNative({event:"HistoryUserScore",params:{score:e}})})}),wc=$("taskEvent",{paramsSchema:f.tuple(f.string(),f.object({tools:f.array(f.object({id:f.string(),name:f.string(),count:f.number(),description:f.string().optional(),price:f.object({amount:f.number(),unit:f.string()}).optional()})).optional(),awards:f.array(f.object({id:f.string(),name:f.string()})).optional()})),implement:(e,t)=>E(Se,null,function*(){var n,o;let r=[];r.push(W.reportToNative({event:"TaskEvent",params:w({taskId:e},t)})),(o=(n=t.tools)==null?void 0:n.length)!=null&&o&&(r.push(W.reporter({event:"USE_GAME_ITEM"})),r.push(W.reportToNative({event:"UseGameItem",params:w({taskId:e},t)}))),yield Promise.all(r)})});Pe.registerCommand("TaskTrackerSDK.levelFinished",_c);Pe.registerCommand("TaskTrackerSDK.taskFinished",gc);Pe.registerCommand("TaskTrackerSDK.levelUpgrade",vc);Pe.registerCommand("TaskTrackerSDK.historyUserLevel",yc);Pe.registerCommand("TaskTrackerSDK.historyUserScore",bc);Pe.registerCommand("TaskTrackerSDK.taskEvent",wc);x("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});x("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});x("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});x("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});x("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});x("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});var Ec,kc,Ji,Gi=k(()=>{"use strict";J();G();ie();P();xe();x("login",{version:"1.0.0",properties:{force:"1.0.0"},success:{errMsg:"1.0.0",code:"1.0.0",token:"1.0.0",isLogin:"1.0.0"}});x("checkSession",{version:"1.0.0",success:{errMsg:"1.0.0"}});Ec=$("login",{implement(){return E(this,null,function*(){var s;let{data:{isLogin:e}}=yield Q("checkLoginAsync");if(e)return{isLogin:!0,token:(s=y.hostUserInfo)==null?void 0:s.token};re("onLoginStateChange",({isLogin:a,token:l,uuid:c})=>{c==r&&o({isLogin:a,token:l})});let t=O("loginSync"),{data:{uuid:r}}=t;if(!r)throw _e({code:-1,msg:"login failed"});let{promise:n,resolve:o}=new fe,i=yield n;return y.onEnvConfigChanged({hostUserInfo:i}),ce.emit("onLoginComplete",i),i})}}),kc=$("checkSession",{implement(){return E(this,null,function*(){let{data:{isLogin:e}}=yield Q("checkLoginAsync");return{isLogin:e}})}}),Ji=j();Ji.registerCommand("API.login",Ec);Ji.registerCommand("API.checkSession",kc)});var qt,Sc,Wt,Tc,xc,Ic,Rc,qi=k(()=>{"use strict";P();ie();Lr();ge();Ie();G();qt=j(),Sc=()=>{let{data:e}=O("getNetworkStatusSync");return!!(e!=null&&e.isConnected)},Wt=new mt(Y,{get:(e,t)=>q(e,w({method:"GET",responseType:"json",appendHostCookie:!0},t)).then(r=>r.response.data),post:(e,t,r)=>q(e,w({method:"POST",responseType:"json",appendHostCookie:!0},r)).then(n=>n.response.data)},Sc),Tc=D("adInit",{implement:e=>{Wt.init(e)}}),xc=D("adConfig",{implement:e=>{Wt.adConfig(e)}}),Ic=D("adBreak",{implement:e=>{Wt.adBreak(e)}}),Rc=D("adUnit",{implement:e=>{Wt.adUnit(e)}});qt.registerCommand("AdsSDK.init",Tc);qt.registerCommand("AdsSDK.adConfig",xc);qt.registerCommand("AdsSDK.adBreak",Ic);qt.registerCommand("AdsSDK.adUnit",Rc);x("AdsSDK.init",{version:"1.0.0"});x("AdsSDK.adConfig",{version:"1.0.0"});x("AdsSDK.adBreak",{version:"1.0.0"});x("AdsSDK.adUnit",{version:"1.0.0"})});var cn,Ac,Cc,Pc,Wi=k(()=>{"use strict";P();G();ie();J();cn=j(),Ac=D("openSchemaSync",{paramsSchema:f.tuple(f.string()),implement:e=>{let t=e;e.match(/^https?:\/\//)||(t=`https://${y.mpId}.app.jolibox.com${e.startsWith("/")?"":"/"}${e}`);let r=O("openSchemaSync",{schema:t});if(r.errNo!==0)throw new $e(r.errMsg,r.errNo)}}),Cc=D("openPageSync",{paramsSchema:f.tuple(f.string()),implement:e=>{let{errNo:t,errMsg:r,data:n}=O("openPageSync",{url:e});if(t!==0||!n)throw new $e(r,t);return{webviewId:n.webviewId}}}),Pc=D("closePageSync",{paramsSchema:f.tuple(f.number()),implement:e=>{let{errNo:t,errMsg:r}=O("closePageSync",{webviewId:e});if(t!==0)throw new $e(r,t)}});cn.registerCommand("RouterSDK.openSchema",Ac);cn.registerCommand("RouterSDK.openPage",Cc);cn.registerCommand("RouterSDK.closePage",Pc);x("router.openSchema",{version:"1.1.10"});x("router.openPage",{version:"1.1.10"});x("router.closePage",{version:"1.1.10"})});var Nc={};var mf,gf,zi=k(()=>{"use strict";Oi();mf=fn(Di());$i();Hi();Ki();gf=fn(Vi());Gi();qi();Wi()});var Qi=Symbol.for("JOLIBOX_IMPLEMENT_INIT");if(window[Qi])throw console.info("Jolibox Implement Already Initialized"),new Error("Jolibox Implement Already Initialized");window[Qi]=!0;E(void 0,null,function*(){let[{config:e}]=yield Promise.all([Promise.resolve().then(()=>(xi(),Ti)),Promise.resolve().then(()=>(zi(),Nc)),Promise.resolve().then(()=>(ge(),Io))]);e()});
|