@xyz-fe/log 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,9 +1,8 @@
1
1
  /*!
2
- * @xyz-fe/log v4.2.0
2
+ * @xyz-fe/log v4.3.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- var e=function(){return e=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]])}return o}function o(e,t,o,n){return new(o||(o=Promise))((function(i,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function n(e,t){var o,n,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(i=2&r[0]?n.return:r[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;switch(n=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,n=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],n=0}finally{o=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function i(e,t,o){if(o||2===arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function r(e){return void 0!==typeof localStorage?localStorage.getItem("XYZ_LOG_"+e):null}function a(e,t){void 0!==typeof localStorage&&localStorage.setItem("XYZ_LOG_"+e,t)}function s(e){return void 0!==typeof sessionStorage?sessionStorage.getItem("XYZ_LOG_"+e):null}function c(e,t){void 0!==typeof sessionStorage&&sessionStorage.setItem("XYZ_LOG_"+e,t)}function p(e,t){void 0===e&&(e=18),void 0===t&&(t=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i=Math.random,r=e,a=t||o.length,s=0;s<r;s++)n[s]=o[0|i()*a];return n.join("")}function u(e){void 0===e&&(e="UID");var t=r(e);return t||a(e,t=p()),t}function l(e){try{return e&&"string"==typeof e?e.split(".").map((function(e){return 1===e.length?"0"+e:e})).join(""):""}catch(t){return console.error('[transferVersion] ver("'.concat(e,'")格式异常:'),t),""}}function d(){var e=new Date,t=e.getFullYear().toString(),o=(e.getMonth()+1).toString(),n=e.getDate().toString();return(t=t.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(n=Number(n)<10?"0"+n:n)}function m(e,t){void 0===e&&(e=[]),void 0===t&&(t=location.href);var o=new URL(t).search.substring(1),n={};return o&&o.split("&").forEach((function(e){n[e.split("=")[0]]=e.split("=")[1]})),Object.keys(n).forEach((function(t){e.includes(t)&&delete n[t]})),n}function f(t,o){var n=e({},t),i=e({},o);return Object.keys(n).forEach((function(e){i[e]||delete i[e]})),e(e({},n),i)}function h(e){for(var t,o,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!n.length)return e;var a=n.shift();if(a&&"object"==typeof a)for(var s in a)a[s]&&"object"==typeof a[s]?(e[s]||Object.assign(e,((t={})[s]={},t)),h(e[s],a[s])):Object.assign(e,((o={})[s]=a[s],o));return h.apply(void 0,i([e],n,!1))}var g=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(t){return e.includes(t)}))?"h5":"pc");var e};var v,b="3/13/2025, 5:16:49 PM";!function(e){e[e.Unknown=0]="Unknown",e[e.Male=1]="Male",e[e.Female=2]="Female"}(v||(v={}));var _,w,y=function(){function t(e){var t,o=e.domain,n=e.commonParams,i=e.isPro,r=void 0===i||i,a=e.sendOpenLog,s=void 0===a||a,c=e.consoleLog,p=void 0===c||c;this.version="4.2.0",this.buildDate=b,this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=s,this._consoleLog=p;var u=this._getApis(o),l=u.openUrl,d=u.eventUrl,m=u.actUrl,f=u.adUrl,h=u.onlineUrl;this._openUrl=l,this._eventUrl=d,this._actUrl=m,this._adUrl=f,this._onlineUrl=h,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var g,v=this._getMp(),_=v.mp,w=v.platform;this._mp=_,this._platform=w,!_||(g=_)&&0===Object.keys(g).length&&g.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",_);try{this._systemInfo=(null===(t=this._mp)||void 0===t?void 0:t.getSystemInfoSync())||{}}catch(e){console.error("[XLOG] getSystemInfoSync error",e)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(n)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var e,t,o=null;try{o=((null===(e=this._mp)||void 0===e?void 0:e.getEnterOptionsSync)||(null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||function(){})()}catch(e){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",e)}return o},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),o)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:o})})},t.prototype._init=function(e){var t=this;this._initCommonParams(this._filterParams(e));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._visibilityChange((function(){t._isColdStartUp||t._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:1})})),t._startTime=Date.now();var e=t._getOnlineBatchData();e&&t._online(e)}),(function(){t._isColdStartUp=!1,t._open({openway:5}),t._sendOnline()}))},t.prototype._getMp=function(){var e={mp:null,platform:7};return"undefined"!=typeof tt?(e.mp=tt,e.platform=2):"undefined"!=typeof ks?(e.mp=ks,e.platform=3):"undefined"!=typeof swan?(e.mp=swan,e.platform=4):"undefined"!=typeof qq?(e.mp=qq,e.platform=5):"undefined"!=typeof wx?(e.mp=wx,e.platform=1):"undefined"!=typeof my?e.mp=my:"undefined"!=typeof jd&&(e.mp=jd),e},t.prototype._visibilityChange=function(e,t){var o,n,i,r,a=this;void 0===e&&(e=function(){}),void 0===t&&(t=function(){});try{var s=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(n=this._mp)||void 0===n?void 0:n.onShow)||function(){},c=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};s((function(){a._consoleLog&&console.log("[XLOG] onAppShow"),e()})),c((function(){a._consoleLog&&console.log("[XLOG] onAppHide"),t()}))}catch(e){console.error("[XLOG] onAppShow or onAppHide error",e)}},t.prototype._getStorage=function(e){var t;try{return null===(t=this._mp)||void 0===t?void 0:t.getStorageSync("XYZ_LOG_".concat(e))}catch(e){console.error("[XLOG] getStorageSync error",e)}},t.prototype._setStorage=function(e,t){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(e),t)}catch(e){console.error("[XLOG] setStorageSync error",e)}},t.prototype._getBatchId=function(){var e=this._getStorage("BATCH_ID");return e&&!this._isColdStartUp||(e=p(),this._setStorage("BATCH_ID",e)),e},t.prototype._coldStartUp=function(){var e=this;this._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:0})}))},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},n=e(e({},o),t);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(n.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(e){this._setStorage("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){var e,t=(null===(e=this._systemInfo.system)||void 0===e?void 0:e.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+d(),os:this._systemInfo.platform,osversion:t,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),n=this._getStorage("COMMON_PARAMS");n&&(o=e(e({},o),JSON.parse(n))),o=t?f(o,t):o,this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var e=this;return new Promise((function(t){var o;try{null===(o=e._mp)||void 0===o||o.getNetworkType({success:function(e){t(e.networkType)},fail:function(){t("none")}})}catch(e){t("none"),console.error("[XLOG] getNetworkType error",e)}}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var n={};if(this.commonParams.userinfo)try{n=JSON.parse(this.commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(e(e(e({},this._extraInfo),n),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var n in e){var i=e[n];o.includes(n)&&i&&(t[n]=i)}}return t},t.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.openid,o=this._commonParams.unionid;e=this._filterParams(e),this._updateCommonParams(e),(e.openid&&e.openid!==t||e.unionid&&e.unionid!==o)&&this._open({isreturn:e.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+d()),t.appver&&(t.appverint=l(t.appver)),this._commonParams=f(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t,o){var n=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(i,r){var a;try{null===(a=n._mp)||void 0===a||a.request({url:e,data:t,method:"POST",header:{"content-type":o},success:function(o){n._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,o),i(o)},fail:function(o){n._consoleLog&&console.log("[XLOG] FAIL: ".concat(e),t,o),r(o)}})}catch(e){console.error("[XLOG] request error",e),r(e)}}))},t.prototype.open=function(e){this._open({querystring:e.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var n=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:"4.2.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",n),this._request(this._openUrl,n)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},t.prototype.code2session=function(e){return o(this,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return t="",1===this._platform?t="wx/":3===this._platform&&(t="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(t,"code2session"),[4,this._request(o,{appTypeId:e.apptypeid,code:e.code,testNet:e.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},t.prototype.getSubsidy=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e.apptypeid,os:this._systemInfo.platform,openId:e.openId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.getUserProps=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e.apptypeid,openId:e.openId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.checkOrder=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:e.apptypeid,os:this._systemInfo.platform,openId:e.openId,orderId:e.orderId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.createOrder=function(e){return o(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e.apptypeid,os:this._systemInfo.platform,openId:e.openId,productId:e.productId,payPlatform:e.payPlatform},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},t.prototype._setOnlineBatchData=function(e){this._setStorage("ONLINE_BACH_DATA",e)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){t._setOnlineBatchData(e)}))},t}(),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P={exports:{}};_=P,w=P.exports,function(e,t){var o="function",n="undefined",i="object",r="string",a="model",s="name",c="type",p="vendor",u="version",l="architecture",d="console",m="mobile",f="tablet",h="smarttv",g="wearable",v="embedded",b="Amazon",y="Apple",O="ASUS",P="BlackBerry",S="Firefox",k="Google",x="Huawei",L="LG",A="Microsoft",U="Motorola",C="Opera",I="Samsung",N="Sony",q="Xiaomi",T="Zebra",D="Facebook",R=function(e){for(var t={},o=0;o<e.length;o++)t[e[o].toUpperCase()]=e[o];return t},E=function(e,t){return typeof e===r&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},j=function(e,t){if(typeof e===r)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===n?e:e.substring(0,255)},M=function(e,n){for(var r,a,s,c,p,u,l=0;l<n.length&&!p;){var d=n[l],m=n[l+1];for(r=a=0;r<d.length&&!p;)if(p=d[r++].exec(e))for(s=0;s<m.length;s++)u=p[++a],typeof(c=m[s])===i&&c.length>0?2===c.length?typeof c[1]==o?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==o||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):t:this[c[0]]=u?c[1].call(this,u,c[2]):t:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):t):this[c]=u||t;l+=2}},X=function(e,o){for(var n in o)if(typeof o[n]===i&&o[n].length>0){for(var r=0;r<o[n].length;r++)if(E(o[n][r],e))return"?"===n?t:n}else if(E(o[n],e))return"?"===n?t:n;return e},B={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,u],[/opios[\/ ]+([\w\.]+)/i],[u,[s,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[u,[s,C]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,u],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[u,[s,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[u,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[u,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[u,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[u,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],u],[/\bfocus\/([\w\.]+)/i],[u,[s,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[u,[s,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[u,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[s,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[u,[s,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[u,[s,S]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],u],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],u],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[s,u],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,D],u],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[s,u],[/\bgsa\/([\w\.]+) .*safari\//i],[u,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[u,[s,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],u],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[u,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,u],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[u,[s,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[u,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[u,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[s,u],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],u],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[u,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[s,u]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[l,"amd64"]],[/(ia32(?=;))/i],[[l,G]],[/((?:i[346]|x)86)[;\)]/i],[[l,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[l,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[l,"armhf"]],[/windows (ce|mobile); ppc;/i],[[l,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[l,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[l,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[l,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[p,I],[c,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[p,I],[c,m]],[/\((ip(?:hone|od)[\w ]*);/i],[a,[p,y],[c,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[p,y],[c,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[p,x],[c,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[a,[p,x],[c,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[p,q],[c,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[p,q],[c,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[p,"OPPO"],[c,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[p,"Vivo"],[c,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[p,"Realme"],[c,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[a,[p,U],[c,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[p,U],[c,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[p,L],[c,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[p,L],[c,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[p,"Lenovo"],[c,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[p,"Nokia"],[c,m]],[/(pixel c)\b/i],[a,[p,k],[c,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[p,k],[c,m]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[p,N],[c,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[p,N],[c,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[p,"OnePlus"],[c,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[p,b],[c,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[p,b],[c,m]],[/(playbook);[-\w\),; ]+(rim)/i],[a,p,[c,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[p,P],[c,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[p,O],[c,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[p,O],[c,m]],[/(nexus 9)/i],[a,[p,"HTC"],[c,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[p,[a,/_/g," "],[c,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[p,"Acer"],[c,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[p,"Meizu"],[c,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[p,"Sharp"],[c,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,a,[c,m]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,a,[c,f]],[/(surface duo)/i],[a,[p,A],[c,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[p,"Fairphone"],[c,m]],[/(u304aa)/i],[a,[p,"AT&T"],[c,m]],[/\bsie-(\w*)/i],[a,[p,"Siemens"],[c,m]],[/\b(rct\w+) b/i],[a,[p,"RCA"],[c,f]],[/\b(venue[\d ]{2,7}) b/i],[a,[p,"Dell"],[c,f]],[/\b(q(?:mv|ta)\w+) b/i],[a,[p,"Verizon"],[c,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[p,"Barnes & Noble"],[c,f]],[/\b(tm\d{3}\w+) b/i],[a,[p,"NuVision"],[c,f]],[/\b(k88) b/i],[a,[p,"ZTE"],[c,f]],[/\b(nx\d{3}j) b/i],[a,[p,"ZTE"],[c,m]],[/\b(gen\d{3}) b.+49h/i],[a,[p,"Swiss"],[c,m]],[/\b(zur\d{3}) b/i],[a,[p,"Swiss"],[c,f]],[/\b((zeki)?tb.*\b) b/i],[a,[p,"Zeki"],[c,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],a,[c,f]],[/\b(ns-?\w{0,9}) b/i],[a,[p,"Insignia"],[c,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[p,"NextBook"],[c,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],a,[c,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],a,[c,m]],[/\b(ph-1) /i],[a,[p,"Essential"],[c,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[p,"Envizen"],[c,f]],[/\b(trio[-\w\. ]+) b/i],[a,[p,"MachSpeed"],[c,f]],[/\btu_(1491) b/i],[a,[p,"Rotor"],[c,f]],[/(shield[\w ]+) b/i],[a,[p,"Nvidia"],[c,f]],[/(sprint) (\w+)/i],[p,a,[c,m]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[p,A],[c,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[p,T],[c,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[p,T],[c,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,a,[c,d]],[/droid.+; (shield) bui/i],[a,[p,"Nvidia"],[c,d]],[/(playstation [345portablevi]+)/i],[a,[p,N],[c,d]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[p,A],[c,d]],[/smart-tv.+(samsung)/i],[p,[c,h]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[p,I],[c,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,L],[c,h]],[/(apple) ?tv/i],[p,[a,"Apple TV"],[c,h]],[/crkey/i],[[a,"Chromecast"],[p,k],[c,h]],[/droid.+aft(\w)( bui|\))/i],[a,[p,b],[c,h]],[/\(dtv[\);].+(aquos)/i],[a,[p,"Sharp"],[c,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,j],[a,j],[c,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,h]],[/((pebble))app/i],[p,a,[c,g]],[/droid.+; (glass) \d/i],[a,[p,k],[c,g]],[/droid.+; (wt63?0{2,3})\)/i],[a,[p,T],[c,g]],[/(quest( 2)?)/i],[a,[p,D],[c,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[c,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[c,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,f]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[c,m]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[u,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[s,u],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,u],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[s,[u,X,B]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,"Windows"],[u,X,B]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[u,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[u,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,u],[/\(bb(10);/i],[u,[s,P]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[u,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[u,[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[u,[s,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[s,"Chromium OS"],u],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[s,u],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],u],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[s,u]]},z=function(o,a){if(typeof o===i&&(a=o,o=t),!(this instanceof z))return new z(o,a).getResult();var s=o||(typeof e!==n&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),c=a?function(e,t){var o={};for(var n in e)t[n]&&t[n].length%2==0?o[n]=t[n].concat(e[n]):o[n]=e[n];return o}(J,a):J;return this.getBrowser=function(){var e,o={};return o.name=t,o.version=t,M.call(o,s,c.browser),o.major=typeof(e=o.version)===r?e.replace(/[^\d\.]/g,"").split(".")[0]:t,o},this.getCPU=function(){var e={};return e.architecture=t,M.call(e,s,c.cpu),e},this.getDevice=function(){var e={};return e.vendor=t,e.model=t,e.type=t,M.call(e,s,c.device),e},this.getEngine=function(){var e={};return e.name=t,e.version=t,M.call(e,s,c.engine),e},this.getOS=function(){var e={};return e.name=t,e.version=t,M.call(e,s,c.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return s},this.setUA=function(e){return s=typeof e===r&&e.length>255?j(e,255):e,this},this.setUA(s),this};z.VERSION="1.0.2",z.BROWSER=R([s,u,"major"]),z.CPU=R([l]),z.DEVICE=R([a,p,c,d,m,h,f,g,v]),z.ENGINE=z.OS=R([s,u]),_.exports&&(w=_.exports=z),w.UAParser=z;var H=typeof e!==n&&(e.jQuery||e.Zepto);if(H&&!H.ua){var W=new z;H.ua=W.getResult(),H.ua.get=function(){return W.getUA()},H.ua.set=function(e){W.setUA(e);var t=W.getResult();for(var o in t)H.ua[o]=t[o]}}}("object"==typeof window?window:O);var S=new P.exports.UAParser,k=S.getBrowser(),x=k.name,L=k.version,A=S.getEngine(),U=A.name,C=A.version,I=function(){var e=(0,S.getOS)();return{os:e.name,osversion:e.version}}(),N=I.os,q=I.osversion,T=function(){var e=(0,S.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),D=T.device,R=T.devicebrand;N=N||"",q=q||"",D=D||"",R=R||"";var E={exports:{}},G={exports:{}},j=1e3,M=60*j,X=60*M,B=24*X,J=365.25*B,z=function(e,t){t=t||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*J;case"days":case"day":case"d":return o*B;case"hours":case"hour":case"hrs":case"hr":case"h":return o*X;case"minutes":case"minute":case"mins":case"min":case"m":return o*M;case"seconds":case"second":case"secs":case"sec":case"s":return o*j;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return t.long?function(e){return H(e,B,"day")||H(e,X,"hour")||H(e,M,"minute")||H(e,j,"second")||e+" ms"}(e):function(e){if(e>=B)return Math.round(e/B)+"d";if(e>=X)return Math.round(e/X)+"h";if(e>=M)return Math.round(e/M)+"m";if(e>=j)return Math.round(e/j)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function H(e,t,o){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+o:Math.ceil(e/t)+" "+o+"s"}!function(e,t){var o;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,r=i-(o||i);e.diff=r,e.prev=o,e.curr=i,o=i;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(o,n){if("%%"===o)return o;c++;var i=t.formatters[n];if("function"==typeof i){var r=a[c];o=i.call(e,r),a.splice(c,1),c--}return o})),t.formatArgs.call(e,a);var p=n.log||t.log||console.log.bind(console);p.apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var o,n=0;for(o in e)n=(n<<5)-n+e.charCodeAt(o),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=G.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),n=o.length,i=0;i<n;i++)o[i]&&("-"===(e=o[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var o,n;for(o=0,n=t.skips.length;o<n;o++)if(t.skips[o].test(e))return!1;for(o=0,n=t.names.length;o<n;o++)if(t.names[o].test(e))return!0;return!1},t.humanize=z,t.names=[],t.skips=[],t.formatters={}}(0,G.exports),function(e,t){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=G.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+t.humanize(this.diff),!o)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(r=i))})),e.splice(r,0,n)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}(E,E.exports);var W=E.exports("jsonp"),F=function(e,t,o){"function"==typeof t&&(o=t,t={});t||(t={});var n,i,r=t.prefix||"__jp",a=t.name||r+V++,s=t.param||"callback",c=null!=t.timeout?t.timeout:6e4,p=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(i=setTimeout((function(){l(),o&&o(new Error("Timeout"))}),c));function l(){n.parentNode&&n.parentNode.removeChild(n),window[a]=Z,i&&clearTimeout(i)}return window[a]=function(e){W("jsonp got",e),l(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+p(a)).replace("?&","?"),W('jsonp req "%s"',e),(n=document.createElement("script")).src=e,u.parentNode.insertBefore(n,u),function(){window[a]&&l()}},V=0;function Z(){}function Y(e,t){return void 0===t&&(t={}),new Promise((function(o,n){var i;F("".concat(e,"?").concat((i=t,Object.keys(i).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(i[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__")},(function(e,t){e?n(e):o(t)}))}))}var $=function(e,t){return Y(e,t)},K=function(){function t(e){var t=e.domain,o=e.commonParams,n=e.isPro,i=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s;this.version="4.2.0",this.buildDate=b,this._urlParams=m(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._isPro=i,this._sendOpenLog=a,this._consoleLog=c;var p=this._getApis(t),u=p.openUrl,l=p.eventUrl,d=p.actUrl;this._openUrl=u,this._eventUrl=l,this._actUrl=d,this._updateCommonParams(this._filterParams(o)),this._init()}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._init=function(){var e=this;this._initCommonParams(),this._coldStartUp(),this._visibilityChange((function(){e._updateCommonParams({network:e._getNetWorkType()}),e._open(1)}),(function(){e._open(5)}))},t.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},t.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},t.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},t.prototype._getBatchId=function(){var e=s("BATCH_ID");return e||c("BATCH_ID",e=p()),e},t.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn"},n=e(e({},o),t);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity")}},t.prototype._cacheCommonParams=function(e){a("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){return{os:N,osversion:q,device:D,devicebrand:R,platform:7,openid:u(),appcqid:"organic",appqid:"organic"+d(),pixel:this._getScreen(),userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(){var t=this._getInitParams(),o=r("COMMON_PARAMS");o&&(t=e(e({},t),JSON.parse(o))),t=f(t,this._commonParams),this._updateCommonParams(e(e({},t),{obatchid:this._getBatchId(),network:this._getNetWorkType()}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var n={};if(this._commonParams.userinfo)try{n=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(e(e({querystring:this._urlParams},n),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["accid","apptypeid","appcqid","srcqid","appver","userinfo"];for(var n in e){var i=e[n];o.includes(n)&&i&&(t[n]=i)}}return t},t.prototype.setParams=function(e){e&&(this._consoleLog&&console.log("[XLOG] setParams",e),e=this._filterParams(e),this._updateCommonParams(e))},t.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+d()),e.appver&&(e.appverint=l(e.appver)),this._commonParams=f(this._commonParams,e),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t){$(e,t)},t.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{openway:t,appqid:this._getAppqid(),xmlog:"4.2.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t}();
6
+ var e=function(){return e=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},e.apply(this,arguments)};function t(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}function o(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function i(e,t){var o,i,n,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(o=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(6===s[0]&&r.label<n[1]){r.label=n[1],n=s;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(s);break}n[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],i=0}finally{o=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var n="XYZ_LOG_";function r(e){return void 0!==typeof localStorage?localStorage.getItem(n+e):null}function a(e,t){void 0!==typeof localStorage&&localStorage.setItem(n+e,t)}function s(e){return void 0!==typeof sessionStorage?sessionStorage.getItem(n+e):null}function c(e,t){void 0!==typeof sessionStorage&&sessionStorage.setItem(n+e,t)}function p(e,t){void 0===e&&(e=18),void 0===t&&(t=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[],n=Math.random,r=e,a=t||o.length,s=0;s<r;s++)i[s]=o[0|n()*a];return i.join("")}function u(e){void 0===e&&(e="UID");var t=r(e);return t||a(e,t=p()),t}function l(e){try{return e&&"string"==typeof e?e.split(".").map((function(e){return 1===e.length?"0"+e:e})).join(""):""}catch(t){return console.error('[transferVersion] ver("'.concat(e,'")格式异常:'),t),""}}function d(){var e=new Date,t=e.getFullYear().toString(),o=(e.getMonth()+1).toString(),i=e.getDate().toString();return(t=t.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(i=Number(i)<10?"0"+i:i)}function m(e,t){void 0===e&&(e=[]),void 0===t&&(t=location.href);var o=new URL(t).search.substring(1),i={};return o&&o.split("&").forEach((function(e){i[e.split("=")[0]]=e.split("=")[1]})),Object.keys(i).forEach((function(t){e.includes(t)&&delete i[t]})),i}function f(t,o){var i=e({},t),n=e({},o);return Object.keys(i).forEach((function(e){n[e]||delete n[e]})),e(e({},i),n)}function h(e){for(var t,o,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return e;var r=i.shift();if(r&&"object"==typeof r)for(var a in r)r[a]&&"object"==typeof r[a]?(e[a]||Object.assign(e,((t={})[a]={},t)),h(e[a],r[a])):Object.assign(e,((o={})[a]=r[a],o));return h.apply(void 0,function(e,t,o){if(o||2===arguments.length)for(var i,n=0,r=t.length;n<r;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}([e],i,!1))}var g=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(t){return e.includes(t)}))?"h5":"pc");var e};var b,w="4.3.0",v="5/12/2025, 7:52:04 PM",_="organic";!function(e){e[e.Unknown=0]="Unknown",e[e.Male=1]="Male",e[e.Female=2]="Female"}(b||(b={}));var y,O,P=function(){function t(e){var t,o=e.domain,i=e.commonParams,n=e.isPro,r=void 0===n||n,a=e.sendOpenLog,s=void 0===a||a,c=e.consoleLog,p=void 0===c||c;this.version=w,this.buildDate=v,this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=s,this._consoleLog=p;var u=this._getApis(o),l=u.openUrl,d=u.eventUrl,m=u.actUrl,f=u.adUrl,h=u.onlineUrl;this._openUrl=l,this._eventUrl=d,this._actUrl=m,this._adUrl=f,this._onlineUrl=h,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var g,b=this._getMp(),_=b.mp,y=b.platform;this._mp=_,this._platform=y,!_||(g=_)&&0===Object.keys(g).length&&g.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",_);try{this._systemInfo=(null===(t=this._mp)||void 0===t?void 0:t.getSystemInfoSync())||{}}catch(e){console.error("[XLOG] getSystemInfoSync error",e)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(i)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var e,t,o=null;try{o=((null===(e=this._mp)||void 0===e?void 0:e.getEnterOptionsSync)||(null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||function(){})()}catch(e){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",e)}return o},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),o)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:o})})},t.prototype._init=function(e){var t=this;this._initCommonParams(this._filterParams(e));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._visibilityChange((function(){t._isColdStartUp||t._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:1})})),t._startTime=Date.now();var e=t._getOnlineBatchData();e&&t._online(e)}),(function(){t._isColdStartUp=!1,t._open({openway:5}),t._sendOnline()}))},t.prototype._getMp=function(){var e={mp:null,platform:7};return"undefined"!=typeof tt?(e.mp=tt,e.platform=2):"undefined"!=typeof ks?(e.mp=ks,e.platform=3):"undefined"!=typeof swan?(e.mp=swan,e.platform=4):"undefined"!=typeof qq?(e.mp=qq,e.platform=5):"undefined"!=typeof wx?(e.mp=wx,e.platform=1):"undefined"!=typeof my?e.mp=my:"undefined"!=typeof jd&&(e.mp=jd),e},t.prototype._visibilityChange=function(e,t){var o,i,n,r,a=this;void 0===e&&(e=function(){}),void 0===t&&(t=function(){});try{var s=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(i=this._mp)||void 0===i?void 0:i.onShow)||function(){},c=(null===(n=this._mp)||void 0===n?void 0:n.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};s((function(){a._consoleLog&&console.log("[XLOG] onAppShow"),e()})),c((function(){a._consoleLog&&console.log("[XLOG] onAppHide"),t()}))}catch(e){console.error("[XLOG] onAppShow or onAppHide error",e)}},t.prototype._getStorage=function(e){var t;try{return null===(t=this._mp)||void 0===t?void 0:t.getStorageSync("XYZ_LOG_".concat(e))}catch(e){console.error("[XLOG] getStorageSync error",e)}},t.prototype._setStorage=function(e,t){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(e),t)}catch(e){console.error("[XLOG] setStorageSync error",e)}},t.prototype._getBatchId=function(){var e=this._getStorage("BATCH_ID");return e&&!this._isColdStartUp||(e=p(),this._setStorage("BATCH_ID",e)),e},t.prototype._coldStartUp=function(){var e=this;this._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:0})}))},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(i.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(i.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(e){this._setStorage("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){var e,t=(null===(e=this._systemInfo.system)||void 0===e?void 0:e.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:_,appqid:_+d(),os:this._systemInfo.platform,osversion:t,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),i=this._getStorage("COMMON_PARAMS");i&&(o=e(e({},o),JSON.parse(i))),o=t?f(o,t):o,this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var e=this;return new Promise((function(t){var o;try{null===(o=e._mp)||void 0===o||o.getNetworkType({success:function(e){t(e.networkType)},fail:function(){t("none")}})}catch(e){t("none"),console.error("[XLOG] getNetworkType error",e)}}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var i={};if(this.commonParams.userinfo)try{i=JSON.parse(this.commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(e(e(e({},this._extraInfo),i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.openid,o=this._commonParams.unionid;e=this._filterParams(e),this._updateCommonParams(e),(e.openid&&e.openid!==t||e.unionid&&e.unionid!==o)&&this._open({isreturn:e.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+d()),t.appver&&(t.appverint=l(t.appver)),this._commonParams=f(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t,o){var i=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(n,r){var a;try{null===(a=i._mp)||void 0===a||a.request({url:e,data:t,method:"POST",header:{"content-type":o},success:function(o){i._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,o),n(o)},fail:function(o){i._consoleLog&&console.log("[XLOG] FAIL: ".concat(e),t,o),r(o)}})}catch(e){console.error("[XLOG] request error",e),r(e)}}))},t.prototype.open=function(e){this._open({querystring:e.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var i=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:w});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",i),this._request(this._openUrl,i)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},t.prototype.code2session=function(e){return o(this,void 0,void 0,(function(){var t,o;return i(this,(function(i){switch(i.label){case 0:return t="",1===this._platform?t="wx/":3===this._platform&&(t="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(t,"code2session"),[4,this._request(o,{appTypeId:e.apptypeid,code:e.code,testNet:e.testNet},"application/json")];case 1:return[2,i.sent().data]}}))}))},t.prototype.getSubsidy=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e.apptypeid,os:this._systemInfo.platform,openId:e.openId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.getUserProps=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e.apptypeid,openId:e.openId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.checkOrder=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:e.apptypeid,os:this._systemInfo.platform,openId:e.openId,orderId:e.orderId},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.createOrder=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e.apptypeid,os:this._systemInfo.platform,openId:e.openId,productId:e.productId,payPlatform:e.payPlatform},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype.checkOrderWx=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/wx/chkOrder"),{appTypeId:e.apptypeid,os:this._systemInfo.platform,openId:e.openId,orderId:e.orderId,sessionKey:e.sessionKey},"application/json")];case 1:return[2,t.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},t.prototype._setOnlineBatchData=function(e){this._setStorage("ONLINE_BACH_DATA",e)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){t._setOnlineBatchData(e)}))},t}(),S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k={exports:{}};y=k,O=k.exports,function(e,t){var o="function",i="undefined",n="object",r="string",a="major",s="model",c="name",p="type",u="vendor",l="version",d="architecture",m="console",f="mobile",h="tablet",g="smarttv",b="wearable",w="embedded",v="Amazon",_="Apple",P="ASUS",S="BlackBerry",k="Browser",x="Chrome",A="Firefox",U="Google",L="Huawei",I="LG",C="Microsoft",q="Motorola",N="Opera",T="Samsung",D="Sharp",E="Sony",R="Xiaomi",j="Zebra",M="Facebook",G="Chromium OS",X="Mac OS",B=" Browser",z=function(e){for(var t={},o=0;o<e.length;o++)t[e[o].toUpperCase()]=e[o];return t},J=function(e,t){return typeof e===r&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===r)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,500)},W=function(e,i){for(var r,a,s,c,p,u,l=0;l<i.length&&!p;){var d=i[l],m=i[l+1];for(r=a=0;r<d.length&&!p&&d[r];)if(p=d[r++].exec(e))for(s=0;s<m.length;s++)u=p[++a],typeof(c=m[s])===n&&c.length>0?2===c.length?typeof c[1]==o?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==o||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):t:this[c[0]]=u?c[1].call(this,u,c[2]):t:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):t):this[c]=u||t;l+=2}},F=function(e,o){for(var i in o)if(typeof o[i]===n&&o[i].length>0){for(var r=0;r<o[i].length;r++)if(J(o[i][r],e))return"?"===i?t:i}else if(J(o[i],e))return"?"===i?t:i;return o.hasOwnProperty("*")?o["*"]:e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,l],[/opios[\/ ]+([\w\.]+)/i],[l,[c,N+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[l,[c,N+" GX"]],[/\bopr\/([\w\.]+)/i],[l,[c,N]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[l,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[l,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,l],[/quark(?:pc)?\/([-\w\.]+)/i],[l,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[l,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[l,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[l,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[l,[c,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],l],[/\bfocus\/([\w\.]+)/i],[l,[c,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[c,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[c,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[c,"MIUI"+B]],[/fxios\/([\w\.-]+)/i],[l,[c,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[l,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],l],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+B],l],[/samsungbrowser\/([\w\.]+)/i],[l,[c,T+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[l,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,l],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[l,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,M],l],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[l,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,l],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[l,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[l,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[l,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],l],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[c,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[l,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[l,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,H]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[u,T],[p,h]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[s,[u,T],[p,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[s,[u,_],[p,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[u,_],[p,h]],[/(macintosh);/i],[s,[u,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[u,D],[p,f]],[/(?:honor)([-\w ]+)[;\)]/i],[s,[u,"Honor"],[p,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[u,L],[p,h]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[u,L],[p,f]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[s,/_/g," "],[u,R],[p,f]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[u,R],[p,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[u,"OPPO"],[p,f]],[/\b(opd2\d{3}a?) bui/i],[s,[u,"OPPO"],[p,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[u,"Vivo"],[p,f]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[s,[u,"Realme"],[p,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[u,q],[p,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[u,q],[p,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[u,I],[p,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[u,I],[p,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[u,"Lenovo"],[p,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[u,"Nokia"],[p,f]],[/(pixel c)\b/i],[s,[u,U],[p,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[u,U],[p,f]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[u,E],[p,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[u,E],[p,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[u,"OnePlus"],[p,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[u,v],[p,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[u,v],[p,f]],[/(playbook);[-\w\),; ]+(rim)/i],[s,u,[p,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[u,S],[p,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[u,P],[p,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[u,P],[p,f]],[/(nexus 9)/i],[s,[u,"HTC"],[p,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[s,/_/g," "],[p,f]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[s,[u,"TCL"],[p,h]],[/(itel) ((\w+))/i],[[u,H],s,[p,F,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[u,"Acer"],[p,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[u,"Meizu"],[p,f]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[s,[u,"Ulefone"],[p,f]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[s,[u,"Energizer"],[p,f]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[s,[u,"Cat"],[p,f]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[s,[u,"Smartfren"],[p,f]],[/droid.+; (a(?:015|06[35]|142p?))/i],[s,[u,"Nothing"],[p,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,s,[p,f]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,s,[p,h]],[/(surface duo)/i],[s,[u,C],[p,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[u,"Fairphone"],[p,f]],[/(u304aa)/i],[s,[u,"AT&T"],[p,f]],[/\bsie-(\w*)/i],[s,[u,"Siemens"],[p,f]],[/\b(rct\w+) b/i],[s,[u,"RCA"],[p,h]],[/\b(venue[\d ]{2,7}) b/i],[s,[u,"Dell"],[p,h]],[/\b(q(?:mv|ta)\w+) b/i],[s,[u,"Verizon"],[p,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[u,"Barnes & Noble"],[p,h]],[/\b(tm\d{3}\w+) b/i],[s,[u,"NuVision"],[p,h]],[/\b(k88) b/i],[s,[u,"ZTE"],[p,h]],[/\b(nx\d{3}j) b/i],[s,[u,"ZTE"],[p,f]],[/\b(gen\d{3}) b.+49h/i],[s,[u,"Swiss"],[p,f]],[/\b(zur\d{3}) b/i],[s,[u,"Swiss"],[p,h]],[/\b((zeki)?tb.*\b) b/i],[s,[u,"Zeki"],[p,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],s,[p,h]],[/\b(ns-?\w{0,9}) b/i],[s,[u,"Insignia"],[p,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[u,"NextBook"],[p,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],s,[p,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],s,[p,f]],[/\b(ph-1) /i],[s,[u,"Essential"],[p,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[u,"Envizen"],[p,h]],[/\b(trio[-\w\. ]+) b/i],[s,[u,"MachSpeed"],[p,h]],[/\btu_(1491) b/i],[s,[u,"Rotor"],[p,h]],[/(shield[\w ]+) b/i],[s,[u,"Nvidia"],[p,h]],[/(sprint) (\w+)/i],[u,s,[p,f]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[u,C],[p,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[u,j],[p,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[u,j],[p,f]],[/smart-tv.+(samsung)/i],[u,[p,g]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[u,T],[p,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,I],[p,g]],[/(apple) ?tv/i],[u,[s,_+" TV"],[p,g]],[/crkey/i],[[s,x+"cast"],[u,U],[p,g]],[/droid.+aft(\w+)( bui|\))/i],[s,[u,v],[p,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[s,[u,D],[p,g]],[/(bravia[\w ]+)( bui|\))/i],[s,[u,E],[p,g]],[/(mitv-\w{5}) bui/i],[s,[u,R],[p,g]],[/Hbbtv.*(technisat) (.*);/i],[u,s,[p,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,V],[s,V],[p,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,s,[p,m]],[/droid.+; (shield) bui/i],[s,[u,"Nvidia"],[p,m]],[/(playstation [345portablevi]+)/i],[s,[u,E],[p,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[u,C],[p,m]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[s,[u,T],[p,b]],[/((pebble))app/i],[u,s,[p,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[s,[u,_],[p,b]],[/droid.+; (glass) \d/i],[s,[u,U],[p,b]],[/droid.+; (wt63?0{2,3})\)/i],[s,[u,j],[p,b]],[/droid.+; (glass) \d/i],[s,[u,U],[p,b]],[/(pico) (4|neo3(?: link|pro)?)/i],[u,s,[p,b]],[/; (quest( \d| pro)?)/i],[s,[u,M],[p,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[p,w]],[/(aeobc)\b/i],[s,[u,v],[p,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[s,[p,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[p,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,f]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,l],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,l],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[l,F,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,F,Z],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,X],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[l,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,l],[/\(bb(10);/i],[l,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[c,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[l,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[l,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,G],l],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,l],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,l]]},K=function(m,g){if(typeof m===n&&(g=m,m=t),!(this instanceof K))return new K(m,g).getResult();var b=typeof e!==i&&e.navigator?e.navigator:t,w=m||(b&&b.userAgent?b.userAgent:""),v=b&&b.userAgentData?b.userAgentData:t,_=g?function(e,t){var o={};for(var i in e)t[i]&&t[i].length%2==0?o[i]=t[i].concat(e[i]):o[i]=e[i];return o}($,g):$,y=b&&b.userAgent==w;return this.getBrowser=function(){var e,i={};return i[c]=t,i[l]=t,W.call(i,w,_.browser),i[a]=typeof(e=i[l])===r?e.replace(/[^\d\.]/g,"").split(".")[0]:t,y&&b&&b.brave&&typeof b.brave.isBrave==o&&(i[c]="Brave"),i},this.getCPU=function(){var e={};return e[d]=t,W.call(e,w,_.cpu),e},this.getDevice=function(){var e={};return e[u]=t,e[s]=t,e[p]=t,W.call(e,w,_.device),y&&!e[p]&&v&&v.mobile&&(e[p]=f),y&&"Macintosh"==e[s]&&b&&typeof b.standalone!==i&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[s]="iPad",e[p]=h),e},this.getEngine=function(){var e={};return e[c]=t,e[l]=t,W.call(e,w,_.engine),e},this.getOS=function(){var e={};return e[c]=t,e[l]=t,W.call(e,w,_.os),y&&!e[c]&&v&&v.platform&&"Unknown"!=v.platform&&(e[c]=v.platform.replace(/chrome os/i,G).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return w},this.setUA=function(e){return w=typeof e===r&&e.length>500?V(e,500):e,this},this.setUA(w),this};K.VERSION="1.0.40",K.BROWSER=z([c,l,a]),K.CPU=z([d]),K.DEVICE=z([s,u,p,m,f,g,h,b,w]),K.ENGINE=K.OS=z([c,l]),y.exports&&(O=y.exports=K),O.UAParser=K;var Y=typeof e!==i&&(e.jQuery||e.Zepto);if(Y&&!Y.ua){var Q=new K;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var o in t)Y.ua[o]=t[o]}}}("object"==typeof window?window:S);var x=new k.exports.UAParser,A=x.getBrowser(),U=A.name,L=A.version,I=x.getEngine(),C=I.name,q=I.version,N=function(){var e=(0,x.getOS)();return{os:e.name,osversion:e.version}}(),T=N.os,D=N.osversion,E=function(){var e=(0,x.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),R=E.device,j=E.devicebrand;T=T||"",D=D||"",R=R||"",j=j||"";var M={exports:{}},G={exports:{}},X=1e3,B=60*X,z=60*B,J=24*z,H=365.25*J,V=function(e,t){t=t||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*H;case"days":case"day":case"d":return o*J;case"hours":case"hour":case"hrs":case"hr":case"h":return o*z;case"minutes":case"minute":case"mins":case"min":case"m":return o*B;case"seconds":case"second":case"secs":case"sec":case"s":return o*X;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return t.long?function(e){return W(e,J,"day")||W(e,z,"hour")||W(e,B,"minute")||W(e,X,"second")||e+" ms"}(e):function(e){if(e>=J)return Math.round(e/J)+"d";if(e>=z)return Math.round(e/z)+"h";if(e>=B)return Math.round(e/B)+"m";if(e>=X)return Math.round(e/X)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function W(e,t,o){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+o:Math.ceil(e/t)+" "+o+"s"}!function(e,t){var o;function i(e){function i(){if(i.enabled){var e=i,n=+new Date,r=n-(o||n);e.diff=r,e.prev=o,e.curr=n,o=n;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(o,i){if("%%"===o)return o;c++;var n=t.formatters[i];if("function"==typeof n){var r=a[c];o=n.call(e,r),a.splice(c,1),c--}return o})),t.formatArgs.call(e,a),(i.log||t.log||console.log.bind(console)).apply(e,a)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var o,i=0;for(o in e)i=(i<<5)-i+e.charCodeAt(o),i|=0;return t.colors[Math.abs(i)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=G.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length,n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var o,i;for(o=0,i=t.skips.length;o<i;o++)if(t.skips[o].test(e))return!1;for(o=0,i=t.names.length;o<i;o++)if(t.names[o].test(e))return!0;return!1},t.humanize=V,t.names=[],t.skips=[],t.formatters={}}(0,G.exports),function(e,t){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=G.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+t.humanize(this.diff),!o)return;var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}(M,M.exports);var F=M.exports("jsonp"),Z=function(e,t,o){"function"==typeof t&&(o=t,t={});t||(t={});var i,n,r=t.prefix||"__jp",a=t.name||r+$++,s=t.param||"callback",c=null!=t.timeout?t.timeout:6e4,p=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(n=setTimeout((function(){l(),o&&o(new Error("Timeout"))}),c));function l(){i.parentNode&&i.parentNode.removeChild(i),window[a]=K,n&&clearTimeout(n)}return window[a]=function(e){F("jsonp got",e),l(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+p(a)).replace("?&","?"),F('jsonp req "%s"',e),(i=document.createElement("script")).src=e,u.parentNode.insertBefore(i,u),function(){window[a]&&l()}},$=0;function K(){}function Y(e,t){return void 0===t&&(t={}),new Promise((function(o,i){var n;Z("".concat(e,"?").concat((n=t,Object.keys(n).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__"),timeout:0},(function(e,t){e?i(e):o(t)}))}))}var Q=function(e,t){return Y(e,t)},ee=function(){function t(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s;this.version=w,this.buildDate=v,this._urlParams=m(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._isPro=n,this._sendOpenLog=a,this._consoleLog=c;var p=this._getApis(t),u=p.openUrl,l=p.eventUrl,d=p.actUrl;this._openUrl=u,this._eventUrl=l,this._actUrl=d,this._updateCommonParams(this._filterParams(o)),this._init()}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._init=function(){var e=this;this._initCommonParams(),this._coldStartUp(),this._visibilityChange((function(){e._updateCommonParams({network:e._getNetWorkType()}),e._open(1)}),(function(){e._open(5)}))},t.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},t.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},t.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},t.prototype._getBatchId=function(){var e=s("BATCH_ID");return e||c("BATCH_ID",e=p()),e},t.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn"},i=e(e({},o),t);return{openUrl:"https://".concat(i.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(i.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(i.act,"/gamefunction_logs/applet/activity")}},t.prototype._cacheCommonParams=function(e){a("COMMON_PARAMS",JSON.stringify(e))},t.prototype._getInitParams=function(){return{os:T,osversion:D,device:R,devicebrand:j,platform:7,openid:u(),appcqid:_,appqid:_+d(),pixel:this._getScreen(),userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(){var t=this._getInitParams(),o=r("COMMON_PARAMS");o&&(t=e(e({},t),JSON.parse(o))),t=f(t,this._commonParams),this._updateCommonParams(e(e({},t),{obatchid:this._getBatchId(),network:this._getNetWorkType()}))},t.prototype._getUserInfo=function(t){var o={};if(t)try{o=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var i={};if(this._commonParams.userinfo)try{i=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(e(e({querystring:this._urlParams},i),o))},t.prototype._filterParams=function(e){var t={};if(e){var o=["accid","apptypeid","appcqid","srcqid","appver","userinfo"];for(var i in e){var n=e[i];o.includes(i)&&n&&(t[i]=n)}}return t},t.prototype.setParams=function(e){e&&(this._consoleLog&&console.log("[XLOG] setParams",e),e=this._filterParams(e),this._updateCommonParams(e))},t.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+d()),e.appver&&(e.appverint=l(e.appver)),this._commonParams=f(this._commonParams,e),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+d()},t.prototype._request=function(e,t){Q(e,t)},t.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{openway:t,appqid:this._getAppqid(),xmlog:w});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t}();
7
7
  /*! js-cookie v3.0.5 | MIT */
