!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.peach=t():e.peach=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";this.app.doReady().then(function(){t="string"==typeof t?t:JSON.stringify(t),e=e?String(e):"",f.default.sendReq({event_type:"event",event:[{device_id:f.default.getDeviceId(),trace_id:f.default.getSessionId(),span_id:f.default.generateUUID(),web_event_uid:f.default.generateUUID(),web_event_id:0,web_event_name:e,web_business_event:t,event_type:"click",type:f.default.isAPP?"h5":"web",web_path:location.href,ua:navigator.userAgent,request_date:f.default.getNowStr(),timestamp:(new Date).getTime(),userid:f.default.getHnUserId()?Number(f.default.getHnUserId()):0}]})})}},{key:"logPage",value:function(){this.app.doReady().then(function(){var e=f.default.generateUUID(),t=sessionStorage.getItem("peach_parent_span_id")||"";sessionStorage.setItem("peach_parent_span_id",e),f.default.sendReq({event_type:"page",page:[{device_id:f.default.getDeviceId(),trace_id:f.default.getSessionId(),span_id:e,parent_span_id:t,type:f.default.isAPP?"h5":"web",ua:navigator.userAgent,url:location.href,ref:p||document.referrer,duration_time:0,page_id:0,page_name:"",request_date:f.default.getNowStr(),timestamp:(new Date).getTime(),userid:f.default.getHnUserId()?Number(f.default.getHnUserId()):0}]}),p=location.href})}}]),t}(l.default);e.exports=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={isAPP:-1!==navigator.userAgent.indexOf("cnhnb_iOS")||-1!==navigator.userAgent.indexOf("cnhnb_Android_"),app:null,generateUUID:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})},getNowStr:function(){var e=new Date,t=function(e){return e>=10?e:"0"+e};return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())},getDeviceId:function(){if(this.isAPP&&this.app.settings.deviceId)return this.app.settings.deviceId;var e=this.getCookie("deviceId");return e||(e=this.generateUUID(),this.setCookie("deviceId",e,365)),e},getSessionId:function(){if(this.isAPP&&this.app.settings.sessionId)return this.app.settings.sessionId;var e=sessionStorage.getItem("sessionId");return e||(e=this.generateUUID(),sessionStorage.setItem("sessionId",e)),e},sendReq:function(e){var t=new XMLHttpRequest;t.open("POST","http://www.lianlianny.com/agricprod/lib/gather/peach/userlog/write/log/file/h5",!0),t.setRequestHeader("Content-Type","application/json; charset=UTF-8"),t.send(JSON.stringify(e))},getCookie:function(e){if(document.cookie.length>0){var t=document.cookie.indexOf(e+"=");if(-1!==t){t=t+e.length+1;var n=document.cookie.indexOf(";",t);return-1===n&&(n=document.cookie.length),unescape(document.cookie.substring(t,n))}}},setCookie:function(e,t,n){var r=new Date;r.setDate(r.getDate()+n),document.cookie=e+"="+escape(t)+(null==n?"":";expires="+r.toGMTString())},getHnUserId:function(){return this.isAPP?this.app.settings.hnUserId:this.getCookie("hnUserId")}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;nt.priority)return-1;if(e.priority