UNPKG

@phil1123/web-monitor

Version:

亮点1:支持多种错误还原方式:定位源码、播放录屏、记录用户行为 亮点2:支持项目的白屏检测,兼容有骨架屏、无骨架屏这两种情况 亮点3:支持错误上报去重,错误生成唯一的id,重复的代码错误只上报一次 亮点4:支持多种上报方式,默认使用web beacon,也支持图片打点、http 上报

1 lines 170 kB
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["web-see"]={})})(this,function(c){function T(e){console.error("webmonitor error: "+e)}function A(t){return function(e){return Object.prototype.toString.call(e)==="[object "+t+"]"}}let x={isString:A("String"),isNumber:A("Number"),isUndefined:A("Undefined")};function R(e){return["[object Error]","[object Exception]","[object DOMException]"].includes(Object.prototype.toString.call(e))}function N(){return"undefined"!=typeof document&&document.location?document.location.href:""}function M(e,t,r,i=!1){e.addEventListener(t,r,i)}function D(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function o(e,t,r){return!!e&&(D(e)===r||void T(t+` 必须是 ${r} 类型`))}function u(){return Date.now()}function U(e,t,r,i=!1){e&&(t in e||i)&&"function"==typeof(i=r(e[t]))&&(e[t]=i)}function F(e,t){return x.isString(e)?e.slice(0,t)+(e.length>t?"...":""):""}function L(t,r){let i=null;return function(...e){i=i||setTimeout(()=>{t.apply(this,e),i=null},r)}}function B(){let r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"==e?t:3&t|8).toString(16)})}function V(e){return x.isString(e)?e:x.isUndefined(e)?"undefined":JSON.stringify(e)}function P(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t}var J=500,X="user-agent",q="",Q="?",$="function",ee="undefined",te="object",re="string",h="browser",ie="cpu",ne="device",ae="engine",oe="os",se="result",p="name",m="type",g="vendor",f="version",b="architecture",le="major",v="model",de="console",y="mobile",n="tablet",e="smarttv",ce="wearable",ue="xr",he="embedded",t="inapp",pe="brands",me="formFactors",ge="fullVersionList",fe="platform",be="platformVersion",ve="bitness",ye="sec-ch-ua",we=ye+"-full-version-list",Ce=ye+"-arch",Ie=ye+"-"+ve,Se=ye+"-form-factors",_e=ye+"-"+y,Ee=ye+"-"+v,ke=ye+"-"+fe,Te=ke+"-version",Ae=[pe,ge,y,v,fe,be,b,me,ve],xe="Amazon",Re="Apple",Ne="BlackBerry",Oe="Google",Me="Microsoft",De="Motorola",r="Nvidia",Ue="OnePlus",Fe="OPPO",Le="Samsung",i="Sony",Be="Xiaomi",ze="Zebra",Ve="Chromium",Pe="Chromecast",Ze="Firefox",He="Opera",Ye="Facebook",We="Mobile ",a=" Browser",Ge="Windows",l=typeof window!==ee&&window.navigator?window.navigator:void 0,Ke=l&&l.userAgentData?l.userAgentData:void 0,je=function(e,t){if(typeof e===te&&0<e.length){for(var r in e)if(Qe(e[r])==Qe(t))return!0;return!1}return!!Xe(e)&&-1!==Qe(t).indexOf(Qe(e))},Je=function(e,t){for(var r in e)return/^(browser|cpu|device|engine|os)$/.test(r)||!!t&&Je(e[r])},Xe=function(e){return typeof e===re},qe=function(e){if(e){for(var t,r=[],i=tt(/\\?\"/g,e).split(","),n=0;n<i.length;n++)-1<i[n].indexOf(";")?(t=it(i[n]).split(";v="),r[n]={brand:t[0],version:t[1]}):r[n]=it(i[n]);return r}},Qe=function(e){return Xe(e)?e.toLowerCase():e},$e=function(e){return Xe(e)?tt(/[^\d\.]/g,e).split(".")[0]:void 0},et=function(e){for(var t in e){t=e[t];typeof t==te&&2==t.length?this[t[0]]=t[1]:this[t]=void 0}return this},tt=function(e,t){return Xe(t)?t.replace(e,q):t},rt=function(e){return tt(/\\?\"/g,e)},it=function(e,t){if(Xe(e))return e=tt(/^\s\s*/,e),typeof t===ee?e:e.substring(0,J)},nt=function(e,t){if(e&&t)for(var r,i,n,a,o,s=0;s<t.length&&!a;){for(var l=t[s],d=t[s+1],c=r=0;c<l.length&&!a&&l[c];)if(a=l[c++].exec(e))for(i=0;i<d.length;i++)o=a[++r],typeof(n=d[i])===te&&0<n.length?2===n.length?typeof n[1]==$?this[n[0]]=n[1].call(this,o):this[n[0]]=n[1]:3===n.length?typeof n[1]!==$||n[1].exec&&n[1].test?this[n[0]]=o?o.replace(n[1],n[2]):void 0:this[n[0]]=o?n[1].call(this,o,n[2]):void 0:4===n.length&&(this[n[0]]=o?n[3].call(this,o.replace(n[1],n[2])):void 0):this[n]=o||void 0;s+=2}},at=function(e,t){for(var r in t)if(typeof t[r]===te&&0<t[r].length){for(var i=0;i<t[r].length;i++)if(je(t[r][i],e))return r===Q?void 0:r}else if(je(t[r],e))return r===Q?void 0:r;return t.hasOwnProperty("*")?t["*"]:e},ot={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},st={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},lt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[p,We+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,f],[/opios[\/ ]+([\w\.]+)/i],[f,[p,He+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[p,He+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[p,He]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[p,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[p,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[p,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[p,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[p,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[p,"Smart Lenovo"+a]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure"+a],f],[/\bfocus\/([\w\.]+)/i],[f,[p,Ze+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[p,He+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[p,He+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[p,"MIUI"+a]],[/fxios\/([\w\.-]+)/i],[f,[p,We+Ze]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[p,"360"]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1"+a],f],[/samsungbrowser\/([\w\.]+)/i],[f,[p,Le+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,f],[/(lbbrowser|rekonq)/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,Ye],f,[m,t]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,f,[m,t]],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[p,"GSA"],[m,t]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[p,"TikTok"],[m,t]],[/\[(linkedin)app\]/i],[p,[m,t]],[/(chromium)[\/ ]([-\w\.]+)/i],[p,f],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[p,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[p,"Android"+a]],[/chrome\/([\w\.]+) mobile/i],[f,[p,We+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,f],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[f,[p,We+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[p,We+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[f,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[f,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[p,f],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[p,We+Ze],f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[p,Ze+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[p,[f,/[^\d\.]+./,q]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[b,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[b,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[b,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[b,/ower/,q,Qe]],[/ sun4\w[;\)]/i],[[b,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[b,Qe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[g,Le],[m,n]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[v,[g,Le],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[g,Re],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[g,Re],[m,n]],[/(macintosh);/i],[v,[g,Re]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[g,"Sharp"],[m,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[v,[g,"Honor"],[m,n]],[/honor([-\w ]+)[;\)]/i],[v,[g,"Honor"],[m,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[v,[g,"Huawei"],[m,n]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[g,"Huawei"],[m,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[v,/_/g," "],[g,Be],[m,n]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[v,/_/g," "],[g,Be],[m,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[g,Fe],[m,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[v,[g,at,{OnePlus:["304","403","203"],"*":Fe}],[m,n]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[g,"Vivo"],[m,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[g,"Realme"],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[g,De],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[g,De],[m,n]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[g,"LG"],[m,n]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[g,"LG"],[m,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[v,[g,"Lenovo"],[m,n]],[/(nokia) (t[12][01])/i],[g,v,[m,n]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[v,/_/g," "],[m,y],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[v,[g,Oe],[m,n]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[g,Oe],[m,y]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[g,i],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[g,i],[m,n]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[g,Ue],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[g,xe],[m,n]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[g,xe],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[v,g,[m,n]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[g,Ne],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[g,"ASUS"],[m,n]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[g,"ASUS"],[m,y]],[/(nexus 9)/i],[v,[g,"HTC"],[m,n]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[v,/_/g," "],[m,y]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[v,[g,"TCL"],[m,n]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[v,[g,"TCL"],[m,y]],[/(itel) ((\w+))/i],[[g,Qe],v,[m,at,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[g,"Acer"],[m,n]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[g,"Meizu"],[m,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[g,"Ulefone"],[m,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[g,"Energizer"],[m,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[g,"Cat"],[m,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[g,"Smartfren"],[m,y]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[g,"Nothing"],[m,y]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,v,[m,n]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,v,[m,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[g,v,[m,n]],[/(surface duo)/i],[v,[g,Me],[m,n]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[g,"Fairphone"],[m,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[v,[g,r],[m,n]],[/(sprint) (\w+)/i],[g,v,[m,y]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[g,Me],[m,y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[g,ze],[m,n]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[g,ze],[m,y]],[/smart-tv.+(samsung)/i],[g,[m,e]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[g,Le],[m,e]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,"LG"],[m,e]],[/(apple) ?tv/i],[g,[v,Re+" TV"],[m,e]],[/crkey.*devicetype\/chromecast/i],[[v,Pe+" Third Generation"],[g,Oe],[m,e]],[/crkey.*devicetype\/([^/]*)/i],[[v,/^/,"Chromecast "],[g,Oe],[m,e]],[/fuchsia.*crkey/i],[[v,Pe+" Nest Hub"],[g,Oe],[m,e]],[/crkey/i],[[v,Pe],[g,Oe],[m,e]],[/droid.+aft(\w+)( bui|\))/i],[v,[g,xe],[m,e]],[/(shield \w+ tv)/i],[v,[g,r],[m,e]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[g,"Sharp"],[m,e]],[/(bravia[\w ]+)( bui|\))/i],[v,[g,i],[m,e]],[/(mi(tv|box)-?\w+) bui/i],[v,[g,Be],[m,e]],[/Hbbtv.*(technisat) (.*);/i],[g,v,[m,e]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,it],[v,it],[m,e]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[v,[m,e]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,e]],[/(ouya)/i,/(nintendo) (\w+)/i],[g,v,[m,de]],[/droid.+; (shield)( bui|\))/i],[v,[g,r],[m,de]],[/(playstation \w+)/i],[v,[g,i],[m,de]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[g,Me],[m,de]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[v,[g,Le],[m,ce]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,v,[m,ce]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[v,[g,Fe],[m,ce]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[g,Re],[m,ce]],[/(opwwe\d{3})/i],[v,[g,Ue],[m,ce]],[/(moto 360)/i],[v,[g,De],[m,ce]],[/(smartwatch 3)/i],[v,[g,i],[m,ce]],[/(g watch r)/i],[v,[g,"LG"],[m,ce]],[/droid.+; (wt63?0{2,3})\)/i],[v,[g,ze],[m,ce]],[/droid.+; (glass) \d/i],[v,[g,Oe],[m,ue]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,v,[m,ue]],[/; (quest( \d| pro)?)/i],[v,[g,Ye],[m,ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,he]],[/(aeobc)\b/i],[v,[g,xe],[m,he]],[/(homepod).+mac os/i],[v,[g,Re],[m,he]],[/windows iot/i],[[m,he]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[v,[m,at,{mobile:"Mobile",xr:"VR","*":n}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,n]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[v,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[p,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[p,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,f],[/ladybird\//i],[[p,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,f],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[f,at,ot]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,at,ot],[p,Ge]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,"macOS"],[f,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[f,[p,Pe+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[f,[p,Pe+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[f,[p,Pe+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[f,[p,Pe+" Linux"]],[/crkey\/([\d\.]+)/i],[f,[p,Pe]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,"$1 Touch"],f],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,f],[/\(bb(10);/i],[f,[p,Ne]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[f,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[p,Ze+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[p,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,"Chrome OS"],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,f],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,f]]},dt=(He={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}},et.call(He.init,[[h,[p,f,le,m]],[ie,[b]],[ne,[m,v,g]],[ae,[p,f]],[oe,[p,f]]]),et.call(He.isIgnore,[[h,[f,le]],[ae,[f]],[oe,[f]]]),et.call(He.isIgnoreRgx,[[h,/ ?browser$/i],[oe,/ ?os$/i]]),et.call(He.toString,[[h,[p,f]],[ie,[b]],[ne,[g,v]],[ae,[p,f]],[oe,[p,f]]]),He),ct=function(t,e){var r=dt.init[e],i=dt.isIgnore[e]||0,n=dt.isIgnoreRgx[e]||0,a=dt.toString[e]||0;function o(){et.call(this,r)}return o.prototype.getItem=function(){return t},o.prototype.withClientHints=function(){return Ke?Ke.getHighEntropyValues(Ae).then(function(e){return t.setCH(new ut(e,!1)).parseCH().get()}):t.parseCH().get()},o.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=se&&(o.prototype.is=function(e){var t,r=!1;for(t in this)if(this.hasOwnProperty(t)&&!je(i,t)&&Qe(n?tt(n,this[t]):this[t])==Qe(n?tt(n,e):e)){if(r=!0,e!=ee)break}else if(e==ee&&r){r=!r;break}return r},o.prototype.toString=function(){var e,t=q;for(e in a)typeof this[a[e]]!==ee&&(t+=(t?" ":q)+this[a[e]]);return t||ee}),Ke||(o.prototype.then=function(e){function t(){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e])}var r=this,i=(t.prototype={is:o.prototype.is,toString:o.prototype.toString},new t);return e(i),i}),new o};function ut(e,t){if(e=e||{},et.call(this,Ae),t)et.call(this,[[pe,qe(e[ye])],[ge,qe(e[we])],[y,/\?1/.test(e[_e])],[v,rt(e[Ee])],[fe,rt(e[ke])],[be,rt(e[Te])],[b,rt(e[Ce])],[me,qe(e[Se])],[ve,rt(e[Ie])]]);else for(var r in e)this.hasOwnProperty(r)&&typeof e[r]!==ee&&(this[r]=e[r])}function ht(e,t,r,i){return this.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},this.set=function(e,t){return this.data[e]=t,this},this.setCH=function(e){return this.uaCH=e,this},this.detectFeature=function(){if(l&&l.userAgent==this.ua)switch(this.itemType){case h:l.brave&&typeof l.brave.isBrave==$&&this.set(p,"Brave");break;case ne:!this.get(m)&&Ke&&Ke[y]&&this.set(m,y),"Macintosh"==this.get(v)&&l&&typeof l.standalone!==ee&&l.maxTouchPoints&&2<l.maxTouchPoints&&this.set(v,"iPad").set(m,n);break;case oe:!this.get(p)&&Ke&&Ke[fe]&&this.set(p,Ke[fe]);break;case se:var t=this.data,e=function(e){return t[e].getItem().detectFeature().get()};this.set(h,e(h)).set(ie,e(ie)).set(ne,e(ne)).set(ae,e(ae)).set(oe,e(oe))}return this},this.parseUA=function(){return this.itemType!=se&&nt.call(this.data,this.ua,this.rgxMap),this.itemType==h&&this.set(le,$e(this.get(f))),this},this.parseCH=function(){var e,t=this.uaCH,r=this.rgxMap;switch(this.itemType){case h:case ae:var i,n=t[ge]||t[pe];if(n)for(var a in n){var o=n[a].brand||n[a],a=n[a].version;this.itemType!=h||/not.a.brand/i.test(o)||i&&(!/chrom/i.test(i)||o==Ve)||(o=at(o,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome"}),this.set(p,o).set(f,a).set(le,$e(a)),i=o),this.itemType==ae&&o==Ve&&this.set(f,a)}break;case ie:var s=t[b];s&&("64"==t[ve]&&(s+="64"),nt.call(this.data,s+";",r));break;case ne:if(t[y]&&this.set(m,y),t[v]&&(this.set(v,t[v]),this.get(m)&&this.get(g)||(nt.call(s={},"droid 9; "+t[v]+")",r),!this.get(m)&&s.type&&this.set(m,s.type),!this.get(g)&&s.vendor&&this.set(g,s.vendor))),t[me]){if("string"!=typeof t[me])for(var l=0;!e&&l<t[me].length;)e=at(t[me][l++],st);else e=at(t[me],st);this.set(m,e)}break;case oe:var d,s=t[fe];s&&(d=t[be],s==Ge&&(d=13<=parseInt($e(d),10)?"11":"10"),this.set(p,s).set(f,d)),this.get(p)==Ge&&"Xbox"==t[v]&&this.set(p,"Xbox").set(f,void 0);break;case se:var c=this.data,s=function(e){return c[e].getItem().setCH(t).parseCH().get()};this.set(h,s(h)).set(ie,s(ie)).set(ne,s(ne)).set(ae,s(ae)).set(oe,s(oe))}return this},et.call(this,[["itemType",e],["ua",t],["uaCH",i],["rgxMap",r],["data",ct(this,e)]]),this}function pt(e,t,r){var i,n,a,o,s;return typeof e===te?(t=Je(e,!0)?(typeof t===te&&(r=t),e):void(r=e),e=void 0):typeof e!==re||Je(t,!0)||(r=t,t=void 0),r&&typeof r.append===$&&(i={},r.forEach(function(e,t){i[t]=e}),r=i),this instanceof pt?(n=typeof e===re?e:r&&r[X]?r[X]:l&&l.userAgent?l.userAgent:q,a=new ut(r,!0),o=t?((e,t)=>{var r,i={},n=t;if(!Je(t))for(var a in n={},t)for(var o in t[a])n[o]=t[a][o].concat(n[o]||[]);for(r in e)i[r]=n[r]&&n[r].length%2==0?n[r].concat(e[r]):e[r];return i})(lt,t):lt,et.call(this,[["getBrowser",(s=function(e){return e==se?function(){return new ht(e,n,o,a).set("ua",n).set(h,this.getBrowser()).set(ie,this.getCPU()).set(ne,this.getDevice()).set(ae,this.getEngine()).set(oe,this.getOS()).get()}:function(){return new ht(e,n,o[e],a).parseUA().get()}})(h)],["getCPU",s(ie)],["getDevice",s(ne)],["getEngine",s(ae)],["getOS",s(oe)],["getResult",s(se)],["getUA",function(){return n}],["setUA",function(e){return Xe(e)&&(n=e.length>J?it(e,J):e),this}]]).setUA(n),this):new pt(e,t,r).getResult()}function mt(){return window}pt.VERSION="2.0.2",pt.BROWSER=P([p,f,le,m]),pt.CPU=P([b]),pt.DEVICE=P([v,g,m,de,y,e,n,ce,he]),pt.ENGINE=pt.OS=P([p,f]);let w=mt(),C=vt();t=(new pt).getResult();C.deviceInfo={browserVersion:t.browser.version,browserName:t.browser.name,osVersion:t.os.version,osName:t.os.name,ua:t.ua,device:t.device.model||"Unkown",deviceType:t.device.type||"Pc",deviceVendor:t.device.vendor||"Unkown"},C.hasError=!1,C.errorMap=new Map,C.replaceFlag=C.replaceFlag||{};let gt=C.replaceFlag;function ft(e,t){gt[e]||(gt[e]=t)}function bt(e){return!!gt[e]}function vt(){return w.__webMonitor__={},w.__webMonitor__}function yt(){var e=w.chrome,e=e&&e.app&&e.app.runtime,t="history"in w&&!!w.history.pushState&&!!w.history.replaceState;return!e&&t}c.EVENTTYPES=void 0,(a=c.EVENTTYPES||(c.EVENTTYPES={})).XHR="xhr",a.FETCH="fetch",a.CLICK="click",a.HISTORY="history",a.ERROR="error",a.HASHCHANGE="hashchange",a.RESOURCE="resource",a.UNHANDLEDREJECTION="unhandledrejection",a.DOM="dom",a.VUE="vue",a.CUSTOM="custom",a.PERFORMANCE="performance",a.RECORDSCREEN="recordScreen",a.WHITESCREEN="whiteScreen",c.HTTPTYPE=void 0,(We=c.HTTPTYPE||(c.HTTPTYPE={})).XHR="xhr",We.FETCH="fetch",c.STATUSCODE=void 0,(Be=c.STATUSCODE||(c.STATUSCODE={})).ERROR="error",Be.OK="ok",c.SpanStatus=void 0,(r=c.SpanStatus||(c.SpanStatus={})).Ok="ok",r.DeadlineExceeded="deadline_exceeded",r.Unauthenticated="unauthenticated",r.PermissionDenied="permission_denied",r.NotFound="not_found",r.ResourceExhausted="resource_exhausted",r.InvalidArgument="invalid_argument",r.Unimplemented="unimplemented",r.Unavailable="unavailable",r.InternalError="internal_error",r.UnknownError="unknown_error",r.Cancelled="cancelled",r.AlreadyExists="already_exists",r.FailedPrecondition="failed_precondition",r.Aborted="aborted",r.OutOfRange="out_of_range",r.DataLoss="data_loss",c.HTTPCODE=void 0,(Me=c.HTTPCODE||(c.HTTPCODE={}))[Me.BAD_REQUEST=400]="BAD_REQUEST",Me[Me.UNAUTHORIZED=401]="UNAUTHORIZED",c.BREADCRUMBTYPES=void 0,(Le=c.BREADCRUMBTYPES||(c.BREADCRUMBTYPES={})).HTTP="Http",Le.CLICK="Click",Le.RESOURCE="Resource_Error",Le.CODEERROR="Code_Error",Le.ROUTE="Route",Le.CUSTOM="Custom",c.EMethods=void 0,(Fe=c.EMethods||(c.EMethods={})).Get="GET",Fe.Post="POST",Fe.Put="PUT",Fe.Delete="DELETE";let wt="1.0.7";function Ct(e){var t,r=e.tagName.toLowerCase();return"body"===r?"":(t=e.classList.value,`<${r}${e.id?` id="${e.id}"`:""}${t=t?` class="${t}"`:""}>${e.innerText}</${r}>`)}function It(e){var t;return(e=e&&e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/))?(t=e[6]||"",{host:e[4],path:e[5],protocol:e[2],relative:e[5]+t+(e[8]||"")}):{}}function St(e){return window.btoa(encodeURIComponent(e))}function _t(e){var t=C.errorMap.has(e);return t||C.errorMap.set(e,!0),t}function Et({slientError:e=!0,slientClick:t=!0,slientFetch:r=!0,slientXhr:i=!0,slientUnhanderRejection:n=!0,slientHashChange:a=!0,slientHistoryChange:o=!0,silentWhiteScreen:s=!0}){ft(c.EVENTTYPES.CLICK,!t),ft(c.EVENTTYPES.ERROR,!e),ft(c.EVENTTYPES.FETCH,!r),ft(c.EVENTTYPES.XHR,!i),ft(c.EVENTTYPES.UNHANDLEDREJECTION,!n),ft(c.EVENTTYPES.HASHCHANGE,!a),ft(c.EVENTTYPES.HISTORY,!o),ft(c.EVENTTYPES.WHITESCREEN,!s)}let s=C.breadcrumb||(C.breadcrumb=new class{constructor(){this.maxBreadcrumbs=20,this.stack=[],this.stack=[]}bindOptions(e){var{maxBreadcrumbs:e,boforePushBreadcrumb:t}=e;o(e,"maxBreadcrumbs","number")&&(this.maxBreadcrumbs=e||20),o(t,"boforePushBreadcrumb","function")&&(this.boforePushBreadcrumb=t)}getCategory(e){switch(e){case c.EVENTTYPES.ERROR:case c.EVENTTYPES.UNHANDLEDREJECTION:return c.BREADCRUMBTYPES.CODEERROR;case c.EVENTTYPES.CLICK:return c.BREADCRUMBTYPES.CLICK;case c.EVENTTYPES.RESOURCE:return c.BREADCRUMBTYPES.RESOURCE;case c.EVENTTYPES.XHR:case c.EVENTTYPES.FETCH:return c.BREADCRUMBTYPES.HTTP;case c.EVENTTYPES.HASHCHANGE:case c.EVENTTYPES.HISTORY:return c.BREADCRUMBTYPES.ROUTE}}push(e){var t;if("function"==typeof this.boforePushBreadcrumb)return(t=this.boforePushBreadcrumb(e))?void this.immediatePush(t):void 0;this.immediatePush(e)}immediatePush(e){e.time||(e.time=u()),this.stack.length>=this.maxBreadcrumbs&&this.shift(),this.stack.push(e),this.stack.sort((e,t)=>e.time-t.time)}shift(){return void 0!==this.stack.shift()}getStack(){return this.stack}clear(){this.stack=[]}});let kt=C.transportData||(C.transportData=new class{constructor(){this.userId="",this.apikey="",this.errorDsn="",this.uuid="1234567890"}beacon(e,t){t=new Blob([JSON.stringify(t)],{type:"application/json; charset=UTF-8"});return navigator.sendBeacon(e,t)}getAuthId(){var e;return"function"==typeof this.getUserId?"string"==typeof(e=this.getUserId())?e:T("getUserId must return string"):""}getAuthInfo(){return{userId:this.userId||this.getAuthId(),apikey:this.apikey,sdkVersion:wt}}getTransportData(e){var t=Object.assign(Object.assign(Object.assign({},e),this.getAuthInfo()),{pageUrl:N(),deviceInfo:C.deviceInfo});return[c.EVENTTYPES.PERFORMANCE,c.EVENTTYPES.RECORDSCREEN,c.EVENTTYPES.WHITESCREEN].includes(e.type)||(t.breadcrumb=s.getStack()),t}isSdkTransportUrl(e){let t=!1;return t=this.errorDsn&&-1!==e.indexOf(this.errorDsn)?!0:t}beforePost(e){let t=this.getTransportData(e);return!("function"==typeof this.beforeDataReport&&!(t=this.beforeDataReport(t)))&&t}bindOptions(e){var{dsn:t,userId:r,apikey:i,getUserId:n,beforeDataReport:a}=e;o(t,"dsn","string")&&(this.errorDsn=e.dsn),o(r,"userId","string")&&(this.userId=r||""),o(i,"apikey","string")&&(this.apikey=i||""),o(n,"getUserId","function")&&(this.getUserId=n),o(a,"beforeDataReport","function")&&(this.beforeDataReport=a)}xhrPost(e,t){fetch(""+t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}send(e){var t=this.errorDsn,e=(C.options.silentRecordScreen&&Tt.recordScreenTypeList.includes(e.type)&&(C.hasError=!0,e.recordScreenId=C.recordScreenId),this.beforePost(e));return!e||this.beacon(t,e)?void 0:this.xhrPost(e,t)}});let Tt=C.options=C.options||new class{constructor(){this.overTime=10,this.throttleDelayTime=0,this.whiteBoxElements=[],this.skeletonProject=!1,this.repeatCodeError=!0}bindOptions(e){var{overTime:e,throttleDelayTime:t,skeletonProject:r,repeatCodeError:i,filterXhrUrlRegExp:n,whiteBoxElements:a=["html","body","#app","#root"]}=e;o(e,"overTime","number")&&(this.overTime=e||0),o(this.throttleDelayTime,"throttleDelayTime","number")&&(this.throttleDelayTime=t||0),o(a,"whiteBoxElements","array")&&(this.whiteBoxElements=a||[]),o(r,"skeletonProject","boolean")&&(this.skeletonProject=r||!1),o(i,"repeatCodeError","boolean")&&(this.repeatCodeError=i||!0),o(n,"filterXhrUrlRegExp","regexp")&&(this.filterXhrUrlRegExp=n||null)}};function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xt,Ue={exports:{}},Rt={exports:{}};Rt.exports;function Nt(){return xt||(xt=1,Rt.exports=(()=>{function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var t=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],n=["fileName","functionName","source"],a=t.concat(i,n,["args"],["evalOrigin"]);function s(e){if(e)for(var t=0;t<a.length;t++)void 0!==e[a[t]]&&this["set"+r(a[t])](e[a[t]])}s.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof s)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new s(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",i=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:i?i+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},s.fromString=function(e){var t,r,i,n=e.indexOf("("),a=e.lastIndexOf(")"),o=e.substring(0,n),n=e.substring(n+1,a).split(","),e=e.substring(a+1);return 0===e.indexOf("@")&&(t=(a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e,""))[1],r=a[2],i=a[3]),new s({functionName:o,args:n||void 0,fileName:t,lineNumber:r||void 0,columnNumber:i||void 0})};for(var o=0;o<t.length;o++)s.prototype["get"+r(t[o])]=e(t[o]),s.prototype["set"+r(t[o])]=(t=>function(e){this[t]=Boolean(e)})(t[o]);for(var l=0;l<i.length;l++)s.prototype["get"+r(i[l])]=e(i[l]),s.prototype["set"+r(i[l])]=(r=>function(e){if(t=e,isNaN(parseFloat(t))||!isFinite(t))throw new TypeError(r+" must be a Number");var t;this[r]=Number(e)})(i[l]);for(var d=0;d<n.length;d++)s.prototype["get"+r(n[d])]=e(n[d]),s.prototype["set"+r(n[d])]=(t=>function(e){this[t]=String(e)})(n[d]);return s})()),Rt.exports}var Ot;Ot||(Ot=1,Ue.exports=function(l){var i=/(^|@)\S+:\d+/;var n=/^\s*at .*(\S+:\d+|\(native\))/m;var a=/^(eval@)?(\[native code])?$/;return{parse:function e(t){if(typeof t.stacktrace!=="undefined"||typeof t["opera#sourceloc"]!=="undefined")return this.parseOpera(t);else if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);else if(t.stack)return this.parseFFOrSafari(t);else throw new Error("Cannot parse given Error object")},extractLocation:function e(t){if(t.indexOf(":")===-1)return[t];var r=/(.+?)(?::(\d+))?(?::(\d+))?$/;var i=r.exec(t.replace(/[()]/g,""));return[i[1],i[2]||undefined,i[3]||undefined]},parseV8OrIE:function e(t){var r=t.stack.split("\n").filter(function(e){return!!e.match(n)},this);return r.map(function(e){if(e.indexOf("(eval ")>-1)e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,"");var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");var r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;var i=this.extractLocation(r?r[1]:t);var n=r&&t||undefined;var a=["eval","<anonymous>"].indexOf(i[0])>-1?undefined:i[0];return new l({functionName:n,fileName:a,lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseFFOrSafari:function e(t){var r=t.stack.split("\n").filter(function(e){return!e.match(a)},this);return r.map(function(e){if(e.indexOf(" > eval")>-1)e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1");if(e.indexOf("@")===-1&&e.indexOf(":")===-1)return new l({functionName:e});else{var t=/((.*".+"[^@]*)?[^@]*)(?:@)/;var r=e.match(t);var i=r&&r[1]?r[1]:undefined;var n=this.extractLocation(e.replace(t,""));return new l({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e})}},this)},parseOpera:function e(t){if(!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length)return this.parseOpera9(t);else if(!t.stack)return this.parseOpera10(t);else return this.parseOpera11(t)},parseOpera9:function e(t){var r=/Line (\d+).*script (?:in )?(\S+)/i;var i=t.message.split("\n");var n=[];for(var a=2,o=i.length;a<o;a+=2){var s=r.exec(i[a]);if(s)n.push(new l({fileName:s[2],lineNumber:s[1],source:i[a]}))}return n},parseOpera10:function e(t){var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;var i=t.stacktrace.split("\n");var n=[];for(var a=0,o=i.length;a<o;a+=2){var s=r.exec(i[a]);if(s)n.push(new l({functionName:s[3]||undefined,fileName:s[2],lineNumber:s[1],source:i[a]}))}return n},parseOpera11:function e(t){var r=t.stack.split("\n").filter(function(e){return!!e.match(i)&&!e.match(/^Error created at/)},this);return r.map(function(e){var t=e.split("@");var r=this.extractLocation(t.pop());var i=t.shift()||"";var n=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||undefined;var a;if(i.match(/\(([^)]*)\)/))a=i.replace(/^[^(]+\(([^)]*)\)$/,"$1");var o=a===undefined||a==="[arguments not available]"?undefined:a.split(",");return new l({functionName:n,args:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}}(Nt()));var Mt=At(Ue.exports);let Dt={};function Ut(e,t){e&&Dt[e]&&null!=(e=Dt[e])&&e.forEach(e=>{try{e(t)}catch(e){console.log("webmonitor notify error",e)}})}function Ft(e){switch(e){case c.EVENTTYPES.ERROR:M(w,"error",e=>{Ut(c.EVENTTYPES.ERROR,e)},!0);break;case c.EVENTTYPES.UNHANDLEDREJECTION:M(w,c.EVENTTYPES.UNHANDLEDREJECTION,e=>{Ut(c.EVENTTYPES.UNHANDLEDREJECTION,e)});break;case c.EVENTTYPES.XHR:"XMLHttpRequest"in w&&(U(XMLHttpRequest.prototype,"open",t=>function(...e){this.webmonitor_xhr={method:x.isString(e[0])?e[0].toUpperCase():e[0],url:e[1],sTime:u(),type:c.HTTPTYPE.XHR},t.apply(this,e)},!0),U(XMLHttpRequest.prototype,"send",t=>function(...e){let{method:r,url:i}=this.webmonitor_xhr;M(this,"loadend",function(){var e,t;r===c.EMethods.Post||kt.isSdkTransportUrl(i)||(e=i,Tt.filterXhrUrlRegExp&&Tt.filterXhrUrlRegExp.test(e))||(e=this.status,t=u(),this.webmonitor_xhr.time=this.webmonitor_xhr.sTime,this.webmonitor_xhr.Status=e,this.webmonitor_xhr.elapsedTime=t-this.webmonitor_xhr.sTime,Ut(c.EVENTTYPES.XHR,this.webmonitor_xhr))}),t.apply(this,e)}));break;case c.EVENTTYPES.CLICK:if("document"in w){let e=L(Ut,Tt.throttleDelayTime);M(w.document,"click",function(){e(c.EVENTTYPES.CLICK,this)},!0)}break;case c.EVENTTYPES.HASHCHANGE:"onhashchange"in w&&M(w,"hashchange",function(e){Ut(c.EVENTTYPES.HASHCHANGE,e)});break;case c.EVENTTYPES.HISTORY:yt()&&(w.onpopstate=function(...e){console.log("aaa",e)},U(w.history,"pushState",t),U(w.history,"replaceState",t));break;case c.EVENTTYPES.WHITESCREEN:Ut(c.EVENTTYPES.WHITESCREEN)}function t(i){return function(...e){var t,r=2<e.length?e[2]:void 0;return r&&(t=Bt,r=r,Bt=r,Ut(c.EVENTTYPES.HISTORY,{from:t,to:r})),i.apply(this,e)}}}function Lt(e){var t,r;!(t=e)||bt(t.type)||(ft(t.type,!0),Dt[t.type]=Dt[t.type]||[],null!=(r=Dt[t.type])&&r.push(t.callback),0)||Ft(e.type)}let Bt=N();function zt(e){var{Status:t=200,time:r,elapsedTime:i=0}=e;let n=c.STATUSCODE.OK,a="";return 0===t?(n=c.STATUSCODE.ERROR,a=i>C.options.overTime?"请求超时":"请求失败, 状态为"+t):t<c.HTTPCODE.BAD_REQUEST?n=c.STATUSCODE.OK:(n=c.STATUSCODE.ERROR,a=`http请求失败, Status值为${t}, `+(t<200?c.SpanStatus.Ok:c.SpanStatus.Aborted)),a=e.url+", "+a,{url:e.url,status:n,message:a,time:r}}let Vt={handleError(e){var t,r,i,n,a=e.target;a&&a.localName||({columnNumber:t,lineNumber:i,fileName:n}=Mt.parse(a?e.error:e)[0],r={type:c.EVENTTYPES.ERROR,status:c.STATUSCODE.ERROR,message:e.message,time:u(),fileName:n,line:i,col:t},s.push({type:c.EVENTTYPES.ERROR,data:r,category:s.getCategory(c.EVENTTYPES.ERROR),time:u(),status:c.STATUSCODE.ERROR}),e=St(`${c.EVENTTYPES.ERROR}-${e.message}-${n}-${i}-`+t),Tt.repeatCodeError&&(Tt.repeatCodeError,_t(e)))||kt.send(r),null!=a&&a.localName&&(n=a,i={time:u(),name:n.localName||"",message:F(n.src||n.href||"",120)+", 资源加载失败"},s.push({type:c.EVENTTYPES.ERROR,data:i,category:s.getCategory(c.EVENTTYPES.RESOURCE),time:u(),status:c.STATUSCODE.ERROR}),kt.send(Object.assign(Object.assign({},i),{type:c.EVENTTYPES.RESOURCE,status:c.STATUSCODE.ERROR})))},handleUnhandledrejection(e){var t,r,i,n;e.reason&&({lineNumber:t,columnNumber:r,fileName:i}=Mt.parse(e.reason)[0],e=e.reason.message||e.reason.stack,n={type:c.EVENTTYPES.UNHANDLEDREJECTION,status:c.STATUSCODE.ERROR,time:u(),fileName:i,message:e,line:t,col:r},s.push({type:c.EVENTTYPES.UNHANDLEDREJECTION,data:n,category:s.getCategory(c.EVENTTYPES.UNHANDLEDREJECTION),time:u(),status:c.STATUSCODE.ERROR}),e=St(c.EVENTTYPES.UNHANDLEDREJECTION+`-${e}-${i}-${t}-`+r),Tt.repeatCodeError&&(Tt.repeatCodeError,_t(e))||kt.send(n),kt.send(n))},handleHttp(e){e=zt(e);e.url.includes(Tt.dsn)||s.push({type:c.EVENTTYPES.XHR,data:e,category:s.getCategory(c.EVENTTYPES.XHR),time:u(),status:e.status}),e.status===c.STATUSCODE.ERROR&&kt.send(e)},handleClick(e){e=Ct(e.activeElement);e&&s.push({type:c.EVENTTYPES.CLICK,status:c.STATUSCODE.OK,time:u(),data:e,category:s.getCategory(c.EVENTTYPES.CLICK)})},handleHashChange(e){var{oldURL:e,newURL:t}=e,t=It(t).relative,e=It(e).relative;t!==e&&s.push({type:c.EVENTTYPES.HASHCHANGE,status:c.STATUSCODE.OK,time:u(),data:{from:e,to:t},category:s.getCategory(c.EVENTTYPES.HASHCHANGE)})},handleHistory(e){var{from:e,to:t}=e,t=It(t).relative,e=It(e).relative;t!==e&&s.push({type:c.EVENTTYPES.HISTORY,status:c.STATUSCODE.OK,time:u(),data:{from:e||"/",to:t||"/"},category:s.getCategory(c.EVENTTYPES.HISTORY)})},handleWhiteScreen(){{var[e,{skeletonProject:s,whiteBoxElements:t}]=[e=>{kt.send(Object.assign({type:c.EVENTTYPES.WHITESCREEN,time:u()},e||{}))},Tt];let n=0,a=[],o=[];function l(e){e=(e=e).id?"#"+e.id:e.className?"."+e.className:e.nodeName.toLowerCase();return s&&(n?o:a).push(e),t.includes(e)}function r(){let t=0;for(let e=1;e<=9;e++){var r=document.elementsFromPoint(w.innerWidth*e/10,w.innerHeight/2),i=document.elementsFromPoint(w.innerWidth/2,w.innerHeight*e/10);l(r[0])&&t++,5!==e&&l(i[0])&&t++}if(17!==t){if(s){if(!n)return d();if(a.join("")==o.join(""))return e({status:c.STATUSCODE.ERROR})}C._loopTimer&&(clearInterval(C._loopTimer),C._loopTimer=null)}else{if(C._loopTimer)return;d()}e({status:17===t?c.STATUSCODE.ERROR:c.STATUSCODE.OK})}function d(){C._loopTimer||(C._loopTimer=setInterval(()=>{s&&(n++,o=[]),i()},1e3))}function i(){"requestIdleCallback"in w?requestIdleCallback(e=>{0<e.timeRemaining()&&r()}):r()}s?"complete"!==document.readyState&&i():"complete"===document.readyState?i():w.addEventListener("load",i)}}};function Pt(e){if(!e.dsn)return console.error("请配置dsn");"fetch"in w&&!e.disabled&&(Et(e=e),s.bindOptions(e),kt.bindOptions(e),Tt.bindOptions(e),Lt({type:c.EVENTTYPES.ERROR,callback:e=>{console.log("js error 捕获到了",e),Vt.handleError(e)}}),Lt({type:c.EVENTTYPES.UNHANDLEDREJECTION,callback:e=>{console.log("promise error 捕获到了",e),Vt.handleUnhandledrejection(e)}}),Lt({type:c.EVENTTYPES.XHR,callback:e=>{Vt.handleHttp(e)}}),Lt({type:c.EVENTTYPES.CLICK,callback:e=>{Vt.handleClick(e)}}),Lt({type:c.EVENTTYPES.HASHCHANGE,callback:e=>{Vt.handleHashChange(e)}}),Lt({type:c.EVENTTYPES.HISTORY,callback:e=>{Vt.handleHistory(e)}}),Lt({type:c.EVENTTYPES.WHITESCREEN,callback:()=>{Vt.handleWhiteScreen()}}))}De={install:function(e,t){let i=e.config.errorHandler;e.config.errorHandler=function(e,t,r){Vt.handleError(e),i&&i.apply(null,[e,t,r])},Pt(t)},use:function(e,t){new e(t).core({transportData:kt,breadcrumb:s,options:Tt})},log:function({message:t="customMsg",error:r,type:i=c.EVENTTYPES.CUSTOM}){try{let e={};var n;R(r)&&(n=Mt.parse(r.target?r.error||r.reason:r)[0],e=Object.assign(Object.assign({},n),{line:n.lineNumber,column:n.columnNumber})),s.push({type:i,status:c.STATUSCODE.ERROR,category:s.getCategory(i),time:u(),data:V(t)}),kt.send(Object.assign({type:i,status:c.STATUSCODE.ERROR,message:V(t),time:u()},e))}catch(r){console.log(r)}}};class Zt{constructor(e){this.type=e}}function Ht(o,s){s=s||{},mr(ar(function(){function e(e){e.forEach(function(e){var t,r;e.hadRecentInput||(t=n[0],r=n[n.length-1],i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,n.push(e)):(i=e.value,n=[e]))}),i>r.value&&(r.value=i,r.entries=n,t())}var t,r=er("CLS",0),i=0,n=[],a=tr("layout-shift",e);a&&(t=rr(o,r,gr,s.reportAllChanges),nr(function(){e(a.takeRecords()),t(!0)}),qt(function(){r=er("CLS",i=0),t=rr(o,r,gr,s.reportAllChanges),ir(function(){return t()})}),setTimeout(t,0))}))}function Yt(o,s){s=s||{},hr(function(){function e(e){(e=s.reportAllChanges?e:e.slice(-1)).forEach(function(e){e.startTime<i.firstHiddenTime&&(n.value=Math.max(e.startTime-$t(),0),n.entries=[e],t())})}var t,r,i=ur(),n=er("LCP"),a=tr("largest-contentful-paint",e);a&&(t=rr(o,n,br,s.reportAllChanges),r=ar(function(){vr[n.id]||(e(a.takeRecords()),a.disconnect(),vr[n.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return fr(r)},{once:!0,capture:!0})}),nr(r),qt(function(e){n=er("LCP"),t=rr(o,n,br,s.reportAllChanges),ir(function(){n.value=performance.now()-e.timeStamp,vr[n.id]=!0,t(!0)})}))})}function Wt(o,s){s=s||{},hr(function(){function e(e){e.forEach(i)}var t=ur(),r=er("FID"),i=function(e){e.startTime<t.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),a(!0))},n=tr("first-input",e),a=rr(o,r,Tr,s.reportAllChanges);n&&(nr(ar(function(){e(n.takeRecords()),n.disconnect()})),qt(function(){var e;r=er("FID"),a=rr(o,r,Tr,s.reportAllChanges),Jt=[],Kt=-1,Gt=null,kr(addEventListener),e=i,Jt.push(e),_r()}))})}var Gt,Kt,jt,Jt,z,Xt=-1,qt=function(t){addEventListener("pageshow",function(e){e.persisted&&(Xt=e.timeStamp,t(e))},!0)},Qt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&0<e.responseStart&&e.responseStart<performance.now())return e},$t=function(){var e=Qt();return e&&e.activationStart||0},er=function(e,t){var r=Qt(),i="navigate";return 0<=Xt?i="back-forward-cache":r&&(document.prerendering||0<$t()?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},tr=function(e,t,r){try{var i;if(PerformanceObserver.supportedEntryTypes.includes(e))return(i=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},r||{})),i}catch(e){}},rr=function(t,r,i,n){var a,o;return function(e){0<=r.value&&(e||n)&&((o=r.value-(a||0))||void 0===a)&&(a=r.value,r.delta=o,r.rating=(e=r.value)>i[1]?"poor":e>i[0]?"needs-improvement":"good",t(r))}},ir=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},nr=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},ar=function(e){var t=!1;return function(){t||(e(),t=!0)}},or=-1,sr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},lr=function(e){"hidden"===document.visibilityState&&-1<or&&(or="visibilitychange"===e.type?e.timeStamp:0,cr())},dr=function(){addEventListener("visibilitychange",lr,!0),addEventListener("prerenderingchange",lr,!0)},cr=function(){removeEventListener("visibilitychange",lr,!0),removeEventListener("prerenderingchange",lr,!0)},ur=function(){return or<0&&(or=sr(),dr(),qt(function(){setTimeout(function(){or=sr(),dr()},0)})),{get firstHiddenTime(){return or}}},hr=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},pr=[1800,3e3],mr=function(a,o){o=o||{},hr(function(){var t,r=ur(),i=er("FCP"),n=tr("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(n.disconnect(),e.startTime<r.firstHiddenTime)&&(i.value=Math.max(e.startTime-$t(),0),i.entries.push(e),t(!0))})});n&&(t=rr(a,i,pr,o.reportAllChanges),qt(function(e){i=er("FCP"),t=rr(a,i,pr,o.reportAllChanges),ir(function(){i.value=performance.now()-e.timeStamp,t(!0)})}))})},gr=[.1,.25],fr=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=ar(e),"hidden"===document.visibilityState?e():(r=t(e),nr(e)),r},br=[2500,4e3],vr={},yr=[800,1800],wr=function e(t){document.prerendering?hr(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Cr={passive:!0,capture:!0},Ir=new Date,Sr=function(e,t){Gt||(Gt=t,Kt=e,jt=new Date,kr(removeEventListener),_r())},_r=function(){var t;0<=Kt&&Kt<jt-Ir&&(t={entryType:"first-input",name:Gt.type,target:Gt.target,cancelable:Gt.cancelable,startTime:Gt.timeStamp,processingStart:Gt.timeStamp+Kt},Jt.forEach(function(e){e(t)}),Jt=[])},Er=function(e){var t,r,i,n,a,o;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(r=t,i=e,n=function(){Sr(r,i),o()},a=function(){o()},o=function(){removeEventListener("pointerup",n,Cr),removeEventListener("pointercancel",a,Cr)},addEventListener("pointerup",n,Cr),addEventListener("pointercancel",a,Cr)):Sr(t,e))},kr=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,Er,Cr)})},Tr=[100,300];let Ar=!1,xr,Rr=[],Nr=0,Or,Mr=w.innerWidth,Dr=w.innerHeight;function Ur(e){cancelAnimationFrame(Or),Or=requestAnimationFrame(()=>{(Ar="complete"===document.readyState?!0:Ar)?(xr&&xr.disconnect(),Rr=[],Nr=(()=>{let t=0;return Rr.map(e=>{t=Math.max(t,e.startTime)}),t-performance.timing.navigationStart})(),e&&e(Nr)):Ur(e)})}function Fr(e){e=e.getBoundingClientRect();return e.left<Mr&&e.top<=Dr}function Lr(n){let a=["SCRIPT","STYLE","LINK"];(xr=new MutationObserver(e=>{Ur(n);var t,r={children:[],startTime:0};for(t of e)if(t.addedNodes.length&&Fr(t.target))for(var i of t.addedNodes)1===i.nodeType&&!a.includes(i.nodeName)&&Fr(i)&&r.children.push(i);r.children.length&&(Rr.push(r),r.startTime=u())})).observe(document,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}function Br(t){if(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)){console.log("我是safari"),c=e=>{t(e)},M(w,"load",()=>{var{responseStart:e,navigationStart:t}=w.performance.timing,e=e-t;c({name:"TTFB",value:e,rating:100<e?"poor":"good"})});{var i=e=>{t(e)};let r=new PerformanceObserver(e=>{for(var t of e.getEntries())"first-contentful-paint"===t.name&&(r.disconnect(),i({name:"FCP",value:t.startTime,rating:2500<t.startTime?"poor":"good"}))});r.observe({type:"paint",buffered:!0})}{var n=e=>{t(e)};let r=new PerformanceObserver(e=>{for(var t of e.getEntries())"largest-contentful-paint"===t.name&&(r.disconnect(),n({name:"LCP",