8
- function Q(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)e[n]=o[n]}return e}var ee=function e(t,o){function n(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=Q({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in i)i[a]&&(r+="; "+a,!0!==i[a]&&(r+="="+i[a].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],n={},i=0;i<o.length;i++){var r=o[i].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(n[s]=t.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",Q({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Q({},this.attributes,t))},withConverter:function(t){return e(Q({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),te="".concat("XYZ_LOG_HW_","COMMON_PARAMS"),oe="".concat("XYZ_LOG_HW_","ONLINE_BACH_DATA"),ne=function(){function o(e){var t=e.domain,o=e.commonParams,n=e.isPro,i=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,p=e.ignoreUrlParams,u=void 0===p?[]:p;this.version="4.2.0",this.buildDate=b,this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=i,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var l=this._getApis(t),d=l.openUrl,m=l.actUrl,f=l.adUrl,h=l.online;this._openUrl=d,this._actUrl=m,this._adUrl=f,this._onlineUrl=h,this._init(o)}return Object.defineProperty(o.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),o.prototype._init=function(t){var o=this;this._updateCommonParams(e(e({},this._filterParams(t)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},o.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},o.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},o.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},o.prototype._getBatchId=function(){var e=s("BATCH_ID");return e||c("BATCH_ID",e=p()),e},o.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},o.prototype._getApis=function(t){var o=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",online:"https://wappubog.snake.cc"}:{open:"https://test-wappubog.snake.cc",act:"https://test-wappubog.snake.cc",ad:"https://test-wappubog.snake.cc",online:"https://test-wappubog.snake.cc"},n=e(e({},o),t);return{openUrl:"".concat(n.open,"/wappubog/h5/open"),actUrl:"".concat(n.act,"/wappubog/h5/activity"),adUrl:"".concat(n.ad,"/gamefunction_logs/h5/advlog"),online:"".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},o.prototype._cacheCommonParams=function(o){var n=r(te),i=this._getInitParams(),s=i.userinfo,c=t(i,["userinfo"]),p=JSON.parse(n||"{}"),u=p.userinfo,l=t(p,["userinfo"]),d=o.userinfo,m=t(o,["userinfo"]),h=e(e(e({},JSON.parse(s||"{}")),JSON.parse(u||"{}")),JSON.parse(d||"{}")),g=f(f(c,l),m);this._commonParams=e(e({},g),{userinfo:JSON.stringify(h)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),a(te,JSON.stringify(this._commonParams))},o.prototype._getInitParams=function(){return{osversion:q,device:D,devicebrand:R,os:N,platform:g(),uid:u(),appcqid:"organic",pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(t)),url:encodeURI(location.href)};var e,t},o.prototype._getUserInfo=function(e){var t={};if(e)try{t=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(h({lang:navigator.language,browser:x,browserversion:L,engine:U,engineversion:C,platform:g(),querystring:m(this._ignoreUrlParams),fbc:ee.get("_fbc"),fbp:ee.get("_fbp"),ttp:ee.get("_ttp")},o,t))},o.prototype._filterParams=function(e){var t={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var n in e){var i=n,r=e[i];o.includes(i)&&r&&(t[i]=r)}}return t},o.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var t=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype._updateCommonParams=function(t){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo?t.userinfo=this._getUserInfo(t.userinfo):t.userinfo=this._getUserInfo();try{o=JSON.parse(t.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(t.userinfo,'" parse error'),e)}t.platform&&(t.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:t.platform})))),this._cacheCommonParams(e(e({},t),{url:encodeURI(location.href),network:this._getNetWorkType()}))},o.prototype._request=function(e,t){var o=this;return $(e,t).then((function(n){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,n),n})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),t,o),Promise.reject(o)}))},o.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:"4.2.0",url_from:document.referrer,openway:t});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},o.prototype.act=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},o.prototype.ad=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||"",adfrom:t.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},o.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},o.prototype._setOnlineBatchData=function(e){a(oe,JSON.stringify(e))},o.prototype._getOnlineBatchData=function(){var e=r(oe);return e?JSON.parse(e):""},o.prototype._clearOnlineBatchData=function(){a(oe,"")},o.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),t._setOnlineBatchData(e)}))},o}();export{v as EGender,y as XLogMp,K as XLogWeb,ne as XLogWebHw};
9
- //# sourceMappingURL=index.mjs.map
8
+ function te(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)e[i]=o[i]}return e}var oe=function e(t,o){function i(e,i,n){if("undefined"!=typeof document){"number"==typeof(n=te({},o,n)).expires&&(n.expires=new Date(Date.now()+864e5*n.expires)),n.expires&&(n.expires=n.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in n)n[a]&&(r+="; "+a,!0!==n[a]&&(r+="="+n[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+r}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],i={},n=0;n<o.length;n++){var r=o[n].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(i[s]=t.read(a,s),e===s)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){i(e,"",te({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,te({},this.attributes,t))},withConverter:function(t){return e(te({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),ie="XYZ_LOG_HW_",ne="".concat(ie,"COMMON_PARAMS"),re="".concat(ie,"ONLINE_BACH_DATA"),ae=function(){function o(e){var t=e.domain,o=e.commonParams,i=e.isPro,n=void 0===i||i,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,p=e.ignoreUrlParams,u=void 0===p?[]:p;this.version=w,this.buildDate=v,this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=n,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var l=this._getApis(t),d=l.openUrl,m=l.actUrl,f=l.adUrl,h=l.online;this._openUrl=d,this._actUrl=m,this._adUrl=f,this._onlineUrl=h,this._init(o)}return Object.defineProperty(o.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),o.prototype._init=function(t){var o=this;this._updateCommonParams(e(e({},this._filterParams(t)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},o.prototype._visibilityChange=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():t()}),!1)},o.prototype._getScreen=function(){var e=window.screen,t=e.width,o=e.height;return"".concat(t,"*").concat(o)},o.prototype._getNetWorkType=function(){var e=window.navigator,t=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==t?void 0:t.type)||(null==t?void 0:t.effectiveType)||"other"},o.prototype._getBatchId=function(){var e=s("BATCH_ID");return e||c("BATCH_ID",e=p()),e},o.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},o.prototype._getApis=function(t){var o=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",online:"https://wappubog.snake.cc"}:{open:"https://test-wappubog.snake.cc",act:"https://test-wappubog.snake.cc",ad:"https://test-wappubog.snake.cc",online:"https://test-wappubog.snake.cc"},i=e(e({},o),t);return{openUrl:"".concat(i.open,"/wappubog/h5/open"),actUrl:"".concat(i.act,"/wappubog/h5/activity"),adUrl:"".concat(i.ad,"/gamefunction_logs/h5/advlog"),online:"".concat(i.online,"/gamefunction_logs/applet/onlineTime")}},o.prototype._cacheCommonParams=function(o){var i=r(ne),n=this._getInitParams(),s=n.userinfo,c=t(n,["userinfo"]),p=JSON.parse(i||"{}"),u=p.userinfo,l=t(p,["userinfo"]),d=o.userinfo,m=t(o,["userinfo"]),h=e(e(e({},JSON.parse(s||"{}")),JSON.parse(u||"{}")),JSON.parse(d||"{}")),g=f(f(c,l),m);this._commonParams=e(e({},g),{userinfo:JSON.stringify(h)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),a(ne,JSON.stringify(this._commonParams))},o.prototype._getInitParams=function(){return{osversion:D,device:R,devicebrand:j,os:T,platform:g(),uid:u(),appcqid:_,pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(t)),url:encodeURI(location.href)};var e,t},o.prototype._getUserInfo=function(e){var t={};if(e)try{t=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(h({lang:navigator.language,browser:U,browserversion:L,engine:C,engineversion:q,platform:g(),querystring:m(this._ignoreUrlParams),fbc:oe.get("_fbc"),fbp:oe.get("_fbp"),ttp:oe.get("_ttp")},o,t))},o.prototype._filterParams=function(e){var t={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var i in e){var n=i,r=e[n];o.includes(n)&&r&&(t[n]=r)}}return t},o.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var t=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var t=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==t||e.province&&e.province!==o)&&this._open(6)}},o.prototype._updateCommonParams=function(t){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo?t.userinfo=this._getUserInfo(t.userinfo):t.userinfo=this._getUserInfo();try{o=JSON.parse(t.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(t.userinfo,'" parse error'),e)}t.platform&&(t.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:t.platform})))),this._cacheCommonParams(e(e({},t),{url:encodeURI(location.href),network:this._getNetWorkType()}))},o.prototype._request=function(e,t){var o=this;return Q(e,t).then((function(i){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),t,i),i})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),t,o),Promise.reject(o)}))},o.prototype._open=function(t){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:w,url_from:document.referrer,openway:t});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},o.prototype.act=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},o.prototype.ad=function(t){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||"",adfrom:t.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},o.prototype._sendOnline=function(){var t=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([o])},o.prototype._setOnlineBatchData=function(e){a(re,JSON.stringify(e))},o.prototype._getOnlineBatchData=function(){var e=r(re);return e?JSON.parse(e):""},o.prototype._clearOnlineBatchData=function(){a(re,"")},o.prototype._online=function(e){var t=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),t._setOnlineBatchData(e)}))},o}();export{b as EGender,P as XLogMp,ee as XLogWeb,ae as XLogWebHw};
package/dist/mp.d.ts CHANGED
@@ -37,9 +37,9 @@ interface IOpenLogParams {
37
37
  interface IActiveLogParams {
38
38
  actentryid?: string;
39
39
  subactid?: string;
40
- type: 'show' | 'click' | 'close';
41
- custom: string;
42
- batchid: string;
40
+ type?: string;
41
+ custom?: string;
42
+ batchid?: string;
43
43
  }
44
44
  interface IEventLogParams {
45
45
  event1?: string;
@@ -67,8 +67,8 @@ interface IOnlineLogParams {
67
67
  endtime?: string;
68
68
  starttime: string;
69
69
  }
70
- declare type IOnlineLogParamsWithCommon = ICommonParams & IOnlineLogParams;
71
- declare type IHwOnlineLogParamsWithCommon = IHwCommonParams & IOnlineLogParams;
70
+ type IOnlineLogParamsWithCommon = ICommonParams & IOnlineLogParams;
71
+ type IHwOnlineLogParamsWithCommon = IHwCommonParams & IOnlineLogParams;
72
72
  interface IUserInfo {
73
73
  [k: string | number]: any;
74
74
  }
@@ -110,7 +110,7 @@ interface MiniprogramShowOptions {
110
110
  extraData: Record<string | number, any>;
111
111
  };
112
112
  }
113
- declare type TPlatform = 'h5' | 'pc' | 'pwa';
113
+ type TPlatform = 'h5' | 'pc' | 'pwa';
114
114
  interface InitParams {
115
115
  isPro?: boolean;
116
116
  domain?: IDomain;
@@ -167,7 +167,7 @@ interface IHwOpenLogParams {
167
167
  interface IHwActiveLogParams {
168
168
  actentryid?: string;
169
169
  subactid?: string;
170
- type: 'show' | 'click' | 'close';
170
+ type?: string;
171
171
  memo1?: string;
172
172
  memo2?: string;
173
173
  memo3?: string;
@@ -215,7 +215,7 @@ interface ISubsidyResponseData {
215
215
  subsidyAfterMoney: number;
216
216
  }[];
217
217
  }
218
- declare type IUserPropsParams = IShareParams;
218
+ type IUserPropsParams = IShareParams;
219
219
  interface IUserPropsResponseData {
220
220
  [k: string]: string | number;
221
221
  }
@@ -225,6 +225,13 @@ interface ICheckOrderParams extends IShareParams {
225
225
  interface ICheckOrderResponseData {
226
226
  payResult: string | number;
227
227
  }
228
+ interface ICheckOrderWxParams extends IShareParams {
229
+ orderId: string;
230
+ sessionKey: string;
231
+ }
232
+ interface ICheckOrderWxResponseData {
233
+ payResult: string | number;
234
+ }
228
235
  interface ICreateOrderParams extends IShareParams {
229
236
  productId?: string;
230
237
  payPlatform?: string;
@@ -305,6 +312,7 @@ declare class XLog {
305
312
  getUserProps(params: IUserPropsParams): Promise<IRes<IUserPropsResponseData>>;
306
313
  checkOrder(params: ICheckOrderParams): Promise<IRes<ICheckOrderResponseData>>;
307
314
  createOrder(params: ICreateOrderParams): Promise<IRes<ICreateOrderResponseData>>;
315
+ checkOrderWx(params: ICheckOrderWxParams): Promise<IRes<ICheckOrderWxResponseData>>;
308
316
  private _sendOnline;
309
317
  private _setOnlineBatchData;
310
318
  private _getOnlineBatchData;
@@ -312,4 +320,4 @@ declare class XLog {
312
320
  private _online;
313
321
  }
314
322
 
315
- export { EGender, HwInitParams, IActiveLogParams, IAdLogParams, ICheckOrderParams, ICheckOrderResponseData, ICode2sessionParams, ICode2sessionResponseData, ICommonParams, ICreateOrderParams, ICreateOrderResponseData, IDomain, IDomainWithEnv, IEventLogParams, IExtraInfo, IHwActiveLogParams, IHwAdLogParams, IHwCommonParams, IHwDomain, IHwOnlineLogParamsWithCommon, IHwOpenLogParams, IOnlineLogParams, IOnlineLogParamsWithCommon, IOpenLogParams, IRes, IShareParams, ISubsidyParams, ISubsidyResponseData, ISystemInfo, IUserInfo, IUserPropsParams, IUserPropsResponseData, InitParams, MiniprogramShowOptions, TCommonParams, THwCommonParams, TPlatform, XLog };
323
+ export { EGender, HwInitParams, IActiveLogParams, IAdLogParams, ICheckOrderParams, ICheckOrderResponseData, ICheckOrderWxParams, ICheckOrderWxResponseData, ICode2sessionParams, ICode2sessionResponseData, ICommonParams, ICreateOrderParams, ICreateOrderResponseData, IDomain, IDomainWithEnv, IEventLogParams, IExtraInfo, IHwActiveLogParams, IHwAdLogParams, IHwCommonParams, IHwDomain, IHwOnlineLogParamsWithCommon, IHwOpenLogParams, IOnlineLogParams, IOnlineLogParamsWithCommon, IOpenLogParams, IRes, IShareParams, ISubsidyParams, ISubsidyResponseData, ISystemInfo, IUserInfo, IUserPropsParams, IUserPropsResponseData, InitParams, MiniprogramShowOptions, TCommonParams, THwCommonParams, TPlatform, XLog };
package/dist/mp.js CHANGED
@@ -1,7 +1,6 @@
1
1
  /*!
2
- * @xyz-fe/log v4.2.0
2
+ * @xyz-fe/log v4.3.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r;exports.EGender=void 0,(r=exports.EGender||(exports.EGender={}))[r.Unknown=0]="Unknown",r[r.Male=1]="Male",r[r.Female=2]="Female";var s=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,a=void 0===s||s,p=t.consoleLog,c=void 0===p||p;this.version="4.2.0",this.buildDate="3/13/2025, 5:16:49 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=a,this._consoleLog=c;var u=this._getApis(n),l=u.openUrl,h=u.eventUrl,d=u.actUrl,m=u.adUrl,_=u.onlineUrl;this._openUrl=l,this._eventUrl=h,this._actUrl=d,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var f,y=this._getMp(),g=y.mp,v=y.platform;this._mp=g,this._platform=v,!g||(f=g)&&0===Object.keys(f).length&&f.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:"organic",appqid:"organic"+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:"4.2.0"});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();exports.XLog=s;
7
- //# sourceMappingURL=mp.js.map
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(p){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,p])}}}function o(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}"function"==typeof SuppressedError&&SuppressedError;function i(e,n){var o=t({},e),i=t({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),t(t({},o),i)}var r,s="4.3.0",a="organic";exports.EGender=void 0,(r=exports.EGender||(exports.EGender={}))[r.Unknown=0]="Unknown",r[r.Male=1]="Male",r[r.Female=2]="Female";var p=function(){function r(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,a=t.sendOpenLog,p=void 0===a||a,c=t.consoleLog,u=void 0===c||c;this.version=s,this.buildDate="5/12/2025, 7:52:04 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=p,this._consoleLog=u;var l=this._getApis(n),h=l.openUrl,d=l.eventUrl,m=l.actUrl,f=l.adUrl,_=l.onlineUrl;this._openUrl=h,this._eventUrl=d,this._actUrl=m,this._adUrl=f,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var y,v=this._getMp(),g=v.mp,O=v.platform;this._mp=g,this._platform=O,!g||(y=g)&&0===Object.keys(y).length&&y.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",g);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(r.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),r.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},r.prototype._updateQuerystring=function(e,n){void 0===e&&(e=null),void 0===n&&(n={}),(null==e?void 0:e.query)?this._updateCommonParams({srcqid:e.query.channel||"",userinfo:JSON.stringify({querystring:t(t({},e.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},r.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},r.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},r.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},r.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},r.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},r.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},r.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},r.prototype._getApis=function(e){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=t(t({},n),e);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},r.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},r.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:a,appqid:a+o(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},r.prototype._initCommonParams=function(e){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=t(t({},n),JSON.parse(o))),n=e?i(n,e):n,this._updateCommonParams(t(t({},n),{obatchid:this._getBatchId()}))},r.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},r.prototype._getUserInfo=function(e){var n={};if(e)try{n=JSON.parse(e)}catch(t){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',e)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(t(t(t({},this._extraInfo),o),n))},r.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},r.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},r.prototype._updateCommonParams=function(e){this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo&&(e.appsubid&&(e.userinfo=JSON.stringify(t(t({},JSON.parse(e.userinfo)),{appsubid:e.appsubid}))),e.userinfo=this._getUserInfo(e.userinfo)),e.appcqid&&(e.appqid=e.appcqid+o()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=i(this._commonParams,e),this._cacheCommonParams(this._commonParams)},r.prototype._getAppqid=function(){return this._commonParams.appcqid+o()},r.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},r.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},r.prototype._open=function(e){if(this._sendOpenLog||e.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,e.querystring);var o=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==n?void 0:n.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:s});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},r.prototype.event=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},r.prototype.act=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},r.prototype.ad=function(e){var n=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},r.prototype.code2session=function(t){return e(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),o="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(o,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,n.sent().data]}}))}))},r.prototype.getSubsidy=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.getUserProps=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype.checkOrderWx=function(t){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/wx/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId,sessionKey:t.sessionKey},"application/json")];case 1:return[2,e.sent().data]}}))}))},r.prototype._sendOnline=function(){var e=Date.now(),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(e-this._startTime),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},r.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},r.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},r.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},r.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},r}();exports.XLog=p;
package/dist/mp.min.js CHANGED
@@ -1,7 +1,6 @@
1
1
  /*!
2
- * @xyz-fe/log v4.2.0
2
+ * @xyz-fe/log v4.3.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function n(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function o(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function i(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}function r(t,n){var o=e({},t),i=e({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),e(e({},o),i)}var s,a="4.2.0",p="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female";var c=function(){function t(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,p=void 0===s||s,c=t.consoleLog,u=void 0===c||c;this.version=a,this.buildDate="3/13/2025, 5:16:49 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=p,this._consoleLog=u;var l=this._getApis(n),h=l.openUrl,d=l.eventUrl,f=l.actUrl,m=l.adUrl,_=l.onlineUrl;this._openUrl=h,this._eventUrl=d,this._actUrl=f,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var y,g=this._getMp(),v=g.mp,O=g.platform;this._mp=v,this._platform=O,!v||(y=v)&&0===Object.keys(y).length&&y.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",v);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},t.prototype._updateQuerystring=function(t,n){void 0===t&&(t=null),void 0===n&&(n={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},t.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},t.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},t.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},t.prototype._getApis=function(t){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=e(e({},n),t);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:p,appqid:p+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=e(e({},n),JSON.parse(o))),n=t?r(n,t):n,this._updateCommonParams(e(e({},n),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},t.prototype._getUserInfo=function(t){var n={};if(t)try{n=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(e(e(e({},this._extraInfo),o),n))},t.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=r(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,t.querystring);var o=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==n?void 0:n.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},t.prototype.act=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},t.prototype.ad=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},t.prototype.code2session=function(t){return n(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),n="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(n,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,o.sent().data]}}))}))},t.prototype.getSubsidy=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.getUserProps=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.checkOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.createOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},t}();t.XLog=c,Object.defineProperty(t,"__esModule",{value:!0})}));
7
- //# sourceMappingURL=mp.min.js.map
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function n(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{p(o.next(t))}catch(t){r(t)}}function a(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}p((o=o.apply(t,e||[])).next())}))}function o(t,e){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(p){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,p])}}}function i(){var t=new Date,e=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),o=t.getDate().toString();return(e=e.toString().substr(-2))+(n=Number(n)<10?"0"+n:n)+(o=Number(o)<10?"0"+o:o)}"function"==typeof SuppressedError&&SuppressedError;function r(t,n){var o=e({},t),i=e({},n);return Object.keys(o).forEach((function(t){i[t]||delete i[t]})),e(e({},o),i)}var s,a="4.3.0",p="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female";var c=function(){function t(t){var e,n=t.domain,o=t.commonParams,i=t.isPro,r=void 0===i||i,s=t.sendOpenLog,p=void 0===s||s,c=t.consoleLog,u=void 0===c||c;this.version=a,this.buildDate="5/12/2025, 7:52:04 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._isPro=r,this._sendOpenLog=p,this._consoleLog=u;var l=this._getApis(n),d=l.openUrl,h=l.eventUrl,f=l.actUrl,m=l.adUrl,_=l.onlineUrl;this._openUrl=d,this._eventUrl=h,this._actUrl=f,this._adUrl=m,this._onlineUrl=_,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var y,g=this._getMp(),v=g.mp,O=g.platform;this._mp=v,this._platform=O,!v||(y=v)&&0===Object.keys(y).length&&y.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",v);try{this._systemInfo=(null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync())||{}}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._init(o)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._getLaunchOptions=function(){var t,e,n=null;try{n=((null===(t=this._mp)||void 0===t?void 0:t.getEnterOptionsSync)||(null===(e=this._mp)||void 0===e?void 0:e.getLaunchOptionsSync)||function(){})()}catch(t){console.error("[XLOG] getEnterOptionsSync or getLaunchOptionsSync error",t)}return n},t.prototype._updateQuerystring=function(t,n){void 0===t&&(t=null),void 0===n&&(n={}),(null==t?void 0:t.query)?this._updateCommonParams({srcqid:t.query.channel||"",userinfo:JSON.stringify({querystring:e(e({},t.query),n)})}):this._updateCommonParams({userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var n=this._getLaunchOptions();this._updateQuerystring(n),this._coldStartUp(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now();var t=e._getOnlineBatchData();t&&e._online(t)}),(function(){e._isColdStartUp=!1,e._open({openway:5}),e._sendOnline()}))},t.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt?(t.mp=tt,t.platform=2):"undefined"!=typeof ks?(t.mp=ks,t.platform=3):"undefined"!=typeof swan?(t.mp=swan,t.platform=4):"undefined"!=typeof qq?(t.mp=qq,t.platform=5):"undefined"!=typeof wx?(t.mp=wx,t.platform=1):"undefined"!=typeof my?t.mp=my:"undefined"!=typeof jd&&(t.mp=jd),t},t.prototype._visibilityChange=function(t,e){var n,o,i,r,s=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(n=this._mp)||void 0===n?void 0:n.onAppShow)||(null===(o=this._mp)||void 0===o?void 0:o.onShow)||function(){},p=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(r=this._mp)||void 0===r?void 0:r.onHide)||function(){};a((function(){s._consoleLog&&console.log("[XLOG] onAppShow"),t()})),p((function(){s._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{return null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t))}catch(t){console.error("[XLOG] getStorageSync error",t)}},t.prototype._setStorage=function(t,e){var n;try{null===(n=this._mp)||void 0===n||n.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage("BATCH_ID");return t&&!this._isColdStartUp||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],i=Math.random,r=t,s=e||n.length,a=0;a<r;a++)o[a]=n[0|i()*s];return o.join("")}(),this._setStorage("BATCH_ID",t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0})}))},t.prototype._getApis=function(t){var n=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},o=e(e({},n),t);return{openUrl:"https://".concat(o.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(o.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(o.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(o.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(o.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage("COMMON_PARAMS",JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:p,appqid:p+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var n=this._getInitParams(),o=this._getStorage("COMMON_PARAMS");o&&(n=e(e({},n),JSON.parse(o))),n=t?r(n,t):n,this._updateCommonParams(e(e({},n),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var n;try{null===(n=t._mp)||void 0===n||n.getNetworkType({success:function(t){e(t.networkType)},fail:function(){e("none")}})}catch(t){e("none"),console.error("[XLOG] getNetworkType error",t)}}))},t.prototype._getUserInfo=function(t){var n={};if(t)try{n=JSON.parse(t)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format: ',t)}var o={};if(this.commonParams.userinfo)try{o=JSON.parse(this.commonParams.userinfo)}catch(t){console.error("[XLOG] parse error",t)}return JSON.stringify(e(e(e({},this._extraInfo),o),n))},t.prototype._filterParams=function(t){var e={};if(t){var n=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var o in t){var i=t[o];n.includes(o)&&i&&(e[o]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,n=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==n)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo&&(t.appsubid&&(t.userinfo=JSON.stringify(e(e({},JSON.parse(t.userinfo)),{appsubid:t.appsubid}))),t.userinfo=this._getUserInfo(t.userinfo)),t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=r(this._commonParams,t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._request=function(t,e,n){var o=this;return void 0===n&&(n="application/x-www-form-urlencoded"),new Promise((function(i,r){var s;try{null===(s=o._mp)||void 0===s||s.request({url:t,data:e,method:"POST",header:{"content-type":n},success:function(n){o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,n),i(n)},fail:function(n){o._consoleLog&&console.log("[XLOG] FAIL: ".concat(t),e,n),r(n)}})}catch(t){console.error("[XLOG] request error",t),r(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var n=this._getLaunchOptions();this._updateQuerystring(n,t.querystring);var o=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==n?void 0:n.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},t.prototype.event=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",n),this._request(this._eventUrl,n)},t.prototype.act=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",n),this._request(this._actUrl,n)},t.prototype.ad=function(t){var n=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",n),this._request(this._adUrl,n,"application/json")},t.prototype.code2session=function(t){return n(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return e="",1===this._platform?e="wx/":3===this._platform&&(e="ks/"),n="".concat(this._businessDomain,"/AppletUtils/").concat(e,"code2session"),[4,this._request(n,{appTypeId:t.apptypeid,code:t.code,testNet:t.testNet},"application/json")];case 1:return[2,o.sent().data]}}))}))},t.prototype.getSubsidy=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:t.apptypeid,os:this._systemInfo.platform,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.getUserProps=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:t.apptypeid,openId:t.openId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.checkOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.createOrder=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,productId:t.productId,payPlatform:t.payPlatform},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype.checkOrderWx=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/wx/chkOrder"),{appTypeId:t.apptypeid,os:this._systemInfo.platform,openId:t.openId,orderId:t.orderId,sessionKey:t.sessionKey},"application/json")];case 1:return[2,e.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(t-this._startTime),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage("ONLINE_BACH_DATA",t)},t.prototype._getOnlineBatchData=function(){return this._getStorage("ONLINE_BACH_DATA")},t.prototype._clearOnlineBatchData=function(){this._setStorage("ONLINE_BACH_DATA","")},t.prototype._online=function(t){var e=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(n){e._setOnlineBatchData(t)}))},t}();t.XLog=c,Object.defineProperty(t,"__esModule",{value:!0})}));