Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apm-insight-web/rangers-site-sdk

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apm-insight-web/rangers-site-sdk - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

cn/browser.0.2.6.cn.js

2

cn/browser.cn.js

@@ -1,1 +0,1 @@

var RangersSiteSDK=function(){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function t(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function v(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function h(t){return"object"==typeof t&&null!==t&&!l(t)}function o(t){return"[object Object]"===(e=t,Object.prototype.toString.call(e));var e}function m(t){return"function"==typeof t}function y(t){return"[object String]"===Object.prototype.toString.call(t)}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(t,e){if(h(t))for(var n in t)p(t,n)&&e.call(null,n,t[n])}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n={},r=0;r<t.length;)n=function t(e,n){var r=f({},e);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&void 0!==n[o]&&(h(e[o])&&h(n[o])?r[o]=t(e[o],n[o]):!h(e[o])&&h(n[o])?r[o]=t({},n[o]):r[o]=n[o]);return r}(n,t[r]),r++;return n}function s(t,e){if(!l(t))return!1;if(0===t.length)return!1;for(var n=0;n<t.length;){if(t[n]===e)return!0;n++}return!1}function e(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(t){return}}function u(){return!!h(window)}function n(){return!(!u()||!h(window.performance))}function c(){return!(!n()||!h(window.performance.timing))}function w(){return!!n()&&!!m(window.performance.getEntries)}function S(){return u()&&"function"==typeof window.MutationObserver}function P(){return u()&&"function"==typeof window.PerformanceObserver}function M(){return!!P()&&m(window.PerformanceLongTaskTiming)}function E(){if(!P())return!1;var t=window.PerformanceObserverEntryList;return m(t)&&m(t.prototype.getEntries)}function T(t){var n,e=function(t){if(!h(t))return{};var n={};return i(t,function(t,e){h(e)||l(e)?n[t]=JSON.stringify(e):n[t]=e}),n}(t),r=(n={},i(e,function(t,e){n[encodeURIComponent(t)]=encodeURIComponent(e)}),n),o=[];return i(r,function(t,e){o.push(t+"="+e)}),o.join("&")}function k(t){var e=document.createElement("a");e.href=t;var n=e.pathname||"/";return"/"!==n[0]&&(n="/"+n),{href:e.href,protocol:e.protocol.slice(0,-1),hostname:e.hostname,host:e.host,search:e.search,pathname:n,hash:e.hash}}var _=function(t){if(!y(t))return!1;var e=t;return m(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function R(){}function x(t){var e="[object String]"===Object.prototype.toString.call(t);return t?e?t.length:ArrayBuffer&&t instanceof ArrayBuffer?t.byteLength:window.Blob&&t instanceof Blob?t.size:t.length?t.length:0:0}function L(t){if(!t)return"";if(!m(t.forEach))return"";var r=[];return t.forEach(function(t){var e,n;l(t)&&t[0]&&!_(t[0])&&(e=t[0],n=t[1]||"",r.push(e+": "+n))}),r.join("\r\n")}function C(t){var e={},n=k(t);return e.ax_protocol=n.protocol,e.ax_domain=n.hostname,e.ax_path=n.pathname,e.ax_url=(n.href||t).split("?")[0],e}function H(t,e){var n=k(t),r=k(e);return n.protocol===r.protocol&&n.host===r.host}function O(t){return l(t)&&t.length?function(t){for(var e=[],n=t.length,r=0;r<n;r++){var o=t[r];y(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(t):null}function q(e,n){m(e)&&(m(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),m(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){m(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var j=function(t){var e,n;return void 0===t&&(t=window),u()&&null!==(e=t.screen)&&void 0!==e&&e.width&&null!==(n=t.screen)&&void 0!==n&&n.height?t.screen.width+"x"+t.screen.height:"0x0"},I=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function A(t){return!!t&&Math.random()<Number(t)}var F=(D.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:R,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:R,s=new XMLHttpRequest;s.open("POST",t,!0),s.setRequestHeader("Content-Type","application/json"),s.send(JSON.stringify(e)),s.onload=function(){try{var t;this.responseText?(t=JSON.parse(this.responseText),i(t)):i({})}catch(t){a()}},s.onerror=function(){a()},s.onabort=function(){a()}},D.get=function(t,e){var n,r,o,i,a=null!==(n=null==e?void 0:e.success)&&void 0!==n?n:R,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:R,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:R,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:R,l=new XMLHttpRequest;l.open("GET",t),l.send(),l.onload=function(){u(null==this?void 0:this.response),c(this.responseText);try{var t;this.responseText?(t=JSON.parse(this.responseText),a(t)):a({})}catch(t){s()}},l.onerror=function(){s()},l.onabort=function(){s()}},D.prototype.getCommonParams=function(){return{timestamp:Date.now()}},D);function D(t){var r=this;this.postEvent=function(t){var e=f(f({},t),r.getCommonParams());D.post(r.url,e)},this.getEvent=function(t){var e=T(f(f({},t),r.getCommonParams())),n=r.url+"?"+e;D.get(n)},this.getURL=function(){return r.url},this.options=t,this.url=this.options.reportURL}function B(t,e,n){if(void 0===n&&(n="0"),1<n.length)throw new TypeError("expect the length of pad to be 1, but got "+t.length);return t.length>=e?t:""+Array.from({length:e-t.length}).fill(n).join("")+t}function N(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var U="x-tt-trace-id",J="x-tt-trace-host",X="x-tt-logid";function V(t,e,n){void 0===n&&(n="01");var r=""+B((Date.now()%4294967295).toString(16),8)+function(t){var e;if("number"==typeof t)e=t;else{var n=t.replace(/-/g,"");if(!/^[0-9]+$/.test(n)){if(18<n.length)return"18"+N(18);var r=22-n.length-4;return""+B(""+n.length,2)+n+N(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+B(""+o.length,2)+o+N(i)}(t)+("string"==typeof e?N(4):B(e.toString(16),4));return"00-"+r+"-"+r.substr(0,16)+"-"+n}function Q(){var t=function(){for(var t=new Array(16),e=0,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;return t}();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(t){for(var e=[],n=0;n<256;++n)e[n]=(n+256).toString(16).substr(1);var r=0;return[e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],e[t[15]]].join("")}(t)}var z=.1,K=.1,W=["/log/sentry/"],G=8e3,$=4e3;Q(),Q();var Y="AjaxMonitor",Z=(tt.prototype.setup=function(t){void 0===t&&(t=R),m(XMLHttpRequest)&&(this.callback=t,this.start())},tt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},tt.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},tt.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||R;XMLHttpRequest.prototype.setRequestHeader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(t),n.apply(this,t)}},tt.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];return this._url=r||"",this._method=(null==n?void 0:n.toLowerCase())||"",o.apply(this,t)}},tt.prototype.hookXMLHttpRequestSend=function(){var a=this,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var t,e,n,r,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return a.checkAddTrace(this._url)&&(n=(e=null!==(t=null==a?void 0:a.props.commonParams)&&void 0!==t?t:{}).bid,r=e.web_id,n&&r&&(a.traceId=V(r,n),this.setRequestHeader(U,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},tt.prototype.checkAddTrace=function(t){var e,n,r=null!==(e=this.props.commonParams)&&void 0!==e?e:{},o=r.bid,i=r.web_id,a=(null!==(n=this.props.ajaxMonitorOptions)&&void 0!==n?n:{}).sampleHitTrace,s=H(location.href,t);return o&&i&&a&&s},tt.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},tt.prototype.hookXMLHttpRequestOnreadystatechange=function(l){var p=this.onreadystatechange,d=this;this.onreadystatechange=function(){for(var t,e,n,r,o,i,a,s,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];if(4===this.readyState&&(a={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:d._method,ax_request_header:L(d._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(a.ax_response_header=function(e){if(y(e)){var t=e.split("\r\n"),r=[];return t.forEach(function(t,e){var n;t&&m(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),L(r)}return h(e)?L(Object.keys(e).map(function(t){return[t,e[t]]})):e}(this.getAllResponseHeaders())),!l.checkAddTrace(d._url)||(s=null!==(t=l.traceId)&&void 0!==t?t:this.getResponseHeader(U))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(J))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(X))&&void 0!==n?n:void 0),a.ax_duration=Date.now()-d._start,200===this.status&&(a.ax_size=function(t){var e=0;if(""===t.responseType||"text"===t.responseType)e=x(t.responseText);else if(t.response)e=x(t.response);else try{e=x(t.responseText)}catch(t){e=0}return e}(this)),a=f(f({},a),C(d._url)),l.collectErrorRequest()&&"2"!==a.ax_status[0]&&"3"!==a.ax_status[0]&&(a.ax_request={body:d._data?""+d._data:void 0,search:null===(r=k(d._url))||void 0===r?void 0:r.search,content_type:null===(i=null===(o=d._requestHeaders)||void 0===o?void 0:o.find(function(t){return"content-type"===t[0].toLowerCase()}))||void 0===i?void 0:i[1]}),m(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},tt.monitorName=Y,tt);function tt(t){this.name=Y,this.callback=R,this.traceId=null,this.props=t}function et(t){return t instanceof Request}var nt="FetchMonitor",rt=(ot.prototype.updateConfig=function(t){this.props=b({},this.props,t)},ot.prototype.setup=function(t){void 0===t&&(t=R),e()&&(this.callback=t,this.start())},ot.prototype.start=function(){e()&&this.hookFetch()},ot.prototype.checkAddTrace=function(t){var e,n,r,o,i=null!==(n=null===(e=this.props)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{},a=i.bid,s=i.web_id,u=(null!==(o=null===(r=null==this?void 0:this.props)||void 0===r?void 0:r.ajaxMonitorOptions)&&void 0!==o?o:{}).sampleHitTrace,c=H(location.href,t);return a&&s&&u&&c},ot.prototype.updateAxRequest=function(t,e,n){var r,o,i,a;this.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(a=this.getFetchUrl(e,!0),t.ax_request={body:null===(r=this.getFetchBody(e,n))||void 0===r?void 0:r.toString(),search:!y(a)||null===(o=k(a))||void 0===o?void 0:o.search,content_type:null===(i=null==n?void 0:n.headers)||void 0===i?void 0:i["Content-Type"]})},ot.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},ot.prototype.hookFetch=function(){var c=this,l=this,p=window.fetch;window.fetch=function(o,i){var t;void 0===i&&(i={});var a=c.getFetchUrl(o);if(!function(t){if(y(t)){var e=d(t.split(":"),2),n=e[0];return!e[1]||("http"===n||"https"===n)}}(a))return p(o,i);var e=null!==(t=c.props.commonParams)&&void 0!==t?t:{},n=e.bid,r=e.web_id,s=Date.now(),u={ev_type:"ajax"};try{l.checkAddTrace(a)&&(i.headers=new Headers(function(t,e){var n=new Headers;et(t)&&t.headers&&m(t.headers.forEach)&&t.headers.forEach(function(t,e){n.append(e,t)});{e.headers&&new Headers(e.headers).forEach(function(t,e){n.append(e,t)})}return n}(o,i)),n&&r&&(u.trace_id=V(n,r),i.headers.append(U,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),C(a)),p(o,i).then(function(t){var e,n,r;return u.ax_status=(t.status||0).toString(),u.ax_duration=Date.now()-s,u.ax_response_header=l.getAllHeaders(t.headers),u.ax_request_header=l.getAllHeaders(i.headers),t.headers&&m(t.headers.has)?(t.headers.has("content-length")?u.ax_size=Number(t.headers.get("content-length"))||0:u.ax_size=0,l.checkAddTrace(a)&&(t.headers.has(J)&&(u.trace_host=null!==(e=t.headers.get(J))&&void 0!==e?e:void 0),t.headers.has(U)&&(u.trace_id=null!==(n=t.headers.get(U))&&void 0!==n?n:void 0),t.headers.has(X)&&(u.log_id=null!==(r=t.headers.get(X))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),t},function(t){return u.ax_status="0",u.ax_size=0,u.ax_duration=Date.now()-s,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},ot.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=et(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},ot.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return et(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},ot.prototype.getFetchBody=function(t,e){return et(t)?t.body:null==e?void 0:e.body},ot.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),L(n)},ot.monitorName=nt,ot);function ot(t){this.name=nt,this.callback=R,this.props=t}var it="FMPMonitor",at=(st.prototype.setup=function(t){if(u())return S()?void(m(document.querySelector)&&(this.callback=t&&m(t)?t:function(){},this.startTime=Date.now(),this.list=[],m(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},st.prototype.count=function(){var t=Date.now()-this.startTime,e=document.querySelector("body");e?this.list.push({score:this.score(e,1,!1),time:t}):this.list.push({score:0,time:t})},st.prototype.score=function(t,e,n){var r=0,o=t.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){var i=t.children?t.children.length:0;if(0<i)for(var a=t.children,s=i-1;0<=s;s--)r+=this.score(a[s],e+1,0<r);if(r<=0&&!n){if(!t.getBoundingClientRect||!m(t.getBoundingClientRect))return 0;var u=t.getBoundingClientRect();if(!u)return 0;if(u.top>window.innerHeight)return 0;if(u.height<=0)return 0}r+=1+.5*e}return r},st.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var t,e={time:this.list[0].time,rate:0},n=1;n<this.list.length;n++){this.list[n].time>=this.list[n-1].time&&(t=this.list[n].score-this.list[n-1].score,e.rate<t&&(e={time:this.list[n].time,rate:t}))}return e.time},st.prototype.getTimeGap=function(){return c()?this.startTime-performance.timing.navigationStart:0},st.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},st.monitorName=it,st);function st(){var r=this;this.name=it,this.callback=R,this.disconnect=function(){var t,e;null!==(e=null===(t=r.observer)||void 0===t?void 0:t.disconnect)&&void 0!==e&&e.call(t)},this.getLoadFmp=function(){var t=r.getFmpInternal(),e=t?r.getTimeGap()+t:0,n=r.formatEvent(e);return r.callback(n),n},this.getFmp=function(){var t=r.getFmpInternal(),e=r.formatEvent(t);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ut(){}var ct=!1,lt=!1,pt={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=pt.uniqueId++;i.beforeCb(r);var o=this.onreadystatechange;return this.onreadystatechange=function(t){null!=o&&o.call(e,t),4===e.readyState&&i.afterCb(r)},pt.originals.send.apply(this,t)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;e()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Promise(function(e,n){var r=pt.uniqueId++;o.beforeCb(r),i.apply(void 0,a(t)).then(function(t){o.afterCb(r),e(t)},function(t){o.afterCb(r,t),n(t)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(a){if(S()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=g(t),o=r.next();!o.done;o=r.next()){var i=o.value;("childList"===i.type&&function t(e,n){var r,o;try{for(var i=g(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(n.includes(s.nodeName.toLowerCase())||s.children&&t(s.children,n))return 1}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}(i.addedNodes,s)||"attributes"===i.type&&s.includes(i.target.nodeName.toLowerCase()))&&a(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}});return t.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),t}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(ct=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(lt=!1,window.fetch=this.originals.fetch)}},dt="TTIMonitor",ht=(ft.prototype.setup=function(){},ft.prototype.isEnable=function(){return M()&&!!P()&&m(window.PerformanceResourceTiming)&&E()},ft.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=g(r),i=o.next();!i.done;i=o.next()){var a=i.value;"resource"===a.entryType&&s.networkRequestFinishedCallback(a),"longtask"===a.entryType&&s.longTaskFinishedCallback(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(t){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ft.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ut,this.proxyConfig.afterCb=ut)},ft.prototype.rescheduleTimer=function(t){var e=this;this.scheduleTimerTasks&&(this.timerActivationTime>t||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){e.checkTTI()},t-performance.now()),this.timerActivationTime=t))},ft.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var t=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(e+5e3,t))},ft.prototype.registerListeners=function(){ct||(pt.patchXMLHTTPRequest(this.proxyConfig),ct=!0),lt||(pt.patchFetch(this.proxyConfig),lt=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ft.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ft.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ft.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ft.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ft.prototype,"incompleteRequestStarts",{get:function(){for(var t=Object.keys(this.incompleteJSInitiatedRequestStartTimes),e=[],n=0;n<t.length;n++){var r=this.incompleteJSInitiatedRequestStartTimes[t[n]];"number"==typeof r&&e.push(r)}return e},enumerable:!1,configurable:!0}),ft.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ft.prototype.checkTTI=function(){var t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),e=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,n=this.getMinValue(),r=performance.now();null===n&&this.rescheduleTimer(Math.max(t+5e3,r+1e3));var o=this.computeTTI(e,n,t,r,this.longTasks);o?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(o)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ft.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ft.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ft.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ft.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=g(e),u=s.next();!u.done;u=s.next()){var c=u.value;a.push({timestamp:c.start,type:"requestStart"}),a.push({timestamp:c.end,type:"requestEnd"})}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}try{for(var l=g(t),p=l.next();!p.done;p=l.next()){var d=p.value;a.push({timestamp:d,type:"requestStart"})}}catch(t){o={error:t}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}a.sort(function(t,e){return t.timestamp-e.timestamp});for(var h=t.length,f=a.length-1;0<=f;f--){var m=a[f];switch(m.type){case"requestStart":h--;break;case"requestEnd":if(2<++h)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ft.monitorName=dt,ft);function ft(t){var e,n,r,o,i,a,s=this;if(this.name=dt,this.longTasks=[],this.callback=ut,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(t){s.callback=t,s.isEnable()?s.startSchedulingTimerTasks():s.callback&&"function"==typeof s.callback&&s.callback()},this.computeTTI=function(t,e,n,r,o){if(r-n<5e3)return null;var i=0===o.length?t:o[o.length-1].end;return r-i<5e3?null:Math.max(i,e)},this.isEnable()){if(this.useMutationObserver=!!t.useMutationObserver,this.minValue=null!==(r=t.minValue)&&void 0!==r?r:null,this.isAsync=null!==(o=t.isAsync)&&void 0!==o?o:0,this.snippetEntries=null===(i=null==t?void 0:t.preLongTaskObserver)||void 0===i?void 0:i.precollect,this.snippetObserver=null===(a=null==t?void 0:t.preLongTaskObserver)||void 0===a?void 0:a.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var u=g(this.snippetEntries),c=u.next();!c.done;c=u.next()){var l=c.value;"longtask"===l.entryType?this.longTasks.push({start:l.startTime,end:l.startTime+l.duration}):"resource"===l.entryType&&this.networkRequests.push({start:l.fetchStart,end:l.responseEnd})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}this.registerListeners()}}function mt(t){try{for(var e,n=t,r=[],o=0,i=0,a=" > ".length;n&&o++<5&&!("html"===(e=function(t){var e,n,r,o,i=t,a=[];if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase()),i.id&&a.push("#"+i.id);var s=i.className;if(s&&y(s))for(e=s.split(/\s+/),o=0;o<e.length;o++)a.push("."+e[o]);var u=["type","name","title","alt"];for(o=0;o<u.length;o++)n=u[o],(r=i.getAttribute(n))&&a.push("["+n+'="'+r+'"]');return a.join("")}(n))||1<o&&80<=i+r.length*a+e.length);)r.push(e),i+=e.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}var vt="FIDMonitor",gt=(yt.prototype.setup=function(t){var u=this;if(P()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=g(t.getEntries()),i=o.next();!i.done;i=o.next()){var a=i.value,s=a.processingStart-a.startTime;u.callback({name:u.name,fid:Math.round(s)})}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(t){this.observer.observe({entryTypes:["first-input"]})}}},yt.monitorName=vt,yt);function yt(){this.name=vt,this.callback=R}var bt="MPFIDMonitor",wt=(St.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&E()){if(!this.props.isAsync){var o=null!==(r=null===(n=this.props.preLongTaskObserver)||void 0===n?void 0:n.precollect)&&void 0!==r?r:[];if(o&&0<o.length)try{for(var i=g(o),s=i.next();!s.done;s=i.next()){var u=s.value;"longtask"===u.entryType&&this.list.push(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}this.observer=new PerformanceObserver(function(t){var e,n;try{for(var r=g(t.getEntries()),o=r.next();!o.done;o=r.next()){var i=o.value;a.list.push(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),this.observer.observe({entryTypes:["longtask"]})}},St.prototype.getMPFID=function(){var e,t;if(M()&&E()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=g(this.list),o=r.next();!o.done;o=r.next()){var i=o.value;n<i.duration&&(n=i.duration)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return this.formatEvent(Math.round(n))}},St.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},St.monitorName=bt,St);function St(t){this.name=bt,this.list=[],this.props=t}var Pt=[],Mt="ResourcePerformanceMonitor",Et=(Tt.prototype.setup=function(t){this.isEnable()&&(this.callback=null!=t?t:R,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Tt.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){var e=this,n=[];if(t.forEach(function(t){m(e.checkIgnore)&&e.checkIgnore(t)||n.push(t)}),n.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:n}}},Tt.prototype.sendResourcePerformance=function(t){var e=this.buildParams(t);e&&this.callback(e)},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(Pt,t.initiatorType)})},Tt.prototype.observePerformance=function(){var n=this;P()&&new PerformanceObserver(function(t){var e=t.getEntries();e.length&&n.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Tt.monitorName=Mt,Tt);function Tt(t){var e,n,r,o=this;this.name=Mt,this.callback=R,this.getResourcePerformance=function(){var t;return null!==(t=o.getPerformance())&&void 0!==t?t:{}},this.isAsync=null!==(e=null==t?void 0:t.isAsync)&&void 0!==e?e:0,this.observe=null!==(n=null==t?void 0:t.observe)&&void 0!==n&&n,this.checkIgnore=null!==(r=null==t?void 0:t.checkIgnore)&&void 0!==r?r:function(){return!1}}var kt={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},_t="PerformanceMonitor",Rt=(xt.prototype.setup=function(t){var e,n,r,o,i=this;c()&&(this.callback=t,n=function(){i.hasLoaded=!0,i.performanceAuto&&setTimeout(function(){i.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){n()},0)},!1):n(),this.sendParams=f({},kt),this.staticPerformanceMonitor=new Et,this.staticPerformanceMonitor.setup(),(new gt).setup(this.hasFID),this.mpfidMonitor=new wt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:ht,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),q(o))},xt.prototype.performanceNow=function(){var t,e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:0)},xt.prototype.getBounced=function(){return!this.hasLoaded},xt.prototype.getPaintTime=function(e){if(w()){var t=performance.getEntriesByType("paint");if(l(t)){var n=t.filter(function(t){return t.name===e});return n.length&&n[0]&&h(n[0])&&n[0].startTime||0}}return 0},xt.monitorName=_t,xt);function xt(t){var a=this;this.name=_t,this.callback=R,this.sendParams=f({},kt),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){a.initFlag&&a.hasLoaded&&(a.sendParams.isAsync&&(a.sendParams.load=Math.round(a.performanceNow()-a.initStart)),setTimeout(function(){a.perfLog()},200))},this.initAsync=function(){var t,e,n,r;a.hasSentInitPerf&&(a.sendParams=f({},kt),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Et({isAsync:1}),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new wt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:ht,a.ttiMonitor=new r({minValue:Math.round(a.performanceNow()),isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.ttiMonitor.setup(),null!==(n=null===(e=a.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==n&&n.call(e,R))},this.getPerformance=function(){return a.finalSendParams.tti||("complete"===document.readyState?a.perfLog():a.perfLog(!0)),a.buildParams(a.finalSendParams)},this.buildParams=function(t){return{name:a.name,type:"post",event:t}},this.perfLog=function(t){if(void 0===t&&(t=!1),c()){if(a.initFlag=!1,a.finalSendParams=f({},a.sendParams),!a.sendParams.isAsync){var e=a.getBounced();if(e)return a.finalSendParams.bounced=e,void a.invokeCallback(0,a.buildParams(a.finalSendParams));a.finalSendParams=f(f({},a.finalSendParams),a.getParams())}var n=a.getStaticResources(),r=a.getFMP(),o=a.getMPFID();n&&(a.finalSendParams.resources=n,a.finalSendParams.has_resource=1),r&&(a.finalSendParams.fmp=Math.round(r)),r&&a.finalSendParams.fcp&&a.finalSendParams.fmp<a.finalSendParams.fcp&&(a.finalSendParams.fmp=a.finalSendParams.fcp),o&&(a.finalSendParams.mpfid=o),m(a.callback)&&(!t&&a.ttiMonitor&&m(a.ttiMonitor.getTTI)?a.ttiMonitor.getTTI(function(t){t&&0<t&&(a.finalSendParams.tti=a.finalSendParams.isAsync?Math.round(t-a.initStart):t),a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams))}):a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams)))}},this.invokeCallback=function(t,e){if(!t){if(a.hasSentInitPerf)return;a.hasSentInitPerf=!0}a.callback(e)},this.getStaticResources=function(){var t;if(a.staticPerformanceMonitor&&m(a.staticPerformanceMonitor.getResourcePerformance)){var e=a.staticPerformanceMonitor.getResourcePerformance();if(null!==(t=null==e?void 0:e.event)&&void 0!==t&&t.resources)return e.event.resources||[]}},this.getFMP=function(){var t,e,n,r;return a.fmpMonitor?(a.fmpMonitor.disconnect(),a.sendParams.isAsync?(null===(t=null==(r=a.fmpMonitor.getFmp())?void 0:r.event)||void 0===t?void 0:t.fmp)||0:m(a.fmpMonitor.getLoadFmp)?1!==a.props.renderType?2===a.props.renderType?a.getPaintTime("first-contentful-paint"):0:null!==(n=null===(e=(r=a.fmpMonitor.getLoadFmp()||{}).event)||void 0===e?void 0:e.fmp)&&void 0!==n?n:0:0):0},this.getMPFID=function(){if(a.mpfidMonitor&&m(a.mpfidMonitor.getMPFID)){var t=a.mpfidMonitor.getMPFID();if(t)return t.mpfid}},this.syncPerfLog=function(){var t,e;a.hasSentInitPerf||(a.perfLog(!0),null!==(e=(t=a.props).report)&&void 0!==e&&e.call(t))},this.hasFID=function(t){a.sendParams.fid=t.fid},this.getParams=function(){if(c()){var t={},e=window.performance.timing;t.dns=e.domainLookupEnd-e.domainLookupStart,t.tcp=e.connectEnd-e.connectStart,t.request=e.responseStart-e.requestStart,t.response=e.responseEnd-e.responseStart,t.processing=e.domComplete-e.domLoading,t.blank=e.responseEnd-e.navigationStart,t.domready=e.domInteractive-e.navigationStart,t.load=e.loadEventEnd-e.navigationStart,e.secureConnectionStart&&(t.ssl=e.connectEnd-e.secureConnectionStart),t.domparse=e.domInteractive-e.responseEnd,t.resource=e.loadEventStart-e.domContentLoadedEventEnd,t.ttfb=e.responseStart-e.requestStart,t.redirect=e.redirectEnd-e.redirectStart;var n=a.getPaintTime("first-paint"),r=a.getPaintTime("first-contentful-paint");n&&(t.fp=Math.round(n)),r&&(t.fcp=Math.round(r));var o=function(){if(!w())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=c()?window.performance.timing:null;return(o||i)&&(t.navigation=null!=o?o:i),i&&(t.timing=i),o&&(t.navigation_timing=o),t}},t.fmpMonitor&&(this.fmpMonitor=t.fmpMonitor);var e=t.performanceAuto;this.performanceAuto=void 0===e||e,this.props=null!=t?t:{}}var Lt="StaticErrorMonitor",Ct=(Ht.prototype.setup=function(t){u()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Ht.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ot(t,"href"):Ot(t,"src")},Ht.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=k(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Ht.monitorName=Lt,Ht);function Ht(){var s=this;this.name=Lt,this.callback=R,this.buildEvent=function(t){var e,n,r,o=t||window.event||{};try{r=null!==(n=null!==(e=o.target)&&void 0!==e?e:o.srcElement)&&void 0!==n?n:{}}catch(o){return}var i=r.tagName;if(i&&y(i)){i=i.toLowerCase();var a=s.getSrc(r);if(a&&a!==window.location.href)return{name:s.name,type:"get",event:s.getParams(a,i)}}},this.staticErrorLog=function(t){var e=s.buildEvent(t);e&&s.callback(e)}}function Ot(t,e){var n,r;return t.getAttribute&&m(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var qt="BreadcrumbMonitor",jt=(It.prototype.setup=function(){this.instrumentDOM()},It.prototype.instrumentDOM=function(){var t;"document"in window&&(t=this,window.document.addEventListener("click",t.domEventHandler("click",t.triggerHandlers.bind(t,"dom")),!1),window.document.addEventListener("keypress",t.keypressEventHandler(t.triggerHandlers.bind(t,"dom")),!1))},It.prototype.domEventHandler=function(e,n,r){var o=this;return void 0===r&&(r=!1),function(t){o.keypressTimeout=void 0,t&&o.lastCapturedEvent!==t&&(o.lastCapturedEvent=t,o.debounceTimer&&clearTimeout(o.debounceTimer),r?o.debounceTimer=setTimeout(function(){n({event:t,name:e})}):n({event:t,name:e}))}},It.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},It.prototype.keypressEventHandler=function(r){var o=this;return function(t){var e;try{e=t.target}catch(t){return}var n=e&&e.tagName;n&&("INPUT"===n||"TEXTAREA"===n||e.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",r)(t),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},It.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?mt(t.event.target):mt(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},It.monitorName=qt,It);function It(){var r=this;this.name=qt,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(t,e){var n=f(f({},t),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==e&&0<=e?a(r.breadcrumbs,[n]).slice(-e):a(r.breadcrumbs,[n]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var At=(Ft.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},Ft.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},Ft.prototype._modifyEvent=function(t){return t},Ft.prototype._shouldSend=function(t){return!0},Ft.prototype._send=function(t){},Ft.prototype.idleSendEvent=function(t){this._send(t)},Ft);function Ft(){}var Dt="JSExceptionMonitor",Bt=(Nt.prototype.setup=function(t){u()&&(this.callback=t,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Nt.prototype.buildEvent=function(t){var e;if(!function(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return t instanceof Error}}(t)?(o(t)&&(e={message:JSON.stringify(t)}),y(t)&&(e={message:t})):e=t,e){var n={ev_type:"js_exception",exception:this.normalizeError(e)};return{name:this.name,type:"post",event:n}}},Nt.prototype.logError=function(t){var e=this.buildEvent(t);e&&this.callback(e)},Nt.prototype.getJSError=function(t){var e=t.error;if(e)return e},Nt.prototype.getJSPromiseRejection=function(t){var e=void 0;try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}if(e)return e},Nt.prototype.normalizeError=function(t){return{message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop}},Nt.monitorName=Dt,Nt);function Nt(t){var n=this;this.name=Dt,this.callback=R,this.jsErrorLog=function(t){var e=n.getJSError(t);e&&n.logError(e)},this.jsPromiseRejectionLog=function(t){var e=n.getJSPromiseRejection(t);e&&n.logError(e)},this.options=null!=t?t:{}}var Ut,Jt=(t(Xt,Ut=At),Object.defineProperty(Xt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Xt.prototype._send=function(t){var e=this,n=this.buildParams(t);n&&this.reportQueue.push(n),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){e._uploadQueue()},this.batchReportWait))},Xt.prototype._uploadQueue=function(){var t;this.reportQueue.length&&this.ready&&(t={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:t,type:"post"}))},Xt.prototype._request=function(t){},Xt);function Xt(t){var e,n,r=Ut.call(this)||this;return r.reportQueue=[],r.isReady=!0,r.batchReportLength=null!==(e=t.maxBatchReportLength)&&void 0!==e?e:10,r.batchReportWait=null!==(n=t.batchReportWait)&&void 0!==n?n:1e3,r.batchReportTimeout=null,r}function Vt(t){return!!t&&Math.random()<Number(t)}var Qt;t(zt,Qt=Jt),zt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(zt.prototype,"contextAgent",{get:function(){var o=this,n={set:function(t,e){return o.options&&(o.options.commonParams.context||(o.options.commonParams.context={}),o.options.commonParams.context[t]=e),n},delete:function(t){var e;return null!==(e=o.options)&&void 0!==e&&e.commonParams.context&&"string"!=typeof o.options.commonParams.context&&p(o.options.commonParams.context,t)&&delete o.options.commonParams.context[t],n},clear:function(){return o.options&&(o.options.commonParams.context={}),n},get:function(t){var e,n,r;return null===(r=null===(n=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.context)||void 0===r?void 0:r[t]},toObject:function(){var t,e,n;return"string"==typeof(null===(t=o.options)||void 0===t?void 0:t.commonParams.context)?{}:f({},null===(n=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.context)}};return n},enumerable:!1,configurable:!0}),zt.prototype._shouldSend=function(t){var e,n;if(!(null!==(e=this.options)&&void 0!==e&&e.monitors&&t&&h(t)&&null!==(n=t.event)&&void 0!==n&&n.ev_type))return!1;var r=this.options.monitors;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){var o=O(W||[]);if(o&&o.test(t.event.ax_url))return!1}return!!r.BaseMonitor.webIDHit||!!r.BaseMonitor.sampleHit&&("PathMonitor"===t.name?function(t){var e=t.sendParams,n=t.pageViewMonitor,r=t.baseMonitor;if(1!==r.appTypeSetting.type||e.event.type!==r.appTypeSetting.SPA)return!1;if(!n)return!0;if(n.webIDHit)return!0;return!!n.sampleHit}({sendParams:t,pageViewMonitor:r.PageViewMonitor,baseMonitor:r.BaseMonitor}):"PageViewMonitor"===t.name?Wt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?Kt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?Gt({performanceMonitor:r.PerformanceMonitor}):"EmitMonitor"===t.name?function(t){var e=t.sendParams,n=t.flexibleMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=n.eventNameHit;if(r){var o=e.event.flexible_data_list[0].event_name;if(r&&p(r,o))return Vt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?$t({sendParams:t,staticErrorMonitor:r.StaticErrorMonitor}):"HijackMonitor"===t.name?function(t){var e=t.hijackMonitor;if(!e)return!0;if(e.webIDHit)return!0;return!!e.sampleHit}({hijackMonitor:r.HijackMonitor}):"JSErrorMonitor"!==t.name||Yt({jsErrorMonitor:r.JSErrorMonitor}))},zt.prototype._modifyEvent=function(t){var e;if(null===(e=this.options)||void 0===e||!e.monitors||!t||!h(t))return{};var n=this.options.monitors;return"PerformanceMonitor"===t.name?function(t){var e,a=t.sendParams,n=t.performanceMonitor;if(!n)return a;if(!c())return{};{var r;e=a.event.isAsync?a.event.load>n.spaSlowSessionTime:(r=window.performance.timing,r.loadEventEnd-r.navigationStart>n.slowSessionTime)}{var s;a.event.resources&&l(a.event.resources)&&(s=O(n.geckoUrls||[]),a.event.resources.forEach(function(t,e){var n,r,o,i;null!==(n=a.event.resources)&&void 0!==n&&n[e]&&h(null===(r=a.event.resources)||void 0===r?void 0:r[e])&&m(null===(o=a.event.resources)||void 0===o?void 0:o[e].toJSON)&&(a.event.resources[e]=null===(i=a.event.resources)||void 0===i?void 0:i[e].toJSON(),a.event.resources[e].is_gecko=s&&s.test(t.name||"")?"1":"0")}))}n.webIDHitStaticResource||n.sampleHitStaticResource?a.event.upload_reason="sample":e?a.event.upload_reason="slow_session":(delete a.event.resources,a.event.has_resource=0);return a}({sendParams:t,performanceMonitor:n.PerformanceMonitor}):"PathMonitor"===t.name?function(t){var e=t.sendParams,n=t.baseMonitor,r=t.effect;1===n.appTypeSetting.type&&n.appTypeSetting.SPA===e.event.type&&(r({commonParams:{pid:e.event.path}}),delete e.event.type,delete e.event.path);return{}}({sendParams:t,baseMonitor:n.BaseMonitor,effect:this.updateConfig}):t},zt.prototype.buildParams=function(t){var e,n,r,o,i,a,s=t.event||{},u=t.overrides,c=f({},null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{});h(null==u?void 0:u.context)&&(a=f(f({},null!==(r=h(c.context)&&c.context)&&void 0!==r?r:{}),null!==(o=null==u?void 0:u.context)&&void 0!==o?o:{}),c.context=a);var l=f(f(f({},s),null!=c?c:{}),s),l=this.normalizeEvent(l);return null!==(i=this.options)&&void 0!==i&&i.custom&&m(this.options.custom.beforeSend)&&(l=this.options.custom.beforeSend(l||{})),l},zt.prototype._request=function(t){var e,n,r,o;t&&t.event&&(n=t.type,r=t.event,"beacon"===(null===(e=this.options)||void 0===e?void 0:e.commonParams.report_type)&&navigator&&navigator.sendBeacon?(o=JSON.stringify(r),navigator.sendBeacon(this.getReportURL(),o)):this.transport&&("get"!==n?"post"===n&&this.transport.postEvent(r):this.transport.getEvent(r)))},zt.prototype.chechIsReady=function(){return 2===this.clientStatus},zt.prototype.updateStatus=function(){var e=this;switch(this.clientStatus){case 0:this.clientStatus=1;break;case 1:if(this.clientStatus=2,!this.preQueue.length)return;this.preQueue.forEach(function(t){Qt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},zt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},zt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},zt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},zt.prototype.normalizeEvent=function(t){var e=f(f({},t),{url:window.location.href});return h(t.context)&&(e.context=JSON.stringify(t.context)),e||{}};function zt(t){var e,i=Qt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new F({reportURL:i.getReportURL()}),i.updateStatus())},i.uploadQueue=function(){i._uploadQueue()},i.updateConfig=function(t){var e,n,r,o=null===(n=null===(e=i.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.pid;i.options=i.normalizeOptions(t),o&&null!==(r=null==t?void 0:t.commonParams)&&void 0!==r&&r.pid&&t.commonParams.pid!==o&&i.sendPageview()},i.sendPageview=function(){m(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?Qt.prototype.sendEvent.call(i,t):i.preQueue.push(t)},i.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",i.preQueue=[],i.clientStatus=0,i.enable=!1,i}function Kt(t){var n=t.sendParams,e=t.ajaxMonitor;if(!e)return!0;if(e.webIDHit)return!0;if(!e.sampleHit)return!1;var r=e.whitelistUrls;if(l(r)&&0<r.length){var o=O(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=O(e.ignore||[]);if(i&&i.test(n.event.ax_url))return!1;var a=e.statusCodeSample;if(a&&p(a,n.event.ax_status))return Vt(a[n.event.ax_status]);var s=e.requestUrlSample;if(s){var u=!1,c=!1;if(s.forEach(function(t){var e;u||null!=(e=O([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Vt(t.sampleRate))}),u)return c}return!0}function Wt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function $t(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=O(n.ignore||[]);return!r||!r.test(e.event.st_src)}function Yt(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Zt(t){var e,n,r=t.setting,o=t.info,i=b({PageViewMonitor:{},JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},FlexibleMonitor:{},StaticErrorMonitor:{},HijackMonitor:{},BaseMonitor:{appTypeSetting:{}}},r.monitors);r.ajaxWhitelistUrls&&l(r.ajaxWhitelistUrls)&&(i.AjaxMonitor.whitelistUrls=(i.AjaxMonitor.whitelistUrls||[]).concat(r.ajaxWhitelistUrls)),r.ignoreAjax&&l(r.ignoreAjax)&&(i.AjaxMonitor.ignore=(i.AjaxMonitor.ignore||[]).concat(r.ignoreAjax)),p(r,"geckoUrls")&&(i.PerformanceMonitor.geckoUrls=r.geckoUrls),r.ignoreStatic&&l(r.ignoreStatic)&&(i.StaticErrorMonitor.ignore=(i.StaticErrorMonitor.ignore||[]).concat(r.ignoreStatic)),null!==(e=r.plugins)&&void 0!==e&&e.sentry&&(i.JSErrorMonitor=f(f({},i.JSErrorMonitor||{}),r.plugins.sentry)),r.errorRelease&&(i.JSErrorMonitor.release=r.errorRelease),r.ignoreErrors&&l(r.ignoreErrors)&&(i.JSErrorMonitor.ignoreErrors=r.ignoreErrors),r.errorBlacklistUrls&&l(r.errorBlacklistUrls)&&(i.JSErrorMonitor.blacklistUrls=r.errorBlacklistUrls),r.errorWhitelistUrls&&l(r.errorWhitelistUrls)&&(i.JSErrorMonitor.whitelistUrls=r.errorWhitelistUrls),p(r,"sampleRate")&&(i.BaseMonitor.sampleHit=Vt(r.sampleRate));var a,s,u,c=r.plugins;return c&&h(c)&&(p(c,"spa")&&((a=c.spa)&&p(a,"enable")&&(i.BaseMonitor.appTypeSetting.type=Number(a.enable)),a&&p(a,"type")&&(i.BaseMonitor.appTypeSetting.SPA=a.type)),!c.render||(s=null===(n=r.plugins)||void 0===n?void 0:n.render)&&h(s)&&p(s,"enable")&&(u=[{pids:[],value:s.enable,isDefault:!0}],i.BaseMonitor.appTypeSetting.renderType=function(t){var e=t.renderRules,n=t.pid;if(!e||!n)return 0;for(var r=0;r<e.length;r++){var o=e[r];if(l(o.pids)&&0<o.pids.length){var i=O(o.pids);if(i&&i.test(n))return o.value}if(o.isDefault&&r===e.length-1)return o.value}return 0}({renderRules:u,pid:o.pid}))),i}var te="RANGERS_WEB_ID";function ee(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:A(1)},PageViewMonitor:{webIDHit:!1,sampleHit:A(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:A(1),sampleHitTrace:!1,ignore:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(z),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:W},HijackMonitor:{webIDHit:!1,sampleHit:A(K)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.5",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:Q(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:j(),network_type:I()},t}function ne(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=g(o),s=a.next();!s.done;s=a.next()){var u=s.value.split("="),c=y(u[0])&&u[0].trim();c&&y(u[1])&&(i[c]=u[1].trim())}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i[e]||""}(document.cookie,te)&&(document.cookie=te+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var re,oe,ie,ae,se=(re="/v2/user/webid",oe="/v2/user/ssid",ie="/v2/event/list",ae=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[re,oe,ie].forEach(function(t){ae.push(e+t)})}),ae);function ue(t){var e=t.sendParams,n=t.commonParams,r=t.custom,o=function(t){var e,n=t.sendParams,r=t.commonParams,o=t.breadcrumbMonitor,i={};if(i.ev_type=n.event.ev_type,i.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,v(a,["ev_type"]));return i.event=s,i}if("PerformanceMonitor"===n.name&&i){n.event.navigation=n.event.navigation_timing;var u=n.event,c=(u.ev_type,v(u,["ev_type"]));return i.ev_type="performance",i.event={fp:c.fp,fcp:c.fcp,fmp:c.fmp,tti:c.tti,fid:c.fid,mpfid:c.mpfid,isAsync:c.isAsync,timing:c.timing,navigation:c.navigation_timing,bounced:c.bounced},i}if("StaticErrorMonitor"===n.name&&i){i.ev_type="resource_error";var l=n.event,p=(l.ev_type,v(l,["ev_type"]));return i.event=p,i}if("ResourcePerformanceMonitor"===n.name&&i){i.ev_type="resource";var d=n.event,h=(d.ev_type,v(d,["ev_type"]));return i.event=h,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var f=n.event,m=(f.ev_type,v(f,["ev_type"]));return i.event=m.exception,i.breadcrumbs=null!==(e=null==o?void 0:o.getBreadcrumbs())&&void 0!==e?e:[],i}return i}({sendParams:e,commonParams:f(f({},null!=n?n:{}),{url:window.location.href})});return r&&m(r.beforeSend)&&(o=r.beforeSend(o||{})),o}function ce(){return"https://tbm.snssdk.com/monitor_browser/collect"}var le,pe=(t(de,le=Jt),de.prototype._shouldSend=function(t){return function(t){var e=t.sendParams,n=t.monitorsSetting;if(!e||!h(e)||!e.event)return!1;var r=n;if("AjaxMonitor"===e.name||"FetchMonitor"===e.name){var o=O(a(["/monitor_browser/collect"],se)||[]);if(o&&o.test(e.event.ax_url))return!1}return!(null==r||!r.BaseMonitor.webIDHit)||!(null==r||!r.BaseMonitor.sampleHit)&&("AjaxMonitor"===e.name||"FetchMonitor"===e.name?Kt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?Gt({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?$t({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?Yt({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Wt({pageViewMonitor:r.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},de.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},de.prototype._request=function(t){var e,n,r;t&&t.event&&(e=t.type,n=t.event,"beacon"===this.options.reportType&&navigator&&navigator.sendBeacon?(r=JSON.stringify(n),navigator.sendBeacon(this.getReportURL(),r)):this.transport&&("get"!==e?"post"===e&&this.transport.postEvent(n):this.transport.getEvent(n)))},de.prototype.buildParams=function(t){return ue({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},de.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},de.prototype.getBatchReportURL=ce,de);function de(t){var e,h=le.call(this,t)||this;return h.options={},h.setTransport=function(){h.transport=new F({reportURL:h.getReportURL()}),h.preQueue.forEach(function(t){le.prototype.sendEvent.call(h,t)})},h.updateConfig=function(t){var e,n,r,o,i,a,s,u,c,l,p,d;h.options=(e={previousOptions:h.options,newOptions:t},l=e.previousOptions,p=e.newOptions,(d=f(f({},l),p)).commonParams=b({},null!==(n=l.commonParams)&&void 0!==n?n:{},null!==(r=p.commonParams)&&void 0!==r?r:{}),d.monitorsSetting=b({},null!==(o=l.monitorsSetting)&&void 0!==o?o:{},null!==(i=p.monitorsSetting)&&void 0!==i?i:{}),d.monitors=f(f({},null!==(a=l.monitors)&&void 0!==a?a:{}),null!==(s=p.monitors)&&void 0!==s?s:{}),d.custom=f(f({},null!==(u=l.custom)&&void 0!==u?u:{}),null!==(c=p.custom)&&void 0!==c?c:{}),d)},h.sendEvent=function(t){h.transport?le.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.uploadQueue=function(){h._uploadQueue()},h.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",h.preQueue=[],h}var he,fe=(me.prototype.getUserIDFromRangers=function(e){window.collectEvent&&m(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},me.prototype.init=function(t){var n=this;this.client=new pe(this.getClientOptions(t)),this.getUserIDFromRangers(function(t){var e=n.normalizeSetting({user_unique_id:t.user_unique_id});n.client.updateConfig(n.getClientOptions(e)),n.client.setTransport()}),this.sendPageview();var e=this.setMonitors();this.setupMonitors(e)},me.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},me.prototype.setMonitors=function(){var t,e,n=[],r=this.baseSetting.flags,o=new at;return n.push(o),r.enableCatchJSError&&n.push(new Bt),r.hookXHR&&n.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new rt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Ct),r.enablePerformance&&(r.enableFMP?n.push(new Rt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new Rt({renderType:1,preLongTaskObserver:{precollect:(null===(t=window.RangersSiteSDK.lt)||void 0===t?void 0:t.e)||[],observer:null===(e=window.RangersSiteSDK.lt)||void 0===e?void 0:e.o}}))),r.enableBreadcrumb&&n.push(new jt),r.enableResourcePerformance&&n.push(new Et({observe:!0,checkIgnore:function(t){return t.name===ce()||("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType||"beacon"===t.initiatorType||"navigation"===t.initiatorType||0===t.decodedBodySize)}})),n},me.prototype.setupMonitors=function(t){var n=this;this.client&&this.client.sendEvent&&(t.forEach(function(t){var e;"FMPMonitor"===(n.monitors[t.name]=t).name?t.setup(R):t.setup(null===(e=n.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},me.prototype.normalizeSetting=function(t){var e={commonParams:this.getClientCommonParams(t),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(t),custom:this.getClientCustom(t)},n={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},r=this.baseSetting;return this.baseSetting=b({},this.baseSetting,e,n),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,r),this.baseSetting},me.prototype.settingEffect=function(t,e){ne(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},me.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},me.prototype.getClientCommonParams=function(n){void 0===n&&(n={});var r={};if(!h(n))return r;var o=["context","pid"];i(n,function(t,e){s(o,t)&&(r[t]=e)});return i({user_unique_id:"rangers_web_id",app_id:"aid"},function(t,e){p(n,t)&&(r[e]=n[t])}),r},me.prototype.getClientFlags=function(t){return function(t){var e;void 0===t&&(t={});var n=b({},null!==(e=t.flags)&&void 0!==e?e:{});if(!h(t))return n;var r=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return i(t,function(t,e){s(r,t)&&(n[t]=e)}),n}(f(f({},t),{flags:this.baseSetting.flags}))},me.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&m(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},me.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},me.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return Zt({setting:e,info:this.getNormoalizeInfo()})},me);function me(){var o=this;this.version="0.2.5",this.instance=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("config"!==t[0])o.client&&o.onClose();else{if(!h(t[1]))return;var n=t[1];o.userSetting=f(f({},o.userSetting||{}),n||{});var r=o.normalizeSetting(n);o.client?o.client.updateConfig(o.getClientOptions(r)):o.init(r)}},this.changeReortType=function(t){var e;null!==(e=o.client)&&void 0!==e&&e.updateConfig({reportType:t})},this.onClose=function(){q(o.onCloseReport,o.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&o.onCloseReport(),"visible"===document.visibilityState&&o.changeReortType("xhr")},this.onCloseReport=function(){var t;o.changeReortType("beacon"),null!==(t=o.client)&&void 0!==t&&t.uploadQueue()},this.baseSetting=ee(),this.client=void 0,this.userSetting={},this.monitors={}}var ve,ge,ye=R;return u()&&(ve=new fe,ye=ve.instance,null!==(he=window.RangersSiteSDK)&&void 0!==he&&he.q&&(l(ge=window.RangersSiteSDK.q)&&ge.forEach(function(t){ye.apply(void 0,a(t))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=ve.instance),ye}();
var RangersSiteSDK=function(){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function t(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function v(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function h(t){return"object"==typeof t&&null!==t&&!l(t)}function o(t){return"[object Object]"===(e=t,Object.prototype.toString.call(e));var e}function m(t){return"function"==typeof t}function y(t){return"[object String]"===Object.prototype.toString.call(t)}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(t,e){if(h(t))for(var n in t)p(t,n)&&e.call(null,n,t[n])}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n={},r=0;r<t.length;)n=function t(e,n){var r=f({},e);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&void 0!==n[o]&&(h(e[o])&&h(n[o])?r[o]=t(e[o],n[o]):!h(e[o])&&h(n[o])?r[o]=t({},n[o]):r[o]=n[o]);return r}(n,t[r]),r++;return n}function s(t,e){if(!l(t))return!1;if(0===t.length)return!1;for(var n=0;n<t.length;){if(t[n]===e)return!0;n++}return!1}function e(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(t){return}}function u(){return!!h(window)}function n(){return!(!u()||!h(window.performance))}function c(){return!(!n()||!h(window.performance.timing))}function w(){return!!n()&&!!m(window.performance.getEntries)}function S(){return u()&&"function"==typeof window.MutationObserver}function P(){return u()&&"function"==typeof window.PerformanceObserver}function M(){return!!P()&&m(window.PerformanceLongTaskTiming)}function E(){if(!P())return!1;var t=window.PerformanceObserverEntryList;return m(t)&&m(t.prototype.getEntries)}function T(t){var n,e=function(t){if(!h(t))return{};var n={};return i(t,function(t,e){h(e)||l(e)?n[t]=JSON.stringify(e):n[t]=e}),n}(t),r=(n={},i(e,function(t,e){n[encodeURIComponent(t)]=encodeURIComponent(e)}),n),o=[];return i(r,function(t,e){o.push(t+"="+e)}),o.join("&")}function k(t){var e=document.createElement("a");e.href=t;var n=e.pathname||"/";return"/"!==n[0]&&(n="/"+n),{href:e.href,protocol:e.protocol.slice(0,-1),hostname:e.hostname,host:e.host,search:e.search,pathname:n,hash:e.hash}}var _=function(t){if(!y(t))return!1;var e=t;return m(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function R(){}function x(t){var e="[object String]"===Object.prototype.toString.call(t);return t?e?t.length:ArrayBuffer&&t instanceof ArrayBuffer?t.byteLength:window.Blob&&t instanceof Blob?t.size:t.length?t.length:0:0}function L(t){if(!t)return"";if(!m(t.forEach))return"";var r=[];return t.forEach(function(t){var e,n;l(t)&&t[0]&&!_(t[0])&&(e=t[0],n=t[1]||"",r.push(e+": "+n))}),r.join("\r\n")}function C(t){var e={},n=k(t);return e.ax_protocol=n.protocol,e.ax_domain=n.hostname,e.ax_path=n.pathname,e.ax_url=(n.href||t).split("?")[0],e}function H(t,e){var n=k(t),r=k(e);return n.protocol===r.protocol&&n.host===r.host}function O(t){return l(t)&&t.length?function(t){for(var e=[],n=t.length,r=0;r<n;r++){var o=t[r];y(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(t):null}function q(e,n){m(e)&&(m(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),m(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){m(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var j=function(t){var e,n;return void 0===t&&(t=window),u()&&null!==(e=t.screen)&&void 0!==e&&e.width&&null!==(n=t.screen)&&void 0!==n&&n.height?t.screen.width+"x"+t.screen.height:"0x0"},I=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function A(t){return!!t&&Math.random()<Number(t)}var F=(D.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:R,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:R,s=new XMLHttpRequest;s.open("POST",t,!0),s.setRequestHeader("Content-Type","application/json"),s.send(JSON.stringify(e)),s.onload=function(){try{var t;this.responseText?(t=JSON.parse(this.responseText),i(t)):i({})}catch(t){a()}},s.onerror=function(){a()},s.onabort=function(){a()}},D.get=function(t,e){var n,r,o,i,a=null!==(n=null==e?void 0:e.success)&&void 0!==n?n:R,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:R,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:R,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:R,l=new XMLHttpRequest;l.open("GET",t),l.send(),l.onload=function(){u(null==this?void 0:this.response),c(this.responseText);try{var t;this.responseText?(t=JSON.parse(this.responseText),a(t)):a({})}catch(t){s()}},l.onerror=function(){s()},l.onabort=function(){s()}},D.prototype.getCommonParams=function(){return{timestamp:Date.now()}},D);function D(t){var r=this;this.postEvent=function(t){var e=f(f({},t),r.getCommonParams());D.post(r.url,e)},this.getEvent=function(t){var e=T(f(f({},t),r.getCommonParams())),n=r.url+"?"+e;D.get(n)},this.getURL=function(){return r.url},this.options=t,this.url=this.options.reportURL}function B(t,e,n){if(void 0===n&&(n="0"),1<n.length)throw new TypeError("expect the length of pad to be 1, but got "+t.length);return t.length>=e?t:""+Array.from({length:e-t.length}).fill(n).join("")+t}function N(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var U="x-tt-trace-id",J="x-tt-trace-host",X="x-tt-logid";function V(t,e,n){void 0===n&&(n="01");var r=""+B((Date.now()%4294967295).toString(16),8)+function(t){var e;if("number"==typeof t)e=t;else{var n=t.replace(/-/g,"");if(!/^[0-9]+$/.test(n)){if(18<n.length)return"18"+N(18);var r=22-n.length-4;return""+B(""+n.length,2)+n+N(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+B(""+o.length,2)+o+N(i)}(t)+("string"==typeof e?N(4):B(e.toString(16),4));return"00-"+r+"-"+r.substr(0,16)+"-"+n}function Q(){var t=function(){for(var t=new Array(16),e=0,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;return t}();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(t){for(var e=[],n=0;n<256;++n)e[n]=(n+256).toString(16).substr(1);var r=0;return[e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],"-",e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],e[t[r++]],e[t[15]]].join("")}(t)}var z=.1,K=.1,W=["/log/sentry/"],G=8e3,$=4e3;Q(),Q();var Y="AjaxMonitor",Z=(tt.prototype.setup=function(t){void 0===t&&(t=R),m(XMLHttpRequest)&&(this.callback=t,this.start())},tt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},tt.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},tt.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||R;XMLHttpRequest.prototype.setRequestHeader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(t),n.apply(this,t)}},tt.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];return this._url=r||"",this._method=(null==n?void 0:n.toLowerCase())||"",o.apply(this,t)}},tt.prototype.hookXMLHttpRequestSend=function(){var a=this,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var t,e,n,r,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return a.checkAddTrace(this._url)&&(n=(e=null!==(t=null==a?void 0:a.props.commonParams)&&void 0!==t?t:{}).bid,r=e.web_id,n&&r&&(a.traceId=V(r,n),this.setRequestHeader(U,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},tt.prototype.checkAddTrace=function(t){var e,n,r=null!==(e=this.props.commonParams)&&void 0!==e?e:{},o=r.bid,i=r.web_id,a=(null!==(n=this.props.ajaxMonitorOptions)&&void 0!==n?n:{}).sampleHitTrace,s=H(location.href,t);return o&&i&&a&&s},tt.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},tt.prototype.hookXMLHttpRequestOnreadystatechange=function(l){var p=this.onreadystatechange,d=this;this.onreadystatechange=function(){for(var t,e,n,r,o,i,a,s,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];if(4===this.readyState&&(a={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:d._method,ax_request_header:L(d._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(a.ax_response_header=function(e){if(y(e)){var t=e.split("\r\n"),r=[];return t.forEach(function(t,e){var n;t&&m(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),L(r)}return h(e)?L(Object.keys(e).map(function(t){return[t,e[t]]})):e}(this.getAllResponseHeaders())),!l.checkAddTrace(d._url)||(s=null!==(t=l.traceId)&&void 0!==t?t:this.getResponseHeader(U))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(J))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(X))&&void 0!==n?n:void 0),a.ax_duration=Date.now()-d._start,200===this.status&&(a.ax_size=function(t){var e=0;if(""===t.responseType||"text"===t.responseType)e=x(t.responseText);else if(t.response)e=x(t.response);else try{e=x(t.responseText)}catch(t){e=0}return e}(this)),a=f(f({},a),C(d._url)),l.collectErrorRequest()&&"2"!==a.ax_status[0]&&"3"!==a.ax_status[0]&&(a.ax_request={body:d._data?""+d._data:void 0,search:null===(r=k(d._url))||void 0===r?void 0:r.search,content_type:null===(i=null===(o=d._requestHeaders)||void 0===o?void 0:o.find(function(t){return"content-type"===t[0].toLowerCase()}))||void 0===i?void 0:i[1]}),m(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},tt.monitorName=Y,tt);function tt(t){this.name=Y,this.callback=R,this.traceId=null,this.props=t}function et(t){return t instanceof Request}var nt="FetchMonitor",rt=(ot.prototype.updateConfig=function(t){this.props=b({},this.props,t)},ot.prototype.setup=function(t){void 0===t&&(t=R),e()&&(this.callback=t,this.start())},ot.prototype.start=function(){e()&&this.hookFetch()},ot.prototype.checkAddTrace=function(t){var e,n,r,o,i=null!==(n=null===(e=this.props)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{},a=i.bid,s=i.web_id,u=(null!==(o=null===(r=null==this?void 0:this.props)||void 0===r?void 0:r.ajaxMonitorOptions)&&void 0!==o?o:{}).sampleHitTrace,c=H(location.href,t);return a&&s&&u&&c},ot.prototype.updateAxRequest=function(t,e,n){var r,o,i,a;this.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(a=this.getFetchUrl(e,!0),t.ax_request={body:null===(r=this.getFetchBody(e,n))||void 0===r?void 0:r.toString(),search:!y(a)||null===(o=k(a))||void 0===o?void 0:o.search,content_type:null===(i=null==n?void 0:n.headers)||void 0===i?void 0:i["Content-Type"]})},ot.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},ot.prototype.hookFetch=function(){var c=this,l=this,p=window.fetch;window.fetch=function(o,i){var t;void 0===i&&(i={});var a=c.getFetchUrl(o);if(!function(t){if(y(t)){var e=d(t.split(":"),2),n=e[0];return!e[1]||("http"===n||"https"===n)}}(a))return p(o,i);var e=null!==(t=c.props.commonParams)&&void 0!==t?t:{},n=e.bid,r=e.web_id,s=Date.now(),u={ev_type:"ajax"};try{l.checkAddTrace(a)&&(i.headers=new Headers(function(t,e){var n=new Headers;et(t)&&t.headers&&m(t.headers.forEach)&&t.headers.forEach(function(t,e){n.append(e,t)});{e.headers&&new Headers(e.headers).forEach(function(t,e){n.append(e,t)})}return n}(o,i)),n&&r&&(u.trace_id=V(n,r),i.headers.append(U,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),C(a)),p(o,i).then(function(t){var e,n,r;return u.ax_status=(t.status||0).toString(),u.ax_duration=Date.now()-s,u.ax_response_header=l.getAllHeaders(t.headers),u.ax_request_header=l.getAllHeaders(i.headers),t.headers&&m(t.headers.has)?(t.headers.has("content-length")?u.ax_size=Number(t.headers.get("content-length"))||0:u.ax_size=0,l.checkAddTrace(a)&&(t.headers.has(J)&&(u.trace_host=null!==(e=t.headers.get(J))&&void 0!==e?e:void 0),t.headers.has(U)&&(u.trace_id=null!==(n=t.headers.get(U))&&void 0!==n?n:void 0),t.headers.has(X)&&(u.log_id=null!==(r=t.headers.get(X))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),t},function(t){return u.ax_status="0",u.ax_size=0,u.ax_duration=Date.now()-s,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},ot.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=et(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},ot.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return et(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},ot.prototype.getFetchBody=function(t,e){return et(t)?t.body:null==e?void 0:e.body},ot.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),L(n)},ot.monitorName=nt,ot);function ot(t){this.name=nt,this.callback=R,this.props=t}var it="FMPMonitor",at=(st.prototype.setup=function(t){if(u())return S()?void(m(document.querySelector)&&(this.callback=t&&m(t)?t:function(){},this.startTime=Date.now(),this.list=[],m(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},st.prototype.count=function(){var t=Date.now()-this.startTime,e=document.querySelector("body");e?this.list.push({score:this.score(e,1,!1),time:t}):this.list.push({score:0,time:t})},st.prototype.score=function(t,e,n){var r=0,o=t.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){var i=t.children?t.children.length:0;if(0<i)for(var a=t.children,s=i-1;0<=s;s--)r+=this.score(a[s],e+1,0<r);if(r<=0&&!n){if(!t.getBoundingClientRect||!m(t.getBoundingClientRect))return 0;var u=t.getBoundingClientRect();if(!u)return 0;if(u.top>window.innerHeight)return 0;if(u.height<=0)return 0}r+=1+.5*e}return r},st.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var t,e={time:this.list[0].time,rate:0},n=1;n<this.list.length;n++){this.list[n].time>=this.list[n-1].time&&(t=this.list[n].score-this.list[n-1].score,e.rate<t&&(e={time:this.list[n].time,rate:t}))}return e.time},st.prototype.getTimeGap=function(){return c()?this.startTime-performance.timing.navigationStart:0},st.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},st.monitorName=it,st);function st(){var r=this;this.name=it,this.callback=R,this.disconnect=function(){var t,e;null!==(e=null===(t=r.observer)||void 0===t?void 0:t.disconnect)&&void 0!==e&&e.call(t)},this.getLoadFmp=function(){var t=r.getFmpInternal(),e=t?r.getTimeGap()+t:0,n=r.formatEvent(e);return r.callback(n),n},this.getFmp=function(){var t=r.getFmpInternal(),e=r.formatEvent(t);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ut(){}var ct=!1,lt=!1,pt={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=pt.uniqueId++;i.beforeCb(r);var o=this.onreadystatechange;return this.onreadystatechange=function(t){null!=o&&o.call(e,t),4===e.readyState&&i.afterCb(r)},pt.originals.send.apply(this,t)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;e()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Promise(function(e,n){var r=pt.uniqueId++;o.beforeCb(r),i.apply(void 0,a(t)).then(function(t){o.afterCb(r),e(t)},function(t){o.afterCb(r,t),n(t)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(a){if(S()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=g(t),o=r.next();!o.done;o=r.next()){var i=o.value;("childList"===i.type&&function t(e,n){var r,o;try{for(var i=g(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(n.includes(s.nodeName.toLowerCase())||s.children&&t(s.children,n))return 1}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}(i.addedNodes,s)||"attributes"===i.type&&s.includes(i.target.nodeName.toLowerCase()))&&a(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}});return t.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),t}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(ct=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(lt=!1,window.fetch=this.originals.fetch)}},dt="TTIMonitor",ht=(ft.prototype.setup=function(){},ft.prototype.isEnable=function(){return M()&&!!P()&&m(window.PerformanceResourceTiming)&&E()},ft.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=g(r),i=o.next();!i.done;i=o.next()){var a=i.value;"resource"===a.entryType&&s.networkRequestFinishedCallback(a),"longtask"===a.entryType&&s.longTaskFinishedCallback(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(t){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ft.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ut,this.proxyConfig.afterCb=ut)},ft.prototype.rescheduleTimer=function(t){var e=this;this.scheduleTimerTasks&&(this.timerActivationTime>t||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){e.checkTTI()},t-performance.now()),this.timerActivationTime=t))},ft.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var t=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(e+5e3,t))},ft.prototype.registerListeners=function(){ct||(pt.patchXMLHTTPRequest(this.proxyConfig),ct=!0),lt||(pt.patchFetch(this.proxyConfig),lt=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ft.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ft.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ft.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ft.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ft.prototype,"incompleteRequestStarts",{get:function(){for(var t=Object.keys(this.incompleteJSInitiatedRequestStartTimes),e=[],n=0;n<t.length;n++){var r=this.incompleteJSInitiatedRequestStartTimes[t[n]];"number"==typeof r&&e.push(r)}return e},enumerable:!1,configurable:!0}),ft.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ft.prototype.checkTTI=function(){var t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),e=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,n=this.getMinValue(),r=performance.now();null===n&&this.rescheduleTimer(Math.max(t+5e3,r+1e3));var o=this.computeTTI(e,n,t,r,this.longTasks);o?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(o)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ft.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ft.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ft.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ft.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=g(e),u=s.next();!u.done;u=s.next()){var c=u.value;a.push({timestamp:c.start,type:"requestStart"}),a.push({timestamp:c.end,type:"requestEnd"})}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}try{for(var l=g(t),p=l.next();!p.done;p=l.next()){var d=p.value;a.push({timestamp:d,type:"requestStart"})}}catch(t){o={error:t}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}a.sort(function(t,e){return t.timestamp-e.timestamp});for(var h=t.length,f=a.length-1;0<=f;f--){var m=a[f];switch(m.type){case"requestStart":h--;break;case"requestEnd":if(2<++h)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ft.monitorName=dt,ft);function ft(t){var e,n,r,o,i,a,s=this;if(this.name=dt,this.longTasks=[],this.callback=ut,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(t){s.callback=t,s.isEnable()?s.startSchedulingTimerTasks():s.callback&&"function"==typeof s.callback&&s.callback()},this.computeTTI=function(t,e,n,r,o){if(r-n<5e3)return null;var i=0===o.length?t:o[o.length-1].end;return r-i<5e3?null:Math.max(i,e)},this.isEnable()){if(this.useMutationObserver=!!t.useMutationObserver,this.minValue=null!==(r=t.minValue)&&void 0!==r?r:null,this.isAsync=null!==(o=t.isAsync)&&void 0!==o?o:0,this.snippetEntries=null===(i=null==t?void 0:t.preLongTaskObserver)||void 0===i?void 0:i.precollect,this.snippetObserver=null===(a=null==t?void 0:t.preLongTaskObserver)||void 0===a?void 0:a.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var u=g(this.snippetEntries),c=u.next();!c.done;c=u.next()){var l=c.value;"longtask"===l.entryType?this.longTasks.push({start:l.startTime,end:l.startTime+l.duration}):"resource"===l.entryType&&this.networkRequests.push({start:l.fetchStart,end:l.responseEnd})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}this.registerListeners()}}function mt(t){try{for(var e,n=t,r=[],o=0,i=0,a=" > ".length;n&&o++<5&&!("html"===(e=function(t){var e,n,r,o,i=t,a=[];if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase()),i.id&&a.push("#"+i.id);var s=i.className;if(s&&y(s))for(e=s.split(/\s+/),o=0;o<e.length;o++)a.push("."+e[o]);var u=["type","name","title","alt"];for(o=0;o<u.length;o++)n=u[o],(r=i.getAttribute(n))&&a.push("["+n+'="'+r+'"]');return a.join("")}(n))||1<o&&80<=i+r.length*a+e.length);)r.push(e),i+=e.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}var vt="FIDMonitor",gt=(yt.prototype.setup=function(t){var u=this;if(P()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=g(t.getEntries()),i=o.next();!i.done;i=o.next()){var a=i.value,s=a.processingStart-a.startTime;u.callback({name:u.name,fid:Math.round(s)})}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(t){this.observer.observe({entryTypes:["first-input"]})}}},yt.monitorName=vt,yt);function yt(){this.name=vt,this.callback=R}var bt="MPFIDMonitor",wt=(St.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&E()){if(!this.props.isAsync){var o=null!==(r=null===(n=this.props.preLongTaskObserver)||void 0===n?void 0:n.precollect)&&void 0!==r?r:[];if(o&&0<o.length)try{for(var i=g(o),s=i.next();!s.done;s=i.next()){var u=s.value;"longtask"===u.entryType&&this.list.push(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}this.observer=new PerformanceObserver(function(t){var e,n;try{for(var r=g(t.getEntries()),o=r.next();!o.done;o=r.next()){var i=o.value;a.list.push(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),this.observer.observe({entryTypes:["longtask"]})}},St.prototype.getMPFID=function(){var e,t;if(M()&&E()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=g(this.list),o=r.next();!o.done;o=r.next()){var i=o.value;n<i.duration&&(n=i.duration)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return this.formatEvent(Math.round(n))}},St.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},St.monitorName=bt,St);function St(t){this.name=bt,this.list=[],this.props=t}var Pt=[],Mt="ResourcePerformanceMonitor",Et=(Tt.prototype.setup=function(t){this.isEnable()&&(this.callback=null!=t?t:R,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Tt.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){var e=this,n=[];if(t.forEach(function(t){m(e.checkIgnore)&&e.checkIgnore(t)||n.push(t)}),n.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:n}}},Tt.prototype.sendResourcePerformance=function(t){var e=this.buildParams(t);e&&this.callback(e)},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(Pt,t.initiatorType)})},Tt.prototype.observePerformance=function(){var n=this;P()&&new PerformanceObserver(function(t){var e=t.getEntries();e.length&&n.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Tt.monitorName=Mt,Tt);function Tt(t){var e,n,r,o=this;this.name=Mt,this.callback=R,this.getResourcePerformance=function(){var t;return null!==(t=o.getPerformance())&&void 0!==t?t:{}},this.isAsync=null!==(e=null==t?void 0:t.isAsync)&&void 0!==e?e:0,this.observe=null!==(n=null==t?void 0:t.observe)&&void 0!==n&&n,this.checkIgnore=null!==(r=null==t?void 0:t.checkIgnore)&&void 0!==r?r:function(){return!1}}var kt={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},_t="PerformanceMonitor",Rt=(xt.prototype.setup=function(t){var e,n,r,o,i=this;c()&&(this.callback=t,n=function(){i.hasLoaded=!0,i.performanceAuto&&setTimeout(function(){i.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){n()},0)},!1):n(),this.sendParams=f({},kt),this.staticPerformanceMonitor=new Et,this.staticPerformanceMonitor.setup(),(new gt).setup(this.hasFID),this.mpfidMonitor=new wt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:ht,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),q(o))},xt.prototype.performanceNow=function(){var t,e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:0)},xt.prototype.getBounced=function(){return!this.hasLoaded},xt.prototype.getPaintTime=function(e){if(w()){var t=performance.getEntriesByType("paint");if(l(t)){var n=t.filter(function(t){return t.name===e});return n.length&&n[0]&&h(n[0])&&n[0].startTime||0}}return 0},xt.monitorName=_t,xt);function xt(t){var a=this;this.name=_t,this.callback=R,this.sendParams=f({},kt),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){a.initFlag&&a.hasLoaded&&(a.sendParams.isAsync&&(a.sendParams.load=Math.round(a.performanceNow()-a.initStart)),setTimeout(function(){a.perfLog()},200))},this.initAsync=function(){var t,e,n,r;a.hasSentInitPerf&&(a.sendParams=f({},kt),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Et({isAsync:1}),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new wt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:ht,a.ttiMonitor=new r({minValue:Math.round(a.performanceNow()),isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.ttiMonitor.setup(),null!==(n=null===(e=a.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==n&&n.call(e,R))},this.getPerformance=function(){return a.finalSendParams.tti||("complete"===document.readyState?a.perfLog():a.perfLog(!0)),a.buildParams(a.finalSendParams)},this.buildParams=function(t){return{name:a.name,type:"post",event:t}},this.perfLog=function(t){if(void 0===t&&(t=!1),c()){if(a.initFlag=!1,a.finalSendParams=f({},a.sendParams),!a.sendParams.isAsync){var e=a.getBounced();if(e)return a.finalSendParams.bounced=e,void a.invokeCallback(0,a.buildParams(a.finalSendParams));a.finalSendParams=f(f({},a.finalSendParams),a.getParams())}var n=a.getStaticResources(),r=a.getFMP(),o=a.getMPFID();n&&(a.finalSendParams.resources=n,a.finalSendParams.has_resource=1),r&&(a.finalSendParams.fmp=Math.round(r)),r&&a.finalSendParams.fcp&&a.finalSendParams.fmp<a.finalSendParams.fcp&&(a.finalSendParams.fmp=a.finalSendParams.fcp),o&&(a.finalSendParams.mpfid=o),m(a.callback)&&(!t&&a.ttiMonitor&&m(a.ttiMonitor.getTTI)?a.ttiMonitor.getTTI(function(t){t&&0<t&&(a.finalSendParams.tti=a.finalSendParams.isAsync?Math.round(t-a.initStart):t),a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams))}):a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams)))}},this.invokeCallback=function(t,e){if(!t){if(a.hasSentInitPerf)return;a.hasSentInitPerf=!0}a.callback(e)},this.getStaticResources=function(){var t;if(a.staticPerformanceMonitor&&m(a.staticPerformanceMonitor.getResourcePerformance)){var e=a.staticPerformanceMonitor.getResourcePerformance();if(null!==(t=null==e?void 0:e.event)&&void 0!==t&&t.resources)return e.event.resources||[]}},this.getFMP=function(){var t,e,n,r;return a.fmpMonitor?(a.fmpMonitor.disconnect(),a.sendParams.isAsync?(null===(t=null==(r=a.fmpMonitor.getFmp())?void 0:r.event)||void 0===t?void 0:t.fmp)||0:m(a.fmpMonitor.getLoadFmp)?1!==a.props.renderType?2===a.props.renderType?a.getPaintTime("first-contentful-paint"):0:null!==(n=null===(e=(r=a.fmpMonitor.getLoadFmp()||{}).event)||void 0===e?void 0:e.fmp)&&void 0!==n?n:0:0):0},this.getMPFID=function(){if(a.mpfidMonitor&&m(a.mpfidMonitor.getMPFID)){var t=a.mpfidMonitor.getMPFID();if(t)return t.mpfid}},this.syncPerfLog=function(){var t,e;a.hasSentInitPerf||(a.perfLog(!0),null!==(e=(t=a.props).report)&&void 0!==e&&e.call(t))},this.hasFID=function(t){a.sendParams.fid=t.fid},this.getParams=function(){if(c()){var t={},e=window.performance.timing;t.dns=e.domainLookupEnd-e.domainLookupStart,t.tcp=e.connectEnd-e.connectStart,t.request=e.responseStart-e.requestStart,t.response=e.responseEnd-e.responseStart,t.processing=e.domComplete-e.domLoading,t.blank=e.responseEnd-e.navigationStart,t.domready=e.domInteractive-e.navigationStart,t.load=e.loadEventEnd-e.navigationStart,e.secureConnectionStart&&(t.ssl=e.connectEnd-e.secureConnectionStart),t.domparse=e.domInteractive-e.responseEnd,t.resource=e.loadEventStart-e.domContentLoadedEventEnd,t.ttfb=e.responseStart-e.requestStart,t.redirect=e.redirectEnd-e.redirectStart;var n=a.getPaintTime("first-paint"),r=a.getPaintTime("first-contentful-paint");n&&(t.fp=Math.round(n)),r&&(t.fcp=Math.round(r));var o=function(){if(!w())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=c()?window.performance.timing:null;return(o||i)&&(t.navigation=null!=o?o:i),i&&(t.timing=i),o&&(t.navigation_timing=o),t}},t.fmpMonitor&&(this.fmpMonitor=t.fmpMonitor);var e=t.performanceAuto;this.performanceAuto=void 0===e||e,this.props=null!=t?t:{}}var Lt="StaticErrorMonitor",Ct=(Ht.prototype.setup=function(t){u()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Ht.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ot(t,"href"):Ot(t,"src")},Ht.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=k(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Ht.monitorName=Lt,Ht);function Ht(){var s=this;this.name=Lt,this.callback=R,this.buildEvent=function(t){var e,n,r,o=t||window.event||{};try{r=null!==(n=null!==(e=o.target)&&void 0!==e?e:o.srcElement)&&void 0!==n?n:{}}catch(o){return}var i=r.tagName;if(i&&y(i)){i=i.toLowerCase();var a=s.getSrc(r);if(a&&a!==window.location.href)return{name:s.name,type:"get",event:s.getParams(a,i)}}},this.staticErrorLog=function(t){var e=s.buildEvent(t);e&&s.callback(e)}}function Ot(t,e){var n,r;return t.getAttribute&&m(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var qt="BreadcrumbMonitor",jt=(It.prototype.setup=function(){this.instrumentDOM()},It.prototype.instrumentDOM=function(){var t;"document"in window&&(t=this,window.document.addEventListener("click",t.domEventHandler("click",t.triggerHandlers.bind(t,"dom")),!1),window.document.addEventListener("keypress",t.keypressEventHandler(t.triggerHandlers.bind(t,"dom")),!1))},It.prototype.domEventHandler=function(e,n,r){var o=this;return void 0===r&&(r=!1),function(t){o.keypressTimeout=void 0,t&&o.lastCapturedEvent!==t&&(o.lastCapturedEvent=t,o.debounceTimer&&clearTimeout(o.debounceTimer),r?o.debounceTimer=setTimeout(function(){n({event:t,name:e})}):n({event:t,name:e}))}},It.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},It.prototype.keypressEventHandler=function(r){var o=this;return function(t){var e;try{e=t.target}catch(t){return}var n=e&&e.tagName;n&&("INPUT"===n||"TEXTAREA"===n||e.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",r)(t),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},It.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?mt(t.event.target):mt(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},It.monitorName=qt,It);function It(){var r=this;this.name=qt,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(t,e){var n=f(f({},t),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==e&&0<=e?a(r.breadcrumbs,[n]).slice(-e):a(r.breadcrumbs,[n]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var At=(Ft.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},Ft.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},Ft.prototype._modifyEvent=function(t){return t},Ft.prototype._shouldSend=function(t){return!0},Ft.prototype._send=function(t){},Ft.prototype.idleSendEvent=function(t){this._send(t)},Ft);function Ft(){}var Dt={enableCatchGlobalJSError:!0},Bt="JSExceptionMonitor",Nt=(Ut.prototype.setup=function(t){u()&&(this.callback=t,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Ut.prototype.buildEvent=function(t){var e;if(!function(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return t instanceof Error}}(t)?(o(t)&&(e={message:JSON.stringify(t)}),y(t)&&(e={message:t})):e=t,e){var n={ev_type:"js_exception",exception:this.normalizeError(e)};return{name:this.name,type:"post",event:n}}},Ut.prototype.logError=function(t){var e=this.buildEvent(t);e&&this.callback(e)},Ut.prototype.getJSError=function(t){var e=t.error;if(e)return e},Ut.prototype.getJSPromiseRejection=function(t){var e=void 0;try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}if(e)return e},Ut.prototype.normalizeError=function(t){return{message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop}},Ut.monitorName=Bt,Ut);function Ut(t){var n=this;this.name=Bt,this.callback=R,this.jsErrorLog=function(t){var e=n.getJSError(t);e&&n.logError(e)},this.jsPromiseRejectionLog=function(t){var e=n.getJSPromiseRejection(t);e&&n.logError(e)},this.options=f(f({},Dt),t)}var Jt,Xt=(t(Vt,Jt=At),Object.defineProperty(Vt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Vt.prototype._send=function(t){var e=this,n=this.buildParams(t);null!=n&&(this.reportQueue.push(n),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){e._uploadQueue()},this.batchReportWait)))},Vt.prototype._uploadQueue=function(){var t;this.reportQueue.length&&this.ready&&(t={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:t,type:"post"}))},Vt.prototype._request=function(t){},Vt);function Vt(t){var e,n,r=Jt.call(this)||this;return r.reportQueue=[],r.isReady=!0,r.batchReportLength=null!==(e=t.maxBatchReportLength)&&void 0!==e?e:10,r.batchReportWait=null!==(n=t.batchReportWait)&&void 0!==n?n:1e3,r.batchReportTimeout=null,r}function Qt(t){return!!t&&Math.random()<Number(t)}var zt;t(Kt,zt=Xt),Kt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Kt.prototype,"contextAgent",{get:function(){var o=this,n={set:function(t,e){return o.options&&(o.options.commonParams.context||(o.options.commonParams.context={}),o.options.commonParams.context[t]=e),n},delete:function(t){var e;return null!==(e=o.options)&&void 0!==e&&e.commonParams.context&&"string"!=typeof o.options.commonParams.context&&p(o.options.commonParams.context,t)&&delete o.options.commonParams.context[t],n},clear:function(){return o.options&&(o.options.commonParams.context={}),n},get:function(t){var e,n,r;return null===(r=null===(n=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.context)||void 0===r?void 0:r[t]},toObject:function(){var t,e,n;return"string"==typeof(null===(t=o.options)||void 0===t?void 0:t.commonParams.context)?{}:f({},null===(n=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.context)}};return n},enumerable:!1,configurable:!0}),Kt.prototype._shouldSend=function(t){var e,n;if(!(null!==(e=this.options)&&void 0!==e&&e.monitors&&t&&h(t)&&null!==(n=t.event)&&void 0!==n&&n.ev_type))return!1;var r=this.options.monitors;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){var o=O(W||[]);if(o&&o.test(t.event.ax_url))return!1}return!!r.BaseMonitor.webIDHit||!!r.BaseMonitor.sampleHit&&("PathMonitor"===t.name?function(t){var e=t.sendParams,n=t.pageViewMonitor,r=t.baseMonitor;if(1!==r.appTypeSetting.type||e.event.type!==r.appTypeSetting.SPA)return!1;if(!n)return!0;if(n.webIDHit)return!0;return!!n.sampleHit}({sendParams:t,pageViewMonitor:r.PageViewMonitor,baseMonitor:r.BaseMonitor}):"PageViewMonitor"===t.name?Gt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?Wt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?$t({performanceMonitor:r.PerformanceMonitor}):"EmitMonitor"===t.name?function(t){var e=t.sendParams,n=t.flexibleMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=n.eventNameHit;if(r){var o=e.event.flexible_data_list[0].event_name;if(r&&p(r,o))return Qt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Yt({sendParams:t,staticErrorMonitor:r.StaticErrorMonitor}):"HijackMonitor"===t.name?function(t){var e=t.hijackMonitor;if(!e)return!0;if(e.webIDHit)return!0;return!!e.sampleHit}({hijackMonitor:r.HijackMonitor}):"JSErrorMonitor"!==t.name||Zt({jsErrorMonitor:r.JSErrorMonitor}))},Kt.prototype._modifyEvent=function(t){var e;if(null===(e=this.options)||void 0===e||!e.monitors||!t||!h(t))return{};var n=this.options.monitors;return"PerformanceMonitor"===t.name?function(t){var e,a=t.sendParams,n=t.performanceMonitor;if(!n)return a;if(!c())return{};{var r;e=a.event.isAsync?a.event.load>n.spaSlowSessionTime:(r=window.performance.timing,r.loadEventEnd-r.navigationStart>n.slowSessionTime)}{var s;a.event.resources&&l(a.event.resources)&&(s=O(n.geckoUrls||[]),a.event.resources.forEach(function(t,e){var n,r,o,i;null!==(n=a.event.resources)&&void 0!==n&&n[e]&&h(null===(r=a.event.resources)||void 0===r?void 0:r[e])&&m(null===(o=a.event.resources)||void 0===o?void 0:o[e].toJSON)&&(a.event.resources[e]=null===(i=a.event.resources)||void 0===i?void 0:i[e].toJSON(),a.event.resources[e].is_gecko=s&&s.test(t.name||"")?"1":"0")}))}n.webIDHitStaticResource||n.sampleHitStaticResource?a.event.upload_reason="sample":e?a.event.upload_reason="slow_session":(delete a.event.resources,a.event.has_resource=0);return a}({sendParams:t,performanceMonitor:n.PerformanceMonitor}):"PathMonitor"===t.name?function(t){var e=t.sendParams,n=t.baseMonitor,r=t.effect;1===n.appTypeSetting.type&&n.appTypeSetting.SPA===e.event.type&&(r({commonParams:{pid:e.event.path}}),delete e.event.type,delete e.event.path);return{}}({sendParams:t,baseMonitor:n.BaseMonitor,effect:this.updateConfig}):t},Kt.prototype.buildParams=function(t){var e,n,r,o,i,a,s=t.event||{},u=t.overrides,c=f({},null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{});h(null==u?void 0:u.context)&&(a=f(f({},null!==(r=h(c.context)&&c.context)&&void 0!==r?r:{}),null!==(o=null==u?void 0:u.context)&&void 0!==o?o:{}),c.context=a);var l=f(f(f({},s),null!=c?c:{}),s),l=this.normalizeEvent(l);return null!==(i=this.options)&&void 0!==i&&i.custom&&m(this.options.custom.beforeSend)&&(l=this.options.custom.beforeSend(l||{})),l},Kt.prototype._request=function(t){var e,n,r,o;t&&t.event&&(n=t.type,r=t.event,"beacon"===(null===(e=this.options)||void 0===e?void 0:e.commonParams.report_type)&&navigator&&navigator.sendBeacon?(o=JSON.stringify(r),navigator.sendBeacon(this.getReportURL(),o)):this.transport&&("get"!==n?"post"===n&&this.transport.postEvent(r):this.transport.getEvent(r)))},Kt.prototype.chechIsReady=function(){return 2===this.clientStatus},Kt.prototype.updateStatus=function(){var e=this;switch(this.clientStatus){case 0:this.clientStatus=1;break;case 1:if(this.clientStatus=2,!this.preQueue.length)return;this.preQueue.forEach(function(t){zt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},Kt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Kt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Kt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Kt.prototype.normalizeEvent=function(t){var e=f(f({},t),{url:window.location.href});return h(t.context)&&(e.context=JSON.stringify(t.context)),e||{}};function Kt(t){var e,i=zt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new F({reportURL:i.getReportURL()}),i.updateStatus())},i.uploadQueue=function(){i._uploadQueue()},i.updateConfig=function(t){var e,n,r,o=null===(n=null===(e=i.options)||void 0===e?void 0:e.commonParams)||void 0===n?void 0:n.pid;i.options=i.normalizeOptions(t),o&&null!==(r=null==t?void 0:t.commonParams)&&void 0!==r&&r.pid&&t.commonParams.pid!==o&&i.sendPageview()},i.sendPageview=function(){m(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?zt.prototype.sendEvent.call(i,t):i.preQueue.push(t)},i.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",i.preQueue=[],i.clientStatus=0,i.enable=!1,i}function Wt(t){var n=t.sendParams,e=t.ajaxMonitor;if(!e)return!0;if(e.webIDHit)return!0;if(!e.sampleHit)return!1;var r=e.whitelistUrls;if(l(r)&&0<r.length){var o=O(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=O(e.ignore||[]);if(i&&i.test(n.event.ax_url))return!1;var a=e.statusCodeSample;if(a&&p(a,n.event.ax_status))return Qt(a[n.event.ax_status]);var s=e.requestUrlSample;if(s){var u=!1,c=!1;if(s.forEach(function(t){var e;u||null!=(e=O([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Qt(t.sampleRate))}),u)return c}return!0}function Gt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function $t(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=O(n.ignore||[]);return!r||!r.test(e.event.st_src)}function Zt(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function te(t){var e,n,r=t.setting,o=t.info,i=b({PageViewMonitor:{},JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},FlexibleMonitor:{},StaticErrorMonitor:{},HijackMonitor:{},BaseMonitor:{appTypeSetting:{}}},r.monitors);r.ajaxWhitelistUrls&&l(r.ajaxWhitelistUrls)&&(i.AjaxMonitor.whitelistUrls=(i.AjaxMonitor.whitelistUrls||[]).concat(r.ajaxWhitelistUrls)),r.ignoreAjax&&l(r.ignoreAjax)&&(i.AjaxMonitor.ignore=(i.AjaxMonitor.ignore||[]).concat(r.ignoreAjax)),p(r,"geckoUrls")&&(i.PerformanceMonitor.geckoUrls=r.geckoUrls),r.ignoreStatic&&l(r.ignoreStatic)&&(i.StaticErrorMonitor.ignore=(i.StaticErrorMonitor.ignore||[]).concat(r.ignoreStatic)),null!==(e=r.plugins)&&void 0!==e&&e.sentry&&(i.JSErrorMonitor=f(f({},i.JSErrorMonitor||{}),r.plugins.sentry)),r.errorRelease&&(i.JSErrorMonitor.release=r.errorRelease),r.ignoreErrors&&l(r.ignoreErrors)&&(i.JSErrorMonitor.ignoreErrors=r.ignoreErrors),r.errorBlacklistUrls&&l(r.errorBlacklistUrls)&&(i.JSErrorMonitor.blacklistUrls=r.errorBlacklistUrls),r.errorWhitelistUrls&&l(r.errorWhitelistUrls)&&(i.JSErrorMonitor.whitelistUrls=r.errorWhitelistUrls),p(r,"sampleRate")&&(i.BaseMonitor.sampleHit=Qt(r.sampleRate));var a,s,u,c=r.plugins;return c&&h(c)&&(p(c,"spa")&&((a=c.spa)&&p(a,"enable")&&(i.BaseMonitor.appTypeSetting.type=Number(a.enable)),a&&p(a,"type")&&(i.BaseMonitor.appTypeSetting.SPA=a.type)),!c.render||(s=null===(n=r.plugins)||void 0===n?void 0:n.render)&&h(s)&&p(s,"enable")&&(u=[{pids:[],value:s.enable,isDefault:!0}],i.BaseMonitor.appTypeSetting.renderType=function(t){var e=t.renderRules,n=t.pid;if(!e||!n)return 0;for(var r=0;r<e.length;r++){var o=e[r];if(l(o.pids)&&0<o.pids.length){var i=O(o.pids);if(i&&i.test(n))return o.value}if(o.isDefault&&r===e.length-1)return o.value}return 0}({renderRules:u,pid:o.pid}))),i}var ee="RANGERS_WEB_ID";function ne(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:A(1)},PageViewMonitor:{webIDHit:!1,sampleHit:A(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:A(1),sampleHitTrace:!1,ignore:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(z),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:W},HijackMonitor:{webIDHit:!1,sampleHit:A(K)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.6",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:Q(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:j(),network_type:I()},t}function re(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=g(o),s=a.next();!s.done;s=a.next()){var u=s.value.split("="),c=y(u[0])&&u[0].trim();c&&y(u[1])&&(i[c]=u[1].trim())}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i[e]||""}(document.cookie,ee)&&(document.cookie=ee+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var oe,ie,ae,se,ue=(oe="/v2/user/webid",ie="/v2/user/ssid",ae="/v2/event/list",se=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[oe,ie,ae].forEach(function(t){se.push(e+t)})}),se);function ce(t){var e=t.sendParams,n=t.commonParams,r=t.custom,o=function(t){var e,n=t.sendParams,r=t.commonParams,o=t.breadcrumbMonitor,i={};if(i.ev_type=n.event.ev_type,i.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,v(a,["ev_type"]));return i.event=s,i}if("PerformanceMonitor"===n.name&&i){n.event.navigation=n.event.navigation_timing;var u=n.event,c=(u.ev_type,v(u,["ev_type"]));return i.ev_type="performance",i.event={fp:c.fp,fcp:c.fcp,fmp:c.fmp,tti:c.tti,fid:c.fid,mpfid:c.mpfid,isAsync:c.isAsync,timing:c.timing,navigation:c.navigation_timing,bounced:c.bounced},i}if("StaticErrorMonitor"===n.name&&i){i.ev_type="resource_error";var l=n.event,p=(l.ev_type,v(l,["ev_type"]));return i.event=p,i}if("ResourcePerformanceMonitor"===n.name&&i){i.ev_type="resource";var d=n.event,h=(d.ev_type,v(d,["ev_type"]));return i.event=h,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var f=n.event,m=(f.ev_type,v(f,["ev_type"]));return i.event=m.exception,i.breadcrumbs=null!==(e=null==o?void 0:o.getBreadcrumbs())&&void 0!==e?e:[],i}return i}({sendParams:e,commonParams:f(f({},null!=n?n:{}),{url:window.location.href})});return r&&m(r.beforeSend)&&(o=r.beforeSend(o||{})),o}function le(){return"https://tbm.snssdk.com/monitor_browser/collect"}var pe,de=(t(he,pe=Xt),he.prototype._shouldSend=function(t){return function(t){var e=t.sendParams,n=t.monitorsSetting;if(!e||!h(e)||!e.event)return!1;var r=n;if("AjaxMonitor"===e.name||"FetchMonitor"===e.name){var o=O(a(["/monitor_browser/collect"],ue)||[]);if(o&&o.test(e.event.ax_url))return!1}return!(null==r||!r.BaseMonitor.webIDHit)||!(null==r||!r.BaseMonitor.sampleHit)&&("AjaxMonitor"===e.name||"FetchMonitor"===e.name?Wt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?$t({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Yt({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?Zt({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Gt({pageViewMonitor:r.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},he.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},he.prototype._request=function(t){var e,n,r;t&&t.event&&(e=t.type,n=t.event,"beacon"===this.options.reportType&&navigator&&navigator.sendBeacon?(r=JSON.stringify(n),navigator.sendBeacon(this.getReportURL(),r)):this.transport&&("get"!==e?"post"===e&&this.transport.postEvent(n):this.transport.getEvent(n)))},he.prototype.buildParams=function(t){return ce({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},he.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},he.prototype.getBatchReportURL=le,he);function he(t){var e,h=pe.call(this,t)||this;return h.options={},h.setTransport=function(){h.transport=new F({reportURL:h.getReportURL()}),h.preQueue.forEach(function(t){pe.prototype.sendEvent.call(h,t)})},h.updateConfig=function(t){var e,n,r,o,i,a,s,u,c,l,p,d;h.options=(e={previousOptions:h.options,newOptions:t},l=e.previousOptions,p=e.newOptions,(d=f(f({},l),p)).commonParams=b({},null!==(n=l.commonParams)&&void 0!==n?n:{},null!==(r=p.commonParams)&&void 0!==r?r:{}),d.monitorsSetting=b({},null!==(o=l.monitorsSetting)&&void 0!==o?o:{},null!==(i=p.monitorsSetting)&&void 0!==i?i:{}),d.monitors=f(f({},null!==(a=l.monitors)&&void 0!==a?a:{}),null!==(s=p.monitors)&&void 0!==s?s:{}),d.custom=f(f({},null!==(u=l.custom)&&void 0!==u?u:{}),null!==(c=p.custom)&&void 0!==c?c:{}),d)},h.sendEvent=function(t){h.transport?pe.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.uploadQueue=function(){h._uploadQueue()},h.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",h.preQueue=[],h}var fe,me=(ve.prototype.getUserIDFromRangers=function(e){window.collectEvent&&m(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},ve.prototype.init=function(t){var n=this;this.client=new de(this.getClientOptions(t)),this.getUserIDFromRangers(function(t){var e=n.normalizeSetting({user_unique_id:t.user_unique_id});n.client.updateConfig(n.getClientOptions(e)),n.client.setTransport()}),this.sendPageview();var e=this.setMonitors();this.setupMonitors(e)},ve.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},ve.prototype.setMonitors=function(){var t,e,n=[],r=this.baseSetting.flags,o=new at;return n.push(o),r.enableCatchJSError&&n.push(new Nt),r.hookXHR&&n.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new rt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Ct),r.enablePerformance&&(r.enableFMP?n.push(new Rt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new Rt({renderType:1,preLongTaskObserver:{precollect:(null===(t=window.RangersSiteSDK.lt)||void 0===t?void 0:t.e)||[],observer:null===(e=window.RangersSiteSDK.lt)||void 0===e?void 0:e.o}}))),r.enableBreadcrumb&&n.push(new jt),r.enableResourcePerformance&&n.push(new Et({observe:!0,checkIgnore:function(t){return t.name===le()||("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType||"beacon"===t.initiatorType||"navigation"===t.initiatorType||0===t.decodedBodySize)}})),n},ve.prototype.setupMonitors=function(t){var n=this;this.client&&this.client.sendEvent&&(t.forEach(function(t){var e;"FMPMonitor"===(n.monitors[t.name]=t).name?t.setup(R):t.setup(null===(e=n.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ve.prototype.normalizeSetting=function(t){var e={commonParams:this.getClientCommonParams(t),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(t),custom:this.getClientCustom(t)},n={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},r=this.baseSetting;return this.baseSetting=b({},this.baseSetting,e,n),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,r),this.baseSetting},ve.prototype.settingEffect=function(t,e){re(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},ve.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ve.prototype.getClientCommonParams=function(n){void 0===n&&(n={});var r={};if(!h(n))return r;var o=["context","pid"];i(n,function(t,e){s(o,t)&&(r[t]=e)});return i({user_unique_id:"rangers_web_id",app_id:"aid"},function(t,e){p(n,t)&&(r[e]=n[t])}),r},ve.prototype.getClientFlags=function(t){return function(t){var e;void 0===t&&(t={});var n=b({},null!==(e=t.flags)&&void 0!==e?e:{});if(!h(t))return n;var r=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return i(t,function(t,e){s(r,t)&&(n[t]=e)}),n}(f(f({},t),{flags:this.baseSetting.flags}))},ve.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&m(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},ve.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},ve.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return te({setting:e,info:this.getNormoalizeInfo()})},ve);function ve(){var o=this;this.version="0.2.6",this.instance=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("config"!==t[0])o.client&&o.onClose();else{if(!h(t[1]))return;var n=t[1];o.userSetting=f(f({},o.userSetting||{}),n||{});var r=o.normalizeSetting(n);o.client?o.client.updateConfig(o.getClientOptions(r)):o.init(r)}},this.changeReortType=function(t){var e;null!==(e=o.client)&&void 0!==e&&e.updateConfig({reportType:t})},this.onClose=function(){q(o.onCloseReport,o.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&o.onCloseReport(),"visible"===document.visibilityState&&o.changeReortType("xhr")},this.onCloseReport=function(){var t;o.changeReortType("beacon"),null!==(t=o.client)&&void 0!==t&&t.uploadQueue()},this.baseSetting=ne(),this.client=void 0,this.userSetting={},this.monitors={}}var ge,ye,be=R;return u()&&(ge=new me,be=ge.instance,null!==(fe=window.RangersSiteSDK)&&void 0!==fe&&fe.q&&(l(ye=window.RangersSiteSDK.q)&&ye.forEach(function(t){be.apply(void 0,a(t))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=ge.instance),be}();

@@ -1,1 +0,1 @@

var RangersSiteHybridSDK=function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function v(t,e){var r={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function h(t){return"object"==typeof t&&null!==t&&!l(t)}function o(t){return"[object Object]"===(e=t,Object.prototype.toString.call(e));var e}function m(t){return"function"==typeof t}function y(t){return"[object String]"===Object.prototype.toString.call(t)}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(t,e){if(h(t))for(var r in t)p(t,r)&&e.call(null,r,t[r])}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r={},n=0;n<t.length;)r=function t(e,r){var n=f({},e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&void 0!==r[o]&&(h(e[o])&&h(r[o])?n[o]=t(e[o],r[o]):!h(e[o])&&h(r[o])?n[o]=t({},r[o]):n[o]=r[o]);return n}(r,t[n]),n++;return r}function s(t,e){if(!l(t))return!1;if(0===t.length)return!1;for(var r=0;r<t.length;){if(t[r]===e)return!0;r++}return!1}function e(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(t){return}}function u(){return!!h(window)}function r(){return!(!u()||!h(window.performance))}function c(){return!(!r()||!h(window.performance.timing))}function w(){return!!r()&&!!m(window.performance.getEntries)}function S(){return u()&&"function"==typeof window.MutationObserver}function P(){return u()&&"function"==typeof window.PerformanceObserver}function M(){return!!P()&&m(window.PerformanceLongTaskTiming)}function T(){if(!P())return!1;var t=window.PerformanceObserverEntryList;return m(t)&&m(t.prototype.getEntries)}function E(t){var r,e=function(t){if(!h(t))return{};var r={};return i(t,function(t,e){h(e)||l(e)?r[t]=JSON.stringify(e):r[t]=e}),r}(t),n=(r={},i(e,function(t,e){r[encodeURIComponent(t)]=encodeURIComponent(e)}),r),o=[];return i(n,function(t,e){o.push(t+"="+e)}),o.join("&")}function k(t){var e=document.createElement("a");e.href=t;var r=e.pathname||"/";return"/"!==r[0]&&(r="/"+r),{href:e.href,protocol:e.protocol.slice(0,-1),hostname:e.hostname,host:e.host,search:e.search,pathname:r,hash:e.hash}}var _=function(t){if(!y(t))return!1;var e=t;return m(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function x(){}function R(t){var e="[object String]"===Object.prototype.toString.call(t);return t?e?t.length:ArrayBuffer&&t instanceof ArrayBuffer?t.byteLength:window.Blob&&t instanceof Blob?t.size:t.length?t.length:0:0}function H(t){if(!t)return"";if(!m(t.forEach))return"";var n=[];return t.forEach(function(t){var e,r;l(t)&&t[0]&&!_(t[0])&&(e=t[0],r=t[1]||"",n.push(e+": "+r))}),n.join("\r\n")}function C(t){var e={},r=k(t);return e.ax_protocol=r.protocol,e.ax_domain=r.hostname,e.ax_path=r.pathname,e.ax_url=(r.href||t).split("?")[0],e}function L(t,e){var r=k(t),n=k(e);return r.protocol===n.protocol&&r.host===n.host}function O(t){return l(t)&&t.length?function(t){for(var e=[],r=t.length,n=0;n<r;n++){var o=t[n];y(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(t):null}function j(e,r){m(e)&&(m(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),m(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){m(r)?r(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,r;return void 0===t&&(t=window),u()&&null!==(e=t.screen)&&void 0!==e&&e.width&&null!==(r=t.screen)&&void 0!==r&&r.height?t.screen.width+"x"+t.screen.height:"0x0"},I=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function A(t){return!!t&&Math.random()<Number(t)}var D=(F.post=function(t,e,r){var n,o,i=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:x,a=null!==(o=null==r?void 0:r.fail)&&void 0!==o?o:x,s=new XMLHttpRequest;s.open("POST",t,!0),s.setRequestHeader("Content-Type","application/json"),s.send(JSON.stringify(e)),s.onload=function(){try{var t;this.responseText?(t=JSON.parse(this.responseText),i(t)):i({})}catch(t){a()}},s.onerror=function(){a()},s.onabort=function(){a()}},F.get=function(t,e){var r,n,o,i,a=null!==(r=null==e?void 0:e.success)&&void 0!==r?r:x,s=null!==(n=null==e?void 0:e.fail)&&void 0!==n?n:x,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:x,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:x,l=new XMLHttpRequest;l.open("GET",t),l.send(),l.onload=function(){u(null==this?void 0:this.response),c(this.responseText);try{var t;this.responseText?(t=JSON.parse(this.responseText),a(t)):a({})}catch(t){s()}},l.onerror=function(){s()},l.onabort=function(){s()}},F.prototype.getCommonParams=function(){return{timestamp:Date.now()}},F);function F(t){var n=this;this.postEvent=function(t){var e=f(f({},t),n.getCommonParams());F.post(n.url,e)},this.getEvent=function(t){var e=E(f(f({},t),n.getCommonParams())),r=n.url+"?"+e;F.get(r)},this.getURL=function(){return n.url},this.options=t,this.url=this.options.reportURL}function B(t,e,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+t.length);return t.length>=e?t:""+Array.from({length:e-t.length}).fill(r).join("")+t}function N(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var J="x-tt-trace-id",U="x-tt-trace-host",X="x-tt-logid";function V(t,e,r){void 0===r&&(r="01");var n=""+B((Date.now()%4294967295).toString(16),8)+function(t){var e;if("number"==typeof t)e=t;else{var r=t.replace(/-/g,"");if(!/^[0-9]+$/.test(r)){if(18<r.length)return"18"+N(18);var n=22-r.length-4;return""+B(""+r.length,2)+r+N(n)}e=parseInt(r,10)}var o=e.toString(16),i=22-o.length-4;return""+B(""+o.length,2)+o+N(i)}(t)+("string"==typeof e?N(4):B(e.toString(16),4));return"00-"+n+"-"+n.substr(0,16)+"-"+r}function Q(){var t=function(){for(var t=new Array(16),e=0,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),t[r]=e>>>((3&r)<<3)&255;return t}();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(t){for(var e=[],r=0;r<256;++r)e[r]=(r+256).toString(16).substr(1);var n=0;return[e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],e[t[15]]].join("")}(t)}var z=.1,K=.1,W=["/log/sentry/"],G=8e3,$=4e3;Q(),Q();var Y="AjaxMonitor",Z=(tt.prototype.setup=function(t){void 0===t&&(t=x),m(XMLHttpRequest)&&(this.callback=t,this.start())},tt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},tt.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},tt.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||x;XMLHttpRequest.prototype.setRequestHeader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(t),r.apply(this,t)}},tt.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,t)}},tt.prototype.hookXMLHttpRequestSend=function(){var a=this,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var t,e,r,n,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return a.checkAddTrace(this._url)&&(r=(e=null!==(t=null==a?void 0:a.props.commonParams)&&void 0!==t?t:{}).bid,n=e.web_id,r&&n&&(a.traceId=V(n,r),this.setRequestHeader(J,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},tt.prototype.checkAddTrace=function(t){var e,r,n=null!==(e=this.props.commonParams)&&void 0!==e?e:{},o=n.bid,i=n.web_id,a=(null!==(r=this.props.ajaxMonitorOptions)&&void 0!==r?r:{}).sampleHitTrace,s=L(location.href,t);return o&&i&&a&&s},tt.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},tt.prototype.hookXMLHttpRequestOnreadystatechange=function(l){var p=this.onreadystatechange,d=this;this.onreadystatechange=function(){for(var t,e,r,n,o,i,a,s,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];if(4===this.readyState&&(a={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:d._method,ax_request_header:H(d._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(a.ax_response_header=function(e){if(y(e)){var t=e.split("\r\n"),n=[];return t.forEach(function(t,e){var r;t&&m(t.split)&&(r=t.split(": "),n.push([r[0],r[1]]))}),H(n)}return h(e)?H(Object.keys(e).map(function(t){return[t,e[t]]})):e}(this.getAllResponseHeaders())),!l.checkAddTrace(d._url)||(s=null!==(t=l.traceId)&&void 0!==t?t:this.getResponseHeader(J))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(r=this.getResponseHeader(X))&&void 0!==r?r:void 0),a.ax_duration=Date.now()-d._start,200===this.status&&(a.ax_size=function(t){var e=0;if(""===t.responseType||"text"===t.responseType)e=R(t.responseText);else if(t.response)e=R(t.response);else try{e=R(t.responseText)}catch(t){e=0}return e}(this)),a=f(f({},a),C(d._url)),l.collectErrorRequest()&&"2"!==a.ax_status[0]&&"3"!==a.ax_status[0]&&(a.ax_request={body:d._data?""+d._data:void 0,search:null===(n=k(d._url))||void 0===n?void 0:n.search,content_type:null===(i=null===(o=d._requestHeaders)||void 0===o?void 0:o.find(function(t){return"content-type"===t[0].toLowerCase()}))||void 0===i?void 0:i[1]}),m(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},tt.monitorName=Y,tt);function tt(t){this.name=Y,this.callback=x,this.traceId=null,this.props=t}function et(t){return t instanceof Request}var rt="FetchMonitor",nt=(ot.prototype.updateConfig=function(t){this.props=b({},this.props,t)},ot.prototype.setup=function(t){void 0===t&&(t=x),e()&&(this.callback=t,this.start())},ot.prototype.start=function(){e()&&this.hookFetch()},ot.prototype.checkAddTrace=function(t){var e,r,n,o,i=null!==(r=null===(e=this.props)||void 0===e?void 0:e.commonParams)&&void 0!==r?r:{},a=i.bid,s=i.web_id,u=(null!==(o=null===(n=null==this?void 0:this.props)||void 0===n?void 0:n.ajaxMonitorOptions)&&void 0!==o?o:{}).sampleHitTrace,c=L(location.href,t);return a&&s&&u&&c},ot.prototype.updateAxRequest=function(t,e,r){var n,o,i,a;this.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(a=this.getFetchUrl(e,!0),t.ax_request={body:null===(n=this.getFetchBody(e,r))||void 0===n?void 0:n.toString(),search:!y(a)||null===(o=k(a))||void 0===o?void 0:o.search,content_type:null===(i=null==r?void 0:r.headers)||void 0===i?void 0:i["Content-Type"]})},ot.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},ot.prototype.hookFetch=function(){var c=this,l=this,p=window.fetch;window.fetch=function(o,i){var t;void 0===i&&(i={});var a=c.getFetchUrl(o);if(!function(t){if(y(t)){var e=d(t.split(":"),2),r=e[0];return!e[1]||("http"===r||"https"===r)}}(a))return p(o,i);var e=null!==(t=c.props.commonParams)&&void 0!==t?t:{},r=e.bid,n=e.web_id,s=Date.now(),u={ev_type:"ajax"};try{l.checkAddTrace(a)&&(i.headers=new Headers(function(t,e){var r=new Headers;et(t)&&t.headers&&m(t.headers.forEach)&&t.headers.forEach(function(t,e){r.append(e,t)});{e.headers&&new Headers(e.headers).forEach(function(t,e){r.append(e,t)})}return r}(o,i)),r&&n&&(u.trace_id=V(r,n),i.headers.append(J,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),C(a)),p(o,i).then(function(t){var e,r,n;return u.ax_status=(t.status||0).toString(),u.ax_duration=Date.now()-s,u.ax_response_header=l.getAllHeaders(t.headers),u.ax_request_header=l.getAllHeaders(i.headers),t.headers&&m(t.headers.has)?(t.headers.has("content-length")?u.ax_size=Number(t.headers.get("content-length"))||0:u.ax_size=0,l.checkAddTrace(a)&&(t.headers.has(U)&&(u.trace_host=null!==(e=t.headers.get(U))&&void 0!==e?e:void 0),t.headers.has(J)&&(u.trace_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0),t.headers.has(X)&&(u.log_id=null!==(n=t.headers.get(X))&&void 0!==n?n:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),t},function(t){return u.ax_status="0",u.ax_size=0,u.ax_duration=Date.now()-s,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},ot.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var r="",r=et(t)?t.url:t;return e||(r=y(r)?r.split("?")[0]:r),r},ot.prototype.getFetchMethod=function(t,e){var r,n,o=null!==(r=null==e?void 0:e.method)&&void 0!==r?r:"get";return et(t)&&(o=null!==(n=t.method)&&void 0!==n?n:o),o.toLowerCase()},ot.prototype.getFetchBody=function(t,e){return et(t)?t.body:null==e?void 0:e.body},ot.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var r=[];return t.forEach(function(t,e){r.push([e,t])}),H(r)},ot.monitorName=rt,ot);function ot(t){this.name=rt,this.callback=x,this.props=t}var it="FMPMonitor",at=(st.prototype.setup=function(t){if(u())return S()?void(m(document.querySelector)&&(this.callback=t&&m(t)?t:function(){},this.startTime=Date.now(),this.list=[],m(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},st.prototype.count=function(){var t=Date.now()-this.startTime,e=document.querySelector("body");e?this.list.push({score:this.score(e,1,!1),time:t}):this.list.push({score:0,time:t})},st.prototype.score=function(t,e,r){var n=0,o=t.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){var i=t.children?t.children.length:0;if(0<i)for(var a=t.children,s=i-1;0<=s;s--)n+=this.score(a[s],e+1,0<n);if(n<=0&&!r){if(!t.getBoundingClientRect||!m(t.getBoundingClientRect))return 0;var u=t.getBoundingClientRect();if(!u)return 0;if(u.top>window.innerHeight)return 0;if(u.height<=0)return 0}n+=1+.5*e}return n},st.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var t,e={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++){this.list[r].time>=this.list[r-1].time&&(t=this.list[r].score-this.list[r-1].score,e.rate<t&&(e={time:this.list[r].time,rate:t}))}return e.time},st.prototype.getTimeGap=function(){return c()?this.startTime-performance.timing.navigationStart:0},st.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},st.monitorName=it,st);function st(){var n=this;this.name=it,this.callback=x,this.disconnect=function(){var t,e;null!==(e=null===(t=n.observer)||void 0===t?void 0:t.disconnect)&&void 0!==e&&e.call(t)},this.getLoadFmp=function(){var t=n.getFmpInternal(),e=t?n.getTimeGap()+t:0,r=n.formatEvent(e);return n.callback(r),r},this.getFmp=function(){var t=n.getFmpInternal(),e=n.formatEvent(t);return n.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ut(){}var ct=!1,lt=!1,pt={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=pt.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(t){null!=o&&o.call(e,t),4===e.readyState&&i.afterCb(n)},pt.originals.send.apply(this,t)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;e()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Promise(function(e,r){var n=pt.uniqueId++;o.beforeCb(n),i.apply(void 0,a(t)).then(function(t){o.afterCb(n),e(t)},function(t){o.afterCb(n,t),r(t)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(a){if(S()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,r;try{for(var n=g(t),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function t(e,r){var n,o;try{for(var i=g(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(r.includes(s.nodeName.toLowerCase())||s.children&&t(s.children,r))return 1}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,s)||"attributes"===i.type&&s.includes(i.target.nodeName.toLowerCase()))&&a(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}});return t.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),t}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(ct=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(lt=!1,window.fetch=this.originals.fetch)}},dt="TTIMonitor",ht=(ft.prototype.setup=function(){},ft.prototype.isEnable=function(){return M()&&!!P()&&m(window.PerformanceResourceTiming)&&T()},ft.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,r,n=t.getEntries();try{for(var o=g(n),i=o.next();!i.done;i=o.next()){var a=i.value;"resource"===a.entryType&&s.networkRequestFinishedCallback(a),"longtask"===a.entryType&&s.longTaskFinishedCallback(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(t){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ft.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ut,this.proxyConfig.afterCb=ut)},ft.prototype.rescheduleTimer=function(t){var e=this;this.scheduleTimerTasks&&(this.timerActivationTime>t||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){e.checkTTI()},t-performance.now()),this.timerActivationTime=t))},ft.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var t=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(e+5e3,t))},ft.prototype.registerListeners=function(){ct||(pt.patchXMLHTTPRequest(this.proxyConfig),ct=!0),lt||(pt.patchFetch(this.proxyConfig),lt=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ft.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ft.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ft.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ft.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ft.prototype,"incompleteRequestStarts",{get:function(){for(var t=Object.keys(this.incompleteJSInitiatedRequestStartTimes),e=[],r=0;r<t.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[t[r]];"number"==typeof n&&e.push(n)}return e},enumerable:!1,configurable:!0}),ft.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ft.prototype.checkTTI=function(){var t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),e=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(t+5e3,n+1e3));var o=this.computeTTI(e,r,t,n,this.longTasks);o?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(o)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ft.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ft.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ft.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ft.prototype.computeLastKnownNetwork2Busy=function(t,e){var r,n,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=g(e),u=s.next();!u.done;u=s.next()){var c=u.value;a.push({timestamp:c.start,type:"requestStart"}),a.push({timestamp:c.end,type:"requestEnd"})}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}try{for(var l=g(t),p=l.next();!p.done;p=l.next()){var d=p.value;a.push({timestamp:d,type:"requestStart"})}}catch(t){o={error:t}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}a.sort(function(t,e){return t.timestamp-e.timestamp});for(var h=t.length,f=a.length-1;0<=f;f--){var m=a[f];switch(m.type){case"requestStart":h--;break;case"requestEnd":if(2<++h)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ft.monitorName=dt,ft);function ft(t){var e,r,n,o,i,a,s=this;if(this.name=dt,this.longTasks=[],this.callback=ut,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(t){s.callback=t,s.isEnable()?s.startSchedulingTimerTasks():s.callback&&"function"==typeof s.callback&&s.callback()},this.computeTTI=function(t,e,r,n,o){if(n-r<5e3)return null;var i=0===o.length?t:o[o.length-1].end;return n-i<5e3?null:Math.max(i,e)},this.isEnable()){if(this.useMutationObserver=!!t.useMutationObserver,this.minValue=null!==(n=t.minValue)&&void 0!==n?n:null,this.isAsync=null!==(o=t.isAsync)&&void 0!==o?o:0,this.snippetEntries=null===(i=null==t?void 0:t.preLongTaskObserver)||void 0===i?void 0:i.precollect,this.snippetObserver=null===(a=null==t?void 0:t.preLongTaskObserver)||void 0===a?void 0:a.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var u=g(this.snippetEntries),c=u.next();!c.done;c=u.next()){var l=c.value;"longtask"===l.entryType?this.longTasks.push({start:l.startTime,end:l.startTime+l.duration}):"resource"===l.entryType&&this.networkRequests.push({start:l.fetchStart,end:l.responseEnd})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}this.registerListeners()}}function mt(t){try{for(var e,r=t,n=[],o=0,i=0,a=" > ".length;r&&o++<5&&!("html"===(e=function(t){var e,r,n,o,i=t,a=[];if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase()),i.id&&a.push("#"+i.id);var s=i.className;if(s&&y(s))for(e=s.split(/\s+/),o=0;o<e.length;o++)a.push("."+e[o]);var u=["type","name","title","alt"];for(o=0;o<u.length;o++)r=u[o],(n=i.getAttribute(r))&&a.push("["+r+'="'+n+'"]');return a.join("")}(r))||1<o&&80<=i+n.length*a+e.length);)n.push(e),i+=e.length,r=r.parentNode;return n.reverse().join(" > ")}catch(t){return"<unknown>"}}var vt="FIDMonitor",gt=(yt.prototype.setup=function(t){var u=this;if(P()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&T()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var r,n;try{for(var o=g(t.getEntries()),i=o.next();!i.done;i=o.next()){var a=i.value,s=a.processingStart-a.startTime;u.callback({name:u.name,fid:Math.round(s)})}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}e.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(t){this.observer.observe({entryTypes:["first-input"]})}}},yt.monitorName=vt,yt);function yt(){this.name=vt,this.callback=x}var bt="MPFIDMonitor",wt=(St.prototype.setup=function(){var e,t,r,n,a=this;if(M()&&T()){if(!this.props.isAsync){var o=null!==(n=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==n?n:[];if(o&&0<o.length)try{for(var i=g(o),s=i.next();!s.done;s=i.next()){var u=s.value;"longtask"===u.entryType&&this.list.push(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}this.observer=new PerformanceObserver(function(t){var e,r;try{for(var n=g(t.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;a.list.push(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}}),this.observer.observe({entryTypes:["longtask"]})}},St.prototype.getMPFID=function(){var e,t;if(M()&&T()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=g(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return this.formatEvent(Math.round(r))}},St.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},St.monitorName=bt,St);function St(t){this.name=bt,this.list=[],this.props=t}var Pt=[],Mt="ResourcePerformanceMonitor",Tt=(Et.prototype.setup=function(t){this.isEnable()&&(this.callback=null!=t?t:x,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Et.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Et.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Et.prototype.buildParams=function(t){var e=this,r=[];if(t.forEach(function(t){m(e.checkIgnore)&&e.checkIgnore(t)||r.push(t)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},Et.prototype.sendResourcePerformance=function(t){var e=this.buildParams(t);e&&this.callback(e)},Et.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(Pt,t.initiatorType)})},Et.prototype.observePerformance=function(){var r=this;P()&&new PerformanceObserver(function(t){var e=t.getEntries();e.length&&r.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Et.monitorName=Mt,Et);function Et(t){var e,r,n,o=this;this.name=Mt,this.callback=x,this.getResourcePerformance=function(){var t;return null!==(t=o.getPerformance())&&void 0!==t?t:{}},this.isAsync=null!==(e=null==t?void 0:t.isAsync)&&void 0!==e?e:0,this.observe=null!==(r=null==t?void 0:t.observe)&&void 0!==r&&r,this.checkIgnore=null!==(n=null==t?void 0:t.checkIgnore)&&void 0!==n?n:function(){return!1}}var kt={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},_t="PerformanceMonitor",xt=(Rt.prototype.setup=function(t){var e,r,n,o,i=this;c()&&(this.callback=t,r=function(){i.hasLoaded=!0,i.performanceAuto&&setTimeout(function(){i.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){r()},0)},!1):r(),this.sendParams=f({},kt),this.staticPerformanceMonitor=new Tt,this.staticPerformanceMonitor.setup(),(new gt).setup(this.hasFID),this.mpfidMonitor=new wt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),n=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:ht,this.ttiMonitor=new n({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),j(o))},Rt.prototype.performanceNow=function(){var t,e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:0)},Rt.prototype.getBounced=function(){return!this.hasLoaded},Rt.prototype.getPaintTime=function(e){if(w()){var t=performance.getEntriesByType("paint");if(l(t)){var r=t.filter(function(t){return t.name===e});return r.length&&r[0]&&h(r[0])&&r[0].startTime||0}}return 0},Rt.monitorName=_t,Rt);function Rt(t){var a=this;this.name=_t,this.callback=x,this.sendParams=f({},kt),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){a.initFlag&&a.hasLoaded&&(a.sendParams.isAsync&&(a.sendParams.load=Math.round(a.performanceNow()-a.initStart)),setTimeout(function(){a.perfLog()},200))},this.initAsync=function(){var t,e,r,n;a.hasSentInitPerf&&(a.sendParams=f({},kt),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Tt({isAsync:1}),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new wt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),n=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:ht,a.ttiMonitor=new n({minValue:Math.round(a.performanceNow()),isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.ttiMonitor.setup(),null!==(r=null===(e=a.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==r&&r.call(e,x))},this.getPerformance=function(){return a.finalSendParams.tti||("complete"===document.readyState?a.perfLog():a.perfLog(!0)),a.buildParams(a.finalSendParams)},this.buildParams=function(t){return{name:a.name,type:"post",event:t}},this.perfLog=function(t){if(void 0===t&&(t=!1),c()){if(a.initFlag=!1,a.finalSendParams=f({},a.sendParams),!a.sendParams.isAsync){var e=a.getBounced();if(e)return a.finalSendParams.bounced=e,void a.invokeCallback(0,a.buildParams(a.finalSendParams));a.finalSendParams=f(f({},a.finalSendParams),a.getParams())}var r=a.getStaticResources(),n=a.getFMP(),o=a.getMPFID();r&&(a.finalSendParams.resources=r,a.finalSendParams.has_resource=1),n&&(a.finalSendParams.fmp=Math.round(n)),n&&a.finalSendParams.fcp&&a.finalSendParams.fmp<a.finalSendParams.fcp&&(a.finalSendParams.fmp=a.finalSendParams.fcp),o&&(a.finalSendParams.mpfid=o),m(a.callback)&&(!t&&a.ttiMonitor&&m(a.ttiMonitor.getTTI)?a.ttiMonitor.getTTI(function(t){t&&0<t&&(a.finalSendParams.tti=a.finalSendParams.isAsync?Math.round(t-a.initStart):t),a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams))}):a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams)))}},this.invokeCallback=function(t,e){if(!t){if(a.hasSentInitPerf)return;a.hasSentInitPerf=!0}a.callback(e)},this.getStaticResources=function(){var t;if(a.staticPerformanceMonitor&&m(a.staticPerformanceMonitor.getResourcePerformance)){var e=a.staticPerformanceMonitor.getResourcePerformance();if(null!==(t=null==e?void 0:e.event)&&void 0!==t&&t.resources)return e.event.resources||[]}},this.getFMP=function(){var t,e,r,n;return a.fmpMonitor?(a.fmpMonitor.disconnect(),a.sendParams.isAsync?(null===(t=null==(n=a.fmpMonitor.getFmp())?void 0:n.event)||void 0===t?void 0:t.fmp)||0:m(a.fmpMonitor.getLoadFmp)?1!==a.props.renderType?2===a.props.renderType?a.getPaintTime("first-contentful-paint"):0:null!==(r=null===(e=(n=a.fmpMonitor.getLoadFmp()||{}).event)||void 0===e?void 0:e.fmp)&&void 0!==r?r:0:0):0},this.getMPFID=function(){if(a.mpfidMonitor&&m(a.mpfidMonitor.getMPFID)){var t=a.mpfidMonitor.getMPFID();if(t)return t.mpfid}},this.syncPerfLog=function(){var t,e;a.hasSentInitPerf||(a.perfLog(!0),null!==(e=(t=a.props).report)&&void 0!==e&&e.call(t))},this.hasFID=function(t){a.sendParams.fid=t.fid},this.getParams=function(){if(c()){var t={},e=window.performance.timing;t.dns=e.domainLookupEnd-e.domainLookupStart,t.tcp=e.connectEnd-e.connectStart,t.request=e.responseStart-e.requestStart,t.response=e.responseEnd-e.responseStart,t.processing=e.domComplete-e.domLoading,t.blank=e.responseEnd-e.navigationStart,t.domready=e.domInteractive-e.navigationStart,t.load=e.loadEventEnd-e.navigationStart,e.secureConnectionStart&&(t.ssl=e.connectEnd-e.secureConnectionStart),t.domparse=e.domInteractive-e.responseEnd,t.resource=e.loadEventStart-e.domContentLoadedEventEnd,t.ttfb=e.responseStart-e.requestStart,t.redirect=e.redirectEnd-e.redirectStart;var r=a.getPaintTime("first-paint"),n=a.getPaintTime("first-contentful-paint");r&&(t.fp=Math.round(r)),n&&(t.fcp=Math.round(n));var o=function(){if(!w())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=c()?window.performance.timing:null;return(o||i)&&(t.navigation=null!=o?o:i),i&&(t.timing=i),o&&(t.navigation_timing=o),t}},t.fmpMonitor&&(this.fmpMonitor=t.fmpMonitor);var e=t.performanceAuto;this.performanceAuto=void 0===e||e,this.props=null!=t?t:{}}var Ht="StaticErrorMonitor",Ct=(Lt.prototype.setup=function(t){u()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Lt.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ot(t,"href"):Ot(t,"src")},Lt.prototype.getParams=function(t,e){var r={ev_type:"static",st_type:e},n=k(t);return r.st_src=t,r.st_protocol=n.protocol,r.st_domain=n.hostname,r.st_path=n.pathname,r},Lt.monitorName=Ht,Lt);function Lt(){var s=this;this.name=Ht,this.callback=x,this.buildEvent=function(t){var e,r,n,o=t||window.event||{};try{n=null!==(r=null!==(e=o.target)&&void 0!==e?e:o.srcElement)&&void 0!==r?r:{}}catch(o){return}var i=n.tagName;if(i&&y(i)){i=i.toLowerCase();var a=s.getSrc(n);if(a&&a!==window.location.href)return{name:s.name,type:"get",event:s.getParams(a,i)}}},this.staticErrorLog=function(t){var e=s.buildEvent(t);e&&s.callback(e)}}function Ot(t,e){var r,n;return t.getAttribute&&m(t.getAttribute)?null!==(r=t.getAttribute(e))&&void 0!==r?r:"":null!==(n=t[e])&&void 0!==n?n:""}var jt="BreadcrumbMonitor",qt=(It.prototype.setup=function(){this.instrumentDOM()},It.prototype.instrumentDOM=function(){var t;"document"in window&&(t=this,window.document.addEventListener("click",t.domEventHandler("click",t.triggerHandlers.bind(t,"dom")),!1),window.document.addEventListener("keypress",t.keypressEventHandler(t.triggerHandlers.bind(t,"dom")),!1))},It.prototype.domEventHandler=function(e,r,n){var o=this;return void 0===n&&(n=!1),function(t){o.keypressTimeout=void 0,t&&o.lastCapturedEvent!==t&&(o.lastCapturedEvent=t,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:t,name:e})}):r({event:t,name:e}))}},It.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},It.prototype.keypressEventHandler=function(n){var o=this;return function(t){var e;try{e=t.target}catch(t){return}var r=e&&e.tagName;r&&("INPUT"===r||"TEXTAREA"===r||e.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(t),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},It.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?mt(t.event.target):mt(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},It.monitorName=jt,It);function It(){var n=this;this.name=jt,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(t,e){var r=f(f({},t),{timestamp:(new Date).getTime()});return n.breadcrumbs=void 0!==e&&0<=e?a(n.breadcrumbs,[r]).slice(-e):a(n.breadcrumbs,[r]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var At=(Dt.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},Dt.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},Dt.prototype._modifyEvent=function(t){return t},Dt.prototype._shouldSend=function(t){return!0},Dt.prototype._send=function(t){},Dt.prototype.idleSendEvent=function(t){this._send(t)},Dt);function Dt(){}var Ft="JSExceptionMonitor",Bt=(Nt.prototype.setup=function(t){u()&&(this.callback=t,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Nt.prototype.buildEvent=function(t){var e;if(!function(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return t instanceof Error}}(t)?(o(t)&&(e={message:JSON.stringify(t)}),y(t)&&(e={message:t})):e=t,e){var r={ev_type:"js_exception",exception:this.normalizeError(e)};return{name:this.name,type:"post",event:r}}},Nt.prototype.logError=function(t){var e=this.buildEvent(t);e&&this.callback(e)},Nt.prototype.getJSError=function(t){var e=t.error;if(e)return e},Nt.prototype.getJSPromiseRejection=function(t){var e=void 0;try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}if(e)return e},Nt.prototype.normalizeError=function(t){return{message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop}},Nt.monitorName=Ft,Nt);function Nt(t){var r=this;this.name=Ft,this.callback=x,this.jsErrorLog=function(t){var e=r.getJSError(t);e&&r.logError(e)},this.jsPromiseRejectionLog=function(t){var e=r.getJSPromiseRejection(t);e&&r.logError(e)},this.options=null!=t?t:{}}var Jt,Ut=(t(Xt,Jt=At),Object.defineProperty(Xt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Xt.prototype._send=function(t){var e=this,r=this.buildParams(t);r&&this.reportQueue.push(r),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){e._uploadQueue()},this.batchReportWait))},Xt.prototype._uploadQueue=function(){var t;this.reportQueue.length&&this.ready&&(t={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:t,type:"post"}))},Xt.prototype._request=function(t){},Xt);function Xt(t){var e,r,n=Jt.call(this)||this;return n.reportQueue=[],n.isReady=!0,n.batchReportLength=null!==(e=t.maxBatchReportLength)&&void 0!==e?e:10,n.batchReportWait=null!==(r=t.batchReportWait)&&void 0!==r?r:1e3,n.batchReportTimeout=null,n}function Vt(t){return!!t&&Math.random()<Number(t)}var Qt;t(zt,Qt=Ut),zt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(zt.prototype,"contextAgent",{get:function(){var o=this,r={set:function(t,e){return o.options&&(o.options.commonParams.context||(o.options.commonParams.context={}),o.options.commonParams.context[t]=e),r},delete:function(t){var e;return null!==(e=o.options)&&void 0!==e&&e.commonParams.context&&"string"!=typeof o.options.commonParams.context&&p(o.options.commonParams.context,t)&&delete o.options.commonParams.context[t],r},clear:function(){return o.options&&(o.options.commonParams.context={}),r},get:function(t){var e,r,n;return null===(n=null===(r=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.context)||void 0===n?void 0:n[t]},toObject:function(){var t,e,r;return"string"==typeof(null===(t=o.options)||void 0===t?void 0:t.commonParams.context)?{}:f({},null===(r=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.context)}};return r},enumerable:!1,configurable:!0}),zt.prototype._shouldSend=function(t){var e,r;if(!(null!==(e=this.options)&&void 0!==e&&e.monitors&&t&&h(t)&&null!==(r=t.event)&&void 0!==r&&r.ev_type))return!1;var n=this.options.monitors;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){var o=O(W||[]);if(o&&o.test(t.event.ax_url))return!1}return!!n.BaseMonitor.webIDHit||!!n.BaseMonitor.sampleHit&&("PathMonitor"===t.name?function(t){var e=t.sendParams,r=t.pageViewMonitor,n=t.baseMonitor;if(1!==n.appTypeSetting.type||e.event.type!==n.appTypeSetting.SPA)return!1;if(!r)return!0;if(r.webIDHit)return!0;return!!r.sampleHit}({sendParams:t,pageViewMonitor:n.PageViewMonitor,baseMonitor:n.BaseMonitor}):"PageViewMonitor"===t.name?Wt({pageViewMonitor:n.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?Kt({sendParams:t,ajaxMonitor:n.AjaxMonitor}):"PerformanceMonitor"===t.name?Gt({performanceMonitor:n.PerformanceMonitor}):"EmitMonitor"===t.name?function(t){var e=t.sendParams,r=t.flexibleMonitor;if(!r)return!0;if(r.webIDHit)return!0;if(!r.sampleHit)return!1;var n=r.eventNameHit;if(n){var o=e.event.flexible_data_list[0].event_name;if(n&&p(n,o))return Vt(n[o])}return!0}({sendParams:t,flexibleMonitor:n.FlexibleMonitor}):"StaticErrorMonitor"===t.name?$t({sendParams:t,staticErrorMonitor:n.StaticErrorMonitor}):"HijackMonitor"===t.name?function(t){var e=t.hijackMonitor;if(!e)return!0;if(e.webIDHit)return!0;return!!e.sampleHit}({hijackMonitor:n.HijackMonitor}):"JSErrorMonitor"!==t.name||Yt({jsErrorMonitor:n.JSErrorMonitor}))},zt.prototype._modifyEvent=function(t){var e;if(null===(e=this.options)||void 0===e||!e.monitors||!t||!h(t))return{};var r=this.options.monitors;return"PerformanceMonitor"===t.name?function(t){var e,a=t.sendParams,r=t.performanceMonitor;if(!r)return a;if(!c())return{};{var n;e=a.event.isAsync?a.event.load>r.spaSlowSessionTime:(n=window.performance.timing,n.loadEventEnd-n.navigationStart>r.slowSessionTime)}{var s;a.event.resources&&l(a.event.resources)&&(s=O(r.geckoUrls||[]),a.event.resources.forEach(function(t,e){var r,n,o,i;null!==(r=a.event.resources)&&void 0!==r&&r[e]&&h(null===(n=a.event.resources)||void 0===n?void 0:n[e])&&m(null===(o=a.event.resources)||void 0===o?void 0:o[e].toJSON)&&(a.event.resources[e]=null===(i=a.event.resources)||void 0===i?void 0:i[e].toJSON(),a.event.resources[e].is_gecko=s&&s.test(t.name||"")?"1":"0")}))}r.webIDHitStaticResource||r.sampleHitStaticResource?a.event.upload_reason="sample":e?a.event.upload_reason="slow_session":(delete a.event.resources,a.event.has_resource=0);return a}({sendParams:t,performanceMonitor:r.PerformanceMonitor}):"PathMonitor"===t.name?function(t){var e=t.sendParams,r=t.baseMonitor,n=t.effect;1===r.appTypeSetting.type&&r.appTypeSetting.SPA===e.event.type&&(n({commonParams:{pid:e.event.path}}),delete e.event.type,delete e.event.path);return{}}({sendParams:t,baseMonitor:r.BaseMonitor,effect:this.updateConfig}):t},zt.prototype.buildParams=function(t){var e,r,n,o,i,a,s=t.event||{},u=t.overrides,c=f({},null!==(r=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==r?r:{});h(null==u?void 0:u.context)&&(a=f(f({},null!==(n=h(c.context)&&c.context)&&void 0!==n?n:{}),null!==(o=null==u?void 0:u.context)&&void 0!==o?o:{}),c.context=a);var l=f(f(f({},s),null!=c?c:{}),s),l=this.normalizeEvent(l);return null!==(i=this.options)&&void 0!==i&&i.custom&&m(this.options.custom.beforeSend)&&(l=this.options.custom.beforeSend(l||{})),l},zt.prototype._request=function(t){var e,r,n,o;t&&t.event&&(r=t.type,n=t.event,"beacon"===(null===(e=this.options)||void 0===e?void 0:e.commonParams.report_type)&&navigator&&navigator.sendBeacon?(o=JSON.stringify(n),navigator.sendBeacon(this.getReportURL(),o)):this.transport&&("get"!==r?"post"===r&&this.transport.postEvent(n):this.transport.getEvent(n)))},zt.prototype.chechIsReady=function(){return 2===this.clientStatus},zt.prototype.updateStatus=function(){var e=this;switch(this.clientStatus){case 0:this.clientStatus=1;break;case 1:if(this.clientStatus=2,!this.preQueue.length)return;this.preQueue.forEach(function(t){Qt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},zt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},zt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},zt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},zt.prototype.normalizeEvent=function(t){var e=f(f({},t),{url:window.location.href});return h(t.context)&&(e.context=JSON.stringify(t.context)),e||{}};function zt(t){var e,i=Qt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new D({reportURL:i.getReportURL()}),i.updateStatus())},i.uploadQueue=function(){i._uploadQueue()},i.updateConfig=function(t){var e,r,n,o=null===(r=null===(e=i.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.pid;i.options=i.normalizeOptions(t),o&&null!==(n=null==t?void 0:t.commonParams)&&void 0!==n&&n.pid&&t.commonParams.pid!==o&&i.sendPageview()},i.sendPageview=function(){m(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?Qt.prototype.sendEvent.call(i,t):i.preQueue.push(t)},i.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",i.preQueue=[],i.clientStatus=0,i.enable=!1,i}function Kt(t){var r=t.sendParams,e=t.ajaxMonitor;if(!e)return!0;if(e.webIDHit)return!0;if(!e.sampleHit)return!1;var n=e.whitelistUrls;if(l(n)&&0<n.length){var o=O(e.whitelistUrls||[]);return o&&o.test(r.event.ax_url)?!0:!1}var i=O(e.ignore||[]);if(i&&i.test(r.event.ax_url))return!1;var a=e.statusCodeSample;if(a&&p(a,r.event.ax_status))return Vt(a[r.event.ax_status]);var s=e.requestUrlSample;if(s){var u=!1,c=!1;if(s.forEach(function(t){var e;u||null!=(e=O([t.url]))&&e.test(r.event.ax_url)&&(u=!0,c=Vt(t.sampleRate))}),u)return c}return!0}function Wt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function $t(t){var e=t.sendParams,r=t.staticErrorMonitor;if(!r)return!0;if(r.webIDHit)return!0;if(!r.sampleHit)return!1;var n=O(r.ignore||[]);return!n||!n.test(e.event.st_src)}function Yt(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Zt(t){var e,r,n=t.setting,o=t.info,i=b({PageViewMonitor:{},JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},FlexibleMonitor:{},StaticErrorMonitor:{},HijackMonitor:{},BaseMonitor:{appTypeSetting:{}}},n.monitors);n.ajaxWhitelistUrls&&l(n.ajaxWhitelistUrls)&&(i.AjaxMonitor.whitelistUrls=(i.AjaxMonitor.whitelistUrls||[]).concat(n.ajaxWhitelistUrls)),n.ignoreAjax&&l(n.ignoreAjax)&&(i.AjaxMonitor.ignore=(i.AjaxMonitor.ignore||[]).concat(n.ignoreAjax)),p(n,"geckoUrls")&&(i.PerformanceMonitor.geckoUrls=n.geckoUrls),n.ignoreStatic&&l(n.ignoreStatic)&&(i.StaticErrorMonitor.ignore=(i.StaticErrorMonitor.ignore||[]).concat(n.ignoreStatic)),null!==(e=n.plugins)&&void 0!==e&&e.sentry&&(i.JSErrorMonitor=f(f({},i.JSErrorMonitor||{}),n.plugins.sentry)),n.errorRelease&&(i.JSErrorMonitor.release=n.errorRelease),n.ignoreErrors&&l(n.ignoreErrors)&&(i.JSErrorMonitor.ignoreErrors=n.ignoreErrors),n.errorBlacklistUrls&&l(n.errorBlacklistUrls)&&(i.JSErrorMonitor.blacklistUrls=n.errorBlacklistUrls),n.errorWhitelistUrls&&l(n.errorWhitelistUrls)&&(i.JSErrorMonitor.whitelistUrls=n.errorWhitelistUrls),p(n,"sampleRate")&&(i.BaseMonitor.sampleHit=Vt(n.sampleRate));var a,s,u,c=n.plugins;return c&&h(c)&&(p(c,"spa")&&((a=c.spa)&&p(a,"enable")&&(i.BaseMonitor.appTypeSetting.type=Number(a.enable)),a&&p(a,"type")&&(i.BaseMonitor.appTypeSetting.SPA=a.type)),!c.render||(s=null===(r=n.plugins)||void 0===r?void 0:r.render)&&h(s)&&p(s,"enable")&&(u=[{pids:[],value:s.enable,isDefault:!0}],i.BaseMonitor.appTypeSetting.renderType=function(t){var e=t.renderRules,r=t.pid;if(!e||!r)return 0;for(var n=0;n<e.length;n++){var o=e[n];if(l(o.pids)&&0<o.pids.length){var i=O(o.pids);if(i&&i.test(r))return o.value}if(o.isDefault&&n===e.length-1)return o.value}return 0}({renderRules:u,pid:o.pid}))),i}var te="RANGERS_WEB_ID";function ee(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:A(1)},PageViewMonitor:{webIDHit:!1,sampleHit:A(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:A(1),sampleHitTrace:!1,ignore:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(z),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:W},HijackMonitor:{webIDHit:!1,sampleHit:A(K)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.5",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:Q(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:q(),network_type:I()},t}function re(t){t!==function(t,e){var r,n;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=g(o),s=a.next();!s.done;s=a.next()){var u=s.value.split("="),c=y(u[0])&&u[0].trim();c&&y(u[1])&&(i[c]=u[1].trim())}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i[e]||""}(document.cookie,te)&&(document.cookie=te+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var ne,oe,ie,ae,se=(ne="/v2/user/webid",oe="/v2/user/ssid",ie="/v2/event/list",ae=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[ne,oe,ie].forEach(function(t){ae.push(e+t)})}),ae);function ue(t){var e=t.sendParams,r=t.commonParams,n=t.custom,o=function(t){var e,r=t.sendParams,n=t.commonParams,o=t.breadcrumbMonitor,i={};if(i.ev_type=r.event.ev_type,i.common=n,"PageViewMonitor"===r.name&&i)return i;if(("AjaxMonitor"===r.name||"FetchMonitor"===r.name)&&i){var a=r.event,s=(a.ev_type,v(a,["ev_type"]));return i.event=s,i}if("PerformanceMonitor"===r.name&&i){r.event.navigation=r.event.navigation_timing;var u=r.event,c=(u.ev_type,v(u,["ev_type"]));return i.ev_type="performance",i.event={fp:c.fp,fcp:c.fcp,fmp:c.fmp,tti:c.tti,fid:c.fid,mpfid:c.mpfid,isAsync:c.isAsync,timing:c.timing,navigation:c.navigation_timing,bounced:c.bounced},i}if("StaticErrorMonitor"===r.name&&i){i.ev_type="resource_error";var l=r.event,p=(l.ev_type,v(l,["ev_type"]));return i.event=p,i}if("ResourcePerformanceMonitor"===r.name&&i){i.ev_type="resource";var d=r.event,h=(d.ev_type,v(d,["ev_type"]));return i.event=h,i}if("JSExceptionMonitor"===r.name&&i){i.ev_type="js_error";var f=r.event,m=(f.ev_type,v(f,["ev_type"]));return i.event=m.exception,i.breadcrumbs=null!==(e=null==o?void 0:o.getBreadcrumbs())&&void 0!==e?e:[],i}return i}({sendParams:e,commonParams:f(f({},null!=r?r:{}),{url:window.location.href})});return n&&m(n.beforeSend)&&(o=n.beforeSend(o||{})),o}var ce,le={cover:x,accumulate:x,reportDirectly:x,average:x},pe=function(t){var e,r=this;this.cover=function(t,e){r.log.cover(t,e)},this.accumulate=function(t,e){r.log.accumulate(t,e)},this.reportDirectly=function(t,e){r.log.reportDirectly(t,e)},this.average=function(t,e){r.log.average(t,e)},this.log=null!==(e=t.transport)&&void 0!==e?e:le},de=(t(he,ce=At),he.prototype.uploadQueue=function(){},he.prototype._shouldSend=function(t){return function(t){var e=t.sendParams,r=t.monitorsSetting;if(!e||!h(e)||!e.event)return!1;var n=r;if("AjaxMonitor"===e.name||"FetchMonitor"===e.name){var o=O(a(["/monitor_browser/collect"],se)||[]);if(o&&o.test(e.event.ax_url))return!1}return!(null==n||!n.BaseMonitor.webIDHit)||!(null==n||!n.BaseMonitor.sampleHit)&&("AjaxMonitor"===e.name||"FetchMonitor"===e.name?Kt({sendParams:e,ajaxMonitor:n.AjaxMonitor}):"PerformanceMonitor"===e.name?Gt({performanceMonitor:n.PerformanceMonitor}):"StaticErrorMonitor"===e.name?$t({sendParams:e,staticErrorMonitor:n.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?Yt({jsErrorMonitor:n.JSErrorMonitor}):"PageViewMonitor"!==e.name||Wt({pageViewMonitor:n.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},he.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},he.prototype.buildParams=function(t){return ue({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},he.prototype._send=function(t){t&&t.event&&t.name&&this.transport&&this.sendByTypes(t)},he.prototype.sendByTypes=function(t){var e,r;this.transport&&(r={jsBase:null!==(e=this.options.commonParams)&&void 0!==e?e:{},jsInfo:this.buildParams(t)},"PerformanceMonitor"===t.name&&this.transport.cover(r,r.jsInfo.ev_type),"StaticErrorMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"ResourcePerformanceMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"AjaxMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"FetchMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"JSExceptionMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"PageViewMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type))},he);function he(t){var h=ce.call(this)||this;return h.options={},h.setTransport=function(t){h.transport=new pe({transport:t.transport}),h.preQueue.forEach(function(t){ce.prototype.sendEvent.call(h,t)})},h.updateConfig=function(t){var e,r,n,o,i,a,s,u,c,l,p,d;h.options=(e={previousOptions:h.options,newOptions:t},l=e.previousOptions,p=e.newOptions,(d=f(f({},l),p)).commonParams=b({},null!==(r=l.commonParams)&&void 0!==r?r:{},null!==(n=p.commonParams)&&void 0!==n?n:{}),d.monitorsSetting=b({},null!==(o=l.monitorsSetting)&&void 0!==o?o:{},null!==(i=p.monitorsSetting)&&void 0!==i?i:{}),d.monitors=f(f({},null!==(a=l.monitors)&&void 0!==a?a:{}),null!==(s=p.monitors)&&void 0!==s?s:{}),d.custom=f(f({},null!==(u=l.custom)&&void 0!==u?u:{}),null!==(c=p.custom)&&void 0!==c?c:{}),d)},h.sendEvent=function(t){h.transport?ce.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.getEventToBeSent=function(t){var e;return null!==(e=ce.prototype.getEventToBeSent.call(h,t))&&void 0!==e?e:{}},h.options=t,h.preQueue=[],h}var fe,me=(ve.prototype.getUserIDFromRangers=function(e){window.collectEvent&&m(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},ve.prototype.init=function(t){this.client=new de(this.getClientOptions(t)),this.client.updateConfig(this.getClientOptions(t)),this.client.setTransport({transport:this.userSetting.transport}),this.sendPageview();var e=this.setMonitors();this.setupMonitors(e)},ve.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},ve.prototype.setMonitors=function(){var t,e,r=[],n=this.baseSetting.flags,o=new at;return r.push(o),n.enableCatchJSError&&r.push(new Bt),n.hookXHR&&r.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),n.hookFetch&&r.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),n.enableStaticError&&r.push(new Ct),n.enablePerformance&&(n.enableFMP?r.push(new xt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):r.push(new xt({renderType:1,preLongTaskObserver:{precollect:(null===(t=window.RangersSiteHybridSDK.lt)||void 0===t?void 0:t.e)||[],observer:null===(e=window.RangersSiteHybridSDK.lt)||void 0===e?void 0:e.o}}))),n.enableBreadcrumb&&r.push(new qt),n.enableResourcePerformance&&r.push(new Tt({observe:!0,checkIgnore:function(t){return"https://tbm.snssdk.com/monitor_browser/collect"===t.name||("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType||"beacon"===t.initiatorType||"navigation"===t.initiatorType||0===t.decodedBodySize)}})),r},ve.prototype.setupMonitors=function(t){var r=this;this.client&&this.client.sendEvent&&(t.forEach(function(t){var e;"FMPMonitor"===(r.monitors[t.name]=t).name?t.setup(x):t.setup(null===(e=r.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ve.prototype.normalizeSetting=function(t){var e={commonParams:this.getClientCommonParams(t),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(t),custom:this.getClientCustom(t)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},n=this.baseSetting;return this.baseSetting=b({},this.baseSetting,e,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,n),this.baseSetting},ve.prototype.settingEffect=function(t,e){re(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},ve.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ve.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!h(r))return n;var o=["context","pid"];i(r,function(t,e){s(o,t)&&(n[t]=e)});return i({user_unique_id:"rangers_web_id",app_id:"aid"},function(t,e){p(r,t)&&(n[e]=r[t])}),n},ve.prototype.getClientFlags=function(t){return function(t){var e;void 0===t&&(t={});var r=b({},null!==(e=t.flags)&&void 0!==e?e:{});if(!h(t))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return i(t,function(t,e){s(n,t)&&(r[t]=e)}),r}(f(f({},t),{flags:this.baseSetting.flags}))},ve.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&m(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},ve.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},ve.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return Zt({setting:e,info:this.getNormoalizeInfo()})},ve);function ve(){var o=this;this.version="0.2.5",this.instance=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("config"!==t[0])o.client&&o.onClose();else{if(!h(t[1]))return;var r=t[1];o.userSetting=f(f({},o.userSetting||{}),r||{});var n=o.normalizeSetting(r);o.client?o.client.updateConfig(o.getClientOptions(n)):o.init(n)}},this.changeReortType=function(t){var e;null!==(e=o.client)&&void 0!==e&&e.updateConfig({reportType:t})},this.onClose=function(){j(o.onCloseReport,o.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&o.onCloseReport(),"visible"===document.visibilityState&&o.changeReortType("xhr")},this.onCloseReport=function(){var t;o.changeReortType("beacon"),null!==(t=o.client)&&void 0!==t&&t.uploadQueue()},this.baseSetting=ee(),this.client=void 0,this.userSetting={},this.monitors={}}var ge,ye,be=x;return u()&&(ge=new me,be=ge.instance,null!==(fe=window.RangersSiteHybridSDK)&&void 0!==fe&&fe.q&&(l(ye=window.RangersSiteHybridSDK.q)&&ye.forEach(function(t){be.apply(void 0,a(t))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ge.instance),be}();
var RangersSiteHybridSDK=function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function v(t,e){var r={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function h(t){return"object"==typeof t&&null!==t&&!l(t)}function o(t){return"[object Object]"===(e=t,Object.prototype.toString.call(e));var e}function m(t){return"function"==typeof t}function y(t){return"[object String]"===Object.prototype.toString.call(t)}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(t,e){if(h(t))for(var r in t)p(t,r)&&e.call(null,r,t[r])}function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r={},n=0;n<t.length;)r=function t(e,r){var n=f({},e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&void 0!==r[o]&&(h(e[o])&&h(r[o])?n[o]=t(e[o],r[o]):!h(e[o])&&h(r[o])?n[o]=t({},r[o]):n[o]=r[o]);return n}(r,t[n]),n++;return r}function s(t,e){if(!l(t))return!1;if(0===t.length)return!1;for(var r=0;r<t.length;){if(t[r]===e)return!0;r++}return!1}function e(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(t){return}}function u(){return!!h(window)}function r(){return!(!u()||!h(window.performance))}function c(){return!(!r()||!h(window.performance.timing))}function w(){return!!r()&&!!m(window.performance.getEntries)}function S(){return u()&&"function"==typeof window.MutationObserver}function P(){return u()&&"function"==typeof window.PerformanceObserver}function M(){return!!P()&&m(window.PerformanceLongTaskTiming)}function E(){if(!P())return!1;var t=window.PerformanceObserverEntryList;return m(t)&&m(t.prototype.getEntries)}function T(t){var r,e=function(t){if(!h(t))return{};var r={};return i(t,function(t,e){h(e)||l(e)?r[t]=JSON.stringify(e):r[t]=e}),r}(t),n=(r={},i(e,function(t,e){r[encodeURIComponent(t)]=encodeURIComponent(e)}),r),o=[];return i(n,function(t,e){o.push(t+"="+e)}),o.join("&")}function k(t){var e=document.createElement("a");e.href=t;var r=e.pathname||"/";return"/"!==r[0]&&(r="/"+r),{href:e.href,protocol:e.protocol.slice(0,-1),hostname:e.hostname,host:e.host,search:e.search,pathname:r,hash:e.hash}}var _=function(t){if(!y(t))return!1;var e=t;return m(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function x(){}function R(t){var e="[object String]"===Object.prototype.toString.call(t);return t?e?t.length:ArrayBuffer&&t instanceof ArrayBuffer?t.byteLength:window.Blob&&t instanceof Blob?t.size:t.length?t.length:0:0}function H(t){if(!t)return"";if(!m(t.forEach))return"";var n=[];return t.forEach(function(t){var e,r;l(t)&&t[0]&&!_(t[0])&&(e=t[0],r=t[1]||"",n.push(e+": "+r))}),n.join("\r\n")}function C(t){var e={},r=k(t);return e.ax_protocol=r.protocol,e.ax_domain=r.hostname,e.ax_path=r.pathname,e.ax_url=(r.href||t).split("?")[0],e}function L(t,e){var r=k(t),n=k(e);return r.protocol===n.protocol&&r.host===n.host}function O(t){return l(t)&&t.length?function(t){for(var e=[],r=t.length,n=0;n<r;n++){var o=t[n];y(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(t):null}function j(e,r){m(e)&&(m(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),m(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){m(r)?r(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,r;return void 0===t&&(t=window),u()&&null!==(e=t.screen)&&void 0!==e&&e.width&&null!==(r=t.screen)&&void 0!==r&&r.height?t.screen.width+"x"+t.screen.height:"0x0"},I=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function A(t){return!!t&&Math.random()<Number(t)}var D=(F.post=function(t,e,r){var n,o,i=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:x,a=null!==(o=null==r?void 0:r.fail)&&void 0!==o?o:x,s=new XMLHttpRequest;s.open("POST",t,!0),s.setRequestHeader("Content-Type","application/json"),s.send(JSON.stringify(e)),s.onload=function(){try{var t;this.responseText?(t=JSON.parse(this.responseText),i(t)):i({})}catch(t){a()}},s.onerror=function(){a()},s.onabort=function(){a()}},F.get=function(t,e){var r,n,o,i,a=null!==(r=null==e?void 0:e.success)&&void 0!==r?r:x,s=null!==(n=null==e?void 0:e.fail)&&void 0!==n?n:x,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:x,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:x,l=new XMLHttpRequest;l.open("GET",t),l.send(),l.onload=function(){u(null==this?void 0:this.response),c(this.responseText);try{var t;this.responseText?(t=JSON.parse(this.responseText),a(t)):a({})}catch(t){s()}},l.onerror=function(){s()},l.onabort=function(){s()}},F.prototype.getCommonParams=function(){return{timestamp:Date.now()}},F);function F(t){var n=this;this.postEvent=function(t){var e=f(f({},t),n.getCommonParams());F.post(n.url,e)},this.getEvent=function(t){var e=T(f(f({},t),n.getCommonParams())),r=n.url+"?"+e;F.get(r)},this.getURL=function(){return n.url},this.options=t,this.url=this.options.reportURL}function B(t,e,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+t.length);return t.length>=e?t:""+Array.from({length:e-t.length}).fill(r).join("")+t}function N(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var J="x-tt-trace-id",U="x-tt-trace-host",X="x-tt-logid";function V(t,e,r){void 0===r&&(r="01");var n=""+B((Date.now()%4294967295).toString(16),8)+function(t){var e;if("number"==typeof t)e=t;else{var r=t.replace(/-/g,"");if(!/^[0-9]+$/.test(r)){if(18<r.length)return"18"+N(18);var n=22-r.length-4;return""+B(""+r.length,2)+r+N(n)}e=parseInt(r,10)}var o=e.toString(16),i=22-o.length-4;return""+B(""+o.length,2)+o+N(i)}(t)+("string"==typeof e?N(4):B(e.toString(16),4));return"00-"+n+"-"+n.substr(0,16)+"-"+r}function Q(){var t=function(){for(var t=new Array(16),e=0,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),t[r]=e>>>((3&r)<<3)&255;return t}();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(t){for(var e=[],r=0;r<256;++r)e[r]=(r+256).toString(16).substr(1);var n=0;return[e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],"-",e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],e[t[n++]],e[t[15]]].join("")}(t)}var z=.1,K=.1,W=["/log/sentry/"],G=8e3,$=4e3;Q(),Q();var Y="AjaxMonitor",Z=(tt.prototype.setup=function(t){void 0===t&&(t=x),m(XMLHttpRequest)&&(this.callback=t,this.start())},tt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},tt.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},tt.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||x;XMLHttpRequest.prototype.setRequestHeader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(t),r.apply(this,t)}},tt.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,t)}},tt.prototype.hookXMLHttpRequestSend=function(){var a=this,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var t,e,r,n,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return a.checkAddTrace(this._url)&&(r=(e=null!==(t=null==a?void 0:a.props.commonParams)&&void 0!==t?t:{}).bid,n=e.web_id,r&&n&&(a.traceId=V(n,r),this.setRequestHeader(J,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},tt.prototype.checkAddTrace=function(t){var e,r,n=null!==(e=this.props.commonParams)&&void 0!==e?e:{},o=n.bid,i=n.web_id,a=(null!==(r=this.props.ajaxMonitorOptions)&&void 0!==r?r:{}).sampleHitTrace,s=L(location.href,t);return o&&i&&a&&s},tt.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},tt.prototype.hookXMLHttpRequestOnreadystatechange=function(l){var p=this.onreadystatechange,d=this;this.onreadystatechange=function(){for(var t,e,r,n,o,i,a,s,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];if(4===this.readyState&&(a={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:d._method,ax_request_header:H(d._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(a.ax_response_header=function(e){if(y(e)){var t=e.split("\r\n"),n=[];return t.forEach(function(t,e){var r;t&&m(t.split)&&(r=t.split(": "),n.push([r[0],r[1]]))}),H(n)}return h(e)?H(Object.keys(e).map(function(t){return[t,e[t]]})):e}(this.getAllResponseHeaders())),!l.checkAddTrace(d._url)||(s=null!==(t=l.traceId)&&void 0!==t?t:this.getResponseHeader(J))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(r=this.getResponseHeader(X))&&void 0!==r?r:void 0),a.ax_duration=Date.now()-d._start,200===this.status&&(a.ax_size=function(t){var e=0;if(""===t.responseType||"text"===t.responseType)e=R(t.responseText);else if(t.response)e=R(t.response);else try{e=R(t.responseText)}catch(t){e=0}return e}(this)),a=f(f({},a),C(d._url)),l.collectErrorRequest()&&"2"!==a.ax_status[0]&&"3"!==a.ax_status[0]&&(a.ax_request={body:d._data?""+d._data:void 0,search:null===(n=k(d._url))||void 0===n?void 0:n.search,content_type:null===(i=null===(o=d._requestHeaders)||void 0===o?void 0:o.find(function(t){return"content-type"===t[0].toLowerCase()}))||void 0===i?void 0:i[1]}),m(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},tt.monitorName=Y,tt);function tt(t){this.name=Y,this.callback=x,this.traceId=null,this.props=t}function et(t){return t instanceof Request}var rt="FetchMonitor",nt=(ot.prototype.updateConfig=function(t){this.props=b({},this.props,t)},ot.prototype.setup=function(t){void 0===t&&(t=x),e()&&(this.callback=t,this.start())},ot.prototype.start=function(){e()&&this.hookFetch()},ot.prototype.checkAddTrace=function(t){var e,r,n,o,i=null!==(r=null===(e=this.props)||void 0===e?void 0:e.commonParams)&&void 0!==r?r:{},a=i.bid,s=i.web_id,u=(null!==(o=null===(n=null==this?void 0:this.props)||void 0===n?void 0:n.ajaxMonitorOptions)&&void 0!==o?o:{}).sampleHitTrace,c=L(location.href,t);return a&&s&&u&&c},ot.prototype.updateAxRequest=function(t,e,r){var n,o,i,a;this.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(a=this.getFetchUrl(e,!0),t.ax_request={body:null===(n=this.getFetchBody(e,r))||void 0===n?void 0:n.toString(),search:!y(a)||null===(o=k(a))||void 0===o?void 0:o.search,content_type:null===(i=null==r?void 0:r.headers)||void 0===i?void 0:i["Content-Type"]})},ot.prototype.collectErrorRequest=function(){var t,e;return null!==(e=null===(t=this.props.ajaxMonitorOptions)||void 0===t?void 0:t.errorRequestCollect)&&void 0!==e&&e},ot.prototype.hookFetch=function(){var c=this,l=this,p=window.fetch;window.fetch=function(o,i){var t;void 0===i&&(i={});var a=c.getFetchUrl(o);if(!function(t){if(y(t)){var e=d(t.split(":"),2),r=e[0];return!e[1]||("http"===r||"https"===r)}}(a))return p(o,i);var e=null!==(t=c.props.commonParams)&&void 0!==t?t:{},r=e.bid,n=e.web_id,s=Date.now(),u={ev_type:"ajax"};try{l.checkAddTrace(a)&&(i.headers=new Headers(function(t,e){var r=new Headers;et(t)&&t.headers&&m(t.headers.forEach)&&t.headers.forEach(function(t,e){r.append(e,t)});{e.headers&&new Headers(e.headers).forEach(function(t,e){r.append(e,t)})}return r}(o,i)),r&&n&&(u.trace_id=V(r,n),i.headers.append(J,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),C(a)),p(o,i).then(function(t){var e,r,n;return u.ax_status=(t.status||0).toString(),u.ax_duration=Date.now()-s,u.ax_response_header=l.getAllHeaders(t.headers),u.ax_request_header=l.getAllHeaders(i.headers),t.headers&&m(t.headers.has)?(t.headers.has("content-length")?u.ax_size=Number(t.headers.get("content-length"))||0:u.ax_size=0,l.checkAddTrace(a)&&(t.headers.has(U)&&(u.trace_host=null!==(e=t.headers.get(U))&&void 0!==e?e:void 0),t.headers.has(J)&&(u.trace_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0),t.headers.has(X)&&(u.log_id=null!==(n=t.headers.get(X))&&void 0!==n?n:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),t},function(t){return u.ax_status="0",u.ax_size=0,u.ax_duration=Date.now()-s,c.updateAxRequest(u,o,i),m(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},ot.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var r="",r=et(t)?t.url:t;return e||(r=y(r)?r.split("?")[0]:r),r},ot.prototype.getFetchMethod=function(t,e){var r,n,o=null!==(r=null==e?void 0:e.method)&&void 0!==r?r:"get";return et(t)&&(o=null!==(n=t.method)&&void 0!==n?n:o),o.toLowerCase()},ot.prototype.getFetchBody=function(t,e){return et(t)?t.body:null==e?void 0:e.body},ot.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var r=[];return t.forEach(function(t,e){r.push([e,t])}),H(r)},ot.monitorName=rt,ot);function ot(t){this.name=rt,this.callback=x,this.props=t}var it="FMPMonitor",at=(st.prototype.setup=function(t){if(u())return S()?void(m(document.querySelector)&&(this.callback=t&&m(t)?t:function(){},this.startTime=Date.now(),this.list=[],m(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},st.prototype.count=function(){var t=Date.now()-this.startTime,e=document.querySelector("body");e?this.list.push({score:this.score(e,1,!1),time:t}):this.list.push({score:0,time:t})},st.prototype.score=function(t,e,r){var n=0,o=t.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){var i=t.children?t.children.length:0;if(0<i)for(var a=t.children,s=i-1;0<=s;s--)n+=this.score(a[s],e+1,0<n);if(n<=0&&!r){if(!t.getBoundingClientRect||!m(t.getBoundingClientRect))return 0;var u=t.getBoundingClientRect();if(!u)return 0;if(u.top>window.innerHeight)return 0;if(u.height<=0)return 0}n+=1+.5*e}return n},st.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var t,e={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++){this.list[r].time>=this.list[r-1].time&&(t=this.list[r].score-this.list[r-1].score,e.rate<t&&(e={time:this.list[r].time,rate:t}))}return e.time},st.prototype.getTimeGap=function(){return c()?this.startTime-performance.timing.navigationStart:0},st.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},st.monitorName=it,st);function st(){var n=this;this.name=it,this.callback=x,this.disconnect=function(){var t,e;null!==(e=null===(t=n.observer)||void 0===t?void 0:t.disconnect)&&void 0!==e&&e.call(t)},this.getLoadFmp=function(){var t=n.getFmpInternal(),e=t?n.getTimeGap()+t:0,r=n.formatEvent(e);return n.callback(r),r},this.getFmp=function(){var t=n.getFmpInternal(),e=n.formatEvent(t);return n.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ut(){}var ct=!1,lt=!1,pt={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=pt.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(t){null!=o&&o.call(e,t),4===e.readyState&&i.afterCb(n)},pt.originals.send.apply(this,t)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;e()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Promise(function(e,r){var n=pt.uniqueId++;o.beforeCb(n),i.apply(void 0,a(t)).then(function(t){o.afterCb(n),e(t)},function(t){o.afterCb(n,t),r(t)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(a){if(S()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,r;try{for(var n=g(t),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function t(e,r){var n,o;try{for(var i=g(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(r.includes(s.nodeName.toLowerCase())||s.children&&t(s.children,r))return 1}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,s)||"attributes"===i.type&&s.includes(i.target.nodeName.toLowerCase()))&&a(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}});return t.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),t}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(ct=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(lt=!1,window.fetch=this.originals.fetch)}},dt="TTIMonitor",ht=(ft.prototype.setup=function(){},ft.prototype.isEnable=function(){return M()&&!!P()&&m(window.PerformanceResourceTiming)&&E()},ft.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,r,n=t.getEntries();try{for(var o=g(n),i=o.next();!i.done;i=o.next()){var a=i.value;"resource"===a.entryType&&s.networkRequestFinishedCallback(a),"longtask"===a.entryType&&s.longTaskFinishedCallback(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(t){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ft.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ut,this.proxyConfig.afterCb=ut)},ft.prototype.rescheduleTimer=function(t){var e=this;this.scheduleTimerTasks&&(this.timerActivationTime>t||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){e.checkTTI()},t-performance.now()),this.timerActivationTime=t))},ft.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var t=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(e+5e3,t))},ft.prototype.registerListeners=function(){ct||(pt.patchXMLHTTPRequest(this.proxyConfig),ct=!0),lt||(pt.patchFetch(this.proxyConfig),lt=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ft.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ft.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ft.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ft.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ft.prototype,"incompleteRequestStarts",{get:function(){for(var t=Object.keys(this.incompleteJSInitiatedRequestStartTimes),e=[],r=0;r<t.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[t[r]];"number"==typeof n&&e.push(n)}return e},enumerable:!1,configurable:!0}),ft.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ft.prototype.checkTTI=function(){var t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),e=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(t+5e3,n+1e3));var o=this.computeTTI(e,r,t,n,this.longTasks);o?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(o)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ft.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ft.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ft.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ft.prototype.computeLastKnownNetwork2Busy=function(t,e){var r,n,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=g(e),u=s.next();!u.done;u=s.next()){var c=u.value;a.push({timestamp:c.start,type:"requestStart"}),a.push({timestamp:c.end,type:"requestEnd"})}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}try{for(var l=g(t),p=l.next();!p.done;p=l.next()){var d=p.value;a.push({timestamp:d,type:"requestStart"})}}catch(t){o={error:t}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}a.sort(function(t,e){return t.timestamp-e.timestamp});for(var h=t.length,f=a.length-1;0<=f;f--){var m=a[f];switch(m.type){case"requestStart":h--;break;case"requestEnd":if(2<++h)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ft.monitorName=dt,ft);function ft(t){var e,r,n,o,i,a,s=this;if(this.name=dt,this.longTasks=[],this.callback=ut,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(t){s.callback=t,s.isEnable()?s.startSchedulingTimerTasks():s.callback&&"function"==typeof s.callback&&s.callback()},this.computeTTI=function(t,e,r,n,o){if(n-r<5e3)return null;var i=0===o.length?t:o[o.length-1].end;return n-i<5e3?null:Math.max(i,e)},this.isEnable()){if(this.useMutationObserver=!!t.useMutationObserver,this.minValue=null!==(n=t.minValue)&&void 0!==n?n:null,this.isAsync=null!==(o=t.isAsync)&&void 0!==o?o:0,this.snippetEntries=null===(i=null==t?void 0:t.preLongTaskObserver)||void 0===i?void 0:i.precollect,this.snippetObserver=null===(a=null==t?void 0:t.preLongTaskObserver)||void 0===a?void 0:a.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var u=g(this.snippetEntries),c=u.next();!c.done;c=u.next()){var l=c.value;"longtask"===l.entryType?this.longTasks.push({start:l.startTime,end:l.startTime+l.duration}):"resource"===l.entryType&&this.networkRequests.push({start:l.fetchStart,end:l.responseEnd})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}this.registerListeners()}}function mt(t){try{for(var e,r=t,n=[],o=0,i=0,a=" > ".length;r&&o++<5&&!("html"===(e=function(t){var e,r,n,o,i=t,a=[];if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase()),i.id&&a.push("#"+i.id);var s=i.className;if(s&&y(s))for(e=s.split(/\s+/),o=0;o<e.length;o++)a.push("."+e[o]);var u=["type","name","title","alt"];for(o=0;o<u.length;o++)r=u[o],(n=i.getAttribute(r))&&a.push("["+r+'="'+n+'"]');return a.join("")}(r))||1<o&&80<=i+n.length*a+e.length);)n.push(e),i+=e.length,r=r.parentNode;return n.reverse().join(" > ")}catch(t){return"<unknown>"}}var vt="FIDMonitor",gt=(yt.prototype.setup=function(t){var u=this;if(P()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var r,n;try{for(var o=g(t.getEntries()),i=o.next();!i.done;i=o.next()){var a=i.value,s=a.processingStart-a.startTime;u.callback({name:u.name,fid:Math.round(s)})}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}e.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(t){this.observer.observe({entryTypes:["first-input"]})}}},yt.monitorName=vt,yt);function yt(){this.name=vt,this.callback=x}var bt="MPFIDMonitor",wt=(St.prototype.setup=function(){var e,t,r,n,a=this;if(M()&&E()){if(!this.props.isAsync){var o=null!==(n=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==n?n:[];if(o&&0<o.length)try{for(var i=g(o),s=i.next();!s.done;s=i.next()){var u=s.value;"longtask"===u.entryType&&this.list.push(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}this.observer=new PerformanceObserver(function(t){var e,r;try{for(var n=g(t.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;a.list.push(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}}),this.observer.observe({entryTypes:["longtask"]})}},St.prototype.getMPFID=function(){var e,t;if(M()&&E()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=g(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return this.formatEvent(Math.round(r))}},St.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},St.monitorName=bt,St);function St(t){this.name=bt,this.list=[],this.props=t}var Pt=[],Mt="ResourcePerformanceMonitor",Et=(Tt.prototype.setup=function(t){this.isEnable()&&(this.callback=null!=t?t:x,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Tt.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){var e=this,r=[];if(t.forEach(function(t){m(e.checkIgnore)&&e.checkIgnore(t)||r.push(t)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},Tt.prototype.sendResourcePerformance=function(t){var e=this.buildParams(t);e&&this.callback(e)},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(Pt,t.initiatorType)})},Tt.prototype.observePerformance=function(){var r=this;P()&&new PerformanceObserver(function(t){var e=t.getEntries();e.length&&r.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Tt.monitorName=Mt,Tt);function Tt(t){var e,r,n,o=this;this.name=Mt,this.callback=x,this.getResourcePerformance=function(){var t;return null!==(t=o.getPerformance())&&void 0!==t?t:{}},this.isAsync=null!==(e=null==t?void 0:t.isAsync)&&void 0!==e?e:0,this.observe=null!==(r=null==t?void 0:t.observe)&&void 0!==r&&r,this.checkIgnore=null!==(n=null==t?void 0:t.checkIgnore)&&void 0!==n?n:function(){return!1}}var kt={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},_t="PerformanceMonitor",xt=(Rt.prototype.setup=function(t){var e,r,n,o,i=this;c()&&(this.callback=t,r=function(){i.hasLoaded=!0,i.performanceAuto&&setTimeout(function(){i.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){r()},0)},!1):r(),this.sendParams=f({},kt),this.staticPerformanceMonitor=new Et,this.staticPerformanceMonitor.setup(),(new gt).setup(this.hasFID),this.mpfidMonitor=new wt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),n=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:ht,this.ttiMonitor=new n({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),j(o))},Rt.prototype.performanceNow=function(){var t,e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:0)},Rt.prototype.getBounced=function(){return!this.hasLoaded},Rt.prototype.getPaintTime=function(e){if(w()){var t=performance.getEntriesByType("paint");if(l(t)){var r=t.filter(function(t){return t.name===e});return r.length&&r[0]&&h(r[0])&&r[0].startTime||0}}return 0},Rt.monitorName=_t,Rt);function Rt(t){var a=this;this.name=_t,this.callback=x,this.sendParams=f({},kt),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){a.initFlag&&a.hasLoaded&&(a.sendParams.isAsync&&(a.sendParams.load=Math.round(a.performanceNow()-a.initStart)),setTimeout(function(){a.perfLog()},200))},this.initAsync=function(){var t,e,r,n;a.hasSentInitPerf&&(a.sendParams=f({},kt),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Et({isAsync:1}),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new wt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),n=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:ht,a.ttiMonitor=new n({minValue:Math.round(a.performanceNow()),isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.ttiMonitor.setup(),null!==(r=null===(e=a.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==r&&r.call(e,x))},this.getPerformance=function(){return a.finalSendParams.tti||("complete"===document.readyState?a.perfLog():a.perfLog(!0)),a.buildParams(a.finalSendParams)},this.buildParams=function(t){return{name:a.name,type:"post",event:t}},this.perfLog=function(t){if(void 0===t&&(t=!1),c()){if(a.initFlag=!1,a.finalSendParams=f({},a.sendParams),!a.sendParams.isAsync){var e=a.getBounced();if(e)return a.finalSendParams.bounced=e,void a.invokeCallback(0,a.buildParams(a.finalSendParams));a.finalSendParams=f(f({},a.finalSendParams),a.getParams())}var r=a.getStaticResources(),n=a.getFMP(),o=a.getMPFID();r&&(a.finalSendParams.resources=r,a.finalSendParams.has_resource=1),n&&(a.finalSendParams.fmp=Math.round(n)),n&&a.finalSendParams.fcp&&a.finalSendParams.fmp<a.finalSendParams.fcp&&(a.finalSendParams.fmp=a.finalSendParams.fcp),o&&(a.finalSendParams.mpfid=o),m(a.callback)&&(!t&&a.ttiMonitor&&m(a.ttiMonitor.getTTI)?a.ttiMonitor.getTTI(function(t){t&&0<t&&(a.finalSendParams.tti=a.finalSendParams.isAsync?Math.round(t-a.initStart):t),a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams))}):a.invokeCallback(a.finalSendParams.isAsync,a.buildParams(a.finalSendParams)))}},this.invokeCallback=function(t,e){if(!t){if(a.hasSentInitPerf)return;a.hasSentInitPerf=!0}a.callback(e)},this.getStaticResources=function(){var t;if(a.staticPerformanceMonitor&&m(a.staticPerformanceMonitor.getResourcePerformance)){var e=a.staticPerformanceMonitor.getResourcePerformance();if(null!==(t=null==e?void 0:e.event)&&void 0!==t&&t.resources)return e.event.resources||[]}},this.getFMP=function(){var t,e,r,n;return a.fmpMonitor?(a.fmpMonitor.disconnect(),a.sendParams.isAsync?(null===(t=null==(n=a.fmpMonitor.getFmp())?void 0:n.event)||void 0===t?void 0:t.fmp)||0:m(a.fmpMonitor.getLoadFmp)?1!==a.props.renderType?2===a.props.renderType?a.getPaintTime("first-contentful-paint"):0:null!==(r=null===(e=(n=a.fmpMonitor.getLoadFmp()||{}).event)||void 0===e?void 0:e.fmp)&&void 0!==r?r:0:0):0},this.getMPFID=function(){if(a.mpfidMonitor&&m(a.mpfidMonitor.getMPFID)){var t=a.mpfidMonitor.getMPFID();if(t)return t.mpfid}},this.syncPerfLog=function(){var t,e;a.hasSentInitPerf||(a.perfLog(!0),null!==(e=(t=a.props).report)&&void 0!==e&&e.call(t))},this.hasFID=function(t){a.sendParams.fid=t.fid},this.getParams=function(){if(c()){var t={},e=window.performance.timing;t.dns=e.domainLookupEnd-e.domainLookupStart,t.tcp=e.connectEnd-e.connectStart,t.request=e.responseStart-e.requestStart,t.response=e.responseEnd-e.responseStart,t.processing=e.domComplete-e.domLoading,t.blank=e.responseEnd-e.navigationStart,t.domready=e.domInteractive-e.navigationStart,t.load=e.loadEventEnd-e.navigationStart,e.secureConnectionStart&&(t.ssl=e.connectEnd-e.secureConnectionStart),t.domparse=e.domInteractive-e.responseEnd,t.resource=e.loadEventStart-e.domContentLoadedEventEnd,t.ttfb=e.responseStart-e.requestStart,t.redirect=e.redirectEnd-e.redirectStart;var r=a.getPaintTime("first-paint"),n=a.getPaintTime("first-contentful-paint");r&&(t.fp=Math.round(r)),n&&(t.fcp=Math.round(n));var o=function(){if(!w())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=c()?window.performance.timing:null;return(o||i)&&(t.navigation=null!=o?o:i),i&&(t.timing=i),o&&(t.navigation_timing=o),t}},t.fmpMonitor&&(this.fmpMonitor=t.fmpMonitor);var e=t.performanceAuto;this.performanceAuto=void 0===e||e,this.props=null!=t?t:{}}var Ht="StaticErrorMonitor",Ct=(Lt.prototype.setup=function(t){u()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Lt.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ot(t,"href"):Ot(t,"src")},Lt.prototype.getParams=function(t,e){var r={ev_type:"static",st_type:e},n=k(t);return r.st_src=t,r.st_protocol=n.protocol,r.st_domain=n.hostname,r.st_path=n.pathname,r},Lt.monitorName=Ht,Lt);function Lt(){var s=this;this.name=Ht,this.callback=x,this.buildEvent=function(t){var e,r,n,o=t||window.event||{};try{n=null!==(r=null!==(e=o.target)&&void 0!==e?e:o.srcElement)&&void 0!==r?r:{}}catch(o){return}var i=n.tagName;if(i&&y(i)){i=i.toLowerCase();var a=s.getSrc(n);if(a&&a!==window.location.href)return{name:s.name,type:"get",event:s.getParams(a,i)}}},this.staticErrorLog=function(t){var e=s.buildEvent(t);e&&s.callback(e)}}function Ot(t,e){var r,n;return t.getAttribute&&m(t.getAttribute)?null!==(r=t.getAttribute(e))&&void 0!==r?r:"":null!==(n=t[e])&&void 0!==n?n:""}var jt="BreadcrumbMonitor",qt=(It.prototype.setup=function(){this.instrumentDOM()},It.prototype.instrumentDOM=function(){var t;"document"in window&&(t=this,window.document.addEventListener("click",t.domEventHandler("click",t.triggerHandlers.bind(t,"dom")),!1),window.document.addEventListener("keypress",t.keypressEventHandler(t.triggerHandlers.bind(t,"dom")),!1))},It.prototype.domEventHandler=function(e,r,n){var o=this;return void 0===n&&(n=!1),function(t){o.keypressTimeout=void 0,t&&o.lastCapturedEvent!==t&&(o.lastCapturedEvent=t,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:t,name:e})}):r({event:t,name:e}))}},It.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},It.prototype.keypressEventHandler=function(n){var o=this;return function(t){var e;try{e=t.target}catch(t){return}var r=e&&e.tagName;r&&("INPUT"===r||"TEXTAREA"===r||e.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(t),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},It.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?mt(t.event.target):mt(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},It.monitorName=jt,It);function It(){var n=this;this.name=jt,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(t,e){var r=f(f({},t),{timestamp:(new Date).getTime()});return n.breadcrumbs=void 0!==e&&0<=e?a(n.breadcrumbs,[r]).slice(-e):a(n.breadcrumbs,[r]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var At=(Dt.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},Dt.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},Dt.prototype._modifyEvent=function(t){return t},Dt.prototype._shouldSend=function(t){return!0},Dt.prototype._send=function(t){},Dt.prototype.idleSendEvent=function(t){this._send(t)},Dt);function Dt(){}var Ft={enableCatchGlobalJSError:!0},Bt="JSExceptionMonitor",Nt=(Jt.prototype.setup=function(t){u()&&(this.callback=t,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Jt.prototype.buildEvent=function(t){var e;if(!function(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return t instanceof Error}}(t)?(o(t)&&(e={message:JSON.stringify(t)}),y(t)&&(e={message:t})):e=t,e){var r={ev_type:"js_exception",exception:this.normalizeError(e)};return{name:this.name,type:"post",event:r}}},Jt.prototype.logError=function(t){var e=this.buildEvent(t);e&&this.callback(e)},Jt.prototype.getJSError=function(t){var e=t.error;if(e)return e},Jt.prototype.getJSPromiseRejection=function(t){var e=void 0;try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}if(e)return e},Jt.prototype.normalizeError=function(t){return{message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop}},Jt.monitorName=Bt,Jt);function Jt(t){var r=this;this.name=Bt,this.callback=x,this.jsErrorLog=function(t){var e=r.getJSError(t);e&&r.logError(e)},this.jsPromiseRejectionLog=function(t){var e=r.getJSPromiseRejection(t);e&&r.logError(e)},this.options=f(f({},Ft),t)}var Ut,Xt=(t(Vt,Ut=At),Object.defineProperty(Vt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Vt.prototype._send=function(t){var e=this,r=this.buildParams(t);null!=r&&(this.reportQueue.push(r),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){e._uploadQueue()},this.batchReportWait)))},Vt.prototype._uploadQueue=function(){var t;this.reportQueue.length&&this.ready&&(t={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:t,type:"post"}))},Vt.prototype._request=function(t){},Vt);function Vt(t){var e,r,n=Ut.call(this)||this;return n.reportQueue=[],n.isReady=!0,n.batchReportLength=null!==(e=t.maxBatchReportLength)&&void 0!==e?e:10,n.batchReportWait=null!==(r=t.batchReportWait)&&void 0!==r?r:1e3,n.batchReportTimeout=null,n}function Qt(t){return!!t&&Math.random()<Number(t)}var zt;t(Kt,zt=Xt),Kt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Kt.prototype,"contextAgent",{get:function(){var o=this,r={set:function(t,e){return o.options&&(o.options.commonParams.context||(o.options.commonParams.context={}),o.options.commonParams.context[t]=e),r},delete:function(t){var e;return null!==(e=o.options)&&void 0!==e&&e.commonParams.context&&"string"!=typeof o.options.commonParams.context&&p(o.options.commonParams.context,t)&&delete o.options.commonParams.context[t],r},clear:function(){return o.options&&(o.options.commonParams.context={}),r},get:function(t){var e,r,n;return null===(n=null===(r=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.context)||void 0===n?void 0:n[t]},toObject:function(){var t,e,r;return"string"==typeof(null===(t=o.options)||void 0===t?void 0:t.commonParams.context)?{}:f({},null===(r=null===(e=o.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.context)}};return r},enumerable:!1,configurable:!0}),Kt.prototype._shouldSend=function(t){var e,r;if(!(null!==(e=this.options)&&void 0!==e&&e.monitors&&t&&h(t)&&null!==(r=t.event)&&void 0!==r&&r.ev_type))return!1;var n=this.options.monitors;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){var o=O(W||[]);if(o&&o.test(t.event.ax_url))return!1}return!!n.BaseMonitor.webIDHit||!!n.BaseMonitor.sampleHit&&("PathMonitor"===t.name?function(t){var e=t.sendParams,r=t.pageViewMonitor,n=t.baseMonitor;if(1!==n.appTypeSetting.type||e.event.type!==n.appTypeSetting.SPA)return!1;if(!r)return!0;if(r.webIDHit)return!0;return!!r.sampleHit}({sendParams:t,pageViewMonitor:n.PageViewMonitor,baseMonitor:n.BaseMonitor}):"PageViewMonitor"===t.name?Gt({pageViewMonitor:n.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?Wt({sendParams:t,ajaxMonitor:n.AjaxMonitor}):"PerformanceMonitor"===t.name?$t({performanceMonitor:n.PerformanceMonitor}):"EmitMonitor"===t.name?function(t){var e=t.sendParams,r=t.flexibleMonitor;if(!r)return!0;if(r.webIDHit)return!0;if(!r.sampleHit)return!1;var n=r.eventNameHit;if(n){var o=e.event.flexible_data_list[0].event_name;if(n&&p(n,o))return Qt(n[o])}return!0}({sendParams:t,flexibleMonitor:n.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Yt({sendParams:t,staticErrorMonitor:n.StaticErrorMonitor}):"HijackMonitor"===t.name?function(t){var e=t.hijackMonitor;if(!e)return!0;if(e.webIDHit)return!0;return!!e.sampleHit}({hijackMonitor:n.HijackMonitor}):"JSErrorMonitor"!==t.name||Zt({jsErrorMonitor:n.JSErrorMonitor}))},Kt.prototype._modifyEvent=function(t){var e;if(null===(e=this.options)||void 0===e||!e.monitors||!t||!h(t))return{};var r=this.options.monitors;return"PerformanceMonitor"===t.name?function(t){var e,a=t.sendParams,r=t.performanceMonitor;if(!r)return a;if(!c())return{};{var n;e=a.event.isAsync?a.event.load>r.spaSlowSessionTime:(n=window.performance.timing,n.loadEventEnd-n.navigationStart>r.slowSessionTime)}{var s;a.event.resources&&l(a.event.resources)&&(s=O(r.geckoUrls||[]),a.event.resources.forEach(function(t,e){var r,n,o,i;null!==(r=a.event.resources)&&void 0!==r&&r[e]&&h(null===(n=a.event.resources)||void 0===n?void 0:n[e])&&m(null===(o=a.event.resources)||void 0===o?void 0:o[e].toJSON)&&(a.event.resources[e]=null===(i=a.event.resources)||void 0===i?void 0:i[e].toJSON(),a.event.resources[e].is_gecko=s&&s.test(t.name||"")?"1":"0")}))}r.webIDHitStaticResource||r.sampleHitStaticResource?a.event.upload_reason="sample":e?a.event.upload_reason="slow_session":(delete a.event.resources,a.event.has_resource=0);return a}({sendParams:t,performanceMonitor:r.PerformanceMonitor}):"PathMonitor"===t.name?function(t){var e=t.sendParams,r=t.baseMonitor,n=t.effect;1===r.appTypeSetting.type&&r.appTypeSetting.SPA===e.event.type&&(n({commonParams:{pid:e.event.path}}),delete e.event.type,delete e.event.path);return{}}({sendParams:t,baseMonitor:r.BaseMonitor,effect:this.updateConfig}):t},Kt.prototype.buildParams=function(t){var e,r,n,o,i,a,s=t.event||{},u=t.overrides,c=f({},null!==(r=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==r?r:{});h(null==u?void 0:u.context)&&(a=f(f({},null!==(n=h(c.context)&&c.context)&&void 0!==n?n:{}),null!==(o=null==u?void 0:u.context)&&void 0!==o?o:{}),c.context=a);var l=f(f(f({},s),null!=c?c:{}),s),l=this.normalizeEvent(l);return null!==(i=this.options)&&void 0!==i&&i.custom&&m(this.options.custom.beforeSend)&&(l=this.options.custom.beforeSend(l||{})),l},Kt.prototype._request=function(t){var e,r,n,o;t&&t.event&&(r=t.type,n=t.event,"beacon"===(null===(e=this.options)||void 0===e?void 0:e.commonParams.report_type)&&navigator&&navigator.sendBeacon?(o=JSON.stringify(n),navigator.sendBeacon(this.getReportURL(),o)):this.transport&&("get"!==r?"post"===r&&this.transport.postEvent(n):this.transport.getEvent(n)))},Kt.prototype.chechIsReady=function(){return 2===this.clientStatus},Kt.prototype.updateStatus=function(){var e=this;switch(this.clientStatus){case 0:this.clientStatus=1;break;case 1:if(this.clientStatus=2,!this.preQueue.length)return;this.preQueue.forEach(function(t){zt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},Kt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Kt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Kt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Kt.prototype.normalizeEvent=function(t){var e=f(f({},t),{url:window.location.href});return h(t.context)&&(e.context=JSON.stringify(t.context)),e||{}};function Kt(t){var e,i=zt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new D({reportURL:i.getReportURL()}),i.updateStatus())},i.uploadQueue=function(){i._uploadQueue()},i.updateConfig=function(t){var e,r,n,o=null===(r=null===(e=i.options)||void 0===e?void 0:e.commonParams)||void 0===r?void 0:r.pid;i.options=i.normalizeOptions(t),o&&null!==(n=null==t?void 0:t.commonParams)&&void 0!==n&&n.pid&&t.commonParams.pid!==o&&i.sendPageview()},i.sendPageview=function(){m(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?zt.prototype.sendEvent.call(i,t):i.preQueue.push(t)},i.reportURL=null!==(e=null==t?void 0:t.reportURL)&&void 0!==e?e:"",i.preQueue=[],i.clientStatus=0,i.enable=!1,i}function Wt(t){var r=t.sendParams,e=t.ajaxMonitor;if(!e)return!0;if(e.webIDHit)return!0;if(!e.sampleHit)return!1;var n=e.whitelistUrls;if(l(n)&&0<n.length){var o=O(e.whitelistUrls||[]);return o&&o.test(r.event.ax_url)?!0:!1}var i=O(e.ignore||[]);if(i&&i.test(r.event.ax_url))return!1;var a=e.statusCodeSample;if(a&&p(a,r.event.ax_status))return Qt(a[r.event.ax_status]);var s=e.requestUrlSample;if(s){var u=!1,c=!1;if(s.forEach(function(t){var e;u||null!=(e=O([t.url]))&&e.test(r.event.ax_url)&&(u=!0,c=Qt(t.sampleRate))}),u)return c}return!0}function Gt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function $t(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(t){var e=t.sendParams,r=t.staticErrorMonitor;if(!r)return!0;if(r.webIDHit)return!0;if(!r.sampleHit)return!1;var n=O(r.ignore||[]);return!n||!n.test(e.event.st_src)}function Zt(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function te(t){var e,r,n=t.setting,o=t.info,i=b({PageViewMonitor:{},JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},FlexibleMonitor:{},StaticErrorMonitor:{},HijackMonitor:{},BaseMonitor:{appTypeSetting:{}}},n.monitors);n.ajaxWhitelistUrls&&l(n.ajaxWhitelistUrls)&&(i.AjaxMonitor.whitelistUrls=(i.AjaxMonitor.whitelistUrls||[]).concat(n.ajaxWhitelistUrls)),n.ignoreAjax&&l(n.ignoreAjax)&&(i.AjaxMonitor.ignore=(i.AjaxMonitor.ignore||[]).concat(n.ignoreAjax)),p(n,"geckoUrls")&&(i.PerformanceMonitor.geckoUrls=n.geckoUrls),n.ignoreStatic&&l(n.ignoreStatic)&&(i.StaticErrorMonitor.ignore=(i.StaticErrorMonitor.ignore||[]).concat(n.ignoreStatic)),null!==(e=n.plugins)&&void 0!==e&&e.sentry&&(i.JSErrorMonitor=f(f({},i.JSErrorMonitor||{}),n.plugins.sentry)),n.errorRelease&&(i.JSErrorMonitor.release=n.errorRelease),n.ignoreErrors&&l(n.ignoreErrors)&&(i.JSErrorMonitor.ignoreErrors=n.ignoreErrors),n.errorBlacklistUrls&&l(n.errorBlacklistUrls)&&(i.JSErrorMonitor.blacklistUrls=n.errorBlacklistUrls),n.errorWhitelistUrls&&l(n.errorWhitelistUrls)&&(i.JSErrorMonitor.whitelistUrls=n.errorWhitelistUrls),p(n,"sampleRate")&&(i.BaseMonitor.sampleHit=Qt(n.sampleRate));var a,s,u,c=n.plugins;return c&&h(c)&&(p(c,"spa")&&((a=c.spa)&&p(a,"enable")&&(i.BaseMonitor.appTypeSetting.type=Number(a.enable)),a&&p(a,"type")&&(i.BaseMonitor.appTypeSetting.SPA=a.type)),!c.render||(s=null===(r=n.plugins)||void 0===r?void 0:r.render)&&h(s)&&p(s,"enable")&&(u=[{pids:[],value:s.enable,isDefault:!0}],i.BaseMonitor.appTypeSetting.renderType=function(t){var e=t.renderRules,r=t.pid;if(!e||!r)return 0;for(var n=0;n<e.length;n++){var o=e[n];if(l(o.pids)&&0<o.pids.length){var i=O(o.pids);if(i&&i.test(r))return o.value}if(o.isDefault&&n===e.length-1)return o.value}return 0}({renderRules:u,pid:o.pid}))),i}var ee="RANGERS_WEB_ID";function re(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:A(1)},PageViewMonitor:{webIDHit:!1,sampleHit:A(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:A(1),sampleHitTrace:!1,ignore:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(z),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:W},HijackMonitor:{webIDHit:!1,sampleHit:A(K)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.6",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:Q(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:q(),network_type:I()},t}function ne(t){t!==function(t,e){var r,n;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=g(o),s=a.next();!s.done;s=a.next()){var u=s.value.split("="),c=y(u[0])&&u[0].trim();c&&y(u[1])&&(i[c]=u[1].trim())}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i[e]||""}(document.cookie,ee)&&(document.cookie=ee+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var oe,ie,ae,se,ue=(oe="/v2/user/webid",ie="/v2/user/ssid",ae="/v2/event/list",se=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[oe,ie,ae].forEach(function(t){se.push(e+t)})}),se);function ce(t){var e=t.sendParams,r=t.commonParams,n=t.custom,o=function(t){var e,r=t.sendParams,n=t.commonParams,o=t.breadcrumbMonitor,i={};if(i.ev_type=r.event.ev_type,i.common=n,"PageViewMonitor"===r.name&&i)return i;if(("AjaxMonitor"===r.name||"FetchMonitor"===r.name)&&i){var a=r.event,s=(a.ev_type,v(a,["ev_type"]));return i.event=s,i}if("PerformanceMonitor"===r.name&&i){r.event.navigation=r.event.navigation_timing;var u=r.event,c=(u.ev_type,v(u,["ev_type"]));return i.ev_type="performance",i.event={fp:c.fp,fcp:c.fcp,fmp:c.fmp,tti:c.tti,fid:c.fid,mpfid:c.mpfid,isAsync:c.isAsync,timing:c.timing,navigation:c.navigation_timing,bounced:c.bounced},i}if("StaticErrorMonitor"===r.name&&i){i.ev_type="resource_error";var l=r.event,p=(l.ev_type,v(l,["ev_type"]));return i.event=p,i}if("ResourcePerformanceMonitor"===r.name&&i){i.ev_type="resource";var d=r.event,h=(d.ev_type,v(d,["ev_type"]));return i.event=h,i}if("JSExceptionMonitor"===r.name&&i){i.ev_type="js_error";var f=r.event,m=(f.ev_type,v(f,["ev_type"]));return i.event=m.exception,i.breadcrumbs=null!==(e=null==o?void 0:o.getBreadcrumbs())&&void 0!==e?e:[],i}return i}({sendParams:e,commonParams:f(f({},null!=r?r:{}),{url:window.location.href})});return n&&m(n.beforeSend)&&(o=n.beforeSend(o||{})),o}var le,pe={cover:x,accumulate:x,reportDirectly:x,average:x},de=function(t){var e,r=this;this.cover=function(t,e){r.log.cover(t,e)},this.accumulate=function(t,e){r.log.accumulate(t,e)},this.reportDirectly=function(t,e){r.log.reportDirectly(t,e)},this.average=function(t,e){r.log.average(t,e)},this.log=null!==(e=t.transport)&&void 0!==e?e:pe},he=(t(fe,le=At),fe.prototype.uploadQueue=function(){},fe.prototype._shouldSend=function(t){return function(t){var e=t.sendParams,r=t.monitorsSetting;if(!e||!h(e)||!e.event)return!1;var n=r;if("AjaxMonitor"===e.name||"FetchMonitor"===e.name){var o=O(a(["/monitor_browser/collect"],ue)||[]);if(o&&o.test(e.event.ax_url))return!1}return!(null==n||!n.BaseMonitor.webIDHit)||!(null==n||!n.BaseMonitor.sampleHit)&&("AjaxMonitor"===e.name||"FetchMonitor"===e.name?Wt({sendParams:e,ajaxMonitor:n.AjaxMonitor}):"PerformanceMonitor"===e.name?$t({performanceMonitor:n.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Yt({sendParams:e,staticErrorMonitor:n.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?Zt({jsErrorMonitor:n.JSErrorMonitor}):"PageViewMonitor"!==e.name||Gt({pageViewMonitor:n.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},fe.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},fe.prototype.buildParams=function(t){return ce({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},fe.prototype._send=function(t){t&&t.event&&t.name&&this.transport&&this.sendByTypes(t)},fe.prototype.sendByTypes=function(t){var e,r;this.transport&&(r={jsBase:null!==(e=this.options.commonParams)&&void 0!==e?e:{},jsInfo:this.buildParams(t)},"PerformanceMonitor"===t.name&&this.transport.cover(r,r.jsInfo.ev_type),"StaticErrorMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"ResourcePerformanceMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"AjaxMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"FetchMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"JSExceptionMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type),"PageViewMonitor"===t.name&&this.transport.reportDirectly(r,r.jsInfo.ev_type))},fe);function fe(t){var h=le.call(this)||this;return h.options={},h.setTransport=function(t){h.transport=new de({transport:t.transport}),h.preQueue.forEach(function(t){le.prototype.sendEvent.call(h,t)})},h.updateConfig=function(t){var e,r,n,o,i,a,s,u,c,l,p,d;h.options=(e={previousOptions:h.options,newOptions:t},l=e.previousOptions,p=e.newOptions,(d=f(f({},l),p)).commonParams=b({},null!==(r=l.commonParams)&&void 0!==r?r:{},null!==(n=p.commonParams)&&void 0!==n?n:{}),d.monitorsSetting=b({},null!==(o=l.monitorsSetting)&&void 0!==o?o:{},null!==(i=p.monitorsSetting)&&void 0!==i?i:{}),d.monitors=f(f({},null!==(a=l.monitors)&&void 0!==a?a:{}),null!==(s=p.monitors)&&void 0!==s?s:{}),d.custom=f(f({},null!==(u=l.custom)&&void 0!==u?u:{}),null!==(c=p.custom)&&void 0!==c?c:{}),d)},h.sendEvent=function(t){h.transport?le.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.getEventToBeSent=function(t){var e;return null!==(e=le.prototype.getEventToBeSent.call(h,t))&&void 0!==e?e:{}},h.options=t,h.preQueue=[],h}var me,ve=(ge.prototype.getUserIDFromRangers=function(e){window.collectEvent&&m(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},ge.prototype.init=function(t){this.client=new he(this.getClientOptions(t)),this.client.updateConfig(this.getClientOptions(t)),this.client.setTransport({transport:this.userSetting.transport}),this.sendPageview();var e=this.setMonitors();this.setupMonitors(e)},ge.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},ge.prototype.setMonitors=function(){var t,e,r=[],n=this.baseSetting.flags,o=new at;return r.push(o),n.enableCatchJSError&&r.push(new Nt),n.hookXHR&&r.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),n.hookFetch&&r.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),n.enableStaticError&&r.push(new Ct),n.enablePerformance&&(n.enableFMP?r.push(new xt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):r.push(new xt({renderType:1,preLongTaskObserver:{precollect:(null===(t=window.RangersSiteHybridSDK.lt)||void 0===t?void 0:t.e)||[],observer:null===(e=window.RangersSiteHybridSDK.lt)||void 0===e?void 0:e.o}}))),n.enableBreadcrumb&&r.push(new qt),n.enableResourcePerformance&&r.push(new Et({observe:!0,checkIgnore:function(t){return"https://tbm.snssdk.com/monitor_browser/collect"===t.name||("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType||"beacon"===t.initiatorType||"navigation"===t.initiatorType||0===t.decodedBodySize)}})),r},ge.prototype.setupMonitors=function(t){var r=this;this.client&&this.client.sendEvent&&(t.forEach(function(t){var e;"FMPMonitor"===(r.monitors[t.name]=t).name?t.setup(x):t.setup(null===(e=r.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ge.prototype.normalizeSetting=function(t){var e={commonParams:this.getClientCommonParams(t),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(t),custom:this.getClientCustom(t)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(t),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},n=this.baseSetting;return this.baseSetting=b({},this.baseSetting,e,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,n),this.baseSetting},ge.prototype.settingEffect=function(t,e){ne(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},ge.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ge.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!h(r))return n;var o=["context","pid"];i(r,function(t,e){s(o,t)&&(n[t]=e)});return i({user_unique_id:"rangers_web_id",app_id:"aid"},function(t,e){p(r,t)&&(n[e]=r[t])}),n},ge.prototype.getClientFlags=function(t){return function(t){var e;void 0===t&&(t={});var r=b({},null!==(e=t.flags)&&void 0!==e?e:{});if(!h(t))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return i(t,function(t,e){s(n,t)&&(r[t]=e)}),r}(f(f({},t),{flags:this.baseSetting.flags}))},ge.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&m(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},ge.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},ge.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return te({setting:e,info:this.getNormoalizeInfo()})},ge);function ge(){var o=this;this.version="0.2.6",this.instance=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("config"!==t[0])o.client&&o.onClose();else{if(!h(t[1]))return;var r=t[1];o.userSetting=f(f({},o.userSetting||{}),r||{});var n=o.normalizeSetting(r);o.client?o.client.updateConfig(o.getClientOptions(n)):o.init(n)}},this.changeReortType=function(t){var e;null!==(e=o.client)&&void 0!==e&&e.updateConfig({reportType:t})},this.onClose=function(){j(o.onCloseReport,o.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&o.onCloseReport(),"visible"===document.visibilityState&&o.changeReortType("xhr")},this.onCloseReport=function(){var t;o.changeReortType("beacon"),null!==(t=o.client)&&void 0!==t&&t.uploadQueue()},this.baseSetting=re(),this.client=void 0,this.userSetting={},this.monitors={}}var ye,be,we=x;return u()&&(ye=new ve,we=ye.instance,null!==(me=window.RangersSiteHybridSDK)&&void 0!==me&&me.q&&(l(be=window.RangersSiteHybridSDK.q)&&be.forEach(function(t){we.apply(void 0,a(t))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ye.instance),we}();
{
"name": "@apm-insight-web/rangers-site-sdk",
"version": "0.2.5",
"version": "0.2.6",
"main": "cn/index.cjs.js",

@@ -9,4 +9,4 @@ "module": "cn/index.esm.js",

"@slardar/polyfill": "0.1.2",
"@slardar/sdk": "3.6.0",
"@slardar/sdk-core": "3.6.0",
"@slardar/sdk": "3.6.1",
"@slardar/sdk-core": "3.6.1",
"@slardar/types": "3.5.3"

@@ -18,3 +18,3 @@ },

},
"gitHead": "d47a3e665aa0e54a4af2271c7feb863b3ddfa5ea"
"gitHead": "56cb2e7a793d43740af3a2ce09fdd2f60cf34cc0"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc