window.AlipayH5Performance||function(){var a,b,c,d,e;navigator.userAgent.indexOf(" AlipayClient/")<0||(a=null,b=[],d={init:function(){this.init=null,this.renderIframe(),this.monitorDOMReady(),this.monitorPageLoad(),this.monitorJSErrors(),this.monitorDNSTime(),this.monitorCacheRate()},monitorDOMReady:function(){var a=this;"complete"===document.readyState?(b.push({name:"domReady",value:(new Date).getTime(),extra:"completed"}),a.sendSignal()):document.addEventListener("DOMContentLoaded",function(c){b.push({name:"domReady",value:c.timeStamp?c.timeStamp:(new Date).getTime(),extra:"complete"}),a.sendSignal()},!0)},monitorPageLoad:function(){var a=this;window.addEventListener("load",function(c){b.push({name:"pageLoad",value:c.timeStamp?c.timeStamp:(new Date).getTime(),extra:"load"}),a.sendSignal()},!0)},monitorJSErrors:function(){var a=this;window.addEventListener("error",function(c){b.push({name:"jsErrors",value:c.message,filename:c.filename,lineno:c.lineno}),a.sendSignal()},!0)},monitorDNSTime:function(){var a=this;window.addEventListener("load",function(){window.performance&&window.performance.timing?b.push({name:"dns",value:window.performance.timing.domainLookupEnd-window.performance.timing.domainLookupStart,extra:"support"}):b.push({name:"dns",value:"",extra:"notsupport"}),a.sendSignal()},!0)},monitorCacheRate:function(){var d,a=this,c={name:"cacheRate"};window.addEventListener("load",function(){var f,g;if(window.performance&&"function"==typeof window.performance.getEntriesByType&&(d=window.performance.getEntriesByType("resource"))){if(d.length>0){for(f=0,g=0;g<d.length;g++)0===d[g].duration&&f++;c.value=(f/d.length).toFixed(4)}else c.value=0;c.extra="support"}else c.value="",c.extra="notsupport";b.push(c),a.sendSignal()},!0)},sendSignal:function(){clearTimeout(c),c=setTimeout(function(){a.src="alipaymonitor://dispatch_monitor_message"},500)},renderIframe:function(){if(!a)try{a=document.createElement("iframe"),a.id="__AlipayH5PerformanceIframe",a.style.display="none",document.documentElement.appendChild(a)}catch(b){}}},d.init(),e={fetchMessageQueue:function(){var a=JSON.stringify(b);return b=[],a}},window.AlipayH5Performance=e)}();