@cloudcare/browser-logs 1.1.20 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/dataflux-logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e=Array.prototype,r=Function.prototype,n=Object.prototype,t=e.slice,i=n.toString,o=n.hasOwnProperty,s=(r.bind,e.forEach),a=(e.indexOf,Array.isArray),u=function(e,r,n){if(null===e)return!1;if(s&&e.forEach===s)e.forEach(r,n);else if(e.length===+e.length){for(var t=0,i=e.length;t<i;t++)if(t in e&&false===r.call(n,e[t],t,e))return!1}else for(var a in e)if(o.call(e,a)&&false===r.call(n,e[a],a,e))return!1},c=function(e){return u(t.call(arguments,1),(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e},d=function(e){return u(t.call(arguments,1),(function(r){for(var n in r)void 0!==r[n]&&(g(r[n])&&g(e[n])?c(e[n],r[n]):e[n]=r[n])})),e},f=a||function(e){return"[object Array]"===i.call(e)},l=function(e){if(!e)return!1;try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},p=function(e){return e?e.toArray?e.toArray():f(e)?t.call(e):(r=e)&&o.call(r,"callee")?t.call(e):v(e):[];var r},v=function(e){var r=[];return null===e||u(e,(function(e){r[r.length]=e})),r},h=function(e,r,n){if(e.map)return e.map(r);for(var t=[],i=0;i<e.length;i++)if(o.call(e,i)){var s=e[i];t.push(r.call(n,s,i,e))}return t},g=function(e){return null!==e&&"[object Object]"===i.call(e)},w=function(e){if(g(e)){for(var r in e)if(o.call(e,r))return!1;return!0}return!1},m=function(e){var r=[];return u(e,(function(e,n){r.push([n,e])})),r},_=function(e){return"[object String]"===i.call(e)},x=function(e){return"[object Boolean]"===i.call(e)},y=function(e){return"[object Number]"===i.call(e)&&/[\d\.]+/.test(String(e))},b=function e(r){var n=r;try{n=e(r)}catch(e){n=r}return n};Date.now;function O(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,O)}function S(e){var r="";return e&&(r=e.replace(/\/([^\/]*)\d([^\/]*)/g,"/?").replace(/\/$/g,"")),r||"/"}var k=function(e){for(var r=function(e){return b(e)},n={},t=(e=e||"").substring(1).split("&"),i=0;i<t.length;i++){var o=t[i].indexOf("=");if(-1!==o){var s=t[i].substring(0,o),a=t[i].substring(o+1);s=r(s),a=r(a),n[s]=a}}return n};function E(e){return e?String(e).substr(0,1)+String(e).substr(1).replace(/\d*/g,"x"):e}function $(e,r,n){if(null==e)return JSON.stringify(e);var t=[!1,void 0];T(e)&&(t=[!0,e.toJSON],delete e.toJSON);var i,o,s=[!1,void 0];"object"==typeof e&&T(i=Object.getPrototypeOf(e))&&(s=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{t[0]&&(e.toJSON=t[1]),s[0]&&(i.toJSON=s[1])}return o}function T(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}var M=1e3,B=6e4;function C(e,r){return+e.toFixed(r)}function W(){return performance.now()}function L(){return{relative:W(),timeStamp:Date.now()}}function I(e,r){return r-e}function P(e,r){for(var n=r.split(".");n.length;){var t=n.shift();if(!(e&&t in e&&o.call(e,t)))return;e=e[t]}return e}function R(e,r,n,t){return A(e,[r],n,t)}function A(e,r,n,t){var i=t&&t.once?function(e){o(),n(e)}:n;t=t&&t.passive?{capture:t.capture,passive:t.passive}:t&&t.capture,u(r,(function(r){e.addEventListener(r,i,t)}));var o=function(){u(r,(function(r){e.removeEventListener(r,i,t)}))};return{stop:o}}function j(){var e={};return{get:function(){return e},add:function(r,n){_(r)&&(e[r]=n)},remove:function(r){delete e[r]},set:function(r){g(r)&&(e=r)}}}function D(e){var r={};return u(e,(function(e,n){var t;r[(t=n,t.replace(/[A-Z]/g,(function(e,r){return(0!==r?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=N(e)})),r}function N(e){return f(e)?h(e,(function(e){return N(e)})):"object"==typeof e&&null!==e?D(e):e}function V(e){if("object"==typeof e&&e)e=$(e);else if(!_(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}function Q(e){return _(e)?e:$(e)}var U=function(){this.buffer=[]};U.prototype={add:function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},drain:function(e){u(this.buffer,(function(r){e(r)})),this.buffer.length=0}};var F=U,z={navigator:void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Windows 2000","Windows XP","Windows Vista","Windows 7","Windows 8","Windows 8.1","Windows Server 2003","Windows ME","Windows 10","Windows 98","Windows 95","Windows NT 4.0","Windows CE","Windows 3.11","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},q={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,"IE 11":e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,"IE 10":e.indexOf("MSIE 10.0")>-1&&e.indexOf("Trident")>-1,"IE 9":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 8":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 7":e.indexOf("MSIE 7.0")>-1&&e.indexOf("Trident")>-1,Edge:e.indexOf("Edg")>-1||e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,WechatWork:e.indexOf("wxwork/")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,"Windows 2000":e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1,"Windows XP":e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1,"Windows Server 2003":e.indexOf("Windows NT 5.2")>-1,"Windows Vista":e.indexOf("Windows NT 6.0")>-1,"Windows 7":e.indexOf("Windows 7")>-1||e.indexOf("Windows NT 6.1")>-1,"Windows 8":e.indexOf("Windows 8")>-1||e.indexOf("Windows NT 6.2")>-1,"Windows 8.1":e.indexOf("Windows 8.1")>-1||e.indexOf("Windows NT 6.3")>-1,"Windows ME":e.indexOf("Win 9x 4.90")>-1||e.indexOf("Windows ME")>-1,"Windows 10":e.indexOf("Windows 10.0")>-1||e.indexOf("Windows NT 10.0")>-1,"Windows 98":e.indexOf("Windows 98")>-1||e.indexOf("Win98")>-1,"Windows 95":e.indexOf("Windows 95")>-1||e.indexOf("Win95")>-1||e.indexOf("Windows_95")>-1,"Windows NT 4.0":e.indexOf("Windows NT 4.0")>-1||e.indexOf("WinNT4.0")>-1||e.indexOf("WinNT")>-1,"Windows CE":e.indexOf("Windows CE")>-1,"Windows 3.11":e.indexOf("Win16")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var r=z.navigator.userAgent||{},n=q.getMatchMap(r);for(var t in z.infoMap)for(var i=0;i<z.infoMap[t].length;i++){var o=z.infoMap[t][i];n[o]&&(e[t]=o)}},getOS:function(){return q.matchInfoMap(this),this.os||"Unknown"},getOSVersion:function(){var e=this,r=z.navigator.userAgent||{};e.osVersion="",e.osMajor="";var n={Windows:function(){var e=r.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return r.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return r.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return r.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return r.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return r.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return r.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion==r&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"},getDeviceType:function(){var e=this;return e.device="PC",q.matchInfoMap(e),e.device},getNetwork:function(){return navigator&&navigator.connection&&navigator.connection.effectiveType},getLanguage:function(){var e;return this.language=((e=(z.navigator.browserLanguage||z.navigator.language).split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language},getBrowserInfo:function(){var e=this;q.matchInfoMap(e);var r=z.navigator.userAgent||{},n=function(e,r){var n=z.navigator.mimeTypes;for(var t in n)if(n[t][e]==r)return!0;return!1},t=q.getMatchMap(r),i=!1;if(window.chrome){var o=r.replace(/^.*Chrome\/([\d]+).*$/,"$1");o>36&&window.showModalDialog?i=!0:o>45&&(i=n("type","application/vnd.chromium.remoting-viewer"))}if(t.Baidu&&t.Opera&&(t.Baidu=!1),t.Mobile&&(t.Mobile=!(r.indexOf("iPad")>-1)),i&&(n("type","application/gameplugin")||z.navigator&&void 0===z.navigator.connection.saveData?t["360SE"]=!0:t["360EE"]=!0),t.IE||t.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 74:case 105:default:break;case 102:t["360EE"]=!0;break;case 104:t["360SE"]=!0}var s={Safari:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return r.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return r.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return r.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return r.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return r.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return r.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return r.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return r.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return r.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return r.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return r.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return r.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return r.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return r.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return r.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return r.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return r.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return r.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return r.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return r.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return r.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return r.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return r.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return r.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return r.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";r.indexOf("LieBaoFast")>-1&&(e=r.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=r.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return r.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return r.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return r.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return r.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return r.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return r.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return r.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return r.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return r.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return r.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return r.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return r.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return r.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",s[e.browser]&&(e.browserVersion=s[e.browser](),e.browserVersion==r&&(e.browserVersion="")),"Chrome"==e.browser&&r.match(/\S+Browser/)&&(e.browser=r.match(/\S+Browser/)[0],e.version=r.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||t.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}},getGeoPostion:function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(r){e(r)}),(function(e){}))}},J={os:q.getOS(),osVersion:q.getOSVersion().version,osVersionMajor:q.getOSVersion().osMajor,browser:q.getBrowserInfo().browser,browserVersion:q.getBrowserInfo().browserVersion,browserVersionMajor:q.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:q.getNetwork(),divice:q.getDeviceType()},H="beforeunload",X="click",G="keydown",K="scroll",Y="touchstart",Z="visibilitychange",ee="action",re="error",ne="long_task",te="view",ie="resource",oe="logger",se={FETCH:"fetch",XHR:"xhr"},ae={DDTRACE:"ddtrace",ZIPKIN_MULTI_HEADER:"zipkin",ZIPKIN_SINGLE_HEADER:"zipkin_single_header",W3C_TRACEPARENT:"w3c_traceparent",SKYWALKING_V3:"skywalking_v3",JAEGER:"jaeger"},ue="handled",ce="unhandled",de=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function fe(e){if(pe){if(le===e)return;be()}var r=Se(e);throw pe=r,le=e,setTimeout((function(){le===e&&be()}),r.incomplete?2e3:0),e}var le,pe,ve,he,ge,we=[];function me(e){!function(){if(he)return;ve=window.onerror,window.onerror=xe,he=!0}(),function(){if(ge)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=ye,ge=!0}(),we.push(e)}function _e(e,r,n){var t;if(u(we,(function(i){try{i(e,r,n)}catch(e){t=e}})),t)throw t}function xe(e,r,n,t,i){if(pe)Ee(pe,r,n),be();else if(i)_e(Se(i),!0,i);else{var o,s={url:r,column:t,line:n},a=e;if("[object String]"==={}.toString.call(e)){var u=de.exec(a);u&&(o=u[1],a=u[2])}_e({name:o,message:"string"==typeof a?a:void 0,stack:[s]},!0,e)}return!!ve&&ve.apply(this,arguments)}function ye(e){var r=e.reason||"Empty reason";_e(Se(r),!0,r)}function be(){var e=pe,r=le;pe=void 0,le=void 0,_e(e,!1,r)}var Oe="?";function Se(e,r){var n,t=void 0===r?0:+r;try{if(n=function(e){var r=Te(e,"stacktrace");if(!r)return;for(var n,t=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=r.split("\n"),s=[],a=0;a<o.length;a+=2){var u;t.exec(o[a])?u={args:[],column:void 0,func:(n=t.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(u={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=Oe),u.context=[o[a+1]],s.push(u))}if(!s.length)return;return{stack:s,message:Te(e,"message"),name:Te(e,"name")}}(e),n)return n}catch(e){if(ke)throw e}try{if(n=function(e){var r=Te(e,"stack");if(!r)return;for(var n,t,i,o,s=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,d=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=r.split("\n"),l=[],p=0,v=f.length;p<v;p+=1){if(s.exec(f[p])){var h=(i=s.exec(f[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),t=d.exec(i[2]),n&&t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3]),o={args:h?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||Oe,line:i[3]?+i[3]:void 0,url:h?void 0:i[2]}}else if(u.exec(f[p]))o={args:[],column:(i=u.exec(f[p]))[4]?+i[4]:void 0,func:i[1]||Oe,line:+i[3],url:i[2]};else{if(!a.exec(f[p]))continue;n=(i=a.exec(f[p]))[3]&&i[3].indexOf(" > eval")>-1,t=c.exec(i[3]),n&&t?(i[3]=t[1],i[4]=t[2],i[5]=void 0):0!==p||i[5]||Be(e.columnNumber)||(l[0].column=e.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||Oe,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=Oe),l.push(o)}if(!l.length)return;return{stack:l,message:Te(e,"message"),name:Te(e,"name")}}(e),n)return n}catch(e){if(ke)throw e}try{if(n=function(e){var r=Te(e,"message");if(!r)return;var n=r.split("\n");if(n.length<4)return;var t,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,s=/^\s*Line (\d+) of function script\s*$/i,a=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var d in u)Me(u,d)&&!u[d].src&&c.push(u[d]);for(var f=2;f<n.length;f+=2){var l;if(i.exec(n[f]))l={args:[],column:void 0,func:(t=i.exec(n[f]))[3],line:+t[1],url:t[2]};else if(o.exec(n[f]))l={args:[],column:void 0,func:(t=o.exec(n[f]))[4],line:+t[1],url:t[3]};else if(s.exec(n[f])){t=s.exec(n[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+t[1]}}l&&(l.func||(l.func=Oe),l.context=[n[f+1]],a.push(l))}if(!a.length)return;return{stack:a,message:n[0],name:Te(e,"name")}}(e),n)return n}catch(e){if(ke)throw e}try{if(n=$e(e,t+1))return n}catch(e){if(ke)throw e}return{message:Te(e,"message"),name:Te(e,"name"),stack:[]}}var ke=!1;function Ee(e,r,n){var t={url:r,line:n?+n:void 0};if(t.url&&t.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===t.url){if(i[0].line===t.line)return!1;if(!i[0].line&&i[0].func===t.func)return i[0].line=t.line,i[0].context=t.context,!1}return i.unshift(t),e.partial=!0,!0}return e.incomplete=!0,!1}function $e(e,r){for(var n,t,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],s={},a=!1,u=$e.caller;u&&!a;u=u.caller)u!==Se&&u!==fe&&(t={args:[],column:void 0,func:Oe,line:void 0,url:void 0},n=i.exec(u.toString()),u.name?t.func=u.name:n&&(t.func=n[1]),void 0===t.func&&(t.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),s[u.toString()]?a=!0:s[u.toString()]=!0,o.push(t));r&&o.splice(0,r);var c={stack:o,message:Te(e,"message"),name:Te(e,"name")};return Ee(c,Te(e,"sourceURL")||Te(e,"fileName"),Te(e,"line")||Te(e,"lineNumber")),c}function Te(e,r){if("object"==typeof e&&e&&r in e){var n=e[r];return"string"==typeof n?n:void 0}}function Me(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function Be(e){return void 0===e}var Ce="agent",We="console",Le="network",Ie="source",Pe="logger";function Re(){var e=new Error;if(!e.stack)try{throw e}catch(e){}var r=Se(e);return r.stack=r.stack.slice(2),Ae(r)}function Ae(e){var r=e.name||"Error: "+e.message;return u(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,t=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";r+="\n at "+n+t+" @ "+e.url+i+o})),r}var je=function(){this._events=[],this.pendingEvents=[]};je.prototype={emit:function(e){var r=[].slice.call(arguments,1);u(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,r)}))},on:function(e,r,n){"function"==typeof r&&this._events.push({type:e,callback:r,context:n||this})}};new je;function De(e,r,n){var t=d({},e),i=n(t);return u(r,(function(r){var n=Ne(e,r),i=Ne(t,r);"string"==typeof n&&"string"==typeof i&&function(e,r,n){for(var t=e,i=r.split("."),o=0;o<i.length;o+=1){var s=i[o];if(!Ve(t,s))return;o!==i.length-1?t=t[s]:t[s]=n}}(e,r,i)})),i}function Ne(e,r){var n=e;for(var t of r.split(".")){if(!Ve(n,t))return;n=n[t]}return n}function Ve(e,r){return"object"==typeof e&&null!==e&&r in e}var Qe=function(){this.observers=[]};Qe.prototype={subscribe:function(e){this.observers.push(e)},notify:function(e){u(this.observers,(function(r){r(e)}))}};var Ue,Fe=Qe;function ze(e){return qe(e,function(e){if(e.origin)return e.origin;var r=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+r}(window.location)).href}function qe(e,r){if(function(){if(void 0!==Ue)return Ue;try{var e=new URL("http://test/path");return Ue="http://test/path"===e.href}catch(e){Ue=!1}return Ue}())return void 0!==r?new URL(e,r):new URL(e);if(void 0===r&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,t=n.createElement("a");if(void 0!==r){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=r,n.head.appendChild(i),n.body.appendChild(t)}return t.href=e,t}var Je=navigator.userAgent.toLowerCase(),He=function(){return/iphone os/.test(Je)};var Xe;function Ge(e,r){var n,t,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(t=Ye(e),o()),t},set:function(n,i){Ke(e,n,i,r),t=n,o()},clearCache:function(){window.clearTimeout(n),i=!1}}}function Ke(e,r,n,t){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),s=t&&t.crossSite?"none":"strict",a=t&&t.domain?";domain="+t.domain:"",u=t&&t.secure?";secure":"";document.cookie=e+"="+r+";"+o+";path=/;samesite="+s+a+u}function Ye(e){return function(e,r){var n=e.match("(?:^|;)\\s*"+r+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}var Ze=/^\s+|\s+$/g,er={resourceSampleRate:100,sampleRate:100,flushTimeout:3e4,maxErrorsByMinute:3e3,maxBatchSize:50,maxMessageSize:262144,requestErrorResponseLengthLimit:32768,batchBytesLimit:16384,datakitUrl:"",logsEndpoint:"",traceType:ae.DDTRACE,traceId128Bit:!1,trackInteractions:!1,allowedDDTracingOrigins:[],allowedTracingOrigins:[],isServiceSampling:!1,isJsBirdge:!1,isLineProtocolToJson:!1,beforeSend:function(e){},isServerError:function(e){return!1}};function rr(e){return e.replace(Ze,"")}function nr(e){var r={};return r.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),r.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(r.domain=function(){if(void 0===Xe){for(var e="dd_site_test_".concat(O()),r=window.location.hostname.split("."),n=r.pop();r.length&&!Ye(e);)n=r.pop()+"."+n,Ke(e,"test",M,{domain:n});Xe=n}return Xe}()),r}function tr(e){return e.lastIndexOf("/")===e.length-1?rr(e)+"v1/write/logging":rr(e)+"/v1/write/logging"}function ir(e,r){var n,t,i=f(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o={applicationId:e.applicationId,env:e.env||"",version:e.version||"",service:e.service||"browser",sdkVersion:r.sdkVersion,sdkName:r.sdkName,datakitUrl:(n=e.datakitUrl||e.datakitOrigin,n.lastIndexOf("/")===n.length-1?rr(n)+"v1/write/rum":rr(n)+"/v1/write/rum"),logsEndpoint:tr(e.datakitOrigin),isEnabled:function(e){return r=e,-1!==i.indexOf(r);var r},cookieOptions:nr(e)};return"isJsBirdge"in e&&(o.isJsBirdge=e.isJsBirdge),"isLineProtocolToJson"in e&&(o.isLineProtocolToJson=e.isLineProtocolToJson),"allowedDDTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedDDTracingOrigins),"allowedTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),"isServerError"in e&&l(e.isServerError)&&x(e.isServerError())&&(o.isServerError=e.isServerError),"traceId128Bit"in e&&(o.traceId128Bit=!!e.traceId128Bit),"traceType"in e&&((t=e.traceType)&&v(ae).indexOf(t)>-1)&&(o.traceType=e.traceType),"isServiceSampling"in e&&x(e.isServiceSampling)&&(o.isServiceSampling=e.isServiceSampling),d({},er,o)}var or,sr,ar,ur,cr,dr,fr={sdk_name:"_dd.sdk_name",sdk_version:"_dd.sdk_version",app_id:"application.id",env:"_dd.env",service:"_dd.service",version:"_dd.version",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",session_sampling:"session.is_sampling",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_path_group:"view.path_group",view_url_query:"view.url_query"},lr={view:{type:te,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",is_active:"view.is_active"},fields:{view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",cumulative_layout_shift:"view.cumulative_layout_shift",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_meaningful_paint:"view.largest_contentful_paint",first_paint_time:"view.fpt",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent"}},resource:{type:ie,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{duration:"resource.duration",resource_size:"resource.size",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_first_byte:"resource.firstbyte"}},error:{type:re,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",error_source:"error.source",error_type:"error.type",error_handling:"error.handling",resource_url:"error.resource.url",resource_url_host:"error.resource.url_host",resource_url_path:"error.resource.url_path",resource_url_path_group:"error.resource.url_path_group",resource_status:"error.resource.status",resource_status_group:"error.resource.status_group",resource_method:"error.resource.method"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"]}},long_task:{type:ne,tags:{},fields:{duration:"long_task.duration"}},action:{type:ee,tags:{action_id:"action.id",action_name:"action.target.name",action_type:"action.type"},fields:{duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_long_task_count:"action.long_task.count"}},browser_log:{type:oe,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"resource.url",error_resource_url_host:"resource.url_host",error_resource_url_path:"resource.url_path",error_resource_url_path_group:"resource.url_path_group",error_resource_status:"resource.status",error_resource_status_group:"resource.status_group",error_resource_method:"resource.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},pr=[],vr=[];function hr(){return or||(sr=XMLHttpRequest.prototype.open,ar=XMLHttpRequest.prototype.send,ur=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(e,r){return this._dataflux_xhr={method:e,startTime:-1,url:ze(r)},sr.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e){var r=this;if(this._dataflux_xhr){var n=this._dataflux_xhr;n.startTime=W(),n.startClocks=L(),n.isAborted=!1;var t=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&o(),t&&t.apply(this,arguments)};var i=!1,o=function e(){if(r.removeEventListener("loadend",e),!i){i=!0;var t=c({},n,{duration:I(n.startClocks.relative,W()),response:r.response,status:r.status});u(vr,(function(e){e(t,r)}))}};r.addEventListener("loadend",o),u(pr,(function(e){e(n,r)}))}return ar.apply(r,arguments)},XMLHttpRequest.prototype.abort=function(){return this._dataflux_xhr&&(this._dataflux_xhr.isAborted=!0),ur.apply(this,arguments)},or={beforeSend:function(e){pr.push(e)},onRequestComplete:function(e){vr.push(e)}}),or}function gr(e,r,n,t,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?r(u):Promise.resolve(u).then(t,i)}var wr,mr,_r=[],xr=[];function yr(){return cr||(!function(){if(!window.fetch)return;dr=window.fetch,window.fetch=function(e,r){var n,t=br.apply(null,[e,r]);return t?(n=dr.call(this,t.input,t.init),Or.apply(null,[n,t])):n=dr.call(this,e,r),n}}(),cr={beforeSend:function(e){_r.push(e)},onRequestComplete:function(e){xr.push(e)}}),cr}function br(e,r){var n=r&&r.method||"object"==typeof e&&e.method||"GET",t=ze("object"==typeof e&&e.url||e),i=L(),o={init:r,input:e,method:n,startTime:W(),startClocks:i,url:t};return u(_r,(function(e){e(o)})),o}function Or(e,r){var n=function(){var e,n=(e=function*(e){if(r.duration=I(r.startClocks.relative,W()),"stack"in e||e instanceof Error)r.status=0,r.response=Ae(Se(e)),r.headers=e.headers,r.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,u(xr,(function(e){e(r)}));else if("status"in e){var n;try{n=yield e.clone().text()}catch(e){n="Unable to retrieve response: "+e}r.response=n,r.responseType=e.type,r.status=e.status,r.headers=e.headers,r.isAborted=!1,u(xr,(function(e){e(r)}))}},function(){var r=this,n=arguments;return new Promise((function(t,i){var o=e.apply(r,n);function s(e){gr(o,t,i,s,a,"next",e)}function a(e){gr(o,t,i,s,a,"throw",e)}s(void 0)}))});return function(e){return n.apply(this,arguments)}}();e.then(n,n)}function Sr(e){return wr||(function(e,r){function n(n,t){(function(e,r){var n=[r.datakitUrl];r.logsEndpoint&&n.push(r.logsEndpoint);var t=!1;for(var i of n)if(0===e.indexOf(i)){t=!0;break}return t})(t.url,e)||t.isAborted||!(function(e){return 0===e.status&&"opaque"!==e.responseType}(t)||function(e){return e.status>=500}(t)||e.isServerError(t))||r.notify({message:$r(n)+" error "+t.method+" "+t.url,resource:{method:t.method,statusCode:t.status,url:t.url,traceId:t.traceId,spanId:t.spanId},source:Le,stack:Er(t.response,e)||"Failed to load",startClocks:t.startClocks})}hr().onRequestComplete((function(e){n(se.XHR,e)})),yr().onRequestComplete((function(e){n(se.FETCH,e)}))}(e,wr=new Fe),function(e){mr=console.error,console.error=function(){mr.apply(console,arguments);var r=Re();e.notify(c({},kr(p(arguments),r),{source:We,startClocks:L(),handling:ue}))}}(wr),function(e){me((function(r,n,t){var i=function(e,r,n,t){return e&&(void 0!==e.message||r instanceof Error)?{message:e.message||"Empty message",stack:Ae(e),handlingStack:t,type:e.name}:{message:n+""+JSON.stringify(r),stack:"No stack, consider using an instance of Error",handlingStack:t,type:e&&e.name}}(r,t,"Uncaught");e.notify({message:i.message,stack:i.stack,type:i.type,source:Ie,startClocks:L(),handling:ce})}))}(wr)),wr}function kr(e,r){var n=function(e,r){for(var n=0;n<e.length;n+=1){var t=e[n];if(r(t,n,e))return t}}(e,(function(e){return e instanceof Error}));return{message:h(["console error:"].concat(e),(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return((r=Se(e)).name||"Error")+": "+r.message;var r;return $(e,0,2)}(e)})).join(" "),stack:n?Ae(Se(n)):void 0,handlingStack:r}}function Er(e,r){return e&&e.length>r.requestErrorResponseLengthLimit?e.substring(0,r.requestErrorResponseLengthLimit)+"...":e}function $r(e){return se.XHR===e?"XHR":"Fetch"}var Tr=9e5,Mr=144e5;function Br(e,r,n){var t=function(e){var r=Ge("_dataflulx_an_id",e);return r.get()||r.set(O(),5184e6),r}(e),i=Ge("_dataflux_s",e),o=new Fe,s=Lr(i).id,a=function(e,r,n){var t,i,o,s,a=0;n||(n={});var u=function(){a=!1===n.leading?0:(new Date).getTime(),t=null,s=e.apply(i,o),t||(i=o=null)},c=function(){o=arguments;var c=(new Date).getTime();a||!1!==n.leading||(a=c);var d=r-(c-a);return i=this,d<=0||d>r?(t&&(clearTimeout(t),t=null),a=c,s=e.apply(i,o),t||(i=o=null)):t||!1===n.trailing||(t=setTimeout(u,d)),s};return c.cancel=function(){clearTimeout(t),a=0,t=null},c}((function(){i.clearCache();var e=Lr(i),t=n(e[r]);e[r]=t.trackingType,t.isTracked&&!e.id&&(e.id=O(),e.created=String(Date.now())),Ir(e,i),t.isTracked&&s!==e.id&&(s=e.id,o.notify())}),1e3);return a(),function(e){var r=A(window,[X,Y,G,K],e,{capture:!0,passive:!0});Rr.push(r.stop)}(a),function(e){var r=function(){"visible"===document.visibilityState&&e()},n=R(document,Z,r);Rr.push(n.stop);var t=window.setInterval(r,6e4);Rr.push((function(){clearInterval(t)}))}((function(){i.clearCache(),Ir(Lr(i),i)})),{getAnonymousID:function(){return t.get()},getId:function(){var e=Lr(i);return e.did||e.id},getTrackingType:function(){return Lr(i)[r]},getDebugSession:function(){var e=Lr(i);return w(e)||!e.did?{}:{id:e.did,created:e.dcreated}},addDebugSession:function(e,r){var n=Lr(i);w(n)||(n.did=e||O,n.dcreated=r||String(Date.now()),Ir(n,i))},clearDebugSession:function(){var e=Lr(i),r={};u(m(e),(function(e){"did"!==e[0]&&"dcreated"!==e[0]&&(r[e[0]]=e[1])})),Ir(r,i)},renewObservable:o}}var Cr=/^([a-z]+)=([a-z0-9-]+)$/,Wr="&";function Lr(e){var r=function(e){var r=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||Cr.test(e))})(r)&&u(r.split(Wr),(function(e){var r=Cr.exec(e);if(null!==r){var t=r[1],i=r[2];n[t]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Mr)&&(void 0===e.expire||Date.now()<Number(e.expire))}(r)?r:(Pr(e),{})}function Ir(e,r){if(w(e))Pr(r);else{e.expire=String(Date.now()+Tr);var n=[];u(m(e),(function(e){n.push(e[0]+"="+e[1])}));var t=n.join(Wr);r.set(t,Tr)}}function Pr(e){e.set("",0)}var Rr=[];var Ar=/[^\u0000-\u007F]/,jr="custom_keys";var Dr=function(e,r,n){this.endpointUrl=e,this.bytesLimit=r,this.isLineProtocolToJson=n};Dr.prototype={send:function(e,r){var n=function(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}(this.endpointUrl);if(navigator.sendBeacon&&r<this.bytesLimit&&!this.isLineProtocolToJson){if(navigator.sendBeacon(n,e))return}else if(navigator.sendBeacon&&r<this.bytesLimit&&this.isLineProtocolToJson){var t=new Blob([JSON.stringify(e)],{type:"application/json"});if(navigator.sendBeacon(n,t))return}var i=new XMLHttpRequest;i.open("POST",n,!0),i.withCredentials=!0,this.isLineProtocolToJson?(i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(e))):(i.setRequestHeader("Content-type","text/plain;charset=UTF-8"),i.send(e))}};var Nr=Dr,Vr=function(e){if(!e||!e.type)return{rowStr:"",rowData:void 0};var r={tags:{},fields:{}},n=!1,t="";return u(lr,(function(i,o){if(i.type===e.type){t+=o+",",r.measurement=o;var s=[],a=c({},fr,i.tags),d=["date","type"];u(a,(function(n,t){var i=P(e,n);d.push(t),(i||y(i))&&(r.tags[t]=Q(i),s.push(V(t)+"="+V(i)))}));var l=[];if(u(i.fields,(function(n,t){if(f(n)&&2===n.length){var i=n[0],o=n[1],s=P(e,o);d.push(t),(s||y(s))&&(r.fields[t]=s,s="string"===i?'"'+s.replace(/[\\]*"/g,'"').replace(/"/g,'\\"')+'"':V(s),l.push(V(t)+"="+s))}else if(_(n)){s=P(e,n);d.push(t),(s||y(s))&&(r.fields[t]=s,s=V(s),l.push(V(t)+"="+s))}})),e.tags&&g(e.tags)&&!w(e.tags)){var p=[];u(e.tags,(function(e,n){d.indexOf(n)>-1||(d.push(n),(e||y(e))&&(p.push(n),r.tags[n]=Q(e),s.push(V(n)+"="+V(e))))})),p.length&&(r.tags.custom_keys=Q(p),s.push(V(jr)+"="+V(p)))}e.type===oe&&u(e,(function(e,n){-1===d.indexOf(n)&&(y(e)||_(e)||x(e))&&(r.tags[n]=Q(e),s.push(V(n)+"="+V(e)))})),s.length&&(t+=s.join(",")),l.length&&(t+=" ",t+=l.join(","),n=!0),t=t+" "+e.date,r.time=(v=e.date,y(v)?C(1e6*v,0):v)}var v})),{rowStr:n?t:"",rowData:n?r:void 0}};function Qr(e,r,n,t,i,o,s){this.request=e,this.maxSize=r,this.bytesLimit=n,this.maxMessageSize=t,this.flushTimeout=i,this.isLineProtocolToJson=o,this.beforeUnloadCallback=s,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}Qr.prototype={add:function(e){this.addOrUpdate(e)},upsert:function(e,r){this.addOrUpdate(e,r)},flush:function(){if(0!==this.bufferMessageCount){var e=this.pushOnlyBuffer.concat(v(this.upsertBuffer));if(0===e.length)return;this.isLineProtocolToJson?this.request.send(h(e,(function(e){return JSON.parse(e)})),this.bufferBytesSize):this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}},processSendData:function(e){return this.isLineProtocolToJson?JSON.stringify(Vr(e).rowData):Vr(e).rowStr},sizeInBytes:function(e){return Ar.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},addOrUpdate:function(e,r){var n=this.process(e);n.processedMessage&&""!==n.processedMessage&&(n.messageBytesSize>=this.maxMessageSize||(this.hasMessageFor(r)&&this.remove(r),this.willReachedBytesLimitWith(n.messageBytesSize)&&this.flush(),this.push(n.processedMessage,n.messageBytesSize,r),this.isFull()&&this.flush()))},process:function(e){var r="";return{processedMessage:r=this.processSendData(e),messageBytesSize:this.sizeInBytes(r)}},push:function(e,r,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=r,this.bufferMessageCount+=1},remove:function(e){var r=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(r);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},hasMessageFor:function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},willReachedBytesLimitWith:function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},isFull:function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},flushPeriodically:function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),e.flushTimeout)},flushOnVisibilityHidden:function(){var e=this;navigator.sendBeacon&&(R(window,H,e.beforeUnloadCallback),R(document,Z,(function(){"hidden"===document.visibilityState&&e.flush()})),R(window,H,(function(){e.flush()})))}};var Ur=Qr,Fr={debug:"debug",critical:"critical",error:"error",info:"info",warn:"warning"},zr={[Fr.debug]:0,[Fr.info]:1,[Fr.warn]:2,[Fr.error]:3,[Fr.critical]:4};Jr=[],null===(qr=Fr)||u(qr,(function(e,r){Jr[Jr.length]=r}));var qr,Jr;const Hr="http";function Xr(e,r,n,t){this.contextManager=j(),void 0===r&&(r=Hr),void 0===n&&(n=Fr.debug),void 0===t&&(t={}),this.sendLog=e,this.handlerType=r,this.level=n,this.contextManager.set(t)}Xr.prototype={log:function(e,r,n){if(void 0===n&&(n=Fr.info),zr[n]>=zr[this.level]&&this.handlerType===Hr){var t=d({message:e,status:n},{tags:this.contextManager.get()},r);this.sendLog(t)}},debug:function(e,r){this.log(e,r,Fr.debug)},info:function(e,r){this.log(e,r,Fr.info)},warn:function(e,r){this.log(e,r,Fr.warn)},critical:function(e,r){this.log(e,r,Fr.critical)},error:function(e,r){var n={error:{origin:Pe}};this.log(e,d(n,r),Fr.error)},setContext:function(e){this.contextManager.set(e)},addContext:function(e,r){this.contextManager.add(e,r)},removeContext:function(e){this.contextManager.remove(e)},setHandler:function(e){this.handlerType=e},setLevel:function(e){this.level=e}};var Gr="0",Kr="1";function Yr(e,r){if(!r){var n=Zr(e)===Kr;return{getId:()=>{},isTracked:()=>n}}var t=Br(e.cookieOptions,"logs",(function(r){return function(e,r){var n=function(e){return e===Gr||e===Kr}(r)?r:Zr(e);return{trackingType:n,isTracked:n===Kr}}(e,r)}));return{getId:t.getId,isTracked:function(){return t.getTrackingType()===Kr}}}function Zr(e){return 0!==(r=e.sampleRate)&&100*Math.random()<=r?Kr:Gr;var r}var en={sdkVersion:"1.1.20",sdkName:"df_web_logs_sdk"},rn=["view.url","view.referrer","message","error.stack","source.url"];function nn(e){var r=window.DATAFLUX_RUM;return r&&r.getInternalContext?r.getInternalContext(e):void 0}var tn,on,sn,an,un=function(e){var r=!1,n=j(),t={},i=new F,o=function(e,r){i.add([e,r])},s=new Xr(f);return a={logger:s,init:function(t){(function(e){return r?(e.silentMultipleInit,!1):!(!e.datakitUrl&&!e.datakitOrigin)&&!!(void 0===e.sampleRate||(n=e.sampleRate,y(n)&&n>=0&&n<=100));var n})(t)&&(o=e(t,s,n.get),i.drain((function([e,r]){return o(e,r)})),r=!0)},getLoggerGlobalContext:n.get,setLoggerGlobalContext:n.set,addLoggerGlobalContext:n.add,removeLoggerGlobalContext:n.remove,createLogger:function(e,r){return void 0===r&&(r={}),t[e]=new Xr(f,r.handler,r.level,c({},r.context,{logger:{name:e}})),t[e]},getLogger:function(e){return t[e]}},u=c({},a,{onReady:function(e){e()}}),Object.defineProperty(u,"_setDebug",{get:function(){return setDebugMode},enumerable:!1}),u;var a,u;function f(e){var r,t,i;o(e,d({date:Date.now(),view:{referrer:document.referrer,url:window.location.href,host:window.location.host,path:window.location.pathname,pathGroup:S(window.location.pathname),urlQuery:$((r=window.location.href,t={},i=r.split("?")[1]||"",i&&(t=k("?"+i)),t))}},n.get()))}}((function(e,r,n){var t=ir(e,en);return function(e,r,n,t,i){var o=function(e,r,n){var t=function(e,r){var n=0,t=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),B),(n+=1)<=e.maxErrorsByMinute||t)return t=!1,!1;if(n===e.maxErrorsByMinute+1){t=!0;try{r({message:"Reached max number of errors by minute: ".concat(e.maxErrorsByMinute),source:Ce,startClocks:L()})}finally{t=!1}}return!0}}}(r,n);return function(n,i){if(e.isTracked()){var o=d({service:r.service||"browser",session:{id:e.getId()},type:oe,_dd:{sdkName:r.sdkName,sdkVersion:r.sdkVersion,env:r.env,version:r.version},device:J,user:{user_id:r.user_id}},i,nn(),n);if(r.beforeSend)if(!1===De(o,rn,r.beforeSend))return;if(o.status!==Fr.error||!t.isLimitReached())return D(o)}}}(n,e,a),s=function(e){var r=n(e.logsEndpoint);function n(r){return new Ur(new Nr(r,e.batchBytesLimit,e.isLineProtocolToJson),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,e.isLineProtocolToJson)}return{add:function(e){r.add(e)}}}(e);function a(e){var r,n,i=e.resource;if(i){var o=(r=e.resource.url,n=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)},n.prototype.setUrl=function(e){this._parse(e)},n.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},n.prototype.addQueryString=function(e){if("object"!=typeof e)return!1;var r=this._values.QueryString||"";for(var n in e)r=new RegExp(n+"[^&]+").test(r)?r.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===r.slice(-1)?r+n+"="+e[n]:""===r?n+"="+e[n]:r+"&"+n+"="+e[n];this._values.QueryString=r},n.prototype.getParse=function(){return this._values},n.prototype.getUrl=function(){var e="";return e+=this._values.Origin,(e+=this._values.Path)+(this._values.QueryString?"?"+this._values.QueryString:"")},n.prototype._parse=function(e){this._initValues();var r=this._regex.exec(e);if(!r)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==r[this._fields[n]]&&(this._values[n]=r[this._fields[n]]);this._values.Path=this._values.Path||"/",this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname+(this._values.Port?":"+this._values.Port:"")},new n(r)).getParse();i={method:e.resource.method,status:e.resource.statusCode,statusGroup:E(e.resource.statusCode),url:e.resource.url,urlHost:o.Host,urlPath:o.Path,urlPathGroup:S(o.Path)}}t.error(e.message,d({date:e.startClocks.timeStamp,error:{type:e.type,source:e.source,stack:e.stack}},{resource:i},nn(e.startClocks.relative)))}return r.subscribe(a),function(e,r){var n=o(e,r);n&&s.add(n)}}(t,!1!==e.forwardErrorsToLogs?Sr(t):new Fe,Yr(t,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var r="dd_cookie_test_".concat(O()),n="test";return Ke(r,n,M,e),Ye(r)===n}catch(e){return!1}}(t.cookieOptions)),r)}));tn=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}(),sn=un,an=tn[on="DATAFLUX_LOGS"],tn[on]=sn,an&&an.q&&u(an.q,(function(e){e()}))})();
|
|
1
|
+
(()=>{"use strict";var e=Array.prototype,r=Function.prototype,n=Object.prototype,t=e.slice,i=n.toString,o=n.hasOwnProperty,s=(r.bind,e.forEach),a=(e.indexOf,Array.isArray),u=function(e,r,n){if(null===e)return!1;if(s&&e.forEach===s)e.forEach(r,n);else if(e.length===+e.length){for(var t=0,i=e.length;t<i;t++)if(t in e&&false===r.call(n,e[t],t,e))return!1}else for(var a in e)if(o.call(e,a)&&false===r.call(n,e[a],a,e))return!1};var c=function(e){return u(t.call(arguments,1),(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e},d=function(e){return u(t.call(arguments,1),(function(r){for(var n in r)void 0!==r[n]&&(g(r[n])&&g(e[n])?c(e[n],r[n]):e[n]=r[n])})),e},f=a||function(e){return"[object Array]"===i.call(e)},l=function(e){if(!e)return!1;try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},p=function(e){return e?e.toArray?e.toArray():f(e)?t.call(e):(r=e)&&o.call(r,"callee")?t.call(e):v(e):[];var r},v=function(e){var r=[];return null===e||u(e,(function(e){r[r.length]=e})),r},h=function(e,r,n){if(e.map)return e.map(r);for(var t=[],i=0;i<e.length;i++)if(o.call(e,i)){var s=e[i];t.push(r.call(n,s,i,e))}return t},g=function(e){return null!==e&&"[object Object]"===i.call(e)},w=function(e){if(g(e)){for(var r in e)if(o.call(e,r))return!1;return!0}return!1},m=function(e){var r=[];return u(e,(function(e,n){r.push([n,e])})),r},_=function(e){return"[object String]"===i.call(e)},y=function(e){return"[object Boolean]"===i.call(e)},x=function(e){return"[object Number]"===i.call(e)&&/[\d\.]+/.test(String(e))},b=function e(r){var n=r;try{n=e(r)}catch(e){n=r}return n};Date.now;function O(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,O)}function S(e){var r="";return e&&(r=e.replace(/\/([^\/]*)\d([^\/]*)/g,"/?").replace(/\/$/g,"")),r||"/"}var k=function(e){for(var r=function(e){return b(e)},n={},t=(e=e||"").substring(1).split("&"),i=0;i<t.length;i++){var o=t[i].indexOf("=");if(-1!==o){var s=t[i].substring(0,o),a=t[i].substring(o+1);s=r(s),a=r(a),n[s]=a}}return n};function E(e){return e?String(e).substr(0,1)+String(e).substr(1).replace(/\d*/g,"x"):e}function $(e,r,n){if(null==e)return JSON.stringify(e);var t=[!1,void 0];T(e)&&(t=[!0,e.toJSON],delete e.toJSON);var i,o,s=[!1,void 0];"object"==typeof e&&T(i=Object.getPrototypeOf(e))&&(s=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{t[0]&&(e.toJSON=t[1]),s[0]&&(i.toJSON=s[1])}return o}function T(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}var M=1e3,B=6e4;function C(e,r){return+e.toFixed(r)}function W(){return performance.now()}function L(){return{relative:W(),timeStamp:(new Date).getTime()}}function I(e,r){return r-e}function P(e,r){for(var n=r.split(".");n.length;){var t=n.shift();if(!(e&&t in e&&o.call(e,t)))return;e=e[t]}return e}function R(e,r,n,t){return A(e,[r],n,t)}function A(e,r,n,t){var i=t&&t.once?function(e){o(),n(e)}:n;t=t&&t.passive?{capture:t.capture,passive:t.passive}:t&&t.capture,u(r,(function(r){e.addEventListener(r,i,t)}));var o=function(){u(r,(function(r){e.removeEventListener(r,i,t)}))};return{stop:o}}function j(){var e={};return{get:function(){return e},add:function(r,n){_(r)&&(e[r]=n)},remove:function(r){delete e[r]},set:function(r){g(r)&&(e=r)}}}function D(e){var r={};return u(e,(function(e,n){var t;r[(t=n,t.replace(/[A-Z]/g,(function(e,r){return(0!==r?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=N(e)})),r}function N(e){return f(e)?h(e,(function(e){return N(e)})):"object"==typeof e&&null!==e?D(e):e}function V(e){if("object"==typeof e&&e)e=$(e);else if(!_(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}function Q(e){return'"'+e.replace(/[\\]*"/g,'"').replace(/"/g,'\\"')+'"'}function U(e){return"object"==typeof e&&e?Q($(e)):_(e)?Q(e):e}var F=function(){this.buffer=[]};F.prototype={add:function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},drain:function(e){u(this.buffer,(function(r){e(r)})),this.buffer.length=0}};var z=F,q={navigator:void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Windows 2000","Windows XP","Windows Vista","Windows 7","Windows 8","Windows 8.1","Windows Server 2003","Windows ME","Windows 10","Windows 98","Windows 95","Windows NT 4.0","Windows CE","Windows 3.11","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},J={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,"IE 11":e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,"IE 10":e.indexOf("MSIE 10.0")>-1&&e.indexOf("Trident")>-1,"IE 9":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 8":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 7":e.indexOf("MSIE 7.0")>-1&&e.indexOf("Trident")>-1,Edge:e.indexOf("Edg")>-1||e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,WechatWork:e.indexOf("wxwork/")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,"Windows 2000":e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1,"Windows XP":e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1,"Windows Server 2003":e.indexOf("Windows NT 5.2")>-1,"Windows Vista":e.indexOf("Windows NT 6.0")>-1,"Windows 7":e.indexOf("Windows 7")>-1||e.indexOf("Windows NT 6.1")>-1,"Windows 8":e.indexOf("Windows 8")>-1||e.indexOf("Windows NT 6.2")>-1,"Windows 8.1":e.indexOf("Windows 8.1")>-1||e.indexOf("Windows NT 6.3")>-1,"Windows ME":e.indexOf("Win 9x 4.90")>-1||e.indexOf("Windows ME")>-1,"Windows 10":e.indexOf("Windows 10.0")>-1||e.indexOf("Windows NT 10.0")>-1,"Windows 98":e.indexOf("Windows 98")>-1||e.indexOf("Win98")>-1,"Windows 95":e.indexOf("Windows 95")>-1||e.indexOf("Win95")>-1||e.indexOf("Windows_95")>-1,"Windows NT 4.0":e.indexOf("Windows NT 4.0")>-1||e.indexOf("WinNT4.0")>-1||e.indexOf("WinNT")>-1,"Windows CE":e.indexOf("Windows CE")>-1,"Windows 3.11":e.indexOf("Win16")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var r=q.navigator.userAgent||{},n=J.getMatchMap(r);for(var t in q.infoMap)for(var i=0;i<q.infoMap[t].length;i++){var o=q.infoMap[t][i];n[o]&&(e[t]=o)}},getOS:function(){return J.matchInfoMap(this),this.os||"Unknown"},getOSVersion:function(){var e=this,r=q.navigator.userAgent||{};e.osVersion="",e.osMajor="";var n={Windows:function(){var e=r.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return r.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return r.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return r.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return r.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return r.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return r.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion==r&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"},getDeviceType:function(){var e=this;return e.device="PC",J.matchInfoMap(e),e.device},getNetwork:function(){return navigator&&navigator.connection&&navigator.connection.effectiveType},getLanguage:function(){var e;return this.language=((e=(q.navigator.browserLanguage||q.navigator.language).split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language},getBrowserInfo:function(){var e=this;J.matchInfoMap(e);var r=q.navigator.userAgent||{},n=function(e,r){var n=q.navigator.mimeTypes;for(var t in n)if(n[t][e]==r)return!0;return!1},t=J.getMatchMap(r),i=!1;if(window.chrome){var o=r.replace(/^.*Chrome\/([\d]+).*$/,"$1");o>36&&window.showModalDialog?i=!0:o>45&&(i=n("type","application/vnd.chromium.remoting-viewer"))}if(t.Baidu&&t.Opera&&(t.Baidu=!1),t.Mobile&&(t.Mobile=!(r.indexOf("iPad")>-1)),i&&(n("type","application/gameplugin")||q.navigator&&void 0===q.navigator.connection.saveData?t["360SE"]=!0:t["360EE"]=!0),t.IE||t.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 74:case 105:default:break;case 102:t["360EE"]=!0;break;case 104:t["360SE"]=!0}var s={Safari:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return r.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return r.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return r.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return r.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return r.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return r.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return r.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return r.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return r.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return r.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return r.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return r.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return r.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return r.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return r.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return r.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return r.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return r.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return r.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return r.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[r.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return r.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return r.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return r.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return r.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return r.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return r.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";r.indexOf("LieBaoFast")>-1&&(e=r.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=r.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return r.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return r.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return r.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return r.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return r.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return r.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return r.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return r.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return r.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return r.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return r.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return r.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return r.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",s[e.browser]&&(e.browserVersion=s[e.browser](),e.browserVersion==r&&(e.browserVersion="")),"Chrome"==e.browser&&r.match(/\S+Browser/)&&(e.browser=r.match(/\S+Browser/)[0],e.version=r.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||t.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}},getGeoPostion:function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(r){e(r)}),(function(e){}))}},H={os:J.getOS(),osVersion:J.getOSVersion().version,osVersionMajor:J.getOSVersion().osMajor,browser:J.getBrowserInfo().browser,browserVersion:J.getBrowserInfo().browserVersion,browserVersionMajor:J.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:J.getNetwork(),divice:J.getDeviceType()},X="beforeunload",G="click",K="keydown",Y="scroll",Z="touchstart",ee="visibilitychange",re="action",ne="error",te="long_task",ie="view",oe="resource",se="logger",ae={FETCH:"fetch",XHR:"xhr"},ue={DDTRACE:"ddtrace",ZIPKIN_MULTI_HEADER:"zipkin",ZIPKIN_SINGLE_HEADER:"zipkin_single_header",W3C_TRACEPARENT:"w3c_traceparent",SKYWALKING_V3:"skywalking_v3",JAEGER:"jaeger"},ce="handled",de="unhandled",fe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function le(e){if(ve){if(pe===e)return;Oe()}var r=ke(e);throw ve=r,pe=e,setTimeout((function(){pe===e&&Oe()}),r.incomplete?2e3:0),e}var pe,ve,he,ge,we,me=[];function _e(e){!function(){if(ge)return;he=window.onerror,window.onerror=xe,ge=!0}(),function(){if(we)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=be,we=!0}(),me.push(e)}function ye(e,r,n){var t;if(u(me,(function(i){try{i(e,r,n)}catch(e){t=e}})),t)throw t}function xe(e,r,n,t,i){if(ve)$e(ve,r,n),Oe();else if(i)ye(ke(i),!0,i);else{var o,s={url:r,column:t,line:n},a=e;if("[object String]"==={}.toString.call(e)){var u=fe.exec(a);u&&(o=u[1],a=u[2])}ye({name:o,message:"string"==typeof a?a:void 0,stack:[s]},!0,e)}return!!he&&he.apply(this,arguments)}function be(e){var r=e.reason||"Empty reason";ye(ke(r),!0,r)}function Oe(){var e=ve,r=pe;ve=void 0,pe=void 0,ye(e,!1,r)}var Se="?";function ke(e,r){var n,t=void 0===r?0:+r;try{if(n=function(e){var r=Me(e,"stacktrace");if(!r)return;for(var n,t=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=r.split("\n"),s=[],a=0;a<o.length;a+=2){var u;t.exec(o[a])?u={args:[],column:void 0,func:(n=t.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(u={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=Se),u.context=[o[a+1]],s.push(u))}if(!s.length)return;return{stack:s,message:Me(e,"message"),name:Me(e,"name")}}(e),n)return n}catch(e){if(Ee)throw e}try{if(n=function(e){var r=Me(e,"stack");if(!r)return;for(var n,t,i,o,s=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,d=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=r.split("\n"),l=[],p=0,v=f.length;p<v;p+=1){if(s.exec(f[p])){var h=(i=s.exec(f[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),t=d.exec(i[2]),n&&t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3]),o={args:h?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||Se,line:i[3]?+i[3]:void 0,url:h?void 0:i[2]}}else if(u.exec(f[p]))o={args:[],column:(i=u.exec(f[p]))[4]?+i[4]:void 0,func:i[1]||Se,line:+i[3],url:i[2]};else{if(!a.exec(f[p]))continue;n=(i=a.exec(f[p]))[3]&&i[3].indexOf(" > eval")>-1,t=c.exec(i[3]),n&&t?(i[3]=t[1],i[4]=t[2],i[5]=void 0):0!==p||i[5]||Ce(e.columnNumber)||(l[0].column=e.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||Se,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=Se),l.push(o)}if(!l.length)return;return{stack:l,message:Me(e,"message"),name:Me(e,"name")}}(e),n)return n}catch(e){if(Ee)throw e}try{if(n=function(e){var r=Me(e,"message");if(!r)return;var n=r.split("\n");if(n.length<4)return;var t,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,s=/^\s*Line (\d+) of function script\s*$/i,a=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var d in u)Be(u,d)&&!u[d].src&&c.push(u[d]);for(var f=2;f<n.length;f+=2){var l;if(i.exec(n[f]))l={args:[],column:void 0,func:(t=i.exec(n[f]))[3],line:+t[1],url:t[2]};else if(o.exec(n[f]))l={args:[],column:void 0,func:(t=o.exec(n[f]))[4],line:+t[1],url:t[3]};else if(s.exec(n[f])){t=s.exec(n[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+t[1]}}l&&(l.func||(l.func=Se),l.context=[n[f+1]],a.push(l))}if(!a.length)return;return{stack:a,message:n[0],name:Me(e,"name")}}(e),n)return n}catch(e){if(Ee)throw e}try{if(n=Te(e,t+1))return n}catch(e){if(Ee)throw e}return{message:Me(e,"message"),name:Me(e,"name"),stack:[]}}var Ee=!1;function $e(e,r,n){var t={url:r,line:n?+n:void 0};if(t.url&&t.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===t.url){if(i[0].line===t.line)return!1;if(!i[0].line&&i[0].func===t.func)return i[0].line=t.line,i[0].context=t.context,!1}return i.unshift(t),e.partial=!0,!0}return e.incomplete=!0,!1}function Te(e,r){for(var n,t,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],s={},a=!1,u=Te.caller;u&&!a;u=u.caller)u!==ke&&u!==le&&(t={args:[],column:void 0,func:Se,line:void 0,url:void 0},n=i.exec(u.toString()),u.name?t.func=u.name:n&&(t.func=n[1]),void 0===t.func&&(t.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),s[u.toString()]?a=!0:s[u.toString()]=!0,o.push(t));r&&o.splice(0,r);var c={stack:o,message:Me(e,"message"),name:Me(e,"name")};return $e(c,Me(e,"sourceURL")||Me(e,"fileName"),Me(e,"line")||Me(e,"lineNumber")),c}function Me(e,r){if("object"==typeof e&&e&&r in e){var n=e[r];return"string"==typeof n?n:void 0}}function Be(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function Ce(e){return void 0===e}var We="agent",Le="console",Ie="network",Pe="source",Re="logger";function Ae(){var e=new Error;if(!e.stack)try{throw e}catch(e){}var r=ke(e);return r.stack=r.stack.slice(2),je(r)}function je(e){var r=e.name||"Error: "+e.message;return u(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,t=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";r+="\n at "+n+t+" @ "+e.url+i+o})),r}var De=function(){this._events=[],this.pendingEvents=[]};De.prototype={emit:function(e){var r=[].slice.call(arguments,1);u(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,r)}))},on:function(e,r,n){"function"==typeof r&&this._events.push({type:e,callback:r,context:n||this})}};new De;function Ne(e,r,n){var t=d({},e),i=n(t);return u(r,(function(r){var n=Ve(e,r),i=Ve(t,r);"string"==typeof n&&"string"==typeof i&&function(e,r,n){for(var t=e,i=r.split("."),o=0;o<i.length;o+=1){var s=i[o];if(!Qe(t,s))return;o!==i.length-1?t=t[s]:t[s]=n}}(e,r,i)})),i}function Ve(e,r){var n=e;for(var t of r.split(".")){if(!Qe(n,t))return;n=n[t]}return n}function Qe(e,r){return"object"==typeof e&&null!==e&&r in e}var Ue=function(){this.observers=[]};Ue.prototype={subscribe:function(e){this.observers.push(e)},notify:function(e){u(this.observers,(function(r){r(e)}))}};var Fe,ze=Ue;function qe(e){return Je(e,function(e){if(e.origin)return e.origin;var r=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+r}(window.location)).href}function Je(e,r){if(function(){if(void 0!==Fe)return Fe;try{var e=new URL("http://test/path");return Fe="http://test/path"===e.href}catch(e){Fe=!1}return Fe}())return void 0!==r?new URL(e,r):new URL(e);if(void 0===r&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,t=n.createElement("a");if(void 0!==r){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=r,n.head.appendChild(i),n.body.appendChild(t)}return t.href=e,t}var He=navigator.userAgent.toLowerCase(),Xe=function(){return/iphone os/.test(He)};var Ge;function Ke(e,r){var n,t,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(t=Ze(e),o()),t},set:function(n,i){Ye(e,n,i,r),t=n,o()},clearCache:function(){window.clearTimeout(n),i=!1}}}function Ye(e,r,n,t){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),s=t&&t.crossSite?"none":"strict",a=t&&t.domain?";domain="+t.domain:"",u=t&&t.secure?";secure":"";document.cookie=e+"="+r+";"+o+";path=/;samesite="+s+a+u}function Ze(e){return function(e,r){var n=e.match("(?:^|;)\\s*"+r+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}var er=/^\s+|\s+$/g,rr={resourceSampleRate:100,sampleRate:100,flushTimeout:3e4,maxErrorsByMinute:3e3,maxBatchSize:50,maxMessageSize:262144,requestErrorResponseLengthLimit:32768,batchBytesLimit:16384,datakitUrl:"",logsEndpoint:"",traceType:ue.DDTRACE,traceId128Bit:!1,trackInteractions:!1,allowedDDTracingOrigins:[],allowedTracingOrigins:[],isServiceSampling:!1,isJsBirdge:!1,isLineProtocolToJson:!1,beforeSend:function(e){},isServerError:function(e){return!1}};function nr(e){return e.replace(er,"")}function tr(e){var r={};return r.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),r.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(r.domain=function(){if(void 0===Ge){for(var e="dd_site_test_".concat(O()),r=window.location.hostname.split("."),n=r.pop();r.length&&!Ze(e);)n=r.pop()+"."+n,Ye(e,"test",M,{domain:n});Ge=n}return Ge}()),r}function ir(e){return e.lastIndexOf("/")===e.length-1?nr(e)+"v1/write/logging":nr(e)+"/v1/write/logging"}function or(e,r){var n,t,i=f(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o={applicationId:e.applicationId,env:e.env||"",version:e.version||"",service:e.service||"browser",sdkVersion:r.sdkVersion,sdkName:r.sdkName,datakitUrl:(n=e.datakitUrl||e.datakitOrigin,n.lastIndexOf("/")===n.length-1?nr(n)+"v1/write/rum":nr(n)+"/v1/write/rum"),logsEndpoint:ir(e.datakitOrigin),isEnabled:function(e){return r=e,-1!==i.indexOf(r);var r},cookieOptions:tr(e)};return"isJsBirdge"in e&&(o.isJsBirdge=e.isJsBirdge),"isLineProtocolToJson"in e&&(o.isLineProtocolToJson=e.isLineProtocolToJson),"allowedDDTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedDDTracingOrigins),"allowedTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),"isServerError"in e&&l(e.isServerError)&&y(e.isServerError())&&(o.isServerError=e.isServerError),"traceId128Bit"in e&&(o.traceId128Bit=!!e.traceId128Bit),"traceType"in e&&((t=e.traceType)&&v(ue).indexOf(t)>-1)&&(o.traceType=e.traceType),"isServiceSampling"in e&&y(e.isServiceSampling)&&(o.isServiceSampling=e.isServiceSampling),d({},rr,o)}var sr,ar,ur,cr,dr,fr,lr={sdk_name:"_dd.sdk_name",sdk_version:"_dd.sdk_version",app_id:"application.id",env:"_dd.env",service:"_dd.service",version:"_dd.version",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",session_sampling:"session.is_sampling",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_path_group:"view.path_group",view_url_query:"view.url_query"},pr={view:{type:ie,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",is_active:"view.is_active"},fields:{view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",cumulative_layout_shift:"view.cumulative_layout_shift",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_meaningful_paint:"view.largest_contentful_paint",first_paint_time:"view.fpt",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent"}},resource:{type:oe,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{duration:"resource.duration",resource_size:"resource.size",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_first_byte:"resource.firstbyte"}},error:{type:ne,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",error_source:"error.source",error_type:"error.type",error_handling:"error.handling",resource_url:"error.resource.url",resource_url_host:"error.resource.url_host",resource_url_path:"error.resource.url_path",resource_url_path_group:"error.resource.url_path_group",resource_status:"error.resource.status",resource_status_group:"error.resource.status_group",resource_method:"error.resource.method"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"]}},long_task:{type:te,tags:{},fields:{duration:"long_task.duration"}},action:{type:re,tags:{action_id:"action.id",action_name:"action.target.name",action_type:"action.type"},fields:{duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_long_task_count:"action.long_task.count"}},browser_log:{type:se,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"resource.url",error_resource_url_host:"resource.url_host",error_resource_url_path:"resource.url_path",error_resource_url_path_group:"resource.url_path_group",error_resource_status:"resource.status",error_resource_status_group:"resource.status_group",error_resource_method:"resource.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},vr=[],hr=[];function gr(){return sr||(ar=XMLHttpRequest.prototype.open,ur=XMLHttpRequest.prototype.send,cr=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(e,r){return this._dataflux_xhr={method:e,startTime:-1,url:qe(r)},ar.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e){var r=this;if(this._dataflux_xhr){var n=this._dataflux_xhr;n.startTime=W(),n.startClocks=L(),n.isAborted=!1;var t=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&o(),t&&t.apply(this,arguments)};var i=!1,o=function e(){if(r.removeEventListener("loadend",e),!i){i=!0;var t=c({},n,{duration:I(n.startClocks.relative,W()),response:r.response,status:r.status});u(hr,(function(e){e(t,r)}))}};r.addEventListener("loadend",o),u(vr,(function(e){e(n,r)}))}return ur.apply(r,arguments)},XMLHttpRequest.prototype.abort=function(){return this._dataflux_xhr&&(this._dataflux_xhr.isAborted=!0),cr.apply(this,arguments)},sr={beforeSend:function(e){vr.push(e)},onRequestComplete:function(e){hr.push(e)}}),sr}function wr(e,r,n,t,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?r(u):Promise.resolve(u).then(t,i)}var mr,_r,yr=[],xr=[];function br(){return dr||(!function(){if(!window.fetch)return;fr=window.fetch,window.fetch=function(e,r){var n,t=Or.apply(null,[e,r]);return t?(n=fr.call(this,t.input,t.init),Sr.apply(null,[n,t])):n=fr.call(this,e,r),n}}(),dr={beforeSend:function(e){yr.push(e)},onRequestComplete:function(e){xr.push(e)}}),dr}function Or(e,r){var n=r&&r.method||"object"==typeof e&&e.method||"GET",t=qe("object"==typeof e&&e.url||e),i=L(),o={init:r,input:e,method:n,startTime:W(),startClocks:i,url:t};return u(yr,(function(e){e(o)})),o}function Sr(e,r){var n=function(){var e,n=(e=function*(e){if(r.duration=I(r.startClocks.relative,W()),"stack"in e||e instanceof Error)r.status=0,r.response=je(ke(e)),r.headers=e.headers,r.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,u(xr,(function(e){e(r)}));else if("status"in e){var n;try{n=yield e.clone().text()}catch(e){n="Unable to retrieve response: "+e}r.response=n,r.responseType=e.type,r.status=e.status,r.headers=e.headers,r.isAborted=!1,u(xr,(function(e){e(r)}))}},function(){var r=this,n=arguments;return new Promise((function(t,i){var o=e.apply(r,n);function s(e){wr(o,t,i,s,a,"next",e)}function a(e){wr(o,t,i,s,a,"throw",e)}s(void 0)}))});return function(e){return n.apply(this,arguments)}}();e.then(n,n)}function kr(e){return mr||(function(e,r){function n(n,t){(function(e,r){var n=[r.datakitUrl];r.logsEndpoint&&n.push(r.logsEndpoint);var t=!1;for(var i of n)if(0===e.indexOf(i)){t=!0;break}return t})(t.url,e)||t.isAborted||!(function(e){return 0===e.status&&"opaque"!==e.responseType}(t)||function(e){return e.status>=500}(t)||e.isServerError(t))||r.notify({message:Tr(n)+" error "+t.method+" "+t.url,resource:{method:t.method,statusCode:t.status,url:t.url,traceId:t.traceId,spanId:t.spanId},source:Ie,stack:$r(t.response,e)||"Failed to load",startClocks:t.startClocks})}gr().onRequestComplete((function(e){n(ae.XHR,e)})),br().onRequestComplete((function(e){n(ae.FETCH,e)}))}(e,mr=new ze),function(e){_r=console.error,console.error=function(){_r.apply(console,arguments);var r=Ae();e.notify(c({},Er(p(arguments),r),{source:Le,startClocks:L(),handling:ce}))}}(mr),function(e){_e((function(r,n,t){var i=function(e,r,n,t){return e&&(void 0!==e.message||r instanceof Error)?{message:e.message||"Empty message",stack:je(e),handlingStack:t,type:e.name}:{message:n+""+JSON.stringify(r),stack:"No stack, consider using an instance of Error",handlingStack:t,type:e&&e.name}}(r,t,"Uncaught");e.notify({message:i.message,stack:i.stack,type:i.type,source:Pe,startClocks:L(),handling:de})}))}(mr)),mr}function Er(e,r){var n=function(e,r){for(var n=0;n<e.length;n+=1){var t=e[n];if(r(t,n,e))return t}}(e,(function(e){return e instanceof Error}));return{message:h(["console error:"].concat(e),(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return((r=ke(e)).name||"Error")+": "+r.message;var r;return $(e,0,2)}(e)})).join(" "),stack:n?je(ke(n)):void 0,handlingStack:r}}function $r(e,r){return e&&e.length>r.requestErrorResponseLengthLimit?e.substring(0,r.requestErrorResponseLengthLimit)+"...":e}function Tr(e){return ae.XHR===e?"XHR":"Fetch"}function Mr(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}var Br=9e5,Cr=144e5;function Wr(e,r,n){var t=function(e){var r=Ke("_dataflulx_an_id",e);return r.get()||r.set(O(),5184e6),r}(e),i=Ke("_dataflux_s",e),o=new ze,s=Pr(i).id,a=function(e,r,n){var t,i,o,s,a=0;n||(n={});var u=function(){a=!1===n.leading?0:(new Date).getTime(),t=null,s=e.apply(i,o),t||(i=o=null)},c=function(){o=arguments;var c=(new Date).getTime();a||!1!==n.leading||(a=c);var d=r-(c-a);return i=this,d<=0||d>r?(t&&(clearTimeout(t),t=null),a=c,s=e.apply(i,o),t||(i=o=null)):t||!1===n.trailing||(t=setTimeout(u,d)),s};return c.cancel=function(){clearTimeout(t),a=0,t=null},c}((function(){i.clearCache();var e=Pr(i),t=n(e[r]);e[r]=t.trackingType,t.isTracked&&!e.id&&(e.id=O(),e.created=String(Date.now())),Rr(e,i),t.isTracked&&s!==e.id&&(s=e.id,o.notify())}),1e3);return a(),function(e){var r=A(window,[G,Z,K,Y],e,{capture:!0,passive:!0});jr.push(r.stop)}(a),function(e){var r=function(){"visible"===document.visibilityState&&e()},n=R(document,ee,r);jr.push(n.stop);var t=window.setInterval(r,6e4);jr.push((function(){clearInterval(t)}))}((function(){i.clearCache(),Rr(Pr(i),i)})),{getAnonymousID:function(){return t.get()},getId:function(){var e=Pr(i);return e.did||e.id},getTrackingType:function(){return Pr(i)[r]},getDebugSession:function(){var e=Pr(i);return w(e)||!e.did?{}:{id:e.did,created:e.dcreated}},addDebugSession:function(e,r){var n=Pr(i);w(n)||(n.did=e||O,n.dcreated=r||String(Date.now()),Rr(n,i))},clearDebugSession:function(){var e=Pr(i),r={};u(m(e),(function(e){"did"!==e[0]&&"dcreated"!==e[0]&&(r[e[0]]=e[1])})),Rr(r,i)},renewObservable:o}}var Lr=/^([a-z]+)=([a-z0-9-]+)$/,Ir="&";function Pr(e){var r=function(e){var r=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||Lr.test(e))})(r)&&u(r.split(Ir),(function(e){var r=Lr.exec(e);if(null!==r){var t=r[1],i=r[2];n[t]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Cr)&&(void 0===e.expire||Date.now()<Number(e.expire))}(r)?r:(Ar(e),{})}function Rr(e,r){if(w(e))Ar(r);else{e.expire=String(Date.now()+Br);var n=[];u(m(e),(function(e){n.push(e[0]+"="+e[1])}));var t=n.join(Ir);r.set(t,Br)}}function Ar(e){e.set("",0)}var jr=[];var Dr=/[^\u0000-\u007F]/,Nr="custom_keys";var Vr=Mr(),Qr=function(e,r,n){this.endpointUrl=e,this.bytesLimit=r,this.isLineProtocolToJson=n;var t="[object Navigator]"===Object.prototype.toString.call(Vr&&Vr.navigator)&&"function"==typeof Vr.navigator.sendBeacon;this.sendBeacon=t?Vr.navigator.sendBeacon.bind(Vr.navigator):void 0};Qr.prototype={send:function(e,r){var n=function(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}(this.endpointUrl);if(this.sendBeacon&&r<this.bytesLimit&&!this.isLineProtocolToJson){if(this.sendBeacon(n,e))return}else if(this.sendBeacon&&r<this.bytesLimit&&this.isLineProtocolToJson){var t=new Blob([JSON.stringify(e)],{type:"application/json"});if(this.sendBeacon(n,t))return}var i=new XMLHttpRequest;i.open("POST",n,!0),i.withCredentials=!0,this.isLineProtocolToJson?(i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(e))):(i.setRequestHeader("Content-type","text/plain;charset=UTF-8"),i.send(e))}};var Ur=Qr,Fr=function(e){if(!e||!e.type)return{rowStr:"",rowData:void 0};var r={tags:{},fields:{}},n=!1,t="";return u(pr,(function(i,o){if(i.type===e.type){t+=o+",",r.measurement=o;var s=[],a=c({},lr,i.tags),d=["date","type",Nr];u(a,(function(n,t){var i=P(e,n);d.push(t),(i||x(i))&&(r.tags[t]=function(e){return _(e)?e:$(e)}(i),s.push(V(t)+"="+V(i)))}));var l=[];if(u(i.fields,(function(n,t){if(f(n)&&2===n.length){n[0];var i=n[1],o=P(e,i);d.push(t),(o||x(o))&&(r.fields[t]=o,l.push(V(t)+"="+U(o)))}else if(_(n)){o=P(e,n);d.push(t),(o||x(o))&&(r.fields[t]=o,l.push(V(t)+"="+U(o)))}})),e.tags&&g(e.tags)&&!w(e.tags)){var p=[];u(e.tags,(function(e,n){d.indexOf(n)>-1||(d.push(n),(e||x(e))&&(p.push(n),r.fields[n]=e,l.push(V(n)+"="+U(e))))})),p.length&&(r.fields.custom_keys=U(p),l.push(V(Nr)+"="+U(p)))}e.type===se&&u(e,(function(e,n){-1===d.indexOf(n)&&(x(e)||_(e)||y(e))&&(r.fields[n]=e,l.push(V(n)+"="+U(e)))})),s.length&&(t+=s.join(",")),l.length&&(t+=" ",t+=l.join(","),n=!0),t=t+" "+e.date,r.time=(v=e.date,x(v)?C(1e6*v,0):v)}var v})),{rowStr:n?t:"",rowData:n?r:void 0}},zr=function(e,r,n,t,i,o,s){this.request=e,this.maxSize=r,this.bytesLimit=n,this.maxMessageSize=t,this.flushTimeout=i,this.isLineProtocolToJson=o,this.beforeUnloadCallback=s,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()};zr.prototype={add:function(e){this.addOrUpdate(e)},upsert:function(e,r){this.addOrUpdate(e,r)},flush:function(){if(0!==this.bufferMessageCount){var e=this.pushOnlyBuffer.concat(v(this.upsertBuffer));if(0===e.length)return;this.isLineProtocolToJson?this.request.send(h(e,(function(e){return JSON.parse(e)})),this.bufferBytesSize):this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}},processSendData:function(e){return this.isLineProtocolToJson?JSON.stringify(Fr(e).rowData):Fr(e).rowStr},sizeInBytes:function(e){return Dr.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},addOrUpdate:function(e,r){var n=this.process(e);n.processedMessage&&""!==n.processedMessage&&(n.messageBytesSize>=this.maxMessageSize||(this.hasMessageFor(r)&&this.remove(r),this.willReachedBytesLimitWith(n.messageBytesSize)&&this.flush(),this.push(n.processedMessage,n.messageBytesSize,r),this.isFull()&&this.flush()))},process:function(e){var r="";return{processedMessage:r=this.processSendData(e),messageBytesSize:this.sizeInBytes(r)}},push:function(e,r,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=r,this.bufferMessageCount+=1},remove:function(e){var r=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(r);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},hasMessageFor:function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},willReachedBytesLimitWith:function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},isFull:function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},flushPeriodically:function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),e.flushTimeout)},flushOnVisibilityHidden:function(){var e=this;Vr.navigator.sendBeacon&&(R(window,X,e.beforeUnloadCallback),R(document,ee,(function(){"hidden"===document.visibilityState&&e.flush()})),R(window,X,(function(){e.flush()})))}};var qr=zr,Jr={debug:"debug",critical:"critical",error:"error",info:"info",warn:"warning"},Hr={[Jr.debug]:0,[Jr.info]:1,[Jr.warn]:2,[Jr.error]:3,[Jr.critical]:4};Gr=[],null===(Xr=Jr)||u(Xr,(function(e,r){Gr[Gr.length]=r}));var Xr,Gr;const Kr="http";function Yr(e,r,n,t){this.contextManager=j(),void 0===r&&(r=Kr),void 0===n&&(n=Jr.debug),void 0===t&&(t={}),this.sendLog=e,this.handlerType=r,this.level=n,this.contextManager.set(t)}Yr.prototype={log:function(e,r,n){if(void 0===n&&(n=Jr.info),Hr[n]>=Hr[this.level]&&this.handlerType===Kr){var t=d({message:e,status:n},{tags:this.contextManager.get()},r);this.sendLog(t)}},debug:function(e,r){this.log(e,r,Jr.debug)},info:function(e,r){this.log(e,r,Jr.info)},warn:function(e,r){this.log(e,r,Jr.warn)},critical:function(e,r){this.log(e,r,Jr.critical)},error:function(e,r){var n={error:{origin:Re}};this.log(e,d(n,r),Jr.error)},setContext:function(e){this.contextManager.set(e)},addContext:function(e,r){this.contextManager.add(e,r)},removeContext:function(e){this.contextManager.remove(e)},setHandler:function(e){this.handlerType=e},setLevel:function(e){this.level=e}};var Zr="0",en="1";function rn(e,r){if(!r){var n=nn(e)===en;return{getId:()=>{},isTracked:()=>n}}var t=Wr(e.cookieOptions,"logs",(function(r){return function(e,r){var n=function(e){return e===Zr||e===en}(r)?r:nn(e);return{trackingType:n,isTracked:n===en}}(e,r)}));return{getId:t.getId,isTracked:function(){return t.getTrackingType()===en}}}function nn(e){return 0!==(r=e.sampleRate)&&100*Math.random()<=r?en:Zr;var r}var tn={sdkVersion:"1.1.23",sdkName:"df_web_logs_sdk"},on=["view.url","view.referrer","message","error.stack","source.url"];function sn(e){var r=window.DATAFLUX_RUM;return r&&r.getInternalContext?r.getInternalContext(e):void 0}var an=function(e){var r=!1,n=j(),t={},i=new z,o=function(e,r){i.add([e,r])},s=new Yr(f);return a={logger:s,init:function(t){(function(e){return r?(e.silentMultipleInit,!1):!(!e.datakitUrl&&!e.datakitOrigin)&&!!(void 0===e.sampleRate||(n=e.sampleRate,x(n)&&n>=0&&n<=100));var n})(t)&&(o=e(t,s,n.get),i.drain((function([e,r]){return o(e,r)})),r=!0)},getLoggerGlobalContext:n.get,setLoggerGlobalContext:n.set,addLoggerGlobalContext:n.add,removeLoggerGlobalContext:n.remove,createLogger:function(e,r){return void 0===r&&(r={}),t[e]=new Yr(f,r.handler,r.level,c({},r.context,{logger:{name:e}})),t[e]},getLogger:function(e){return t[e]}},u=c({},a,{onReady:function(e){e()}}),Object.defineProperty(u,"_setDebug",{get:function(){return setDebugMode},enumerable:!1}),u;var a,u;function f(e){var r,t,i;o(e,d({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href,host:window.location.host,path:window.location.pathname,pathGroup:S(window.location.pathname),urlQuery:$((r=window.location.href,t={},i=r.split("?")[1]||"",i&&(t=k("?"+i)),t))}},n.get()))}}((function(e,r,n){var t=or(e,tn);return function(e,r,n,t,i){var o=function(e,r,n){var t=function(e,r){var n=0,t=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),B),(n+=1)<=e.maxErrorsByMinute||t)return t=!1,!1;if(n===e.maxErrorsByMinute+1){t=!0;try{r({message:"Reached max number of errors by minute: ".concat(e.maxErrorsByMinute),source:We,startClocks:L()})}finally{t=!1}}return!0}}}(r,n);return function(n,i){if(e.isTracked()){var o=d({service:r.service||"browser",session:{id:e.getId()},type:se,_dd:{sdkName:r.sdkName,sdkVersion:r.sdkVersion,env:r.env,version:r.version},device:H,user:{user_id:r.user_id}},i,sn(),n);if(r.beforeSend)if(!1===Ne(o,on,r.beforeSend))return;if(o.status!==Jr.error||!t.isLimitReached())return D(o)}}}(n,e,a),s=function(e){var r=n(e.logsEndpoint);function n(r){return new qr(new Ur(r,e.batchBytesLimit,e.isLineProtocolToJson),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,e.isLineProtocolToJson)}return{add:function(e){r.add(e)}}}(e);function a(e){var r,n,i=e.resource;if(i){var o=(r=e.resource.url,n=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)},n.prototype.setUrl=function(e){this._parse(e)},n.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},n.prototype.addQueryString=function(e){if("object"!=typeof e)return!1;var r=this._values.QueryString||"";for(var n in e)r=new RegExp(n+"[^&]+").test(r)?r.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===r.slice(-1)?r+n+"="+e[n]:""===r?n+"="+e[n]:r+"&"+n+"="+e[n];this._values.QueryString=r},n.prototype.getParse=function(){return this._values},n.prototype.getUrl=function(){var e="";return e+=this._values.Origin,(e+=this._values.Path)+(this._values.QueryString?"?"+this._values.QueryString:"")},n.prototype._parse=function(e){this._initValues();var r=this._regex.exec(e);if(!r)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==r[this._fields[n]]&&(this._values[n]=r[this._fields[n]]);this._values.Path=this._values.Path||"/",this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname+(this._values.Port?":"+this._values.Port:"")},new n(r)).getParse();i={method:e.resource.method,status:e.resource.statusCode,statusGroup:E(e.resource.statusCode),url:e.resource.url,urlHost:o.Host,urlPath:o.Path,urlPathGroup:S(o.Path)}}t.error(e.message,d({date:e.startClocks.timeStamp,error:{type:e.type,source:e.source,stack:e.stack}},{resource:i},sn(e.startClocks.relative)))}return r.subscribe(a),function(e,r){var n=o(e,r);n&&s.add(n)}}(t,!1!==e.forwardErrorsToLogs?kr(t):new ze,rn(t,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var r="dd_cookie_test_".concat(O()),n="test";return Ye(r,n,M,e),Ze(r)===n}catch(e){return!1}}(t.cookieOptions)),r)}));!function(e,r,n){var t=e[r];e[r]=n,t&&t.q&&u(t.q,(function(e){e()}))}(Mr(),"DATAFLUX_LOGS",an)})();
|
package/cjs/boot/buildEnv.js
CHANGED
package/cjs/boot/log.entry.js
CHANGED
|
@@ -101,7 +101,7 @@ function makeLogsPublicApi(startLogsImpl) {
|
|
|
101
101
|
|
|
102
102
|
function sendLog(message) {
|
|
103
103
|
sendLogStrategy(message, (0, _browserCore.extend2Lev)({
|
|
104
|
-
date: Date.
|
|
104
|
+
date: new Date().getTime(),
|
|
105
105
|
view: {
|
|
106
106
|
referrer: document.referrer,
|
|
107
107
|
url: window.location.href,
|
package/esm/boot/buildEnv.js
CHANGED
package/esm/boot/log.entry.js
CHANGED
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@cloudcare/browser-logs",
|
|
3
3
|
"main": "cjs/index.js",
|
|
4
4
|
"module": "esm/index.js",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.23",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@cloudcare/browser-core": "1.
|
|
7
|
+
"@cloudcare/browser-core": "1.1.2"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "webpack serve --open --mode=development",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"author": "dataflux",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"description": "DataFlux RUM Web 端数据指标监控",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "5cbe53e30874a6c365a4e1e31353da8b02d0e0f3"
|
|
32
32
|
}
|
package/src/boot/log.entry.js
CHANGED