"use strict";var e="[UMENG] -- ",t=function(){var t=null,n=!1;function i(){this.setDebug=function(e){n=e};this.d=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.debug.apply(console,arguments)}catch(e){}};this.i=function(){try{if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.info.apply(console,arguments)}catch(e){}}catch(e){}};this.e=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.error.apply(console,arguments)}catch(e){}};this.w=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.warn.apply(console,arguments)}catch(e){}};this.v=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.log.apply(console,arguments)}catch(e){}};this.t=function(){if(n)try{console.table.apply(console,arguments)}catch(e){}};this.tip=function(){try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.log.apply(console,arguments)}catch(e){}};this.tip_w=function(e){try{console.log("%c [UMENG] -- "+e,"background:red; padding: 4px; padding-right: 8px; border-radius: 4px; color: #fff;")}catch(e){}};this.err=function(){try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]);console.error.apply(console,arguments)}catch(e){}};this.repeat=function(e){for(var t=e;t.length<86;)t+=e;return t}}return function(){null===t&&(t=new i);return t}}(),n=function(){var e=null;function t(){var e={};this.useOpenid=function(){return!!e.useOpenid};this.useSwanid=function(){return!!e.useSwanid};this.autoGetOpenid=function(){return!!e.autoGetOpenid};this.appKey=function(){return e.appKey};this.uploadUserInfo=function(){return e.uploadUserInfo};this.enableVerify=function(){return e.enableVerify};this.set=function(t){e=t};this.get=function(){return e};this.setItem=function(t,n){e[t]=n};this.getItem=function(t){return e[t]}}return function(){e||(e=new t);return e}}();function i(){}i.prototype={on:function(e,t,n){var i=this.e||(this.e={});(i[e]||(i[e]=[])).push({fn:t,ctx:n});return this},once:function(e,t,n){var i=this;function r(){i.off(e,r);t.apply(n,arguments)}r._=t;return this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;is?o+"*"+s:s+"*"+o;"function"==typeof e&&e(i)},fail:function(){"function"==typeof e&&e()}})};e.prototype.getDeviceInfo=function(e){"function"==typeof e&&e("")};e.prototype.checkNetworkAvailable=function(e){wx.getNetworkType({success:function(t){"function"==typeof e&&e(t&&"none"!==t.networkType)},fail:function(){"function"==typeof e&&e(!1)}})};e.prototype.getNetworkInfo=function(e){wx.getNetworkType({success:function(t){"function"==typeof e&&e({networkAvailable:"none"!==t.networkType,networkType:t.networkType})},fail:function(){"function"==typeof e&&e()}})};e.prototype.getDeviceId=function(e){e("")};e.prototype.getAdvertisingId=function(e){"function"==typeof e&&e("")};e.prototype.onNetworkStatusChange=function(e){wx.onNetworkStatusChange((function(t){"function"==typeof e&&e(t.isConnected)}))};e.prototype.request=function(e){var t=e.success,n=e.fail,i=!1,r=null;e.success=function(e){if(!i){r&&clearTimeout(r);"function"==typeof t&&t(e)}};e.fail=function(){if(!i){r&&clearTimeout(r);"function"==typeof n&&n(!1)}};wx.request(e);r=setTimeout((function(){r&&clearTimeout(r);i=!0;"function"==typeof n&&n(i)}),e.timeout||5e3)};e.prototype.getSdkType=function(){return"wxmp"};e.prototype.getPlatform=function(){return"wx"};e.prototype.getUserInfo=function(e){e()};e.prototype.getAppInfoSync=function(){if(wx.getAccountInfoSync){var e=wx.getAccountInfoSync(),t=e&&e.miniProgram?e.miniProgram:{};return{appId:t.appId,appEnv:t.envVersion,appVersion:t.version}}return{}};e.prototype.onShareAppMessage=function(e){wx.onShareAppMessage(e)};e.prototype.shareAppMessage=function(e){wx.shareAppMessage(e)};e.prototype.getLaunchOptionsSync=function(){var e=null;if(e)return e;if(!wx.getLaunchOptionsSync)return{};try{e=wx.getLaunchOptionsSync()}catch(t){e=null}return e||{}};return e}()),s=function(e,t){s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return s(e,t)};function a(e,t){s(e,t);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u={SESSION_INTERVAL:3e4,LOG_URL:"/wxm_logs",GET_OPENID_URL:"/uminiprogram_logs/wx/getuut",USERINFO_URL:"/uminiprogram_logs/comm/uif",ENDPOINT:"https://umini.shujupie.com",ENDPOINTB:"https://ulogs.umeng.com",DEVICE_INFO_KEY:"device_info",ADVERTISING_ID:"mobile_ad_id",ANDROID_ID:"android_id",CURRENT_SESSION:"current_session",SESSION_PAUSE_TIME:"session_pause_time",EVENT_SEND_DEFAULT_INTERVAL:15e3,EVENT_LAST_SEND_TIME:"last_send_time",MAX_EVENTID_LENGTH:128,MAX_PROPERTY_KEY_LENGTH:256,MAX_PROPERTY_KEYS_COUNT:100,REPORT_POLICY:"report_policy",REPORT_INTERVAL_TIME:"report_interval_time",REPORT_POLICY_START_SEND:"1",REPORT_POLICY_INTERVAL:"6",IMPRINT:"imprint",SEED_VERSION:"1.0.0",IMPL_VERSION:"2.7.5",ALIPAY_AVAILABLE_VERSION:"10.1.52",SHARE_PATH:"um_share_path",SHARES:"shares",REQUESTS:"requests",UUID:"um_uuid",UUID_SUFFIX:"ud",OPENID:"um_od",UNIONID:"um_unid",ALIPAYID:"um_alipayid",USERID:"um_userid",PROVIDER:"um_provider",SWANID:"um_swanid",ANONYMOUSID:"um_anonymousid",LAUNCH_OPTIONS:"LAUNCH_OPTIONS",UM_SSRC:"_um_ssrc",USER_INFO:"user_info",IS_ALIYUN:!1};var c,f={isNumber:function(e){return!Number.isNaN(parseInt(e,10))},compareVersion:function(e,t){for(var n=String(e).split("."),i=String(t).split("."),r=0;rs)return 1;if(oe.length)&&e.substr(0,t.length)===t},endsWith:function(e,t){return!(!t||0===e.length||t.length>e.length)&&e.substring(e.length-t.length)===t},assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n1&&f.startsWith(o.path,"/")&&(o.path=f.trimStart(o.path,"/"));var s=e.path||"",a=l().getId();if(a){var u=i.split(","),c=(u=u.filter((function(e){return e.length>0}))).indexOf(a);c>=0&&(u=u.slice(0,c));u.length<3&&u.push(a);var p=u.join(",");-1!==s.indexOf("?")?s+="&_um_ssrc="+p:s+="?_um_ssrc="+p;var h=Date.now();s+="&_um_sts="+h;if(r){var g=function(e){var t=[];for(var n in e)"_um_ssrc"!==n&&"_um_sts"!==n&&t.push(n+"="+e[n]);return t.join("&")}(d),v=g?g+"&_um_ssrc="+p+"&_um_sts="+h:"_um_ssrc="+p+"&_um_sts="+h;e.query=e.query?e.query+"&_um_ssrc="+p+"&_um_sts="+h:v}else e.path=s;o._um_ssrc=p;o._um_sts=h}n.push(o);t().v("share: %o",e);return e},setShareSource:function(e){i=e},clear:function(){n.length=0},get:function(){return n}}}return function(){e||(e=new r);return e}}(),v=function(e){if(e)try{return JSON.stringify(e)}catch(e){}return""},_=function(e){if(e)try{return JSON.parse(e)}catch(e){}return null},y=function(){var e=null,t="",i=null,r=!1;function s(){this.load=function(e){if(i){o.removeStorage(t);e()}else{t="um_cache_"+n().appKey();o.getStorage(t,(function(n){i=_(n)||{};r=!0;o.removeStorage(t);e()}))}};this.save=function(){i&&o.setStorage(t,v(i))};this.set=function(e,t){i&&(i[e]=t)};this.get=function(e){return(i||{})[e]};this.remove=function(e){i&&i[e]&&delete i[e]};this.getAll=function(){return i};this.clear=function(){i=null};this.has=function(e){return!!this.get(e)};this.isLoaded=function(){return r}}return function(){e||(e=new s);return e}}(),m=function(){var e,n,i=[],r=[];function o(){if(i.length){var e=y().get("ekvs");if(function(e){var t=0;for(var n in e)Array.isArray(e[n])&&(t+=e[n].length);return t}(e)+i.length<=1e4){e=s(e,i);y().set("ekvs",e)}}}function s(e,t){var i=(e=e||{})[n];Array.isArray(i)&&i.length?e[n]=i.concat(t):e[n]=[].concat(t);return e}return function(){e||(e={addEvent:function(e){if(n){i.unshift(e);if(i.length>1){o();i.length=0}}else{t().w("session id is null: ",n);r.unshift(e)}},setSessionId:function(e){n=e;t().v("setSessionId: ",n);if(Array.isArray(r)&&r.length&&n){for(var i=0;iu.SESSION_INTERVAL){r=!0;!function(e){try{var n=(i||{}).options||{},r=f.assign({},function(e){var n={};for(var i in e)0===i.indexOf("_um_")&&(n[i]=e[i]);t().v("query: ",e);t().v("_um_params: ",n);return n}(e.query));r.path=e.path||n.path;"gaode"!==o.getPlatform()&&(r.scene=e.scene?o.getPlatform()+"_"+e.scene:n.scene);var s=e.referrerInfo;s&&(r.referrerAppId=s.appId);t().v("session options: ",r);var a=r[u.UM_SSRC];a&&g().setShareSource(a);var c=Date.now();i={id:f.getRandomStr(10)+c,start_time:c,options:r}}catch(e){t().e("生成新session失败: ",e)}}(e);t().v("开始新的session(%s): ",i.id,i)}else t().v("延续上一次session(%s): %s ",i.id,s.toLocaleTimeString(),i);return r},pause:function(){!function(){if(i){var e=new Date;i.end_time=e.getTime();"number"!=typeof i.duration&&(i.duration=0);i.duration=i.end_time-n;y().set(u.CURRENT_SESSION,i);t().v("退出会话(%s): %s ",i.id,e.toLocaleTimeString(),i)}}()},getCurrentSessionId:function(){return(i||{}).id},getCurrentSession:function(){return i},cloneCurrentSession:function(){return f.clone(i)}}}return function(){e||(e=r());return e}}();function b(e){var t=null;switch(e){case A:t=function(){var e=null,t=k().cloneCurrentSession();t&&(e={header:{st:"1"},analytics:{sessions:[t]}});return e}();break;case E:t=function(){var e=null,t={},n=k().cloneCurrentSession();if(n){var i=h().get(),r=g().get();Array.isArray(i)&&i.length&&(n.pages=f.clone(i));Array.isArray(r)&&r.length&&(n.shares=f.clone(r));h().clear();g().clear();t.sessions=[n]}var o=m().getEkvs();if(o){t.ekvs=f.clone(o);m().clear()}(t.sessions||t.ekvs)&&(e={analytics:t});return e}();break;case N:t=function(){var e=null,t=m().getEkvs();if(t){e={analytics:{ekvs:f.clone(t)}};m().clear()}return e}()}return t}var D={sessions:"sn",ekvs:"e",active_user:"active_user"},U={sdk_type:"sdt",access:"ac",access_subtype:"acs",device_model:"dm",language:"lang",device_type:"dt",device_manufacturer:"dmf",device_name:"dn",platform_version:"pv",id_type:"it",font_size_setting:"fss",os_version:"ov",device_manuid:"did",platform_sdk_version:"psv",device_brand:"db",appkey:"ak",_id:"id",id_tracking:"itr",imprint:"imp",sdk_version:"sv",resolution:"rl",testToken:"ttn",theme:"t5",benchmark_level:"bml",screen_width:"sw",screen_height:"sh",status_bar_height:"sbh",safe_area_top:"sat",safe_area_left:"sal",safe_area_right:"sar",safe_area_bottom:"sab",safe_area_height:"sah",safe_area_width:"saw",pixel_ratio:"pr",storage:"s7",host:"hs"},P={uuid:"ud",unionid:"und",openid:"od",anonymousid:"nd",alipay_id:"ad",device_id:"dd",userid:"puid"};function R(e,t){var n=L(e,t);e&&e.id_tracking&&(n[t.id_tracking||"id_tracking"]=L(e.id_tracking,P));return n}function L(e,t){var n={};for(var i in e)t[i]?n[t[i]]=e[i]:n[i]=e[i];return n}function C(e,t){var n={};if(e)for(var i in e)e[i]&&(n[t[i]]=e[i]);return n}var M="";function x(){return M}var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=function(e){for(var t={},n=0,i=e.length;n>>6)+F(128|63&t):F(224|t>>>12&15)+F(128|t>>>6&63)+F(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return F(240|t>>>18&7)+F(128|t>>>12&63)+F(128|t>>>6&63)+F(128|63&t)},q=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,K=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[V.charAt(n>>>18),V.charAt(n>>>12&63),t>=2?"=":V.charAt(n>>>6&63),t>=1?"=":V.charAt(63&n)].join("")},H=function(e){return t=function(e){return e.replace(q,G)}(e),t.replace(/[\s\S]{1,3}/g,K);var t},Y=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),J=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return F(55296+(t>>>10))+F(56320+(1023&t));case 3:return F((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return F((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},B=function(e){var t=e.length,n=t%4,i=(t>0?j[e.charAt(0)]<<18:0)|(t>1?j[e.charAt(1)]<<12:0)|(t>2?j[e.charAt(2)]<<6:0)|(t>3?j[e.charAt(3)]:0),r=[F(i>>>16),F(i>>>8&255),F(255&i)];r.length-=[0,0,2,1][n];return r.join("")},X=function(e){return t=function(e){return e.replace(/[\s\S]{1,4}/g,B)}(e),t.replace(Y,J);var t},W=function(e,t){return t?H(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):H(String(e))},z=function(e){return X(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))};var Q=new function(){var e="",t=this;this.set=function(t){e=t};this.get=function(){return e};this.getImpObj=function(){return _(z(e))};this.getItem=function(e){var n=t.getImpObj();return n&&n[e]||""};this.load=function(){e=y().get(u.IMPRINT)};this.save=function(){e&&y().set(u.IMPRINT,e)}};function Z(e,n,i,r){w.instance().setIdType(l().getIdType());w.instance().setIdTracking(l().getIdTracking());var s=l().getUserId();s&&e.analytics&&(e.analytics.active_user={puid:s,provider:l().getProvider()});var a=f.clone(w.instance().get());e.header=f.assign(a,e.header,{ts:Date.now(),testToken:x(),traceId:f.getRandomStr(10)+Date.now()+f.getRandomStr(9)});var c=function(e){return{h:R(e.header,U),a:C(e.analytics,D)}}(e),p=v(c),h={url:u.ENDPOINT+u.LOG_URL,method:"POST",data:c,success:function(r){var o=r.code||r.status||r.statusCode;if(200===o||413===o){t().i("数据发送成功: ",e,p);!function(e){if(e){w.instance().setItem(u.IMPRINT,e);Q.set(e);Q.save();t().v("imprint: ",Q.getImpObj());Q.getItem("ttn_invalid")&&(M="")}}((r.data||{}).imprint);"function"==typeof n&&n(r)}else{t().w("数据发送失败: ",p);"function"==typeof i&&i()}},fail:function(e){t().w("超时: ",p);"function"==typeof i&&i()},complete:function(){"function"==typeof r&&r()}};o.request(f.assign(h,{header:{"Msg-Type":o.getSdkType()+"/json","disable-base64":"Y"}}))}function $(e){var t=e,n=[];this.enqueue=function(e){"number"==typeof t&&this.size()>=t&&this.dequeue();n.push(e)};this.dequeue=function(){return n.shift()};this.front=function(){return n[0]};this.isEmpty=function(){return 0===n.length};this.clear=function(){n.length=0};this.size=function(){return n.length};this.items=function(){return n};this.print=function(){console.log(n.toString())}}var ee=function(){var e=null,n=!1,i=[],r=new $(50);function o(e,t,n){if(w.instance().isLoaded()){t=t||{};var i=b(e);if(i){var s=w.instance().getRealtimeFields();i.header=f.assign({},i.header,s);i.noCache=t.noCache;r.enqueue(i)}"function"==typeof n&&n()}else setTimeout((function(){o(e,t,n)}),100)}function s(e){var t=r.front();if(t)Z(t,(function(){r.dequeue();s(e)}),(function(){var t=r.dequeue();t&&!t.noCache&&i.push(t);s(e)}));else{!function(){i.forEach((function(e){r.enqueue(e)}));i.length=0}();e()}}function a(e){if(l().getId())if(n)t().i("队列正在发送中");else{n=!0;s((function(){n=!1;"function"==typeof e&&e()}))}else{t().i("获取id标识失败,暂缓发送");"function"==typeof e&&e()}}function c(){this.send=function(e,t,n){e?this.add(e,t,(function(){a(n)})):a(n)};this.add=function(e,t,n){o(e,t,n)};this.load=function(){var e=y().get(u.REQUESTS);e&&e.length&&e.forEach((function(e){r.enqueue(e)}));y().remove(u.REQUESTS)};this.save=function(){y().set(u.REQUESTS,f.clone(r.items()));r.clear()}}return function(){e||(e=new c);return e}}(),te=function(){var e=null,i=null;function r(){this.setUserInfo=function(e){i=e};this.update=function(){e(i)||o.getUserInfo((function(t){e(t)}))};function e(e){if(e&&"object"==typeof e){var i=y().get(u.USER_INFO);i&&f.deepEqual(e,i)||function(e,i){var r=n().appKey(),s=o.getSdkType(),a=l().getId(),c=l().getIdType();if(!(r&&s&&a&&c))return;var f={ak:n().appKey(),sdt:o.getSdkType(),uin:e.nickName,uia:e.avatar||e.avatarUrl,uig:e.gender,uit:e.country,uip:e.province,uic:e.city,uil:e.language,id:l().getId(),it:l().getIdType(),age:e.age,cln:e.constellation},p=JSON.stringify(f);p=W(p);o.request({url:u.ENDPOINT+u.USERINFO_URL,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},data:"ui="+p,success:function(n){t().v("用户信息上传成功: ",e);i&&i(n&&n.data&&200===n.data.code)},fail:function(){t().e("用户信息上传失败: ",e);i&&i(!1)}})}(e,(function(t){t&&y().set(u.USER_INFO,e)}));return!0}return!1}}return function(){e||(e=new r);return e}}();function ne(e,t){this.id=e;this.ts=Date.now();var n=typeof t;if("string"===n&&t)this[e]=t;else if("object"===n)for(var i in t)({}).hasOwnProperty.call(t,i)&&(this[i]=t[i])}function ie(){var e=!1,i=!1,r=0;this.init=function(i){t().v("sdk version: "+u.IMPL_VERSION);e?t().v("Lib重复实例化"):y().load((function(){t().v("cache初始化成功: ",y().getAll());!function(){l().setUseOpenid&&l().setUseOpenid(n().useOpenid());l().init((function(){w.instance().init();t().v("Header初始化成功")}))}();e=!0;"function"==typeof i&&i();t().tip("SDK集成成功")}))};this.resume=function(r){if(e&&!i){t().v("showOptions: ",r);var o;i=!0;n().enableVerify()&&r&&r.query&&(o=r.query._ttn,M=o||M);this._resume(r)}};this._resume=function(e){ee().load();var i=k().resume(e),r=k().getCurrentSessionId();m().setSessionId(r);i&&ee().add(A,{},(function(){l().setUseOpenid&&l().setUseOpenid(n().useOpenid());if(n().useOpenid()&&n().autoGetOpenid()&&!l().getId()){t().v("get id async");o(10,3e3)}else{t().v("session auto send");ee().send()}}));function o(e,i){l().getId()||e<=0||l().getOpenIdAsync(n().appKey(),(function(n){if(n){t().v("获取id成功");ee().send()}else{t().v("获取openid失败,启动重试,剩余可用次数",e-1);setTimeout((function(){o(e-1,i)}),i)}}))}};this.pause=function(o){if(e){i=!1;r=0;k().pause();n().uploadUserInfo()&&te().update();ee().send(E,{},(function(){ee().save();y().save();t().v("cache save success");"function"==typeof o&&o()}))}};this.setOpenid=function(e){t().v("setOpenId: %s",e);l().setOpenid(e);ee().send()};this.setUnionid=function(e){t().v("setUnionid: %s",e);l().setUnionid(e)};this.setUserid=function(e,n){t().v("setUserid: %s",e,n);l().setUserid(e,n)};this.removeUserid=function(){t().v("removeUserid");l().removeUserid()};this.setUserInfo=function(e){t().v("setUserInfo: %s",e);te().setUserInfo(e)};this.setAnonymousid=function(e){t().v("setAnonymousId: %s",e);l().setAnonymousid(e);ee().send()};this.setAppVersion=function(e){e&&"string"!=typeof e?t().w("setAppVersion方法只接受字符串类型参数"):w.instance().setAppVersion(e)};this.setAlipayUserid=function(e){if(e&&"string"!=typeof e)t().w("setAlipayUserid方法只接受字符串类型参数");else{t().v("setAlipayUserid: %s",e);l().setAlipayUserid(e)}};this.setDeviceId=function(e){if("string"==typeof e){l().setDeviceId(e);return e}};this.setSuperProperty=function(e){if(e&&"string"!=typeof e)t().w("超级属性只支持字符串类型");else{var n=this;if(w.instance().getSuperProperty()!==e){w.instance().setSuperProperty(e);n.pause((function(){n.resume()}))}}};this.trackEvent=function(n,i){if(e){t().v("event: ",n,i);if(function(e,n){if(!e||"string"!=typeof e){t().e('please check trackEvent id. id should be "string" and not null');return!1}var i=["id","ts","du"],r={};i.forEach((function(e){r[e]=1}));if(r[e]){t().e("eventId不能与以下保留字冲突: "+i.join(","));return!1}if(e.length>u.MAX_EVENTID_LENGTH){t().e("The maximum length of event id shall not exceed "+u.MAX_EVENTID_LENGTH);return!1}if(n&&("object"!=typeof n||Array.isArray(n))&&"string"!=typeof n){t().e("please check trackEvent properties. properties should be string or object(not include Array)");return!1}if("object"==typeof n){var o=0;for(var s in n)if({}.hasOwnProperty.call(n,s)){if(s.length>u.MAX_PROPERTY_KEY_LENGTH){t().e("The maximum length of property key shall not exceed "+u.MAX_PROPERTY_KEY_LENGTH);return!1}if(o>=u.MAX_PROPERTY_KEYS_COUNT){t().e("The maximum count of properties shall not exceed "+u.MAX_PROPERTY_KEYS_COUNT);return!1}if(r[s]){t().e("属性中的key不能与以下保留字冲突: "+i.join(","));return!1}o+=1}}return!0}(n,i)){var o=new ne(n,i);m().addEvent(o);var s=!!x(),a=s?0:u.EVENT_SEND_DEFAULT_INTERVAL,c=Date.now();if(function(e,t){return"number"!=typeof r||"number"!=typeof t||r<=0||e-r>t}(c,a)){r=c;ee().send(N,{noCache:s},(function(){}))}}}};this.trackShare=function(n){if(e)try{if(o.getSdkType().indexOf("game")>-1){n=g().add(n,!0);t().v("shareQuery: ",n)}else{n=g().add(n,!1);t().v("sharePath: ",n.path)}}catch(e){t().v("shareAppMessage: ",e)}return n};this.trackPageStart=function(t){e&&h().addPageStart(t)};this.trackPageEnd=function(t){e&&h().addPageEnd(t)};this.onShareAppMessage=function(e){var t=this;o.onShareAppMessage((function(){return t.trackShare(e())}))};this.shareAppMessage=function(e){this.trackShare(e);o.shareAppMessage(e)}}var re=[];function oe(){}oe.prototype={createMethod:function(e,n,i){try{e[n]=i&&i[n]?function(){return i[n].apply(i,arguments)}:function(){re.push([n,[].slice.call(arguments)])}}catch(e){t().v("create method errror: ",e)}},installApi:function(e,n){try{var i,r,o="resume,pause,trackEvent,trackPageStart,trackPageEnd,trackShare,setUserid,setOpenid,setUnionid,setSuperProperty,setUserInfo".split(",");for(i=0,r=o.length;i=se.length||n){n&&(r=i,u.ENDPOINT=r);n&&t().v("命中可用服务",i);!n&&t().tip_w("未命中可用服务");return!1}o.request({url:u.ENDPOINT+"/uminiprogram_logs/ckdh",success:function(t){200===(t.code||t.status||t.statusCode)&&t.data&&200===t.data.code?ae(e+1,!0):ae(e+1,!1)},fail:function(){ae(e+1,!1)}})}var ue={init:function(e){u.ENDPOINTB&&setTimeout((function(){ae(0,!1)}),e)}},ce=new oe,fe={_inited:!1,_log:t(),preinit:function(e){if(e&&"object"==typeof e)for(var t in e)u[t]=e[t];return u},use:function(e,t){e&&f.isFunction(e.install)?e.install(fe,t):f.isFunction(e)&&e(fe,t);return fe},messager:r,init:function(e){if(this._inited)t().v("已经实例过,请避免重复初始化");else if(e)if(e.appKey){"boolean"!=typeof e.useOpenid&&(e.useOpenid=!0);n().set(e);t().setDebug(e.debug);this._inited=!0;var i=this;r.emit(r.messageType.CONFIG_LOADED,e);try{var o=new ie;t().v("成功创建Lib对象");0;o.init((function(){t().v("Lib对象初始化成功");ce.installApi(i,o);t().v("安装Lib接口成功");r.emit(r.messageType.UMA_LIB_INITED,e)}));ue.init(3e3)}catch(e){t().w("创建Lib对象异常: "+e)}}else t().err("请确保传入正确的appkey");else t().err("请正确设置相关信息!")}};try{ce.installApi(fe,null)}catch(e){t().w("uma赋值异常: ",e)}var pe="https://ucc.umeng.com/v1/mini/fetch",le="https://pslog.umeng.com/mini_ablog",he="2.7.5",de="none",ge={},ve=Array.isArray;ge.isArray=ve||function(e){return"[object Array]"===toString.call(e)};ge.isObject=function(e){return e===Object(e)&&!ge.isArray(e)};ge.isEmptyObject=function(e){if(ge.isObject(e)){for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}return!1};ge.isUndefined=function(e){return void 0===e};ge.isString=function(e){return"[object String]"===toString.call(e)};ge.isDate=function(e){return"[object Date]"===toString.call(e)};ge.isNumber=function(e){return"[object Number]"===toString.call(e)};ge.each=function(e,t,n){if(null!=e){var i={},r=Array.prototype.forEach;if(r&&e.forEach===r)e.forEach(t,n);else if(e.length===+e.length){for(var o=0,s=e.length;o