zg-sdk-wechart 2.0.13 → 2.0.16

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/README.md CHANGED
@@ -363,3 +363,11 @@ export default Index;
363
363
  #### 6. sendLimit 批量上传时,上传时机是什么时候?
364
364
 
365
365
  当设置了 sendLimit 时,触发的所有埋点请求,会达到 limit 指定数量时,将所有埋点数据合并为一个请求进行上传。另外为避免数据丢失的可能性,当页面触发 Page 的 onHide、onUnload 生命周期时,不管请求数量是否达到 limit 限制,都会将已缓存数据进行上传。
366
+
367
+
368
+ #### 7. 如何启动小程序可视化埋点?
369
+ 可视化埋点启动的前提是开启全埋点(即 config 中的 pv 和 click 设置为true),同时 config 中的 visual 也设置为 true 时,小程序sdk会启动可视化埋点,每次点击或浏览行为发生后,会把行为数据与可视化埋点规则中的数据进行比较,如果能匹配上,侧进行全埋点的同时,会进行可视化埋点上报。
370
+
371
+
372
+ #### 8. 如何新增或修改小程序可视化规则?
373
+ 登录诸葛分析平台 - 顶部导航 - 数据管理 - 数据接入 - 微信小程序 - 可视化埋点 - 授权对应的小程序 - 启动可视化埋点 - 手机扫码小程序二维码 - 小程序通过scoket与分析平台进行连接 - 手机端进行点击或浏览操作 - 分析平台新增或修改可视化规则。(注:开发者在扫码后,需要在手机端打开小程序调试模式,这样避免微信官方的域名校验导致sckoet连接失败的问题。)通过 socketUrl 可配置私有化的scoket连接。
@@ -1,4 +1,4 @@
1
- var t=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},i=u.iterator||"@@iterator",o=u.asyncIterator||"@@asyncIterator",a=u.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var u=e&&e.prototype instanceof v?e:v,i=Object.create(u.prototype),o=new D(n||[]);return i._invoke=function(t,e,r){var n=l;return function(u,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===u)throw i;return j()}for(r.method=u,r.arg=i;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var s=m(t,e,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(t,r,o),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function g(){}function _(){}var y={};y[i]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(T([])));b&&b!==r&&n.call(b,i)&&(y=b);var k=_.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(u,i,o,a){var s=m(t[u],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,a)}))}a(s.arg)}var u;this._invoke=function(t,n){function i(){return new e((function(e,u){r(t,n,e,u)}))}return u=u?u.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var u=m(n,t.iterator,r.arg);if("throw"===u.type)return r.method="throw",r.arg=u.arg,r.delegate=null,d;var i=u.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var u=-1,o=function r(){for(;++u<t.length;)if(n.call(t,u))return r.value=t[u],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}return{next:j}}function j(){return{value:e,done:!0}}return g.prototype=k.constructor=_,_.constructor=g,g.displayName=s(_,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,a,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,r,n,u,i){void 0===i&&(i=Promise);var o=new S(c(e,r,n,u),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(k),s(k,a,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach($),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function u(n,u){return a.type="throw",a.arg=t,r.next=n,u&&(r.method="next",r.arg=e),!!u}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return u("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return u(o.catchLoc,!0);if(this.prev<o.finallyLoc)return u(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return u(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return u(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var u=this.tryEntries[r];if(u.tryLoc<=this.prev&&n.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var i=u;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var u=n.arg;$(r)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}({});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var u=a(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return c(this,r)}}function l(t,e,r){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var u=Object.getOwnPropertyDescriptor(n,e);return u.get?u.get.call(r):u.value}})(t,e,r||t)}function h(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}
1
+ var t=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),u=new E(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var u=n.delegate;if(u){var a=O(u,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var s=m(t,e,n);if("normal"===s.type){if(r=n.done?p:h,s.arg===d)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(t,n,u),o}function m(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function g(){}function y(){}var _={};_[o]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w($([])));k&&k!==n&&r.call(k,o)&&(_=k);var b=y.prototype=v.prototype=Object.create(_);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,u,a){var s=m(t[i],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,a)}),(function(t){n("throw",t,u,a)})):e.resolve(l).then((function(t){c.value=t,u(c)}),(function(t){return n("throw",t,u,a)}))}a(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=m(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function $(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return u.next=u}}return{next:C}}function C(){return{value:e,done:!0}}return g.prototype=b.constructor=y,y.constructor=g,g.displayName=s(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,a,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(S.prototype),S.prototype[u]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var u=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},x(b),s(b,a,"Generator"),b[o]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=$,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return a.type="throw",a.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var s=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:$(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}({});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=a(t);if(e){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function l(t,e,n){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- function d(t,e,r,n){var u,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(u=t[a])&&(o=(i<3?u(o):i>3?u(e,r,o):u(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function v(t,e,r,n){return new(r||(r=Promise))((function(u,i){function o(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?u(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}s((n=n.apply(t,e||[])).next())}))}var g,_,y,w={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=Array.from(new Set(e[n].concat(r[n]))):t.isObject(e[n])&&t.isObject(r[n])?e[n]=t.merge(e[n],r[n]):e[n]=r[n]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(t){var r=function(t){var e=t.constructor;switch(n(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return i(t);case"Symbol":return u(t);case"Function":return t;default:return null}},n=function(t){return Object.prototype.toString.call(t).slice(8,-1)},u=function(t){return Object(Symbol.prototype.valueOf.call(t))},i=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},o=function(t,e){for(var r=-1,n=t.length;++r<n;)e(t[r],r);return t},a=function t(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(u)||null===u)return u;var a=n(u),s=null;return i.get(u)?i.get(u):(i.set(u,s),"Set"!==a&&"Map"!==a&&"Array"!==a&&"Object"!==a?r(u):"Set"===a?(s=new Set,u.forEach((function(e){s.add(t(e,i))})),s):"Map"===a?(s=new Map,u.forEach((function(e,r){s.set(r,t(e,i))})),s):("Array"===a&&(s=new Array,o(u,(function(e,r){s[r]=t(e,i)}))),"Object"===a&&(s=new Object,o(Object.keys(u),(function(e){s[e]=t(u[e],i)}))),s))};return a(t)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var r in t)e.push("".concat(r,"=").concat(t[r]));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var r in t)e["_"+r]=t[r];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var r=!0;for(var n in t)t[n]!==e[n]&&(r=!1);return r},getUtmByQuery:function(t){var e={};for(var r in t)this.utmKeys.includes(r)&&(e[r]=t[r]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var u in t)e.indexOf(u)>-1&&(r=!0,n[u]=t[u]);return r?n:null},deleteQueryParams:function(t,e){var r=t.split("&"),n=[];return r.forEach((function(t){var r=new RegExp(e+"=.*"),u="";r.test(t)?(u=t.replace(r,""))&&n.push(u):n.push(t)})),n.join("&")},addUrlParam:function(t,e){var r=t,n="";for(var u in e)n&&(n+="&"),r=this.deleteQueryParams(r,u),n+=u+"="+e[u];var i=r.split("?");return i.length>1?i[1]?i[1]=n+"&"+i[1]:i[1]=n:1===i.length&&i.push(n),i.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,r,n,u="";t.data&&t.data.title&&t.data.title.length>0&&(u=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!u.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(u=e.text)})),!u.length)){var i=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];u=i?null===(e=i.window)||void 0===e?void 0:e.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(t){}return u||t.route}},b=function(){function t(e,n){r(this,t),this.timeout=500,this.catch=[],this.clearCatchTimer=null,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=e}return u(t,[{key:"generateRequestData",value:function(){var t=new Date,e={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()," ").concat(t.getHours(),":").concat(t.getMinutes(),":").concat(t.getSeconds()),tz:w.getTimezone(t),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:h(this.catch)}),_:t.getTime()+""};return this.catch=[],e}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(t,n){var u,i=!1;u=setTimeout((function(){i=!0,t(null)}),e.timeout),e.requestFunction(e.url,r,{timeout:e.requestTimeout}).then((function(e){i||(clearTimeout(u),t(e))})).catch((function(t){n(t)}))}))}}}]),t}(),k=function(){function e(t,n,u){r(this,e),this.storageFunction=t,this.allData=u||{},this.allData.did||this.set("did",n.config.did||w.UUID()),this.allData.cuid||this.set("cuid",void 0),w.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return u(e,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(e,r){return v(this,void 0,void 0,t.mark((function n(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.allData[e]=r,t.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return t.stop()}}),n,this)})))}}]),e}();function x(t,e,r){var n=r.value;return r.value=function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:e,args:r})},r}var S=function(){function e(t,n,u){r(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,_=t,g=n,y=u,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},debug:!1,pv:!1,click:!1,timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1}}return u(e,[{key:"load",value:function(e,r){return v(this,void 0,void 0,t.mark((function n(){var u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.appKey=e,this.config=w.merge(this.config,r||{}),t.prev=2,t.next=5,g.get();case 5:if((u=t.sent)&&u.did){t.next=10;break}return t.next=9,g.getDid();case 9:u.did=t.sent;case 10:this.storage=new k(g,this,u),this.request=new b(_,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2),console.error("sdk初始化失败,缓存读取失败",t.t0);case 20:case"end":return t.stop()}}),n,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var r in e)e[r]&&(t.pr["$".concat(r)]=e[r]);return this.request.send(t)}},{key:"trackBaseData",value:function(e){return v(this,void 0,void 0,t.mark((function r(){var n,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Date,t.t0=e,t.t1=n.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=w.getTimezone(n),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=y.os(),t.t9=y.ov(),t.t10=y.version(),t.next=14,y.mnet();case 14:return t.t11=t.sent,t.next=17,y.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15},(u={dt:"evt",pr:t.t16}).pr=w.merge(u.pr,w.encode(this.config.superProperty)),t.abrupt("return",u);case 25:case"end":return t.stop()}}),r,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(y.windowWidth(),"x").concat(y.windowHeight()),$tz:w.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();e.pr.$dv=r.model,e.pr.$br=r.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,r=t.update-t.sid,n={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:w.getTimezone(e),$dru:r,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return v(this,void 0,void 0,t.mark((function e(){var r,n,u,i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,n=this.storage.allData,u=n.sid,i=n.cuid,t.t0=u,t.t1=u,t.t2=i,t.t3=this.cn,t.t4=w.getTimezone(r),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=y.os(),t.t8=y.ov(),t.t9=y.version(),t.next=14,y.mnet();case 14:return t.t10=t.sent,t.next=17,y.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},o={dt:"ss",pr:t.t15},this.config.utm&&!w.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(o),this.environmentInfo();case 26:case"end":return t.stop()}}),e,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,r=Date.now();if(e.sid&&e.update)if(r-e.update>this.config.timeout){var n=w.clone(e);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{$element_content:"",$element_selector:"",$element_style:[]};return v(this,void 0,void 0,t.mark((function e(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:return(n=t.sent).dt="abp",n.pr=w.merge(n.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},r),t.next=10,this.send(n);case 10:case"end":return t.stop()}}),e,this)})))}},{key:"pv",value:function(e){return v(this,void 0,void 0,t.mark((function r(){var n,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(n=t.sent).dt="abp",u={$page_title:this.currentPage.title},n.pr=w.merge(n.pr,u,e||{}),t.next=11,this.send(n);case 11:case"end":return t.stop()}}),r,this)})))}},{key:"duration",value:function(){return v(this,void 0,void 0,t.mark((function e(){var r,n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),w.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),r=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(n=t.sent).dt="abp",n.pr=w.merge(n.pr,{$dr:r,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(n);case 12:w.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),e,this)})))}},{key:"track",value:function(e,r){return v(this,void 0,void 0,t.mark((function n(){var u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track"),t.next=3,this.trackBaseData(e);case 3:return(u=t.sent).pr=w.merge(u.pr,w.encode(r)),t.next=7,this.send(u);case 7:case"end":return t.stop()}}),n,this)})))}},{key:"identify",value:function(e,r){return v(this,void 0,void 0,t.mark((function n(){var u,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),u=new Date,(i={dt:"usr",pr:{$ct:u.getTime(),$tz:w.getTimezone(u),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=w.merge(i.pr,w.encode(r)),t.next=7,this.trackBaseData("usr");case 7:return t.next=9,this.send(i);case 9:case"end":return t.stop()}}),n,this)})))}},{key:"setPushClient",value:function(e,r){return v(this,void 0,void 0,t.mark((function n(){var u,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=new Date,i={dt:"um",pr:{$ct:u.getTime(),$tz:w.getTimezone(u),$push_ch:r||"getui",$push_id:e}},t.next=4,this.trackBaseData("usr");case 4:return t.next=6,this.send(i);case 6:case"end":return t.stop()}}),n,this)})))}},{key:"trackCount",value:function(t,e){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=w.clone(e)),this.previousCountEvent.name===t&&w.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=w.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,r,n){return v(this,void 0,void 0,t.mark((function u(){var i,o,a,s;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track count"),i=Date.now()-this.countStartTime,n&&(i-=this.config.countDuration),o=this.count,this.count=n?0:1,t.next=7,this.trackBaseData(e);case 7:return a=t.sent,s={},w.isObject(r)&&(s=w.clone(r)),a.pr=w.merge(a.pr,w.encode(s),w.encode({count:o,countTime:i})),t.next=13,this.send(a);case 13:case"end":return t.stop()}}),u,this)})))}},{key:"trackRevenue",value:function(e){return v(this,void 0,void 0,t.mark((function r(){var n,u,i,o,a,s,c,m;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=function(t,e){var r=0;try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),r.next=4,this.trackBaseData("revenue");case 4:(n=r.sent).dt="abp",(u=w.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=i(u.price,u.productQuantity),o=["productID","revenueType"],a=["price","total","productQuantity"],s={},r.t0=t.keys(u);case 12:if((r.t1=r.t0()).done){r.next=21;break}if(c=r.t1.value,-1!==o.indexOf(c)||-1!==a.indexOf(c)){r.next=16;break}return r.abrupt("continue",12);case 16:m=u[c],a.indexOf(c)>-1&&((m=Number(m))||(m=0)),s["$"+c]=m,r.next=12;break;case 21:return n.pr=w.merge(n.pr,s),r.next=24,this.send(n);case 24:case"end":return r.stop()}}),r,this)})))}},{key:"setUtm",value:function(e){return v(this,void 0,void 0,t.mark((function r(){var n;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(n=w.filterUtm(e))&&(this.storage.set("utm",n),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),r,this)})))}},{key:"setSuperProperty",value:function(t){w.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){w.isObject(t)&&(this.config.superProperty=w.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,u=function(){};return{s:u,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;delete this.config.superProperty[n]}}catch(t){r.e(t)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();d([x],S.prototype,"environmentInfo",null),d([x],S.prototype,"sessionEnd",null),d([x],S.prototype,"sessionStart",null),d([x],S.prototype,"updateSession",null),d([x],S.prototype,"click",null),d([x],S.prototype,"pv",null),d([x],S.prototype,"duration",null),d([x],S.prototype,"track",null),d([x],S.prototype,"identify",null),d([x],S.prototype,"setPushClient",null),d([x],S.prototype,"trackCount",null),d([x],S.prototype,"trackRevenue",null),d([x],S.prototype,"setUtm",null);var P=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],O=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],$=function(t){return w.wxGetTitle(t)},D=function(t,e,r){return new Promise((function(n,u){var o;wx.request((i(o={url:t,data:e,method:"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":"application/x-www-form-urlencoded"}),i(o,"dataType","json"),i(o,"responseType","arraybuffer"),i(o,"success",(function(t){n(t)})),i(o,"fail",(function(t){u(t)})),o))}))},T={did:null,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(r,n){wx.setStorage({key:t,data:e,success:r,fail:n})}))}},j=!1,E=wx.getSystemInfoSync(),C=E.system.split(/\s/),A={os:C[0],ov:C[1],version:E.version,windowHeight:E.windowHeight,windowWidth:E.windowWidth,net:0,mnet:0};function z(t){var e=t.toLowerCase();"wifi"===e?(A.net=1,A.mnet=0):(A.net=0,A.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function L(t){return new Promise((function(e,r){if(j)return e(A[t]);wx.getNetworkType({success:function(r){j=!0,z(r.networkType),e(A[t])}})}))}wx.onNetworkStatusChange((function(t){z(t.networkType)}));var I,R,q={os:function(){return A.os},ov:function(){return A.ov},version:function(){return A.version},net:function(){return L("net")},mnet:function(){return L("mnet")},windowWidth:function(){return A.windowWidth},windowHeight:function(){return A.windowHeight}},U=App,F=Page,N=Component,M=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function B(t,e,r){if(t[r]&&w.isFunction(t[r])){var n=t[r];t[r]=function(){n.apply(this,arguments),e[r].apply(this,arguments)}}else t[r]=function(){e[r].apply(this,arguments)}}function H(t,e,r){var n=t[e];t[e]=function(){var t=arguments[0];if(I===t||t&&I&&I.timeStamp===t.timeStamp)return n.apply(this,arguments);if(I=t,t){var e=t.type;"tap"===e&&r.click(t)}return n.apply(this,arguments)}}var W=function(e){o(i,S);var n=m(i);function i(t){var e;return r(this,i),(e=n.call(this,D,T,q)).openData={path:"",props:{}},e.shared=!1,e.semiAutoTrackEventCatch={},e.isShareOperation=!1,R=t,e.initLifeCycleHook(),e}return u(i,[{key:"initLifeCycleHook",value:function(){var t,e=this,r=(t=e,{App:{onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){t.currentPage.query=w.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),r=e[e.length-1];t.currentPage.route=r.__route__||r.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var n=$;if(t.currentPage.title="function"==typeof n?n(r):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(r),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=w.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=w.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=r;var n=function(t){for(var n in r.App)B(t,r.App,n);for(var u in t)!P.includes(u)&&w.isFunction(t[u])&&H(t,u,e);return U(t)};for(var u in App)n[u]=App[u];App=n;var i=function(t){for(var n in r.Page)B(t,r.Page,n);for(var u in t)!O.includes(u)&&w.isFunction(t[u])&&"onShareAppMessage"!==u&&H(t,u,e);var i=t.onShareAppMessage;return w.isFunction(i)&&(t.onShareAppMessage=e.onShareAppMessage(i)),F(t)};for(var o in Page)i[o]=Page[o];Page=i,Component=function(t){if(void 0!==t.methods)for(var r in t.methods)H(t.methods,r,e);return N(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return l(a(i.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(e){var r=this,n=Object.create(null,{pv:{get:function(){return l(a(i.prototype),"pv",r)}}});return v(this,void 0,void 0,t.mark((function e(){var r,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},u=w.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(r.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(r.$share_level=Number(this.openOptions.query.zg_share_level)),u.data&&u.data.zg_share_data&&(r=w.merge(r,w.encode(u.data.zg_share_data)))),t.next=5,n.pv.call(this,r);case 5:case"end":return t.stop()}}),e,this)})))}},{key:"click",value:function(e,r){var n=this,u=Object.create(null,{click:{get:function(){return l(a(i.prototype),"click",n)}}});return v(this,void 0,void 0,t.mark((function n(){var i,o,a,s;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.target,o=i.dataset.title,a=i.dataset.index,s=[],s="alipay-miniprogram"===this.referrerDomain?["","",e.detail.pageX,e.detail.pageY]:["","",e.detail.x,e.detail.y],t.next=7,u.click.call(this,e,w.merge({$element_content:o||"",$element_selector:a||"",$element_style:s},r||{}));case 7:case"end":return t.stop()}}),n,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=w.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&R){var r=t.scene;this.cn=r+"";var n=R[r],u={},i=null,o=R.isShare(r);if(o&&t.referrerInfo&&(i=t.referrerInfo.appId),n){u={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:i};var a=t.query||{};R.isCartShare(r)&&a.zg_uid&&a.zg_share_id&&(u.utm_term=a.zg_uid,u.utm_content=a.zg_share_id)}e=w.merge(u,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&w.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(e){return v(this,void 0,void 0,t.mark((function r(){var n,u,i,o,a,s,c,m,l,h,f;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(n=e.query||{},u=this.currentPage.route,!(R.isCartShare(e.scene)&&n.zg_uid&&n.zg_share_id)){t.next=24;break}for(a in i={$uid:n.zg_uid,$share_id:n.zg_share_id,$title:this.currentPage.title,$path:u,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(n.zg_share_level)},this.shareId=n.zg_share_id,this.shareLevel=Number(n.zg_share_level),o={},n)s=a.replace(/^zg_/,""),-1===M.indexOf(s)&&/^zg_/.test(a)&&(o[s]=n[a]);if(c=this.config.shareToUtm,w.isObject(c)&&!w.isEmpty(c)){for(l in m={},c)null!==o[l]&&void 0!==o[l]&&(h=c[l],m[h]=o[l]);w.isEmpty(m)||(m.utm_campaign||(m.utm_campaign="分享打开"),this.setUtm(m))}return this.openData={path:u,props:o},i=w.merge(i,w.encode(o)),t.next=19,this.trackBaseData("wxsopen");case 19:return(f=t.sent).dt="abp",f.pr=w.merge(f.pr,i),t.next=24,this.send(f);case 24:case"end":return t.stop()}}),r,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var r=t.apply(this,arguments)||{};if(!e.config.forwardShare)return r;r.path=r.path||e.currentPage.url;var n=r.title||e.currentPage.title,u=r.path.split("?")[0],i=this.data.zg_share_data,o=(new Date).getTime(),a=1;!this.data.newShare&&e.openData&&e.openData.path===u&&w.isEqual(i||{},e.openData.props)&&(o=e.shareId,a=e.shareLevel+1);var s={share_id:o,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:a},c={$share_title:n,$title:e.currentPage.title||"",$path:u},m={};for(var l in s)c["$".concat(l)]=m["zg_".concat(l)]=s[l];for(var h in i)-1===M.indexOf(h)&&(c["_".concat(h)]=m["zg_".concat(h)]=i[h]);return r.path=w.addUrlParam(r.path,m),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=w.merge(t.pr,c),e.request.send(t)})),e.shared=!0,r}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var r,n=e.getEventDataFromDataset(t.dataset);(r=l(a(i.prototype),"track",e)).call.apply(r,[e].concat(h(n)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},r="";for(var n in t){if(n.startsWith("expo"))if("expoName"===n)r=t[n];else e[n.replace(/^expo(.*)/,(function(t,e,r,n){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[n]}return[r,e]}}]),i}();d([x],W.prototype,"sceneToUtm",null),d([x],W.prototype,"trackOpenShare",null);var G={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},Q=new(function(t){o(n,W);var e=m(n);function n(){return r(this,n),e.call(this,G)}return u(n,[{key:"load",value:function(t,e){var r=e||{};if(wx.getAccountInfoSync){var u=wx.getAccountInfoSync();u&&u.miniProgram&&u.miniProgram.appId&&(r.appId=u.miniProgram.appId)}return l(a(n.prototype),"load",this).call(this,t,r)}}]),n}());App.zhuge=Q;export default Q;
16
+ function v(t,e,n,r){var i,o=arguments.length,u=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(u=(o<3?i(u):o>3?i(e,n,u):i(e,n))||u);return o>3&&u&&Object.defineProperty(e,n,u),u}function g(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{s(r.next(t))}catch(t){o(t)}}function a(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}s((r=r.apply(t,e||[])).next())}))}var y,_={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},jsJSON:function(t){try{return JSON.parse(t),!0}catch(t){return!1}},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce((function(e,n){return Object.keys(n).forEach((function(r){Array.isArray(e[r])&&Array.isArray(n[r])?e[r]=Array.from(new Set(e[r].concat(n[r]))):t.isObject(e[r])&&t.isObject(n[r])?e[r]=t.merge(e[r],n[r]):e[r]=n[r]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(t){var n=function(t){var e=t.constructor;switch(r(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return o(t);case"Symbol":return i(t);case"Function":return t;default:return null}},r=function(t){return Object.prototype.toString.call(t).slice(8,-1)},i=function(t){return Object(Symbol.prototype.valueOf.call(t))},o=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},u=function(t,e){for(var n=-1,r=t.length;++n<r;)e(t[n],n);return t},a=function t(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(i)||null===i)return i;var a=r(i),s=null;return o.get(i)?o.get(i):(o.set(i,s),"Set"!==a&&"Map"!==a&&"Array"!==a&&"Object"!==a?n(i):"Set"===a?(s=new Set,i.forEach((function(e){s.add(t(e,o))})),s):"Map"===a?(s=new Map,i.forEach((function(e,n){s.set(n,t(e,o))})),s):("Array"===a&&(s=new Array,u(i,(function(e,n){s[n]=t(e,o)}))),"Object"===a&&(s=new Object,u(Object.keys(i),(function(e){s[e]=t(i[e],o)}))),s))};return a(t)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var n in t)e.push("".concat(n,"=").concat(t[n]));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var n in t)e["_"+n]=t[n];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var n=!0;for(var r in t)t[r]!==e[r]&&(n=!1);return n},getUtmByQuery:function(t){var e={};for(var n in t)this.utmKeys.includes(n)&&(e[n]=t[n]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],n=!1,r={};for(var i in t)e.indexOf(i)>-1&&(n=!0,r[i]=t[i]);return n?r:null},deleteQueryParams:function(t,e){var n=t.split("&"),r=[];return n.forEach((function(t){var n=new RegExp(e+"=.*"),i="";n.test(t)?(i=t.replace(n,""))&&r.push(i):r.push(t)})),r.join("&")},addUrlParam:function(t,e){var n=t,r="";for(var i in e)r&&(r+="&"),n=this.deleteQueryParams(n,i),r+=i+"="+e[i];var o=n.split("?");return o.length>1?o[1]?o[1]=r+"&"+o[1]:o[1]=r:1===o.length&&o.push(r),o.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,n,r,i="";t.data&&t.data.title&&t.data.title.length>0&&(i=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!i.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(i=e.text)})),!i.length)){var o=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];i=o?null===(e=o.window)||void 0===e?void 0:e.navigationBarTitleText:null===(r=null===(n=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===n?void 0:n.window)||void 0===r?void 0:r.navigationBarTitleText}}catch(t){}return i||t.route}},w=function(){function t(e,r){n(this,t),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=r,this.url="".concat(r.config.serverUrl.normal,"/apipool"),this.timeout=r.config.timeout||this.timeout,this.requestTimeout=r.config.requestTimeout,this.debug=r.config.debug?1:0,this.appKey=r.appKey,this.did=r.storage.allData.did,this.sendLimit=r.config.sendLimit,this.requestFunction=e}return i(t,[{key:"generateRequestData",value:function(){var t=new Date,e={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()," ").concat(t.getHours(),":").concat(t.getMinutes(),":").concat(t.getSeconds()),tz:_.getTimezone(t),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:f(this.catch)}),_:t.getTime()+""};return this.catch=[],e}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var n=this.generateRequestData();return new Promise((function(t,r){var i,o=!1;i=setTimeout((function(){o=!0,t(null)}),e.timeout),e.requestFunction(e.url,n,{timeout:e.requestTimeout}).then((function(e){o||(clearTimeout(i),t(e))})).catch((function(t){r(t)}))}))}}}]),t}(),k=function(){function e(t,r,i){n(this,e),this.storageFunction=t,this.allData=i||{},this.allData.did||this.set("did",r.config.did||_.UUID()),this.allData.cuid||this.set("cuid",void 0),_.isEmpty(r.config.utm)||this.set("utm",r.config.utm)}return i(e,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(e,n){return g(this,void 0,void 0,t.mark((function r(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.allData[e]=n,t.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return t.stop()}}),r,this)})))}}]),e}();!function(t){var e,n,r,i,o,u;(e=t.EventType||(t.EventType={})).connected="connected",e.disconnected="disconnected",e.error="error",e.offline="offline",e.exist="exist",e.online="online",(n=t.RequestType||(t.RequestType={}))[n.common=0]="common",n[n.ping=1]="ping",n[n.pong=2]="pong",n[n.normal=5]="normal",n[n.img=6]="img",(r=t.ResponseCode||(t.ResponseCode={}))[r.offline=109001]="offline",r[r.exist=109002]="exist",r[r.paramError=109005]="paramError",r[r.online=109006]="online",(i=t.SocketMsgOrigin||(t.SocketMsgOrigin={}))[i.xcx=1]="xcx",i[i.app=2]="app",i[i.web=3]="web",(o=t.VisualEndpointType||(t.VisualEndpointType={}))[o.xcx=1]="xcx",(u=t.SocketMessageType||(t.SocketMessageType={})).update="update",u.xcxLogin="xcxLogin",u.eventInfo="eventInfo"}(y||(y={}));var b,x,S,O=y,T=function(){function t(e,r){n(this,t),this.listeners={},this.catch=[],this.showLog=!1,this.url=e,this.params=r,this.open()}return i(t,[{key:"emit",value:function(t,e){var n;if(this.log("info","emit message",[t,e]),!this.client)return this.log("info","缓存消息",[t,e]),void this.catch.push([t,e]);switch(null===(n=this.client)||void 0===n?void 0:n.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[t,e]),this.catch.push([t,e])}}},{key:"on",value:function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)}},{key:"onConnected",value:function(t){this.on(O.EventType.connected,t)}},{key:"onDisconnected",value:function(t){this.on(O.EventType.disconnected,t)}},{key:"onError",value:function(t){this.on(O.EventType.error,t)}},{key:"send",value:function(t){var e;null===(e=this.client)||void 0===e||e.send({data:JSON.stringify(t)})}},{key:"_onError",value:function(t){var e;this.log("error","socket连接异常",t),null===(e=this.listeners.error)||void 0===e||e.forEach((function(e){e.call(void 0,t)}))}},{key:"_onClose",value:function(t){var e;this.log("error","socket连接已关闭"),null===(e=this.listeners.disconnected)||void 0===e||e.forEach((function(t){t.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(t){var e,n=this;this.log("info","socket连接成功",t),null===(e=this.listeners.connected)||void 0===e||e.forEach((function(t){t.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(t){var e=h(t,2),r=e[0],i=e[1];n.emit(r,i)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(t){var e,n,r;if(""!==t.data){var i=JSON.parse(t.data);if(i.code)switch(Number(i.code)){case O.ResponseCode.offline:null===(e=this.listeners[O.EventType.offline])||void 0===e||e.forEach((function(t){t.call(void 0,i)}));break;case O.ResponseCode.online:null===(n=this.listeners[O.EventType.online])||void 0===n||n.forEach((function(t){t.call(void 0,i)}));break;case O.ResponseCode.exist:null===(r=this.listeners[O.EventType.exist])||void 0===r||r.forEach((function(t){t.call(void 0,i)}));break;case O.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(i.type===O.RequestType.pong)return;var o=i.data;this.listeners[o.event]&&this.listeners[o.event].forEach((function(t){t.call(void 0,o.payload)}))}}}},{key:"ping",value:function(){var t=this;this.pingTimer=setInterval((function(){t.send({type:O.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(t,e){var n=this;e?this.listeners[t].forEach((function(r,i){r===e&&n.listeners[t].splice(i,1)})):this.listeners[t]=[]}},{key:"open",value:function(){var t,e,n=this;this.client&&this.close();var r=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(t=this.params)||void 0===t?void 0:t.socketToken,"&appId=").concat(null===(e=this.params)||void 0===e?void 0:e.appId,"&origin=").concat(O.SocketMsgOrigin.xcx)});r.onMessage((function(t){n.onMessage(t)})),r.onError((function(t){n._onError(t)})),r.onClose((function(t){n._onClose(t)})),r.onOpen((function(t){n._onOpen(t)})),this.client=r}},{key:"close",value:function(){var t;null===(t=this.client)||void 0===t||t.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.showLog&&(e=console).log.apply(e,["%c【socketClient】:".concat(t),"color: ".concat("error"===t?"red":"#1890ff")].concat(r))}},{key:"openLog",value:function(t){this.showLog=t}}]),t}(),P=function(t,e,n){return new Promise((function(r,i){var u;wx.request((o(u={url:t,data:e,method:(null==n?void 0:n.method)||"POST",timeout:null==n?void 0:n.timeout},"header",{"content-type":(null==n?void 0:n.contentType)||"application/x-www-form-urlencoded"}),o(u,"dataType","json"),o(u,"responseType",null!=(null==n?void 0:n.responseType)?null==n?void 0:n.responseType:"arraybuffer"),o(u,"success",(function(t){r(t)})),o(u,"fail",(function(t){i(t)})),u))}))},E=function(){function e(t){n(this,e),this.pagePathJudge=function(t,e){return-1!==e.pagePath.indexOf("*")?-1!==t.pr.$page_url.indexOf(e.pagePath.split("*")[0]):e.pagePath===t.pr.$page_url.split("?")[0]},this.tracker=t,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return i(e,[{key:"init",value:function(){var t=this;this.socket&&this.socket.destroy(),this.socket=new T(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){t.getVisualData()})),this.socket.on("connected",(function(){null===t.socketUserInfo?wx.getSystemInfo({success:function(e){var n=e.model,r=e.system,i=e.version;wx.getUserInfo({success:function(e){var o=e.userInfo.nickName,u=e.userInfo.avatarUrl,a={model:n,system:r,version:i,nickName:o,avatarUrl:u,programId:t.tracker.config.appId};t.socketUserInfo=a,t.sendUserInfo(a)}})}}):t.sendUserInfo(t.socketUserInfo)}))}},{key:"getVisualData",value:function(){var t=this;P("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:O.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(e){e.data&&e.data.data&&(t.visualData=e.data.data)}))}},{key:"sendUserInfo",value:function(t){var e;this.socketState=!0,null===(e=this.socket)||void 0===e||e.send({type:O.RequestType.normal,data:{event:O.SocketMessageType.xcxLogin,payload:{userInfo:t}}})}},{key:"send",value:function(t){var e;this.socketState&&(null===(e=this.socket)||void 0===e||e.send({type:O.RequestType.normal,data:{event:O.SocketMessageType.eventInfo,payload:t}}))}},{key:"event",value:function(e){var n;return g(this,void 0,void 0,t.mark((function r(){var i,o,u,a=this;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(n=this.tracker)||void 0===n?void 0:n.config.visual){t.next=2;break}return t.abrupt("return");case 2:"abp"!==e.dt||"pv"!==e.pr.$eid&&"click"!==e.pr.$eid?"evt"===e.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},e),{eventType:"evt"})):(i=_.clone(e),o=!1,this.visualData.map((function(t){var n,r;if("click"===e.pr.$eid){var u=[],s=_.jsJSON(t.elementConditions)?JSON.parse(t.elementConditions):{};for(var c in s)u.push(s[c]===e.pr[c]);u.push(a.pagePathJudge(e,t)),-1===u.indexOf(!1)&&"click"===t.eventType&&(i.dt="evt",i.pr.$eid=t.eventName,o=!0,a.vRQC?a.send(Object.assign(Object.assign({},i),{visual:t})):null===(n=a.tracker)||void 0===n||n.send(i))}else"pv"===t.eventType&&a.pagePathJudge(e,t)&&(i.dt="evt",i.pr.$eid=t.eventName,o=!0,a.vRQC?a.send(Object.assign(Object.assign({},i),{visual:t})):null===(r=a.tracker)||void 0===r||r.send(i))})),this.vRQC&&!o&&(u="click"===e.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},e),{eventType:u}))));case 3:case"end":return t.stop()}}),r,this)})))}}]),e}();function $(t,e,n){var r=n.value;return n.value=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this.pageReady&&this.loadReady)return r.apply(this,n);this.buffer.push({fnName:e,args:n})},n}var C=function(){function e(t,r,i){n(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,x=t,b=r,S=i,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new E(this)}return i(e,[{key:"load",value:function(e,n){return g(this,void 0,void 0,t.mark((function r(){var i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.appKey=e,this.config=_.merge(this.config,n||{}),t.prev=2,t.next=5,b.get();case 5:if((i=t.sent)&&i.did){t.next=10;break}return t.next=9,b.getDid();case 9:i.did=t.sent;case 10:this.storage=new k(b,this,i),this.request=new w(x,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(2),console.error("sdk初始化失败,缓存读取失败",t.t0);case 20:case"end":return t.stop()}}),r,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var n in e)e[n]&&(t.pr["$".concat(n)]=e[n]);return this.request.send(t)}},{key:"trackBaseData",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,t.t0=e,t.t1=r.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=_.getTimezone(r),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=S.os(),t.t9=S.ov(),t.t10=S.version(),t.next=14,S.mnet();case 14:return t.t11=t.sent,t.next=17,S.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15,$page_url:""},(i={dt:"evt",pr:t.t16}).pr=_.merge(i.pr,_.encode(this.config.superProperty)),t.abrupt("return",i);case 25:case"end":return t.stop()}}),n,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(S.windowWidth(),"x").concat(S.windowHeight()),$tz:_.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var n=wx.getSystemInfoSync();e.pr.$dv=n.model,e.pr.$br=n.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,n=t.update-t.sid,r={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:_.getTimezone(e),$dru:n,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(r)}},{key:"sessionStart",value:function(){return g(this,void 0,void 0,t.mark((function e(){var n,r,i,o,u;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Date,r=this.storage.allData,i=r.sid,o=r.cuid,t.t0=i,t.t1=i,t.t2=o,t.t3=this.cn,t.t4=_.getTimezone(n),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=S.os(),t.t8=S.ov(),t.t9=S.version(),t.next=14,S.mnet();case 14:return t.t10=t.sent,t.next=17,S.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},u={dt:"ss",pr:t.t15},this.config.utm&&!_.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(u),this.environmentInfo();case 26:case"end":return t.stop()}}),e,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,n=Date.now();if(e.sid&&e.update)if(n-e.update>this.config.timeout){var r=_.clone(e);this.storage.set("sid",n),this.storage.set("update",n),this.sessionEnd(r),this.sessionStart()}else this.storage.set("update",n);else this.storage.set("sid",n),this.storage.set("update",n),this.sessionStart()}},{key:"click",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r,i,o,u,a;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:for(u in r=t.sent,i={},o=["id","content","type","style","selector","link"],e.target.dataset)-1===o.indexOf(u)&&(i["_".concat(u)]=e.target.dataset[u]);return a=e.target,r.dt="abp",r.pr=_.merge(r.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:a.dataset.id||"",$element_content:a.dataset.content||"",$element_type:a.dataset.type||"",$element_style:a.dataset.style||"",$element_selector:a.dataset.selector||"",$element_link:a.dataset.link||""},i,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=14,this.send(r);case 14:return t.next=16,this.visual.event(r);case 16:case"end":return t.stop()}}),n,this)})))}},{key:"pv",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(r=t.sent).dt="abp",r.pr=_.merge(r.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},e||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=10,this.send(r);case 10:return t.next=12,this.visual.event(r);case 12:case"end":return t.stop()}}),n,this)})))}},{key:"duration",value:function(){return g(this,void 0,void 0,t.mark((function e(){var n,r;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),_.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),n=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(r=t.sent).dt="abp",r.pr=_.merge(r.pr,{$dr:n,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(r);case 12:_.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),e,this)})))}},{key:"track",value:function(e,n){return g(this,void 0,void 0,t.mark((function r(){var i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track"),t.next=3,this.trackBaseData(e);case 3:return(i=t.sent).pr=_.merge(i.pr,_.encode(n),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=7,this.send(i);case 7:return t.next=9,this.visual.event(i);case 9:case"end":return t.stop()}}),r,this)})))}},{key:"identify",value:function(e,n){return g(this,void 0,void 0,t.mark((function r(){var i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),i=new Date,(o={dt:"usr",pr:{$ct:i.getTime(),$tz:_.getTimezone(i),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=_.merge(o.pr,_.encode(n)),t.next=7,this.trackBaseData("usr");case 7:return t.next=9,this.send(o);case 9:case"end":return t.stop()}}),r,this)})))}},{key:"setPushClient",value:function(e,n){return g(this,void 0,void 0,t.mark((function r(){var i,o;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new Date,o={dt:"um",pr:{$ct:i.getTime(),$tz:_.getTimezone(i),$push_ch:n||"getui",$push_id:e}},t.next=4,this.trackBaseData("usr");case 4:return t.next=6,this.send(o);case 6:case"end":return t.stop()}}),r,this)})))}},{key:"trackCount",value:function(t,e){var n=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=_.clone(e)),this.previousCountEvent.name===t&&_.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=_.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){n.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,n,r){return g(this,void 0,void 0,t.mark((function i(){var o,u,a,s;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateSession("track count"),o=Date.now()-this.countStartTime,r&&(o-=this.config.countDuration),u=this.count,this.count=r?0:1,t.next=7,this.trackBaseData(e);case 7:return a=t.sent,s={},_.isObject(n)&&(s=_.clone(n)),a.pr=_.merge(a.pr,_.encode(s),_.encode({count:u,countTime:o})),t.next=13,this.send(a);case 13:case"end":return t.stop()}}),i,this)})))}},{key:"trackRevenue",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r,i,o,u,a,s,c,m;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=function(t,e){var n=0;try{t.toString().split(".")[1]&&(n+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(n+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,n)},this.updateSession("track revenue"),n.next=4,this.trackBaseData("revenue");case 4:(r=n.sent).dt="abp",(i=_.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=o(i.price,i.productQuantity),u=["productID","revenueType"],a=["price","total","productQuantity"],s={},n.t0=t.keys(i);case 12:if((n.t1=n.t0()).done){n.next=21;break}if(c=n.t1.value,-1!==u.indexOf(c)||-1!==a.indexOf(c)){n.next=16;break}return n.abrupt("continue",12);case 16:m=i[c],a.indexOf(c)>-1&&((m=Number(m))||(m=0)),s["$"+c]=m,n.next=12;break;case 21:return r.pr=_.merge(r.pr,s),n.next=24,this.send(r);case 24:case"end":return n.stop()}}),n,this)})))}},{key:"setUtm",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(r=_.filterUtm(e))&&(this.storage.set("utm",r),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),n,this)})))}},{key:"setSuperProperty",value:function(t){_.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){_.isObject(t)&&(this.config.superProperty=_.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,n=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=p(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;delete this.config.superProperty[r]}}catch(t){n.e(t)}finally{n.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();v([$],C.prototype,"environmentInfo",null),v([$],C.prototype,"sessionEnd",null),v([$],C.prototype,"sessionStart",null),v([$],C.prototype,"updateSession",null),v([$],C.prototype,"click",null),v([$],C.prototype,"pv",null),v([$],C.prototype,"duration",null),v([$],C.prototype,"track",null),v([$],C.prototype,"identify",null),v([$],C.prototype,"setPushClient",null),v([$],C.prototype,"trackCount",null),v([$],C.prototype,"trackRevenue",null),v([$],C.prototype,"setUtm",null);var D=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],j=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],I=function(t){return _.wxGetTitle(t)},R={did:null,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(n,r){wx.setStorage({key:t,data:e,success:n,fail:r})}))}},L=!1,A=wx.getSystemInfoSync(),z=A.system.split(/\s/),N={os:z[0],ov:z[1],version:A.version,windowHeight:A.windowHeight,windowWidth:A.windowWidth,net:0,mnet:0};function U(t){var e=t.toLowerCase();"wifi"===e?(N.net=1,N.mnet=0):(N.net=0,N.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function q(t){return new Promise((function(e,n){if(L)return e(N[t]);wx.getNetworkType({success:function(n){L=!0,U(n.networkType),e(N[t])}})}))}wx.onNetworkStatusChange((function(t){U(t.networkType)}));var M,F,B={os:function(){return N.os},ov:function(){return N.ov},version:function(){return N.version},net:function(){return q("net")},mnet:function(){return q("mnet")},windowWidth:function(){return N.windowWidth},windowHeight:function(){return N.windowHeight}},Q=App,W=Page,H=Component,G=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function J(t,e,n){if(t[n]&&_.isFunction(t[n])){var r=t[n];t[n]=function(){r.apply(this,arguments),e[n].apply(this,arguments)}}else t[n]=function(){e[n].apply(this,arguments)}}function V(t,e,n){var r=t[e];t[e]=function(){var t=arguments[0];if(M===t||t&&M&&M.timeStamp===t.timeStamp)return r.apply(this,arguments);if(M=t,t){var e=t.type;"tap"===e&&n.click(t)}return r.apply(this,arguments)}}var K=function(e){u(o,C);var r=m(o);function o(t){var e;return n(this,o),(e=r.call(this,P,R,B)).openData={path:"",props:{}},e.shared=!1,e.semiAutoTrackEventCatch={},e.isShareOperation=!1,F=t,e.initLifeCycleHook(),e}return i(o,[{key:"initLifeCycleHook",value:function(){var t,e=this,n=(t=e,{App:{onLaunch:function(e){t.config.visual&&t.visual.getVisualData()},onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){(null==e?void 0:e.scene)&&-1!==decodeURIComponent(e.scene).indexOf("vRQC")&&t.config.visual&&(t.visual.vRQC=decodeURIComponent(e.scene).split("vRQC=")[1],t.visual.init()),t.currentPage.query=_.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),n=e[e.length-1];t.currentPage.route=n.__route__||n.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var r=I;if(t.currentPage.title="function"==typeof r?r(n):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(n),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=_.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=_.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=n;var r=function(t){for(var r in n.App)J(t,n.App,r);for(var i in t)!D.includes(i)&&_.isFunction(t[i])&&V(t,i,e);return Q(t)};for(var i in App)r[i]=App[i];App=r;var o=function(t){for(var r in n.Page)J(t,n.Page,r);for(var i in t)!j.includes(i)&&_.isFunction(t[i])&&"onShareAppMessage"!==i&&V(t,i,e);var o=t.onShareAppMessage;return _.isFunction(o)&&(t.onShareAppMessage=e.onShareAppMessage(o)),W(t)};for(var u in Page)o[u]=Page[u];Page=o,Component=function(t){if(void 0!==t.methods)for(var n in t.methods)V(t.methods,n,e);return H(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return l(a(o.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(e){var n=this,r=Object.create(null,{pv:{get:function(){return l(a(o.prototype),"pv",n)}}});return g(this,void 0,void 0,t.mark((function e(){var n,i;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={},i=_.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(n.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(n.$share_level=Number(this.openOptions.query.zg_share_level)),i.data&&i.data.zg_share_data&&(n=_.merge(n,_.encode(i.data.zg_share_data)))),t.next=5,r.pv.call(this,n);case 5:case"end":return t.stop()}}),e,this)})))}},{key:"click",value:function(e){var n=this,r=Object.create(null,{click:{get:function(){return l(a(o.prototype),"click",n)}}});return g(this,void 0,void 0,t.mark((function n(){return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.click.call(this,e);case 2:case"end":return t.stop()}}),n,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=_.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&F){var n=t.scene;this.cn=n+"";var r=F[n],i={},o=null,u=F.isShare(n);if(u&&t.referrerInfo&&(o=t.referrerInfo.appId),r){i={utm_source:r.utm_source,utm_medium:r.utm_medium,utm_campaign:o};var a=t.query||{};F.isCartShare(n)&&a.zg_uid&&a.zg_share_id&&(i.utm_term=a.zg_uid,i.utm_content=a.zg_share_id)}e=_.merge(i,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&_.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(e){return g(this,void 0,void 0,t.mark((function n(){var r,i,o,u,a,s,c,m,l,h,f;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(r=e.query||{},i=this.currentPage.route,!(F.isCartShare(e.scene)&&r.zg_uid&&r.zg_share_id)){t.next=24;break}for(a in o={$uid:r.zg_uid,$share_id:r.zg_share_id,$title:this.currentPage.title,$path:i,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(r.zg_share_level)},this.shareId=r.zg_share_id,this.shareLevel=Number(r.zg_share_level),u={},r)s=a.replace(/^zg_/,""),-1===G.indexOf(s)&&/^zg_/.test(a)&&(u[s]=r[a]);if(c=this.config.shareToUtm,_.isObject(c)&&!_.isEmpty(c)){for(l in m={},c)null!==u[l]&&void 0!==u[l]&&(h=c[l],m[h]=u[l]);_.isEmpty(m)||(m.utm_campaign||(m.utm_campaign="分享打开"),this.setUtm(m))}return this.openData={path:i,props:u},o=_.merge(o,_.encode(u)),t.next=19,this.trackBaseData("wxsopen");case 19:return(f=t.sent).dt="abp",f.pr=_.merge(f.pr,o),t.next=24,this.send(f);case 24:case"end":return t.stop()}}),n,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var n=t.apply(this,arguments)||{};if(!e.config.forwardShare)return n;n.path=n.path||e.currentPage.url;var r=n.title||e.currentPage.title,i=n.path.split("?")[0],o=this.data.zg_share_data,u=(new Date).getTime(),a=1;!this.data.newShare&&e.openData&&e.openData.path===i&&_.isEqual(o||{},e.openData.props)&&(u=e.shareId,a=e.shareLevel+1);var s={share_id:u,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:a},c={$share_title:r,$title:e.currentPage.title||"",$path:i},m={};for(var l in s)c["$".concat(l)]=m["zg_".concat(l)]=s[l];for(var h in o)-1===G.indexOf(h)&&(c["_".concat(h)]=m["zg_".concat(h)]=o[h]);return n.path=_.addUrlParam(n.path,m),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=_.merge(t.pr,c),e.request.send(t)})),e.shared=!0,n}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var n,r=e.getEventDataFromDataset(t.dataset);(n=l(a(o.prototype),"track",e)).call.apply(n,[e].concat(f(r)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},n="";for(var r in t){if(r.startsWith("expo"))if("expoName"===r)n=t[r];else e[r.replace(/^expo(.*)/,(function(t,e,n,r){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[r]}return[n,e]}}]),o}();v([$],K.prototype,"sceneToUtm",null),v([$],K.prototype,"trackOpenShare",null);var Y={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},X=new(function(t){u(r,K);var e=m(r);function r(){return n(this,r),e.call(this,Y)}return i(r,[{key:"load",value:function(t,e){var n=e||{};if(wx.getAccountInfoSync){var i=wx.getAccountInfoSync();i&&i.miniProgram&&i.miniProgram.appId&&(n.appId=i.miniProgram.appId)}return l(a(r.prototype),"load",this).call(this,t,n)}}]),r}());App.zhuge=X;export default X;
package/dist/zhuge.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var regeneratorRuntime=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},i=u.iterator||"@@iterator",o=u.asyncIterator||"@@asyncIterator",a=u.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var u=e&&e.prototype instanceof g?e:g,i=Object.create(u.prototype),o=new D(n||[]);return i._invoke=function(t,e,r){var n=l;return function(u,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===u)throw i;return R()}for(r.method=u,r.arg=i;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=m(t,e,r);if("normal"===s.type){if(n=r.done?p:f,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(t,r,o),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",f="suspendedYield",h="executing",p="completed",d={};function g(){}function v(){}function _(){}var y={};y[i]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(T([])));b&&b!==r&&n.call(b,i)&&(y=b);var k=_.prototype=g.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(u,i,o,a){var s=m(t[u],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,a)}))}a(s.arg)}var u;this._invoke=function(t,n){function i(){return new e((function(e,u){r(t,n,e,u)}))}return u=u?u.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var u=m(n,t.iterator,r.arg);if("throw"===u.type)return r.method="throw",r.arg=u.arg,r.delegate=null,d;var i=u.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var u=-1,o=function r(){for(;++u<t.length;)if(n.call(t,u))return r.value=t[u],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}return{next:R}}function R(){return{value:e,done:!0}}return v.prototype=k.constructor=_,_.constructor=v,v.displayName=s(_,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,a,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,r,n,u,i){void 0===i&&(i=Promise);var o=new S(c(e,r,n,u),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(k),s(k,a,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach($),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function u(n,u){return a.type="throw",a.arg=t,r.next=n,u&&(r.method="next",r.arg=e),!!u}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return u("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return u(o.catchLoc,!0);if(this.prev<o.finallyLoc)return u(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return u(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return u(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var u=this.tryEntries[r];if(u.tryLoc<=this.prev&&n.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var i=u;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var u=n.arg;$(r)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}({});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).zhuge=e()}(this,(function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=o(t);if(e){var u=o(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return s(this,r)}}function m(t,e,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(n){var u=Object.getOwnPropertyDescriptor(n,e);return u.get?u.get.call(r):u.value}})(t,e,r||t)}function l(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}
1
+ var regeneratorRuntime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),u=new R(n||[]);return o._invoke=function(e,t,r){var n=l;return function(i,o){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return $()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var a=O(u,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var s=m(e,t,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,u),o}function m(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function g(){}function y(){}var _={};_[o]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w(E([])));k&&k!==r&&n.call(k,o)&&(_=k);var b=y.prototype=v.prototype=Object.create(_);function x(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,o,u,a){var s=m(e[i],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,u,a)}),(function(e){r("throw",e,u,a)})):t.resolve(l).then((function(e){c.value=e,u(c)}),(function(e){return r("throw",e,u,a)}))}a(s.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=m(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function E(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,u=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return u.next=u}}return{next:$}}function $(){return{value:t,done:!0}}return g.prototype=b.constructor=y,y.constructor=g,g.displayName=s(y,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},x(S.prototype),S.prototype[u]=function(){return this},e.AsyncIterator=S,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var u=new S(c(t,r,n,i),o);return e.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},x(b),s(b,a,"Generator"),b[o]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var s=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}({});!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).zhuge=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return s(this,r)}}function m(e,t,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ var regeneratorRuntime=function(t){"use strict";var e,r=Object.prototype,n=r.has
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- function p(t,e,r,n){var u,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(u=t[a])&&(o=(i<3?u(o):i>3?u(e,r,o):u(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function d(t,e,r,n){return new(r||(r=Promise))((function(u,i){function o(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?u(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}s((n=n.apply(t,e||[])).next())}))}var g,v,_,y={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(t){return null==t},type:function(t){return Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===this.type(t)},isArray:function(t){return"[object Array]"===this.type(t)},isString:function(t){return"[object String]"===this.type(t)},isNumber:function(t){return"[object Number]"===this.type(t)},isDate:function(t){return"[object Date]"===this.type(t)},isFunction:function(t){return"[object Function]"===this.type(t)},isEmpty:function(t){return Array.isArray(t)||"string"==typeof t||t instanceof String?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length},merge:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=Array.from(new Set(e[n].concat(r[n]))):t.isObject(e[n])&&t.isObject(r[n])?e[n]=t.merge(e[n],r[n]):e[n]=r[n]})),e}),{})},UUID:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},clone:function(e){var r=function(t){var e=t.constructor;switch(n(t)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new e(t);case"RegExp":return i(t);case"Symbol":return u(t);case"Function":return t;default:return null}},n=function(t){return Object.prototype.toString.call(t).slice(8,-1)},u=function(t){return Object(Symbol.prototype.valueOf.call(t))},i=function(t){var e=new t.constructor(t.source,/\w*$/.exec(t));return e.lastIndex=t.lastIndex,e},o=function(t,e){for(var r=-1,n=t.length;++r<n;)e(t[r],r);return t},a=function e(u){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==t(u)||null===u)return u;var a=n(u),s=null;return i.get(u)?i.get(u):(i.set(u,s),"Set"!==a&&"Map"!==a&&"Array"!==a&&"Object"!==a?r(u):"Set"===a?(s=new Set,u.forEach((function(t){s.add(e(t,i))})),s):"Map"===a?(s=new Map,u.forEach((function(t,r){s.set(r,e(t,i))})),s):("Array"===a&&(s=new Array,o(u,(function(t,r){s[r]=e(t,i)}))),"Object"===a&&(s=new Object,o(Object.keys(u),(function(t){s[t]=e(u[t],i)}))),s))};return a(e)},parseQuery:function(t){if(this.isEmpty(t))return"";var e=[];for(var r in t)e.push("".concat(r,"=").concat(t[r]));return e.join("&")},getTimezone:function(t){return 6e4*-t.getTimezoneOffset()},encode:function(t){var e={};for(var r in t)e["_"+r]=t[r];return e},isEqual:function(t,e){if(this.type(t)!==this.type(e))return!1;var r=!0;for(var n in t)t[n]!==e[n]&&(r=!1);return r},getUtmByQuery:function(t){var e={};for(var r in t)this.utmKeys.includes(r)&&(e[r]=t[r]);return e},filterUtm:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var u in t)e.indexOf(u)>-1&&(r=!0,n[u]=t[u]);return r?n:null},deleteQueryParams:function(t,e){var r=t.split("&"),n=[];return r.forEach((function(t){var r=new RegExp(e+"=.*"),u="";r.test(t)?(u=t.replace(r,""))&&n.push(u):n.push(t)})),n.join("&")},addUrlParam:function(t,e){var r=t,n="";for(var u in e)n&&(n+="&"),r=this.deleteQueryParams(r,u),n+=u+"="+e[u];var i=r.split("?");return i.length>1?i[1]?i[1]=n+"&"+i[1]:i[1]=n:1===i.length&&i.push(n),i.join("?")},getCurrentPage:function(){var t=getCurrentPages();return t[t.length-1]},wxGetTitle:function(t){var e,r,n,u="";t.data&&t.data.title&&t.data.title.length>0&&(u=Array.isArray(t.data.title)?t.data.title.join(" "):t.data.title);try{if(!u.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(e){e.pagePath==="".concat(t.route,".html")&&e.text&&(u=e.text)})),!u.length)){var i=__wxConfig.page[t.route]||__wxConfig.page["".concat(t.route,".html")];u=i?null===(e=i.window)||void 0===e?void 0:e.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(t){}return u||t.route}},w=function(){function t(r,n){e(this,t),this.timeout=500,this.catch=[],this.clearCatchTimer=null,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=r}return n(t,[{key:"generateRequestData",value:function(){var t=new Date,e={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()," ").concat(t.getHours(),":").concat(t.getMinutes(),":").concat(t.getSeconds()),tz:y.getTimezone(t),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:l(this.catch)}),_:t.getTime()+""};return this.catch=[],e}},{key:"clear",value:function(){if(this.catch.length){var t=this.generateRequestData();this.requestFunction(this.url,t,{timeout:this.requestTimeout})}}},{key:"send",value:function(t){var e=this;if(this.catch.push(t),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){e.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(t,n){var u,i=!1;u=setTimeout((function(){i=!0,t(null)}),e.timeout),e.requestFunction(e.url,r,{timeout:e.requestTimeout}).then((function(e){i||(clearTimeout(u),t(e))})).catch((function(t){n(t)}))}))}}}]),t}(),b=function(){function t(r,n,u){e(this,t),this.storageFunction=r,this.allData=u||{},this.allData.did||this.set("did",n.config.did||y.UUID()),this.allData.cuid||this.set("cuid",void 0),y.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return n(t,[{key:"get",value:function(t){return this.allData[t]}},{key:"set",value:function(t,e){return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.allData[t]=e,r.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return r.stop()}}),r,this)})))}}]),t}();function k(t,e,r){var n=r.value;return r.value=function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:e,args:r})},r}var x=function(){function t(r,n,u){e(this,t),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,v=r,g=n,_=u,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},debug:!1,pv:!1,click:!1,timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1}}return n(t,[{key:"load",value:function(t,e){return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.appKey=t,this.config=y.merge(this.config,e||{}),r.prev=2,r.next=5,g.get();case 5:if((n=r.sent)&&n.did){r.next=10;break}return r.next=9,g.getDid();case 9:n.did=r.sent;case 10:this.storage=new b(g,this,n),this.request=new w(v,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(2),console.error("sdk初始化失败,缓存读取失败",r.t0);case 20:case"end":return r.stop()}}),r,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var e=this.buffer.shift();if(e)(t.prototype[e.fnName]||this[e.fnName]).apply(this,e.args)}}},{key:"send",value:function(t){var e=this.storage.allData.utm;if(e)for(var r in e)e[r]&&(t.pr["$".concat(r)]=e[r]);return this.request.send(t)}},{key:"trackBaseData",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Date,e.t0=t,e.t1=r.getTime(),e.t2=this.storage.allData.sid,e.t3=this.storage.allData.cuid,e.t4=this.cn,e.t5=y.getTimezone(r),e.t6=this.currentPage.url,e.t7=this.prevPage.url,e.t8=_.os(),e.t9=_.ov(),e.t10=_.version(),e.next=14,_.mnet();case 14:return e.t11=e.sent,e.next=17,_.net();case 17:return e.t12=e.sent,e.t13=this.config.vn,e.t14=this.referrerDomain,e.t15=this.config.appId,e.t16={$eid:e.t0,$ct:e.t1,$sid:e.t2,$cuid:e.t3,$cn:e.t4,$tz:e.t5,$url:e.t6,$ref:e.t7,$os:e.t8,$ov:e.t9,$wv:e.t10,$mnet:e.t11,$net:e.t12,$vn:e.t13,$referrer_domain:e.t14,$wxeid:e.t15},(n={dt:"evt",pr:e.t16}).pr=y.merge(n.pr,y.encode(this.config.superProperty)),e.abrupt("return",n);case 25:case"end":return e.stop()}}),e,this)})))}},{key:"environmentInfo",value:function(){var t=new Date,e={dt:"pl",pr:{$rs:"".concat(_.windowWidth(),"x").concat(_.windowHeight()),$tz:y.getTimezone(t),$ct:t.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();e.pr.$dv=r.model,e.pr.$br=r.brand}else delete e.pr.$dv,delete e.pr.$br;this.send(e)}},{key:"sessionEnd",value:function(t){var e=new Date,r=t.update-t.sid,n={dt:"se",pr:{$ct:t.update,$cn:this.cn,$tz:y.getTimezone(e),$dru:r,$sid:t.sid,$cuid:t.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,r,n,u,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new Date,r=this.storage.allData,n=r.sid,u=r.cuid,t.t0=n,t.t1=n,t.t2=u,t.t3=this.cn,t.t4=y.getTimezone(e),t.t5=this.currentPage.url,t.t6=this.prevPage.url,t.t7=_.os(),t.t8=_.ov(),t.t9=_.version(),t.next=14,_.mnet();case 14:return t.t10=t.sent,t.next=17,_.net();case 17:t.t11=t.sent,t.t12=this.config.vn,t.t13=this.referrerDomain,t.t14=this.config.appId,t.t15={$ct:t.t0,$sid:t.t1,$cuid:t.t2,$cn:t.t3,$tz:t.t4,$url:t.t5,$ref:t.t6,$os:t.t7,$ov:t.t8,$wv:t.t9,$mnet:t.t10,$net:t.t11,$vn:t.t12,$referrer_domain:t.t13,$wxeid:t.t14},i={dt:"ss",pr:t.t15},this.config.utm&&!y.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(i),this.environmentInfo();case 26:case"end":return t.stop()}}),t,this)})))}},{key:"updateSession",value:function(t){var e=this.storage.allData,r=Date.now();if(e.sid&&e.update)if(r-e.update>this.config.timeout){var n=y.clone(e);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{$element_content:"",$element_selector:"",$element_style:[]};return d(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:return(r=t.sent).dt="abp",r.pr=y.merge(r.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},e),t.next=10,this.send(r);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"pv",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.config.pv){e.next=2;break}return e.abrupt("return");case 2:return this.updateSession("pv"),e.next=5,this.trackBaseData("pv");case 5:return(r=e.sent).dt="abp",n={$page_title:this.currentPage.title},r.pr=y.merge(r.pr,n,t||{}),e.next=11,this.send(r);case 11:case"end":return e.stop()}}),e,this)})))}},{key:"duration",value:function(){return d(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.duration){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("duration"),y.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),e=this.currentPage.time-this.prevPage.time,t.next=7,this.trackBaseData("dr");case 7:return(r=t.sent).dt="abp",r.pr=y.merge(r.pr,{$dr:e,$url:this.prevPage.url,$title:this.prevPage.title}),t.next=12,this.send(r);case 12:y.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return t.stop()}}),t,this)})))}},{key:"track",value:function(t,e){return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.updateSession("track"),r.next=3,this.trackBaseData(t);case 3:return(n=r.sent).pr=y.merge(n.pr,y.encode(e)),r.next=7,this.send(n);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"identify",value:function(t,e){return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.storage.set("cuid",t),this.updateSession("identify"),n=new Date,(u={dt:"usr",pr:{$ct:n.getTime(),$tz:y.getTimezone(n),$cuid:t,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=y.merge(u.pr,y.encode(e)),r.next=7,this.trackBaseData("usr");case 7:return r.next=9,this.send(u);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"setPushClient",value:function(t,e){return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=new Date,u={dt:"um",pr:{$ct:n.getTime(),$tz:y.getTimezone(n),$push_ch:e||"getui",$push_id:t}},r.next=4,this.trackBaseData("usr");case 4:return r.next=6,this.send(u);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"trackCount",value:function(t,e){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=t,this.previousCountEvent.props=y.clone(e)),this.previousCountEvent.name===t&&y.isEqual(this.previousCountEvent.props,e)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=t,this.previousCountEvent.props=y.clone(e),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(t,e,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(t,e,r){return d(this,void 0,void 0,regeneratorRuntime.mark((function n(){var u,i,o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.updateSession("track count"),u=Date.now()-this.countStartTime,r&&(u-=this.config.countDuration),i=this.count,this.count=r?0:1,n.next=7,this.trackBaseData(t);case 7:return o=n.sent,a={},y.isObject(e)&&(a=y.clone(e)),o.pr=y.merge(o.pr,y.encode(a),y.encode({count:i,countTime:u})),n.next=13,this.send(o);case 13:case"end":return n.stop()}}),n,this)})))}},{key:"trackRevenue",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,u,i,o,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=function(t,e){var r=0;try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(t){console.error(t)}try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(t){console.error(t)}return Number(t.toString().replace(".",""))*Number(e.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),e.next=4,this.trackBaseData("revenue");case 4:(r=e.sent).dt="abp",(n=y.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},t)).total=u(n.price,n.productQuantity),i=["productID","revenueType"],o=["price","total","productQuantity"],a={},e.t0=regeneratorRuntime.keys(n);case 12:if((e.t1=e.t0()).done){e.next=21;break}if(s=e.t1.value,-1!==i.indexOf(s)||-1!==o.indexOf(s)){e.next=16;break}return e.abrupt("continue",12);case 16:c=n[s],o.indexOf(s)>-1&&((c=Number(c))||(c=0)),a["$"+s]=c,e.next=12;break;case 21:return r.pr=y.merge(r.pr,a),e.next=24,this.send(r);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"setUtm",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==(r=y.filterUtm(t))&&(this.storage.set("utm",r),this.updateSession("setUtm"));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"setSuperProperty",value:function(t){y.isObject(t)&&(this.config.superProperty=t)}},{key:"extendSuperPropertys",value:function(t){y.isObject(t)&&(this.config.superProperty=y.merge(this.config.superProperty,t))}},{key:"removeSuperProperty",value:function(t){var e,r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,u=function(){};return{s:u,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;delete this.config.superProperty[n]}}catch(t){r.e(t)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),t}();p([k],x.prototype,"environmentInfo",null),p([k],x.prototype,"sessionEnd",null),p([k],x.prototype,"sessionStart",null),p([k],x.prototype,"updateSession",null),p([k],x.prototype,"click",null),p([k],x.prototype,"pv",null),p([k],x.prototype,"duration",null),p([k],x.prototype,"track",null),p([k],x.prototype,"identify",null),p([k],x.prototype,"setPushClient",null),p([k],x.prototype,"trackCount",null),p([k],x.prototype,"trackRevenue",null),p([k],x.prototype,"setUtm",null);var S=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],P=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],O=function(t){return y.wxGetTitle(t)},$=function(t,e,r){return new Promise((function(n,i){var o;wx.request((u(o={url:t,data:e,method:"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":"application/x-www-form-urlencoded"}),u(o,"dataType","json"),u(o,"responseType","arraybuffer"),u(o,"success",(function(t){n(t)})),u(o,"fail",(function(t){i(t)})),o))}))},D={did:null,getDid:function(){return new Promise((function(t,e){wx.getStorage({key:"zg-did",success:function(e){t(e.data||""),wx.removeStorage({key:"zg-did"})},fail:function(e){t("")}})}))},get:function(){return new Promise((function(t,e){wx.getStorage({key:"zg",success:function(e){t(e.data||{})},fail:function(e){t({})}})}))},set:function(t,e){return new Promise((function(r,n){wx.setStorage({key:t,data:e,success:r,fail:n})}))}},T=!1,R=wx.getSystemInfoSync(),j=R.system.split(/\s/),E={os:j[0],ov:j[1],version:R.version,windowHeight:R.windowHeight,windowWidth:R.windowWidth,net:0,mnet:0};function C(t){var e=t.toLowerCase();"wifi"===e?(E.net=1,E.mnet=0):(E.net=0,E.mnet={"2g":1,"3g":3,"4g":13}[e]||0)}function A(t){return new Promise((function(e,r){if(T)return e(E[t]);wx.getNetworkType({success:function(r){T=!0,C(r.networkType),e(E[t])}})}))}wx.onNetworkStatusChange((function(t){C(t.networkType)}));var z,L,I={os:function(){return E.os},ov:function(){return E.ov},version:function(){return E.version},net:function(){return A("net")},mnet:function(){return A("mnet")},windowWidth:function(){return E.windowWidth},windowHeight:function(){return E.windowHeight}},q=App,U=Page,F=Component,N=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function M(t,e,r){if(t[r]&&y.isFunction(t[r])){var n=t[r];t[r]=function(){n.apply(this,arguments),e[r].apply(this,arguments)}}else t[r]=function(){e[r].apply(this,arguments)}}function B(t,e,r){var n=t[e];t[e]=function(){var t=arguments[0];if(z===t||t&&z&&z.timeStamp===t.timeStamp)return n.apply(this,arguments);if(z=t,t){var e=t.type;"tap"===e&&r.click(t)}return n.apply(this,arguments)}}var H=function(t){i(u,t);var r=c(u);function u(t){var n;return e(this,u),(n=r.call(this,$,D,I)).openData={path:"",props:{}},n.shared=!1,n.semiAutoTrackEventCatch={},n.isShareOperation=!1,L=t,n.initLifeCycleHook(),n}return n(u,[{key:"initLifeCycleHook",value:function(){var t,e=this,r=(t=e,{App:{onShow:function(e){t.sceneToUtm(e),t.openOptions=e,t.updateSession("appOnShow")},onHide:function(){t.flush(),t.config.duration&&!t.isShareOperation&&(t.pageReady=!0,t.currentPage.time=Date.now(),t.duration().then((function(){t.pageReady=!1,t.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(e){t.currentPage.query=y.parseQuery(e),t.currentPage.queryObj=e},onShow:function(){var e=getCurrentPages(),r=e[e.length-1];t.currentPage.route=r.__route__||r.route,t.currentPage.time=Date.now(),t.currentPage.url="".concat(t.currentPage.route);var n=O;if(t.currentPage.title="function"==typeof n?n(r):"",t.currentPage.query&&(t.currentPage.url+="?".concat(t.currentPage.query)),t.pageReady=!0,t.freeBuffer(),t.currentPage.url!==t.prevPage.url){""!==t.prevPage.url&&t.duration();try{t.trackOpenShare(t.openOptions)}catch(e){console.warn(e,"".concat(t.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}t.pv()}t.startObserveMarkElement(r),t.openOptions=null,t.isShareOperation=!1},onHide:function(){t.semiAutoTrackEventCatch={},t.prevPage=y.clone(t.currentPage),t.pageReady=!1,t.flush()},onUnload:function(){t.semiAutoTrackEventCatch={},t.prevPage=y.clone(t.currentPage),t.pageReady=!1,t.flush()}}});this.lifecycle=r;var n=function(t){for(var n in r.App)M(t,r.App,n);for(var u in t)!S.includes(u)&&y.isFunction(t[u])&&B(t,u,e);return q(t)};for(var u in App)n[u]=App[u];App=n;var i=function(t){for(var n in r.Page)M(t,r.Page,n);for(var u in t)!P.includes(u)&&y.isFunction(t[u])&&"onShareAppMessage"!==u&&B(t,u,e);var i=t.onShareAppMessage;return y.isFunction(i)&&(t.onShareAppMessage=e.onShareAppMessage(i)),U(t)};for(var o in Page)i[o]=Page[o];Page=i,Component=function(t){if(void 0!==t.methods)for(var r in t.methods)B(t.methods,r,e);return F(t)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=e}},{key:"load",value:function(t,e){return m(o(u.prototype),"load",this).call(this,t,e)}},{key:"pv",value:function(t){var e=this,r=Object.create(null,{pv:{get:function(){return m(o(u.prototype),"pv",e)}}});return d(this,void 0,void 0,regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={},n=y.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(e.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(e.$share_level=Number(this.openOptions.query.zg_share_level)),n.data&&n.data.zg_share_data&&(e=y.merge(e,y.encode(n.data.zg_share_data)))),t.next=5,r.pv.call(this,e);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"click",value:function(t,e){var r=this,n=Object.create(null,{click:{get:function(){return m(o(u.prototype),"click",r)}}});return d(this,void 0,void 0,regeneratorRuntime.mark((function r(){var u,i,o,a;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=t.target,i=u.dataset.title,o=u.dataset.index,a=[],a="alipay-miniprogram"===this.referrerDomain?["","",t.detail.pageX,t.detail.pageY]:["","",t.detail.x,t.detail.y],r.next=7,n.click.call(this,t,y.merge({$element_content:i||"",$element_selector:o||"",$element_style:a},e||{}));case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sceneToUtm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=y.getUtmByQuery(t.query);if(this.config.parseScene&&t.scene&&L){var r=t.scene;this.cn=r+"";var n=L[r],u={},i=null,o=L.isShare(r);if(o&&t.referrerInfo&&(i=t.referrerInfo.appId),n){u={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:i};var a=t.query||{};L.isCartShare(r)&&a.zg_uid&&a.zg_share_id&&(u.utm_term=a.zg_uid,u.utm_content=a.zg_share_id)}e=y.merge(u,e)}this.utmCatch=e,"fresh"===this.config.utmMode&&y.isEmpty(this.config.utm)&&this.storage.set("utm",e)}},{key:"trackOpenShare",value:function(t){return d(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,u,i,o,a,s,c,m,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&this.config.forwardShare){e.next=2;break}return e.abrupt("return");case 2:if(!this.shared){e.next=5;break}return this.shared=!1,e.abrupt("return");case 5:if(r=t.query||{},n=this.currentPage.route,!(L.isCartShare(t.scene)&&r.zg_uid&&r.zg_share_id)){e.next=24;break}for(o in u={$uid:r.zg_uid,$share_id:r.zg_share_id,$title:this.currentPage.title,$path:n,$share_open_type:1008===t.scene?"群聊":"聊天",$share_level:Number(r.zg_share_level)},this.shareId=r.zg_share_id,this.shareLevel=Number(r.zg_share_level),i={},r)a=o.replace(/^zg_/,""),-1===N.indexOf(a)&&/^zg_/.test(o)&&(i[a]=r[o]);if(s=this.config.shareToUtm,y.isObject(s)&&!y.isEmpty(s)){for(m in c={},s)null!==i[m]&&void 0!==i[m]&&(l=s[m],c[l]=i[m]);y.isEmpty(c)||(c.utm_campaign||(c.utm_campaign="分享打开"),this.setUtm(c))}return this.openData={path:n,props:i},u=y.merge(u,y.encode(i)),e.next=19,this.trackBaseData("wxsopen");case 19:return(f=e.sent).dt="abp",f.pr=y.merge(f.pr,u),e.next=24,this.send(f);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"onShareAppMessage",value:function(t){var e=this;return function(){e.isShareOperation=!0;var r=t.apply(this,arguments)||{};if(!e.config.forwardShare)return r;r.path=r.path||e.currentPage.url;var n=r.title||e.currentPage.title,u=r.path.split("?")[0],i=this.data.zg_share_data,o=(new Date).getTime(),a=1;!this.data.newShare&&e.openData&&e.openData.path===u&&y.isEqual(i||{},e.openData.props)&&(o=e.shareId,a=e.shareLevel+1);var s={share_id:o,uid:e.storage.allData.cuid||e.storage.allData.did,share_level:a},c={$share_title:n,$title:e.currentPage.title||"",$path:u},m={};for(var l in s)c["$".concat(l)]=m["zg_".concat(l)]=s[l];for(var f in i)-1===N.indexOf(f)&&(c["_".concat(f)]=m["zg_".concat(f)]=i[f]);return r.path=y.addUrlParam(r.path,m),e.trackBaseData("wxshare").then((function(t){t.dt="abp",t.pr=y.merge(t.pr,c),e.request.send(t)})),e.shared=!0,r}}},{key:"startObserveMarkElement",value:function(t){var e=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),t.isComponent?this.elementObserver=t.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(t,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(t){if(t.intersectionRatio>0){var r,n=e.getEventDataFromDataset(t.dataset);(r=m(o(u.prototype),"track",e)).call.apply(r,[e].concat(l(n)))}})))}},{key:"getEventDataFromDataset",value:function(t){var e={},r="";for(var n in t){if(n.startsWith("expo"))if("expoName"===n)r=t[n];else e[n.replace(/^expo(.*)/,(function(t,e,r,n){return e.replace(e[0],e[0].toLocaleLowerCase())}))]=t[n]}return[r,e]}}]),u}(x);p([k],H.prototype,"sceneToUtm",null),p([k],H.prototype,"trackOpenShare",null);var W={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},isShare:function(t){return[1096].includes(t)},isCartShare:function(t){return[1007,1008,1036,1044].includes(t)}},G=new(function(t){i(u,t);var r=c(u);function u(){return e(this,u),r.call(this,W)}return n(u,[{key:"load",value:function(t,e){var r=e||{};if(wx.getAccountInfoSync){var n=wx.getAccountInfoSync();n&&n.miniProgram&&n.miniProgram.appId&&(r.appId=n.miniProgram.appId)}return m(o(u.prototype),"load",this).call(this,t,r)}}]),u}(H));return App.zhuge=G,G}));
16
+ function d(e,t,r,n){var i,o=arguments.length,u=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,r,u):i(t,r))||u);return o>3&&u&&Object.defineProperty(t,r,u),u}function v(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(e){o(e)}}function a(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))}var g,y={utmKeys:["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],isValid:function(e){return null==e},type:function(e){return Object.prototype.toString.call(e)},isObject:function(e){return"[object Object]"===this.type(e)},isArray:function(e){return"[object Array]"===this.type(e)},isString:function(e){return"[object String]"===this.type(e)},isNumber:function(e){return"[object Number]"===this.type(e)},isDate:function(e){return"[object Date]"===this.type(e)},isFunction:function(e){return"[object Function]"===this.type(e)},jsJSON:function(e){try{return JSON.parse(e),!0}catch(e){return!1}},isEmpty:function(e){return Array.isArray(e)||"string"==typeof e||e instanceof String?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"[object Object]"===Object.prototype.toString.call(e)&&0===Object.keys(e).length},merge:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce((function(t,r){return Object.keys(r).forEach((function(n){Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=Array.from(new Set(t[n].concat(r[n]))):e.isObject(t[n])&&e.isObject(r[n])?t[n]=e.merge(t[n],r[n]):t[n]=r[n]})),t}),{})},UUID:function(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},clone:function(t){var r=function(e){var t=e.constructor;switch(n(e)){case"Boolean":case"Number":case"String":case"Error":case"Date":return new t(e);case"RegExp":return o(e);case"Symbol":return i(e);case"Function":return e;default:return null}},n=function(e){return Object.prototype.toString.call(e).slice(8,-1)},i=function(e){return Object(Symbol.prototype.valueOf.call(e))},o=function(e){var t=new e.constructor(e.source,/\w*$/.exec(e));return t.lastIndex=e.lastIndex,t},u=function(e,t){for(var r=-1,n=e.length;++r<n;)t(e[r],r);return e},a=function t(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if("object"!==e(i)||null===i)return i;var a=n(i),s=null;return o.get(i)?o.get(i):(o.set(i,s),"Set"!==a&&"Map"!==a&&"Array"!==a&&"Object"!==a?r(i):"Set"===a?(s=new Set,i.forEach((function(e){s.add(t(e,o))})),s):"Map"===a?(s=new Map,i.forEach((function(e,r){s.set(r,t(e,o))})),s):("Array"===a&&(s=new Array,u(i,(function(e,r){s[r]=t(e,o)}))),"Object"===a&&(s=new Object,u(Object.keys(i),(function(e){s[e]=t(i[e],o)}))),s))};return a(t)},parseQuery:function(e){if(this.isEmpty(e))return"";var t=[];for(var r in e)t.push("".concat(r,"=").concat(e[r]));return t.join("&")},getTimezone:function(e){return 6e4*-e.getTimezoneOffset()},encode:function(e){var t={};for(var r in e)t["_"+r]=e[r];return t},isEqual:function(e,t){if(this.type(e)!==this.type(t))return!1;var r=!0;for(var n in e)e[n]!==t[n]&&(r=!1);return r},getUtmByQuery:function(e){var t={};for(var r in e)this.utmKeys.includes(r)&&(t[r]=e[r]);return t},filterUtm:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],r=!1,n={};for(var i in e)t.indexOf(i)>-1&&(r=!0,n[i]=e[i]);return r?n:null},deleteQueryParams:function(e,t){var r=e.split("&"),n=[];return r.forEach((function(e){var r=new RegExp(t+"=.*"),i="";r.test(e)?(i=e.replace(r,""))&&n.push(i):n.push(e)})),n.join("&")},addUrlParam:function(e,t){var r=e,n="";for(var i in t)n&&(n+="&"),r=this.deleteQueryParams(r,i),n+=i+"="+t[i];var o=r.split("?");return o.length>1?o[1]?o[1]=n+"&"+o[1]:o[1]=n:1===o.length&&o.push(n),o.join("?")},getCurrentPage:function(){var e=getCurrentPages();return e[e.length-1]},wxGetTitle:function(e){var t,r,n,i="";e.data&&e.data.title&&e.data.title.length>0&&(i=Array.isArray(e.data.title)?e.data.title.join(" "):e.data.title);try{if(!i.length&&__wxConfig&&(__wxConfig.tabBar&&__wxConfig.tabBar.list.forEach((function(t){t.pagePath==="".concat(e.route,".html")&&t.text&&(i=t.text)})),!i.length)){var o=__wxConfig.page[e.route]||__wxConfig.page["".concat(e.route,".html")];i=o?null===(t=o.window)||void 0===t?void 0:t.navigationBarTitleText:null===(n=null===(r=null===__wxConfig||void 0===__wxConfig?void 0:__wxConfig.global)||void 0===r?void 0:r.window)||void 0===n?void 0:n.navigationBarTitleText}}catch(e){}return i||e.route}},_=function(){function e(r,n){t(this,e),this.timeout=500,this.catch=[],this.fastTouch=[],this.clearFastTouchTimer=null,this.clearCatchTimer=null,this.tracker=n,this.url="".concat(n.config.serverUrl.normal,"/apipool"),this.timeout=n.config.timeout||this.timeout,this.requestTimeout=n.config.requestTimeout,this.debug=n.config.debug?1:0,this.appKey=n.appKey,this.did=n.storage.allData.did,this.sendLimit=n.config.sendLimit,this.requestFunction=r}return n(e,[{key:"generateRequestData",value:function(){var e=new Date,t={method:"web_event_sr.upload",event:JSON.stringify({sln:"itn",pl:"js",sdk:"sys",sdkv:"__sdkv__",owner:"zg",ut:"".concat(e.getFullYear(),"-").concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()),tz:y.getTimezone(e),debug:this.debug?1:0,ak:this.appKey,usr:{did:this.did},data:h(this.catch)}),_:e.getTime()+""};return this.catch=[],t}},{key:"clear",value:function(){if(this.catch.length){var e=this.generateRequestData();this.requestFunction(this.url,e,{timeout:this.requestTimeout})}}},{key:"send",value:function(e){var t=this;if(this.catch.push(e),this.clearCatchTimer&&clearTimeout(this.clearCatchTimer),this.clearCatchTimer=setTimeout((function(){t.clear()}),3e4),!(this.catch.length<this.sendLimit)){this.clearCatchTimer&&clearTimeout(this.clearCatchTimer);var r=this.generateRequestData();return new Promise((function(e,n){var i,o=!1;i=setTimeout((function(){o=!0,e(null)}),t.timeout),t.requestFunction(t.url,r,{timeout:t.requestTimeout}).then((function(t){o||(clearTimeout(i),e(t))})).catch((function(e){n(e)}))}))}}}]),e}(),w=function(){function e(r,n,i){t(this,e),this.storageFunction=r,this.allData=i||{},this.allData.did||this.set("did",n.config.did||y.UUID()),this.allData.cuid||this.set("cuid",void 0),y.isEmpty(n.config.utm)||this.set("utm",n.config.utm)}return n(e,[{key:"get",value:function(e){return this.allData[e]}},{key:"set",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.allData[e]=t,r.next=3,this.storageFunction.set("zg",this.allData);case 3:case"end":return r.stop()}}),r,this)})))}}]),e}();!function(e){var t,r,n,i,o,u;(t=e.EventType||(e.EventType={})).connected="connected",t.disconnected="disconnected",t.error="error",t.offline="offline",t.exist="exist",t.online="online",(r=e.RequestType||(e.RequestType={}))[r.common=0]="common",r[r.ping=1]="ping",r[r.pong=2]="pong",r[r.normal=5]="normal",r[r.img=6]="img",(n=e.ResponseCode||(e.ResponseCode={}))[n.offline=109001]="offline",n[n.exist=109002]="exist",n[n.paramError=109005]="paramError",n[n.online=109006]="online",(i=e.SocketMsgOrigin||(e.SocketMsgOrigin={}))[i.xcx=1]="xcx",i[i.app=2]="app",i[i.web=3]="web",(o=e.VisualEndpointType||(e.VisualEndpointType={}))[o.xcx=1]="xcx",(u=e.SocketMessageType||(e.SocketMessageType={})).update="update",u.xcxLogin="xcxLogin",u.eventInfo="eventInfo"}(g||(g={}));var k,b,x,S=g,O=function(){function e(r,n){t(this,e),this.listeners={},this.catch=[],this.showLog=!1,this.url=r,this.params=n,this.open()}return n(e,[{key:"emit",value:function(e,t){var r;if(this.log("info","emit message",[e,t]),!this.client)return this.log("info","缓存消息",[e,t]),void this.catch.push([e,t]);switch(null===(r=this.client)||void 0===r?void 0:r.readyState){case WebSocket.CLOSED:case WebSocket.CLOSING:break;case WebSocket.CONNECTING:this.log("info","缓存消息",[e,t]),this.catch.push([e,t])}}},{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"onConnected",value:function(e){this.on(S.EventType.connected,e)}},{key:"onDisconnected",value:function(e){this.on(S.EventType.disconnected,e)}},{key:"onError",value:function(e){this.on(S.EventType.error,e)}},{key:"send",value:function(e){var t;null===(t=this.client)||void 0===t||t.send({data:JSON.stringify(e)})}},{key:"_onError",value:function(e){var t;this.log("error","socket连接异常",e),null===(t=this.listeners.error)||void 0===t||t.forEach((function(t){t.call(void 0,e)}))}},{key:"_onClose",value:function(e){var t;this.log("error","socket连接已关闭"),null===(t=this.listeners.disconnected)||void 0===t||t.forEach((function(e){e.call(void 0)})),clearInterval(this.pingTimer)}},{key:"_onOpen",value:function(e){var t,r=this;this.log("info","socket连接成功",e),null===(t=this.listeners.connected)||void 0===t||t.forEach((function(e){e.call(void 0)})),this.log("info","clear catch",this.catch),this.catch.forEach((function(e){var t=l(e,2),n=t[0],i=t[1];r.emit(n,i)})),this.catch=[],this.ping()}},{key:"onMessage",value:function(e){var t,r,n;if(""!==e.data){var i=JSON.parse(e.data);if(i.code)switch(Number(i.code)){case S.ResponseCode.offline:null===(t=this.listeners[S.EventType.offline])||void 0===t||t.forEach((function(e){e.call(void 0,i)}));break;case S.ResponseCode.online:null===(r=this.listeners[S.EventType.online])||void 0===r||r.forEach((function(e){e.call(void 0,i)}));break;case S.ResponseCode.exist:null===(n=this.listeners[S.EventType.exist])||void 0===n||n.forEach((function(e){e.call(void 0,i)}));break;case S.ResponseCode.paramError:this._onError(new Error("参数缺失或错误"))}else{if(i.type===S.RequestType.pong)return;var o=i.data;this.listeners[o.event]&&this.listeners[o.event].forEach((function(e){e.call(void 0,o.payload)}))}}}},{key:"ping",value:function(){var e=this;this.pingTimer=setInterval((function(){e.send({type:S.RequestType.ping})}),3e3)}},{key:"removeAllListeners",value:function(){this.listeners={}}},{key:"removeListener",value:function(e,t){var r=this;t?this.listeners[e].forEach((function(n,i){n===t&&r.listeners[e].splice(i,1)})):this.listeners[e]=[]}},{key:"open",value:function(){var e,t,r=this;this.client&&this.close();var n=wx.connectSocket({url:"".concat(this.url,"?socketToken=").concat(null===(e=this.params)||void 0===e?void 0:e.socketToken,"&appId=").concat(null===(t=this.params)||void 0===t?void 0:t.appId,"&origin=").concat(S.SocketMsgOrigin.xcx)});n.onMessage((function(e){r.onMessage(e)})),n.onError((function(e){r._onError(e)})),n.onClose((function(e){r._onClose(e)})),n.onOpen((function(e){r._onOpen(e)})),this.client=n}},{key:"close",value:function(){var e;null===(e=this.client)||void 0===e||e.close(),this.log("info","关闭socket连接")}},{key:"destroy",value:function(){this.removeAllListeners(),this.close(),this.client=void 0}},{key:"log",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.showLog&&(t=console).log.apply(t,["%c【socketClient】:".concat(e),"color: ".concat("error"===e?"red":"#1890ff")].concat(n))}},{key:"openLog",value:function(e){this.showLog=e}}]),e}(),T=function(e,t,r){return new Promise((function(n,o){var u;wx.request((i(u={url:e,data:t,method:(null==r?void 0:r.method)||"POST",timeout:null==r?void 0:r.timeout},"header",{"content-type":(null==r?void 0:r.contentType)||"application/x-www-form-urlencoded"}),i(u,"dataType","json"),i(u,"responseType",null!=(null==r?void 0:r.responseType)?null==r?void 0:r.responseType:"arraybuffer"),i(u,"success",(function(e){n(e)})),i(u,"fail",(function(e){o(e)})),u))}))},P=function(){function e(r){t(this,e),this.pagePathJudge=function(e,t){return-1!==t.pagePath.indexOf("*")?-1!==e.pr.$page_url.indexOf(t.pagePath.split("*")[0]):t.pagePath===e.pr.$page_url.split("?")[0]},this.tracker=r,this.vRQC="",this.visualData=[],this.socketUserInfo=null,this.socketState=!1}return n(e,[{key:"init",value:function(){var e=this;this.socket&&this.socket.destroy(),this.socket=new O(this.tracker.config.socketUrl,{socketToken:this.vRQC.split("*")[0],appId:this.vRQC.split("*")[1]}),this.socket.on("update",(function(){e.getVisualData()})),this.socket.on("connected",(function(){null===e.socketUserInfo?wx.getSystemInfo({success:function(t){var r=t.model,n=t.system,i=t.version;wx.getUserInfo({success:function(t){var o=t.userInfo.nickName,u=t.userInfo.avatarUrl,a={model:r,system:n,version:i,nickName:o,avatarUrl:u,programId:e.tracker.config.appId};e.socketUserInfo=a,e.sendUserInfo(a)}})}}):e.sendUserInfo(e.socketUserInfo)}))}},{key:"getVisualData",value:function(){var e=this;T("".concat(this.tracker.config.serverUrl.normal,"/zg/web/v2/tracking/view/miniProgram/event/list"),{endpointType:S.VisualEndpointType.xcx,endpointIdentity:this.tracker.config.appId},{contentType:"application/json",responseType:""}).then((function(t){t.data&&t.data.data&&(e.visualData=t.data.data)}))}},{key:"sendUserInfo",value:function(e){var t;this.socketState=!0,null===(t=this.socket)||void 0===t||t.send({type:S.RequestType.normal,data:{event:S.SocketMessageType.xcxLogin,payload:{userInfo:e}}})}},{key:"send",value:function(e){var t;this.socketState&&(null===(t=this.socket)||void 0===t||t.send({type:S.RequestType.normal,data:{event:S.SocketMessageType.eventInfo,payload:e}}))}},{key:"event",value:function(e){var t;return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,u=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===(t=this.tracker)||void 0===t?void 0:t.config.visual){r.next=2;break}return r.abrupt("return");case 2:"abp"!==e.dt||"pv"!==e.pr.$eid&&"click"!==e.pr.$eid?"evt"===e.dt&&this.vRQC&&this.send(Object.assign(Object.assign({},e),{eventType:"evt"})):(n=y.clone(e),i=!1,this.visualData.map((function(t){var r,o;if("click"===e.pr.$eid){var a=[],s=y.jsJSON(t.elementConditions)?JSON.parse(t.elementConditions):{};for(var c in s)a.push(s[c]===e.pr[c]);a.push(u.pagePathJudge(e,t)),-1===a.indexOf(!1)&&"click"===t.eventType&&(n.dt="evt",n.pr.$eid=t.eventName,i=!0,u.vRQC?u.send(Object.assign(Object.assign({},n),{visual:t})):null===(r=u.tracker)||void 0===r||r.send(n))}else"pv"===t.eventType&&u.pagePathJudge(e,t)&&(n.dt="evt",n.pr.$eid=t.eventName,i=!0,u.vRQC?u.send(Object.assign(Object.assign({},n),{visual:t})):null===(o=u.tracker)||void 0===o||o.send(n))})),this.vRQC&&!i&&(o="click"===e.pr.$eid?"click":"pv",this.send(Object.assign(Object.assign({},e),{eventType:o}))));case 3:case"end":return r.stop()}}),r,this)})))}}]),e}();function R(e,t,r){var n=r.value;return r.value=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];if(this.pageReady&&this.loadReady)return n.apply(this,r);this.buffer.push({fnName:t,args:r})},r}var E=function(){function e(r,n,i){t(this,e),this.buffer=[],this.currentPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""},this.cn="",this.previousCountEvent={name:"",props:{}},this.count=0,this.countTimer=null,this.pageReady=!1,this.loadReady=!1,b=r,k=n,x=i,this.referrerDomain="miniprogram",this.appKey="",this.config={serverUrl:{normal:"https://u.zhugeapi.net",bac:"https://ubak.zhugeio.com"},socketUrl:"wss://u.zhugeapi.net/eventtracking/ws",debug:!1,pv:!1,click:!1,visual:!1,appName:"",timeout:18e5,requestTimeout:6e4,did:"",duration:!1,vn:"1.0",appId:"",sendLimit:1,superProperty:{},forwardShare:!1,beforeDuration:function(){},afterDuration:function(){},countDuration:3e3,parseScene:!0,utm:{},utmMode:"session",shareToUtm:{},exposure:!1},this.visual=new P(this)}return n(e,[{key:"load",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.appKey=e,this.config=y.merge(this.config,t||{}),r.prev=2,r.next=5,k.get();case 5:if((n=r.sent)&&n.did){r.next=10;break}return r.next=9,k.getDid();case 9:n.did=r.sent;case 10:this.storage=new w(k,this,n),this.request=new _(b,this),this.loadReady=!0,this.updateSession("load"),this.freeBuffer(),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(2),console.error("sdk初始化失败,缓存读取失败",r.t0);case 20:case"end":return r.stop()}}),r,this,[[2,17]])})))}},{key:"freeBuffer",value:function(){if(this.loadReady&&this.pageReady)for(;this.buffer.length;){var t=this.buffer.shift();if(t)(e.prototype[t.fnName]||this[t.fnName]).apply(this,t.args)}}},{key:"send",value:function(e){var t=this.storage.allData.utm;if(t)for(var r in t)t[r]&&(e.pr["$".concat(r)]=t[r]);return this.request.send(e)}},{key:"trackBaseData",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Date,t.t0=e,t.t1=r.getTime(),t.t2=this.storage.allData.sid,t.t3=this.storage.allData.cuid,t.t4=this.cn,t.t5=y.getTimezone(r),t.t6=this.currentPage.url,t.t7=this.prevPage.url,t.t8=x.os(),t.t9=x.ov(),t.t10=x.version(),t.next=14,x.mnet();case 14:return t.t11=t.sent,t.next=17,x.net();case 17:return t.t12=t.sent,t.t13=this.config.vn,t.t14=this.referrerDomain,t.t15=this.config.appId,t.t16={$eid:t.t0,$ct:t.t1,$sid:t.t2,$cuid:t.t3,$cn:t.t4,$tz:t.t5,$url:t.t6,$ref:t.t7,$os:t.t8,$ov:t.t9,$wv:t.t10,$mnet:t.t11,$net:t.t12,$vn:t.t13,$referrer_domain:t.t14,$wxeid:t.t15,$page_url:""},(n={dt:"evt",pr:t.t16}).pr=y.merge(n.pr,y.encode(this.config.superProperty)),t.abrupt("return",n);case 25:case"end":return t.stop()}}),t,this)})))}},{key:"environmentInfo",value:function(){var e=new Date,t={dt:"pl",pr:{$rs:"".concat(x.windowWidth(),"x").concat(x.windowHeight()),$tz:y.getTimezone(e),$ct:e.getTime(),$cuid:this.storage.allData.cuid,$sid:this.storage.allData.sid,$dv:void 0,$br:void 0}};if(wx.getSystemInfoSync){var r=wx.getSystemInfoSync();t.pr.$dv=r.model,t.pr.$br=r.brand}else delete t.pr.$dv,delete t.pr.$br;this.send(t)}},{key:"sessionEnd",value:function(e){var t=new Date,r=e.update-e.sid,n={dt:"se",pr:{$ct:e.update,$cn:this.cn,$tz:y.getTimezone(t),$dru:r,$sid:e.sid,$cuid:e.cuid,$referrer_domain:this.referrerDomain}};this.send(n)}},{key:"sessionStart",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Date,r=this.storage.allData,n=r.sid,i=r.cuid,e.t0=n,e.t1=n,e.t2=i,e.t3=this.cn,e.t4=y.getTimezone(t),e.t5=this.currentPage.url,e.t6=this.prevPage.url,e.t7=x.os(),e.t8=x.ov(),e.t9=x.version(),e.next=14,x.mnet();case 14:return e.t10=e.sent,e.next=17,x.net();case 17:e.t11=e.sent,e.t12=this.config.vn,e.t13=this.referrerDomain,e.t14=this.config.appId,e.t15={$ct:e.t0,$sid:e.t1,$cuid:e.t2,$cn:e.t3,$tz:e.t4,$url:e.t5,$ref:e.t6,$os:e.t7,$ov:e.t8,$wv:e.t9,$mnet:e.t10,$net:e.t11,$vn:e.t12,$referrer_domain:e.t13,$wxeid:e.t14},o={dt:"ss",pr:e.t15},this.config.utm&&!y.isEmpty(this.config.utm)||!this.utmCatch||this.storage.set("utm",this.utmCatch),this.send(o),this.environmentInfo();case 26:case"end":return e.stop()}}),e,this)})))}},{key:"updateSession",value:function(e){var t=this.storage.allData,r=Date.now();if(t.sid&&t.update)if(r-t.update>this.config.timeout){var n=y.clone(t);this.storage.set("sid",r),this.storage.set("update",r),this.sessionEnd(n),this.sessionStart()}else this.storage.set("update",r);else this.storage.set("sid",r),this.storage.set("update",r),this.sessionStart()}},{key:"click",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.click){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("click"),t.next=5,this.trackBaseData("click");case 5:for(o in r=t.sent,n={},i=["id","content","type","style","selector","link"],e.target.dataset)-1===i.indexOf(o)&&(n["_".concat(o)]=e.target.dataset[o]);return u=e.target,r.dt="abp",r.pr=y.merge(r.pr,{$page_url:this.currentPage.url,$page_title:this.currentPage.title},{$element_id:u.dataset.id||"",$element_content:u.dataset.content||"",$element_type:u.dataset.type||"",$element_style:u.dataset.style||"",$element_selector:u.dataset.selector||"",$element_link:u.dataset.link||""},n,""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=14,this.send(r);case 14:return t.next=16,this.visual.event(r);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"pv",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.config.pv){t.next=2;break}return t.abrupt("return");case 2:return this.updateSession("pv"),t.next=5,this.trackBaseData("pv");case 5:return(r=t.sent).dt="abp",r.pr=y.merge(r.pr,{$page_url:this.currentPage.url.split("?")[0],$page_title:this.currentPage.title},e||{},""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),t.next=10,this.send(r);case 10:return t.next=12,this.visual.event(r);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"duration",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.config.duration){e.next=2;break}return e.abrupt("return");case 2:return this.updateSession("duration"),y.isFunction(this.config.beforeDuration)&&this.config.beforeDuration(),t=this.currentPage.time-this.prevPage.time,e.next=7,this.trackBaseData("dr");case 7:return(r=e.sent).dt="abp",r.pr=y.merge(r.pr,{$dr:t,$url:this.prevPage.url,$title:this.prevPage.title}),e.next=12,this.send(r);case 12:y.isFunction(this.config.afterDuration)&&this.config.afterDuration();case 13:case"end":return e.stop()}}),e,this)})))}},{key:"track",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.updateSession("track"),r.next=3,this.trackBaseData(e);case 3:return(n=r.sent).pr=y.merge(n.pr,y.encode(t),""!==this.config.appName?{"_小程序名称":this.config.appName}:{}),r.next=7,this.send(n);case 7:return r.next=9,this.visual.event(n);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"identify",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.storage.set("cuid",e),this.updateSession("identify"),n=new Date,(i={dt:"usr",pr:{$ct:n.getTime(),$tz:y.getTimezone(n),$cuid:e,$sid:this.storage.allData.sid,$url:this.currentPage.url}}).pr=y.merge(i.pr,y.encode(t)),r.next=7,this.trackBaseData("usr");case 7:return r.next=9,this.send(i);case 9:case"end":return r.stop()}}),r,this)})))}},{key:"setPushClient",value:function(e,t){return v(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=new Date,i={dt:"um",pr:{$ct:n.getTime(),$tz:y.getTimezone(n),$push_ch:t||"getui",$push_id:e}},r.next=4,this.trackBaseData("usr");case 4:return r.next=6,this.send(i);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"trackCount",value:function(e,t){var r=this;0===this.count&&(this.countStartTime=Date.now(),this.previousCountEvent.name=e,this.previousCountEvent.props=y.clone(t)),this.previousCountEvent.name===e&&y.isEqual(this.previousCountEvent.props,t)||(this.sendCountEvent(this.previousCountEvent.name,this.previousCountEvent.props,!1),this.previousCountEvent.name=e,this.previousCountEvent.props=y.clone(t),this.countStartTime=Date.now(),this.count=0),this.count+=1,this.countTimer&&clearTimeout(this.countTimer),this.countTimer=setTimeout((function(){r.sendCountEvent(e,t,!0)}),this.config.countDuration)}},{key:"sendCountEvent",value:function(e,t,r){return v(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,u,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.updateSession("track count"),i=Date.now()-this.countStartTime,r&&(i-=this.config.countDuration),o=this.count,this.count=r?0:1,n.next=7,this.trackBaseData(e);case 7:return u=n.sent,a={},y.isObject(t)&&(a=y.clone(t)),u.pr=y.merge(u.pr,y.encode(a),y.encode({count:o,countTime:i})),n.next=13,this.send(u);case 13:case"end":return n.stop()}}),n,this)})))}},{key:"trackRevenue",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,u,a,s,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(e,t){var r=0;try{e.toString().split(".")[1]&&(r+=e.toString().split(".")[1].length)}catch(e){console.error(e)}try{t.toString().split(".")[1]&&(r+=t.toString().split(".")[1].length)}catch(e){console.error(e)}return Number(e.toString().replace(".",""))*Number(t.toString().replace(".",""))/Math.pow(10,r)},this.updateSession("track revenue"),t.next=4,this.trackBaseData("revenue");case 4:(r=t.sent).dt="abp",(n=y.merge({price:0,total:0,productID:null,productQuantity:0,revenueType:null},e)).total=i(n.price,n.productQuantity),o=["productID","revenueType"],u=["price","total","productQuantity"],a={},t.t0=regeneratorRuntime.keys(n);case 12:if((t.t1=t.t0()).done){t.next=21;break}if(s=t.t1.value,-1!==o.indexOf(s)||-1!==u.indexOf(s)){t.next=16;break}return t.abrupt("continue",12);case 16:c=n[s],u.indexOf(s)>-1&&((c=Number(c))||(c=0)),a["$"+s]=c,t.next=12;break;case 21:return r.pr=y.merge(r.pr,a),t.next=24,this.send(r);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"setUtm",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!==(r=y.filterUtm(e))&&(this.storage.set("utm",r),this.updateSession("setUtm"));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"setSuperProperty",value:function(e){y.isObject(e)&&(this.config.superProperty=e)}},{key:"extendSuperPropertys",value:function(e){y.isObject(e)&&(this.config.superProperty=y.merge(this.config.superProperty,e))}},{key:"removeSuperProperty",value:function(e){var t,r=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=f(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw o}}}}(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;delete this.config.superProperty[n]}}catch(e){r.e(e)}finally{r.f()}}},{key:"getSuperProperty",value:function(){return this.config.superProperty}},{key:"flush",value:function(){this.request.clear()}}]),e}();d([R],E.prototype,"environmentInfo",null),d([R],E.prototype,"sessionEnd",null),d([R],E.prototype,"sessionStart",null),d([R],E.prototype,"updateSession",null),d([R],E.prototype,"click",null),d([R],E.prototype,"pv",null),d([R],E.prototype,"duration",null),d([R],E.prototype,"track",null),d([R],E.prototype,"identify",null),d([R],E.prototype,"setPushClient",null),d([R],E.prototype,"trackCount",null),d([R],E.prototype,"trackRevenue",null),d([R],E.prototype,"setUtm",null);var $=["onLaunch","onShow","onHide","onError","onPageNotFound","onUnhandledRejection","onThemeChange","onShareAppMessage","onLogin"],C=["onLoad","onShow","onReady","onHide","onUnload","onShareAppMessage","onReachBottom","onPageScroll","onPullDownRefresh","onTabItemTap","onInit","onShareTimeline","onAddToFavorites","onResize","onTitleClick","onOptionMenuClick","onPullIntercept","onURLQueryChange"],D=function(e){return y.wxGetTitle(e)},j={did:null,getDid:function(){return new Promise((function(e,t){wx.getStorage({key:"zg-did",success:function(t){e(t.data||""),wx.removeStorage({key:"zg-did"})},fail:function(t){e("")}})}))},get:function(){return new Promise((function(e,t){wx.getStorage({key:"zg",success:function(t){e(t.data||{})},fail:function(t){e({})}})}))},set:function(e,t){return new Promise((function(r,n){wx.setStorage({key:e,data:t,success:r,fail:n})}))}},I=!1,L=wx.getSystemInfoSync(),A=L.system.split(/\s/),z={os:A[0],ov:A[1],version:L.version,windowHeight:L.windowHeight,windowWidth:L.windowWidth,net:0,mnet:0};function N(e){var t=e.toLowerCase();"wifi"===t?(z.net=1,z.mnet=0):(z.net=0,z.mnet={"2g":1,"3g":3,"4g":13}[t]||0)}function U(e){return new Promise((function(t,r){if(I)return t(z[e]);wx.getNetworkType({success:function(r){I=!0,N(r.networkType),t(z[e])}})}))}wx.onNetworkStatusChange((function(e){N(e.networkType)}));var q,M,F={os:function(){return z.os},ov:function(){return z.ov},version:function(){return z.version},net:function(){return U("net")},mnet:function(){return U("mnet")},windowWidth:function(){return z.windowWidth},windowHeight:function(){return z.windowHeight}},B=App,Q=Page,W=Component,H=["eid","ct","tz","cuid","cn","sid","url","os","ov","wv","mnet","referrer_domain","net","vn","wxeid","uid","share_id","share_title","share_level","title","path"];function G(e,t,r){if(e[r]&&y.isFunction(e[r])){var n=e[r];e[r]=function(){n.apply(this,arguments),t[r].apply(this,arguments)}}else e[r]=function(){t[r].apply(this,arguments)}}function J(e,t,r){var n=e[t];e[t]=function(){var e=arguments[0];if(q===e||e&&q&&q.timeStamp===e.timeStamp)return n.apply(this,arguments);if(q=e,e){var t=e.type;"tap"===t&&r.click(e)}return n.apply(this,arguments)}}var V=function(e){o(i,e);var r=c(i);function i(e){var n;return t(this,i),(n=r.call(this,T,j,F)).openData={path:"",props:{}},n.shared=!1,n.semiAutoTrackEventCatch={},n.isShareOperation=!1,M=e,n.initLifeCycleHook(),n}return n(i,[{key:"initLifeCycleHook",value:function(){var e,t=this,r=(e=t,{App:{onLaunch:function(t){e.config.visual&&e.visual.getVisualData()},onShow:function(t){e.sceneToUtm(t),e.openOptions=t,e.updateSession("appOnShow")},onHide:function(){e.flush(),e.config.duration&&!e.isShareOperation&&(e.pageReady=!0,e.currentPage.time=Date.now(),e.duration().then((function(){e.pageReady=!1,e.prevPage={queryObj:{},query:"",route:"",time:0,url:"",title:""}})))}},Page:{onLoad:function(t){(null==t?void 0:t.scene)&&-1!==decodeURIComponent(t.scene).indexOf("vRQC")&&e.config.visual&&(e.visual.vRQC=decodeURIComponent(t.scene).split("vRQC=")[1],e.visual.init()),e.currentPage.query=y.parseQuery(t),e.currentPage.queryObj=t},onShow:function(){var t=getCurrentPages(),r=t[t.length-1];e.currentPage.route=r.__route__||r.route,e.currentPage.time=Date.now(),e.currentPage.url="".concat(e.currentPage.route);var n=D;if(e.currentPage.title="function"==typeof n?n(r):"",e.currentPage.query&&(e.currentPage.url+="?".concat(e.currentPage.query)),e.pageReady=!0,e.freeBuffer(),e.currentPage.url!==e.prevPage.url){""!==e.prevPage.url&&e.duration();try{e.trackOpenShare(e.openOptions)}catch(t){console.warn(t,"".concat(e.referrerDomain," ","zhuge"," sdk trackOpenShare error"))}e.pv()}e.startObserveMarkElement(r),e.openOptions=null,e.isShareOperation=!1},onHide:function(){e.semiAutoTrackEventCatch={},e.prevPage=y.clone(e.currentPage),e.pageReady=!1,e.flush()},onUnload:function(){e.semiAutoTrackEventCatch={},e.prevPage=y.clone(e.currentPage),e.pageReady=!1,e.flush()}}});this.lifecycle=r;var n=function(e){for(var n in r.App)G(e,r.App,n);for(var i in e)!$.includes(i)&&y.isFunction(e[i])&&J(e,i,t);return B(e)};for(var i in App)n[i]=App[i];App=n;var o=function(e){for(var n in r.Page)G(e,r.Page,n);for(var i in e)!C.includes(i)&&y.isFunction(e[i])&&"onShareAppMessage"!==i&&J(e,i,t);var o=e.onShareAppMessage;return y.isFunction(o)&&(e.onShareAppMessage=t.onShareAppMessage(o)),Q(e)};for(var u in Page)o[u]=Page[u];Page=o,Component=function(e){if(void 0!==e.methods)for(var r in e.methods)J(e.methods,r,t);return W(e)},global&&global.mpvue&&(global.App=App,global.Page=Page,global.Component=Component),App.zhuge=t}},{key:"load",value:function(e,t){return m(u(i.prototype),"load",this).call(this,e,t)}},{key:"pv",value:function(e){var t=this,r=Object.create(null,{pv:{get:function(){return m(u(i.prototype),"pv",t)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},n=y.getCurrentPage(),this.config.forwardShare&&this.openOptions&&(t.$share_open_type=1008===this.openOptions.scene?"群聊":"聊天",this.openOptions.query&&this.openOptions.query.zg_share_level&&(t.$share_level=Number(this.openOptions.query.zg_share_level)),n.data&&n.data.zg_share_data&&(t=y.merge(t,y.encode(n.data.zg_share_data)))),e.next=5,r.pv.call(this,t);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"click",value:function(e){var t=this,r=Object.create(null,{click:{get:function(){return m(u(i.prototype),"click",t)}}});return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.click.call(this,e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"sceneToUtm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y.getUtmByQuery(e.query);if(this.config.parseScene&&e.scene&&M){var r=e.scene;this.cn=r+"";var n=M[r],i={},o=null,u=M.isShare(r);if(u&&e.referrerInfo&&(o=e.referrerInfo.appId),n){i={utm_source:n.utm_source,utm_medium:n.utm_medium,utm_campaign:o};var a=e.query||{};M.isCartShare(r)&&a.zg_uid&&a.zg_share_id&&(i.utm_term=a.zg_uid,i.utm_content=a.zg_share_id)}t=y.merge(i,t)}this.utmCatch=t,"fresh"===this.config.utmMode&&y.isEmpty(this.config.utm)&&this.storage.set("utm",t)}},{key:"trackOpenShare",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,u,a,s,c,m,l,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&this.config.forwardShare){t.next=2;break}return t.abrupt("return");case 2:if(!this.shared){t.next=5;break}return this.shared=!1,t.abrupt("return");case 5:if(r=e.query||{},n=this.currentPage.route,!(M.isCartShare(e.scene)&&r.zg_uid&&r.zg_share_id)){t.next=24;break}for(u in i={$uid:r.zg_uid,$share_id:r.zg_share_id,$title:this.currentPage.title,$path:n,$share_open_type:1008===e.scene?"群聊":"聊天",$share_level:Number(r.zg_share_level)},this.shareId=r.zg_share_id,this.shareLevel=Number(r.zg_share_level),o={},r)a=u.replace(/^zg_/,""),-1===H.indexOf(a)&&/^zg_/.test(u)&&(o[a]=r[u]);if(s=this.config.shareToUtm,y.isObject(s)&&!y.isEmpty(s)){for(m in c={},s)null!==o[m]&&void 0!==o[m]&&(l=s[m],c[l]=o[m]);y.isEmpty(c)||(c.utm_campaign||(c.utm_campaign="分享打开"),this.setUtm(c))}return this.openData={path:n,props:o},i=y.merge(i,y.encode(o)),t.next=19,this.trackBaseData("wxsopen");case 19:return(h=t.sent).dt="abp",h.pr=y.merge(h.pr,i),t.next=24,this.send(h);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"onShareAppMessage",value:function(e){var t=this;return function(){t.isShareOperation=!0;var r=e.apply(this,arguments)||{};if(!t.config.forwardShare)return r;r.path=r.path||t.currentPage.url;var n=r.title||t.currentPage.title,i=r.path.split("?")[0],o=this.data.zg_share_data,u=(new Date).getTime(),a=1;!this.data.newShare&&t.openData&&t.openData.path===i&&y.isEqual(o||{},t.openData.props)&&(u=t.shareId,a=t.shareLevel+1);var s={share_id:u,uid:t.storage.allData.cuid||t.storage.allData.did,share_level:a},c={$share_title:n,$title:t.currentPage.title||"",$path:i},m={};for(var l in s)c["$".concat(l)]=m["zg_".concat(l)]=s[l];for(var h in o)-1===H.indexOf(h)&&(c["_".concat(h)]=m["zg_".concat(h)]=o[h]);return r.path=y.addUrlParam(r.path,m),t.trackBaseData("wxshare").then((function(e){e.dt="abp",e.pr=y.merge(e.pr,c),t.request.send(e)})),t.shared=!0,r}}},{key:"startObserveMarkElement",value:function(e){var t=this;this.config.exposure&&(this.elementObserver&&this.elementObserver.disconnect(),e.isComponent?this.elementObserver=e.createIntersectionObserver({observeAll:!0}):this.elementObserver=wx.createIntersectionObserver(e,{observeAll:!0}),this.elementObserver.relativeToViewport().observe(".zhuge-expo-track",(function(e){if(e.intersectionRatio>0){var r,n=t.getEventDataFromDataset(e.dataset);(r=m(u(i.prototype),"track",t)).call.apply(r,[t].concat(h(n)))}})))}},{key:"getEventDataFromDataset",value:function(e){var t={},r="";for(var n in e){if(n.startsWith("expo"))if("expoName"===n)r=e[n];else t[n.replace(/^expo(.*)/,(function(e,t,r,n){return t.replace(t[0],t[0].toLocaleLowerCase())}))]=e[n]}return[r,t]}}]),i}(E);d([R],V.prototype,"sceneToUtm",null),d([R],V.prototype,"trackOpenShare",null);var K={1e3:{utm_source:"其他",utm_medium:"其他"},1001:{utm_source:"微信主程序",utm_medium:"发现栏小程序主入口"},1005:{utm_source:"搜索",utm_medium:"顶部搜索框的搜索结果页"},1006:{utm_source:"搜索",utm_medium:"发现栏小程序主入口搜索框的搜索结果页"},1007:{utm_source:"分享",utm_medium:"单人聊天会话中的小程序消息卡片"},1008:{utm_source:"分享",utm_medium:"群聊会话中的小程序消息卡片"},1010:{utm_source:"收藏",utm_medium:"收藏夹"},1011:{utm_source:"扫码",utm_medium:"扫描二维码"},1012:{utm_source:"扫码",utm_medium:"长按图片识别二维码"},1013:{utm_source:"扫码",utm_medium:"手机相册选取二维码"},1014:{utm_source:"小程序模板消息",utm_medium:"小程序模板消息"},1017:{utm_source:"体验版",utm_medium:"前往体验版的入口页"},1019:{utm_source:"微信支付",utm_medium:"微信钱包"},1023:{utm_source:"桌面图标",utm_medium:"安卓系统桌面图标"},1024:{utm_source:"微信主程序",utm_medium:"小程序 profile 页"},1025:{utm_source:"扫码",utm_medium:"扫描一维码"},1026:{utm_source:"微信主程序",utm_medium:"附近小程序列表"},1027:{utm_source:"搜索",utm_medium:"顶部搜索框搜索结果页“使用过的小程序”列表"},1028:{utm_source:"微信卡券",utm_medium:"我的卡包"},1029:{utm_source:"微信卡券",utm_medium:"卡券详情页"},1030:{utm_source:"测试",utm_medium:"自动化测试下打开小程序"},1031:{utm_source:"扫码",utm_medium:"长按图片识别一维码"},1032:{utm_source:"扫码",utm_medium:"手机相册选取一维码"},1034:{utm_source:"微信支付",utm_medium:"微信支付完成页"},1035:{utm_source:"公众号",utm_medium:"公众号自定义菜单"},1036:{utm_source:"分享",utm_medium:"App分享消息卡片"},1037:{utm_source:"小程序",utm_medium:"小程序打开小程序"},1038:{utm_source:"小程序",utm_medium:"从另一个小程序返回"},1039:{utm_source:"摇电视",utm_medium:"摇电视"},1042:{utm_source:"搜索",utm_medium:"添加好友搜索框的搜索结果页"},1043:{utm_source:"公众号",utm_medium:"公众号模板消息"},1044:{utm_source:"分享",utm_medium:"带shareTicket的小程序消息卡片(详情)"},1045:{utm_source:"广告",utm_medium:"朋友圈广告"},1046:{utm_source:"广告",utm_medium:"朋友圈广告详情页"},1047:{utm_source:"扫码",utm_medium:"扫描小程序码"},1048:{utm_source:"扫码",utm_medium:"长按图片识别小程序码"},1049:{utm_source:"扫码",utm_medium:"手机相册选取小程序码"},1052:{utm_source:"微信卡券",utm_medium:"卡券的适用门店列表"},1053:{utm_source:"搜索",utm_medium:"搜一搜的结果页"},1056:{utm_source:"音乐播放器菜单",utm_medium:"音乐播放器菜单"},1057:{utm_source:"微信支付",utm_medium:"钱包中的银行卡详情页"},1058:{utm_source:"公众号",utm_medium:"公众号文章"},1059:{utm_source:"体验版",utm_medium:"体验版小程序绑定邀请页"},1060:{utm_source:"支付完成",utm_medium:"微信支付完成页"},1064:{utm_source:"微信WIFI",utm_medium:"微信连Wi-Fi状态栏"},1065:{utm_source:"scheme 详情",utm_medium:"URL scheme 详情"},1067:{utm_source:"广告",utm_medium:"公众号文章广告"},1069:{utm_source:"移动应用",utm_medium:"移动应用"},1071:{utm_source:"微信支付",utm_medium:"钱包中的银行卡列表页"},1072:{utm_source:"微信支付",utm_medium:"二维码收款页面"},1073:{utm_source:"客服消息",utm_medium:"客服消息列表下发的小程序消息卡片"},1074:{utm_source:"公众号会话",utm_medium:"公众号会话下发的小程序消息卡片"},1077:{utm_source:"摇周边",utm_medium:"摇周边"},1078:{utm_source:"微信WIFI",utm_medium:"连Wi-Fi成功页"},1079:{utm_source:"微信游戏中心",utm_medium:"微信游戏中心"},1081:{utm_source:"客服消息",utm_medium:"客服消息下发的文字链"},1082:{utm_source:"公众号",utm_medium:"公众号会话下发的文字链"},1084:{utm_source:"广告",utm_medium:"朋友圈广告原生页"},1088:{utm_source:"打开小程序",utm_medium:"会话中查看系统消息,打开小程序"},1089:{utm_source:"微信主程序",utm_medium:"微信聊天主界面下拉"},1090:{utm_source:"小程序",utm_medium:"长按小程序右上角菜单唤出最近使用历史"},1091:{utm_source:"公众号",utm_medium:"公众号文章商品卡片"},1092:{utm_source:"微信城市服务",utm_medium:"城市服务入口"},1095:{utm_source:"广告",utm_medium:"小程序广告组件"},1096:{utm_source:"分享",utm_medium:"聊天记录"},1097:{utm_source:"微信支付",utm_medium:"微信支付签约页"},1099:{utm_source:"小程序",utm_medium:"页面内嵌插件"},1100:{utm_source:"打开小程序",utm_medium:"红包封面详情页打开小程序"},1101:{utm_source:"调试",utm_medium:"远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)"},1102:{utm_source:"公众号",utm_medium:"公众号profile页服务预览"},1106:{utm_source:"打开小程序",utm_medium:"聊天主界面下拉,从顶部搜索结果页,打开小程序"},1107:{utm_source:"打开小程序",utm_medium:"订阅消息,打开小程序"},1113:{utm_source:"打开小程序",utm_medium:"安卓手机负一屏,打开小程序(三星)"},1114:{utm_source:"打开小程序",utm_medium:"安卓手机侧边栏,打开小程序(三星)"},1119:{utm_source:"打开小程序",utm_medium:"【企业微信】工作台内打开小程序"},1120:{utm_source:"打开小程序",utm_medium:"【企业微信】个人资料页内打开小程序"},1121:{utm_source:"打开小程序",utm_medium:"【企业微信】聊天加号附件框内打开小程序"},1124:{utm_source:"打开小程序",utm_medium:"扫“一物一码”打开小程序"},1125:{utm_source:"图片识别",utm_medium:"长按图片识别“一物一码”"},1126:{utm_source:"扫描手机相册",utm_medium:"扫描手机相册中选取的“一物一码”"},1129:{utm_source:"爬虫",utm_medium:"微信爬虫"},1131:{utm_source:"浮窗",utm_medium:"浮窗"},1133:{utm_source:"打开小程序详情",utm_medium:"硬件设备打开小程序详情"},1135:{utm_source:"打开小程序",utm_medium:"小程序 profile 页相关小程序列表,打开小程序"},1144:{utm_source:"视频贴片",utm_medium:"公众号文章 - 视频贴片"},1145:{utm_source:"发现小程序",utm_medium:"发现栏 - 发现小程序"},1146:{utm_source:"打开出行类小程序",utm_medium:"地理位置信息打开出行类小程序"},1148:{utm_source:"打开小程序",utm_medium:"卡包 - 交通卡,打开小程序"},1150:{utm_source:"扫一扫",utm_medium:"扫一扫商品条码结果页打开小程序"},1151:{utm_source:"我的订单",utm_medium:"发现栏 - 我的订单"},1152:{utm_source:"打开小程序",utm_medium:"订阅号视频打开小程序"},1153:{utm_source:"打开小程序",utm_medium:"“识物”结果页打开小程序"},1154:{utm_source:"打开“单页模式”",utm_medium:"朋友圈内打开“单页模式”"},1155:{utm_source:"打开小程序",utm_medium:"“单页模式”打开小程序"},1157:{utm_source:"打开小程序",utm_medium:"服务号会话页打开小程序"},1158:{utm_source:"打开小程序",utm_medium:"群工具打开小程序"},1160:{utm_source:"群待办",utm_medium:"群待办"},1167:{utm_source:"打开小程序详情",utm_medium:"H5 通过开放标签打开小程序详情"},1168:{utm_source:"运行小程序",utm_medium:"移动应用直接运行小程序"},1169:{utm_source:"小程序入口",utm_medium:"发现栏小程序主入口,各个生活服务入口"},1171:{utm_source:"微信运动记录",utm_medium:"微信运动记录"},1173:{utm_source:"打开小程序详情",utm_medium:"聊天素材用小程序打开详情"},1175:{utm_source:"商店入口",utm_medium:"视频号主页商店入口"},1176:{utm_source:"打开小程序",utm_medium:"视频号直播间主播打开小程序"},1177:{utm_source:"直播商品",utm_medium:"视频号直播商品"},1178:{utm_source:"打开小程序",utm_medium:"在电脑打开手机上打开的小程序"},1179:{utm_source:"打开小程序",utm_medium:"#话题页打开小程序"},1181:{utm_source:"打开 PC 小程序",utm_medium:"网站应用打开 PC 小程序"},1183:{utm_source:"搜索",utm_medium:"PC微信 - 小程序面板 - 发现小程序 - 搜索"},1184:{utm_source:"打开小程序",utm_medium:"视频号链接打开小程序"},1185:{utm_source:"群公告",utm_medium:"群公告"},1186:{utm_source:"收藏",utm_medium:"收藏 - 笔记"},1187:{utm_source:"浮窗",utm_medium:"浮窗"},1189:{utm_source:"表情雨广告",utm_medium:"表情雨广告"},1191:{utm_source:"视频号活动",utm_medium:"视频号活动"},1192:{utm_source:"企业微信联系人 profile 页",utm_medium:"企业微信联系人 profile 页"},1193:{utm_source:"打开小程序",utm_medium:"视频号主页服务菜单打开小程序"},1194:{utm_source:"URL Link 详情",utm_medium:"URL Link 详情"},1195:{utm_source:"主页商品tab",utm_medium:"视频号主页商品tab"},1196:{utm_source:"打开小程序",utm_medium:"个人状态打开小程序"},1197:{utm_source:"返回小游戏",utm_medium:"视频号主播从直播间返回小游戏"},1198:{utm_source:"打开小游戏",utm_medium:"视频号开播界面打开小游戏"},1201:{utm_source:"打开小程序",utm_medium:"视频号广告详情页打开小程序"},1202:{utm_source:"打开小程序卡片",utm_medium:"企微客服号会话打开小程序卡片"},1203:{utm_source:"压测工具的请求",utm_medium:"微信小程序压测工具的请求"},1206:{utm_source:"打开小游戏",utm_medium:"视频号小游戏直播间打开小游戏"},1207:{utm_source:"打开小程序文字链",utm_medium:"企微客服号会话打开小程序文字链"},1208:{utm_source:"打开商品卡片",utm_medium:"聊天打开商品卡片"},1212:{utm_source:"打开小程序",utm_medium:"青少年模式申请页打开小程序"},1215:{utm_source:"打开小程序",utm_medium:"广告预约打开小程序"},1216:{utm_source:"打开小程序",utm_medium:"视频号订单中心打开小程序"},isShare:function(e){return[1096].includes(e)},isCartShare:function(e){return[1007,1008,1036,1044].includes(e)}},Y=new(function(e){o(i,e);var r=c(i);function i(){return t(this,i),r.call(this,K)}return n(i,[{key:"load",value:function(e,t){var r=t||{};if(wx.getAccountInfoSync){var n=wx.getAccountInfoSync();n&&n.miniProgram&&n.miniProgram.appId&&(r.appId=n.miniProgram.appId)}return m(u(i.prototype),"load",this).call(this,e,r)}}]),i}(V));return App.zhuge=Y,Y}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zg-sdk-wechart",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "description": "诸葛智能微信小程序sdk",
5
5
  "main": "./dist/zhuge.min.js",
6
6
  "module": "./dist/zhuge.es.min.js",