this.Tracker=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,t,r){},t.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t){function r(e){return"object"==typeof e&&null!==e}var n=function(e){return"[object Number]"===Object.prototype.toString.call(e)};t.isNumber=n,t.isNaN=function(e){return n(e)&&e!==+e},t.isArray=function(e){return Array.isArray?Array.isArray(e):-1!==Object.prototype.toString.call(e).toUpperCase().indexOf("ARRAY")},t.noop=function(e){return e||""},t.extend=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},t.shallowMerge=function(e,t,r){for(var n in t)t.hasOwnProperty(n)&&(r||e[n]===undefined)&&(e[n]=t[n])},t.getSpm=function(){var e="",r="",n=window.goldlog||{},i=n.spmAb||n.spm_ab;return i&&t.isArray(i)&&(e=i[0],i[1]&&(r=i[1])),{a:e,b:r}},t.unifyErrorMsg=function(e){return/^script error\.?$/i.test(e)?"Script error":e},t.getScreenSize=function(){return window.screen.width+"x"+window.screen.height},t.generateIdentifier=function(e){return[e.type,e.uid,e.page,e.msg||"",e.ajaxurl||""].join("_")};var i={};t.addEvent=function(e,t,r,n){e.addEventListener?e.addEventListener(t,r,n||!1):e.attachEvent&&(i["on"+t]=function(){return r.call(e,window.event)},e.attachEvent("on"+t,i["on"+t]))},t.removeEvent=function(e,t,r,n){e.removeEventListener?e.removeEventListener(t,r,n||!1):e.detachEvent&&e.detachEvent("on"+t,i["on"+t]||noop)},t.isError=function(e){var t={}.toString.call(e);return r(e)&&"[object Error]"===t||"[object Exception]"===t||e instanceof Error},t.getXPath=function o(e,t){var r=e.id?"#"+e.id:"",n=e.className&&e.className.split?"."+e.className.split(" ").join("."):"",i=e.tagName.toLowerCase();return e.parentNode&&e.parentNode.tagName&&t-1!=0?o(e.parentNode,t-1)+" > "+i.toLowerCase()+r+n:i+r+n},t.getWin=function(){var e=!1;try{"[object process]"===global.process.toString()&&(e=!0,global.process.versions&&global.process.versions.electron&&"renderer"===global.process.type&&(e=!1))}catch(r){}var t={};return e||(t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{}),t}},function(e,t,r){function n(e){if(!(this instanceof n))return new n(e);e=e||{},!0===e.hotPatch&&this._hotPatch(),!1!==e.global&&"object"==typeof v.__trackerOptions&&o(e,v.__trackerOptions),this.global=null==e.global||!!e.global,this.debug=e.debug||y&&y.search.indexOf("clueTrackerDebug=true")>-1,this.debug&&this._warn("已开启 debug 模式,请勿在生产环境使用"),this.pid=e.pid,this.sampleRate=e.sampleRate||1,this.uidResolver=e.uidResolver||s,this.userOptions=e,this.requiredFields=e.requiredFields||[],this.releaseResolver=e.releaseResolver||s,this.uaParser=e.uaParser||s,this.beforeLog=e.beforeLog||null,this.msgWhitelist=e.msgWhitelist||e.msgWhiteList||k,this.urlWhitelist=e.urlWhitelist||e.urlWhiteList||O,this.oncePerSession=e.oncePerSession===undefined||e.oncePerSession,this.consoleDisplay=e.consoleDisplay||!1,this.ignoreScriptError=e.ignoreScriptError||!1,this.resourceError=e.resourceError===undefined||e.resourceError,this.resourceErrorSampleRate=e.resourceErrorSampleRate||1,this.useSendBeacon=e.useSendBeacon===undefined||e.useSendBeacon,this.ignoredQueries=e.ignoredQueries||[],this.global&&(v.__trackerOptions=e),this._inited=!1,this._tracked=[],this._logWaitingQueue=[],this._plugins=e.plugins||[],this._pos="0,0",this._trackMousePos(),this.isWeex=e.isWeex||!1,this.weexFetch=e.weexFetch,this.fetchCallBack=e.fetchCallBack,this.noDOM=this.isWeex,this.fetchProtocol=e.protocol}var i=r(0),o=i.shallowMerge,s=i.noop,a=i.generateIdentifier,c=i.getScreenSize,l=i.addEvent,h=i.removeEvent,u=i.getWin,p=i.getSpm,f=i.isError,d=i.getXPath,g=r(2),_=r(3),m=i.unifyErrorMsg,v=u(),w=v.document,b=v.navigator,y=v.location,E=!1,R=v.Tracker,S={JS_ERROR:1},k=null,O=null,x=+new Date,P=v.onerror;n.noConflict=function(){return v.Tracker===n&&(v.Tracker=R),n},n.prototype={VERSION:"4.3.1",log:function(e,t){"object"==typeof e?t=e:"string"==typeof e&&(t=t||{},o(t,{code:1,msg:e})),this._log(t)},captureMessage:function(e,t){return this.log(e,t)},logError:function(e,t){if(!f(e))return this.log(e,t);if(t=t||{},t.c1||t.c2||t.c3)return void this._warn("使用 tracker.logError() 时不可再传入 c1,c2,c3 字段,请求未发送");var r={},n=_(e);r.msg=e.toString(),r.c1=n[0],r.c2=n[1],r.c3=n[2],o(r,t),this._log(r)},captureException:function(e,t){return this.logError(e,t)},logReq:function(){this._warn("logReq() 方法已经废弃,若有需要,请使用自定义打点方式( `tracker.log()` )监控接口错误。")},logPerf:function(){this._warn("logPerf() 方法已经废弃,若有需要,请使用自定义打点方式( `tracker.log()` )监控接口错误。")},config:function(e,t){return"string"==typeof e?(t=t||{},t.pid=e):t=e,o(this,t,!0),o(this.userOptions,t,!0),"object"==typeof v.__trackerOptions&&o(v.__trackerOptions,t,!0),this._checkRequiredFields()&&this._popWaitingQueue(),this},_getResourceErrorSrc:function(e){var t=e.src||e.href;if(void 0===t){var r="object"===e.tagName.toLowerCase(),n="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"===e.getAttribute("classid")||"application/x-shockwave-flash"===e.getAttribute("type");r&&n&&(t=e.getAttribute("data")||e.getAttribute("codebase")),void 0===t&&(t=e.outerHTML||e.innerHTML)}return t},onGlobalError:function(){if(this._plugins.length)for(;this._plugins.length>0;){var e=this._plugins.pop(),t=e[0],r=e[1];t.apply(this,[this].concat(r))}if(this._warn("plugin 已加载"),!w)return this._warn("当前为非 web 环境,不支持报错监听"),this;var n=this;return this.pid&&!this._inited&&(v.onerror=function(e,t,r,i,o){n._handleError(e,t,r,i,o)},this.unhandledrejectionHandler=function(e){e.reason&&e.reason.message&&n._handleError(e.reason.message,null,null,null,e.reason)},l(v,"unhandledrejection",this.unhandledrejectionHandler),this.resourceError&&(this.resourceErrorHandler=function(e){if(!(!e.target.tagName||e.message||e.filename||e.lineno||e.colno)){var t=n._getResourceErrorSrc(e.target),r=e.target.tagName.toLowerCase();n._log({code:4,sampleRate:n.resourceErrorSampleRate,msg:t+" 获取失败",c1:r,c2:d(e.target,5)})}},l(v,"error",this.resourceErrorHandler,!0)),this._inited=!0,this._warn("onGlobalError 已开启")),this},install:function(){return this.onGlobalError()},offGlobalError:function(){return this._plugins=[],w?(v.onerror=P,h(v,"unhandledrejection",this.unhandledrejectionHandler),this.resourceError&&h(v,"error",this.resourceErrorHandler,!0),this._inited=!1,this._tracked=[],this._warn("onGlobalError 已关闭"),this):(this._warn("当前为非 web 环境,不支持监听事件移除与状态重置"),this)},uninstall:function(){return this.offGlobalError()},addPlugin:function(e){var t=[].slice.call(arguments,1);return"function"==typeof e&&this._inited?e.apply(this,[this].concat(t)):this._plugins.push([e,t]),this},_handleError:function(e,t,r,n,i){if(P)try{P.call(this,e,t,r,n,i)}catch(a){}t=t||"-",r=r||"-",n=n||"-",e=m(e);var o={msg:e,code:S.JS_ERROR};if(!this.ignoreScriptError||"Script error"!==e){if(null!=i&&(1===this.sampleRate||Math.random()<.1)){var s=_(i);o.c1=s[0],o.c2=s[1],o.c3=s[2]}this._log(o)}},_handleMouseDown:function(e){var t=w&&w.documentElement;if(t&&w.body){var r=Math.round(e.pageY||e.clientY+w.body.scrollTop+t.scrollTop),n=Math.round(e.pageX||e.clientX+w.body.scrollLeft+t.scrollLeft);n-=Math.max(t.clientWidth,t.offsetWidth,t.scrollWidth)/2,this._pos=String(n)+","+String(r)}},_trackMousePos:function(){var e=this;w&&w.documentElement&&l(w,"mousedown",function(t){e._handleMouseDown(t)})},getFetchProtocol:function(){return"http"===this.fetchProtocol?"http://gm.mmstat.com/":"https"===this.fetchProtocol?"https://gm.mmstat.com/":v&&w&&!this.noDOM&&"file:"===v.location.protocol?"http://gm.mmstat.com/":"//gm.mmstat.com/"},_postData:function(e){var t=this.useSendBeacon&&!!(v.navigator&&v.navigator.sendBeacon&&v.Blob),r=this.getFetchProtocol()+(e.base||"fsp.1.1");this._warn("当前打点参数",e);var n=g.stringify(e,["code","base","sampleRate","oncePerSession"],t);if(this.isWeex&&this.weexFetch&&this.weexFetch.fetch)if(this.fetchCallBack)this.fetchCallBack(r+"?"+n),this._warn("当前已使用 fetchCallBack ",r+"?"+n);else try{this.weexFetch.fetch({method:"GET",type:"json",url:r+"?"+n}),this._warn("weex 打点请求已发出",r+"?"+n)}catch(o){this._warn("weex fetch 发送打点请求失败")}else if(this.fetchCallBack)this.fetchCallBack(r+"?"+n),this._warn("当前已使用 fetchCallBack ",r+"?"+n);else if(t)try{v.navigator.sendBeacon(r,JSON.stringify({gmkey:"OTHER",gokey:n,logtype:"2"})),this._warn("sendBeacon 打点请求已发出",{gmkey:"OTHER",gokey:n,logtype:"2"})}catch(o){if(n=g.stringify(e,["code","base","sampleRate","oncePerSession"],!1),v&&w&&!this.noDOM){var i=new Image;i.src=r+"?"+n,this._warn("打点请求已发出",i.src)}else this._warn("当前非 web 环境,发送异常信息失败")}else if(v&&w&&!this.noDOM){var i=new Image;i.src=r+"?"+n,this._warn("打点请求已发出",i.src)}else this._warn("当前非 web 环境,发送异常信息失败")},_log:function(e){if(e=e||{},e.type||e.code||(e.type=1),!e.type&&e.code&&(e.type=e.code),e.type===S.JS_ERROR&&Math.random()>(e.sampleRate||this.sampleRate))return void this._warn("当前已设置采样率"+(e.sampleRate||this.sampleRate)+",未被采集");if(null!=e.sampleRate&&Math.random()>e.sampleRate)return void this._warn("当前已设置采样率"+(e.sampleRate||this.sampleRate)+",未被采集");if(e=this._enhanceOpitons(e),!e.pid)return void this._warn("未配置 pid,请求未发送");for(var t=a(e),r=!1,n=0;n0?e.referrer=r+"?"+n:e.referrer=r,e.last_pos=this._pos,e},_enhanceOpitons:function(e){return e=this._enhanceOpitonsCommon(e),e=this._enhanceOpitonsDOM(e)},_warn:function(){if("object"==typeof v&&v.console&&"function"==typeof v.console.warn&&this.debug){var e=Array.prototype.slice.call(arguments);v.console.warn.apply(null,["[Tracker Debug] "+e[0]].concat(e.slice(1)))}},_hotPatch:function(){if(v&&w&&!this.noDOM){if(E&&v.__trackerPatch)return;E=!0;var e=Math.random();if(v.localStorage&&v.localStorage.getItem){var t=v.localStorage.getItem("__tracker_patch__"),r=+new Date;if(t&&r-parseInt(t,10)<432e5)e=t;else{e=r;try{v.localStorage.setItem("__tracker_patch__",r)}catch(o){}}}var n=w.createElement("script");n.src="//g.alicdn.com/fsp/tracker-patch/index.js?"+e,n.async=!0,n.crossOrigin=!0,n.id="tracker-patch",(w.head||w.body).appendChild(n);var i=this;v.__trackerPatch=function(){return i}}}},e.exports=n},function(e,t){function r(e){return"[object Array]"==={}.toString.call(e)}t.parse=function(e){var t={};if("string"!=typeof e)return t;if(e=(e||"").split("?")[1]||"",!(e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/^(\?|#|&)/,"")))return t;for(var n=e.split("&"),i=0;i0){t.shift();var f="";for(c=0;f.length+(t[c]||"").length).*?)(?::\d+)?(?::\d+)?\)?\s*$/i,o=/^\s*.*?(?:\(.*?\))?(?:^|@)((?:file|https?|blob|chrome|resource|\[native).*?)(?::\d+)?(?::\d+)?\s*$/i,s=/^\s*at (?:(?:\[object object\])?.+ )?\(?((?:file|ms-appx|https?|blob):.*?):\d+(?::\d+)?\)?\s*$/i;"object"==typeof process&&"test"===process.env.NODE_ENV&&(i=/([^\()]+\.spec\.js)/i),e.exports=r}]);this.interfaceTrackerPlugin=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,t,r){},t.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){function r(e){return"object"==typeof e&&null!==e}var n=function(e){return"[object Number]"===Object.prototype.toString.call(e)};t.isNumber=n,t.isNaN=function(e){return n(e)&&e!==+e},t.isArray=function(e){return Array.isArray?Array.isArray(e):-1!==Object.prototype.toString.call(e).toUpperCase().indexOf("ARRAY")},t.noop=function(e){return e||""},t.extend=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},t.shallowMerge=function(e,t,r){for(var n in t)t.hasOwnProperty(n)&&(r||e[n]===undefined)&&(e[n]=t[n])},t.getSpm=function(){var e="",r="",n=window.goldlog||{},o=n.spmAb||n.spm_ab;return o&&t.isArray(o)&&(e=o[0],o[1]&&(r=o[1])),{a:e,b:r}},t.unifyErrorMsg=function(e){return/^script error\.?$/i.test(e)?"Script error":e},t.getScreenSize=function(){return window.screen.width+"x"+window.screen.height},t.generateIdentifier=function(e){return[e.type,e.uid,e.page,e.msg||"",e.ajaxurl||""].join("_")};var o={};t.addEvent=function(e,t,r,n){e.addEventListener?e.addEventListener(t,r,n||!1):e.attachEvent&&(o["on"+t]=function(){return r.call(e,window.event)},e.attachEvent("on"+t,o["on"+t]))},t.removeEvent=function(e,t,r,n){e.removeEventListener?e.removeEventListener(t,r,n||!1):e.detachEvent&&e.detachEvent("on"+t,o["on"+t]||noop)},t.isError=function(e){var t={}.toString.call(e);return r(e)&&"[object Error]"===t||"[object Exception]"===t||e instanceof Error},t.getXPath=function a(e,t){var r=e.id?"#"+e.id:"",n=e.className&&e.className.split?"."+e.className.split(" ").join("."):"",o=e.tagName.toLowerCase();return e.parentNode&&e.parentNode.tagName&&t-1!=0?a(e.parentNode,t-1)+" > "+o.toLowerCase()+r+n:o+r+n},t.getWin=function(){var e=!1;try{"[object process]"===global.process.toString()&&(e=!0,global.process.versions&&global.process.versions.electron&&"renderer"===global.process.type&&(e=!1))}catch(r){}var t={};return e||(t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{}),t}},,,,function(e,t,r){var n=r(0),o=n.getWin();e.exports=function(e,t){var r={sampleRate:1,evaluate:null,fullSample:!1},a=n.extend(r,t);if("XMLHttpRequest"in o){var c=o.XMLHttpRequest.prototype,i=c.open;c.open=function(e,t){this.__tracker__={method:e,url:t||"",status_code:null};for(var r=new Array(arguments.length),n=0;n2048&&(l="[too large]");var u={ajaxurl:c,params:s,c1:n.__tracker__.method,c2:n.status,c3:l,code:2,sampleRate:a.sampleRate,oncePerSession:!0},p=!1;if("function"==typeof a.evaluate){if("[object Blob]"==={}.toString.call(n.response))return;var f;try{f=a.evaluate(n.response)}catch(d){}"object"==typeof f&&(u.c4=f.errorCode||f.errCode||"",u.c5=f.traceId||"",u.msg=f.msg||"",p=!0)}(200!==n.status||p||a.fullSample)&&e.log(u)}catch(g){e.logError(g,{pid:"fsp",code:12,c4:e.pid,c5:n.__tracker__.url})}}var n=this;if("onreadystatechange"in n&&"function"==typeof n.onreadystatechange){var o=n.onreadystatechange;n.onreadystatechange=function(){for(var e=new Array(arguments.length),t=0;t2048?"[too large]":t,e.log(f))}).then(function(){o(r)},function(n){e.logError(n,{pid:"fsp",code:12,c4:e.pid,c5:t[0]}),o(r)})}catch(d){e.logError(d,{pid:"fsp",code:12,c4:e.pid,c5:t[0]}),o(r)}})})}}}}]);