var itraceJserrorPlugin=function(){"use strict";function r(e,n){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},r(e,n)}var e;(e={}).ZH="cn",e.QUARK="quark",e.INTL="intl";var n=function(r){return r[r.JSERR=1]="JSERR",r[r.API=2]="API",r[r.PERF=3]="PERF",r[r.RESERR=4]="RESERR",r[r.PVUV=5]="PVUV",r[r.BKPG=6]="BKPG",r[r.LONGTASK=8]="LONGTASK",r[r.INPD=15]="INPD",r[r.NODERES=16]="NODERES",r[r.PGERROR=17]="PGERROR",r[r.BLOCK=18]="BLOCK",r[r.PERFNEXT=1e3]="PERFNEXT",r[r.MAINDOC=1e5]="MAINDOC",r[r.RESTIMING=100001]="RESTIMING",r}({});!function(r){r.JSERR="jserr",r.API="api",r.PERF="jsfsperf",r.RESERR="resloadfail",r.PVUV="flow",r.BKPG="bkpg",r.CUSTOM="jssdkidx",r.INPD="inputdelay",r.LONGTASK="longtask",r.NODERES="nodres",r.PGERROR="pgerror",r.BLOCK="h5block"}({});var t=function(r){r=r||{},this.id=r.id,this.sampleRate=r.sampleRate,this.forceEnable=r.forceEnable};function o(){for(var r=arguments.length <=0?void 0:arguments[0],e=1,n=arguments.length;e=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r 1?c[1]:"",l=c[0],u=this.opts.withReqHeader?o:void 0;return{w_res:l,w_param:d,w_body:s,w_method:t,w_rc:r,w_rt:p-n,w_hd:JSON.stringify(u),w_trace_reqid:i&&i["x-wpk-reqid"]||o&&o["x-wpk-reqid"]||void 0,w_rshd:this.opts.withRespHeader?JSON.stringify(i):void 0,w_trace_serverid:i&&i["x-wpk-serverid"]||void 0,w_type:17,msg:a}},a.hookMtop=function(){var e,t=this;null!=(e=window)&&null!=(e=e.lib)&&null!=(e=e.mtop)&&e.middlewares&&(this.reporter.print("init mtop middlewares"),window.lib.mtop.middlewares.push((function(e){var r=this.params,n=this.options,o=Date.now();return e().then((function(){try{if(t.opts.enableXHR&&n.H5Request&&(n.getJSON||n.postJSON))return;var e=n.retJson||{},s=Date.now()-o,a=e.code||200,i=r.type,p=r.api,c=function(e){var t=[];for(var r in e)t.push(r+"="+e[r]);return t.join("&")}(n.querystring),d=t.opts.withReqBody&&n.postdata&&n.postdata.data?JSON.stringify(n.postdata.data):null,l=t.opts.withRespBody?JSON.stringify(e.data||{}):void 0,u="",h=e.ret;h instanceof Array&&(h=h.join(",")),-1===h.indexOf("SUCCESS")&&(u=h);var f={w_res:p,w_param:c,w_body:d,w_method:i,w_rc:a,w_rt:s,w_resp:l,w_type:100,msg:u};t.sendData(f)}catch(e){t.reportPluginError(e)}}))})))},a.sendData=function(e){var t=e.w_res||"",n=e.w_rt||0;!0!==this.opts.onlyForTrace?this.whiteList(t)&&n <121e3?(o(e,{category:r.API,sampleRate:this.opts.sampleRate,pluginVer:this.pluginVer}),this.reporter.report(e)):this.reporter.print( "api addr in black list or rt over limit ignore this log item"):this.reporter.print( "in uccore. ignore this interface log item")},a.transferXhrRspHeader=function(e){try{var t=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")}(e|| "").split(/[\r\n]+/);if(t.length>0){var r={};return s(t,(function(e){var t=e.split(": "),n=t.shift()||"";r[n]=t.join(": ")})),r}}catch(e){}},a.transferFetchRespHeaders=function(e){try{if(!e)return{};for(var t,r={},n=i(e);!(t=n()).done;){var o=t.value;r[o[0]]=o[1]}return r}catch(e){return{}}},a.isReqSuccess=function(e){return e>=200&&e <=299},a.reportPluginError=function(e){},a.whiteList=function(e){return-1===e.indexOf( "//arms-retcode")&&-1===e.indexOf( "//retcode.taobao.com")&&-1===e.indexOf( "aliyuncs.com/r.png")&&-1===e.indexOf( "//mdap.alipay.com/loggw")&&-1===e.indexOf( "//wpk-gateway")&&-1===e.indexOf( "//px.wpk.quark.cn")&&-1===e.indexOf( "//px.ucweb.com")&&-1===e.indexOf( "//px.effirst.com")&&-1===e.indexOf( "//px-intl.ucweb.com")&&-1===e.indexOf( "//gm.mmstat.com/arms.1.1")&&-1===e.indexOf( "//gm.mmstat.com/arms.1.2")&&-1===e.indexOf( "//g.alicdn.com/alilog")&&-1===e.indexOf( "//log.m.sm.cn/0.gif")},n}(n);return u.pluginId="iTraceInterfacePlugin" ,u}(); var itracePerfPlugin=function(){ "use strict";function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e(t,n)}!function(e){e.ZH="cn" ,e.QUARK="quark" ,e.INTL="intl" }({});var t=function(e){return e[e.JSERR=1]="JSERR" ,e[e.API=2]="API" ,e[e.PERF=3]="PERF" ,e[e.RESERR=4]="RESERR" ,e[e.PVUV=5]="PVUV" ,e[e.BKPG=6]="BKPG" ,e[e.LONGTASK=8]="LONGTASK" ,e[e.INPD=15]="INPD" ,e[e.NODERES=16]="NODERES" ,e[e.PGERROR=17]="PGERROR" ,e[e.BLOCK=18]="BLOCK" ,e[e.PERFNEXT=1e3]="PERFNEXT" ,e[e.MAINDOC=1e5]="MAINDOC" ,e[e.RESTIMING=100001]="RESTIMING" ,e}({});!function(e){e.JSERR="jserr" ,e.API="api" ,e.PERF="jsfsperf" ,e.RESERR="resloadfail" ,e.PVUV="flow" ,e.BKPG="bkpg" ,e.CUSTOM="jssdkidx" ,e.INPD="inputdelay" ,e.LONGTASK="longtask" ,e.NODERES="nodres" ,e.PGERROR="pgerror" ,e.BLOCK="h5block" }({});var n=function(e){e=e||{},this.id=e.id,this.sampleRate=e.sampleRate,this.forceEnable=e.forceEnable};function r(e){return "[object Array]"==={}.toString.call(e)}function i(){for(var e=arguments.length<=0?void 0:arguments[0],t=1,n=arguments.length;t-1}var c,l,u,f,p=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},v=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:d(r)+(r.className&&r.className.trim().length?"."+r.className.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},m=-1,h=function(e){addEventListener("pageshow",(function(t){t.persisted&&(m=t.timeStamp,e(t))}),!0)},g=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},b=function(){var e=g();return e&&e.activationStart||0},w=function(e,t){var n=g(),r="navigate";return m>=0?r="back-forward-cache":n&&(document.prerendering||b()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},E=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},y=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},_=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},P=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},S=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},T=-1,R=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},L=function(e){"hidden"===document.visibilityState&&T>-1&&(T="visibilitychange"===e.type?e.timeStamp:0,V())},C=function(){addEventListener("visibilitychange",L,!0),addEventListener("prerenderingchange",L,!0)},V=function(){removeEventListener("visibilitychange",L,!0),removeEventListener("prerenderingchange",L,!0)},O=function(){return T <0&&(T=R(),C(),h((function(){setTimeout((function(){T=R(),C()}),0)}))),{get firstHiddenTime(){return T}}},I=function(e){document.prerendering?addEventListener( "prerenderingchange",(function(){return e()}),!0):e()},N=[1800,3e3],k=function(e,t){t=t||{},I((function(){var n,r=O(),i=w( "FCP"),o=E( "paint",(function(e){e.forEach((function(e){ "first-contentful-paint"===e.name&&(o.disconnect(),e.startTime=0&&l 1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){D(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,F),removeEventListener("pointercancel",r,F)};addEventListener("pointerup",n,F),addEventListener("pointercancel",r,F)}(t,e):D(t,e)}},j=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,G,F)}))},K=[100,300],x=function(e){var t=e;if(!t)return!1;for(;t;){if("true"===t.getAttribute("ignore-lcp"))return!0;t=t.parentElement}return!1};function M(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var W=function(){function e(){var t,n,r,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=void 0,(n=M(n="debug"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.debug=i}var t,n;return t=e,n=[{key:"info",value:function(){var e;this.debug&&(e=console).info.apply(e,arguments)}},{key:"warn",value:function(){var e;this.debug&&(e=console).warn.apply(e,arguments)}}],n&&function(e,t){for(var n=0;n o.value&&(o.value=a,o.entries=s)},l=function(e,t){if("function"==typeof PerformanceObserver){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe({type:e,buffered:!0}),n}}("layout-shift",c),u=function(){r||(r=!0,function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:v(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t})}}var r;e.attribution={}}(o),e(o))};l&&(t=function(){c(l.takeRecords()),u(),l.disconnect()},i=function(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)},addEventListener("visibilitychange",i,!0),addEventListener("pagehide",i,!0),["keydown","click"].forEach((function(e){window.addEventListener(e,(function(){r||(c(l.takeRecords()),u(),l.disconnect())}),{once:!0,capture:!0})})))}}))};function J(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n 0;s--){var c=e[s-1];if(!x(c.element)){c.startTime 0){var n=t.entries[t.entries.length-1];e.webVitals.lcpElement=v(n.element),e.webVitals.lcpNav=t.navigationType}e._reportPerfLog()}),{enableFilter:o,debug:this.reporter.debug})}this.webVitals.hasCls&&H((function(t){e.webVitals.cls=t.value,e.webVitals.clsElement=t.attribution.largestShiftTarget,e._reportPerfLog()}))},p._getWebVitals=function(){return{wl_fcp:this._getIndFromWebVitals("fcp"),wl_fid:this._getIndFromWebVitals("fid"),wl_lcp:this._getIndFromWebVitals("lcp"),wl_cls:this._getIndFromWebVitals("cls"),w_lcp_ele:this.webVitals.lcpElement,w_lcp_navt:this.webVitals.lcpNav,w_cls_ele:this.webVitals.clsElement}},p._getIndFromWebVitals=function(e){var t=this.webVitals[e];if(t&&!(t>6e4))return["fid","cls"].includes(e)?parseFloat(t.toFixed(4)):Math.floor(t)},p.reportPerf=function(e){this.reporter._hasReportPerfData?this.reporter.print("do not repeat report performance data"):(this.reporter.print("manual performance data"),this.reporter.__customPerfCache__=e,this.autoCollectTimingData())},p.autoCollectTimingData=function(){var e,t=this,n=function(){var e=setTimeout((function(){t.collectNavigationTimingData(),clearTimeout(e)}),0)},r=null==(e=this.reporter._sdkEnv)?void 0:e.isPrerender;!function(e){var t;return void 0===e&&(e={}),e.isPrerender?"compass"===e.prerenderType?"object"==typeof(null==(t=window)?void 0:t.prerenderCommitEvent)&&"prerendercommit"===window.prerenderCommitEvent.type:e.hasPrerenderCommit:"complete"===document.readyState}(this.reporter._sdkEnv)?function(e,t){o(window,t?"wpkpageforeground":"load",(function(n){t&&"complete"!==document.readyState?o(window,"load",(function(t){e.call(null,t)}),!1,!0):e.call(null,n)}),!1,!0)}(n,r):n()},p.collectNavigationTimingData=function(){var e=window.performance;if(e){var n,o=e.getEntriesByType?e.getEntriesByType("navigation"):[];if(r(o)&&o.length>0?(n=o[0])._ver=2:(n=e.timing)&&(n._ver=1),n&&function(e){return"object"==typeof e}(n)){var c=i(this.calcNormalStageTime(n),this.calcKeyStageTime(n));for(var l in c)if(void 0===c[l]||null===c[l]||c[l] <0||c[l]>6e4)return void this.reporter.print(l+" 指标无效或超过临界值,本次性能数据丢弃");var u=i(c,this.calcExtData(n,e),{category:t.PERF,sampleRate:this.sampleRate,pluginVer:this.pluginVer});this.opts.manual&&this.reporter.__customPerfCache__&&(u=i(u,this.reporter.__customPerfCache__),this.reporter.__customPerfCache__=null),this.webVitals.oldPerf=u,this._reportPerfLog(),(this.opts.collectResTiming||s()||a.indexOf("ucbrowser/")>-1)&&!this.reporter._hasCollectResTiming&&this._handleBadPerfTiming(u)}else this.reporter.print("没有timing对象,本次不采集性能数据")}},p._reportPerfLog=function(e){if(void 0===e&&(e=!1),this.webVitals.oldPerf)if(e||this._hadCollectedWebVitals()){var t=i(this.webVitals.oldPerf,this._getWebVitals());if(a.indexOf("quarkpc/")>-1)t.w_bv=this._qkPCFirstWebPage;else if(s()&&/(iphone|ipad|ipod|ios)/i.test(a)){var n;t.w_bv=(null==(n=window)||null==(n=n.__quark)?void 0:n.app_w_first_render)||0}this.reporter._hasReportPerfData=!0,this.reporter.report(i(this.webVitals.oldPerf,this._getWebVitals())),this.webVitals={}}else this.reporter.print("no lcp fcp yet");else this.reporter.print("no perf log yet")},p.calcNormalStageTime=function(e){return this.calculateInd(e,{w_unload:[1,2],w_redirect:[3,4],w_appcache:[5,6],w_dns:[6,7],w_tcp:[8,10],w_ssl:[9,10],w_ttfb:[5,12],w_n_rve:[5,13],w_contentdownload:[12,13],w_domparsing:[13,15],w_res:[17,19]})},p.calcKeyStageTime=function(e){return this.calculateInd(e,{w_firstbyte:[5,12],w_tti:[5,15],w_domready:[5,17],w_load:[5,19],w_total:[5,20]})},p.calculateInd=function(e,t){var n,r,i={},o=e._ver||1;for(var a in t){n=e[Q[t[a][0]]],r=e[Q[t[a][1]]],(2===o?n>=0:n>0)&&r>0&&(i[a]=parseFloat((r-n).toFixed(2)))}return i},p.calcExtData=function(e,t){var n,r=t.navigation||{},i=null,o=null,a=null;return 1===e._ver?n=X[r.type]||"other":2===e._ver&&(i=e.encodedBodySize,o=e.decodedBodySize,a=e.transferSize,n=e.type),{w_enbdsize:i,w_debdsize:o,w_transize:a,w_navtype:n}},p._handleBadPerfTiming=function(e){var n=0;e.w_load&&e.w_load>=(this.opts.minLoadTiming||3e3)&&e.w_load <=(this.opts.maxLoadTiming||8e3)?n=this.opts.minLoadSpr||.05:e.w_load&&e.w_load>(this.opts.maxLoadTiming||8e3)&&(n=this.opts.maxLoadSpr||1),n&&performance&&"function"==typeof performance.getEntriesByType&&(this.reporter.report({category:t.RESTIMING,sampleRate:n,bl1:JSON.stringify(performance.getEntriesByType("resource")),bl2:performance.timeOrigin||performance.timing.fetchStart,_forcePost:!0}),this.reporter._hasCollectResTiming=!0)},p._browserSupportsEnty=function(e){var t;return("first-input"!==e||"PerformanceEventTiming"in window)&&(("event"!==e||!self.PerformanceEventTiming||"interactionId"in PerformanceEventTiming.prototype)&&(null==(t=window.PerformanceObserver)||null==(t=t.supportedEntryTypes)?void 0:t.includes(e)))},u}(n);return Z.pluginId="iTracePerfPlugin",Z}(); var itraceFlowPlugin=function(){"use strict";function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t(e,n)}var e;(e={}).ZH="cn",e.QUARK="quark",e.INTL="intl",function(t){t[t.JSERR=1]="JSERR",t[t.API=2]="API",t[t.PERF=3]="PERF",t[t.RESERR=4]="RESERR",t[t.PVUV=5]="PVUV",t[t.BKPG=6]="BKPG",t[t.LONGTASK=8]="LONGTASK",t[t.INPD=15]="INPD",t[t.NODERES=16]="NODERES",t[t.PGERROR=17]="PGERROR",t[t.BLOCK=18]="BLOCK",t[t.PERFNEXT=1e3]="PERFNEXT",t[t.MAINDOC=1e5]="MAINDOC",t[t.RESTIMING=100001]="RESTIMING"}({}),function(t){t.JSERR="jserr",t.API="api",t.PERF="jsfsperf",t.RESERR="resloadfail",t.PVUV="flow",t.BKPG="bkpg",t.CUSTOM="jssdkidx",t.INPD="inputdelay",t.LONGTASK="longtask",t.NODERES="nodres",t.PGERROR="pgerror",t.BLOCK="h5block"}({});var n=function(t){t=t||{},this.id=t.id,this.sampleRate=t.sampleRate,this.forceEnable=t.forceEnable},o=window.history||{},i=window.document,r="historystatechange",a=function(t,e){var n;void 0!==window.CustomEvent?n=new CustomEvent(t,{detail:e}):((n=i.createEvent("HTMLEvents")).initEvent(t,!1,!0),n.detail=e),window.dispatchEvent(n)};function c(t){return"string"==typeof t?t.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""}function s(t){return(t?c(t.replace(/^#\/?/,"")):"")||"[index]"}function u(t,e,n,o){return t.addEventListener?t.addEventListener(e,(function i(r){o&&t.removeEventListener(e,i,!1),n.call(t,r)}),!1):t.attachEvent&&t.attachEvent("on"+e,(function i(r){o&&t.detachEvent("on"+e,i),n.call(t,r)})),this}function E(t,e,n){return n?(t.removeEventListener?t.removeEventListener(e,n):t.detachEvent&&t.detachEvent(e,n),this):this}function l(t){var e=o[t];"function"==typeof e&&(o[t]=function(t,n,i){var s=location.href,u=e.call(o,t,n,i);if("string"!=typeof i)return u;if(i===s)return u;try{var E=s.split("#"),l=i.split("#"),p=c(E[0]),d=c(l[0]),f=E[1]&&E[1].replace(/^\/?(.*)/,"$1"),R=l[1]&&l[1].replace(/^\/?(.*)/,"$1");p!==d?a(r,d):f!==R&&a(r,R)}catch(t){}return u},o[t].toString=t+"() { [native code] }")}var p=function(e){function n(t){return e.call(this,t)||this}return function(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,t(e,n)}(n,e),n.prototype.init=function(t){var e,n;t.immediatePV||t.reportFlow(),t.spa&&(e=function(){s(location.hash)&&(t.resetSession(),t.reportFlow(),a("wpkpgchange",void 0))},n=function(e){s(e.detail)&&(t.resetSession(),t.reportFlow(),a("wpkpgchange",void 0))},u(window,"hashchange",e),u(window,"historystatechange",n),l("pushState"),l("replaceState")),u(window,"beforeunload",(function(){E(window,"load"),E(window,"hashchange"),E(window,"historystatechange"),e=n=null}))},n}(n);return p.pluginId="iTraceFlowPlugin",p}(); var itraceBlankPlugin=function(){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t t?"e":-1!==["VIDEO","AUDIO","IMG","BUTTON","TEXTAREA","RADIO","CHECKBOX","SELECT","IFRAME","CANVAS","SVG"].indexOf(e.nodeName)||"none"!==r.backgroundImage?"v":"rgba(0, 0, 0, 0)"!==r.backgroundColor||"0px"!==r.borderWidth||"none"!==r.boxShadow?"ve":"oc"};var u=function(r){function o(e){var t;(t=r.call(this,e)||this).reporter=null,t.pluginVer="2.3.0";return t.opts=c({maxDepth:8,minElements:10,startCheckingTime:5e3},e),t}!function(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,t(e,r)}(o,r);var s=o.prototype;return s.init=function(e){var t,r,n,o=this,c=this;c.reporter=e;try{if(c.opts.ignorePageUrls&&a(c.opts.ignorePageUrls)&&c.opts.ignorePageUrls(location))return void c.reporter.print("current url is in ignore list, skip blank check");this.reporter.detectBlank=function(e){o._checkBlank(e)}}catch(e){this.reporter.print(e)}if(null!=(t=this.reporter._sdkEnv)&&t.iOSNBCheck)return function(e,t,r,n){var o;if("function"==typeof(null==(o=window)||null==(o=o.ucapi)?void 0:o.invoke)){var a=i({},t,{success:r,fail:n});window.ucapi.invoke(e,a)}else n&&n("ucapi is not exist")}("webMonitor.setConfig",{startCheckingTime:this.opts.startCheckingTime,frmId:this.reporter._frmId,sampleRate:this.opts.sampleRate,w_rel:this.reporter.rel,uid:this.reporter.uid}),void this.reporter.print("blank check will be performed by client");var s=null==(r=this.reporter._sdkEnv)?void 0:r.isPrerender;!function(e){var t;return void 0===e&&(e={}),e.isPrerender?"compass"===e.prerenderType?"object"==typeof(null==(t=window)?void 0:t.prerenderCommitEvent)&&"prerendercommit"===window.prerenderCommitEvent.type:e.hasPrerenderCommit:"complete"===document.readyState}(this.reporter._sdkEnv)?function(e,t){l(window,t?"wpkpageforeground":"load",(function(r){t&&"complete"!==document.readyState?l(window,"load",(function(t){e.call(null,t)}),!1,!0):e.call(null,r)}),!1,!0)}((function(){c._onloadBlankCheck()}),s):c._onloadBlankCheck(),null!=(n=this.opts.spaOption)&&n.enable&&l(window,"wpkpgchange",(function(){o.reporter.print("spa page change blank detect"),c._routeChangeBlankCheck()}))},s._onloadBlankCheck=function(){var e=this;this.onLoadDetectTimer=setTimeout((function(){try{e._checkBlank()}catch(t){e.reporter.print("bkpg checking oops: ",t)}e.onLoadDetectTimer=null}),e.opts.startCheckingTime)},s._routeChangeBlankCheck=function(){var t,r=this;this.onLoadDetectTimer&&(clearTimeout(this.onLoadDetectTimer),r.reporter.print("page changed cancel the blank detect after onload")),this.pageChangeDetectTimer&&clearTimeout(this.pageChangeDetectTimer),this.pageChangeDetectTimer=setTimeout((function(){try{var t,n=e({},r.opts);n.rootDom=(null==(t=n.spaOption)?void 0:t.rootDom)||n.rootDom,r._checkBlank(n)}catch(e){r.reporter.print("bkpg checking oops: ",e)}r.pageChangeDetectTimer=null}),(null==(t=r.opts.spaOption)?void 0:t.startCheckingTime)||3e3)},s._checkBlank=function(t){var r=this,o=t||r.opts,i=document.body;o.rootNode?i=o.rootNode:o.rootDom&&(i="function"==typeof o.rootDom?o.rootDom():o.rootDom);var c,l,s,u,d,h,f,E,g={deepestLayer:0,hasAtLeastOneVisibleNode:!1,total:0,invisible:0,visibleEmpty:0,occupy:0,domDSL:[]},m={},R=-1,v=Date.now();if(i){var k=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}(i.innerText);if(k)c=o.minTextLength||0,l=k,c&&c>0&&l&&c>l.split("").length?R=105:function(e,t){return function(e,t){for(var r,n=0,o=e.length;n h.deepestLayer&&(h.deepestLayer=t);r.length&&f;){var o=r.shift();h.total++;var i=p(o,n);if(h.domDSL.push({tag:o.tagName,layer:t,cls:o.className,isEmpty:"e"===i||"oc"===i}),"e"!==i){if("v"===i){h.hasAtLeastOneVisibleNode=!0,f=!1;break}if("ve"===i&&(h.visibleEmpty++,d&&h.visibleEmpty>d)){f=!1;break}"oc"===i&&h.occupy++,t <=u&&o.children.length&&E(o.children,t+1)}else h.invisible++}},(h={deepestLayer:0,hasAtLeastOneVisibleNode:!1,total:0,invisible:0,visibleEmpty:0,occupy:0,domDSL:[]}).deepestLayer=1,E(s,1),!(g=h).hasAtLeastOneVisibleNode&&g.visibleEmpty<(o.minElements||4)&&(R=101,m={wl_ven:g.visibleEmpty,wl_ocn:g.occupy})}}else R=103;var O=Date.now()-v;r.reporter.print( "节点总数:"+g.total+ ", 最大层深:"+g.deepestLayer+ ", 耗时:"+O);var b={w_fp:-1};if(R>=0){r.reporter.print("检测到白屏,白屏类型:"+R),b=e({w_fp:R,w_dsl:JSON.stringify(g.domDSL),w_depth:g.deepestLayer,w_domcnt:g.total,wl_dcost:O},m),r.sendData(b);var P=document.documentElement.innerHTML||"";P.length <=1e5&&r.reporter.report({category:n.MAINDOC,sampleRate:1,bl1:P,_forcePost:!0}),r.reporter._hasCollectResTiming||(r.reporter.report({category:n.RESTIMING,bl1:JSON.stringify(performance.getEntriesByType( "resource")),bl2:performance.timeOrigin||performance.timing.fetchStart,_forcePost:!0}),r.reporter._hasCollectResTiming=!0)}try{o.callback&&a(o.callback)&&o.callback(b)}catch(e){this.reporter.print( "blank callback error",e)}},s.sendData=function(e){c(e,{category:n.BKPG,sampleRate:this.sampleRate,pluginVer:this.pluginVer}),this.reporter.report(e)},o}(o);return u.pluginId="iTraceBlankPlugin" ,u}(); var itraceResourcePlugin=function(){ "use strict";function e(t,r){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e(t,r)}var t;(t={}).ZH="cn" ,t.QUARK="quark" ,t.INTL="intl" ;var r=function(e){return e[e.JSERR=1]="JSERR" ,e[e.API=2]="API" ,e[e.PERF=3]="PERF" ,e[e.RESERR=4]="RESERR" ,e[e.PVUV=5]="PVUV" ,e[e.BKPG=6]="BKPG" ,e[e.LONGTASK=8]="LONGTASK" ,e[e.INPD=15]="INPD" ,e[e.NODERES=16]="NODERES" ,e[e.PGERROR=17]="PGERROR" ,e[e.BLOCK=18]="BLOCK" ,e[e.PERFNEXT=1e3]="PERFNEXT" ,e[e.MAINDOC=1e5]="MAINDOC" ,e[e.RESTIMING=100001]="RESTIMING" ,e}({});!function(e){e.JSERR="jserr" ,e.API="api" ,e.PERF="jsfsperf" ,e.RESERR="resloadfail" ,e.PVUV="flow" ,e.BKPG="bkpg" ,e.CUSTOM="jssdkidx" ,e.INPD="inputdelay" ,e.LONGTASK="longtask" ,e.NODERES="nodres" ,e.PGERROR="pgerror" ,e.BLOCK="h5block" }({});var n=function(e){e=e||{},this.id=e.id,this.sampleRate=e.sampleRate,this.forceEnable=e.forceEnable};!function(e){e.ZH="cn" ,e.QUARK="quark" ,e.INTL="intl" }({}),function(e){e[e.JSERR=1]="JSERR" ,e[e.API=2]="API" ,e[e.PERF=3]="PERF" ,e[e.RESERR=4]="RESERR" ,e[e.PVUV=5]="PVUV" ,e[e.BKPG=6]="BKPG" ,e[e.LONGTASK=8]="LONGTASK" ,e[e.INPD=15]="INPD" ,e[e.NODERES=16]="NODERES" ,e[e.PGERROR=17]="PGERROR" ,e[e.BLOCK=18]="BLOCK" ,e[e.PERFNEXT=1e3]="PERFNEXT" ,e[e.MAINDOC=1e5]="MAINDOC" ,e[e.RESTIMING=100001]="RESTIMING" }({}),function(e){e.JSERR="jserr" ,e.API="api" ,e.PERF="jsfsperf" ,e.RESERR="resloadfail" ,e.PVUV="flow" ,e.BKPG="bkpg" ,e.CUSTOM="jssdkidx" ,e.INPD="inputdelay" ,e.LONGTASK="longtask" ,e.NODERES="nodres" ,e.PGERROR="pgerror" ,e.BLOCK="h5block" }({}), "undefined"!=typeof navigator&&(navigator.userAgent|| "").toLowerCase();var a=function(t){function n(e){var r;return(r=t.call(this,e)||this).reporter=null,r.pluginVer="2.0.4" ,r}!function(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,e(t,r)}(n,t);var a=n.prototype;return a.init=function(e){this.listenResourceError(),this.reporter=e},a.getDomPath=function(e,t){var r=e.id? "#"+e.id: "",n="" ;e.className&& "string"==typeof e.className&&(n="." +e.className.split( " ").join( "."));var a=e.tagName.toLowerCase();return e.parentNode&&e.parentNode.tagName&&t-1!=0?this.getDomPath(e.parentNode,t-1)+ " > "+a.toLowerCase()+r+n:a+r+n},a.tagNameToType=function(e){var t=-1;switch(e.tagName.toLowerCase()){case "img":t=1;break;case "link":e.rel&& "stylesheet"===e.rel.toLowerCase()&&(t=2);break;case "script":t=3;break;case "video":t=11}return t},a.listenResourceError=function(){var e=this;!function(e,t,r,n,a){void 0===n&&(n=!1),void 0===a&&(a=!1),e.addEventListener?e.addEventListener(t,(function o(i){a&&e.removeEventListener(t,o,n),r.call(this,i)}),n):e.attachEvent&&e.attachEvent( "on"+t,(function o(i){a&&e.detachEvent(t,o,n),r.call(this,i)}))}(window, "error",(function(t){if(!function(e){var t=e.target;return!(t&&t.tagName)||e.message||e.filename||e.lineno||e.colno}(t)){var n=t.target.src||t.target.href;n===window.location.href&&(n="empty src" );var a,o=e.tagNameToType(t.target);11===o&&t.target.error&&(a=t.target.error.code);var i={msg:n+ " 加载失败",w_res:n,w_type:o,w_err:a,w_xpath:e.getDomPath(t.target,5),category:r.RESERR,sampleRate:e.sampleRate,pluginVer:e.pluginVer};e.reporter.report(i)}}),!0,!1)},n}(n);return a.pluginId="iTraceResourcePlugin" ,a}(); var itraceNext=function(t){ "use strict";function e(t,r){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,r)}var r=function(t){return t.ZH="cn" ,t.QUARK="quark" ,t.INTL="intl" ,t}({});!function(t){t[t.JSERR=1]="JSERR" ,t[t.API=2]="API" ,t[t.PERF=3]="PERF" ,t[t.RESERR=4]="RESERR" ,t[t.PVUV=5]="PVUV" ,t[t.BKPG=6]="BKPG" ,t[t.LONGTASK=8]="LONGTASK" ,t[t.INPD=15]="INPD" ,t[t.NODERES=16]="NODERES" ,t[t.PGERROR=17]="PGERROR" ,t[t.BLOCK=18]="BLOCK" ,t[t.PERFNEXT=1e3]="PERFNEXT" ,t[t.MAINDOC=1e5]="MAINDOC" ,t[t.RESTIMING=100001]="RESTIMING" }({});var n=function(t){return t.JSERR="jserr" ,t.API="api" ,t.PERF="jsfsperf" ,t.RESERR="resloadfail" ,t.PVUV="flow" ,t.BKPG="bkpg" ,t.CUSTOM="jssdkidx" ,t.INPD="inputdelay" ,t.LONGTASK="longtask" ,t.NODERES="nodres" ,t.PGERROR="pgerror" ,t.BLOCK="h5block" ,t}({});function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e1?r-1:0),i=1;i =1||"100%"===t||(/^\d+(\.\d+)?%$/.test(t)?Math.random() 0&&t <1&&Math.random()-1}function b(){return m.indexOf("quarkpc/")>-1}function R(t,e,r,n){var o;if("function"==typeof(null==(o=window)||null==(o=o.ucapi)?void 0:o.invoke)){var s=i({},e,{success:r,fail:n});window.ucapi.invoke(t,s)}else n&&n("ucapi is not exist")}var E=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},k=function(t){if(!t)return 0;try{return"function"==typeof TextEncoder?(new TextEncoder).encode(t).length:function(t){for(var e=0,r=0,n=t.length;r 0},e.pushPreLog=function(t){this.preLogList.push(t)},e.hasPreLog=function(){return this.preLogList&&this.preLogList.length>0},e.setPreLogList=function(t){void 0===t&&(t=[]),this.preLogList=this.preLogList.concat(t)},e.clearLogList=function(){this.logList=[]},t}(),L=function(t){return t.ZH="cn",t.QUARK="quark",t.INTL="intl",t}({}),x=function(){function t(){}return t.getAddr=function(e,r){return r?""+r+t.uploadPath:""+t.hosts[e.valueOf()]+t.uploadPath},t.getConfAddr=function(e,r){return r?""+r+t.jconfigPath:""+t.hosts[e.valueOf()]+t.jconfigPath},t.getHosts=function(e){return t.hosts[e]},t}();x.hosts={cn:"https://px.effirst.com",intl:"https://px-intl.ucweb.com",quark:"https://px.wpk.quark.cn",er:"https://erpx.effirst.com"},x.uploadPath="/api/v1/jssdk/upload",x.jconfigPath="/api/v1/jconfig";var I=function(t){return t[t.JSERR=1]="JSERR",t[t.API=2]="API",t[t.PERF=3]="PERF",t[t.RESERR=4]="RESERR",t[t.PVUV=5]="PVUV",t[t.BKPG=6]="BKPG",t[t.LONGTASK=8]="LONGTASK",t[t.INPD=15]="INPD",t[t.NODERES=16]="NODERES",t[t.PGERROR=17]="PGERROR",t[t.BLOCK=18]="BLOCK",t[t.PERFNEXT=1e3]="PERFNEXT",t[t.MAINDOC=1e5]="MAINDOC",t[t.RESTIMING=100001]="RESTIMING",t}({});function O(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return C(t,e);var r={}.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)?C(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r n;return!0}function V(){var t=[],e=function(){for(var t=navigator.userAgent.split(" "),e=0;e -1)return t[e].split("/")[1]}();return e&&(G(e,"1.0.0.0")&&t.push.apply(t,["flow","blank"]),G(e,"2.0.0.0")&&t.push.apply(t,["perf","jserror"])),t}function K(t){try{if(s(window)&&window.hasOwnProperty("ucweb")&&window.ucweb.window||s(t)){for(var e=(t||B.userAgent).split(" "),r=e.length,n=!1,i=0;i -1||w()}}catch(t){console.error(t)}return!1}var J=function(){var t,e;return 3===(null==(t=window.ucweb)||null==(t=t.window)||null==(t=t.performance)?void 0:t.pt)||(null==(e=window.compass)||null==(e=e.env)?void 0:e.isPrerender)};function F(t){try{var e="__wpktestingls__";return t().setItem(e,e),t().removeItem(e),!0}catch(t){return!1}}function H(){return localStorage}var Q={get:function(t){if(F(H)){var e=H().getItem(t);if(e){if(e=JSON.parse(e),Date.now() parseInt(n[0])||!(parseInt(r[1]) parseInt(n[1])||parseInt(r[2])>=parseInt(n[2])))}};function W(t,e,r,n){var i="itracereporter:dynamicConf:"+t,o=Q.get(i);if(o)d(n)&&n(o);else{var s=l({app:t,tm:f(!0),ud:a(),sver:e,sign:"c41e43c828c16c16a6eb1c9c1e68e8ce"});!function(t,e){if("undefined"==typeof XMLHttpRequest)e();else{var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){var t;if(200===r.status&&r.response)try{var n=JSON.parse(r.response);0===n.code&&(t=n.config||[])}catch(t){}e(t)}};try{r.open("GET",t,!0),r.timeout=3e3,r.send()}catch(t){}}}(r+"?wpk-header="+encodeURIComponent(s),(function(t){if(o={},void 0!==t){for(var r=t.length,s=0;s -1}return N}()?"renderer":void 0,i=null==(t=A.__itracecfg__)?void 0:t.wv_traceid,o=B.deviceMemory||-1;return{w_url:(T.origin?T.origin:T.protocol+"//"+T.host)+T.pathname,w_query:T.search,w_ref:T.hash.substring(1),w_title:j.title,ua:B.userAgent,referrer:e,dsp_dpi:U||1,dsp_w:A.screen.width,dsp_h:A.screen.height,w_wv_traceid:i,wk_proc_type:n,wl_devmem:o,net:(r=B.connection,r&&r.type?"none"===r.type?"disconnected":"cellular"===r.type?"slow-2g"===r.effectiveType?"2g":r.effectiveType:r.type:"")}}var it=function(t,e,r){if("function"==typeof XMLHttpRequest){var n=new XMLHttpRequest;n.open("POST",e,!0),n.setRequestHeader("Content-Type","text/plain"),n.timeout=5e3,n.send(r)}else t.print("xhr is not supported")},ot=function(t,e){R("webMonitor.reportWpkLog",e,(function(e){t.print("report success by jsapi",e)}),(function(e){t.print("report failed by jsapi",e)}))};function st(){return B&&!!B.sendBeacon&&A.Blob}var at=function(t){try{return 1===((null==A?void 0:A.nativeWpkReport)||{})[t]}catch(t){return!1}};function ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ut(t,e);var r={}.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)?ut(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r 0)try{rt(this,this.plugins)}catch(t){this._reportToSelf(t,{c1:"插件初始化异常"})}},n._normalizeLog=function(t){var e=t.uid||this.uid||this._wid,r=t.rel||this.rel,n=nt(),i=p(t.category),o=g({uid:e,utdid:t.utdid||this.utdid,wid:this._wid,type:i,category:t.category,w_cnt:1,w_rel:r,w_bid:t.bid||this.bid,w_cid:t.cid||this.cid||void 0,w_spa:this.spa,w_frmid:this._frmId,w_tm:f(),log_src:this.logSrc,sdk_ver:this.sdkVer,uc_param:this.uc_param},n,t),s=this._genReportUrl(o,!0);return o._url=s,o._hash=function(t){var e="";switch(t.category){case 1:e=[t.category,t.uid,t.w_url,t.w_ref,t.w_msg||"",t.w_line||"",t.w_col||""].join("");break;case 2:e=[t.category,t.uid,t.w_res,t.w_method,t.w_rc].join("");break;case 4:e=[t.category,t.uid,t.w_url,t.w_ref,t.w_res,t.w_type].join("")}return e}(o),o},n._genReportUrl=function(t,e){var r={app:t.w_bid||this.bid,cp:"none",de:e?4:1,seq:""+Math.floor(+new Date/1e3)+Math.floor(1e4*Math.random()),tm:f(!0),ud:encodeURIComponent(t.uid||this.uid||this._wid),ver:t.rel||this.rel,type:t.type||p(t.category),sver:this.sdkVer,sign:"9bf8a190ef82c5049df7b199c599c45b"};return x.getAddr(this.cluster,this.gateway)+"?wpk-header="+encodeURIComponent(l(r))+(this.uc_param_str&&!this.uc_param?"&uc_param_str="+this.uc_param_str:"")},n.send=function(t,e,r){if(r)it(this,t,e);else if(s(e)){navigator.sendBeacon(t,e)||(this.print("beacon send fail, retry by xhr"),it(this,t,e))}else this._sdkEnv.supportBeacon?navigator.sendBeacon(t):(n=t,i="itraceimgreporter_"+f()+".r"+Math.floor(1e3*Math.random()),(o=A[i]=new Image).onload=o.onerror=function(){A[i]=null},o.src=n);var n,i,o;this.print("log is sent: ",t)},n.setReady=function(){var e=this;t.prototype.setReady.call(this),v((function(){e._sendQueuingLogs()}),0)},n._updateSpecialFields=function(t){return t._dirty?g(t,{w_bid:this.bid,w_cid:this.cid,w_rel:this.rel,uid:this.uid,utdid:this.utdid}):t},n._sendQueuingLogs=function(){if(this._logq.hasLog()){var t=this._logq.takeLogList(),e=t.length;if(this._sdkEnv.sendByJsapi)for(var r=0;r 6e4?(this.send(this._genReportUrl(l,!1),h,!0),this.print("single log oversize 60k, send by xhr")):((p+=g)>6e4&&(this.send(this._genReportUrl(l,!1),u.join("\n")),this.print("group log length is "+p+" oversize 60k, send now"),u.splice(0,u.length),p=g),u.push(h))}u.length>0&&this.send(d,u.join("\n"))}catch(t){this.print(t)}}else for(var v=0;v 7500)?(m=this._genReportUrl(y,!1),this.send(m,b,w)):(m+="&data="+encodeURIComponent(b),this.send(m))}catch(t){this.print(t)}}}else this.print("logq is empty.")},n._handlePreReporting=function(){var t=window.__iTraceLogQueue;if(u(t)&&t.length>0&&(this._logq.setPreLogList(t),window.__iTraceLogQueue=[],this.print("preLogList is updated")),this._logq.hasPreLog()){this.print("handling logq for pre-reporting");for(var e=this._logq.getPreLogList();e.length;){var r=e.shift(),n=null==r?void 0:r.shift();d(this[n])&&(this[n].apply(this,r),this.print(n+" is called by pre-reporting."))}}},n.resetSession=function(){var t;this._sid=(t=a(),F(X)&&X().setItem("wpkreporter:frmid",t),t),this._begin=Date.now(),this._frmId=this._sid},n._useU4Monitor=function(){return!this.ignoreU4HA&&(K()||b())&&function(t){if(s(document)&&document.getElementsByTagName)for(var e=document.getElementsByTagName("meta"),r=e.length,n=0;n =this.maxSessDuration&&this.resetSession();try{var n=this._normalizeLog(t);if(this._dyConf&&Date.now() =18e5&&(this.print("syncing dynamic config"),this._syncDyConf());if(this._handlePreReporting(),d(this.beforeSend))try{if(!1===this.beforeSend(n))return this.print("the beforeSend hook rejects this log"),this}catch(t){this.print("beforeSend hook error",t)}n.category===I.JSERR&&delete n.error;var a=this.isReady();if(n._dirty=!a,!this._logq.pushLog(n))return this.print("log merged: ",n),this;if(a)v((function(){e._sendQueuingLogs()}),!n._reportNow&&this.delay&&-1!==[1,2,4,8,15,18].indexOf(n.category||0)?1e3:-1);else this.print("sdk is not ready, you should call setReady to trigger reporting.")}catch(e){this.print("report failed: ",t,e),this._reportToSelf(e)}return this},n.reportFlow=function(t){var e=t||{};return e.category=I.PVUV,this.report(e),this},n.reportJSError=function(t,e){return!function(t){var e={}.toString.call(t);return("[object Error]"===e||"[object Exception]"===e||"[object DOMException]"===e||e instanceof Error)&&c(t)}(t)?this.print("the input is not a real JSError"):((e=e||{}).category=I.JSERR,e.w_msg=t.toString(),e.stack=function(t){if(t.stack){var e=t.stack.split("\n");return e.shift(),e.join("\n")}return""}(t),e.w_file=t.filename||"",e.w_line=t.lineno,e.w_col=t.colno,this.report(e)),this},n.reportApi=function(t){if(t){c(t.queryString)&&(t.queryString=l(t.queryString));var e=g(t,{category:I.API,w_type:16,w_res:t.url,w_method:t.method,w_param:t.queryString,w_body:"object"==typeof t.body?JSON.stringify(t.body):t.body,w_resp:t.response,w_rc:t.status,w_rt:t.spent||0},{url:void 0,queryString:void 0,response:void 0,body:void 0,status:void 0,spent:void 0});this.report(e)}return this},n.reportBlankPage=function(t){var e=t||{};return E(t,"w_fp")||(e=g(t,{w_fp:999})),e=g(e,{category:I.BKPG}),this.report(e),this},n.reportPerf=function(t){return this._hasReportPerfData?(this.print("do not repeat report performance data"),this):(this.print("manual report performance data"),this.__customPerfCache__=t,this)},n.detectBlank=function(t){return this.print("need itrace-blank plugin"),this},n.detectBlock=function(t,e){return this.print("need itrace-fluency plugin"),this},n._syncDyConf=function(){var t=x.getConfAddr(this.cluster,this.gateway),e=this;e._dyStart=Date.now(),e._dying=!0,W(e.bid,e.sdkVer,t,(function(t){e._dying=!1,e._dyConf=t,e.print("jconfig come back")}))},n._reportToSelf=function(t,e){void 0===e&&(e={});this.reportJSError(t,g({bid:"itrace-next"},e))},r}(S),pt=window;function ft(t){var e=t||pt[M]||{},r=new dt(e);return r.init(),r}return pt[M]&&c(pt[M])&&!s(pt[D])&&(pt[D]=new dt(pt[M]),pt[D].init()),pt.__getItraceInstance||(pt.__getItraceInstance=ft),t.getItraceInstance=ft,t.getItraceSingleton=function(t){if(pt[D])return pt[D];var e=t||pt[M]||{};return pt[D]=new dt(e),pt[D].init(),pt[D]},t.iTraceReporter=dt,Object.defineProperty(t,"__esModule",{value:!0}),t}({});