cwj_monitoring 0.0.23 → 0.0.24
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/README.md +200 -34
- package/dist/index.cjs +925 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +290 -16
- package/dist/index.js +915 -1
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/index.umd.js +931 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +24 -9
package/dist/index.js
CHANGED
|
@@ -1 +1,915 @@
|
|
|
1
|
-
const e=e=>{const t=new Date(e),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),c=e=>{let t="";return t=e<10?"0"+e:e.toString(),t};return n+"-"+c(r)+"-"+c(i)+" "+c(o)+":"+c(a)+":"+c(s)};function t(e){return/^\d+$/.test(e.toString())}const n=window.requestIdleCallback||window.requestAnimationFrame||(e=>window.setTimeout(e,1e3/60));class r{nextValidator;constructor(){this.nextValidator=null}}const i=new class extends r{constructor(){super()}setNext(e){this.nextValidator=e}validate(e){return t=e.url,new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)?!this.nextValidator||this.nextValidator.validate(e):(console.error("请输入符合规范的url"),!1);var t}},o=new class extends r{constructor(){super()}setNext(e){this.nextValidator=e}validate(e){return e.max&&!t(e.max)?(console.error("max请输入正整数"),!1):!this.nextValidator||this.nextValidator.validate(e)}},a=new class extends r{constructor(){super()}setNext(e){this.nextValidator=e}validate(e){return e.time&&!t(e.time)?(console.error("time请输入正整数"),!1):!this.nextValidator||this.nextValidator.validate(e)}};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function d(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}i.setNext(o),o.setNext(a);var f={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},m={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},h={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},v={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},p={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"},g=function(){function e(){s(this,e)}return d(e,null,[{key:"getFirstMatch",value:function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""}},{key:"getSecondMatch",value:function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""}},{key:"matchAndReturnConst",value:function(e,t,n){if(e.test(t))return n}},{key:"getWindowsVersionName",value:function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}},{key:"getMacOSVersionName",value:function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}},{key:"getAndroidVersionName",value:function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}},{key:"getVersionPrecision",value:function(e){return e.split(".").length}},{key:"compareVersions",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),a=Math.max(i,o),s=0,c=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]<c[1][a])return-1}}},{key:"map",value:function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r}},{key:"find",value:function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}}},{key:"assign",value:function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var s=function(){var e=o[t];"object"===c(e)&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)s();return e}},{key:"getBrowserAlias",value:function(e){return f[e]}},{key:"getBrowserTypeByAlias",value:function(e){return m[e]||""}}]),e}(),b=/version\/(\d+(\.?_?\d+)+)/i,y=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=g.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=g.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=g.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=g.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=g.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=g.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=g.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=g.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=g.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=g.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=g.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=g.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=g.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=g.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=g.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=g.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=g.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=g.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=g.getFirstMatch(b,e)||g.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=g.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=g.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=g.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=g.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=g.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=g.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=g.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=g.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=g.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=g.getFirstMatch(b,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:g.getFirstMatch(t,e),version:g.getSecondMatch(t,e)}}}],w=[{test:[/Roku\/DVP/],describe:function(e){var t=g.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:v.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=g.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:v.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=g.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=g.getWindowsVersionName(t);return{name:v.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:v.iOS},n=g.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=g.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=g.getMacOSVersionName(t),r={name:v.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=g.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:v.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=g.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=g.getAndroidVersionName(t),r={name:v.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=g.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:v.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=g.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||g.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||g.getFirstMatch(/\bbb(\d+)/i,e);return{name:v.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=g.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:v.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=g.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:v.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:v.Linux}}},{test:[/CrOS/],describe:function(){return{name:v.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=g.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:v.PlayStation4,version:t}}}],k=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=g.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:h.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:h.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:h.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:h.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:h.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:h.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:h.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=g.getFirstMatch(/(ipod|iphone)/i,e);return{type:h.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:h.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:h.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:h.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:h.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:h.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:h.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:h.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:h.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:h.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:h.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:h.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:h.tv}}}],M=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:p.Blink};var t=g.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:p.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:p.Trident},n=g.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:p.Presto},n=g.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:p.Gecko},n=g.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:p.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:p.WebKit},n=g.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(s(this,e),null==t||""===t)throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},!0!==n&&this.parse()}return d(e,[{key:"getUA",value:function(){return this._ua}},{key:"test",value:function(e){return e.test(this._ua)}},{key:"parseBrowser",value:function(){var e=this;this.parsedResult.browser={};var t=g.find(y,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}},{key:"getBrowser",value:function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}},{key:"getBrowserName",value:function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}},{key:"getBrowserVersion",value:function(){return this.getBrowser().version}},{key:"getOS",value:function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}},{key:"parseOS",value:function(){var e=this;this.parsedResult.os={};var t=g.find(w,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}},{key:"getOSName",value:function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""}},{key:"getOSVersion",value:function(){return this.getOS().version}},{key:"getPlatform",value:function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}},{key:"getPlatformType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""}},{key:"parsePlatform",value:function(){var e=this;this.parsedResult.platform={};var t=g.find(k,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}},{key:"getEngine",value:function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}},{key:"getEngineName",value:function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}},{key:"parseEngine",value:function(){var e=this;this.parsedResult.engine={};var t=g.find(M,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}},{key:"parse",value:function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}},{key:"getResult",value:function(){return g.assign({},this.parsedResult)}},{key:"satisfies",value:function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"===c(a)&&(n[t]=a,r+=1)})),r>0){var a=Object.keys(n),s=g.find(a,(function(e){return t.isOS(e)}));if(s){var u=this.satisfies(n[s]);if(void 0!==u)return u}var l=g.find(a,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(o>0){var f=Object.keys(i),m=g.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==m)return this.compareVersion(i[m])}}},{key:"isBrowser",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=g.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}},{key:"compareVersion",value:function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(g.compareVersions(i,n,r))>-1}},{key:"isOS",value:function(e){return this.getOSName(!0)===String(e).toLowerCase()}},{key:"isPlatform",value:function(e){return this.getPlatformType(!0)===String(e).toLowerCase()}},{key:"isEngine",value:function(e){return this.getEngineName(!0)===String(e).toLowerCase()}},{key:"is",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}},{key:"some",value:function(){var e=this;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((function(t){return e.is(t)}))}}]),e}(),L=function(){function e(){s(this,e)}return d(e,null,[{key:"getParser",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("UserAgent should be a string");return new S(e,t)}},{key:"parse",value:function(e){return new S(e).getResult()}},{key:"BROWSER_MAP",get:function(){return m}},{key:"ENGINE_MAP",get:function(){return p}},{key:"OS_MAP",get:function(){return v}},{key:"PLATFORMS_MAP",get:function(){return h}}]),e}();function F(){let e=0;const t=window.screen,n=navigator.userAgent.toLowerCase();return void 0!==window.devicePixelRatio?e=window.devicePixelRatio:~n.indexOf("msie")?t.deviceXDPI&&t.logicalXDPI&&(e=t.deviceXDPI/t.logicalXDPI):void 0!==window.outerWidth&&void 0!==window.innerWidth&&(e=window.outerWidth/window.innerWidth),e&&(e=Math.round(100*e)),e}var R=function(){return R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},R.apply(this,arguments)};function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function x(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function V(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var P="4.6.2";function C(e,t){return new Promise((function(n){return setTimeout(n,e,t)}))}function O(e){return!!e&&"function"==typeof e.then}function A(e,t){try{var n=e();O(n)?n.then((function(e){return t(!0,e)}),(function(e){return t(!1,e)})):t(!0,n)}catch(e){t(!1,e)}}function N(e,t,n){return void 0===n&&(n=16),E(this,void 0,void 0,(function(){var r,i,o,a;return x(this,(function(s){switch(s.label){case 0:r=Array(e.length),i=Date.now(),o=0,s.label=1;case 1:return o<e.length?(r[o]=t(e[o],o),(a=Date.now())>=i+n?(i=a,[4,new Promise((function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)}))]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++o,[3,1];case 4:return[2,r]}}))}))}function W(e){return e.then(void 0,(function(){})),e}function _(e){return parseInt(e)}function B(e){return parseFloat(e)}function I(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Z(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function T(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function G(e,t){var n=e[0]>>>16,r=65535&e[0],i=e[1]>>>16,o=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,u=0,l=0,d=0,f=0;d+=(f+=o+(65535&t[1]))>>>16,f&=65535,l+=(d+=i+c)>>>16,d&=65535,u+=(l+=r+s)>>>16,l&=65535,u+=n+a,u&=65535,e[0]=u<<16|l,e[1]=d<<16|f}function j(e,t){var n=e[0]>>>16,r=65535&e[0],i=e[1]>>>16,o=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,u=65535&t[1],l=0,d=0,f=0,m=0;f+=(m+=o*u)>>>16,m&=65535,d+=(f+=i*u)>>>16,f&=65535,d+=(f+=o*c)>>>16,f&=65535,l+=(d+=r*u)>>>16,d&=65535,l+=(d+=i*c)>>>16,d&=65535,l+=(d+=o*s)>>>16,d&=65535,l+=n*u+r*c+i*s+o*a,l&=65535,e[0]=l<<16|d,e[1]=f<<16|m}function X(e,t){var n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Y(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function H(e,t){e[0]^=t[0],e[1]^=t[1]}var D=[4283543511,3981806797],z=[3301882366,444984403];function J(e){var t=[0,e[0]>>>1];H(e,t),j(e,D),t[1]=e[0]>>>1,H(e,t),j(e,z),t[1]=e[0]>>>1,H(e,t)}var U=[2277735313,289559509],Q=[1291169091,658871167],K=[0,5],q=[0,1390208809],$=[0,944331445];function ee(e,t){var n=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return(new TextEncoder).encode(e);t[n]=r}return t}(e);t=t||0;var r,i=[0,n.length],o=i[1]%16,a=i[1]-o,s=[0,t],c=[0,t],u=[0,0],l=[0,0];for(r=0;r<a;r+=16)u[0]=n[r+4]|n[r+5]<<8|n[r+6]<<16|n[r+7]<<24,u[1]=n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24,l[0]=n[r+12]|n[r+13]<<8|n[r+14]<<16|n[r+15]<<24,l[1]=n[r+8]|n[r+9]<<8|n[r+10]<<16|n[r+11]<<24,j(u,U),X(u,31),j(u,Q),H(s,u),X(s,27),G(s,c),j(s,K),G(s,q),j(l,Q),X(l,33),j(l,U),H(c,l),X(c,31),G(c,s),j(c,K),G(c,$);u[0]=0,u[1]=0,l[0]=0,l[1]=0;var d=[0,0];switch(o){case 15:d[1]=n[r+14],Y(d,48),H(l,d);case 14:d[1]=n[r+13],Y(d,40),H(l,d);case 13:d[1]=n[r+12],Y(d,32),H(l,d);case 12:d[1]=n[r+11],Y(d,24),H(l,d);case 11:d[1]=n[r+10],Y(d,16),H(l,d);case 10:d[1]=n[r+9],Y(d,8),H(l,d);case 9:d[1]=n[r+8],H(l,d),j(l,Q),X(l,33),j(l,U),H(c,l);case 8:d[1]=n[r+7],Y(d,56),H(u,d);case 7:d[1]=n[r+6],Y(d,48),H(u,d);case 6:d[1]=n[r+5],Y(d,40),H(u,d);case 5:d[1]=n[r+4],Y(d,32),H(u,d);case 4:d[1]=n[r+3],Y(d,24),H(u,d);case 3:d[1]=n[r+2],Y(d,16),H(u,d);case 2:d[1]=n[r+1],Y(d,8),H(u,d);case 1:d[1]=n[r],H(u,d),j(u,U),X(u,31),j(u,Q),H(s,u)}return H(s,i),H(c,i),G(s,c),G(c,s),J(s),J(c),G(s,c),G(c,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function te(e,t,n,r){var i=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}(n,e)})),o=W(N(i,(function(n){return function(e,t){var n=W(new Promise((function(n){var r=Date.now();A(e.bind(null,t),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Date.now()-r;if(!e[0])return n((function(){return{error:e[1],duration:i}}));var o=e[1];if(function(e){return"function"!=typeof e}(o))return n((function(){return{value:o,duration:i}}));n((function(){return new Promise((function(e){var t=Date.now();A(o,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i+Date.now()-t;if(!n[0])return e({error:n[1],duration:o});e({value:n[1],duration:o})}))}))}))}))})));return function(){return n.then((function(e){return e()}))}}(e[n],t)}),r));return function(){return E(this,void 0,void 0,(function(){var e,t,n,a;return x(this,(function(s){switch(s.label){case 0:return[4,o];case 1:return[4,N(s.sent(),(function(e){return W(e())}),r)];case 2:return e=s.sent(),[4,Promise.all(e)];case 3:for(t=s.sent(),n={},a=0;a<i.length;++a)n[i[a]]=t[a];return[2,n]}}))}))}}function ne(){var e=window,t=navigator;return Z(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function re(){var e=window,t=navigator;return Z(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function ie(){var e=window;return Z(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function oe(){var e=window,t=e.HTMLElement,n=e.Document;return Z(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function ae(){var e,t=window;return e=t.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))&&"[object WebPageNamespace]"===String(t.browser)}function se(){var e,t,n=window;return Z(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function ce(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return Z([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function ue(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function le(){var e=re(),t=se(),n=window,r=navigator,i="connection";return e?Z([!("SharedWorker"in n),r[i]&&"ontypechange"in r[i],!("sinkId"in new Audio)])>=2:!!t&&Z(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2}function de(e){var t=new Error(e);return t.name=e,t}function fe(e,t,n){var r,i,o;return void 0===n&&(n=50),E(this,void 0,void 0,(function(){var a,s;return x(this,(function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,C(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise((function(e,n){var r=!1,i=function(){r=!0,e()};s.onload=i,s.onerror=function(e){r=!0,n(e)};var o=s.style;o.setProperty("display","block","important"),o.position="absolute",o.top="0",o.left="0",o.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);!function e(){var t,n;r||("complete"===(null===(n=null===(t=s.contentWindow)||void 0===t?void 0:t.document)||void 0===n?void 0:n.readyState)?i():setTimeout(e,10))}()}))];case 5:c.sent(),c.label=6;case 6:return(null===(i=null===(r=s.contentWindow)||void 0===r?void 0:r.document)||void 0===i?void 0:i.body)?[3,8]:[4,C(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return null===(o=s.parentNode)||void 0===o||o.removeChild(s),[7];case 11:return[2]}}))}))}function me(e){for(var t=function(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),i=/^\s*([a-z-]*)(.*)$/i.exec(e),o=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var u=s.exec(i[2]);if(!u)break;var l=u[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!d)throw new Error(r);c(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[o,a]}(e),n=t[0],r=t[1],i=document.createElement(null!=n?n:"div"),o=0,a=Object.keys(r);o<a.length;o++){var s=a[o],c=r[s].join(" ");"style"===s?he(i.style,c):i.setAttribute(s,c)}return i}function he(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var i=r[n],o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(o){var a=o[1],s=o[2],c=o[4];e.setProperty(a,s,c||"")}}}var ve=["monospace","sans-serif","serif"],pe=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function ge(e){return e.toDataURL()}var be,ye,we=2500;function ke(){var e=this;return void 0===ye&&function e(){var t=Me();Se(t)?ye=setTimeout(e,we):(be=t,ye=void 0)}(),function(){return E(e,void 0,void 0,(function(){var e;return x(this,(function(t){switch(t.label){case 0:return Se(e=Me())?be?[2,V([],be,!0)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,ue()]:[3,2]:[3,2];case 1:t.sent(),e=Me(),t.label=2;case 2:return Se(e)||(be=e),[2,e]}var n}))}))}}function Me(){var e=screen;return[I(B(e.availTop),null),I(B(e.width)-B(e.availWidth)-I(B(e.availLeft),0),null),I(B(e.height)-B(e.availHeight)-I(B(e.availTop),0),null),I(B(e.availLeft),null)]}function Se(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Le(e){var t;return E(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return x(this,(function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),i=new Array(e.length),o={},Fe(r),c=0;c<e.length;++c)"DIALOG"===(a=me(e[c])).tagName&&a.show(),Fe(s=n.createElement("div")),s.appendChild(a),r.appendChild(s),i[c]=a;u.label=1;case 1:return n.body?[3,3]:[4,C(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<e.length;++c)i[c].offsetParent||(o[e[c]]=!0)}finally{null===(t=r.parentNode)||void 0===t||t.removeChild(r)}return[2,o]}}))}))}function Fe(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Re(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Ee(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function xe(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Ve(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Pe(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function Ce(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Oe=Math,Ae=function(){return 0};var Ne={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var We=function(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return!0;throw e}e=t}};var _e=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Be=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Ie=["FRAGMENT_SHADER","VERTEX_SHADER"],Ze=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Te="WEBGL_debug_renderer_info";function Ge(e){if(e.webgl)return e.webgl.context;var t,n=document.createElement("canvas");n.addEventListener("webglCreateContextError",(function(){return t=void 0}));for(var r=0,i=["webgl","experimental-webgl"];r<i.length;r++){var o=i[r];try{t=n.getContext(o)}catch(e){}if(t)break}return e.webgl={context:t},t}function je(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Xe(e){return Object.keys(e.__proto__).filter(Ye)}function Ye(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function He(){return se()}function De(e){return"function"==typeof e.getParameter}var ze={fonts:function(){var e=this;return fe((function(t,n){var r=n.document;return E(e,void 0,void 0,(function(){var e,t,n,i,o,a,s,c,u,l,d;return x(this,(function(f){for((e=r.body).style.fontSize="48px",(t=r.createElement("div")).style.setProperty("visibility","hidden","important"),n={},i={},o=function(e){var n=r.createElement("span"),i=n.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",t.appendChild(n),n},a=function(e,t){return o("'".concat(e,"',").concat(t))},s=function(){for(var e={},t=function(t){e[t]=ve.map((function(e){return a(t,e)}))},n=0,r=pe;n<r.length;n++){t(r[n])}return e},c=function(e){return ve.some((function(t,r){return e[r].offsetWidth!==n[t]||e[r].offsetHeight!==i[t]}))},u=function(){return ve.map(o)}(),l=s(),e.appendChild(t),d=0;d<ve.length;d++)n[ve[d]]=u[d].offsetWidth,i[ve[d]]=u[d].offsetHeight;return[2,pe.filter((function(e){return c(l[e])}))]}))}))}))},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return E(this,void 0,void 0,(function(){var e,n,r,i,o;return x(this,(function(a){switch(a.label){case 0:return ie()||le()?(s=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},n=Object.keys(e),[4,Le((o=[]).concat.apply(o,n.map((function(t){return e[t]}))))]):[2,void 0];case 1:return r=a.sent(),t&&function(e,t){for(var n="DOM blockers debug:\n```",r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];n+="\n".concat(o,":");for(var a=0,s=e[o];a<s.length;a++){var c=s[a];n+="\n ".concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}(e,r),(i=n.filter((function(t){var n=e[t];return Z(n.map((function(e){return r[e]})))>.6*n.length}))).sort(),[2,i]}var s}))}))},fontPreferences:function(){return function(e,t){void 0===t&&(t=4e3);return fe((function(n,r){var i=r.document,o=i.body,a=o.style;a.width="".concat(t,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",re()?o.style.zoom="".concat(1/r.devicePixelRatio):ie()&&(o.style.zoom="reset");var s=i.createElement("div");return s.textContent=V([],Array(t/20<<0),!0).map((function(){return"word"})).join(" "),o.appendChild(s),e(i,o)}),'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((function(e,t){for(var n={},r={},i=0,o=Object.keys(Ne);i<o.length;i++){var a=o[i],s=Ne[a],c=s[0],u=void 0===c?{}:c,l=s[1],d=void 0===l?"mmMwWLliI0fiflO&1":l,f=e.createElement("span");f.textContent=d,f.style.whiteSpace="nowrap";for(var m=0,h=Object.keys(u);m<h.length;m++){var v=h[m],p=u[v];void 0!==p&&(f.style[v]=p)}n[a]=f,t.append(e.createElement("br"),f)}for(var g=0,b=Object.keys(Ne);g<b.length;g++){r[a=b[g]]=n[a].getBoundingClientRect().width}return r}))},audio:function(){return ie()&&ce()&&ae()||re()&&(e=navigator,t=window,n=Audio.prototype,r=t.visualViewport,Z(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3)&&function(){var e=window,t=e.URLPattern;return Z(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ie()&&!oe()&&!function(){var e=window;return Z(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=4500,r=new t(1,5e3,44100),i=r.createOscillator();i.type="triangle",i.frequency.value=1e4;var o=r.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,i.connect(o),o.connect(r.destination),i.start(0);var a=function(e){var t=3,n=500,r=500,i=5e3,o=function(){},a=new Promise((function(a,s){var c=!1,u=0,l=0;e.oncomplete=function(e){return a(e.renderedBuffer)};var d=function(){setTimeout((function(){return s(de("timeout"))}),Math.min(r,l+i-Date.now()))};(function r(){try{var i=e.startRendering();switch(O(i)&&W(i),e.state){case"running":l=Date.now(),c&&d();break;case"suspended":document.hidden||u++,c&&u>=t?s(de("suspended")):setTimeout(r,n)}}catch(e){s(e)}})(),o=function(){c||(c=!0,l>0&&d())}}));return[a,o]}(r),s=a[0],c=a[1],u=W(s.then((function(e){return function(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e})));return function(){return c(),u}}();var e,t,n,r},screenFrame:function(){var e=this;if(ie()&&ce()&&ae())return function(){return Promise.resolve(void 0)};var t=ke();return function(){return E(e,void 0,void 0,(function(){var e,n;return x(this,(function(r){switch(r.label){case 0:return[4,t()];case 1:return e=r.sent(),[2,[(n=function(e){return null===e?null:T(e,10)})(e[0]),n(e[1]),n(e[2]),n(e[3])]]}}))}))}},canvas:function(){return function(e){var t,n,r,i=!1,o=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),a=o[0],s=o[1];!function(e,t){return!(!t||!e.toDataURL)}(a,s)?n=r="unsupported":(i=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(s),e?n=r="skipped":(t=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);var n=ge(e),r=ge(e);if(n!==r)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var i=r[n],o=i[0],a=i[1],s=i[2];t.fillStyle=o,t.beginPath(),t.arc(a,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);var i=ge(e);return[i,n]}(a,s),n=t[0],r=t[1]));return{winding:i,geometry:n,text:r}}(ie()&&ce()&&ae())},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,n=[],r=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==r&&n.push([r]),Array.isArray(t.languages))re()&&Z([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||n.push(t.languages);else if("string"==typeof t.languages){var i=t.languages;i&&n.push(i.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return I(B(navigator.deviceMemory),void 0)},screenResolution:function(){var e,t,n;if(!(ie()&&ce()&&ae()))return e=screen,(n=[(t=function(e){return I(_(e),null)})(e.width),t(e.height)]).sort().reverse(),n},hardwareConcurrency:function(){return I(_(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var r,i=(r=(new Date).getFullYear(),-Math.max(B(new Date(r,0,1).getTimezoneOffset()),B(new Date(r,6,1).getTimezoneOffset())));return"UTC".concat(i>=0?"+":"").concat(i)},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(ne()||(e=window,t=navigator,Z(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!ne())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&ie()&&!oe()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Z(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var i=[],o=0;o<r.length;++o){var a=r[o];i.push({type:a.type,suffixes:a.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:i})}}return t}},touchSupport:function(){var e,t=navigator,n=0;void 0!==t.maxTouchPoints?n=_(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(n=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:n,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],i=window[r];i&&"object"===c(i)&&e.push(r)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}},invertedColors:function(){return!!Re("inverted")||!Re("none")&&void 0},forcedColors:function(){return!!Ee("active")||!Ee("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return xe("no-preference")?0:xe("high")||xe("more")?1:xe("low")||xe("less")?-1:xe("forced")?10:void 0},reducedMotion:function(){return!!Ve("reduce")||!Ve("no-preference")&&void 0},reducedTransparency:function(){return!!Pe("reduce")||!Pe("no-preference")&&void 0},hdr:function(){return!!Ce("high")||!Ce("standard")&&void 0},math:function(){var e,t=Oe.acos||Ae,n=Oe.acosh||Ae,r=Oe.asin||Ae,i=Oe.asinh||Ae,o=Oe.atanh||Ae,a=Oe.atan||Ae,s=Oe.sin||Ae,c=Oe.sinh||Ae,u=Oe.cos||Ae,l=Oe.cosh||Ae,d=Oe.tan||Ae,f=Oe.tanh||Ae,m=Oe.exp||Ae,h=Oe.expm1||Ae,v=Oe.log1p||Ae;return{acos:t(.12312423423423424),acosh:n(1e308),acoshPf:(e=1e154,Oe.log(e+Oe.sqrt(e*e-1))),asin:r(.12312423423423424),asinh:i(1),asinhPf:function(e){return Oe.log(e+Oe.sqrt(e*e+1))}(1),atanh:o(.5),atanhPf:function(e){return Oe.log((1+e)/(1-e))/2}(.5),atan:a(.5),sin:s(-1e300),sinh:c(1),sinhPf:function(e){return Oe.exp(e)-1/Oe.exp(e)/2}(1),cos:u(10.000000000123),cosh:l(1),coshPf:function(e){return(Oe.exp(e)+1/Oe.exp(e))/2}(1),tan:d(-1e300),tanh:f(1),tanhPf:function(e){return(Oe.exp(2*e)-1)/(Oe.exp(2*e)+1)}(1),exp:m(1),expm1:h(1),expm1Pf:function(e){return Oe.exp(e)-1}(1),log1p:v(10),log1pPf:function(e){return Oe.log(1+e)}(10),powPI:function(e){return Oe.pow(Oe.PI,e)}(-100)}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){var e=window.ApplePaySession;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(We())return-3;try{return e.canMakePayments()?1:0}catch(e){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(e)}},privateClickMeasurement:function(){var e,t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(le()||ie()))return-2;if(!window.AudioContext)return-1;var e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function(e){var t,n,r,i,o,a,s=Ge(e.cache);if(!s)return-1;if(!De(s))return-2;var c=He()?null:s.getExtension(Te);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(r=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===r?void 0:r.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(o=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===o?void 0:o.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function(e){var t=Ge(e.cache);if(!t)return-1;if(!De(t))return-2;var n=t.getSupportedExtensions(),r=t.getContextAttributes(),i=[],o=[],a=[],s=[],c=[];if(r)for(var u=0,l=Object.keys(r);u<l.length;u++){var d=l[u];o.push("".concat(d,"=").concat(r[d]))}for(var f=0,m=Xe(t);f<m.length;f++){var h=t[k=m[f]];a.push("".concat(k,"=").concat(h).concat(_e.has(h)?"=".concat(t.getParameter(h)):""))}if(n)for(var v=0,p=n;v<p.length;v++){var g=p[v];if(!(g===Te&&He()||"WEBGL_polygon_mode"===g&&(re()||ie()))){var b=t.getExtension(g);if(b)for(var y=0,w=Xe(b);y<w.length;y++){var k;h=b[k=w[y]];s.push("".concat(k,"=").concat(h).concat(Be.has(h)?"=".concat(t.getParameter(h)):""))}else i.push(g)}}for(var M=0,S=Ie;M<S.length;M++)for(var L=S[M],F=0,R=Ze;F<R.length;F++){var E=R[F],x=je(t,L,E);c.push("".concat(L,".").concat(E,"=").concat(x.join(",")))}return s.sort(),a.sort(),{contextAttributes:o,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};var Je="$ if upgrade to Pro: https://fpjs.dev/pro";function Ue(e){var t=function(e){if(le())return.4;if(ie())return!oe()||ce()&&ae()?.3:.5;var t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return T(.99+.01*e,1e-4)}(t);return{score:t,comment:Je.replace(/\$/g,"".concat(n))}}function Qe(e){return JSON.stringify(e,(function(e,t){return t instanceof Error?R({name:(n=t).name,message:n.message,stack:null===(r=n.stack)||void 0===r?void 0:r.split("\n")},n):t;var n,r}),2)}function Ke(e){return ee(function(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var i=r[n],o=e[i],a="error"in o?"error":JSON.stringify(o.value);t+="".concat(t?"|":"").concat(i.replace(/([:|\\])/g,"\\$1"),":").concat(a)}return t}(e))}function qe(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise((function(e){return n.call(window,(function(){return e()}),{timeout:t})})):C(Math.min(e,t))}(e,2*e)}function $e(e,t){var n=Date.now();return{get:function(r){return E(this,void 0,void 0,(function(){var i,o,a;return x(this,(function(s){switch(s.label){case 0:return i=Date.now(),[4,e()];case 1:return o=s.sent(),a=function(e){var t;return{get visitorId(){return void 0===t&&(t=Ke(this.components)),t},set visitorId(e){t=e},confidence:Ue(e),components:e,version:P}}(o),(t||(null==r?void 0:r.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(a.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(i-n,"\nvisitorId: ").concat(a.visitorId,"\ncomponents: ").concat(Qe(o),"\n```")),[2,a]}}))}))}}}var et={load:function(e){var t;return void 0===e&&(e={}),E(this,void 0,void 0,(function(){var n,r,i;return x(this,(function(o){switch(o.label){case 0:return(null===(t=e.monitoring)||void 0===t||t)&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(P,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),n=e.delayFallback,r=e.debug,[4,qe(n)];case 1:return o.sent(),i=function(e){return te(ze,e,[])}({cache:{},debug:r}),[2,$e(i,r)]}}))}))},hashComponents:Ke,componentsToDebugString:Qe};class tt{device;uuid="";constructor(){this.device=function(){const{browser:e,os:t,platform:n}=L.parse(window.navigator.userAgent);return{browser:e,os:t,platform:n,ratio:F(),wh:{width:window.screen.width,height:window.screen.height}}}(),this.getUUid()}async getUUid(){const e=await et.load(),t=await e.get();this.uuid=t.visitorId}}class nt extends tt{url;max;time;timer=null;data;events=[];isSending=!1;constructor(e){var t;super(),this.url=e.url,this.max=e.max||5,this.time=e.time||3e4,this.data=e.data,t=()=>this.flush(),window.addEventListener("beforeunload",(()=>{t()}))}formatter(t,n){const r=Date.now();return Object.assign({},{device:this.device,uuid:this.uuid},{type:t,data:n,date:e(r),userData:this.data})}async send(e=!1){if(!this.isSending&&this.events.length){this.isSending=!0;try{const t=e?this.events.length:this.max,r=this.events.slice(0,t);this.events=this.events.slice(t),await this.safeSend(r),this.events.length&&n((()=>this.send()))}finally{this.isSending=!1}}}flush(){return this.send(!0)}emit(e,t){const n=this.formatter(e,t);this.events.push(n),this.timer&&(clearTimeout(this.timer),this.timer=null),this.events.length>=this.max?this.send():this.timer=setTimeout((()=>{this.send()}),this.time)}safeSend(e){if(!e.length)return;const t=JSON.stringify(e);if(window.navigator.sendBeacon instanceof Function)window.navigator.sendBeacon(this.url,t);else{const e=new XMLHttpRequest;e.open("POST",this.url,!0),e.send(t)}}}class rt extends nt{pluginMap=new Map;constructor(e){super(e)}use(e){return this.pluginMap.has(e.name)||this.pluginMap.set(e.name,e),this}run(){this.pluginMap.forEach((e=>{e.install(this)}))}}class it{static instance;static plugins=new Map;static registerPlugin(e){this.plugins.set(e.name,e)}static start(e){i.validate(e)&&(this.instance=new rt(e),window.$track=this.instance,this.loadPlugins(e))}static loadPlugins(e){const{plugin:t=[]}=e;(t.length>0?t:Array.from(this.plugins.keys())).forEach((e=>{const t=this.plugins.get(e);t&&this.instance.use(t)})),this.instance.run()}}class ot{name;track;constructor(e){this.name=e}}var at=(e=>(e.ERROR="error",e.CLICK="click",e.PERFORMANCE="performance",e.ROUTER="router",e))(at||{}),st=(e=>(e.ERROR="error",e.ROUTE_CHANGE="route_change",e.PERFORMANCE_FP="performance_fp",e.PERFORMANCE_FCP="performance_fcp",e.PERFORMANCE_LCP="performance_lcp",e.PERFORMANCE_DOMCONTENTLOADED="performance_DOMContentLoaded",e.PERFORMANCE_LOAD="performance_load",e.BEHAVIOR_CLICK="click",e))(st||{});var ct=new class extends ot{originalConsoleError;constructor(){super(at.ERROR)}install(e){this.track=e,this.overrideConsoleError(),this.setupErrorListeners()}overrideConsoleError(){this.originalConsoleError=console.error,console.error=(...e)=>{this.originalConsoleError?.apply(console,e);const t={type:"console",message:e.map((e=>String(e))).join(" "),stack:(new Error).stack};this.track?.emit(st.ERROR,t)}}setupErrorListeners(){window.addEventListener("error",(e=>{this.handleSyncError(e,this.track)}),!0),window.addEventListener("unhandledrejection",(e=>{this.handleAsyncError(e,this.track)}),!0)}handleSyncError(e,t){const n={type:"sync",...this.getErrorDetails(e)};t?.emit(st.ERROR,n)}handleAsyncError(e,t){const n={type:"async",...this.getPromiseErrorDetails(e)};t?.emit(st.ERROR,n)}getPromiseErrorDetails(e){return e.reason instanceof Error?{errorType:"promise",message:e.reason.message,stack:e.reason.stack}:{errorType:"promise",message:String(e.reason)}}getErrorDetails(e){const{error:t,target:n,filename:r,message:i}=e;if(t instanceof Error)return{errorType:"js",message:t.message,stack:t.stack,filename:r,colno:e.colno,lineno:e.lineno};if(this.isResourceError(n)){const e=n.src||n.href;return{errorType:"resource",message:`Resource load failed: ${e}`,url:e}}return{errorType:"unknown",message:i,filename:r}}isResourceError(e){return e&&["LINK","SCRIPT","IMG","AUDIO","VIDEO","IFRAME"].includes(e.tagName)}};var ut=new class extends ot{pageStartTime=0;lastRouteTime=0;constructor(){super(at.ROUTER)}install(e){this.track=e,this.pageStartTime=Date.now(),this.lastRouteTime=this.pageStartTime,this.setupHashListener(),this.setupHistoryListener()}emitRouteChange(e){const t=Date.now();var n,r;this.track?.emit(st.ROUTE_CHANGE,{from:document.referrer,to:window.location.href,type:e,duration:(n=t,r=this.lastRouteTime,n<r&&([n,r]=[r,n]),Math.floor((n-r)/1e3))}),this.lastRouteTime=t}setupHashListener(){window.addEventListener("hashchange",(()=>{this.emitRouteChange("hashchange")}))}setupHistoryListener(){const e=window.history.pushState,t=window.history.replaceState;window.history.pushState=(...t)=>{e.apply(window.history,t),this.emitRouteChange("pushState")},window.history.replaceState=(...e)=>{t.apply(window.history,e),this.emitRouteChange("replaceState")},window.addEventListener("popstate",(()=>{this.emitRouteChange("popstate")}))}};var lt=new class extends ot{constructor(){super(at.CLICK)}install(e){this.track=e,this.setupClickListeners()}setupClickListeners(){const e=e=>{const t=e.target;if(!t)return;const n={tagName:t.tagName,id:t.id,className:t.className,text:t.textContent?.trim(),xPath:this.getElementXPath(t)};this.track?.emit(st.BEHAVIOR_CLICK,n)};document.addEventListener(st.BEHAVIOR_CLICK,(t=>{setTimeout((()=>e(t)),300)}),!0)}getElementXPath(e){if(!e||1!==e.nodeType)return"";if(e.id)return`//*[@id="${e.id}"]`;const t=Array.from(e.parentNode?.children||[]).filter((t=>t.tagName===e.tagName)).indexOf(e)+1;return`${this.getElementXPath(e.parentNode)}/${e.tagName.toLowerCase()}[${t}]`}};var dt=new class extends ot{constructor(){super(at.PERFORMANCE)}install(e){this.track=e,this.setupPerformanceMonitoring()}setupPerformanceMonitoring(){this.monitorPaintMetrics(),this.monitorLCP(),this.monitorDCL(),this.monitorLoad()}monitorPaintMetrics(){const e=new PerformanceObserver((t=>{for(const e of t.getEntries())"first-paint"===e.name?this.track?.emit(st.PERFORMANCE_FP,e.startTime):"first-contentful-paint"===e.name&&this.track?.emit(st.PERFORMANCE_FCP,e.startTime);e.disconnect()}));e.observe({type:"paint",buffered:!0})}monitorLCP(){const e=new PerformanceObserver((t=>{e&&e.disconnect();for(const e of t.getEntries())this.track?.emit(st.PERFORMANCE_LCP,e.startTime)}));e.observe({type:"largest-contentful-paint",buffered:!0})}monitorDCL(){window.addEventListener("DOMContentLoaded",(e=>{this.track?.emit(st.PERFORMANCE_DOMCONTENTLOADED,e.timeStamp)}))}monitorLoad(){window.addEventListener("load",(e=>{this.track?.emit(st.PERFORMANCE_LOAD,e.timeStamp)}))}};it.registerPlugin(lt),it.registerPlugin(ct),it.registerPlugin(dt),it.registerPlugin(ut);const ft=function(){let e=!1;return function(t){e||(it.start(t),e=!0)}}();var mt={init:ft};export{at as TYPES,mt as default,ft as init};
|
|
1
|
+
const urlAlphabet =
|
|
2
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
3
|
+
|
|
4
|
+
/* @ts-self-types="./index.d.ts" */
|
|
5
|
+
let nanoid = (size = 21) => {
|
|
6
|
+
let id = '';
|
|
7
|
+
let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
|
|
8
|
+
while (size--) {
|
|
9
|
+
id += urlAlphabet[bytes[size] & 63];
|
|
10
|
+
}
|
|
11
|
+
return id
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const getDate = (time = Date.now()) => {
|
|
15
|
+
const date = new Date(time);
|
|
16
|
+
const year = date.getFullYear();
|
|
17
|
+
const month = date.getMonth() + 1;
|
|
18
|
+
const day = date.getDate();
|
|
19
|
+
const hour = date.getHours();
|
|
20
|
+
const minute = date.getMinutes();
|
|
21
|
+
const second = date.getSeconds();
|
|
22
|
+
const formatter = (date2) => {
|
|
23
|
+
let res = "";
|
|
24
|
+
if (date2 < 10) {
|
|
25
|
+
res = "0" + date2;
|
|
26
|
+
} else {
|
|
27
|
+
res = date2.toString();
|
|
28
|
+
}
|
|
29
|
+
return res;
|
|
30
|
+
};
|
|
31
|
+
return year + "-" + formatter(month) + "-" + formatter(day) + " " + formatter(hour) + ":" + formatter(minute) + ":" + formatter(second);
|
|
32
|
+
};
|
|
33
|
+
const getSeconds = (timestamp1, timestamp2) => {
|
|
34
|
+
if (timestamp1 < timestamp2) {
|
|
35
|
+
[timestamp1, timestamp2] = [timestamp2, timestamp1];
|
|
36
|
+
}
|
|
37
|
+
return Math.floor((timestamp1 - timestamp2) / 1e3);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
41
|
+
|
|
42
|
+
function getDefaultExportFromCjs (x) {
|
|
43
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var es5 = {exports: {}};
|
|
47
|
+
|
|
48
|
+
(function (module, exports) {
|
|
49
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){t.__esModule=!0,t.default=void 0;var i=r(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return "NT";case"XP":return "XP";case"NT 5.0":return "2000";case"NT 5.1":return "XP";case"NT 5.2":return "2003";case"NT 6.0":return "Vista";case"NT 6.1":return "7";case"NT 6.2":return "8";case"NT 6.3":return "8.1";case"NT 10.0":return "10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));t.push(0);var r=t[0],i=t[1];if(10===r)switch(i){case 5:return "Leopard";case 6:return "Snow Leopard";case 7:return "Lion";case 8:return "Mountain Lion";case 9:return "Mavericks";case 10:return "Yosemite";case 11:return "El Capitan";case 12:return "Sierra";case 13:return "High Sierra";case 14:return "Mojave";case 15:return "Catalina";default:return}switch(r){case 11:return "Big Sur";case 12:return "Monterey";case 13:return "Ventura";case 14:return "Sonoma";case 15:return "Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,i){void 0===i&&(i=!1);var n=e.getVersionPrecision(t),a=e.getVersionPrecision(r),o=Math.max(n,a),s=0,u=e.map([t,r],(function(t){var r=o-e.getVersionPrecision(t),i=t+new Array(r+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=o-Math.min(n,a)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1;}else if(u[0][o]<u[1][o])return -1}},e.map=function(e,t){var r,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)i.push(t(e[r]));return i},e.find=function(e,t){var r,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,i=e.length;r<i;r+=1){var n=e[r];if(t(n,r))return n}},e.assign=function(e){for(var t,r,i=e,n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t];}));};for(t=0,r=a.length;t<r;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=n,e.exports=t.default;},18:function(e,t,r){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0;t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"};t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"};t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"};t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"};t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};},90:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(91))&&i.__esModule?i:{default:i},a=r(18);function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}var s=function(){function e(){}var t,r,i;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new n.default(e,t)},e.parse=function(e){return new n.default(e).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}],(r=null)&&o(t.prototype,r),i&&o(t,i),e}();t.default=s,e.exports=t.default;},91:function(e,t,r){t.__esModule=!0,t.default=void 0;var i=u(r(92)),n=u(r(93)),a=u(r(94)),o=u(r(95)),s=u(r(17));function u(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse();}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},i=0,n={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(n[t]=o,a+=1):"object"==typeof o&&(r[t]=o,i+=1);})),i>0){var o=Object.keys(r),u=s.default.find(o,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=s.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(a>0){var l=Object.keys(n),b=s.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==b)return this.compareVersion(n[b])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),n=s.default.getBrowserTypeByAlias(i);return t&&n&&(i=n.toLowerCase()),i===r},t.compareVersion=function(e){var t=[0],r=e,i=!1,n=this.getBrowserVersion();if("string"==typeof n)return ">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(i=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(i=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(n,r,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default;},92:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i};var a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},r=n.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},r=n.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},r=n.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},r=n.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},r=n.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},r=n.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},r=n.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},r=n.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},r=n.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},r=n.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},r=n.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},r=n.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},r=n.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},r=n.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},r=n.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},r=n.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},r=n.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},r=n.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return {name:"FacebookExternalHit"}}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return {name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return {name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return {name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},r=n.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},r=n.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),a=n.default.getFirstMatch(/se ([\d.]+)x/i,e),o=r||i||a;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return {name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default;},93:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return {name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=n.default.getWindowsVersionName(t);return {name:a.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},r=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=n.default.getMacOSVersionName(t),i={name:a.OS_MAP.MacOS,version:t};return r&&(i.versionName=r),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return {name:a.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=n.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=n.default.getAndroidVersionName(t),i={name:a.OS_MAP.Android,version:t};return r&&(i.versionName=r),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:a.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return {name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return {name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return {name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default;},94:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:[/googlebot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/amazonbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/yahoo/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return {type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=n.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),r={type:a.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(r.model=t),r}},{test:[/[^-]mobi/i],describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "blackberry"===e.getBrowserName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return "bada"===e.getBrowserName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "windows phone"===e.getBrowserName()},describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return "android"===e.getOSName(!0)&&t>=3},describe:function(){return {type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return "android"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "macos"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return "windows"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return "linux"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return "playstation 4"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.tv}}},{test:function(e){return "roku"===e.getOSName(!0)},describe:function(){return {type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default;},95:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:function(e){return "microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return {name:a.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return {name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},r=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},r=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},r=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return {name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},r=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=o,e.exports=t.default;}})}));
|
|
50
|
+
} (es5));
|
|
51
|
+
|
|
52
|
+
var es5Exports = es5.exports;
|
|
53
|
+
var Bowser = /*@__PURE__*/getDefaultExportFromCjs(es5Exports);
|
|
54
|
+
|
|
55
|
+
function getBrowserNameVersion() {
|
|
56
|
+
const { browser, os, platform } = Bowser.parse(window.navigator.userAgent);
|
|
57
|
+
return {
|
|
58
|
+
browser,
|
|
59
|
+
os,
|
|
60
|
+
platform,
|
|
61
|
+
ratio: getRatio(),
|
|
62
|
+
wh: getWH()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function getRatio() {
|
|
66
|
+
let ratio = 0;
|
|
67
|
+
const screen = window.screen;
|
|
68
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
69
|
+
if (window.devicePixelRatio !== void 0) {
|
|
70
|
+
ratio = window.devicePixelRatio;
|
|
71
|
+
} else if (~ua.indexOf("msie")) {
|
|
72
|
+
if (screen.deviceXDPI && screen.logicalXDPI) {
|
|
73
|
+
ratio = screen.deviceXDPI / screen.logicalXDPI;
|
|
74
|
+
}
|
|
75
|
+
} else if (window.outerWidth !== void 0 && window.innerWidth !== void 0) {
|
|
76
|
+
ratio = window.outerWidth / window.innerWidth;
|
|
77
|
+
}
|
|
78
|
+
if (ratio) {
|
|
79
|
+
ratio = Math.round(ratio * 100);
|
|
80
|
+
}
|
|
81
|
+
return ratio;
|
|
82
|
+
}
|
|
83
|
+
function getWH() {
|
|
84
|
+
return {
|
|
85
|
+
width: window.screen.width,
|
|
86
|
+
height: window.screen.height
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const nextTime = window.requestIdleCallback || window.requestAnimationFrame || ((callback) => window.setTimeout(callback, 1e3 / 60));
|
|
90
|
+
const beforeUnload = (callback) => {
|
|
91
|
+
window.addEventListener("beforeunload", () => {
|
|
92
|
+
callback();
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
function throttle(fn, delay) {
|
|
97
|
+
let lastTime = 0;
|
|
98
|
+
return function(...args) {
|
|
99
|
+
const now = Date.now();
|
|
100
|
+
if (now - lastTime >= delay) {
|
|
101
|
+
fn.apply(this, args);
|
|
102
|
+
lastTime = now;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const MAX_CACHE_LEN = 5;
|
|
108
|
+
const MAX_WAITING_TIME = 3e4;
|
|
109
|
+
const UUID = "track_uuid";
|
|
110
|
+
const DEFAULT_LONG_TASK_THRESHOLD = 100;
|
|
111
|
+
const DEFAULT_RESOURCE_THRESHOLD = 1e3;
|
|
112
|
+
const DEFAULT_INP_THRESHOLD = 200;
|
|
113
|
+
|
|
114
|
+
var __defProp$3 = Object.defineProperty;
|
|
115
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
116
|
+
var __publicField$3 = (obj, key, value) => {
|
|
117
|
+
__defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
118
|
+
return value;
|
|
119
|
+
};
|
|
120
|
+
class DeviceInfo {
|
|
121
|
+
constructor(uuidKey = UUID) {
|
|
122
|
+
__publicField$3(this, "device");
|
|
123
|
+
__publicField$3(this, "uuid", "");
|
|
124
|
+
this.device = getBrowserNameVersion();
|
|
125
|
+
this.getUUid(uuidKey);
|
|
126
|
+
}
|
|
127
|
+
getUUid(key) {
|
|
128
|
+
try {
|
|
129
|
+
const uuid = localStorage.getItem(key);
|
|
130
|
+
if (uuid) {
|
|
131
|
+
this.uuid = uuid;
|
|
132
|
+
} else {
|
|
133
|
+
this.uuid = nanoid();
|
|
134
|
+
localStorage.setItem(key, this.uuid);
|
|
135
|
+
}
|
|
136
|
+
} catch (e) {
|
|
137
|
+
this.uuid = nanoid();
|
|
138
|
+
console.warn("[CWJ Monitor] localStorage access failed, UUID will not be persisted:", e);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var __defProp$2 = Object.defineProperty;
|
|
144
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
145
|
+
var __publicField$2 = (obj, key, value) => {
|
|
146
|
+
__defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
147
|
+
return value;
|
|
148
|
+
};
|
|
149
|
+
class EventTrack {
|
|
150
|
+
constructor(options, reporter) {
|
|
151
|
+
__publicField$2(this, "deviceInfo");
|
|
152
|
+
__publicField$2(this, "reporter");
|
|
153
|
+
__publicField$2(this, "data");
|
|
154
|
+
this.deviceInfo = new DeviceInfo(options.uuidKey);
|
|
155
|
+
this.reporter = reporter;
|
|
156
|
+
this.data = options.data;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* 格式化事件数据用于传输
|
|
160
|
+
*/
|
|
161
|
+
formatter(type, data) {
|
|
162
|
+
const timestamp = Date.now();
|
|
163
|
+
return {
|
|
164
|
+
device: this.deviceInfo.device,
|
|
165
|
+
uuid: this.deviceInfo.uuid,
|
|
166
|
+
type,
|
|
167
|
+
data,
|
|
168
|
+
date: getDate(timestamp),
|
|
169
|
+
userData: this.data
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 公共方法:发送事件
|
|
174
|
+
* 将事件格式化后交给 reporter 处理
|
|
175
|
+
*/
|
|
176
|
+
emit(type, data) {
|
|
177
|
+
const payload = this.formatter(type, data);
|
|
178
|
+
this.reporter.send(payload);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 获取上报器实例 (供 Core 使用)
|
|
182
|
+
*/
|
|
183
|
+
getReporter() {
|
|
184
|
+
return this.reporter;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var __defProp$1 = Object.defineProperty;
|
|
189
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
190
|
+
var __publicField$1 = (obj, key, value) => {
|
|
191
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
192
|
+
return value;
|
|
193
|
+
};
|
|
194
|
+
class Reporter {
|
|
195
|
+
constructor(url, config) {
|
|
196
|
+
__publicField$1(this, "url");
|
|
197
|
+
__publicField$1(this, "transportConfig");
|
|
198
|
+
__publicField$1(this, "events", []);
|
|
199
|
+
__publicField$1(this, "isSending", false);
|
|
200
|
+
__publicField$1(this, "timer", null);
|
|
201
|
+
this.url = url;
|
|
202
|
+
this.transportConfig = {
|
|
203
|
+
maxBatchSize: config?.maxBatchSize ?? MAX_CACHE_LEN,
|
|
204
|
+
maxWaitTime: config?.maxWaitTime ?? MAX_WAITING_TIME
|
|
205
|
+
};
|
|
206
|
+
beforeUnload(() => this.flush());
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* 将事件加入队列
|
|
210
|
+
*/
|
|
211
|
+
send(payload) {
|
|
212
|
+
this.events.push(payload);
|
|
213
|
+
if (this.events.length >= this.transportConfig.maxBatchSize) {
|
|
214
|
+
this.clearTimer();
|
|
215
|
+
this.triggerSend();
|
|
216
|
+
} else if (!this.timer) {
|
|
217
|
+
this.timer = setTimeout(() => {
|
|
218
|
+
this.timer = null;
|
|
219
|
+
this.triggerSend();
|
|
220
|
+
}, this.transportConfig.maxWaitTime);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* 立即刷新所有待发送事件
|
|
225
|
+
*/
|
|
226
|
+
flush() {
|
|
227
|
+
return this.triggerSend(true);
|
|
228
|
+
}
|
|
229
|
+
clearTimer() {
|
|
230
|
+
if (this.timer) {
|
|
231
|
+
clearTimeout(this.timer);
|
|
232
|
+
this.timer = null;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* 触发发送逻辑
|
|
237
|
+
*/
|
|
238
|
+
async triggerSend(isFlush = false) {
|
|
239
|
+
if (this.isSending || !this.events.length)
|
|
240
|
+
return;
|
|
241
|
+
this.isSending = true;
|
|
242
|
+
try {
|
|
243
|
+
const maxLen = isFlush ? this.events.length : this.transportConfig.maxBatchSize;
|
|
244
|
+
const sendEvents = this.events.slice(0, maxLen);
|
|
245
|
+
this.events = this.events.slice(maxLen);
|
|
246
|
+
await this.safeSend(sendEvents);
|
|
247
|
+
if (this.events.length) {
|
|
248
|
+
nextTime(() => this.triggerSend());
|
|
249
|
+
}
|
|
250
|
+
} catch (error) {
|
|
251
|
+
} finally {
|
|
252
|
+
this.isSending = false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 使用 navigator.sendBeacon 或 XMLHttpRequest 安全发送事件
|
|
257
|
+
*/
|
|
258
|
+
safeSend(events) {
|
|
259
|
+
return new Promise((resolve, reject) => {
|
|
260
|
+
if (!events.length) {
|
|
261
|
+
resolve();
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const data = JSON.stringify(events);
|
|
265
|
+
if (typeof navigator.sendBeacon === "function") {
|
|
266
|
+
const blob = new Blob([data], { type: "application/json" });
|
|
267
|
+
const success = navigator.sendBeacon(this.url, blob);
|
|
268
|
+
if (success) {
|
|
269
|
+
resolve();
|
|
270
|
+
} else {
|
|
271
|
+
this.sendViaXHR(data, resolve, reject);
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
this.sendViaXHR(data, resolve, reject);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* 通过 XMLHttpRequest 发送
|
|
280
|
+
*/
|
|
281
|
+
sendViaXHR(data, resolve, reject) {
|
|
282
|
+
const xhr = new XMLHttpRequest();
|
|
283
|
+
xhr.open("POST", this.url, true);
|
|
284
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
285
|
+
xhr.onload = () => {
|
|
286
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
287
|
+
resolve();
|
|
288
|
+
} else {
|
|
289
|
+
reject(new Error(`HTTP ${xhr.status}: ${xhr.statusText}`));
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
xhr.onerror = () => reject(new Error("Network error"));
|
|
293
|
+
xhr.ontimeout = () => reject(new Error("Request timeout"));
|
|
294
|
+
xhr.timeout = 1e4;
|
|
295
|
+
xhr.send(data);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
var TYPES = /* @__PURE__ */ ((TYPES2) => {
|
|
300
|
+
TYPES2["ERROR"] = "error";
|
|
301
|
+
TYPES2["CLICK"] = "click";
|
|
302
|
+
TYPES2["PERFORMANCE"] = "performance";
|
|
303
|
+
TYPES2["ROUTER"] = "router";
|
|
304
|
+
TYPES2["XHR"] = "xhr";
|
|
305
|
+
TYPES2["FETCH"] = "fetch";
|
|
306
|
+
return TYPES2;
|
|
307
|
+
})(TYPES || {});
|
|
308
|
+
var EMIT_TYPE = /* @__PURE__ */ ((EMIT_TYPE2) => {
|
|
309
|
+
EMIT_TYPE2["ERROR"] = "error";
|
|
310
|
+
EMIT_TYPE2["BEHAVIOR_CLICK"] = "click";
|
|
311
|
+
EMIT_TYPE2["ROUTE_CHANGE"] = "route_change";
|
|
312
|
+
EMIT_TYPE2["PERFORMANCE_FP"] = "performance_fp";
|
|
313
|
+
EMIT_TYPE2["PERFORMANCE_FCP"] = "performance_fcp";
|
|
314
|
+
EMIT_TYPE2["PERFORMANCE_LCP"] = "performance_lcp";
|
|
315
|
+
EMIT_TYPE2["PERFORMANCE_INP"] = "performance_inp";
|
|
316
|
+
EMIT_TYPE2["PERFORMANCE_LONGTASK"] = "performance_longtask";
|
|
317
|
+
EMIT_TYPE2["PERFORMANCE_RESOURCE"] = "performance_resource";
|
|
318
|
+
EMIT_TYPE2["XHR"] = "xhr";
|
|
319
|
+
EMIT_TYPE2["FETCH"] = "fetch";
|
|
320
|
+
EMIT_TYPE2["CUSTOM"] = "custom";
|
|
321
|
+
return EMIT_TYPE2;
|
|
322
|
+
})(EMIT_TYPE || {});
|
|
323
|
+
|
|
324
|
+
var __defProp = Object.defineProperty;
|
|
325
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
326
|
+
var __publicField = (obj, key, value) => {
|
|
327
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
328
|
+
return value;
|
|
329
|
+
};
|
|
330
|
+
class Core extends EventTrack {
|
|
331
|
+
constructor(options) {
|
|
332
|
+
const reporter = new Reporter(options.url, options.transport);
|
|
333
|
+
super(options, reporter);
|
|
334
|
+
__publicField(this, "pluginMap", /* @__PURE__ */ new Map());
|
|
335
|
+
__publicField(this, "options");
|
|
336
|
+
this.options = options;
|
|
337
|
+
}
|
|
338
|
+
use(plugin) {
|
|
339
|
+
if (!this.pluginMap.has(plugin.name)) {
|
|
340
|
+
this.pluginMap.set(plugin.name, plugin);
|
|
341
|
+
}
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* 自定义事件上报
|
|
346
|
+
* @param data 上报的数据
|
|
347
|
+
* @param type 事件类型,默认为 'custom'
|
|
348
|
+
*/
|
|
349
|
+
log(data, type = EMIT_TYPE.CUSTOM) {
|
|
350
|
+
this.emit(type, data);
|
|
351
|
+
}
|
|
352
|
+
// 启动插件
|
|
353
|
+
run() {
|
|
354
|
+
const context = {
|
|
355
|
+
emit: this.emit.bind(this),
|
|
356
|
+
url: this.options.url
|
|
357
|
+
};
|
|
358
|
+
this.pluginMap.forEach((plugin) => {
|
|
359
|
+
plugin.install(context);
|
|
360
|
+
});
|
|
361
|
+
this.mount();
|
|
362
|
+
}
|
|
363
|
+
// 停止并卸载所有插件
|
|
364
|
+
stop() {
|
|
365
|
+
this.pluginMap.forEach((plugin) => {
|
|
366
|
+
plugin.uninstall?.();
|
|
367
|
+
});
|
|
368
|
+
this.pluginMap.clear();
|
|
369
|
+
this.unmount();
|
|
370
|
+
}
|
|
371
|
+
mount() {
|
|
372
|
+
const { globalKey = "$track" } = this.options;
|
|
373
|
+
if (typeof window !== "undefined") {
|
|
374
|
+
window[globalKey] = this;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
unmount() {
|
|
378
|
+
const { globalKey = "$track" } = this.options;
|
|
379
|
+
if (typeof window !== "undefined" && window[globalKey] === this) {
|
|
380
|
+
delete window[globalKey];
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function createMonitor(options) {
|
|
385
|
+
return new Core(options);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const ErrorPlugin = (options = {}) => {
|
|
389
|
+
let originalConsoleError;
|
|
390
|
+
let context;
|
|
391
|
+
const overrideConsoleError = () => {
|
|
392
|
+
originalConsoleError = console.error;
|
|
393
|
+
console.error = (...args) => {
|
|
394
|
+
originalConsoleError?.apply(console, args);
|
|
395
|
+
const errorData = {
|
|
396
|
+
type: "console",
|
|
397
|
+
message: args.map((arg) => String(arg)).join(" "),
|
|
398
|
+
stack: new Error().stack
|
|
399
|
+
};
|
|
400
|
+
if (options.filter && !options.filter(errorData)) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
context?.emit(EMIT_TYPE.ERROR, errorData);
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
const restoreConsoleError = () => {
|
|
407
|
+
if (originalConsoleError) {
|
|
408
|
+
console.error = originalConsoleError;
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
const cleanStack = (stack) => {
|
|
412
|
+
if (!stack)
|
|
413
|
+
return void 0;
|
|
414
|
+
const lines = stack.split("\n").slice(0, 11);
|
|
415
|
+
return lines.join("\n");
|
|
416
|
+
};
|
|
417
|
+
const simpleHash = (str) => {
|
|
418
|
+
let hash = 0;
|
|
419
|
+
for (let i = 0; i < str.length; i++) {
|
|
420
|
+
const char = str.charCodeAt(i);
|
|
421
|
+
hash = (hash << 5) - hash + char;
|
|
422
|
+
hash = hash & hash;
|
|
423
|
+
}
|
|
424
|
+
return Math.abs(hash).toString(36);
|
|
425
|
+
};
|
|
426
|
+
const generateFingerprint = (...parts) => {
|
|
427
|
+
const combined = parts.filter(Boolean).join("|");
|
|
428
|
+
return simpleHash(combined);
|
|
429
|
+
};
|
|
430
|
+
const isResourceError = (target) => {
|
|
431
|
+
const resourceTags = ["LINK", "SCRIPT", "IMG", "AUDIO", "VIDEO", "IFRAME"];
|
|
432
|
+
return target && resourceTags.includes(target.tagName);
|
|
433
|
+
};
|
|
434
|
+
const getPromiseErrorDetails = (e) => {
|
|
435
|
+
if (e.reason instanceof Error) {
|
|
436
|
+
return {
|
|
437
|
+
errorType: "promise",
|
|
438
|
+
message: e.reason.message,
|
|
439
|
+
stack: cleanStack(e.reason.stack),
|
|
440
|
+
name: e.reason.name,
|
|
441
|
+
fingerprint: generateFingerprint(e.reason.message, e.reason.stack)
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
errorType: "promise",
|
|
446
|
+
message: String(e.reason)
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
const getErrorDetails = (e) => {
|
|
450
|
+
const { error, target, filename, message } = e;
|
|
451
|
+
if (error instanceof Error) {
|
|
452
|
+
return {
|
|
453
|
+
errorType: "js",
|
|
454
|
+
name: error.name,
|
|
455
|
+
message: error.message,
|
|
456
|
+
stack: cleanStack(error.stack),
|
|
457
|
+
filename,
|
|
458
|
+
colno: e.colno,
|
|
459
|
+
lineno: e.lineno,
|
|
460
|
+
fingerprint: generateFingerprint(error.message, error.stack)
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
if (isResourceError(target)) {
|
|
464
|
+
const element = target;
|
|
465
|
+
const url = "src" in element ? element.src : element.href;
|
|
466
|
+
return {
|
|
467
|
+
errorType: "resource",
|
|
468
|
+
message: `Resource load failed: ${url}`,
|
|
469
|
+
url,
|
|
470
|
+
tagName: element.tagName,
|
|
471
|
+
fingerprint: generateFingerprint(`resource:${url}`)
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
errorType: "unknown",
|
|
476
|
+
message,
|
|
477
|
+
filename
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
const errorHandler = (e) => {
|
|
481
|
+
const errorData = { type: "sync", ...getErrorDetails(e) };
|
|
482
|
+
if (options.filter && !options.filter(errorData))
|
|
483
|
+
return;
|
|
484
|
+
context?.emit(EMIT_TYPE.ERROR, errorData);
|
|
485
|
+
};
|
|
486
|
+
const rejectionHandler = (e) => {
|
|
487
|
+
const errorData = { type: "async", ...getPromiseErrorDetails(e) };
|
|
488
|
+
if (options.filter && !options.filter(errorData))
|
|
489
|
+
return;
|
|
490
|
+
context?.emit(EMIT_TYPE.ERROR, errorData);
|
|
491
|
+
};
|
|
492
|
+
return {
|
|
493
|
+
name: TYPES.ERROR,
|
|
494
|
+
install: (ctx) => {
|
|
495
|
+
context = ctx;
|
|
496
|
+
overrideConsoleError();
|
|
497
|
+
window.addEventListener("error", errorHandler, true);
|
|
498
|
+
window.addEventListener("unhandledrejection", rejectionHandler, true);
|
|
499
|
+
},
|
|
500
|
+
uninstall: () => {
|
|
501
|
+
restoreConsoleError();
|
|
502
|
+
window.removeEventListener("error", errorHandler, true);
|
|
503
|
+
window.removeEventListener("unhandledrejection", rejectionHandler, true);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
const PVPlugin = (options = {}) => {
|
|
509
|
+
let lastRouteTime = Date.now();
|
|
510
|
+
let context;
|
|
511
|
+
let originPushState;
|
|
512
|
+
let originReplaceState;
|
|
513
|
+
const emitRouteChange = (type) => {
|
|
514
|
+
const now = Date.now();
|
|
515
|
+
const to = window.location.href;
|
|
516
|
+
const from = document.referrer;
|
|
517
|
+
if (options.filter && !options.filter(to, from)) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
context?.emit(EMIT_TYPE.ROUTE_CHANGE, {
|
|
521
|
+
from,
|
|
522
|
+
to,
|
|
523
|
+
type,
|
|
524
|
+
duration: getSeconds(now, lastRouteTime)
|
|
525
|
+
});
|
|
526
|
+
lastRouteTime = now;
|
|
527
|
+
};
|
|
528
|
+
const handleHashChange = () => emitRouteChange("hashchange");
|
|
529
|
+
const handlePopState = () => emitRouteChange("popstate");
|
|
530
|
+
const setupHistoryListener = () => {
|
|
531
|
+
originPushState = window.history.pushState;
|
|
532
|
+
originReplaceState = window.history.replaceState;
|
|
533
|
+
window.history.pushState = (...args) => {
|
|
534
|
+
originPushState.apply(window.history, args);
|
|
535
|
+
emitRouteChange("pushState");
|
|
536
|
+
};
|
|
537
|
+
window.history.replaceState = (...args) => {
|
|
538
|
+
originReplaceState.apply(window.history, args);
|
|
539
|
+
emitRouteChange("replaceState");
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
const restoreHistoryListener = () => {
|
|
543
|
+
if (originPushState)
|
|
544
|
+
window.history.pushState = originPushState;
|
|
545
|
+
if (originReplaceState)
|
|
546
|
+
window.history.replaceState = originReplaceState;
|
|
547
|
+
};
|
|
548
|
+
return {
|
|
549
|
+
name: TYPES.ROUTER,
|
|
550
|
+
install: (ctx) => {
|
|
551
|
+
context = ctx;
|
|
552
|
+
lastRouteTime = Date.now();
|
|
553
|
+
window.addEventListener("hashchange", handleHashChange);
|
|
554
|
+
window.addEventListener("popstate", handlePopState);
|
|
555
|
+
setupHistoryListener();
|
|
556
|
+
},
|
|
557
|
+
uninstall: () => {
|
|
558
|
+
window.removeEventListener("hashchange", handleHashChange);
|
|
559
|
+
window.removeEventListener("popstate", handlePopState);
|
|
560
|
+
restoreHistoryListener();
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
const BehaviorPlugin = (options = {}) => {
|
|
566
|
+
const { throttleDelay = 500 } = options;
|
|
567
|
+
let context;
|
|
568
|
+
const getElementXPath = (element) => {
|
|
569
|
+
if (!element || element.nodeType !== 1)
|
|
570
|
+
return "";
|
|
571
|
+
if (element.id)
|
|
572
|
+
return `//*[@id="${element.id}"]`;
|
|
573
|
+
const sameTagSiblings = Array.from(element.parentNode?.children || []).filter(
|
|
574
|
+
(el) => el.tagName === element.tagName
|
|
575
|
+
);
|
|
576
|
+
const idx = sameTagSiblings.indexOf(element) + 1;
|
|
577
|
+
return `${getElementXPath(element.parentNode)}/${element.tagName.toLowerCase()}[${idx}]`;
|
|
578
|
+
};
|
|
579
|
+
const handleClick = throttle((e) => {
|
|
580
|
+
const target = e.target;
|
|
581
|
+
if (!target)
|
|
582
|
+
return;
|
|
583
|
+
if (options.filter && !options.filter(target)) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
const clickData = {
|
|
587
|
+
tagName: target.tagName,
|
|
588
|
+
id: target.id,
|
|
589
|
+
className: target.className,
|
|
590
|
+
text: target.textContent?.trim(),
|
|
591
|
+
xPath: getElementXPath(target)
|
|
592
|
+
};
|
|
593
|
+
context?.emit(EMIT_TYPE.BEHAVIOR_CLICK, clickData);
|
|
594
|
+
}, throttleDelay);
|
|
595
|
+
return {
|
|
596
|
+
name: TYPES.CLICK,
|
|
597
|
+
install: (ctx) => {
|
|
598
|
+
context = ctx;
|
|
599
|
+
document.addEventListener(EMIT_TYPE.BEHAVIOR_CLICK, handleClick, true);
|
|
600
|
+
},
|
|
601
|
+
uninstall: () => {
|
|
602
|
+
document.removeEventListener(EMIT_TYPE.BEHAVIOR_CLICK, handleClick, true);
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
const PerformancePlugin = (options = {}) => {
|
|
608
|
+
let context;
|
|
609
|
+
let paintObserver = null;
|
|
610
|
+
let lcpObserver = null;
|
|
611
|
+
let inpObserver = null;
|
|
612
|
+
let longTaskObserver = null;
|
|
613
|
+
let resourceObserver = null;
|
|
614
|
+
const interactionMap = /* @__PURE__ */ new Map();
|
|
615
|
+
const monitorPaintMetrics = () => {
|
|
616
|
+
const entryHandler = (list) => {
|
|
617
|
+
for (const entry of list.getEntries()) {
|
|
618
|
+
if (entry.name === "first-paint") {
|
|
619
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_FP, entry.startTime)) {
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_FP, entry.startTime);
|
|
623
|
+
} else if (entry.name === "first-contentful-paint") {
|
|
624
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_FCP, entry.startTime)) {
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_FCP, entry.startTime);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
paintObserver?.disconnect();
|
|
631
|
+
};
|
|
632
|
+
try {
|
|
633
|
+
paintObserver = new PerformanceObserver(entryHandler);
|
|
634
|
+
paintObserver.observe({ type: "paint", buffered: true });
|
|
635
|
+
} catch (e) {
|
|
636
|
+
console.warn("[CWJ Monitor] Paint observation not supported:", e);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
const monitorLCP = () => {
|
|
640
|
+
const entryHandler = (list) => {
|
|
641
|
+
if (lcpObserver) {
|
|
642
|
+
lcpObserver.disconnect();
|
|
643
|
+
}
|
|
644
|
+
for (const entry of list.getEntries()) {
|
|
645
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_LCP, entry.startTime)) {
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_LCP, entry.startTime);
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
try {
|
|
652
|
+
lcpObserver = new PerformanceObserver(entryHandler);
|
|
653
|
+
lcpObserver.observe({ type: "largest-contentful-paint", buffered: true });
|
|
654
|
+
} catch (e) {
|
|
655
|
+
console.warn("[CWJ Monitor] LCP observation not supported:", e);
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
const monitorINP = () => {
|
|
659
|
+
const entryHandler = (list) => {
|
|
660
|
+
for (const entry of list.getEntries()) {
|
|
661
|
+
if (!entry.interactionId)
|
|
662
|
+
continue;
|
|
663
|
+
const existing = interactionMap.get(entry.interactionId);
|
|
664
|
+
if (existing) {
|
|
665
|
+
clearTimeout(existing.timeoutId);
|
|
666
|
+
}
|
|
667
|
+
const maxEntry = existing && existing.entry.duration > entry.duration ? existing.entry : entry;
|
|
668
|
+
const timeoutId = setTimeout(() => {
|
|
669
|
+
interactionMap.delete(maxEntry.interactionId);
|
|
670
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_INP, maxEntry)) {
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
const threshold = options.inpThreshold ?? DEFAULT_INP_THRESHOLD;
|
|
674
|
+
if (maxEntry.duration > threshold) {
|
|
675
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_INP, {
|
|
676
|
+
value: maxEntry.duration,
|
|
677
|
+
startTime: maxEntry.startTime,
|
|
678
|
+
name: maxEntry.name,
|
|
679
|
+
interactionId: maxEntry.interactionId
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}, 200);
|
|
683
|
+
interactionMap.set(entry.interactionId, { entry: maxEntry, timeoutId });
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
try {
|
|
687
|
+
inpObserver = new PerformanceObserver(entryHandler);
|
|
688
|
+
inpObserver.observe({ type: "event", buffered: true });
|
|
689
|
+
} catch (e) {
|
|
690
|
+
console.warn("[CWJ Monitor] INP observation not supported:", e);
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
const monitorLongTask = () => {
|
|
694
|
+
const entryHandler = (list) => {
|
|
695
|
+
for (const entry of list.getEntries()) {
|
|
696
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_LONGTASK, entry)) {
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
const threshold = options.longTaskThreshold ?? DEFAULT_LONG_TASK_THRESHOLD;
|
|
700
|
+
if (entry.duration > threshold) {
|
|
701
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_LONGTASK, {
|
|
702
|
+
startTime: entry.startTime,
|
|
703
|
+
duration: entry.duration,
|
|
704
|
+
name: entry.name,
|
|
705
|
+
attribution: entry.attribution
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
try {
|
|
711
|
+
longTaskObserver = new PerformanceObserver(entryHandler);
|
|
712
|
+
longTaskObserver.observe({ type: "longtask", buffered: true });
|
|
713
|
+
} catch (e) {
|
|
714
|
+
console.warn("[CWJ Monitor] Long Task observation not supported:", e);
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
const monitorResource = () => {
|
|
718
|
+
const entryHandler = (list) => {
|
|
719
|
+
for (const entry of list.getEntries()) {
|
|
720
|
+
if (entry.initiatorType !== "fetch" && entry.initiatorType !== "xmlhttprequest") {
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (options.filter && !options.filter(EMIT_TYPE.PERFORMANCE_RESOURCE, entry)) {
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
const threshold = options.resourceThreshold ?? DEFAULT_RESOURCE_THRESHOLD;
|
|
727
|
+
if (entry.duration > threshold) {
|
|
728
|
+
context?.emit(EMIT_TYPE.PERFORMANCE_RESOURCE, {
|
|
729
|
+
name: entry.name,
|
|
730
|
+
// 资源 URL
|
|
731
|
+
initiatorType: entry.initiatorType,
|
|
732
|
+
duration: entry.duration,
|
|
733
|
+
startTime: entry.startTime,
|
|
734
|
+
transferSize: entry.transferSize,
|
|
735
|
+
encodedBodySize: entry.encodedBodySize,
|
|
736
|
+
decodedBodySize: entry.decodedBodySize
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
try {
|
|
742
|
+
resourceObserver = new PerformanceObserver(entryHandler);
|
|
743
|
+
resourceObserver.observe({ type: "resource", buffered: true });
|
|
744
|
+
} catch (e) {
|
|
745
|
+
console.warn("[CWJ Monitor] Resource observation not supported:", e);
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
return {
|
|
749
|
+
name: TYPES.PERFORMANCE,
|
|
750
|
+
install: (ctx) => {
|
|
751
|
+
context = ctx;
|
|
752
|
+
monitorPaintMetrics();
|
|
753
|
+
monitorLCP();
|
|
754
|
+
monitorINP();
|
|
755
|
+
monitorLongTask();
|
|
756
|
+
monitorResource();
|
|
757
|
+
},
|
|
758
|
+
uninstall: () => {
|
|
759
|
+
paintObserver?.disconnect();
|
|
760
|
+
lcpObserver?.disconnect();
|
|
761
|
+
inpObserver?.disconnect();
|
|
762
|
+
longTaskObserver?.disconnect();
|
|
763
|
+
resourceObserver?.disconnect();
|
|
764
|
+
interactionMap.forEach((value) => clearTimeout(value.timeoutId));
|
|
765
|
+
interactionMap.clear();
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
const XHRPlugin = (options = {}) => {
|
|
771
|
+
let context;
|
|
772
|
+
let originOpen;
|
|
773
|
+
let originSend;
|
|
774
|
+
const setupXHRListeners = () => {
|
|
775
|
+
const originXhr = window.XMLHttpRequest;
|
|
776
|
+
if (!originXhr)
|
|
777
|
+
return;
|
|
778
|
+
originOpen = originXhr.prototype.open;
|
|
779
|
+
originSend = originXhr.prototype.send;
|
|
780
|
+
originXhr.prototype.open = function(...args) {
|
|
781
|
+
this._xhr_info = {
|
|
782
|
+
method: args[0].toUpperCase(),
|
|
783
|
+
url: String(args[1]),
|
|
784
|
+
startTime: 0
|
|
785
|
+
};
|
|
786
|
+
return originOpen.apply(this, args);
|
|
787
|
+
};
|
|
788
|
+
originXhr.prototype.send = function(...args) {
|
|
789
|
+
if (this._xhr_info) {
|
|
790
|
+
this._xhr_info.startTime = Date.now();
|
|
791
|
+
}
|
|
792
|
+
const onLoadend = () => {
|
|
793
|
+
if (this._xhr_info) {
|
|
794
|
+
const trackerUrl = context?.url;
|
|
795
|
+
const { url, method, startTime } = this._xhr_info;
|
|
796
|
+
if (trackerUrl && url.includes(trackerUrl)) {
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
if (options.filter && !options.filter(method, url)) {
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
const duration = Date.now() - startTime;
|
|
803
|
+
const status = this.status;
|
|
804
|
+
if (!(status >= 200 && status < 300)) {
|
|
805
|
+
const data = {
|
|
806
|
+
method,
|
|
807
|
+
url,
|
|
808
|
+
status,
|
|
809
|
+
duration,
|
|
810
|
+
// 限制响应体大小,避免数据过大
|
|
811
|
+
response: this.response ? String(this.response).slice(0, 200) : ""
|
|
812
|
+
};
|
|
813
|
+
context?.emit(EMIT_TYPE.XHR, data);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
this.addEventListener("loadend", onLoadend);
|
|
818
|
+
return originSend.apply(this, args);
|
|
819
|
+
};
|
|
820
|
+
};
|
|
821
|
+
const restoreXHR = () => {
|
|
822
|
+
const originXhr = window.XMLHttpRequest;
|
|
823
|
+
if (!originXhr)
|
|
824
|
+
return;
|
|
825
|
+
if (originOpen)
|
|
826
|
+
originXhr.prototype.open = originOpen;
|
|
827
|
+
if (originSend)
|
|
828
|
+
originXhr.prototype.send = originSend;
|
|
829
|
+
};
|
|
830
|
+
return {
|
|
831
|
+
name: TYPES.XHR,
|
|
832
|
+
install: (ctx) => {
|
|
833
|
+
context = ctx;
|
|
834
|
+
setupXHRListeners();
|
|
835
|
+
},
|
|
836
|
+
uninstall: () => {
|
|
837
|
+
restoreXHR();
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
const FetchPlugin = (options = {}) => {
|
|
843
|
+
let context;
|
|
844
|
+
let originFetch;
|
|
845
|
+
const setupFetchListeners = () => {
|
|
846
|
+
originFetch = window.fetch;
|
|
847
|
+
if (!originFetch)
|
|
848
|
+
return;
|
|
849
|
+
window.fetch = function(input, init) {
|
|
850
|
+
const startTime = Date.now();
|
|
851
|
+
const method = (init?.method || "GET").toUpperCase();
|
|
852
|
+
const url = input instanceof Request ? input.url : String(input);
|
|
853
|
+
return originFetch.apply(this, [input, init]).then(
|
|
854
|
+
(response) => {
|
|
855
|
+
const trackerUrl = context?.url;
|
|
856
|
+
if (trackerUrl && url.includes(trackerUrl)) {
|
|
857
|
+
return response;
|
|
858
|
+
}
|
|
859
|
+
if (options.filter && !options.filter(method, url)) {
|
|
860
|
+
return response;
|
|
861
|
+
}
|
|
862
|
+
if (!response.ok) {
|
|
863
|
+
const duration = Date.now() - startTime;
|
|
864
|
+
const data = {
|
|
865
|
+
method,
|
|
866
|
+
url,
|
|
867
|
+
status: response.status,
|
|
868
|
+
duration,
|
|
869
|
+
success: false
|
|
870
|
+
};
|
|
871
|
+
context?.emit(EMIT_TYPE.FETCH, data);
|
|
872
|
+
}
|
|
873
|
+
return response;
|
|
874
|
+
},
|
|
875
|
+
(error) => {
|
|
876
|
+
const trackerUrl = context?.url;
|
|
877
|
+
if (trackerUrl && url.includes(trackerUrl)) {
|
|
878
|
+
throw error;
|
|
879
|
+
}
|
|
880
|
+
if (options.filter && !options.filter(method, url)) {
|
|
881
|
+
throw error;
|
|
882
|
+
}
|
|
883
|
+
const duration = Date.now() - startTime;
|
|
884
|
+
const data = {
|
|
885
|
+
method,
|
|
886
|
+
url,
|
|
887
|
+
status: 0,
|
|
888
|
+
duration,
|
|
889
|
+
success: false,
|
|
890
|
+
message: error.message
|
|
891
|
+
};
|
|
892
|
+
context?.emit(EMIT_TYPE.FETCH, data);
|
|
893
|
+
throw error;
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
const restoreFetch = () => {
|
|
899
|
+
if (originFetch)
|
|
900
|
+
window.fetch = originFetch;
|
|
901
|
+
};
|
|
902
|
+
return {
|
|
903
|
+
name: TYPES.FETCH,
|
|
904
|
+
install: (ctx) => {
|
|
905
|
+
context = ctx;
|
|
906
|
+
setupFetchListeners();
|
|
907
|
+
},
|
|
908
|
+
uninstall: () => {
|
|
909
|
+
restoreFetch();
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
export { BehaviorPlugin, Core, EMIT_TYPE, ErrorPlugin, FetchPlugin, PVPlugin, PerformancePlugin, XHRPlugin, createMonitor };
|
|
915
|
+
//# sourceMappingURL=index.js.map
|