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.0 to 0.2.1

dist/browser.0.2.1.rangers.js

2

dist/browser.rangers.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 m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function v(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 g(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 o(){return!!h(window)}function n(){return!(!o()||!h(window.performance))}function u(){return!(!n()||!h(window.performance.timing))}function c(){return!!n()&&!!g(window.performance.getEntries)}function w(){return o()&&"function"==typeof window.MutationObserver}function S(){return o()&&"function"==typeof window.PerformanceObserver}function M(){return!!S()&&g(window.PerformanceLongTaskTiming)}function P(){if(!S())return!1;var t=window.PerformanceObserverEntryList;return g(t)&&g(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 E(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 k=function(t){if(!y(t))return!1;var e=t;return g(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function _(){}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 x(t){if(!t)return"";if(!g(t.forEach))return"";var r=[];return t.forEach(function(t){var e,n;l(t)&&t[0]&&!k(t[0])&&(e=t[0],n=t[1]||"",r.push(e+": "+n))}),r.join("\r\n")}function L(t){var e={},n=E(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=E(t),r=E(e);return n.protocol===r.protocol&&n.host===r.host}function C(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 O(e,n){g(e)&&(g(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),g(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){g(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,n;return void 0===t&&(t=window),o()&&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"},j=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 I=(F.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:_,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:_,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 n,r,o,i,a=null!==(n=null==e?void 0:e.success)&&void 0!==n?n:_,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:_,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:_,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:_,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 r=this;this.postEvent=function(t){var e=f(f({},t),r.getCommonParams());F.post(r.url,e)},this.getEvent=function(t){var e=T(f(f({},t),r.getCommonParams())),n=r.url+"?"+e;F.get(n)},this.getURL=function(){return r.url},this.options=t,this.url=this.options.reportURL}function D(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 B(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var N="x-tt-trace-id",U="x-tt-trace-host",J="x-tt-logid";function X(t,e,n){void 0===n&&(n="01");var r=""+D((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"+B(18);var r=22-n.length-4;return""+D(""+n.length,2)+n+B(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+D(""+o.length,2)+o+B(i)}(t)+("string"==typeof e?B(4):D(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 V=.1,z=.1,K=["/log/sentry/"],W=8e3,G=4e3;Q(),Q();var $="AjaxMonitor",Y=(Z.prototype.setup=function(t){void 0===t&&(t=_),g(XMLHttpRequest)&&(this.callback=t,this.start())},Z.prototype.updateConfig=function(t){this.props=b({},this.props,t)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||_;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)}},Z.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)}},Z.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=X(r,n),this.setRequestHeader(N,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},Z.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},Z.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},Z.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:x(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&&g(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),x(r)}return h(e)?x(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(N))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(J))&&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=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),L(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=E(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]}),g(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},Z.monitorName=$,Z);function Z(t){this.name=$,this.callback=_,this.traceId=null,this.props=t}function tt(t){return t instanceof Request}var et="FetchMonitor",nt=(rt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},rt.prototype.setup=function(t){void 0===t&&(t=_),e()&&(this.callback=t,this.start())},rt.prototype.start=function(){e()&&this.hookFetch()},rt.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},rt.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=E(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"]})},rt.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},rt.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;tt(t)&&t.headers&&g(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=X(n,r),i.headers.append(N,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),L(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&&g(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(N)&&(u.trace_id=null!==(n=t.headers.get(N))&&void 0!==n?n:void 0),t.headers.has(J)&&(u.log_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),g(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),g(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},rt.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=tt(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},rt.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return tt(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},rt.prototype.getFetchBody=function(t,e){return tt(t)?t.body:null==e?void 0:e.body},rt.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),x(n)},rt.monitorName=et,rt);function rt(t){this.name=et,this.callback=_,this.props=t}var ot="FMPMonitor",it=(at.prototype.setup=function(t){if(o())return w()?void(g(document.querySelector)&&(this.callback=t&&g(t)?t:function(){},this.startTime=Date.now(),this.list=[],g(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},at.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})},at.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||!g(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},at.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},at.prototype.getTimeGap=function(){return u()?this.startTime-performance.timing.navigationStart:0},at.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},at.monitorName=ot,at);function at(){var r=this;this.name=ot,this.callback=_,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 st(){}var ut=!1,ct=!1,lt={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=lt.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)},lt.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=lt.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(w()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=v(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=v(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&&(ut=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ct=!1,window.fetch=this.originals.fetch)}},pt="TTIMonitor",dt=(ht.prototype.setup=function(){},ht.prototype.isEnable=function(){return M()&&!!S()&&g(window.PerformanceResourceTiming)&&P()},ht.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=v(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"]})}},ht.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),lt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=st,this.proxyConfig.afterCb=st)},ht.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))},ht.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))},ht.prototype.registerListeners=function(){ut||(lt.patchXMLHTTPRequest(this.proxyConfig),ut=!0),ct||(lt.patchFetch(this.proxyConfig),ct=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=lt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ht.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ht.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ht.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ht.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ht.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}),ht.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ht.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)},ht.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ht.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ht.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)},ht.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=v(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=v(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},ht.monitorName=pt,ht);function ht(t){var e,n,r,o,i,a,s=this;if(this.name=pt,this.longTasks=[],this.callback=st,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=v(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 ft(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 mt="FIDMonitor",vt=(gt.prototype.setup=function(t){var u=this;if(S()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&P()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=v(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"]})}}},gt.monitorName=mt,gt);function gt(){this.name=mt,this.callback=_}var yt="MPFIDMonitor",bt=(wt.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&P()){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=v(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=v(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"]})}},wt.prototype.getMPFID=function(){var e,t;if(M()&&P()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=v(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))}},wt.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},wt.monitorName=yt,wt);function wt(t){this.name=yt,this.list=[],this.props=t}var St=[],Mt="ResourcePerformanceMonitor",Pt=(Tt.prototype.setup=function(){this.isEnable()&&this.isAsync&&window.performance.clearResourceTimings()},Tt.prototype.isEnable=function(){return c()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:t}}},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(St,t.initiatorType)})},Tt.monitorName=Mt,Tt);function Tt(t){var e=this;void 0===t&&(t=0),this.name=Mt,this.getResourcePerformance=function(){var t;return null!==(t=e.getPerformance())&&void 0!==t?t:{}},this.isAsync=t}var Et={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:[]},kt="PerformanceMonitor",_t=(Rt.prototype.setup=function(t){var e,n,r,o,i=this;u()&&(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({},Et),this.staticPerformanceMonitor=new Pt,this.staticPerformanceMonitor.setup(),(new vt).setup(this.hasFID),this.mpfidMonitor=new bt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:dt,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),O(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(c()){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},Rt.monitorName=kt,Rt);function Rt(t){var a=this;this.name=kt,this.callback=_,this.sendParams=f({},Et),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({},Et),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Pt(1),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new bt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:dt,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,_))},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),u()){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),g(a.callback)&&(!t&&a.ttiMonitor&&g(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&&g(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:g(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&&g(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(u()){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(!c())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=u()?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 xt="StaticErrorMonitor",Lt=(Ht.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Ht.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ct(t,"href"):Ct(t,"src")},Ht.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=E(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Ht.monitorName=xt,Ht);function Ht(){var s=this;this.name=xt,this.callback=_,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 Ct(t,e){var n,r;return t.getAttribute&&g(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var Ot="BreadcrumbMonitor",qt=(jt.prototype.setup=function(){this.instrumentDOM()},jt.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))},jt.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}))}},jt.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},jt.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))}},jt.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?ft(t.event.target):ft(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},jt.monitorName=Ot,jt);function jt(){var r=this;this.name=Ot,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=(It.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},It.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},It.prototype._modifyEvent=function(t){return t},It.prototype._shouldSend=function(t){return!0},It.prototype._send=function(t){},It.prototype.idleSendEvent=function(t){this._send(t)},It);function It(){}var Ft="JSExceptionMonitor",Dt=(Bt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.jsErrorLog.bind(this)),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog.bind(this)))},Bt.monitorName=Ft,Bt);function Bt(){var r=this;this.name=Ft,this.callback=_,this.buildEvent=function(t){var e={ev_type:"js_exception",exception:t};return{name:r.name,type:"post",event:e}},this.jsErrorLog=function(t){var e=t.error;e&&r.normalizeError(e)},this.jsPromiseRejectionLog=function(t){var e={};try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}r.normalizeError(e)},this.normalizeError=function(t){var e={message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop},n=r.buildEvent(e);n&&r.callback(n)}}var Nt,Ut=(t(Jt,Nt=At),Object.defineProperty(Jt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Jt.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))},Jt.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"}))},Jt.prototype._request=function(t){},Jt);function Jt(t){var e,n,r=Nt.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 Xt(t){return!!t&&Math.random()<Number(t)}var Qt;t(Vt,Qt=Ut),Vt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Vt.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}),Vt.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=C(K||[]);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?Kt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?zt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?Wt({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 Xt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Gt({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||$t({jsErrorMonitor:r.JSErrorMonitor}))},Vt.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(!u())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=C(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])&&g(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},Vt.prototype.buildParams=function(t){var e,n,r,o=t.event||{},i=f(f(f({},o),null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{}),o),i=this.normalizeEvent(i);return null!==(r=this.options)&&void 0!==r&&r.custom&&g(this.options.custom.beforeSend)&&(i=this.options.custom.beforeSend(i||{})),i},Vt.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)))},Vt.prototype.chechIsReady=function(){return 2===this.clientStatus},Vt.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=[]}},Vt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Vt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Vt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Vt.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 Vt(t){var e,i=Qt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new I({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(){g(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 zt(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=C(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=C(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 Xt(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=C([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Xt(t.sampleRate))}),u)return c}return!0}function Kt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Wt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=C(n.ignore||[]);return!r||!r.test(e.event.st_src)}function $t(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(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=Xt(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=C(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 Zt="RANGERS_WEB_ID";function te(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,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:K,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(V),slowSessionTime:W,spaSlowSessionTime:G,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:K},HijackMonitor:{webIDHit:!1,sampleHit:A(z)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.0",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:j()},t}function ee(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=v(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,Zt)&&(document.cookie=Zt+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var ne,re,oe,ie,ae=(ne="/v2/user/webid",re="/v2/user/ssid",oe="/v2/event/list",ie=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[ne,re,oe].forEach(function(t){ie.push(e+t)})}),ie);function se(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.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,m(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,m(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,m(l,["ev_type"]));return i.event=p,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var d=n.event,h=(d.ev_type,m(d,["ev_type"]));return i.event=h.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&&g(r.beforeSend)&&(o=r.beforeSend(o||{})),o}var ue,ce=(t(le,ue=Ut),le.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=C(a(["/monitor_browser/collect"],ae)||[]);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?zt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?Wt({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Gt({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?$t({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Kt({pageViewMonitor:r.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},le.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},le.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)))},le.prototype.buildParams=function(t){return se({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},le.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},le.prototype.getBatchReportURL=function(){return"https://tbm.snssdk.com/monitor_browser/collect"},le);function le(t){var e,h=ue.call(this,t)||this;return h.options={},h.setTransport=function(){h.transport=new I({reportURL:h.getReportURL()}),h.preQueue.forEach(function(t){ue.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?ue.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 pe,de=(he.prototype.getUserIDFromRangers=function(e){window.collectEvent&&g(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},he.prototype.init=function(t){var n=this;this.client=new ce(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)},he.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},he.prototype.setMonitors=function(){var t,e,n=[],r=this.baseSetting.flags,o=new it;return n.push(o),r.enableCatchJSError&&n.push(new Dt),r.hookXHR&&n.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Lt),r.enablePerformance&&(r.enableFMP?n.push(new _t({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new _t({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 qt),n.push(new Pt),n},he.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(_):t.setup(null===(e=n.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},he.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},he.prototype.settingEffect=function(t,e){ee(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},he.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},he.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},he.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","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}))},he.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&g(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},he.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},he.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return Yt({setting:e,info:this.getNormoalizeInfo()})},he);function he(){var o=this;this.version="0.2.0",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(){O(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=te(),this.client=void 0,this.userSetting={},this.monitors={}}var fe,me,ve=_;return o()&&(fe=new de,ve=fe.instance,null!==(pe=window.RangersSiteSDK)&&void 0!==pe&&pe.q&&(l(me=window.RangersSiteSDK.q)&&me.forEach(function(t){ve.apply(void 0,a(t))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=fe.instance),ve}();
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 m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function v(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 g(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 o(){return!!h(window)}function n(){return!(!o()||!h(window.performance))}function u(){return!(!n()||!h(window.performance.timing))}function c(){return!!n()&&!!g(window.performance.getEntries)}function w(){return o()&&"function"==typeof window.MutationObserver}function S(){return o()&&"function"==typeof window.PerformanceObserver}function M(){return!!S()&&g(window.PerformanceLongTaskTiming)}function P(){if(!S())return!1;var t=window.PerformanceObserverEntryList;return g(t)&&g(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 E(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 k=function(t){if(!y(t))return!1;var e=t;return g(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function _(){}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 x(t){if(!t)return"";if(!g(t.forEach))return"";var r=[];return t.forEach(function(t){var e,n;l(t)&&t[0]&&!k(t[0])&&(e=t[0],n=t[1]||"",r.push(e+": "+n))}),r.join("\r\n")}function L(t){var e={},n=E(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=E(t),r=E(e);return n.protocol===r.protocol&&n.host===r.host}function C(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 O(e,n){g(e)&&(g(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),g(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){g(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,n;return void 0===t&&(t=window),o()&&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"},j=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 I=(F.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:_,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:_,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 n,r,o,i,a=null!==(n=null==e?void 0:e.success)&&void 0!==n?n:_,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:_,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:_,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:_,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 r=this;this.postEvent=function(t){var e=f(f({},t),r.getCommonParams());F.post(r.url,e)},this.getEvent=function(t){var e=T(f(f({},t),r.getCommonParams())),n=r.url+"?"+e;F.get(n)},this.getURL=function(){return r.url},this.options=t,this.url=this.options.reportURL}function D(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 B(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var N="x-tt-trace-id",U="x-tt-trace-host",J="x-tt-logid";function X(t,e,n){void 0===n&&(n="01");var r=""+D((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"+B(18);var r=22-n.length-4;return""+D(""+n.length,2)+n+B(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+D(""+o.length,2)+o+B(i)}(t)+("string"==typeof e?B(4):D(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 V=.1,z=.1,K=["/log/sentry/"],W=8e3,G=4e3;Q(),Q();var $="AjaxMonitor",Y=(Z.prototype.setup=function(t){void 0===t&&(t=_),g(XMLHttpRequest)&&(this.callback=t,this.start())},Z.prototype.updateConfig=function(t){this.props=b({},this.props,t)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||_;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)}},Z.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)}},Z.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=X(r,n),this.setRequestHeader(N,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},Z.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},Z.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},Z.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:x(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&&g(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),x(r)}return h(e)?x(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(N))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(J))&&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=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),L(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=E(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]}),g(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},Z.monitorName=$,Z);function Z(t){this.name=$,this.callback=_,this.traceId=null,this.props=t}function tt(t){return t instanceof Request}var et="FetchMonitor",nt=(rt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},rt.prototype.setup=function(t){void 0===t&&(t=_),e()&&(this.callback=t,this.start())},rt.prototype.start=function(){e()&&this.hookFetch()},rt.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},rt.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=E(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"]})},rt.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},rt.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;tt(t)&&t.headers&&g(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=X(n,r),i.headers.append(N,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),L(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&&g(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(N)&&(u.trace_id=null!==(n=t.headers.get(N))&&void 0!==n?n:void 0),t.headers.has(J)&&(u.log_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),g(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),g(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},rt.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=tt(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},rt.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return tt(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},rt.prototype.getFetchBody=function(t,e){return tt(t)?t.body:null==e?void 0:e.body},rt.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),x(n)},rt.monitorName=et,rt);function rt(t){this.name=et,this.callback=_,this.props=t}var ot="FMPMonitor",it=(at.prototype.setup=function(t){if(o())return w()?void(g(document.querySelector)&&(this.callback=t&&g(t)?t:function(){},this.startTime=Date.now(),this.list=[],g(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},at.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})},at.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||!g(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},at.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},at.prototype.getTimeGap=function(){return u()?this.startTime-performance.timing.navigationStart:0},at.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},at.monitorName=ot,at);function at(){var r=this;this.name=ot,this.callback=_,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 st(){}var ut=!1,ct=!1,lt={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=lt.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)},lt.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=lt.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(w()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=v(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=v(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&&(ut=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ct=!1,window.fetch=this.originals.fetch)}},pt="TTIMonitor",dt=(ht.prototype.setup=function(){},ht.prototype.isEnable=function(){return M()&&!!S()&&g(window.PerformanceResourceTiming)&&P()},ht.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=v(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"]})}},ht.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),lt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=st,this.proxyConfig.afterCb=st)},ht.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))},ht.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))},ht.prototype.registerListeners=function(){ut||(lt.patchXMLHTTPRequest(this.proxyConfig),ut=!0),ct||(lt.patchFetch(this.proxyConfig),ct=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=lt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ht.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ht.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ht.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ht.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ht.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}),ht.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ht.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)},ht.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ht.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ht.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)},ht.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=v(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=v(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},ht.monitorName=pt,ht);function ht(t){var e,n,r,o,i,a,s=this;if(this.name=pt,this.longTasks=[],this.callback=st,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=v(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 ft(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 mt="FIDMonitor",vt=(gt.prototype.setup=function(t){var u=this;if(S()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&P()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=v(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"]})}}},gt.monitorName=mt,gt);function gt(){this.name=mt,this.callback=_}var yt="MPFIDMonitor",bt=(wt.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&P()){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=v(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=v(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"]})}},wt.prototype.getMPFID=function(){var e,t;if(M()&&P()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=v(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))}},wt.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},wt.monitorName=yt,wt);function wt(t){this.name=yt,this.list=[],this.props=t}var St=[],Mt="ResourcePerformanceMonitor",Pt=(Tt.prototype.setup=function(){this.isEnable()&&this.isAsync&&window.performance.clearResourceTimings()},Tt.prototype.isEnable=function(){return c()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:t}}},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(St,t.initiatorType)})},Tt.monitorName=Mt,Tt);function Tt(t){var e=this;void 0===t&&(t=0),this.name=Mt,this.getResourcePerformance=function(){var t;return null!==(t=e.getPerformance())&&void 0!==t?t:{}},this.isAsync=t}var Et={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:[]},kt="PerformanceMonitor",_t=(Rt.prototype.setup=function(t){var e,n,r,o,i=this;u()&&(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({},Et),this.staticPerformanceMonitor=new Pt,this.staticPerformanceMonitor.setup(),(new vt).setup(this.hasFID),this.mpfidMonitor=new bt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:dt,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),O(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(c()){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},Rt.monitorName=kt,Rt);function Rt(t){var a=this;this.name=kt,this.callback=_,this.sendParams=f({},Et),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({},Et),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Pt(1),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new bt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:dt,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,_))},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),u()){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),g(a.callback)&&(!t&&a.ttiMonitor&&g(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&&g(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:g(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&&g(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(u()){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(!c())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=u()?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 xt="StaticErrorMonitor",Lt=(Ht.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Ht.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ct(t,"href"):Ct(t,"src")},Ht.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=E(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Ht.monitorName=xt,Ht);function Ht(){var s=this;this.name=xt,this.callback=_,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 Ct(t,e){var n,r;return t.getAttribute&&g(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var Ot="BreadcrumbMonitor",qt=(jt.prototype.setup=function(){this.instrumentDOM()},jt.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))},jt.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}))}},jt.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},jt.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))}},jt.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?ft(t.event.target):ft(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},jt.monitorName=Ot,jt);function jt(){var r=this;this.name=Ot,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=(It.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},It.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},It.prototype._modifyEvent=function(t){return t},It.prototype._shouldSend=function(t){return!0},It.prototype._send=function(t){},It.prototype.idleSendEvent=function(t){this._send(t)},It);function It(){}var Ft="JSExceptionMonitor",Dt=(Bt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.jsErrorLog.bind(this)),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog.bind(this)))},Bt.monitorName=Ft,Bt);function Bt(){var r=this;this.name=Ft,this.callback=_,this.buildEvent=function(t){var e={ev_type:"js_exception",exception:t};return{name:r.name,type:"post",event:e}},this.jsErrorLog=function(t){var e=t.error;e&&r.normalizeError(e)},this.jsPromiseRejectionLog=function(t){var e={};try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}r.normalizeError(e)},this.normalizeError=function(t){var e={message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop},n=r.buildEvent(e);n&&r.callback(n)}}var Nt,Ut=(t(Jt,Nt=At),Object.defineProperty(Jt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Jt.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))},Jt.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"}))},Jt.prototype._request=function(t){},Jt);function Jt(t){var e,n,r=Nt.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 Xt(t){return!!t&&Math.random()<Number(t)}var Qt;t(Vt,Qt=Ut),Vt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Vt.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}),Vt.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=C(K||[]);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?Kt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?zt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?Wt({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 Xt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Gt({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||$t({jsErrorMonitor:r.JSErrorMonitor}))},Vt.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(!u())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=C(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])&&g(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},Vt.prototype.buildParams=function(t){var e,n,r,o=t.event||{},i=f(f(f({},o),null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{}),o),i=this.normalizeEvent(i);return null!==(r=this.options)&&void 0!==r&&r.custom&&g(this.options.custom.beforeSend)&&(i=this.options.custom.beforeSend(i||{})),i},Vt.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)))},Vt.prototype.chechIsReady=function(){return 2===this.clientStatus},Vt.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=[]}},Vt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Vt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Vt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Vt.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 Vt(t){var e,i=Qt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new I({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(){g(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 zt(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=C(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=C(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 Xt(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=C([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Xt(t.sampleRate))}),u)return c}return!0}function Kt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Wt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=C(n.ignore||[]);return!r||!r.test(e.event.st_src)}function $t(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(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=Xt(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=C(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 Zt="RANGERS_WEB_ID";function te(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,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:K,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:A(1),webIDHitStaticResource:!1,sampleHitStaticResource:A(V),slowSessionTime:W,spaSlowSessionTime:G,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:A(1),eventNameHit:{},eventNameSampleHit:A(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:A(1),ignore:K},HijackMonitor:{webIDHit:!1,sampleHit:A(z)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.1",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:j()},t}function ee(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=v(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,Zt)&&(document.cookie=Zt+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var ne,re,oe,ie,ae=(ne="/v2/user/webid",re="/v2/user/ssid",oe="/v2/event/list",ie=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[ne,re,oe].forEach(function(t){ie.push(e+t)})}),ie);function se(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.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,m(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,m(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,m(l,["ev_type"]));return i.event=p,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var d=n.event,h=(d.ev_type,m(d,["ev_type"]));return i.event=h.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&&g(r.beforeSend)&&(o=r.beforeSend(o||{})),o}var ue,ce=(t(le,ue=Ut),le.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=C(a(["/monitor_browser/collect"],ae)||[]);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?zt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?Wt({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Gt({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?$t({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Kt({pageViewMonitor:r.PageViewMonitor}))}({sendParams:t,monitorsSetting:this.options.monitorsSetting})},le.prototype._modifyEvent=function(t){return(e={sendParams:t}.sendParams)&&h(e)?e:{};var e},le.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)))},le.prototype.buildParams=function(t){return se({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},le.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},le.prototype.getBatchReportURL=function(){return"https://tbm.snssdk.com/monitor_browser/collect"},le);function le(t){var e,h=ue.call(this,t)||this;return h.options={},h.setTransport=function(){h.transport=new I({reportURL:h.getReportURL()}),h.preQueue.forEach(function(t){ue.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?ue.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 pe,de=(he.prototype.getUserIDFromRangers=function(e){window.collectEvent&&g(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},he.prototype.init=function(t){var n=this;this.client=new ce(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)},he.prototype.getClientOptions=function(t){return{monitorsSetting:t.monitors,commonParams:t.commonParams,custom:t.custom}},he.prototype.setMonitors=function(){var t,e,n=[],r=this.baseSetting.flags,o=new it;return n.push(o),r.enableCatchJSError&&n.push(new Dt),r.hookXHR&&n.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Lt),r.enablePerformance&&(r.enableFMP?n.push(new _t({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new _t({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 qt),n.push(new Pt),n},he.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(_):t.setup(null===(e=n.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},he.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},he.prototype.settingEffect=function(t,e){ee(t.commonParams.rangers_web_id),e.commonParams.pid!==t.commonParams.pid&&this.sendPageview()},he.prototype.sendPageview=function(){var t;null!==(t=this.client)&&void 0!==t&&t.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},he.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},he.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","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}))},he.prototype.getClientCustom=function(t){var e={};return t.beforeSend&&g(t.beforeSend)&&(e.beforeSend=t.beforeSend),e},he.prototype.getNormoalizeInfo=function(){return{web_id:this.baseSetting.commonParams.rangers_web_id,pid:this.baseSetting.commonParams.pid}},he.prototype.getClientMonitorsSetting=function(t){var e=f(f({},t),{monitors:this.baseSetting.monitors});return Yt({setting:e,info:this.getNormoalizeInfo()})},he);function he(){var o=this;this.version="0.2.1",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(){O(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=te(),this.client=void 0,this.userSetting={},this.monitors={}}var fe,me,ve=_;return o()&&(fe=new de,ve=fe.instance,null!==(pe=window.RangersSiteSDK)&&void 0!==pe&&pe.q&&(l(me=window.RangersSiteSDK.q)&&me.forEach(function(t){ve.apply(void 0,a(t))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=fe.instance),ve}();

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

var RangersSiteHybridSDK=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 m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function v(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 g(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 o(){return!!h(window)}function n(){return!(!o()||!h(window.performance))}function u(){return!(!n()||!h(window.performance.timing))}function c(){return!!n()&&!!g(window.performance.getEntries)}function w(){return o()&&"function"==typeof window.MutationObserver}function S(){return o()&&"function"==typeof window.PerformanceObserver}function M(){return!!S()&&g(window.PerformanceLongTaskTiming)}function P(){if(!S())return!1;var t=window.PerformanceObserverEntryList;return g(t)&&g(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 E(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 g(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function k(){}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 R(t){if(!t)return"";if(!g(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 H(t){var e={},n=E(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 L(t,e){var n=E(t),r=E(e);return n.protocol===r.protocol&&n.host===r.host}function C(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 O(e,n){g(e)&&(g(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),g(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){g(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,n;return void 0===t&&(t=window),o()&&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"},j=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function I(t){return!!t&&Math.random()<Number(t)}var A=(D.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:k,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:k,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:k,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:k,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:k,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:k,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 F(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 B(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var N="x-tt-trace-id",U="x-tt-trace-host",J="x-tt-logid";function X(t,e,n){void 0===n&&(n="01");var r=""+F((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"+B(18);var r=22-n.length-4;return""+F(""+n.length,2)+n+B(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+F(""+o.length,2)+o+B(i)}(t)+("string"==typeof e?B(4):F(e.toString(16),4));return"00-"+r+"-"+r.substr(0,16)+"-"+n}function V(){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 Q=.1,z=.1,K=["/log/sentry/"],W=8e3,G=4e3;V(),V();var $="AjaxMonitor",Y=(Z.prototype.setup=function(t){void 0===t&&(t=k),g(XMLHttpRequest)&&(this.callback=t,this.start())},Z.prototype.updateConfig=function(t){this.props=b({},this.props,t)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||k;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)}},Z.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)}},Z.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=X(r,n),this.setRequestHeader(N,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},Z.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=L(location.href,t);return o&&i&&a&&s},Z.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},Z.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:R(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&&g(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),R(r)}return h(e)?R(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(N))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(J))&&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),H(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=E(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]}),g(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},Z.monitorName=$,Z);function Z(t){this.name=$,this.callback=k,this.traceId=null,this.props=t}function tt(t){return t instanceof Request}var et="FetchMonitor",nt=(rt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},rt.prototype.setup=function(t){void 0===t&&(t=k),e()&&(this.callback=t,this.start())},rt.prototype.start=function(){e()&&this.hookFetch()},rt.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=L(location.href,t);return a&&s&&u&&c},rt.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=E(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"]})},rt.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},rt.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;tt(t)&&t.headers&&g(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=X(n,r),i.headers.append(N,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),H(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&&g(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(N)&&(u.trace_id=null!==(n=t.headers.get(N))&&void 0!==n?n:void 0),t.headers.has(J)&&(u.log_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),g(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),g(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},rt.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=tt(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},rt.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return tt(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},rt.prototype.getFetchBody=function(t,e){return tt(t)?t.body:null==e?void 0:e.body},rt.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),R(n)},rt.monitorName=et,rt);function rt(t){this.name=et,this.callback=k,this.props=t}var ot="FMPMonitor",it=(at.prototype.setup=function(t){if(o())return w()?void(g(document.querySelector)&&(this.callback=t&&g(t)?t:function(){},this.startTime=Date.now(),this.list=[],g(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},at.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})},at.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||!g(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},at.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},at.prototype.getTimeGap=function(){return u()?this.startTime-performance.timing.navigationStart:0},at.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},at.monitorName=ot,at);function at(){var r=this;this.name=ot,this.callback=k,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 st(){}var ut=!1,ct=!1,lt={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=lt.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)},lt.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=lt.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(w()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=v(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=v(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&&(ut=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ct=!1,window.fetch=this.originals.fetch)}},pt="TTIMonitor",dt=(ht.prototype.setup=function(){},ht.prototype.isEnable=function(){return M()&&!!S()&&g(window.PerformanceResourceTiming)&&P()},ht.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=v(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"]})}},ht.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),lt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=st,this.proxyConfig.afterCb=st)},ht.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))},ht.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))},ht.prototype.registerListeners=function(){ut||(lt.patchXMLHTTPRequest(this.proxyConfig),ut=!0),ct||(lt.patchFetch(this.proxyConfig),ct=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=lt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ht.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ht.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ht.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ht.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ht.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}),ht.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ht.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)},ht.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ht.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ht.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)},ht.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=v(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=v(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},ht.monitorName=pt,ht);function ht(t){var e,n,r,o,i,a,s=this;if(this.name=pt,this.longTasks=[],this.callback=st,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=v(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 ft(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 mt="FIDMonitor",vt=(gt.prototype.setup=function(t){var u=this;if(S()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&P()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=v(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"]})}}},gt.monitorName=mt,gt);function gt(){this.name=mt,this.callback=k}var yt="MPFIDMonitor",bt=(wt.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&P()){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=v(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=v(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"]})}},wt.prototype.getMPFID=function(){var e,t;if(M()&&P()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=v(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))}},wt.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},wt.monitorName=yt,wt);function wt(t){this.name=yt,this.list=[],this.props=t}var St=[],Mt="ResourcePerformanceMonitor",Pt=(Tt.prototype.setup=function(){this.isEnable()&&this.isAsync&&window.performance.clearResourceTimings()},Tt.prototype.isEnable=function(){return c()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:t}}},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(St,t.initiatorType)})},Tt.monitorName=Mt,Tt);function Tt(t){var e=this;void 0===t&&(t=0),this.name=Mt,this.getResourcePerformance=function(){var t;return null!==(t=e.getPerformance())&&void 0!==t?t:{}},this.isAsync=t}var Et={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",kt=(xt.prototype.setup=function(t){var e,n,r,o,i=this;u()&&(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({},Et),this.staticPerformanceMonitor=new Pt,this.staticPerformanceMonitor.setup(),(new vt).setup(this.hasFID),this.mpfidMonitor=new bt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:dt,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),O(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(c()){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=k,this.sendParams=f({},Et),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({},Et),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Pt(1),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new bt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:dt,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,k))},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),u()){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),g(a.callback)&&(!t&&a.ttiMonitor&&g(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&&g(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:g(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&&g(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(u()){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(!c())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=u()?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 Rt="StaticErrorMonitor",Ht=(Lt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Lt.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ct(t,"href"):Ct(t,"src")},Lt.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=E(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Lt.monitorName=Rt,Lt);function Lt(){var s=this;this.name=Rt,this.callback=k,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 Ct(t,e){var n,r;return t.getAttribute&&g(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var Ot="BreadcrumbMonitor",qt=(jt.prototype.setup=function(){this.instrumentDOM()},jt.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))},jt.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}))}},jt.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},jt.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))}},jt.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?ft(t.event.target):ft(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},jt.monitorName=Ot,jt);function jt(){var r=this;this.name=Ot,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 It=(At.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},At.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},At.prototype._modifyEvent=function(t){return t},At.prototype._shouldSend=function(t){return!0},At.prototype._send=function(t){},At.prototype.idleSendEvent=function(t){this._send(t)},At);function At(){}var Dt="JSExceptionMonitor",Ft=(Bt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.jsErrorLog.bind(this)),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog.bind(this)))},Bt.monitorName=Dt,Bt);function Bt(){var r=this;this.name=Dt,this.callback=k,this.buildEvent=function(t){var e={ev_type:"js_exception",exception:t};return{name:r.name,type:"post",event:e}},this.jsErrorLog=function(t){var e=t.error;e&&r.normalizeError(e)},this.jsPromiseRejectionLog=function(t){var e={};try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}r.normalizeError(e)},this.normalizeError=function(t){var e={message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop},n=r.buildEvent(e);n&&r.callback(n)}}var Nt,Ut=(t(Jt,Nt=It),Object.defineProperty(Jt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Jt.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))},Jt.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"}))},Jt.prototype._request=function(t){},Jt);function Jt(t){var e,n,r=Nt.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 Xt(t){return!!t&&Math.random()<Number(t)}var Vt;t(Qt,Vt=Ut),Qt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Qt.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}),Qt.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=C(K||[]);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?Kt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?zt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?Wt({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 Xt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Gt({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||$t({jsErrorMonitor:r.JSErrorMonitor}))},Qt.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(!u())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=C(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])&&g(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},Qt.prototype.buildParams=function(t){var e,n,r,o=t.event||{},i=f(f(f({},o),null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{}),o),i=this.normalizeEvent(i);return null!==(r=this.options)&&void 0!==r&&r.custom&&g(this.options.custom.beforeSend)&&(i=this.options.custom.beforeSend(i||{})),i},Qt.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)))},Qt.prototype.chechIsReady=function(){return 2===this.clientStatus},Qt.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){Vt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},Qt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Qt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Qt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Qt.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 Qt(t){var e,i=Vt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new A({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(){g(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?Vt.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 zt(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=C(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=C(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 Xt(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=C([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Xt(t.sampleRate))}),u)return c}return!0}function Kt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Wt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=C(n.ignore||[]);return!r||!r.test(e.event.st_src)}function $t(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(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=Xt(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=C(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 Zt="RANGERS_WEB_ID";function te(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:I(1)},PageViewMonitor:{webIDHit:!1,sampleHit:I(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:I(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:I(1),sampleHitTrace:!1,ignore:K,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:I(1),webIDHitStaticResource:!1,sampleHitStaticResource:I(Q),slowSessionTime:W,spaSlowSessionTime:G,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:I(1),eventNameHit:{},eventNameSampleHit:I(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:I(1),ignore:K},HijackMonitor:{webIDHit:!1,sampleHit:I(z)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.0",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:q(),network_type:j()},t}function ee(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=v(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,Zt)&&(document.cookie=Zt+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var ne,re,oe,ie,ae=(ne="/v2/user/webid",re="/v2/user/ssid",oe="/v2/event/list",ie=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[ne,re,oe].forEach(function(t){ie.push(e+t)})}),ie);function se(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.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,m(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,m(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,m(l,["ev_type"]));return i.event=p,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var d=n.event,h=(d.ev_type,m(d,["ev_type"]));return i.event=h.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&&g(r.beforeSend)&&(o=r.beforeSend(o||{})),o}var ue,ce={cover:k,accumulate:k,reportDirectly:k,average:k},le=function(t){var e,n=this;this.cover=function(t,e){n.log.cover(t,e)},this.accumulate=function(t,e){n.log.accumulate(t,e)},this.reportDirectly=function(t,e){n.log.reportDirectly(t,e)},this.average=function(t,e){n.log.average(t,e)},this.log=null!==(e=t.transport)&&void 0!==e?e:ce},pe=(t(de,ue=It),de.prototype.uploadQueue=function(){},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=C(a(["/monitor_browser/collect"],ae)||[]);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?zt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?Wt({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Gt({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?$t({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Kt({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.buildParams=function(t){return se({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},de.prototype._send=function(t){t&&t.event&&t.name&&this.transport&&this.sendByTypes(t)},de.prototype.sendByTypes=function(t){var e,n;this.transport&&(n={jsBase:null!==(e=this.options.commonParams)&&void 0!==e?e:{},jsInfo:this.buildParams(t)},"PerformanceMonitor"===t.name&&this.transport.cover(n,n.jsInfo.ev_type),"StaticErrorMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"ResourcePerformanceMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"AjaxMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"FetchMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"JSExceptionMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"PageViewMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type))},de);function de(t){var h=ue.call(this)||this;return h.options={},h.setTransport=function(t){h.transport=new le({transport:t.transport}),h.preQueue.forEach(function(t){ue.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?ue.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.getEventToBeSent=function(t){var e;return null!==(e=ue.prototype.getEventToBeSent.call(h,t))&&void 0!==e?e:{}},h.options=t,h.preQueue=[],h}var he,fe=(me.prototype.getUserIDFromRangers=function(e){window.collectEvent&&g(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},me.prototype.init=function(t){this.client=new pe(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)},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 it;return n.push(o),r.enableCatchJSError&&n.push(new Ft),r.hookXHR&&n.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Ht),r.enablePerformance&&(r.enableFMP?n.push(new kt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new kt({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}}))),r.enableBreadcrumb&&n.push(new qt),n.push(new Pt),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(k):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){ee(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","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&&g(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 Yt({setting:e,info:this.getNormoalizeInfo()})},me);function me(){var o=this;this.version="0.2.0",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(){O(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=te(),this.client=void 0,this.userSetting={},this.monitors={}}var ve,ge,ye=k;return o()&&(ve=new fe,ye=ve.instance,null!==(he=window.RangersSiteHybridSDK)&&void 0!==he&&he.q&&(l(ge=window.RangersSiteHybridSDK.q)&&ge.forEach(function(t){ye.apply(void 0,a(t))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ve.instance),ye}();
var RangersSiteHybridSDK=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 m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function v(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 g(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 o(){return!!h(window)}function n(){return!(!o()||!h(window.performance))}function u(){return!(!n()||!h(window.performance.timing))}function c(){return!!n()&&!!g(window.performance.getEntries)}function w(){return o()&&"function"==typeof window.MutationObserver}function S(){return o()&&"function"==typeof window.PerformanceObserver}function M(){return!!S()&&g(window.PerformanceLongTaskTiming)}function P(){if(!S())return!1;var t=window.PerformanceObserverEntryList;return g(t)&&g(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 E(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 g(e.toLowerCase)&&(e=e.toLowerCase()),s(["x-tt-token"],e)};function k(){}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 R(t){if(!t)return"";if(!g(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 H(t){var e={},n=E(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 L(t,e){var n=E(t),r=E(e);return n.protocol===r.protocol&&n.host===r.host}function C(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 O(e,n){g(e)&&(g(window.addEventListener)&&(window.addEventListener("unload",e),window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e)),g(document.addEventListener)&&document.addEventListener("visibilitychange",function(t){g(n)?n(t):"hidden"===document.visibilityState&&e(t)}))}var q=function(t){var e,n;return void 0===t&&(t=window),o()&&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"},j=function(){var t="unknown",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e&&y(e.effectiveType)?e.effectiveType:t};function I(t){return!!t&&Math.random()<Number(t)}var A=(D.post=function(t,e,n){var r,o,i=null!==(r=null==n?void 0:n.success)&&void 0!==r?r:k,a=null!==(o=null==n?void 0:n.fail)&&void 0!==o?o:k,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:k,s=null!==(r=null==e?void 0:e.fail)&&void 0!==r?r:k,u=null!==(o=null==e?void 0:e.getResponse)&&void 0!==o?o:k,c=null!==(i=null==e?void 0:e.getResponseText)&&void 0!==i?i:k,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 F(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 B(t){return t?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,t):""}var N="x-tt-trace-id",U="x-tt-trace-host",J="x-tt-logid";function X(t,e,n){void 0===n&&(n="01");var r=""+F((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"+B(18);var r=22-n.length-4;return""+F(""+n.length,2)+n+B(r)}e=parseInt(n,10)}var o=e.toString(16),i=22-o.length-4;return""+F(""+o.length,2)+o+B(i)}(t)+("string"==typeof e?B(4):F(e.toString(16),4));return"00-"+r+"-"+r.substr(0,16)+"-"+n}function V(){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 Q=.1,z=.1,K=["/log/sentry/"],W=8e3,G=4e3;V(),V();var $="AjaxMonitor",Y=(Z.prototype.setup=function(t){void 0===t&&(t=k),g(XMLHttpRequest)&&(this.callback=t,this.start())},Z.prototype.updateConfig=function(t){this.props=b({},this.props,t)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var n=XMLHttpRequest.prototype.setRequestHeader||k;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)}},Z.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)}},Z.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=X(r,n),this.setRequestHeader(N,a.traceId))),a.hookXMLHttpRequestOnreadystatechange.call(this,a),this._start=Date.now(),this._data=null==o?void 0:o[0],s.apply(this,o)}},Z.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=L(location.href,t);return o&&i&&a&&s},Z.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},Z.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:R(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&&g(t.split)&&(n=t.split(": "),r.push([n[0],n[1]]))}),R(r)}return h(e)?R(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(N))&&(a.trace_id=s,a.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,a.log_id=null!==(n=this.getResponseHeader(J))&&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),H(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=E(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]}),g(l.callback)&&l.callback({name:l.name,type:"get",event:a})),p)return p.apply(this,u)}},Z.monitorName=$,Z);function Z(t){this.name=$,this.callback=k,this.traceId=null,this.props=t}function tt(t){return t instanceof Request}var et="FetchMonitor",nt=(rt.prototype.updateConfig=function(t){this.props=b({},this.props,t)},rt.prototype.setup=function(t){void 0===t&&(t=k),e()&&(this.callback=t,this.start())},rt.prototype.start=function(){e()&&this.hookFetch()},rt.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=L(location.href,t);return a&&s&&u&&c},rt.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=E(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"]})},rt.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},rt.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;tt(t)&&t.headers&&g(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=X(n,r),i.headers.append(N,u.trace_id)))}catch(t){}return u.ax_type=c.getFetchMethod(o,i),u=f(f({},u),H(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&&g(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(N)&&(u.trace_id=null!==(n=t.headers.get(N))&&void 0!==n?n:void 0),t.headers.has(J)&&(u.log_id=null!==(r=t.headers.get(J))&&void 0!==r?r:void 0))):u.ax_size=0,c.updateAxRequest(u,o,i),g(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),g(l.callback)&&l.callback({name:l.name,type:"get",event:u}),Promise.reject(t)})}},rt.prototype.getFetchUrl=function(t,e){void 0===e&&(e=!1);var n="",n=tt(t)?t.url:t;return e||(n=y(n)?n.split("?")[0]:n),n},rt.prototype.getFetchMethod=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"get";return tt(t)&&(o=null!==(r=t.method)&&void 0!==r?r:o),o.toLowerCase()},rt.prototype.getFetchBody=function(t,e){return tt(t)?t.body:null==e?void 0:e.body},rt.prototype.getAllHeaders=function(t){if(!t||"function"!=typeof t.forEach)return"";var n=[];return t.forEach(function(t,e){n.push([e,t])}),R(n)},rt.monitorName=et,rt);function rt(t){this.name=et,this.callback=k,this.props=t}var ot="FMPMonitor",it=(at.prototype.setup=function(t){if(o())return w()?void(g(document.querySelector)&&(this.callback=t&&g(t)?t:function(){},this.startTime=Date.now(),this.list=[],g(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},at.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})},at.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||!g(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},at.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},at.prototype.getTimeGap=function(){return u()?this.startTime-performance.timing.navigationStart:0},at.prototype.formatEvent=function(t){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:t}}},at.monitorName=ot,at);function at(){var r=this;this.name=ot,this.callback=k,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 st(){}var ut=!1,ct=!1,lt={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=lt.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)},lt.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=lt.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(w()){var s=["img","script","iframe","link","audio","video","source"],t=new MutationObserver(function(t){var e,n;try{for(var r=v(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=v(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&&(ut=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ct=!1,window.fetch=this.originals.fetch)}},pt="TTIMonitor",dt=(ht.prototype.setup=function(){},ht.prototype.isEnable=function(){return M()&&!!S()&&g(window.PerformanceResourceTiming)&&P()},ht.prototype.registerPerformanceObserver=function(){var s=this;this.performanceObserver=new PerformanceObserver(function(t){var e,n,r=t.getEntries();try{for(var o=v(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"]})}},ht.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),lt.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=st,this.proxyConfig.afterCb=st)},ht.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))},ht.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))},ht.prototype.registerListeners=function(){ut||(lt.patchXMLHTTPRequest(this.proxyConfig),ut=!0),ct||(lt.patchFetch(this.proxyConfig),ct=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=lt.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ht.prototype.mutationObserverCallback=function(t){this.rescheduleTimer(performance.now()+5e3)},ht.prototype.beforeJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=performance.now()},ht.prototype.afterJSInitiatedRequestCallback=function(t){this.incompleteJSInitiatedRequestStartTimes[t]=void 0},ht.prototype.networkRequestFinishedCallback=function(t){this.networkRequests.push({start:t.fetchStart,end:t.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ht.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}),ht.prototype.longTaskFinishedCallback=function(t){var e=t.startTime+t.duration;this.longTasks.push({start:t.startTime,end:e}),this.rescheduleTimer(e+5e3)},ht.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)},ht.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var t=performance.timing;return t.domContentLoadedEventEnd-t.navigationStart}return null},ht.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var t=performance.getEntriesByType("paint")[0];return t?t.startTime:0}return 0},ht.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)},ht.prototype.computeLastKnownNetwork2Busy=function(t,e){var n,r,o,i;if(2<t.length)return performance.now();var a=[];try{for(var s=v(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=v(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},ht.monitorName=pt,ht);function ht(t){var e,n,r,o,i,a,s=this;if(this.name=pt,this.longTasks=[],this.callback=st,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=v(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 ft(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 mt="FIDMonitor",vt=(gt.prototype.setup=function(t){var u=this;if(S()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&P()){this.callback=t,this.observer=new PerformanceObserver(function(t,e){var n,r;try{for(var o=v(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"]})}}},gt.monitorName=mt,gt);function gt(){this.name=mt,this.callback=k}var yt="MPFIDMonitor",bt=(wt.prototype.setup=function(){var e,t,n,r,a=this;if(M()&&P()){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=v(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=v(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"]})}},wt.prototype.getMPFID=function(){var e,t;if(M()&&P()){this.observer&&this.observer.disconnect();var n=0;try{for(var r=v(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))}},wt.prototype.formatEvent=function(t){return{name:this.name,mpfid:t}},wt.monitorName=yt,wt);function wt(t){this.name=yt,this.list=[],this.props=t}var St=[],Mt="ResourcePerformanceMonitor",Pt=(Tt.prototype.setup=function(){this.isEnable()&&this.isAsync&&window.performance.clearResourceTimings()},Tt.prototype.isEnable=function(){return c()&&"function"==typeof performance.clearResourceTimings},Tt.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Tt.prototype.buildParams=function(t){return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:t}}},Tt.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(t){return!s(St,t.initiatorType)})},Tt.monitorName=Mt,Tt);function Tt(t){var e=this;void 0===t&&(t=0),this.name=Mt,this.getResourcePerformance=function(){var t;return null!==(t=e.getPerformance())&&void 0!==t?t:{}},this.isAsync=t}var Et={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",kt=(xt.prototype.setup=function(t){var e,n,r,o,i=this;u()&&(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({},Et),this.staticPerformanceMonitor=new Pt,this.staticPerformanceMonitor.setup(),(new vt).setup(this.hasFID),this.mpfidMonitor=new bt({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),r=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:dt,this.ttiMonitor=new r({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),o=this.syncPerfLog.bind(this),O(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(c()){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=k,this.sendParams=f({},Et),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({},Et),a.sendParams.isAsync=1,a.initFlag=!0,a.initStart=a.performanceNow(),a.staticPerformanceMonitor=new Pt(1),a.staticPerformanceMonitor.setup(),a.mpfidMonitor=new bt({isAsync:1,preLongTaskObserver:a.props.preLongTaskObserver}),a.mpfidMonitor.setup(),r=null!==(t=a.props.TTIMonitor)&&void 0!==t?t:dt,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,k))},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),u()){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),g(a.callback)&&(!t&&a.ttiMonitor&&g(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&&g(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:g(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&&g(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(u()){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(!c())return null;var t=window.performance.getEntriesByType("navigation");return l(t)&&0!==t.length?t[0]:null}(),i=u()?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 Rt="StaticErrorMonitor",Ht=(Lt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Lt.prototype.getSrc=function(t){return"link"===t.tagName.toLowerCase()?Ct(t,"href"):Ct(t,"src")},Lt.prototype.getParams=function(t,e){var n={ev_type:"static",st_type:e},r=E(t);return n.st_src=t,n.st_protocol=r.protocol,n.st_domain=r.hostname,n.st_path=r.pathname,n},Lt.monitorName=Rt,Lt);function Lt(){var s=this;this.name=Rt,this.callback=k,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 Ct(t,e){var n,r;return t.getAttribute&&g(t.getAttribute)?null!==(n=t.getAttribute(e))&&void 0!==n?n:"":null!==(r=t[e])&&void 0!==r?r:""}var Ot="BreadcrumbMonitor",qt=(jt.prototype.setup=function(){this.instrumentDOM()},jt.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))},jt.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}))}},jt.prototype.triggerHandlers=function(t,e){if(t)try{this.domBreadcrumb(e)}catch(t){}},jt.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))}},jt.prototype.domBreadcrumb=function(t){var e;try{e=t.event.target?ft(t.event.target):ft(t.event)}catch(t){e="<unknown>"}0!==e.length&&this.addBreadcrumb({category:"ui."+t.name,message:e})},jt.monitorName=Ot,jt);function jt(){var r=this;this.name=Ot,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 It=(At.prototype.sendEvent=function(t){var e=this.getEventToBeSent(t);e&&this.idleSendEvent(e)},At.prototype.getEventToBeSent=function(t){var e=this._modifyEvent(t);if(this._shouldSend(e))return e},At.prototype._modifyEvent=function(t){return t},At.prototype._shouldSend=function(t){return!0},At.prototype._send=function(t){},At.prototype.idleSendEvent=function(t){this._send(t)},At);function At(){}var Dt="JSExceptionMonitor",Ft=(Bt.prototype.setup=function(t){o()&&(this.callback=t,window.addEventListener("error",this.jsErrorLog.bind(this)),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog.bind(this)))},Bt.monitorName=Dt,Bt);function Bt(){var r=this;this.name=Dt,this.callback=k,this.buildEvent=function(t){var e={ev_type:"js_exception",exception:t};return{name:r.name,type:"post",event:e}},this.jsErrorLog=function(t){var e=t.error;e&&r.normalizeError(e)},this.jsPromiseRejectionLog=function(t){var e={};try{"reason"in t?e=t.reason:"detail"in t&&"reason"in t.detail&&(e=t.detail.reason)}catch(t){}r.normalizeError(e)},this.normalizeError=function(t){var e={message:t.message,name:t.name,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber,stack:t.stack,stacktrace:t.stacktrace,framesToPop:t.framesToPop},n=r.buildEvent(e);n&&r.callback(n)}}var Nt,Ut=(t(Jt,Nt=It),Object.defineProperty(Jt.prototype,"ready",{get:function(){return this.isReady},set:function(t){this.isReady=t,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Jt.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))},Jt.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"}))},Jt.prototype._request=function(t){},Jt);function Jt(t){var e,n,r=Nt.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 Xt(t){return!!t&&Math.random()<Number(t)}var Vt;t(Qt,Vt=Ut),Qt.prototype.setEnable=function(t){this.enable||(this.enable=t,this.enable&&this.updateStatus())},Object.defineProperty(Qt.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}),Qt.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=C(K||[]);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?Kt({pageViewMonitor:r.PageViewMonitor}):"AjaxMonitor"===t.name||"FetchMonitor"===t.name?zt({sendParams:t,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===t.name?Wt({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 Xt(r[o])}return!0}({sendParams:t,flexibleMonitor:r.FlexibleMonitor}):"StaticErrorMonitor"===t.name?Gt({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||$t({jsErrorMonitor:r.JSErrorMonitor}))},Qt.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(!u())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=C(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])&&g(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},Qt.prototype.buildParams=function(t){var e,n,r,o=t.event||{},i=f(f(f({},o),null!==(n=null===(e=this.options)||void 0===e?void 0:e.commonParams)&&void 0!==n?n:{}),o),i=this.normalizeEvent(i);return null!==(r=this.options)&&void 0!==r&&r.custom&&g(this.options.custom.beforeSend)&&(i=this.options.custom.beforeSend(i||{})),i},Qt.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)))},Qt.prototype.chechIsReady=function(){return 2===this.clientStatus},Qt.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){Vt.prototype.sendEvent.call(e,t)}),this.preQueue=[]}},Qt.prototype.getBatchReportURL=function(){var t;return"https://"+(null===(t=this.options)||void 0===t?void 0:t.commonParams.report_domain)+"/monitor_browser/collect"},Qt.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},Qt.prototype.normalizeOptions=function(t){var e;return b({},null!==(e=this.options)&&void 0!==e?e:{},t)},Qt.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 Qt(t){var e,i=Vt.call(this,null!=t?t:{reportURL:""})||this;return i.setTransport=function(){i.transport||(i.transport=new A({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(){g(i.sendEvent)&&i.sendEvent({name:"PageViewMonitor",type:"get",event:{ev_type:"pageview"}})},i.sendEvent=function(t){i.chechIsReady()?Vt.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 zt(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=C(e.whitelistUrls||[]);return o&&o.test(n.event.ax_url)?!0:!1}var i=C(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 Xt(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=C([t.url]))&&e.test(n.event.ax_url)&&(u=!0,c=Xt(t.sampleRate))}),u)return c}return!0}function Kt(t){var e=t.pageViewMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Wt(t){var e=t.performanceMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Gt(t){var e=t.sendParams,n=t.staticErrorMonitor;if(!n)return!0;if(n.webIDHit)return!0;if(!n.sampleHit)return!1;var r=C(n.ignore||[]);return!r||!r.test(e.event.st_src)}function $t(t){var e=t.jsErrorMonitor;return!e||(!!e.webIDHit||!!e.sampleHit)}function Yt(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=Xt(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=C(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 Zt="RANGERS_WEB_ID";function te(){var t={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return t.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},webIDHit:!1,sampleHit:I(1)},PageViewMonitor:{webIDHit:!1,sampleHit:I(1)},JSErrorMonitor:{webIDHit:!1,sampleHit:I(1),webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{webIDHit:!1,sampleHit:I(1),sampleHitTrace:!1,ignore:K,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{webIDHit:!1,sampleHit:I(1),webIDHitStaticResource:!1,sampleHitStaticResource:I(Q),slowSessionTime:W,spaSlowSessionTime:G,geckoUrls:[],interval:0,checkPoint:[]},FlexibleMonitor:{webIDHit:!1,sampleHit:I(1),eventNameHit:{},eventNameSampleHit:I(1)},StaticErrorMonitor:{webIDHit:!1,sampleHit:I(1),ignore:K},HijackMonitor:{webIDHit:!1,sampleHit:I(z)}},t.custom={},t.commonParams={aid:0,pid:"",version:"0.2.1",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:q(),network_type:j()},t}function ee(t){t!==function(t,e){var n,r;if(!t||!e)return"";var o=t.split(";"),i={};try{for(var a=v(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,Zt)&&(document.cookie=Zt+"="+t+";max-age=7776000;domain="+location.hostname+";path=/")}var ne,re,oe,ie,ae=(ne="/v2/user/webid",re="/v2/user/ssid",oe="/v2/event/list",ie=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(e){[ne,re,oe].forEach(function(t){ie.push(e+t)})}),ie);function se(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.common=r,"PageViewMonitor"===n.name&&i)return i;if(("AjaxMonitor"===n.name||"FetchMonitor"===n.name)&&i){var a=n.event,s=(a.ev_type,m(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,m(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,m(l,["ev_type"]));return i.event=p,i}if("JSExceptionMonitor"===n.name&&i){i.ev_type="js_error";var d=n.event,h=(d.ev_type,m(d,["ev_type"]));return i.event=h.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&&g(r.beforeSend)&&(o=r.beforeSend(o||{})),o}var ue,ce={cover:k,accumulate:k,reportDirectly:k,average:k},le=function(t){var e,n=this;this.cover=function(t,e){n.log.cover(t,e)},this.accumulate=function(t,e){n.log.accumulate(t,e)},this.reportDirectly=function(t,e){n.log.reportDirectly(t,e)},this.average=function(t,e){n.log.average(t,e)},this.log=null!==(e=t.transport)&&void 0!==e?e:ce},pe=(t(de,ue=It),de.prototype.uploadQueue=function(){},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=C(a(["/monitor_browser/collect"],ae)||[]);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?zt({sendParams:e,ajaxMonitor:r.AjaxMonitor}):"PerformanceMonitor"===e.name?Wt({performanceMonitor:r.PerformanceMonitor}):"StaticErrorMonitor"===e.name?Gt({sendParams:e,staticErrorMonitor:r.StaticErrorMonitor}):"JSExceptionMonitor"===e.name?$t({jsErrorMonitor:r.JSErrorMonitor}):"PageViewMonitor"!==e.name||Kt({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.buildParams=function(t){return se({sendParams:t,commonParams:this.options.commonParams,custom:this.options.custom})},de.prototype._send=function(t){t&&t.event&&t.name&&this.transport&&this.sendByTypes(t)},de.prototype.sendByTypes=function(t){var e,n;this.transport&&(n={jsBase:null!==(e=this.options.commonParams)&&void 0!==e?e:{},jsInfo:this.buildParams(t)},"PerformanceMonitor"===t.name&&this.transport.cover(n,n.jsInfo.ev_type),"StaticErrorMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"ResourcePerformanceMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"AjaxMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"FetchMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"JSExceptionMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type),"PageViewMonitor"===t.name&&this.transport.reportDirectly(n,n.jsInfo.ev_type))},de);function de(t){var h=ue.call(this)||this;return h.options={},h.setTransport=function(t){h.transport=new le({transport:t.transport}),h.preQueue.forEach(function(t){ue.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?ue.prototype.sendEvent.call(h,t):h.preQueue.push(t)},h.getEventToBeSent=function(t){var e;return null!==(e=ue.prototype.getEventToBeSent.call(h,t))&&void 0!==e?e:{}},h.options=t,h.preQueue=[],h}var he,fe=(me.prototype.getUserIDFromRangers=function(e){window.collectEvent&&g(window.collectEvent)&&window.collectEvent("getToken",function(t){e(t)})},me.prototype.init=function(t){this.client=new pe(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)},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 it;return n.push(o),r.enableCatchJSError&&n.push(new Ft),r.hookXHR&&n.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&n.push(new nt({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&n.push(new Ht),r.enablePerformance&&(r.enableFMP?n.push(new kt({fmpMonitor:o,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):n.push(new kt({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}}))),r.enableBreadcrumb&&n.push(new qt),n.push(new Pt),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(k):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){ee(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","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&&g(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 Yt({setting:e,info:this.getNormoalizeInfo()})},me);function me(){var o=this;this.version="0.2.1",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(){O(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=te(),this.client=void 0,this.userSetting={},this.monitors={}}var ve,ge,ye=k;return o()&&(ve=new fe,ye=ve.instance,null!==(he=window.RangersSiteHybridSDK)&&void 0!==he&&he.q&&(l(ge=window.RangersSiteHybridSDK.q)&&ge.forEach(function(t){ye.apply(void 0,a(t))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ve.instance),ye}();
{
"name": "@apm-insight-web/rangers-site-sdk",
"version": "0.2.0",
"version": "0.2.1",
"main": "dist/index.cjs.js",

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

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

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

},
"gitHead": "84770eeacadb301f2efde8391fce3b6543b1c8e0"
"gitHead": "f4594b8162263ade8baa879dfb4ea13edbddc88d"
}

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