@cloudcare/browser-rum 3.1.22 → 3.1.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/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/rum.js +1 -1
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/domain/firstInputPolyfill.js +83 -0
- package/cjs/domain/firstInputPolyfill.js.map +1 -0
- package/cjs/domain/performanceCollection.js +4 -90
- package/cjs/domain/performanceCollection.js.map +1 -1
- package/cjs/domain/performanceObservable.js +11 -0
- package/cjs/domain/performanceObservable.js.map +1 -1
- package/cjs/domain/performanceUtils.js +30 -2
- package/cjs/domain/performanceUtils.js.map +1 -1
- package/cjs/domain/replay/deflate/deflateWorker.js +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js +10 -2
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +4 -20
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +6 -3
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstInput.js +8 -3
- package/cjs/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +4 -4
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +21 -6
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +6 -4
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js +19 -24
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/rum.js +1 -1
- package/esm/boot/rum.js.map +1 -1
- package/esm/domain/firstInputPolyfill.js +77 -0
- package/esm/domain/firstInputPolyfill.js.map +1 -0
- package/esm/domain/performanceCollection.js +4 -90
- package/esm/domain/performanceCollection.js.map +1 -1
- package/esm/domain/performanceObservable.js +11 -1
- package/esm/domain/performanceObservable.js.map +1 -1
- package/esm/domain/performanceUtils.js +29 -2
- package/esm/domain/performanceUtils.js.map +1 -1
- package/esm/domain/replay/deflate/deflateWorker.js +1 -1
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js +11 -3
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +6 -22
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +8 -5
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstInput.js +10 -5
- package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +4 -4
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +23 -8
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +7 -5
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js +21 -26
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/rum.js +1 -1
- package/src/domain/firstInputPolyfill.js +92 -0
- package/src/domain/performanceCollection.js +5 -112
- package/src/domain/performanceObservable.js +19 -3
- package/src/domain/performanceUtils.js +37 -2
- package/src/domain/rumEventsCollection/longTask/longTaskCollection.js +37 -26
- package/src/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +6 -35
- package/src/domain/rumEventsCollection/view/trackCommonViewMetrics.js +1 -2
- package/src/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +26 -19
- package/src/domain/rumEventsCollection/view/trackFirstInput.js +40 -42
- package/src/domain/rumEventsCollection/view/trackInitialViewTimings.js +1 -4
- package/src/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +43 -35
- package/src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +32 -32
- package/src/domain/rumEventsCollection/view/trackNavigationTimings.js +29 -31
- package/src/domain/rumEventsCollection/view/trackViews.js +1 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performanceCollection.js","names":["addEventListeners","each","dateNow","relativeNow","DOM_EVENT","LifeCycleEventType","setTimeout","addEventListener","monitor","objectHasValue","RumPerformanceEntryType","supportPerformanceTimingEvent","supportPerformanceObject","window","performance","undefined","startPerformanceCollection","lifeCycle","configuration","cleanupTasks","performanceEntries","getEntries","handleRumPerformanceEntries","PerformanceObserver","handlePerformanceEntryList","entries","mainEntries","LONG_TASK","PAINT","experimentalEntries","LARGEST_CONTENTFUL_PAINT","FIRST_INPUT","LAYOUT_SHIFT","EVENT","type","observer","observe","buffered","durationThreshold","push","disconnect","e","mainObserver","entryTypes","_unused","resourncetimingbufferfullListener","clearResourceTimings","stop","_retrieveFirstInputTiming","retrieveFirstInputTiming","timing","task","callback","startTimeStamp","timingSent","listeners","CLICK","MOUSE_DOWN","KEY_DOWN","TOUCH_START","POINTER_DOWN","evt","cancelable","entryType","processingStart","processingEnd","startTime","timeStamp","duration","name","sendTimingIfPointerIsNotCancelled","sendTiming","passive","capture","removeEventListeners","POINTER_UP","POINTER_CANCEL","event","once","delay","rumPerformanceEntries","filter","entry","length","notify","PERFORMANCE_ENTRIES_COLLECTED"],"sources":["../../src/domain/performanceCollection.js"],"sourcesContent":["import {\n addEventListeners,\n each,\n dateNow,\n relativeNow,\n DOM_EVENT,\n LifeCycleEventType,\n setTimeout,\n addEventListener,\n monitor,\n objectHasValue\n} from '@cloudcare/browser-core'\n\nimport {\n RumPerformanceEntryType,\n supportPerformanceTimingEvent\n} from './performanceObservable'\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function startPerformanceCollection(lifeCycle, configuration) {\n var cleanupTasks = []\n if (supportPerformanceObject()) {\n var performanceEntries = performance.getEntries()\n // Because the performance entry list can be quite large\n // delay the computation to prevent the SDK from blocking the main thread on init\n setTimeout(function () {\n handleRumPerformanceEntries(lifeCycle, performanceEntries)\n })\n }\n if (window.PerformanceObserver) {\n var handlePerformanceEntryList = monitor(function (entries) {\n handleRumPerformanceEntries(lifeCycle, entries.getEntries())\n })\n var mainEntries = [\n RumPerformanceEntryType.LONG_TASK,\n RumPerformanceEntryType.PAINT\n ]\n var experimentalEntries = [\n RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,\n RumPerformanceEntryType.FIRST_INPUT,\n RumPerformanceEntryType.LAYOUT_SHIFT,\n RumPerformanceEntryType.EVENT\n ]\n try {\n // Experimental entries are not retrieved by performance.getEntries()\n // use a single PerformanceObserver with buffered flag by type\n // to get values that could happen before SDK init\n each(experimentalEntries, function (type) {\n var observer = new window.PerformanceObserver(\n handlePerformanceEntryList\n )\n observer.observe({\n type: type,\n buffered: true,\n // durationThreshold only impact PerformanceEventTiming entries used for INP computation which requires a threshold at 40 (default is 104ms)\n // cf: https://github.com/GoogleChrome/web-vitals/blob/3806160ffbc93c3c4abf210a167b81228172b31c/src/onINP.ts#L209\n durationThreshold: 40\n })\n cleanupTasks.push(function () {\n observer.disconnect()\n })\n })\n } catch (e) {\n // Some old browser versions (ex: chrome 67) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to PerformanceObserver with entryTypes\n each(experimentalEntries, function (type) {\n mainEntries.push(type)\n })\n }\n var mainObserver = new PerformanceObserver(handlePerformanceEntryList)\n // mainObserver.observe({ entryTypes: mainEntries })\n try {\n mainObserver.observe({ entryTypes: mainEntries })\n cleanupTasks.push(function () {\n mainObserver.disconnect()\n })\n } catch {}\n if (supportPerformanceObject() && 'addEventListener' in performance) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n var resourncetimingbufferfullListener = addEventListener(\n performance,\n 'resourcetimingbufferfull',\n function () {\n performance.clearResourceTimings()\n }\n )\n cleanupTasks.push(resourncetimingbufferfullListener.stop)\n }\n }\n\n if (!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT)) {\n var _retrieveFirstInputTiming = retrieveFirstInputTiming(function (timing) {\n return handleRumPerformanceEntries(lifeCycle, [timing])\n })\n cleanupTasks.push(_retrieveFirstInputTiming.stop)\n }\n return {\n stop: function () {\n each(cleanupTasks, function (task) {\n return task()\n })\n }\n }\n}\n\n/**\n * first-input timing entry polyfill based on\n * https://github.com/GoogleChrome/web-vitals/blob/master/src/lib/polyfills/firstInputPolyfill.ts\n */\nfunction retrieveFirstInputTiming(callback) {\n var startTimeStamp = dateNow()\n var timingSent = false\n\n var listeners = addEventListeners(\n window,\n [\n DOM_EVENT.CLICK,\n DOM_EVENT.MOUSE_DOWN,\n DOM_EVENT.KEY_DOWN,\n DOM_EVENT.TOUCH_START,\n DOM_EVENT.POINTER_DOWN\n ],\n function (evt) {\n // Only count cancelable events, which should trigger behavior important to the user.\n if (!evt.cancelable) {\n return\n }\n\n // This timing will be used to compute the \"first Input delay\", which is the delta between\n // when the system received the event (e.g. evt.timeStamp) and when it could run the callback\n // (e.g. performance.now()).\n var timing = {\n entryType: RumPerformanceEntryType.FIRST_INPUT,\n processingStart: relativeNow(),\n processingEnd: relativeNow(),\n startTime: evt.timeStamp,\n duration: 0,\n name: ''\n }\n\n if (evt.type === DOM_EVENT.POINTER_DOWN) {\n sendTimingIfPointerIsNotCancelled(timing)\n } else {\n sendTiming(timing)\n }\n },\n { passive: true, capture: true }\n )\n var removeEventListeners = listeners.stop\n /**\n * Pointer events are a special case, because they can trigger main or compositor thread behavior.\n * We differenciate these cases based on whether or not we see a pointercancel event, which are\n * fired when we scroll. If we're scrolling we don't need to report input delay since FID excludes\n * scrolling and pinch/zooming.\n */\n function sendTimingIfPointerIsNotCancelled(timing) {\n addEventListeners(\n window,\n [DOM_EVENT.POINTER_UP, DOM_EVENT.POINTER_CANCEL],\n function (event) {\n if (event.type === DOM_EVENT.POINTER_UP) {\n sendTiming(timing)\n }\n },\n { once: true }\n )\n }\n\n function sendTiming(timing) {\n if (!timingSent) {\n timingSent = true\n removeEventListeners()\n // In some cases the recorded delay is clearly wrong, e.g. it's negative or it's larger than\n // the time between now and when the page was loaded.\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/4\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/6\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/7\n var delay = timing.processingStart - timing.startTime\n if (delay >= 0 && delay < dateNow() - startTimeStamp) {\n callback(timing)\n }\n }\n }\n return {\n stop: removeEventListeners\n }\n}\n\nfunction handleRumPerformanceEntries(lifeCycle, entries) {\n var rumPerformanceEntries = entries.filter(function (entry) {\n return objectHasValue(RumPerformanceEntryType, entry.entryType)\n })\n\n if (rumPerformanceEntries.length) {\n lifeCycle.notify(\n LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED,\n rumPerformanceEntries\n )\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"performanceCollection.js","names":["addEventListeners","each","dateNow","relativeNow","DOM_EVENT","LifeCycleEventType","setTimeout","addEventListener","monitor","objectHasValue","RumPerformanceEntryType","supportPerformanceTimingEvent","supportPerformanceObject","window","performance","undefined","startPerformanceCollection","lifeCycle","configuration","cleanupTasks","performanceEntries","getEntries","handleRumPerformanceEntries","PerformanceObserver","handlePerformanceEntryList","entries","experimentalEntries","LAYOUT_SHIFT","type","observer","observe","buffered","push","disconnect","e","mainObserver","entryTypes","_unused","resourncetimingbufferfullListener","clearResourceTimings","stop","task","rumPerformanceEntries","filter","entry","entryType","length","notify","PERFORMANCE_ENTRIES_COLLECTED"],"sources":["../../src/domain/performanceCollection.js"],"sourcesContent":["import {\n addEventListeners,\n each,\n dateNow,\n relativeNow,\n DOM_EVENT,\n LifeCycleEventType,\n setTimeout,\n addEventListener,\n monitor,\n objectHasValue\n} from '@cloudcare/browser-core'\n\nimport {\n RumPerformanceEntryType,\n supportPerformanceTimingEvent\n} from './performanceObservable'\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function startPerformanceCollection(lifeCycle, configuration) {\n var cleanupTasks = []\n if (supportPerformanceObject()) {\n var performanceEntries = performance.getEntries()\n // Because the performance entry list can be quite large\n // delay the computation to prevent the SDK from blocking the main thread on init\n setTimeout(function () {\n handleRumPerformanceEntries(lifeCycle, performanceEntries)\n })\n }\n if (window.PerformanceObserver) {\n var handlePerformanceEntryList = monitor(function (entries) {\n handleRumPerformanceEntries(lifeCycle, entries.getEntries())\n })\n\n var experimentalEntries = [RumPerformanceEntryType.LAYOUT_SHIFT]\n try {\n // Experimental entries are not retrieved by performance.getEntries()\n // use a single PerformanceObserver with buffered flag by type\n // to get values that could happen before SDK init\n each(experimentalEntries, function (type) {\n var observer = new window.PerformanceObserver(\n handlePerformanceEntryList\n )\n observer.observe({\n type: type,\n buffered: true\n })\n cleanupTasks.push(function () {\n observer.disconnect()\n })\n })\n } catch (e) {}\n var mainObserver = new PerformanceObserver(handlePerformanceEntryList)\n try {\n mainObserver.observe({ entryTypes: experimentalEntries })\n cleanupTasks.push(function () {\n mainObserver.disconnect()\n })\n } catch {}\n if (supportPerformanceObject() && 'addEventListener' in performance) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n var resourncetimingbufferfullListener = addEventListener(\n performance,\n 'resourcetimingbufferfull',\n function () {\n performance.clearResourceTimings()\n }\n )\n cleanupTasks.push(resourncetimingbufferfullListener.stop)\n }\n }\n\n return {\n stop: function () {\n each(cleanupTasks, function (task) {\n return task()\n })\n }\n }\n}\n\nfunction handleRumPerformanceEntries(lifeCycle, entries) {\n var rumPerformanceEntries = entries.filter(function (entry) {\n return objectHasValue(RumPerformanceEntryType, entry.entryType)\n })\n\n if (rumPerformanceEntries.length) {\n lifeCycle.notify(\n LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED,\n rumPerformanceEntries\n )\n }\n}\n"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,kBAAkB,EAClBC,UAAU,EACVC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,QACT,yBAAyB;AAEhC,SACEC,uBAAuB,EACvBC,6BAA6B,QACxB,yBAAyB;AAChC,SAASC,wBAAwBA,CAAA,EAAG;EAClC,OAAOC,MAAM,CAACC,WAAW,KAAKC,SAAS,IAAI,YAAY,IAAID,WAAW;AACxE;AAEA,OAAO,SAASE,0BAA0BA,CAACC,SAAS,EAAEC,aAAa,EAAE;EACnE,IAAIC,YAAY,GAAG,EAAE;EACrB,IAAIP,wBAAwB,CAAC,CAAC,EAAE;IAC9B,IAAIQ,kBAAkB,GAAGN,WAAW,CAACO,UAAU,CAAC,CAAC;IACjD;IACA;IACAf,UAAU,CAAC,YAAY;MACrBgB,2BAA2B,CAACL,SAAS,EAAEG,kBAAkB,CAAC;IAC5D,CAAC,CAAC;EACJ;EACA,IAAIP,MAAM,CAACU,mBAAmB,EAAE;IAC9B,IAAIC,0BAA0B,GAAGhB,OAAO,CAAC,UAAUiB,OAAO,EAAE;MAC1DH,2BAA2B,CAACL,SAAS,EAAEQ,OAAO,CAACJ,UAAU,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,IAAIK,mBAAmB,GAAG,CAAChB,uBAAuB,CAACiB,YAAY,CAAC;IAChE,IAAI;MACF;MACA;MACA;MACA1B,IAAI,CAACyB,mBAAmB,EAAE,UAAUE,IAAI,EAAE;QACxC,IAAIC,QAAQ,GAAG,IAAIhB,MAAM,CAACU,mBAAmB,CAC3CC,0BACF,CAAC;QACDK,QAAQ,CAACC,OAAO,CAAC;UACfF,IAAI,EAAEA,IAAI;UACVG,QAAQ,EAAE;QACZ,CAAC,CAAC;QACFZ,YAAY,CAACa,IAAI,CAAC,YAAY;UAC5BH,QAAQ,CAACI,UAAU,CAAC,CAAC;QACvB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;IACb,IAAIC,YAAY,GAAG,IAAIZ,mBAAmB,CAACC,0BAA0B,CAAC;IACtE,IAAI;MACFW,YAAY,CAACL,OAAO,CAAC;QAAEM,UAAU,EAAEV;MAAoB,CAAC,CAAC;MACzDP,YAAY,CAACa,IAAI,CAAC,YAAY;QAC5BG,YAAY,CAACF,UAAU,CAAC,CAAC;MAC3B,CAAC,CAAC;IACJ,CAAC,CAAC,OAAAI,OAAA,EAAM,CAAC;IACT,IAAIzB,wBAAwB,CAAC,CAAC,IAAI,kBAAkB,IAAIE,WAAW,EAAE;MACnE;MACA,IAAIwB,iCAAiC,GAAG/B,gBAAgB,CACtDO,WAAW,EACX,0BAA0B,EAC1B,YAAY;QACVA,WAAW,CAACyB,oBAAoB,CAAC,CAAC;MACpC,CACF,CAAC;MACDpB,YAAY,CAACa,IAAI,CAACM,iCAAiC,CAACE,IAAI,CAAC;IAC3D;EACF;EAEA,OAAO;IACLA,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBvC,IAAI,CAACkB,YAAY,EAAE,UAAUsB,IAAI,EAAE;QACjC,OAAOA,IAAI,CAAC,CAAC;MACf,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAASnB,2BAA2BA,CAACL,SAAS,EAAEQ,OAAO,EAAE;EACvD,IAAIiB,qBAAqB,GAAGjB,OAAO,CAACkB,MAAM,CAAC,UAAUC,KAAK,EAAE;IAC1D,OAAOnC,cAAc,CAACC,uBAAuB,EAAEkC,KAAK,CAACC,SAAS,CAAC;EACjE,CAAC,CAAC;EAEF,IAAIH,qBAAqB,CAACI,MAAM,EAAE;IAChC7B,SAAS,CAAC8B,MAAM,CACd1C,kBAAkB,CAAC2C,6BAA6B,EAChDN,qBACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addEventListener, Observable, setTimeout, clearTimeout, monitor, includes } from '@cloudcare/browser-core';
|
|
2
2
|
import { isAllowedRequestUrl, hasValidResourceEntryDuration } from './rumEventsCollection/resource/resourceUtils';
|
|
3
|
-
|
|
3
|
+
import { retrieveFirstInputTiming } from './firstInputPolyfill';
|
|
4
4
|
// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary
|
|
5
5
|
// string is an expected performance entry
|
|
6
6
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -70,8 +70,18 @@ export function createPerformanceObservable(configuration, options) {
|
|
|
70
70
|
}
|
|
71
71
|
isObserverInitializing = false;
|
|
72
72
|
manageResourceTimingBufferFull(configuration);
|
|
73
|
+
var stopFirstInputTiming;
|
|
74
|
+
if (!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) && options.type === RumPerformanceEntryType.FIRST_INPUT) {
|
|
75
|
+
var _retrieveFirstInputTiming = retrieveFirstInputTiming(configuration, function (timing) {
|
|
76
|
+
handlePerformanceEntries([timing]);
|
|
77
|
+
});
|
|
78
|
+
stopFirstInputTiming = _retrieveFirstInputTiming.stop;
|
|
79
|
+
}
|
|
73
80
|
return function () {
|
|
74
81
|
observer.disconnect();
|
|
82
|
+
if (stopFirstInputTiming) {
|
|
83
|
+
stopFirstInputTiming();
|
|
84
|
+
}
|
|
75
85
|
clearTimeout(timeoutId);
|
|
76
86
|
};
|
|
77
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performanceObservable.js","names":["addEventListener","Observable","setTimeout","clearTimeout","monitor","includes","isAllowedRequestUrl","hasValidResourceEntryDuration","RumPerformanceEntryType","EVENT","FIRST_INPUT","LARGEST_CONTENTFUL_PAINT","LAYOUT_SHIFT","LONG_TASK","LONG_ANIMATION_FRAME","NAVIGATION","PAINT","RESOURCE","createPerformanceObservable","configuration","options","observable","window","PerformanceObserver","handlePerformanceEntries","entries","rumPerformanceEntries","filterRumPerformanceEntries","length","notify","timeoutId","isObserverInitializing","observer","getEntries","observe","_unused","fallbackSupportedEntryTypes","type","buffered","performance","getEntriesByType","entryTypes","_unused2","manageResourceTimingBufferFull","
|
|
1
|
+
{"version":3,"file":"performanceObservable.js","names":["addEventListener","Observable","setTimeout","clearTimeout","monitor","includes","isAllowedRequestUrl","hasValidResourceEntryDuration","retrieveFirstInputTiming","RumPerformanceEntryType","EVENT","FIRST_INPUT","LARGEST_CONTENTFUL_PAINT","LAYOUT_SHIFT","LONG_TASK","LONG_ANIMATION_FRAME","NAVIGATION","PAINT","RESOURCE","createPerformanceObservable","configuration","options","observable","window","PerformanceObserver","handlePerformanceEntries","entries","rumPerformanceEntries","filterRumPerformanceEntries","length","notify","timeoutId","isObserverInitializing","observer","getEntries","observe","_unused","fallbackSupportedEntryTypes","type","buffered","performance","getEntriesByType","entryTypes","_unused2","manageResourceTimingBufferFull","stopFirstInputTiming","supportPerformanceTimingEvent","_retrieveFirstInputTiming","timing","stop","disconnect","resourceTimingBufferFullListener","supportPerformanceObject","clearResourceTimings","undefined","entryType","supportedEntryTypes","filter","entry","isForbiddenResource","name"],"sources":["../../src/domain/performanceObservable.js"],"sourcesContent":["import {\n addEventListener,\n Observable,\n setTimeout,\n clearTimeout,\n monitor,\n includes\n} from '@cloudcare/browser-core'\nimport {\n isAllowedRequestUrl,\n hasValidResourceEntryDuration\n} from './rumEventsCollection/resource/resourceUtils'\nimport { retrieveFirstInputTiming } from './firstInputPolyfill'\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected performance entry\n// eslint-disable-next-line no-restricted-syntax\nexport var RumPerformanceEntryType = {\n EVENT: 'event',\n FIRST_INPUT: 'first-input',\n LARGEST_CONTENTFUL_PAINT: 'largest-contentful-paint',\n LAYOUT_SHIFT: 'layout-shift',\n LONG_TASK: 'longtask',\n LONG_ANIMATION_FRAME: 'long-animation-frame',\n NAVIGATION: 'navigation',\n PAINT: 'paint',\n RESOURCE: 'resource'\n}\n\nexport function createPerformanceObservable(configuration, options) {\n return new Observable(function (observable) {\n if (!window.PerformanceObserver) {\n return\n }\n var handlePerformanceEntries = function (entries) {\n var rumPerformanceEntries = filterRumPerformanceEntries(\n configuration,\n entries\n )\n if (rumPerformanceEntries.length > 0) {\n observable.notify(rumPerformanceEntries)\n }\n }\n\n var timeoutId\n var isObserverInitializing = true\n\n const observer = new PerformanceObserver(\n monitor(function (entries) {\n // In Safari the performance observer callback is synchronous.\n // Because the buffered performance entry list can be quite large we delay the computation to prevent the SDK from blocking the main thread on init\n if (isObserverInitializing) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(entries.getEntries())\n })\n } else {\n handlePerformanceEntries(entries.getEntries())\n }\n })\n )\n\n try {\n observer.observe(options)\n } catch {\n // Some old browser versions (<= chrome 74 ) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to getEntriesByType and PerformanceObserver with entryTypes\n // TODO: remove this fallback in the next major version\n var fallbackSupportedEntryTypes = [\n RumPerformanceEntryType.RESOURCE,\n RumPerformanceEntryType.NAVIGATION,\n RumPerformanceEntryType.LONG_TASK,\n RumPerformanceEntryType.PAINT\n ]\n if (includes(fallbackSupportedEntryTypes, options.type)) {\n if (options.buffered) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(performance.getEntriesByType(options.type))\n })\n }\n try {\n observer.observe({ entryTypes: [options.type] })\n } catch {\n // Old versions of Safari are throwing \"entryTypes contained only unsupported types\"\n // errors when observing only unsupported entry types.\n //\n // We could use `supportPerformanceTimingEvent` to make sure we don't invoke\n // `observer.observe` with an unsupported entry type, but Safari 11 and 12 don't support\n // `Performance.supportedEntryTypes`, so doing so would lose support for these versions\n // even if they do support the entry type.\n return\n }\n }\n }\n isObserverInitializing = false\n\n manageResourceTimingBufferFull(configuration)\n var stopFirstInputTiming\n if (\n !supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) &&\n options.type === RumPerformanceEntryType.FIRST_INPUT\n ) {\n var _retrieveFirstInputTiming = retrieveFirstInputTiming(\n configuration,\n function (timing) {\n handlePerformanceEntries([timing])\n }\n )\n stopFirstInputTiming = _retrieveFirstInputTiming.stop\n }\n return function () {\n observer.disconnect()\n if (stopFirstInputTiming) {\n stopFirstInputTiming()\n }\n clearTimeout(timeoutId)\n }\n })\n}\n\nvar resourceTimingBufferFullListener\nfunction manageResourceTimingBufferFull(configuration) {\n if (\n !resourceTimingBufferFullListener &&\n supportPerformanceObject() &&\n 'addEventListener' in performance\n ) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n resourceTimingBufferFullListener = addEventListener(\n performance,\n 'resourcetimingbufferfull',\n function () {\n performance.clearResourceTimings()\n }\n )\n }\n return function () {\n resourceTimingBufferFullListener && resourceTimingBufferFullListener.stop()\n }\n}\n\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function supportPerformanceTimingEvent(entryType) {\n return (\n window.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes !== undefined &&\n PerformanceObserver.supportedEntryTypes.includes(entryType)\n )\n}\n\nfunction filterRumPerformanceEntries(configuration, entries) {\n return entries.filter(function (entry) {\n return !isForbiddenResource(configuration, entry)\n })\n}\n\nfunction isForbiddenResource(configuration, entry) {\n return (\n entry.entryType === RumPerformanceEntryType.RESOURCE &&\n (!isAllowedRequestUrl(configuration, entry.name) ||\n !hasValidResourceEntryDuration(entry))\n )\n}\n"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,OAAO,EACPC,QAAQ,QACH,yBAAyB;AAChC,SACEC,mBAAmB,EACnBC,6BAA6B,QACxB,8CAA8C;AACrD,SAASC,wBAAwB,QAAQ,sBAAsB;AAC/D;AACA;AACA;AACA,OAAO,IAAIC,uBAAuB,GAAG;EACnCC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE,aAAa;EAC1BC,wBAAwB,EAAE,0BAA0B;EACpDC,YAAY,EAAE,cAAc;EAC5BC,SAAS,EAAE,UAAU;EACrBC,oBAAoB,EAAE,sBAAsB;EAC5CC,UAAU,EAAE,YAAY;EACxBC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,SAASC,2BAA2BA,CAACC,aAAa,EAAEC,OAAO,EAAE;EAClE,OAAO,IAAIpB,UAAU,CAAC,UAAUqB,UAAU,EAAE;IAC1C,IAAI,CAACC,MAAM,CAACC,mBAAmB,EAAE;MAC/B;IACF;IACA,IAAIC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAaC,OAAO,EAAE;MAChD,IAAIC,qBAAqB,GAAGC,2BAA2B,CACrDR,aAAa,EACbM,OACF,CAAC;MACD,IAAIC,qBAAqB,CAACE,MAAM,GAAG,CAAC,EAAE;QACpCP,UAAU,CAACQ,MAAM,CAACH,qBAAqB,CAAC;MAC1C;IACF,CAAC;IAED,IAAII,SAAS;IACb,IAAIC,sBAAsB,GAAG,IAAI;IAEjC,IAAMC,QAAQ,GAAG,IAAIT,mBAAmB,CACtCpB,OAAO,CAAC,UAAUsB,OAAO,EAAE;MACzB;MACA;MACA,IAAIM,sBAAsB,EAAE;QAC1BD,SAAS,GAAG7B,UAAU,CAAC,YAAY;UACjCuB,wBAAwB,CAACC,OAAO,CAACQ,UAAU,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC;MACJ,CAAC,MAAM;QACLT,wBAAwB,CAACC,OAAO,CAACQ,UAAU,CAAC,CAAC,CAAC;MAChD;IACF,CAAC,CACH,CAAC;IAED,IAAI;MACFD,QAAQ,CAACE,OAAO,CAACd,OAAO,CAAC;IAC3B,CAAC,CAAC,OAAAe,OAAA,EAAM;MACN;MACA;MACA;MACA,IAAIC,2BAA2B,GAAG,CAChC5B,uBAAuB,CAACS,QAAQ,EAChCT,uBAAuB,CAACO,UAAU,EAClCP,uBAAuB,CAACK,SAAS,EACjCL,uBAAuB,CAACQ,KAAK,CAC9B;MACD,IAAIZ,QAAQ,CAACgC,2BAA2B,EAAEhB,OAAO,CAACiB,IAAI,CAAC,EAAE;QACvD,IAAIjB,OAAO,CAACkB,QAAQ,EAAE;UACpBR,SAAS,GAAG7B,UAAU,CAAC,YAAY;YACjCuB,wBAAwB,CAACe,WAAW,CAACC,gBAAgB,CAACpB,OAAO,CAACiB,IAAI,CAAC,CAAC;UACtE,CAAC,CAAC;QACJ;QACA,IAAI;UACFL,QAAQ,CAACE,OAAO,CAAC;YAAEO,UAAU,EAAE,CAACrB,OAAO,CAACiB,IAAI;UAAE,CAAC,CAAC;QAClD,CAAC,CAAC,OAAAK,QAAA,EAAM;UACN;UACA;UACA;UACA;UACA;UACA;UACA;UACA;QACF;MACF;IACF;IACAX,sBAAsB,GAAG,KAAK;IAE9BY,8BAA8B,CAACxB,aAAa,CAAC;IAC7C,IAAIyB,oBAAoB;IACxB,IACE,CAACC,6BAA6B,CAACrC,uBAAuB,CAACE,WAAW,CAAC,IACnEU,OAAO,CAACiB,IAAI,KAAK7B,uBAAuB,CAACE,WAAW,EACpD;MACA,IAAIoC,yBAAyB,GAAGvC,wBAAwB,CACtDY,aAAa,EACb,UAAU4B,MAAM,EAAE;QAChBvB,wBAAwB,CAAC,CAACuB,MAAM,CAAC,CAAC;MACpC,CACF,CAAC;MACDH,oBAAoB,GAAGE,yBAAyB,CAACE,IAAI;IACvD;IACA,OAAO,YAAY;MACjBhB,QAAQ,CAACiB,UAAU,CAAC,CAAC;MACrB,IAAIL,oBAAoB,EAAE;QACxBA,oBAAoB,CAAC,CAAC;MACxB;MACA1C,YAAY,CAAC4B,SAAS,CAAC;IACzB,CAAC;EACH,CAAC,CAAC;AACJ;AAEA,IAAIoB,gCAAgC;AACpC,SAASP,8BAA8BA,CAACxB,aAAa,EAAE;EACrD,IACE,CAAC+B,gCAAgC,IACjCC,wBAAwB,CAAC,CAAC,IAC1B,kBAAkB,IAAIZ,WAAW,EACjC;IACA;IACAW,gCAAgC,GAAGnD,gBAAgB,CACjDwC,WAAW,EACX,0BAA0B,EAC1B,YAAY;MACVA,WAAW,CAACa,oBAAoB,CAAC,CAAC;IACpC,CACF,CAAC;EACH;EACA,OAAO,YAAY;IACjBF,gCAAgC,IAAIA,gCAAgC,CAACF,IAAI,CAAC,CAAC;EAC7E,CAAC;AACH;AAEA,SAASG,wBAAwBA,CAAA,EAAG;EAClC,OAAO7B,MAAM,CAACiB,WAAW,KAAKc,SAAS,IAAI,YAAY,IAAId,WAAW;AACxE;AAEA,OAAO,SAASM,6BAA6BA,CAACS,SAAS,EAAE;EACvD,OACEhC,MAAM,CAACC,mBAAmB,IAC1BA,mBAAmB,CAACgC,mBAAmB,KAAKF,SAAS,IACrD9B,mBAAmB,CAACgC,mBAAmB,CAACnD,QAAQ,CAACkD,SAAS,CAAC;AAE/D;AAEA,SAAS3B,2BAA2BA,CAACR,aAAa,EAAEM,OAAO,EAAE;EAC3D,OAAOA,OAAO,CAAC+B,MAAM,CAAC,UAAUC,KAAK,EAAE;IACrC,OAAO,CAACC,mBAAmB,CAACvC,aAAa,EAAEsC,KAAK,CAAC;EACnD,CAAC,CAAC;AACJ;AAEA,SAASC,mBAAmBA,CAACvC,aAAa,EAAEsC,KAAK,EAAE;EACjD,OACEA,KAAK,CAACH,SAAS,KAAK9C,uBAAuB,CAACS,QAAQ,KACnD,CAACZ,mBAAmB,CAACc,aAAa,EAAEsC,KAAK,CAACE,IAAI,CAAC,IAC9C,CAACrD,6BAA6B,CAACmD,KAAK,CAAC,CAAC;AAE5C","ignoreList":[]}
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import { getRelativeTime, isNumber } from '@cloudcare/browser-core';
|
|
2
|
-
|
|
1
|
+
import { getRelativeTime, isNumber, assign } from '@cloudcare/browser-core';
|
|
2
|
+
import { supportPerformanceTimingEvent, RumPerformanceEntryType } from './performanceObservable';
|
|
3
|
+
export function getNavigationEntry() {
|
|
4
|
+
if (supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)) {
|
|
5
|
+
var navigationEntry = performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];
|
|
6
|
+
if (navigationEntry) {
|
|
7
|
+
return navigationEntry;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
var timings = computeTimingsFromDeprecatedPerformanceTiming();
|
|
11
|
+
var entry = assign({
|
|
12
|
+
entryType: RumPerformanceEntryType.NAVIGATION,
|
|
13
|
+
initiatorType: 'navigation',
|
|
14
|
+
name: window.location.href,
|
|
15
|
+
startTime: 0,
|
|
16
|
+
duration: timings.responseEnd,
|
|
17
|
+
decodedBodySize: 0,
|
|
18
|
+
encodedBodySize: 0,
|
|
19
|
+
transferSize: 0,
|
|
20
|
+
renderBlockingStatus: 'non-blocking',
|
|
21
|
+
toJSON: function toJSON() {
|
|
22
|
+
return assign({}, entry, {
|
|
23
|
+
toJSON: undefined
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}, timings);
|
|
27
|
+
return entry;
|
|
28
|
+
}
|
|
29
|
+
export function computeTimingsFromDeprecatedPerformanceTiming() {
|
|
3
30
|
var result = {};
|
|
4
31
|
var timing = performance.timing;
|
|
5
32
|
for (var key in timing) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performanceUtils.js","names":["getRelativeTime","isNumber","
|
|
1
|
+
{"version":3,"file":"performanceUtils.js","names":["getRelativeTime","isNumber","assign","supportPerformanceTimingEvent","RumPerformanceEntryType","getNavigationEntry","NAVIGATION","navigationEntry","performance","getEntriesByType","timings","computeTimingsFromDeprecatedPerformanceTiming","entry","entryType","initiatorType","name","window","location","href","startTime","duration","responseEnd","decodedBodySize","encodedBodySize","transferSize","renderBlockingStatus","toJSON","undefined","result","timing","key","numberKey","timingElement"],"sources":["../../src/domain/performanceUtils.js"],"sourcesContent":["import { getRelativeTime, isNumber, assign } from '@cloudcare/browser-core'\nimport {\n supportPerformanceTimingEvent,\n RumPerformanceEntryType\n} from './performanceObservable'\n\nexport function getNavigationEntry() {\n if (supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)) {\n var navigationEntry = performance.getEntriesByType(\n RumPerformanceEntryType.NAVIGATION\n )[0]\n if (navigationEntry) {\n return navigationEntry\n }\n }\n\n var timings = computeTimingsFromDeprecatedPerformanceTiming()\n var entry = assign(\n {\n entryType: RumPerformanceEntryType.NAVIGATION,\n initiatorType: 'navigation',\n name: window.location.href,\n startTime: 0,\n duration: timings.responseEnd,\n decodedBodySize: 0,\n encodedBodySize: 0,\n transferSize: 0,\n renderBlockingStatus: 'non-blocking',\n toJSON: function () {\n return assign({}, entry, { toJSON: undefined })\n }\n },\n timings\n )\n return entry\n}\n\nexport function computeTimingsFromDeprecatedPerformanceTiming() {\n var result = {}\n var timing = performance.timing\n\n for (var key in timing) {\n if (isNumber(timing[key])) {\n var numberKey = key\n var timingElement = timing[numberKey]\n result[numberKey] =\n timingElement === 0 ? 0 : getRelativeTime(timingElement)\n }\n }\n return result\n}\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,yBAAyB;AAC3E,SACEC,6BAA6B,EAC7BC,uBAAuB,QAClB,yBAAyB;AAEhC,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,IAAIF,6BAA6B,CAACC,uBAAuB,CAACE,UAAU,CAAC,EAAE;IACrE,IAAIC,eAAe,GAAGC,WAAW,CAACC,gBAAgB,CAChDL,uBAAuB,CAACE,UAC1B,CAAC,CAAC,CAAC,CAAC;IACJ,IAAIC,eAAe,EAAE;MACnB,OAAOA,eAAe;IACxB;EACF;EAEA,IAAIG,OAAO,GAAGC,6CAA6C,CAAC,CAAC;EAC7D,IAAIC,KAAK,GAAGV,MAAM,CAChB;IACEW,SAAS,EAAET,uBAAuB,CAACE,UAAU;IAC7CQ,aAAa,EAAE,YAAY;IAC3BC,IAAI,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAI;IAC1BC,SAAS,EAAE,CAAC;IACZC,QAAQ,EAAEV,OAAO,CAACW,WAAW;IAC7BC,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE,CAAC;IACfC,oBAAoB,EAAE,cAAc;IACpCC,MAAM,EAAE,SAAAA,OAAA,EAAY;MAClB,OAAOxB,MAAM,CAAC,CAAC,CAAC,EAAEU,KAAK,EAAE;QAAEc,MAAM,EAAEC;MAAU,CAAC,CAAC;IACjD;EACF,CAAC,EACDjB,OACF,CAAC;EACD,OAAOE,KAAK;AACd;AAEA,OAAO,SAASD,6CAA6CA,CAAA,EAAG;EAC9D,IAAIiB,MAAM,GAAG,CAAC,CAAC;EACf,IAAIC,MAAM,GAAGrB,WAAW,CAACqB,MAAM;EAE/B,KAAK,IAAIC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI5B,QAAQ,CAAC4B,MAAM,CAACC,GAAG,CAAC,CAAC,EAAE;MACzB,IAAIC,SAAS,GAAGD,GAAG;MACnB,IAAIE,aAAa,GAAGH,MAAM,CAACE,SAAS,CAAC;MACrCH,MAAM,CAACG,SAAS,CAAC,GACfC,aAAa,KAAK,CAAC,GAAG,CAAC,GAAGhC,eAAe,CAACgC,aAAa,CAAC;IAC5D;EACF;EACA,OAAOJ,MAAM;AACf","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { display, includes, setTimeout, addEventListener, addTelemetryError, ONE_SECOND } from '@cloudcare/browser-core';
|
|
2
2
|
export var INITIALIZATION_TIME_OUT_DELAY = 10 * ONE_SECOND;
|
|
3
3
|
export function createDeflateWorker() {
|
|
4
|
-
return new Worker(URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t,a){var n=\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(!n){if(Array.isArray(t)||(n=function(t,a){if(!t)return;if(\"string\"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===n&&t.constructor&&(n=t.constructor.name);if(\"Map\"===n||\"Set\"===n)return Array.from(t);if(\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t))||a&&t&&\"number\"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var s,_=!0,h=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return _=t.done,t},e:function(t){h=!0,s=t},f:function(){try{_||null==n.return||n.return()}finally{if(h)throw s}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}function a(e){var a,n=e.reduce((function(t,e){return t+e.length}),0),r=new Uint8Array(n),i=0,s=t(e);try{for(s.s();!(a=s.n()).done;){var _=a.value;r.set(_,i),i+=_.length}}catch(t){s.e(t)}finally{s.f()}return r}function n(t){for(var e=t.length;--e>=0;)t[e]=0}var r=256,i=286,s=30,_=15,h=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=new Array(576);n(u);var f=new Array(60);n(f);var c=new Array(512);n(c);var p=new Array(256);n(p);var g=new Array(29);n(g);var v,w,b,m=new Array(s);function y(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(m);var z=function(t){return t<256?c[t]:c[256+(t>>>7)]},A=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,A(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},E=function(t,e,a){x(t,a[2*e],a[2*e+1])},Z=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},S=function(t,e,a){var n,r,i=new Array(16),s=0;for(n=1;n<=_;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=Z(i[h]++,h))}},U=function(t){var e;for(e=0;e<i;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},R=function(t){t.bi_valid>8?A(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},L=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},F=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&L(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!L(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},T=function(t,e,a){var n,i,s,_,o=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===n?E(t,i,e):(s=p[i],E(t,s+r+1,e),0!==(_=h[s])&&(i-=g[s],x(t,i,_)),n--,s=z(n),E(t,s,a),0!==(_=l[s])&&(n-=m[s],x(t,n,_)))}while(o<t.last_lit);E(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)F(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],F(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,F(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(i=0;i<=_;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(i=p,g++),l[2*n+1]=i,n>o||(t.bl_count[i]++,s=0,n>=c&&(s=f[n-c]),h=l[2*n],t.opt_len+=h*(i+s),u&&(t.static_len+=h*(d[2*n+1]+s)));if(0!==g){do{for(i=p-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(i=p;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),S(i,o,t.bl_count)},O=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_<h&&r===s||(_<l?t.bl_tree[2*r]+=_:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):_<=10?t.bl_tree[34]++:t.bl_tree[36]++,_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))},N=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_<h&&r===s)){if(_<l)do{E(t,r,t.bl_tree)}while(0!=--_);else 0!==r?(r!==i&&(E(t,r,t.bl_tree),_--),E(t,16,t.bl_tree),x(t,_-3,2)):_<=10?(E(t,17,t.bl_tree),x(t,_-3,3)):(E(t,18,t.bl_tree),x(t,_-11,7));_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}},D=!1,C=function(t,e,a,n){x(t,0+(n?1:0),3),function(t,e,a,n){R(t),n&&(A(t,a),A(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},M=function(t,e,a,n){var i,s,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<r;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=a+5,a+4<=i&&-1!==e?C(t,e,a,n):4===t.strategy||s===i?(x(t,2+(n?1:0),3),T(t,u,f)):(x(t,4+(n?1:0),3),function(t,e,a,n){var r;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),r=0;r<n;r++)x(t,t.bl_tree[2*d[r]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),T(t,t.dyn_ltree,t.dyn_dtree)),U(t),n&&R(t)},B={_tr_init:function(t){D||(!function(){var t,e,a,n,r,d=new Array(16);for(a=0,n=0;n<28;n++)for(g[n]=a,t=0;t<1<<h[n];t++)p[a++]=n;for(p[a-1]=n,r=0,n=0;n<16;n++)for(m[n]=r,t=0;t<1<<l[n];t++)c[r++]=n;for(r>>=7;n<s;n++)for(m[n]=r<<7,t=0;t<1<<l[n]-7;t++)c[256+r++]=n;for(e=0;e<=_;e++)d[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,d[8]++;for(;t<=255;)u[2*t+1]=9,t++,d[9]++;for(;t<=279;)u[2*t+1]=7,t++,d[7]++;for(;t<=287;)u[2*t+1]=8,t++,d[8]++;for(S(u,287,d),t=0;t<s;t++)f[2*t+1]=5,f[2*t]=Z(t,5);v=new y(u,h,257,i,_),w=new y(f,l,0,s,_),b=new y(new Array(0),o,0,19,7)}(),D=!0),t.l_desc=new k(t.dyn_ltree,v),t.d_desc=new k(t.dyn_dtree,w),t.bl_desc=new k(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,U(t)},_tr_stored_block:C,_tr_flush_block:M,_tr_tally:function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(p[a]+r+1)]++,t.dyn_dtree[2*z(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){x(t,2,3),E(t,256,u),function(t){16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},H=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},Y=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),K=function(t,e,a,n){var r=Y,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},P={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},G=B._tr_init,X=B._tr_stored_block,W=B._tr_flush_block,$=B._tr_tally,q=B._tr_align,J=j.Z_NO_FLUSH,Q=j.Z_PARTIAL_FLUSH,V=j.Z_FULL_FLUSH,tt=j.Z_FINISH,et=j.Z_BLOCK,at=j.Z_OK,nt=j.Z_STREAM_END,rt=j.Z_STREAM_ERROR,it=j.Z_DATA_ERROR,st=j.Z_BUF_ERROR,_t=j.Z_DEFAULT_COMPRESSION,ht=j.Z_FILTERED,lt=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,dt=j.Z_FIXED,ut=j.Z_DEFAULT_STRATEGY,ft=j.Z_UNKNOWN,ct=j.Z_DEFLATED,pt=258,gt=262,vt=103,wt=113,bt=666,mt=function(t,e){return t.msg=P[e],e},yt=function(t){return(t<<1)-(t>4?9:0)},kt=function(t){for(var e=t.length;--e>=0;)t[e]=0},zt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},At=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},xt=function(t,e){W(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},Et=function(t,e){t.pending_buf[t.pending++]=e},Zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},St=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-gt?t.strstart-(t.w_size-gt):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+pt,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<u);if(n=pt-(u-i),i=u-pt,n>s){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Ut=function(t){var e,a,n,r,i,s,_,h,l,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-gt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=H(s.adler,_,o,h):2===s.state.wrap&&(s.adler=K(s.adler,_,o,h)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=zt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=zt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<gt&&0!==t.strm.avail_in)},Rt=function(t,e){for(var a,n;;){if(t.lookahead<gt){if(Ut(t),t.lookahead<gt&&e===J)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-gt&&(t.match_length=St(t,a)),t.match_length>=3)if(n=$(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=zt(t,t.ins_h,t.window[t.strstart+1]);else n=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2},Lt=function(t,e){for(var a,n,r;;){if(t.lookahead<gt){if(Ut(t),t.lookahead<gt&&e===J)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-gt&&(t.match_length=St(t,a),t.match_length<=5&&(t.strategy===ht||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=$(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(xt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=$(t,0,t.window[t.strstart-1]))&&xt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=$(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2};function Ft(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Tt=[new Ft(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ut(t),0===t.lookahead&&e===J)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,xt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-gt&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(xt(t,!1),t.strm.avail_out),1)})),new Ft(4,4,8,4,Rt),new Ft(4,5,16,8,Rt),new Ft(4,6,32,32,Rt),new Ft(4,4,16,16,Lt),new Ft(8,16,32,32,Lt),new Ft(8,16,128,128,Lt),new Ft(8,32,128,256,Lt),new Ft(32,128,258,1024,Lt),new Ft(32,258,258,4096,Lt)];function It(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),kt(this.dyn_ltree),kt(this.dyn_dtree),kt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),kt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),kt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return mt(t,rt);t.total_in=t.total_out=0,t.data_type=ft;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=J,G(e),at},Nt=function(t){var e,a=Ot(t);return a===at&&((e=t.state).window_size=2*e.w_size,kt(e.head),e.max_lazy_match=Tt[e.level].max_lazy,e.good_match=Tt[e.level].good_length,e.nice_match=Tt[e.level].nice_length,e.max_chain_length=Tt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Dt=function(t,e,a,n,r,i){if(!t)return rt;var s=1;if(e===_t&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==ct||n<8||n>15||e<0||e>9||i<0||i>dt)return mt(t,rt);8===n&&(n=9);var _=new It;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new Uint8Array(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=e,_.strategy=i,_.method=a,Nt(t)},Ct={deflateInit:function(t,e){return Dt(t,e,ct,15,8,ut)},deflateInit2:Dt,deflateReset:Nt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?rt:(t.state.gzhead=e,at):rt},deflate:function(t,e){var a,n;if(!t||!t.state||e>et||e<0)return t?mt(t,rt):rt;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===bt&&e!==tt)return mt(t,0===t.avail_out?st:rt);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Et(r,31),Et(r,139),Et(r,8),r.gzhead?(Et(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Et(r,255&r.gzhead.time),Et(r,r.gzhead.time>>8&255),Et(r,r.gzhead.time>>16&255),Et(r,r.gzhead.time>>24&255),Et(r,9===r.level?2:r.strategy>=lt||r.level<2?4:0),Et(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Et(r,255&r.gzhead.extra.length),Et(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=K(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Et(r,0),Et(r,0),Et(r,0),Et(r,0),Et(r,0),Et(r,9===r.level?2:r.strategy>=lt||r.level<2?4:0),Et(r,3),r.status=wt);else{var s=ct+(r.w_bits-8<<4)<<8;s|=(r.strategy>=lt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=wt,Zt(r,s),0!==r.strstart&&(Zt(r,t.adler>>>16),Zt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending!==r.pending_buf_size));)Et(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Et(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Et(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=vt)}else r.status=vt;if(r.status===vt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&At(t),r.pending+2<=r.pending_buf_size&&(Et(r,255&t.adler),Et(r,t.adler>>8&255),t.adler=0,r.status=wt)):r.status=wt),0!==r.pending){if(At(t),0===t.avail_out)return r.last_flush=-1,at}else if(0===t.avail_in&&yt(e)<=yt(i)&&e!==tt)return mt(t,st);if(r.status===bt&&0!==t.avail_in)return mt(t,st);if(0!==t.avail_in||0!==r.lookahead||e!==J&&r.status!==bt){var _=r.strategy===lt?function(t,e){for(var a;;){if(0===t.lookahead&&(Ut(t),0===t.lookahead)){if(e===J)return 1;break}if(t.match_length=0,a=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===ot?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=pt){if(Ut(t),t.lookahead<=pt&&e===J)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+pt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=pt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=$(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Tt[r.level].func(r,e);if(3!==_&&4!==_||(r.status=bt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),at;if(2===_&&(e===Q?q(r):e!==et&&(X(r,0,0,!1),e===V&&(kt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),0===t.avail_out))return r.last_flush=-1,at}return e!==tt?at:r.wrap<=0?nt:(2===r.wrap?(Et(r,255&t.adler),Et(r,t.adler>>8&255),Et(r,t.adler>>16&255),Et(r,t.adler>>24&255),Et(r,255&t.total_in),Et(r,t.total_in>>8&255),Et(r,t.total_in>>16&255),Et(r,t.total_in>>24&255)):(Zt(r,t.adler>>>16),Zt(r,65535&t.adler)),At(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?at:nt)},deflateEnd:function(t){if(!t||!t.state)return rt;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==vt&&e!==wt&&e!==bt?mt(t,rt):(t.state=null,e===wt?mt(t,it):at)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return rt;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return rt;if(1===r&&(t.adler=H(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(kt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Ut(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=zt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Ut(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=_,t.input=h,t.avail_in=s,n.wrap=r,at},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Mt=new Uint8Array(256),Bt=0;Bt<256;Bt++)Mt[Bt]=Bt>=252?6:Bt>=248?5:Bt>=240?4:Bt>=224?3:Bt>=192?2:1;Mt[254]=Mt[254]=1;var Ht=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Yt=Object.prototype.toString,Kt=j.Z_NO_FLUSH,Pt=j.Z_SYNC_FLUSH,jt=j.Z_FULL_FLUSH,Gt=j.Z_FINISH,Xt=j.Z_OK,Wt=j.Z_STREAM_END,$t=j.Z_DEFAULT_COMPRESSION,qt=j.Z_DEFAULT_STRATEGY,Jt=j.Z_DEFLATED;function Qt(){this.options={level:$t,method:Jt,chunkSize:16384,windowBits:15,memLevel:8,strategy:qt};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ht,this.strm.avail_out=0;var e=Ct.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==Xt)throw new Error(P[e]);if(t.header&&Ct.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Yt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Ct.deflateSetDictionary(this.strm,a))!==Xt)throw new Error(P[e]);this._dict_set=!0}}function Vt(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function te(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}Qt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Gt:Kt,\"[object ArrayBuffer]\"===Yt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Pt||n===jt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Ct.deflate(r,n))===Wt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Ct.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Xt;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Qt.prototype.onData=function(t){this.chunks.push(t)},Qt.prototype.onEnd=function(t){t===Xt&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,_=t.length;i<_;i++){var h=t[i];r.set(h,s),s+=h.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(t){void 0===t&&(t=self);try{var e=new Map;t.addEventListener(\"message\",(function(n){try{var r=function(t,e){switch(e.action){case\"init\":return{type:\"initialized\",version:\"3.1.22\"};case\"write\":var n=t.get(e.streamId);n||(n=new Qt,t.set(e.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,_=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),_+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(_),i=0,r=0;i<_;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(e.data);return n.push(i,j.Z_SYNC_FLUSH),{type:\"wrote\",id:e.id,streamId:e.streamId,result:a(n.chunks.slice(r)),trailer:te(n),additionalBytesCount:i.length};case\"reset\":t.delete(e.streamId)}}(e,n.data);r&&t.postMessage(r)}catch(e){Vt(t,e,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(e){Vt(t,e)}}()}();"])));
|
|
4
|
+
return new Worker(URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t,a){var n=\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(!n){if(Array.isArray(t)||(n=function(t,a){if(!t)return;if(\"string\"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===n&&t.constructor&&(n=t.constructor.name);if(\"Map\"===n||\"Set\"===n)return Array.from(t);if(\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t))||a&&t&&\"number\"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var s,_=!0,h=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return _=t.done,t},e:function(t){h=!0,s=t},f:function(){try{_||null==n.return||n.return()}finally{if(h)throw s}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}function a(e){var a,n=e.reduce((function(t,e){return t+e.length}),0),r=new Uint8Array(n),i=0,s=t(e);try{for(s.s();!(a=s.n()).done;){var _=a.value;r.set(_,i),i+=_.length}}catch(t){s.e(t)}finally{s.f()}return r}function n(t){for(var e=t.length;--e>=0;)t[e]=0}var r=256,i=286,s=30,_=15,h=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=new Array(576);n(u);var f=new Array(60);n(f);var c=new Array(512);n(c);var p=new Array(256);n(p);var g=new Array(29);n(g);var v,w,b,m=new Array(s);function y(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(m);var z=function(t){return t<256?c[t]:c[256+(t>>>7)]},A=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,A(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},E=function(t,e,a){x(t,a[2*e],a[2*e+1])},Z=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},S=function(t,e,a){var n,r,i=new Array(16),s=0;for(n=1;n<=_;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=Z(i[h]++,h))}},U=function(t){var e;for(e=0;e<i;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},R=function(t){t.bi_valid>8?A(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},L=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},F=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&L(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!L(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},T=function(t,e,a){var n,i,s,_,o=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===n?E(t,i,e):(s=p[i],E(t,s+r+1,e),0!==(_=h[s])&&(i-=g[s],x(t,i,_)),n--,s=z(n),E(t,s,a),0!==(_=l[s])&&(n-=m[s],x(t,n,_)))}while(o<t.last_lit);E(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)F(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],F(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,F(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(i=0;i<=_;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(i=p,g++),l[2*n+1]=i,n>o||(t.bl_count[i]++,s=0,n>=c&&(s=f[n-c]),h=l[2*n],t.opt_len+=h*(i+s),u&&(t.static_len+=h*(d[2*n+1]+s)));if(0!==g){do{for(i=p-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(i=p;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),S(i,o,t.bl_count)},O=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_<h&&r===s||(_<l?t.bl_tree[2*r]+=_:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):_<=10?t.bl_tree[34]++:t.bl_tree[36]++,_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))},N=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_<h&&r===s)){if(_<l)do{E(t,r,t.bl_tree)}while(0!=--_);else 0!==r?(r!==i&&(E(t,r,t.bl_tree),_--),E(t,16,t.bl_tree),x(t,_-3,2)):_<=10?(E(t,17,t.bl_tree),x(t,_-3,3)):(E(t,18,t.bl_tree),x(t,_-11,7));_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}},D=!1,C=function(t,e,a,n){x(t,0+(n?1:0),3),function(t,e,a,n){R(t),n&&(A(t,a),A(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},M=function(t,e,a,n){var i,s,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<r;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=a+5,a+4<=i&&-1!==e?C(t,e,a,n):4===t.strategy||s===i?(x(t,2+(n?1:0),3),T(t,u,f)):(x(t,4+(n?1:0),3),function(t,e,a,n){var r;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),r=0;r<n;r++)x(t,t.bl_tree[2*d[r]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),T(t,t.dyn_ltree,t.dyn_dtree)),U(t),n&&R(t)},B={_tr_init:function(t){D||(!function(){var t,e,a,n,r,d=new Array(16);for(a=0,n=0;n<28;n++)for(g[n]=a,t=0;t<1<<h[n];t++)p[a++]=n;for(p[a-1]=n,r=0,n=0;n<16;n++)for(m[n]=r,t=0;t<1<<l[n];t++)c[r++]=n;for(r>>=7;n<s;n++)for(m[n]=r<<7,t=0;t<1<<l[n]-7;t++)c[256+r++]=n;for(e=0;e<=_;e++)d[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,d[8]++;for(;t<=255;)u[2*t+1]=9,t++,d[9]++;for(;t<=279;)u[2*t+1]=7,t++,d[7]++;for(;t<=287;)u[2*t+1]=8,t++,d[8]++;for(S(u,287,d),t=0;t<s;t++)f[2*t+1]=5,f[2*t]=Z(t,5);v=new y(u,h,257,i,_),w=new y(f,l,0,s,_),b=new y(new Array(0),o,0,19,7)}(),D=!0),t.l_desc=new k(t.dyn_ltree,v),t.d_desc=new k(t.dyn_dtree,w),t.bl_desc=new k(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,U(t)},_tr_stored_block:C,_tr_flush_block:M,_tr_tally:function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(p[a]+r+1)]++,t.dyn_dtree[2*z(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){x(t,2,3),E(t,256,u),function(t){16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},H=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},Y=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),K=function(t,e,a,n){var r=Y,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},P={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},G=B._tr_init,X=B._tr_stored_block,W=B._tr_flush_block,$=B._tr_tally,q=B._tr_align,J=j.Z_NO_FLUSH,Q=j.Z_PARTIAL_FLUSH,V=j.Z_FULL_FLUSH,tt=j.Z_FINISH,et=j.Z_BLOCK,at=j.Z_OK,nt=j.Z_STREAM_END,rt=j.Z_STREAM_ERROR,it=j.Z_DATA_ERROR,st=j.Z_BUF_ERROR,_t=j.Z_DEFAULT_COMPRESSION,ht=j.Z_FILTERED,lt=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,dt=j.Z_FIXED,ut=j.Z_DEFAULT_STRATEGY,ft=j.Z_UNKNOWN,ct=j.Z_DEFLATED,pt=258,gt=262,vt=103,wt=113,bt=666,mt=function(t,e){return t.msg=P[e],e},yt=function(t){return(t<<1)-(t>4?9:0)},kt=function(t){for(var e=t.length;--e>=0;)t[e]=0},zt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},At=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},xt=function(t,e){W(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},Et=function(t,e){t.pending_buf[t.pending++]=e},Zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},St=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-gt?t.strstart-(t.w_size-gt):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+pt,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<u);if(n=pt-(u-i),i=u-pt,n>s){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Ut=function(t){var e,a,n,r,i,s,_,h,l,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-gt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=H(s.adler,_,o,h):2===s.state.wrap&&(s.adler=K(s.adler,_,o,h)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=zt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=zt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<gt&&0!==t.strm.avail_in)},Rt=function(t,e){for(var a,n;;){if(t.lookahead<gt){if(Ut(t),t.lookahead<gt&&e===J)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-gt&&(t.match_length=St(t,a)),t.match_length>=3)if(n=$(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=zt(t,t.ins_h,t.window[t.strstart+1]);else n=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2},Lt=function(t,e){for(var a,n,r;;){if(t.lookahead<gt){if(Ut(t),t.lookahead<gt&&e===J)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-gt&&(t.match_length=St(t,a),t.match_length<=5&&(t.strategy===ht||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=$(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=zt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(xt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=$(t,0,t.window[t.strstart-1]))&&xt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=$(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2};function Ft(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Tt=[new Ft(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ut(t),0===t.lookahead&&e===J)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,xt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-gt&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(xt(t,!1),t.strm.avail_out),1)})),new Ft(4,4,8,4,Rt),new Ft(4,5,16,8,Rt),new Ft(4,6,32,32,Rt),new Ft(4,4,16,16,Lt),new Ft(8,16,32,32,Lt),new Ft(8,16,128,128,Lt),new Ft(8,32,128,256,Lt),new Ft(32,128,258,1024,Lt),new Ft(32,258,258,4096,Lt)];function It(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),kt(this.dyn_ltree),kt(this.dyn_dtree),kt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),kt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),kt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return mt(t,rt);t.total_in=t.total_out=0,t.data_type=ft;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=J,G(e),at},Nt=function(t){var e,a=Ot(t);return a===at&&((e=t.state).window_size=2*e.w_size,kt(e.head),e.max_lazy_match=Tt[e.level].max_lazy,e.good_match=Tt[e.level].good_length,e.nice_match=Tt[e.level].nice_length,e.max_chain_length=Tt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Dt=function(t,e,a,n,r,i){if(!t)return rt;var s=1;if(e===_t&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==ct||n<8||n>15||e<0||e>9||i<0||i>dt)return mt(t,rt);8===n&&(n=9);var _=new It;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new Uint8Array(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=e,_.strategy=i,_.method=a,Nt(t)},Ct={deflateInit:function(t,e){return Dt(t,e,ct,15,8,ut)},deflateInit2:Dt,deflateReset:Nt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?rt:(t.state.gzhead=e,at):rt},deflate:function(t,e){var a,n;if(!t||!t.state||e>et||e<0)return t?mt(t,rt):rt;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===bt&&e!==tt)return mt(t,0===t.avail_out?st:rt);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Et(r,31),Et(r,139),Et(r,8),r.gzhead?(Et(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Et(r,255&r.gzhead.time),Et(r,r.gzhead.time>>8&255),Et(r,r.gzhead.time>>16&255),Et(r,r.gzhead.time>>24&255),Et(r,9===r.level?2:r.strategy>=lt||r.level<2?4:0),Et(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Et(r,255&r.gzhead.extra.length),Et(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=K(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Et(r,0),Et(r,0),Et(r,0),Et(r,0),Et(r,0),Et(r,9===r.level?2:r.strategy>=lt||r.level<2?4:0),Et(r,3),r.status=wt);else{var s=ct+(r.w_bits-8<<4)<<8;s|=(r.strategy>=lt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=wt,Zt(r,s),0!==r.strstart&&(Zt(r,t.adler>>>16),Zt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending!==r.pending_buf_size));)Et(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Et(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),At(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Et(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=K(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=vt)}else r.status=vt;if(r.status===vt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&At(t),r.pending+2<=r.pending_buf_size&&(Et(r,255&t.adler),Et(r,t.adler>>8&255),t.adler=0,r.status=wt)):r.status=wt),0!==r.pending){if(At(t),0===t.avail_out)return r.last_flush=-1,at}else if(0===t.avail_in&&yt(e)<=yt(i)&&e!==tt)return mt(t,st);if(r.status===bt&&0!==t.avail_in)return mt(t,st);if(0!==t.avail_in||0!==r.lookahead||e!==J&&r.status!==bt){var _=r.strategy===lt?function(t,e){for(var a;;){if(0===t.lookahead&&(Ut(t),0===t.lookahead)){if(e===J)return 1;break}if(t.match_length=0,a=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===ot?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=pt){if(Ut(t),t.lookahead<=pt&&e===J)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+pt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=pt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=$(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===tt?(xt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(xt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Tt[r.level].func(r,e);if(3!==_&&4!==_||(r.status=bt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),at;if(2===_&&(e===Q?q(r):e!==et&&(X(r,0,0,!1),e===V&&(kt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),0===t.avail_out))return r.last_flush=-1,at}return e!==tt?at:r.wrap<=0?nt:(2===r.wrap?(Et(r,255&t.adler),Et(r,t.adler>>8&255),Et(r,t.adler>>16&255),Et(r,t.adler>>24&255),Et(r,255&t.total_in),Et(r,t.total_in>>8&255),Et(r,t.total_in>>16&255),Et(r,t.total_in>>24&255)):(Zt(r,t.adler>>>16),Zt(r,65535&t.adler)),At(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?at:nt)},deflateEnd:function(t){if(!t||!t.state)return rt;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==vt&&e!==wt&&e!==bt?mt(t,rt):(t.state=null,e===wt?mt(t,it):at)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return rt;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return rt;if(1===r&&(t.adler=H(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(kt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Ut(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=zt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Ut(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=_,t.input=h,t.avail_in=s,n.wrap=r,at},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Mt=new Uint8Array(256),Bt=0;Bt<256;Bt++)Mt[Bt]=Bt>=252?6:Bt>=248?5:Bt>=240?4:Bt>=224?3:Bt>=192?2:1;Mt[254]=Mt[254]=1;var Ht=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Yt=Object.prototype.toString,Kt=j.Z_NO_FLUSH,Pt=j.Z_SYNC_FLUSH,jt=j.Z_FULL_FLUSH,Gt=j.Z_FINISH,Xt=j.Z_OK,Wt=j.Z_STREAM_END,$t=j.Z_DEFAULT_COMPRESSION,qt=j.Z_DEFAULT_STRATEGY,Jt=j.Z_DEFLATED;function Qt(){this.options={level:$t,method:Jt,chunkSize:16384,windowBits:15,memLevel:8,strategy:qt};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ht,this.strm.avail_out=0;var e=Ct.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==Xt)throw new Error(P[e]);if(t.header&&Ct.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Yt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Ct.deflateSetDictionary(this.strm,a))!==Xt)throw new Error(P[e]);this._dict_set=!0}}function Vt(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function te(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}Qt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Gt:Kt,\"[object ArrayBuffer]\"===Yt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Pt||n===jt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Ct.deflate(r,n))===Wt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Ct.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Xt;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Qt.prototype.onData=function(t){this.chunks.push(t)},Qt.prototype.onEnd=function(t){t===Xt&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,_=t.length;i<_;i++){var h=t[i];r.set(h,s),s+=h.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(t){void 0===t&&(t=self);try{var e=new Map;t.addEventListener(\"message\",(function(n){try{var r=function(t,e){switch(e.action){case\"init\":return{type:\"initialized\",version:\"3.1.24\"};case\"write\":var n=t.get(e.streamId);n||(n=new Qt,t.set(e.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,_=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),_+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(_),i=0,r=0;i<_;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(e.data);return n.push(i,j.Z_SYNC_FLUSH),{type:\"wrote\",id:e.id,streamId:e.streamId,result:a(n.chunks.slice(r)),trailer:te(n),additionalBytesCount:i.length};case\"reset\":t.delete(e.streamId)}}(e,n.data);r&&t.postMessage(r)}catch(e){Vt(t,e,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(e){Vt(t,e)}}()}();"])));
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* In order to be sure that the worker is correctly working, we need a round trip of
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { toServerDuration, relativeToClocks, RumEventType, LifeCycleEventType, UUID, RumLongTaskEntryType } from '@cloudcare/browser-core';
|
|
2
|
-
import { RumPerformanceEntryType } from '../../performanceObservable';
|
|
3
|
-
export function startLongTaskCollection(lifeCycle) {
|
|
4
|
-
|
|
2
|
+
import { RumPerformanceEntryType, createPerformanceObservable } from '../../performanceObservable';
|
|
3
|
+
export function startLongTaskCollection(lifeCycle, configuration) {
|
|
4
|
+
var performanceLongTaskSubscription = createPerformanceObservable(configuration, {
|
|
5
|
+
type: RumPerformanceEntryType.LONG_TASK,
|
|
6
|
+
buffered: true
|
|
7
|
+
}).subscribe(function (entries) {
|
|
5
8
|
for (var i = 0; i < entries.length; i++) {
|
|
6
9
|
var entry = entries[i];
|
|
7
10
|
if (entry.entryType !== RumPerformanceEntryType.LONG_TASK) {
|
|
@@ -26,5 +29,10 @@ export function startLongTaskCollection(lifeCycle) {
|
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
});
|
|
32
|
+
return {
|
|
33
|
+
stop: function stop() {
|
|
34
|
+
performanceLongTaskSubscription.unsubscribe();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
29
37
|
}
|
|
30
38
|
//# sourceMappingURL=longTaskCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"longTaskCollection.js","names":["toServerDuration","relativeToClocks","RumEventType","LifeCycleEventType","UUID","RumLongTaskEntryType","RumPerformanceEntryType","startLongTaskCollection","lifeCycle","
|
|
1
|
+
{"version":3,"file":"longTaskCollection.js","names":["toServerDuration","relativeToClocks","RumEventType","LifeCycleEventType","UUID","RumLongTaskEntryType","RumPerformanceEntryType","createPerformanceObservable","startLongTaskCollection","lifeCycle","configuration","performanceLongTaskSubscription","type","LONG_TASK","buffered","subscribe","entries","i","length","entry","entryType","startClocks","startTime","rawRumEvent","date","timeStamp","long_task","id","duration","notify","RAW_RUM_EVENT_COLLECTED","relative","domainContext","performanceEntry","stop","unsubscribe"],"sources":["../../../../src/domain/rumEventsCollection/longTask/longTaskCollection.js"],"sourcesContent":["import {\n toServerDuration,\n relativeToClocks,\n RumEventType,\n LifeCycleEventType,\n UUID,\n RumLongTaskEntryType\n} from '@cloudcare/browser-core'\nimport {\n RumPerformanceEntryType,\n createPerformanceObservable\n} from '../../performanceObservable'\nexport function startLongTaskCollection(lifeCycle, configuration) {\n var performanceLongTaskSubscription = createPerformanceObservable(\n configuration,\n {\n type: RumPerformanceEntryType.LONG_TASK,\n buffered: true\n }\n ).subscribe(function (entries) {\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i]\n if (entry.entryType !== RumPerformanceEntryType.LONG_TASK) {\n break\n }\n\n var startClocks = relativeToClocks(entry.startTime)\n var rawRumEvent = {\n date: startClocks.timeStamp,\n long_task: {\n id: UUID(),\n entryType: RumLongTaskEntryType.LONG_TASK,\n duration: toServerDuration(entry.duration)\n },\n type: RumEventType.LONG_TASK\n }\n lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, {\n rawRumEvent: rawRumEvent,\n startTime: startClocks.relative,\n domainContext: { performanceEntry: entry }\n })\n }\n })\n return {\n stop: function () {\n performanceLongTaskSubscription.unsubscribe()\n }\n }\n}\n"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,kBAAkB,EAClBC,IAAI,EACJC,oBAAoB,QACf,yBAAyB;AAChC,SACEC,uBAAuB,EACvBC,2BAA2B,QACtB,6BAA6B;AACpC,OAAO,SAASC,uBAAuBA,CAACC,SAAS,EAAEC,aAAa,EAAE;EAChE,IAAIC,+BAA+B,GAAGJ,2BAA2B,CAC/DG,aAAa,EACb;IACEE,IAAI,EAAEN,uBAAuB,CAACO,SAAS;IACvCC,QAAQ,EAAE;EACZ,CACF,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IAC7B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,OAAO,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;MACvC,IAAIE,KAAK,GAAGH,OAAO,CAACC,CAAC,CAAC;MACtB,IAAIE,KAAK,CAACC,SAAS,KAAKd,uBAAuB,CAACO,SAAS,EAAE;QACzD;MACF;MAEA,IAAIQ,WAAW,GAAGpB,gBAAgB,CAACkB,KAAK,CAACG,SAAS,CAAC;MACnD,IAAIC,WAAW,GAAG;QAChBC,IAAI,EAAEH,WAAW,CAACI,SAAS;QAC3BC,SAAS,EAAE;UACTC,EAAE,EAAEvB,IAAI,CAAC,CAAC;UACVgB,SAAS,EAAEf,oBAAoB,CAACQ,SAAS;UACzCe,QAAQ,EAAE5B,gBAAgB,CAACmB,KAAK,CAACS,QAAQ;QAC3C,CAAC;QACDhB,IAAI,EAAEV,YAAY,CAACW;MACrB,CAAC;MACDJ,SAAS,CAACoB,MAAM,CAAC1B,kBAAkB,CAAC2B,uBAAuB,EAAE;QAC3DP,WAAW,EAAEA,WAAW;QACxBD,SAAS,EAAED,WAAW,CAACU,QAAQ;QAC/BC,aAAa,EAAE;UAAEC,gBAAgB,EAAEd;QAAM;MAC3C,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EACF,OAAO;IACLe,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBvB,+BAA+B,CAACwB,WAAW,CAAC,CAAC;IAC/C;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,35 +1,19 @@
|
|
|
1
1
|
import { runOnReadyState, assign } from '@cloudcare/browser-core';
|
|
2
|
-
import { RumPerformanceEntryType
|
|
2
|
+
import { RumPerformanceEntryType } from '../../performanceObservable';
|
|
3
3
|
import { FAKE_INITIAL_DOCUMENT } from './resourceUtils';
|
|
4
|
-
import {
|
|
4
|
+
import { getNavigationEntry } from '../../performanceUtils';
|
|
5
5
|
export function retrieveInitialDocumentResourceTiming(configuration, callback) {
|
|
6
6
|
runOnReadyState('interactive', function () {
|
|
7
|
-
var
|
|
8
|
-
var forcedAttributes = {
|
|
7
|
+
var entry = assign(getNavigationEntry().toJSON(), {
|
|
9
8
|
entryType: RumPerformanceEntryType.RESOURCE,
|
|
10
9
|
initiatorType: FAKE_INITIAL_DOCUMENT,
|
|
11
10
|
toJSON: function toJSON() {
|
|
12
|
-
return assign({},
|
|
11
|
+
return assign({}, entry, {
|
|
13
12
|
toJSON: undefined
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
var navigationEntry = performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];
|
|
19
|
-
timing = assign(navigationEntry.toJSON(), forcedAttributes);
|
|
20
|
-
} else {
|
|
21
|
-
var relativePerformanceTiming = computeRelativePerformanceTiming();
|
|
22
|
-
timing = assign(relativePerformanceTiming, {
|
|
23
|
-
decodedBodySize: 0,
|
|
24
|
-
encodedBodySize: 0,
|
|
25
|
-
transferSize: 0,
|
|
26
|
-
renderBlockingStatus: 'non-blocking',
|
|
27
|
-
duration: relativePerformanceTiming.responseEnd,
|
|
28
|
-
name: window.location.href,
|
|
29
|
-
startTime: 0
|
|
30
|
-
}, forcedAttributes);
|
|
31
|
-
}
|
|
32
|
-
callback(timing);
|
|
15
|
+
});
|
|
16
|
+
callback(entry);
|
|
33
17
|
});
|
|
34
18
|
}
|
|
35
19
|
//# sourceMappingURL=retrieveInitialDocumentResourceTiming.js.map
|
package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveInitialDocumentResourceTiming.js","names":["runOnReadyState","assign","RumPerformanceEntryType","
|
|
1
|
+
{"version":3,"file":"retrieveInitialDocumentResourceTiming.js","names":["runOnReadyState","assign","RumPerformanceEntryType","FAKE_INITIAL_DOCUMENT","getNavigationEntry","retrieveInitialDocumentResourceTiming","configuration","callback","entry","toJSON","entryType","RESOURCE","initiatorType","undefined"],"sources":["../../../../src/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js"],"sourcesContent":["import { runOnReadyState, assign } from '@cloudcare/browser-core'\nimport { RumPerformanceEntryType } from '../../performanceObservable'\nimport { FAKE_INITIAL_DOCUMENT } from './resourceUtils'\nimport { getNavigationEntry } from '../../performanceUtils'\nexport function retrieveInitialDocumentResourceTiming(configuration, callback) {\n runOnReadyState('interactive', function () {\n var entry = assign(getNavigationEntry().toJSON(), {\n entryType: RumPerformanceEntryType.RESOURCE,\n initiatorType: FAKE_INITIAL_DOCUMENT,\n toJSON: function () {\n return assign({}, entry, { toJSON: undefined })\n }\n })\n callback(entry)\n })\n}\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,MAAM,QAAQ,yBAAyB;AACjE,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,OAAO,SAASC,qCAAqCA,CAACC,aAAa,EAAEC,QAAQ,EAAE;EAC7EP,eAAe,CAAC,aAAa,EAAE,YAAY;IACzC,IAAIQ,KAAK,GAAGP,MAAM,CAACG,kBAAkB,CAAC,CAAC,CAACK,MAAM,CAAC,CAAC,EAAE;MAChDC,SAAS,EAAER,uBAAuB,CAACS,QAAQ;MAC3CC,aAAa,EAAET,qBAAqB;MACpCM,MAAM,EAAE,SAAAA,OAAA,EAAY;QAClB,OAAOR,MAAM,CAAC,CAAC,CAAC,EAAEO,KAAK,EAAE;UAAEC,MAAM,EAAEI;QAAU,CAAC,CAAC;MACjD;IACF,CAAC,CAAC;IACFN,QAAQ,CAACC,KAAK,CAAC;EACjB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ export function trackCommonViewMetrics(lifeCycle, domMutationObservable, configu
|
|
|
20
20
|
scheduleViewUpdate();
|
|
21
21
|
});
|
|
22
22
|
var stopCLSTracking = _trackCumulativeLayoutShift.stop;
|
|
23
|
-
var _trackInteractionToNextPaint = trackInteractionToNextPaint(configuration, viewStart.relative, loadingType
|
|
23
|
+
var _trackInteractionToNextPaint = trackInteractionToNextPaint(configuration, viewStart.relative, loadingType);
|
|
24
24
|
var stopINPTracking = _trackInteractionToNextPaint.stop;
|
|
25
25
|
var getInteractionToNextPaint = _trackInteractionToNextPaint.getInteractionToNextPaint;
|
|
26
26
|
var setViewEnd = _trackInteractionToNextPaint.setViewEnd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackCommonViewMetrics.js","names":["trackScrollMetrics","trackLoadingTime","trackCumulativeLayoutShift","trackInteractionToNextPaint","trackCommonViewMetrics","lifeCycle","domMutationObservable","configuration","scheduleViewUpdate","loadingType","viewStart","commonViewMetrics","_trackLoadingTime","newLoadingTime","loadingTime","stopLoadingTimeTracking","stop","setLoadEvent","_trackScrollMetrics","newScrollMetrics","scroll","stopScrollMetricsTracking","stopCLSTracking","_trackCumulativeLayoutShift","relative","cumulativeLayoutShift","_trackInteractionToNextPaint","stopINPTracking","getInteractionToNextPaint","setViewEnd","getCommonViewMetrics","interactionToNextPaint"],"sources":["../../../../src/domain/rumEventsCollection/view/trackCommonViewMetrics.js"],"sourcesContent":["import { trackScrollMetrics } from './trackScrollMetrics'\nimport { trackLoadingTime } from './trackLoadingTime'\nimport { trackCumulativeLayoutShift } from './trackCumulativeLayoutShift'\nimport { trackInteractionToNextPaint } from './trackInteractionToNextPaint'\n\nexport function trackCommonViewMetrics(\n lifeCycle,\n domMutationObservable,\n configuration,\n scheduleViewUpdate,\n loadingType,\n viewStart\n) {\n var commonViewMetrics = {}\n var _trackLoadingTime = trackLoadingTime(\n lifeCycle,\n domMutationObservable,\n configuration,\n loadingType,\n viewStart,\n function (newLoadingTime) {\n commonViewMetrics.loadingTime = newLoadingTime\n scheduleViewUpdate()\n }\n )\n var stopLoadingTimeTracking = _trackLoadingTime.stop\n var setLoadEvent = _trackLoadingTime.setLoadEvent\n var _trackScrollMetrics = trackScrollMetrics(\n configuration,\n viewStart,\n function (newScrollMetrics) {\n commonViewMetrics.scroll = newScrollMetrics\n }\n )\n var stopScrollMetricsTracking = _trackScrollMetrics.stop\n var stopCLSTracking\n var _trackCumulativeLayoutShift = trackCumulativeLayoutShift(\n configuration,\n lifeCycle,\n viewStart.relative,\n function (cumulativeLayoutShift) {\n commonViewMetrics.cumulativeLayoutShift = cumulativeLayoutShift\n scheduleViewUpdate()\n }\n )\n var stopCLSTracking = _trackCumulativeLayoutShift.stop\n var _trackInteractionToNextPaint = trackInteractionToNextPaint(\n configuration,\n viewStart.relative,\n loadingType
|
|
1
|
+
{"version":3,"file":"trackCommonViewMetrics.js","names":["trackScrollMetrics","trackLoadingTime","trackCumulativeLayoutShift","trackInteractionToNextPaint","trackCommonViewMetrics","lifeCycle","domMutationObservable","configuration","scheduleViewUpdate","loadingType","viewStart","commonViewMetrics","_trackLoadingTime","newLoadingTime","loadingTime","stopLoadingTimeTracking","stop","setLoadEvent","_trackScrollMetrics","newScrollMetrics","scroll","stopScrollMetricsTracking","stopCLSTracking","_trackCumulativeLayoutShift","relative","cumulativeLayoutShift","_trackInteractionToNextPaint","stopINPTracking","getInteractionToNextPaint","setViewEnd","getCommonViewMetrics","interactionToNextPaint"],"sources":["../../../../src/domain/rumEventsCollection/view/trackCommonViewMetrics.js"],"sourcesContent":["import { trackScrollMetrics } from './trackScrollMetrics'\nimport { trackLoadingTime } from './trackLoadingTime'\nimport { trackCumulativeLayoutShift } from './trackCumulativeLayoutShift'\nimport { trackInteractionToNextPaint } from './trackInteractionToNextPaint'\n\nexport function trackCommonViewMetrics(\n lifeCycle,\n domMutationObservable,\n configuration,\n scheduleViewUpdate,\n loadingType,\n viewStart\n) {\n var commonViewMetrics = {}\n var _trackLoadingTime = trackLoadingTime(\n lifeCycle,\n domMutationObservable,\n configuration,\n loadingType,\n viewStart,\n function (newLoadingTime) {\n commonViewMetrics.loadingTime = newLoadingTime\n scheduleViewUpdate()\n }\n )\n var stopLoadingTimeTracking = _trackLoadingTime.stop\n var setLoadEvent = _trackLoadingTime.setLoadEvent\n var _trackScrollMetrics = trackScrollMetrics(\n configuration,\n viewStart,\n function (newScrollMetrics) {\n commonViewMetrics.scroll = newScrollMetrics\n }\n )\n var stopScrollMetricsTracking = _trackScrollMetrics.stop\n var stopCLSTracking\n var _trackCumulativeLayoutShift = trackCumulativeLayoutShift(\n configuration,\n lifeCycle,\n viewStart.relative,\n function (cumulativeLayoutShift) {\n commonViewMetrics.cumulativeLayoutShift = cumulativeLayoutShift\n scheduleViewUpdate()\n }\n )\n var stopCLSTracking = _trackCumulativeLayoutShift.stop\n var _trackInteractionToNextPaint = trackInteractionToNextPaint(\n configuration,\n viewStart.relative,\n loadingType\n )\n var stopINPTracking = _trackInteractionToNextPaint.stop\n var getInteractionToNextPaint =\n _trackInteractionToNextPaint.getInteractionToNextPaint\n var setViewEnd = _trackInteractionToNextPaint.setViewEnd\n return {\n stop: function () {\n stopLoadingTimeTracking()\n stopCLSTracking()\n stopScrollMetricsTracking()\n },\n stopINPTracking: stopINPTracking,\n setLoadEvent: setLoadEvent,\n setViewEnd: setViewEnd,\n getCommonViewMetrics: function () {\n commonViewMetrics.interactionToNextPaint = getInteractionToNextPaint()\n return commonViewMetrics\n }\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,2BAA2B,QAAQ,+BAA+B;AAE3E,OAAO,SAASC,sBAAsBA,CACpCC,SAAS,EACTC,qBAAqB,EACrBC,aAAa,EACbC,kBAAkB,EAClBC,WAAW,EACXC,SAAS,EACT;EACA,IAAIC,iBAAiB,GAAG,CAAC,CAAC;EAC1B,IAAIC,iBAAiB,GAAGX,gBAAgB,CACtCI,SAAS,EACTC,qBAAqB,EACrBC,aAAa,EACbE,WAAW,EACXC,SAAS,EACT,UAAUG,cAAc,EAAE;IACxBF,iBAAiB,CAACG,WAAW,GAAGD,cAAc;IAC9CL,kBAAkB,CAAC,CAAC;EACtB,CACF,CAAC;EACD,IAAIO,uBAAuB,GAAGH,iBAAiB,CAACI,IAAI;EACpD,IAAIC,YAAY,GAAGL,iBAAiB,CAACK,YAAY;EACjD,IAAIC,mBAAmB,GAAGlB,kBAAkB,CAC1CO,aAAa,EACbG,SAAS,EACT,UAAUS,gBAAgB,EAAE;IAC1BR,iBAAiB,CAACS,MAAM,GAAGD,gBAAgB;EAC7C,CACF,CAAC;EACD,IAAIE,yBAAyB,GAAGH,mBAAmB,CAACF,IAAI;EACxD,IAAIM,eAAe;EACnB,IAAIC,2BAA2B,GAAGrB,0BAA0B,CAC1DK,aAAa,EACbF,SAAS,EACTK,SAAS,CAACc,QAAQ,EAClB,UAAUC,qBAAqB,EAAE;IAC/Bd,iBAAiB,CAACc,qBAAqB,GAAGA,qBAAqB;IAC/DjB,kBAAkB,CAAC,CAAC;EACtB,CACF,CAAC;EACD,IAAIc,eAAe,GAAGC,2BAA2B,CAACP,IAAI;EACtD,IAAIU,4BAA4B,GAAGvB,2BAA2B,CAC5DI,aAAa,EACbG,SAAS,CAACc,QAAQ,EAClBf,WACF,CAAC;EACD,IAAIkB,eAAe,GAAGD,4BAA4B,CAACV,IAAI;EACvD,IAAIY,yBAAyB,GAC3BF,4BAA4B,CAACE,yBAAyB;EACxD,IAAIC,UAAU,GAAGH,4BAA4B,CAACG,UAAU;EACxD,OAAO;IACLb,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBD,uBAAuB,CAAC,CAAC;MACzBO,eAAe,CAAC,CAAC;MACjBD,yBAAyB,CAAC,CAAC;IAC7B,CAAC;IACDM,eAAe,EAAEA,eAAe;IAChCV,YAAY,EAAEA,YAAY;IAC1BY,UAAU,EAAEA,UAAU;IACtBC,oBAAoB,EAAE,SAAAA,qBAAA,EAAY;MAChCnB,iBAAiB,CAACoB,sBAAsB,GAAGH,yBAAyB,CAAC,CAAC;MACtE,OAAOjB,iBAAiB;IAC1B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { find,
|
|
2
|
-
import { RumPerformanceEntryType } from '../../performanceObservable';
|
|
1
|
+
import { find, ONE_MINUTE } from '@cloudcare/browser-core';
|
|
2
|
+
import { RumPerformanceEntryType, createPerformanceObservable } from '../../performanceObservable';
|
|
3
3
|
export var TIMING_MAXIMUM_DELAY = 10 * ONE_MINUTE;
|
|
4
|
-
export function trackFirstContentfulPaint(
|
|
5
|
-
var
|
|
4
|
+
export function trackFirstContentfulPaint(configuration, firstHidden, callback) {
|
|
5
|
+
var performanceSubscription = createPerformanceObservable(configuration, {
|
|
6
|
+
type: RumPerformanceEntryType.PAINT,
|
|
7
|
+
buffered: true
|
|
8
|
+
}).subscribe(function (entries) {
|
|
6
9
|
var fcpEntry = find(entries, function (entry) {
|
|
7
10
|
return entry.entryType === RumPerformanceEntryType.PAINT && entry.name === 'first-contentful-paint' && entry.startTime < firstHidden.getTimeStamp() && entry.startTime < TIMING_MAXIMUM_DELAY;
|
|
8
11
|
});
|
|
@@ -11,7 +14,7 @@ export function trackFirstContentfulPaint(lifeCycle, firstHidden, callback) {
|
|
|
11
14
|
}
|
|
12
15
|
});
|
|
13
16
|
return {
|
|
14
|
-
stop:
|
|
17
|
+
stop: performanceSubscription.unsubscribe
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=trackFirstContentfulPaint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackFirstContentfulPaint.js","names":["find","
|
|
1
|
+
{"version":3,"file":"trackFirstContentfulPaint.js","names":["find","ONE_MINUTE","RumPerformanceEntryType","createPerformanceObservable","TIMING_MAXIMUM_DELAY","trackFirstContentfulPaint","configuration","firstHidden","callback","performanceSubscription","type","PAINT","buffered","subscribe","entries","fcpEntry","entry","entryType","name","startTime","getTimeStamp","stop","unsubscribe"],"sources":["../../../../src/domain/rumEventsCollection/view/trackFirstContentfulPaint.js"],"sourcesContent":["import { find, ONE_MINUTE } from '@cloudcare/browser-core'\nimport {\n RumPerformanceEntryType,\n createPerformanceObservable\n} from '../../performanceObservable'\nexport var TIMING_MAXIMUM_DELAY = 10 * ONE_MINUTE\nexport function trackFirstContentfulPaint(\n configuration,\n firstHidden,\n callback\n) {\n var performanceSubscription = createPerformanceObservable(configuration, {\n type: RumPerformanceEntryType.PAINT,\n buffered: true\n }).subscribe(function (entries) {\n var fcpEntry = find(entries, function (entry) {\n return (\n entry.entryType === RumPerformanceEntryType.PAINT &&\n entry.name === 'first-contentful-paint' &&\n entry.startTime < firstHidden.getTimeStamp() &&\n entry.startTime < TIMING_MAXIMUM_DELAY\n )\n })\n if (fcpEntry) {\n callback(fcpEntry.startTime)\n }\n })\n return { stop: performanceSubscription.unsubscribe }\n}\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,UAAU,QAAQ,yBAAyB;AAC1D,SACEC,uBAAuB,EACvBC,2BAA2B,QACtB,6BAA6B;AACpC,OAAO,IAAIC,oBAAoB,GAAG,EAAE,GAAGH,UAAU;AACjD,OAAO,SAASI,yBAAyBA,CACvCC,aAAa,EACbC,WAAW,EACXC,QAAQ,EACR;EACA,IAAIC,uBAAuB,GAAGN,2BAA2B,CAACG,aAAa,EAAE;IACvEI,IAAI,EAAER,uBAAuB,CAACS,KAAK;IACnCC,QAAQ,EAAE;EACZ,CAAC,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IAC9B,IAAIC,QAAQ,GAAGf,IAAI,CAACc,OAAO,EAAE,UAAUE,KAAK,EAAE;MAC5C,OACEA,KAAK,CAACC,SAAS,KAAKf,uBAAuB,CAACS,KAAK,IACjDK,KAAK,CAACE,IAAI,KAAK,wBAAwB,IACvCF,KAAK,CAACG,SAAS,GAAGZ,WAAW,CAACa,YAAY,CAAC,CAAC,IAC5CJ,KAAK,CAACG,SAAS,GAAGf,oBAAoB;IAE1C,CAAC,CAAC;IACF,IAAIW,QAAQ,EAAE;MACZP,QAAQ,CAACO,QAAQ,CAACI,SAAS,CAAC;IAC9B;EACF,CAAC,CAAC;EACF,OAAO;IAAEE,IAAI,EAAEZ,uBAAuB,CAACa;EAAY,CAAC;AACtD","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { elapsed, find,
|
|
1
|
+
import { elapsed, find, isElementNode } from '@cloudcare/browser-core';
|
|
2
2
|
import { getSelectorFromElement } from '../actions/getSelectorsFromElement';
|
|
3
|
-
import { RumPerformanceEntryType } from '../../performanceObservable';
|
|
3
|
+
import { RumPerformanceEntryType, createPerformanceObservable } from '../../performanceObservable';
|
|
4
4
|
/**
|
|
5
5
|
* Track the first input occurring during the initial View to return:
|
|
6
6
|
* - First Input Delay
|
|
@@ -9,8 +9,11 @@ import { RumPerformanceEntryType } from '../../performanceObservable';
|
|
|
9
9
|
* Documentation: https://web.dev/fid/
|
|
10
10
|
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getFID.ts
|
|
11
11
|
*/
|
|
12
|
-
export function trackFirstInput(
|
|
13
|
-
var
|
|
12
|
+
export function trackFirstInput(configuration, firstHidden, callback) {
|
|
13
|
+
var performanceFirstInputSubscription = createPerformanceObservable(configuration, {
|
|
14
|
+
type: RumPerformanceEntryType.FIRST_INPUT,
|
|
15
|
+
buffered: true
|
|
16
|
+
}).subscribe(function (entries) {
|
|
14
17
|
var firstInputEntry = find(entries, function (entry) {
|
|
15
18
|
return entry.entryType === RumPerformanceEntryType.FIRST_INPUT && entry.startTime < firstHidden.getTimeStamp();
|
|
16
19
|
});
|
|
@@ -30,7 +33,9 @@ export function trackFirstInput(lifeCycle, configuration, firstHidden, callback)
|
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
35
|
return {
|
|
33
|
-
stop:
|
|
36
|
+
stop: function stop() {
|
|
37
|
+
performanceFirstInputSubscription.unsubscribe();
|
|
38
|
+
}
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
41
|
//# sourceMappingURL=trackFirstInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackFirstInput.js","names":["elapsed","find","
|
|
1
|
+
{"version":3,"file":"trackFirstInput.js","names":["elapsed","find","isElementNode","getSelectorFromElement","RumPerformanceEntryType","createPerformanceObservable","trackFirstInput","configuration","firstHidden","callback","performanceFirstInputSubscription","type","FIRST_INPUT","buffered","subscribe","entries","firstInputEntry","entry","entryType","startTime","getTimeStamp","firstInputDelay","processingStart","firstInputTargetSelector","target","actionNameAttribute","delay","time","targetSelector","stop","unsubscribe"],"sources":["../../../../src/domain/rumEventsCollection/view/trackFirstInput.js"],"sourcesContent":["import { elapsed, find, isElementNode } from '@cloudcare/browser-core'\nimport { getSelectorFromElement } from '../actions/getSelectorsFromElement'\nimport {\n RumPerformanceEntryType,\n createPerformanceObservable\n} from '../../performanceObservable'\n/**\n * Track the first input occurring during the initial View to return:\n * - First Input Delay\n * - First Input Time\n * Callback is called at most one time.\n * Documentation: https://web.dev/fid/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getFID.ts\n */\nexport function trackFirstInput(configuration, firstHidden, callback) {\n const performanceFirstInputSubscription = createPerformanceObservable(\n configuration,\n {\n type: RumPerformanceEntryType.FIRST_INPUT,\n buffered: true\n }\n ).subscribe(function (entries) {\n var firstInputEntry = find(entries, function (entry) {\n return (\n entry.entryType === RumPerformanceEntryType.FIRST_INPUT &&\n entry.startTime < firstHidden.getTimeStamp()\n )\n })\n if (firstInputEntry) {\n var firstInputDelay = elapsed(\n firstInputEntry.startTime,\n firstInputEntry.processingStart\n )\n var firstInputTargetSelector\n if (firstInputEntry.target && isElementNode(firstInputEntry.target)) {\n firstInputTargetSelector = getSelectorFromElement(\n firstInputEntry.target,\n configuration.actionNameAttribute\n )\n }\n callback({\n // Ensure firstInputDelay to be positive, see\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1185815\n delay: firstInputDelay >= 0 ? firstInputDelay : 0,\n time: firstInputEntry.startTime,\n targetSelector: firstInputTargetSelector\n })\n }\n })\n return {\n stop: function () {\n performanceFirstInputSubscription.unsubscribe()\n }\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,IAAI,EAAEC,aAAa,QAAQ,yBAAyB;AACtE,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SACEC,uBAAuB,EACvBC,2BAA2B,QACtB,6BAA6B;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,aAAa,EAAEC,WAAW,EAAEC,QAAQ,EAAE;EACpE,IAAMC,iCAAiC,GAAGL,2BAA2B,CACnEE,aAAa,EACb;IACEI,IAAI,EAAEP,uBAAuB,CAACQ,WAAW;IACzCC,QAAQ,EAAE;EACZ,CACF,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IAC7B,IAAIC,eAAe,GAAGf,IAAI,CAACc,OAAO,EAAE,UAAUE,KAAK,EAAE;MACnD,OACEA,KAAK,CAACC,SAAS,KAAKd,uBAAuB,CAACQ,WAAW,IACvDK,KAAK,CAACE,SAAS,GAAGX,WAAW,CAACY,YAAY,CAAC,CAAC;IAEhD,CAAC,CAAC;IACF,IAAIJ,eAAe,EAAE;MACnB,IAAIK,eAAe,GAAGrB,OAAO,CAC3BgB,eAAe,CAACG,SAAS,EACzBH,eAAe,CAACM,eAClB,CAAC;MACD,IAAIC,wBAAwB;MAC5B,IAAIP,eAAe,CAACQ,MAAM,IAAItB,aAAa,CAACc,eAAe,CAACQ,MAAM,CAAC,EAAE;QACnED,wBAAwB,GAAGpB,sBAAsB,CAC/Ca,eAAe,CAACQ,MAAM,EACtBjB,aAAa,CAACkB,mBAChB,CAAC;MACH;MACAhB,QAAQ,CAAC;QACP;QACA;QACAiB,KAAK,EAAEL,eAAe,IAAI,CAAC,GAAGA,eAAe,GAAG,CAAC;QACjDM,IAAI,EAAEX,eAAe,CAACG,SAAS;QAC/BS,cAAc,EAAEL;MAClB,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EACF,OAAO;IACLM,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBnB,iCAAiC,CAACoB,WAAW,CAAC,CAAC;IACjD;EACF,CAAC;AACH","ignoreList":[]}
|