@highlight-run/rrweb 1.2.0 → 2.0.1
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/dist/plugins/console-record.js +655 -0
- package/dist/plugins/console-record.min.js +1 -1
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +293 -0
- package/dist/plugins/console-replay.min.js +16 -0
- package/dist/plugins/console-replay.min.js.map +1 -0
- package/dist/plugins/sequential-id-record.js +33 -0
- package/dist/plugins/sequential-id-record.min.js +2 -0
- package/dist/plugins/sequential-id-record.min.js.map +1 -0
- package/dist/plugins/sequential-id-replay.js +37 -0
- package/dist/plugins/sequential-id-replay.min.js +2 -0
- package/dist/plugins/sequential-id-replay.min.js.map +1 -0
- package/dist/record/rrweb-record-pack.js +747 -0
- package/dist/record/rrweb-record-pack.min.js +16 -0
- package/dist/record/rrweb-record-pack.min.js.map +1 -0
- package/dist/record/rrweb-record.js +3318 -0
- package/dist/record/rrweb-record.min.js +16 -0
- package/dist/record/rrweb-record.min.js.map +1 -0
- package/dist/replay/rrweb-replay-unpack.js +4626 -0
- package/dist/replay/rrweb-replay-unpack.min.css +2 -0
- package/dist/replay/rrweb-replay-unpack.min.css.map +1 -0
- package/dist/replay/rrweb-replay-unpack.min.js +30 -0
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -0
- package/dist/replay/rrweb-replay.js +4216 -0
- package/dist/replay/rrweb-replay.min.css +2 -0
- package/dist/replay/rrweb-replay.min.css.map +1 -0
- package/dist/replay/rrweb-replay.min.js +30 -0
- package/dist/replay/rrweb-replay.min.js.map +1 -0
- package/dist/rrweb-all.js +8708 -0
- package/dist/rrweb-all.min.css +2 -0
- package/dist/rrweb-all.min.css.map +1 -0
- package/dist/rrweb-all.min.js +30 -0
- package/dist/rrweb-all.min.js.map +1 -0
- package/dist/rrweb.js +7294 -0
- package/dist/rrweb.min.css +2 -0
- package/dist/rrweb.min.css.map +1 -0
- package/dist/rrweb.min.js +2 -2
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/ext/@xstate/fsm/es/index.js +17 -0
- package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +49 -0
- package/es/rrweb/ext/fflate/esm/browser.js +777 -0
- package/es/rrweb/ext/mitt/dist/mitt.es.js +63 -0
- package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +78 -0
- package/es/rrweb/packages/rrweb/src/entries/all.js +13 -0
- package/es/rrweb/packages/rrweb/src/index.js +12 -0
- package/es/rrweb/packages/rrweb/src/packer/base.js +3 -0
- package/es/rrweb/packages/rrweb/src/packer/pack.js +10 -0
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +29 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +179 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +134 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +141 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +111 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +23 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +28 -0
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +32 -0
- package/es/rrweb/packages/rrweb/src/record/index.js +381 -0
- package/es/rrweb/packages/rrweb/src/record/mutation.js +532 -0
- package/es/rrweb/packages/rrweb/src/record/observer.js +665 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +78 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +93 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +30 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +116 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +78 -0
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +45 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +25 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +35 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +124 -0
- package/es/rrweb/packages/rrweb/src/replay/index.js +1864 -0
- package/es/rrweb/packages/rrweb/src/replay/machine.js +321 -0
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +221 -0
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +8 -0
- package/es/rrweb/packages/rrweb/src/replay/timer.js +96 -0
- package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +121 -0
- package/es/rrweb/packages/rrweb/src/types.js +75 -0
- package/es/rrweb/packages/rrweb/src/utils.js +509 -0
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +1697 -0
- package/lib/plugins/console-record.js +650 -0
- package/lib/plugins/console-replay.js +288 -0
- package/lib/plugins/sequential-id-record.js +28 -0
- package/lib/plugins/sequential-id-replay.js +32 -0
- package/lib/record/rrweb-record-pack.js +742 -0
- package/lib/record/rrweb-record.js +3315 -0
- package/lib/replay/rrweb-replay-unpack.js +4621 -0
- package/lib/replay/rrweb-replay.js +4211 -0
- package/lib/rrweb-all.js +8703 -0
- package/lib/rrweb.js +7289 -0
- package/package.json +41 -43
- package/typings/entries/all.d.ts +6 -0
- package/{dist → typings}/entries/record-pack.d.ts +0 -0
- package/{dist → typings}/entries/replay-unpack.d.ts +0 -0
- package/{dist → typings}/index.d.ts +1 -2
- package/{dist → typings}/packer/base.d.ts +0 -0
- package/{dist → typings}/packer/index.d.ts +0 -0
- package/{dist → typings}/packer/pack.d.ts +0 -0
- package/{dist → typings}/packer/unpack.d.ts +0 -0
- package/{dist → typings}/plugins/console/record/error-stack-parser.d.ts +0 -0
- package/{dist → typings}/plugins/console/record/index.d.ts +3 -2
- package/{dist → typings}/plugins/console/record/stringify.d.ts +0 -0
- package/{dist → typings}/plugins/console/replay/index.d.ts +2 -2
- package/{dist → typings}/plugins/sequential-id/record/index.d.ts +0 -0
- package/{dist → typings}/plugins/sequential-id/replay/index.d.ts +0 -0
- package/{dist → typings}/record/iframe-manager.d.ts +1 -1
- package/{dist → typings}/record/index.d.ts +0 -0
- package/{dist → typings}/record/mutation.d.ts +5 -8
- package/typings/record/observer.d.ts +7 -0
- package/{dist → typings}/record/observers/canvas/2d.d.ts +0 -0
- package/{dist → typings}/record/observers/canvas/canvas-manager.d.ts +0 -0
- package/{dist → typings}/record/observers/canvas/canvas.d.ts +0 -0
- package/{dist → typings}/record/observers/canvas/serialize-args.d.ts +1 -1
- package/{dist → typings}/record/observers/canvas/webgl.d.ts +0 -0
- package/typings/record/observers/canvas/webgl2.d.ts +2 -0
- package/typings/record/shadow-dom-manager.d.ts +21 -0
- package/{dist → typings}/replay/canvas/2d.d.ts +0 -0
- package/{dist → typings}/replay/canvas/index.d.ts +0 -0
- package/{dist → typings}/replay/canvas/webgl.d.ts +0 -0
- package/{dist → typings}/replay/index.d.ts +1 -0
- package/{dist → typings}/replay/machine.d.ts +0 -0
- package/{dist → typings}/replay/smoothscroll.d.ts +0 -0
- package/{dist → typings}/replay/styles/inject-style.d.ts +0 -0
- package/{dist → typings}/replay/timer.d.ts +0 -0
- package/{dist → typings}/replay/virtual-styles.d.ts +1 -1
- package/{dist → typings}/rrdom/index.d.ts +0 -0
- package/{dist → typings}/rrdom/tree-node.d.ts +0 -0
- package/{dist → typings}/types.d.ts +7 -8
- package/{dist → typings}/utils.d.ts +3 -4
- package/CHANGELOG.md +0 -26
- package/README.md +0 -124
- package/README.zh_CN.md +0 -122
- package/dist/entries/all.d.ts +0 -4
- package/dist/index.css +0 -82
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.LICENSE.txt +0 -14
- package/dist/index.js.map +0 -1
- package/dist/plugins/entries/all.d.ts +0 -4
- package/dist/plugins/entries/record-pack.d.ts +0 -2
- package/dist/plugins/entries/replay-unpack.d.ts +0 -2
- package/dist/plugins/index.d.ts +0 -9
- package/dist/plugins/packer/base.d.ts +0 -7
- package/dist/plugins/packer/index.d.ts +0 -2
- package/dist/plugins/packer/pack.d.ts +0 -2
- package/dist/plugins/packer/unpack.d.ts +0 -2
- package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
- package/dist/plugins/plugins/console/record/index.d.ts +0 -41
- package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
- package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
- package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
- package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
- package/dist/plugins/record/iframe-manager.d.ts +0 -13
- package/dist/plugins/record/index.d.ts +0 -9
- package/dist/plugins/record/mutation.d.ts +0 -45
- package/dist/plugins/record/observer.d.ts +0 -11
- package/dist/plugins/record/observers/canvas/2d.d.ts +0 -2
- package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
- package/dist/plugins/record/observers/canvas/canvas.d.ts +0 -2
- package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
- package/dist/plugins/record/observers/canvas/webgl.d.ts +0 -2
- package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
- package/dist/plugins/replay/canvas/2d.d.ts +0 -9
- package/dist/plugins/replay/canvas/index.d.ts +0 -9
- package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
- package/dist/plugins/replay/index.d.ts +0 -82
- package/dist/plugins/replay/machine.d.ts +0 -85
- package/dist/plugins/replay/smoothscroll.d.ts +0 -1
- package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
- package/dist/plugins/replay/timer.d.ts +0 -19
- package/dist/plugins/replay/virtual-styles.d.ts +0 -43
- package/dist/plugins/rrdom/index.d.ts +0 -1
- package/dist/plugins/rrdom/tree-node.d.ts +0 -20
- package/dist/plugins/snapshot/css.d.ts +0 -92
- package/dist/plugins/snapshot/index.d.ts +0 -5
- package/dist/plugins/snapshot/rebuild.d.ts +0 -19
- package/dist/plugins/snapshot/snapshot.d.ts +0 -49
- package/dist/plugins/snapshot/types.d.ts +0 -99
- package/dist/plugins/snapshot/utils.d.ts +0 -11
- package/dist/plugins/types.d.ts +0 -509
- package/dist/plugins/utils.d.ts +0 -71
- package/dist/record/observer.d.ts +0 -11
- package/dist/record/shadow-dom-manager.d.ts +0 -34
- package/dist/snapshot/css.d.ts +0 -92
- package/dist/snapshot/index.d.ts +0 -5
- package/dist/snapshot/rebuild.d.ts +0 -19
- package/dist/snapshot/snapshot.d.ts +0 -49
- package/dist/snapshot/types.d.ts +0 -99
- package/dist/snapshot/utils.d.ts +0 -11
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjcgNSAxOCAxOCIgaGVpZ2h0PSIzMDAiIHdpZHRoPSIzMDAiPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04LjIgMjAuOXYtMTZsMTEuNiAxMS42SDEzbC0uNC4xeiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy4zIDIxLjZsLTMuNiAxLjVMOSAxMmwzLjctMS41eiIvPjxwYXRoIGQ9Ik0xMS4wMyAxNC4yOTNsMS44NDUtLjc3NCAzLjA5NiA3LjM3Ni0xLjg0NC43NzV6Ii8+PHBhdGggZD0iTTkuMiA3LjN2MTEuMmwzLTIuOS40LS4xaDQuOHoiLz48L3N2Zz4=");border-color:transparent}.replayer-mouse:after{background:transparent}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-radius:100%;margin-left:-37px;margin-top:-37px;border:4px solid rgba(73,80,246,0);transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px;background:transparent}75%{width:24px;height:24px;opacity:.8;background:#dc2626}to{background:transparent}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}
|
|
2
|
+
/*# sourceMappingURL=rrweb-replay-unpack.min.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,kBACE,iBACF,CACA,gBACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,2CAA+C,CAC/C,uBAAwB,CACxB,uBAAkC,CAClC,2BAA4B,CAC5B,0cAAuzB,CACvzB,wBACF,CAEA,sBACE,sBACF,CAEA,6BACE,iCACF,CACA,6BACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CAGZ,kBAAmB,CACnB,iBAAkB,CAClB,gBAAiB,CACjB,kCAAkC,CAClC,oEACF,CACA,0CACE,oBAAkC,CAClC,wEACF,CACA,mCACE,SACF,CACA,0CACE,uCACF,CACA,qBACE,iBAAkB,CAClB,mBACF,CAEA,iBACE,GACE,UAAY,CACZ,UAAW,CACX,WAAY,CACZ,sBACF,CACA,IACE,UAAW,CACX,WAAY,CACZ,UAAY,CACZ,kBACF,CACA,GACE,sBACF,CACF,CAEA,uBACE,GACE,SAAU,CACV,UAAW,CACX,WACF,CACA,IACE,UAAY,CACZ,UAAW,CACX,WACF,CACF","file":"rrweb-replay-unpack.min.css","sourcesContent":[".replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n\n.replayer-mouse::after {\n background: transparent;\n}\n\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n background: transparent;\n }\n 75% {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n background: #dc2626;\n }\n 100% {\n background: transparent;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var rrwebReplay=function(e){"use strict";
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */var t,r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function o(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var r=1,n=1;function i(e){var t=e.match(/\n/g);t&&(r+=t.length);var i=e.lastIndexOf("\n");n=-1===i?n+e.length:e.length-i}function o(){var e={line:r,column:n};return function(t){return t.position=new a(e),v(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var l=[];function d(i){var o=new Error(t.source+":"+r+":"+n+": "+i);if(o.reason=i,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;l.push(o)}function f(){return m(/^{\s*/)}function h(){return m(/^}/)}function p(){var t,r=[];for(v(),y(r);e.length&&"}"!==e.charAt(0)&&(t=A()||C());)!1!==t&&(r.push(t),y(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return i(n),e=e.slice(n.length),r}}function v(){m(/^\s*/)}function y(e){var t;for(void 0===e&&(e=[]);t=g();)!1!==t&&e.push(t),t=g();return e}function g(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return d("End of comment missing");var a=e.slice(2,r-2);return n+=2,i(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function b(){var e=m(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function w(){var e=o(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=c(t[0]);if(!m(/^:\s*/))return d("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(s,""),value:n?c(n[0]).replace(s,""):""});return m(/^[;\s]*/),i}}function x(){var e,t=[];if(!f())return d("missing '{'");for(y(t);e=w();)!1!==e&&(t.push(e),y(t)),e=w();return h()?t:d("missing '}'")}function S(){for(var e,t=[],r=o();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:x()})}var T,E=N("import"),M=N("charset"),I=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=m(t);if(n){var i={type:e};return i[e]=n[1].trim(),r(i)}}}function A(){if("@"===e[0])return function(){var e=o(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return d("@keyframes missing name");var n,i=t[1];if(!f())return d("@keyframes missing '{'");for(var a=y();n=S();)a.push(n),a=a.concat(y());return h()?e({type:"keyframes",name:i,vendor:r,keyframes:a}):d("@keyframes missing '}'")}}()||function(){var e=o(),t=m(/^@media *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@media missing '{'");var n=y().concat(p());return h()?e({type:"media",media:r,rules:n}):d("@media missing '}'")}}()||function(){var e=o(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=o(),t=m(/^@supports *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@supports missing '{'");var n=y().concat(p());return h()?e({type:"supports",supports:r,rules:n}):d("@supports missing '}'")}}()||E()||M()||I()||function(){var e=o(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=c(t[1]),n=c(t[2]);if(!f())return d("@document missing '{'");var i=y().concat(p());return h()?e({type:"document",document:n,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=o();if(m(/^@page */)){var t=b()||[];if(!f())return d("@page missing '{'");for(var r,n=y();r=w();)n.push(r),n=n.concat(y());return h()?e({type:"page",selectors:t,declarations:n}):d("@page missing '}'")}}()||function(){var e=o();if(m(/^@host\s*/)){if(!f())return d("@host missing '{'");var t=y().concat(p());return h()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=o();if(m(/^@font-face\s*/)){if(!f())return d("@font-face missing '{'");for(var t,r=y();t=w();)r.push(t),r=r.concat(y());return h()?e({type:"font-face",declarations:r}):d("@font-face missing '}'")}}()}function C(){var e=o(),t=b();return t?(y(),e({type:"rule",selectors:t,declarations:x()})):d("selector missing")}return u((T=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}function u(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,i=0,o=Object.keys(e);i<o.length;i++){var a=e[o[i]];Array.isArray(a)?a.forEach((function(e){u(e,n)})):a&&"object"==typeof a&&u(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var d={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var f=/([^\\]):hover/,h=new RegExp(f.source,"g");function p(e,t){var r;if(!(null===(r=window.HIG_CONFIGURATION)||void 0===r?void 0:r.enableOnHoverClass))return e;var n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;var i=l(e,{silent:!0});if(!i.stylesheet)return e;var o=[];if(i.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&o.push(e)}))})),0===o.length)return e;var a=new RegExp(o.filter((function(e,t){return o.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),s=e.replace(a,(function(e){var t=e.replace(h,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,s),s}function m(){return{stylesWithHoverClass:new Map}}function v(e,r){var n=r.doc,i=r.hackCss,o=r.cache;switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var a,s=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var l=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if("option"===s&&"selected"===t&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===t){var l=document.createElement("img");l.src=r,l.onload=function(){var e=a.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}else if("img"===s&&"rr_dataURL"===t){var c=a;c.currentSrc.startsWith("data:")||(c.setAttribute("rrweb-original-src",e.attributes.src),c.src=r)}if("rr_width"===t)a.style.width=r;else if("rr_height"===t)a.style.height=r;else if("rr_mediaCurrentTime"===t)a.currentTime=e.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===t)switch(r){case"played":a.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":a.pause()}}else{var u="textarea"===s&&"value"===t,d="style"===s&&"_cssText"===t;if(d&&i&&"string"==typeof(r=p(r,o))){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,h=void 0,m=[];null!==(h=f.exec(r));)h.index===f.lastIndex&&f.lastIndex++,h.forEach((function(e,t){if(0===t){var r=e.slice(5,e.length-2);m.push({originalUrl:r,proxyUrl:r.replace(r,"https://replay-cors-proxy.highlightrun.workers.dev?url="+r)})}}));m.forEach((function(e){r=r.replace(e.originalUrl,e.proxyUrl)}))}if(u||d){for(var v=n.createTextNode(r),y=0,g=Array.from(a.childNodes);y<g.length;y++){var b=g[y];b.nodeType===a.TEXT_NODE&&a.removeChild(b)}return a.appendChild(v),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,r);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,r);else{if("meta"===s&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return a.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===s&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===s&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(t,r))}}catch(e){}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case t.Text:return n.createTextNode(e.isStyle&&i?p(e.textContent,o):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function y(e,r){var n=r.doc,i=r.map,o=r.skipChild,s=void 0!==o&&o,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,d=r.cache,f=v(e,{doc:n,hackCss:c,cache:d});if(!f)return null;if(e.rootId&&console.assert(i[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==t.DocumentType&&(e.childNodes[0].type===t.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=n),f.__sn=e,i[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var h=0,p=e.childNodes;h<p.length;h++){var m=p[h],g=y(m,{doc:n,map:i,skipChild:!1,hackCss:c,afterAppend:u,cache:d});g?(m.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(g):f.appendChild(g),u&&u(g)):console.warn("Failed to rebuild",m)}return f}function g(e,r){var n=r.doc,i=r.onVisit,o=r.hackCss,a={},s=y(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){i&&i(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var i in r.attributes)if(r.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=r.attributes[i];"rr_scrollLeft"===i&&(n.scrollLeft=o),"rr_scrollTop"===i&&(n.scrollTop=o)}}}(e)})),[s,a]}function b(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}var w,x,S,T,E,M,I=Object.freeze({__proto__:null,default:b});function N(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?p.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):p.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;p.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=f(this),n=r.getBoundingClientRect(),o=this.getBoundingClientRect();r!==t.body?(p.call(this,r,r.scrollLeft+o.left-n.left,r.scrollTop+o.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function d(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function h(t){var r,n,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*r,i=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,i),n===t.x&&i===t.y||e.requestAnimationFrame(h.bind(e,t))}function p(r,n,a){var l,c,u,d,f=o();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,d=s),h({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:n,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(w||(w={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(x||(x={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(S||(S={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(T||(T={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(E||(E={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(M||(M={}));var A,C=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.replaceActions=function(e){var t;this.actions.length=0,(t=this.actions).splice.apply(t,o([0,0],i(e),!1))},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var i=performance.now();for(r.timeOffset+=(i-e)*r.speed,e=i;t.length;){var o=t[0];if(!(r.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n+1;r=n-1}}return t},e}();function k(e,t){if(e.type===w.IncrementalSnapshot&&e.data.source===x.MouseMove){var r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}
|
|
16
|
+
/*! *****************************************************************************
|
|
17
|
+
Copyright (c) Microsoft Corporation.
|
|
18
|
+
|
|
19
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
+
purpose with or without fee is hereby granted.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
+
***************************************************************************** */function D(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(A||(A={}));var _={type:"xstate.init"};function R(e){return void 0===e?[]:[].concat(e)}function L(e){return{type:"xstate.assign",assignment:e}}function P(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function O(e){return function(t){return e===t}}function F(e){return"string"==typeof e?{type:e}:e}function W(e,t){return{value:e,context:t,actions:[],changed:!1,matches:O(e)}}function U(e,t,r){var n=t,i=!1;return[e.filter((function(e){if("xstate.assign"===e.type){i=!0;var t=Object.assign({},n);return"function"==typeof e.assignment?t=e.assignment(n,r):Object.keys(e.assignment).forEach((function(i){t[i]="function"==typeof e.assignment[i]?e.assignment[i](n,r):e.assignment[i]})),n=t,!1}return!0})),n,i]}function j(e,t){void 0===t&&(t={});var r=D(U(R(e.states[e.initial].entry).map((function(e){return P(e,t.actions)})),e.context,_),2),n=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:O(e.initial)},transition:function(t,r){var n,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=F(r),u=e.states[s];if(u.on){var d=R(u.on[c.type]);try{for(var f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),h=f.next();!h.done;h=f.next()){var p=h.value;if(void 0===p)return W(s,l);var m="string"==typeof p?{target:p}:p,v=m.target,y=m.actions,g=void 0===y?[]:y,b=m.cond,w=void 0===b?function(){return!0}:b,x=void 0===v,S=null!=v?v:s,T=e.states[S];if(w(l,c)){var E=D(U((x?R(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return P(e,o._options.actions)})),l,c),3),M=E[0],I=E[1],N=E[2],A=null!=v?v:s;return{value:A,context:I,actions:M,changed:v!==s||M.length>0||N,matches:O(A)}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}return W(s,l)}};return o}var B=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function V(e){var t=e.initialState,r=A.NotStarted,n=new Set,i={_machine:e,send:function(i){r===A.Running&&(t=e.transition(t,i),B(t,F(i)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var o="object"==typeof n?n:{context:e.config.context,value:n};t={value:o.value,actions:[],context:o.context,matches:O(o.value)}}return r=A.Running,B(t,_),i},stop:function(){return r=A.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}function G(e,t){var i=t.getCastFn,o=t.applyEventsSynchronously,a=t.emitter;return V(j({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:L({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:L((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),r(r({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,r,s,l,c,u=e.timer,d=e.events,f=e.baselineTime,h=e.lastPlayedEvent;u.clear();try{for(var p=n(d),m=p.next();!m.done;m=p.next()){k(m.value,f)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var v=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===w.Meta&&n.timestamp<=t)return e.slice(r)}return e}(d,f),y=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===w.IncrementalSnapshot&&h.data.source===x.MouseMove&&(y=h.timestamp+(null===(c=h.data.positions[0])||void 0===c?void 0:c.timeOffset)),f<(y||0)&&a.emit(M.PlayBack);var g=new Array,b=new Array,S=function(e){if(y&&y<f&&(e.timestamp<=y||e===h))return"continue";if(e.timestamp<f)g.push(e);else{var t=i(e,!1);b.push({doAction:function(){t()},delay:e.delay})}};try{for(var T=n(v),E=T.next();!E.done;E=T.next()){S(E.value)}}catch(e){s={error:e}}finally{try{E&&!E.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}o(g),a.emit(M.Flush),u.addActions(b),u.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:L((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:L({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),replaceEvents:L((function(e,t){var o,a,s=e.events,l=e.timer,c=e.baselineTime;if("REPLACE_EVENTS"===t.type){var u=t.payload.events;s.length=0;var d=[],f=function(e){if(k(e,c),s.push(e),e.timestamp>=l.timeOffset+c){var t=i(e,!1);d.push({doAction:function(){t()},delay:e.delay})}};try{for(var h=n(u),p=h.next();!p.done;p=h.next()){f(p.value)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}l.isActive()&&l.replaceActions(d)}return r(r({},e),{events:s})})),addEvent:L((function(e,t){var n=e.baselineTime,o=e.timer,a=e.events;if("ADD_EVENT"===t.type){var s=t.payload.event;k(s,n);var l=a.length-1;if(!a[l]||a[l].timestamp<=s.timestamp)a.push(s);else{for(var c=-1,u=0;u<=l;){var d=Math.floor((u+l)/2);a[d].timestamp<=s.timestamp?u=d+1:l=d-1}-1===c&&(c=u),a.splice(c,0,s)}var f=s.timestamp<n,h=i(s,f);f?h():o.isActive()&&o.addAction({doAction:function(){h()},delay:s.delay})}return r(r({},e),{events:a})}))}}))}var H="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",z={map:{},getId:function(){return console.error(H),-1},getNode:function(){return console.error(H),null},removeNodeFromMap:function(){console.error(H)},has:function(){return console.error(H),!1},reset:function(){console.error(H)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(z=new Proxy(z,{get:function(e,t,r){return"map"===t&&console.error(H),Reflect.get(e,t,r)}}));var Y=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},e.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),i=this.indexes.get(e.id),o=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&o(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var i=n.parent;i&&(delete n.parent,delete i.children[n.id],r.indexes.delete(e.id))}};i?n?(delete i.parent,delete n.children[i.id],this.indexes.delete(e.id),a(i)):(delete this.tree[i.id],this.indexes.delete(i.id),a(i)):(this.removeNodeMutations.push(e),o(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,r,i,o=this,a=this,s=a.tree,l=a.removeNodeMutations,c=a.textMutations,u=a.attributeMutations,d={source:x.Mutation,removes:l,texts:c,attributes:u,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),d.attributes=d.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(s).forEach((function(e){return f(e,!1)}));try{for(var h=n(this.scrollMap.keys()),p=h.next();!p.done;p=h.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var v=n(this.inputMap.keys()),y=v.next();!y.done;y=v.next()){m=y.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e}();function X(e){var t,r,i={},o=function(e,t){var r={value:e,parent:t,children:[]};return i[e.node.id]=r,r},a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var h=f.parent.children.indexOf(f);f.parent.children.splice(h,0,o(c,f.parent))}else{h=a.indexOf(f);a.splice(h,0,o(c,null))}}else if(d in i){var p=i[d];p.children.push(o(c,p))}else a.push(o(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function Q(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)Q(e.children[r],t)}function q(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function J(e,t){var r,n,i=null===(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===n?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=i.getBoundingClientRect(),a=J(i,t),s=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function $(e){return Boolean(null==e?void 0:e.shadowRoot)}var K;function Z(e,t){var r=e[t[0]];return 1===t.length?r:Z(r.cssRules[t[1]].cssRules,t.slice(2))}function ee(e){var t=o([],i(e),!1),r=t.pop();return{positions:t,index:r}}function te(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===K.Insert)try{if(Array.isArray(e.index)){var n=ee(e.index),o=n.positions,a=n.index;Z(r.cssRules,o).insertRule(e.cssText,a)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===K.Remove)try{if(Array.isArray(e.index)){var s=ee(e.index);o=s.positions,a=s.index;Z(r.cssRules,o).deleteRule(a||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===K.Snapshot)!function(e,t){var r;try{var n=Array.from((null===(r=t.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText})),o=Object.entries(n).reverse(),a=n.length;o.forEach((function(r){var n,o=i(r,2),s=o[0],l=o[1],c=e.indexOf(l);if(-1===c||c>a)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(s))}catch(e){}a=c})),e.forEach((function(e,r){var n,i,o;try{(null===(i=null===(n=t.sheet)||void 0===n?void 0:n.cssRules[r])||void 0===i?void 0:i.cssText)!==e&&(null===(o=t.sheet)||void 0===o||o.insertRule(e,r))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===K.SetProperty){Z(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===K.RemoveProperty){Z(r.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(K||(K={}));for(var re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ne="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ie=0;ie<re.length;ie++)ne[re.charCodeAt(ie)]=ie;var oe=new Map;function ae(e,t){var r=oe.get(e);return r||(r=new Map,oe.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var se=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function le(e,t){return function(r){if(r&&"object"==typeof r&&"rr_type"in r){if("index"in r){var n=r.rr_type,a=r.index;return ae(t,n)[a]}if("args"in r){var s=r.rr_type,l=r.args,c=window[s];return new(c.bind.apply(c,o([void 0],i(l.map(le(e,t))),!1)))}if("base64"in r)return function(e){var t,r,n,i,o,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)r=ne[e.charCodeAt(t)],n=ne[e.charCodeAt(t+1)],i=ne[e.charCodeAt(t+2)],o=ne[e.charCodeAt(t+3)],u[l++]=r<<2|n>>4,u[l++]=(15&n)<<4|i>>2,u[l++]=(3&i)<<6|63&o;return c}(r.base64);if("src"in r){var u=e.get(r.src);if(u)return u;var d=new Image;return d.src=r.src,e.set(r.src,d),d}}else if(Array.isArray(r))return r.map(le(e,t));return r}}function ce(e){var t=e.mutation,r=e.target,n=e.type,i=e.imageMap,o=e.errorHandler;try{var a=function(e,t){try{return t===T.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(r,n);if(!a)return;if(t.setter)return void(a[t.property]=t.args[0]);var s=a[t.property],l=t.args.map(le(i,a));!function(e,t){if(null==t?void 0:t.constructor){var r=t.constructor.name;if(se.includes(r)){var n=ae(e,r);n.includes(t)||n.push(t)}}}(a,s.apply(a,l))}catch(e){o(t,e)}}var ue=36e5,de=b||I,fe="[replayer]",he={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function pe(e){return e.type==w.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==S.TouchStart)}var me=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=de(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=m(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:he,inactiveThreshold:.02,inactiveSkipTime:2e3};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(M.Resize,this.handleResize),this.setupDom(),this.treeIndex=new Y,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(M.Flush,(function(){var e,t,i,o,a,s,l,c,u=r.treeIndex.flush(),d=u.scrollMap,f=u.inputMap,h=u.mutationData;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)}));try{for(var p=n(h.texts),m=p.next();!m.done;m=p.next()){var v=m.value;r.applyText(v,h)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}try{for(var y=n(r.virtualStyleRulesMap.keys()),g=y.next();!g.done;g=y.next()){var b=g.value;r.restoreNodeSheet(b)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}r.fragmentParentMap.clear(),r.elementStateMap.clear(),r.virtualStyleRulesMap.clear();try{for(var w=n(d.values()),x=w.next();!x.done;x=w.next()){v=x.value;r.applyScroll(v,!0)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}try{for(var S=n(f.values()),T=S.next();!T.done;T=S.next()){v=T.value;r.applyInput(v)}}catch(e){l={error:e}}finally{try{T&&!T.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}})),this.emitter.on(M.PlayBack,(function(){r.firstFullSnapshot=null,r.mirror.reset()}));var o=new C([],(null==t?void 0:t.speed)||i.speed);this.service=G({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(M.StateChange,{player:e})})),this.speedService=V(j({id:"speed",context:{normalSpeed:-1,timer:o},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:L({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){r.emitter.emit(M.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===w.Meta})),s=this.service.state.context.events.find((function(e){return e.type===w.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){r.emitter.emit(M.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){r.firstFullSnapshot||(r.firstFullSnapshot=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(pe)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getActivityIntervals=function(){var e=this;if(0==this.activityIntervals.length){for(var t=[],r=this.getMetaData(),n=o(o([{timestamp:r.startTime}],i(this.service.state.context.events.filter((function(t){return e.isUserInteraction(t)}))),!1),[{timestamp:r.endTime}],!1),a=1;a<n.length;a++){var s=n[a-1],l=n[a];l.timestamp-s.timestamp>1e4?t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!1}):t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!0})}var c=[],u=t[0];for(a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(c.push({startTime:u.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-u.startTime,active:t[a-1].active}),u=t[a]);u&&t.length>0&&c.push({startTime:u.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-u.startTime,active:t[t.length-1].active}),u=c[0];for(a=1;a<c.length;a++)(!c[a].active&&c[a].duration>this.config.inactiveThreshold*r.totalTime||!c[a-1].active&&c[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:u.startTime,endTime:c[a-1].endTime,duration:c[a-1].endTime-u.startTime,active:c[a-1].active}),u=c[a]);u&&c.length>0&&this.activityIntervals.push({startTime:u.startTime,endTime:c[c.length-1].endTime,duration:c[c.length-1].endTime-u.startTime,active:c[c.length-1].active})}return this.activityIntervals},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(M.Start),this.handleInactivity(this.getMetaData().startTime+e,!0)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(M.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(M.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;pe(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},e.prototype.replaceEvents=function(e){var t,r;try{for(var i=n(e),o=i.next();!o.done;o=i.next()){if(pe(o.value)){this.mouse.classList.add("touch-device");break}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.resetCache=function(){this.cache=m()},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(N(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var i=n([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.applyEventsSynchronously=function(e){var t,r;try{for(var i=n(e),o=i.next();!o.done;o=i.next()){var a=o.value;switch(a.type){case w.DomContentLoaded:case w.Load:case w.Custom:continue;case w.FullSnapshot:case w.Meta:case w.Plugin:break;case w.IncrementalSnapshot:switch(a.data.source){case x.MediaInteraction:continue}}this.getCastFn(a,!0)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},e.prototype.getCastFn=function(e,t){var r,i=this;switch(void 0===t&&(t=!1),e.type){case w.DomContentLoaded:case w.Load:break;case w.Custom:r=function(){i.emitter.emit(M.CustomEvent,e)};break;case w.Meta:r=function(){return i.emitter.emit(M.Resize,{width:e.data.width,height:e.data.height})};break;case w.FullSnapshot:r=function(){if(i.firstFullSnapshot){if(i.firstFullSnapshot===e)return void(i.firstFullSnapshot=!0)}else i.firstFullSnapshot=!0;i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case w.IncrementalSnapshot:r=function(){var r,o;if(i.applyIncremental(e,t),!t&&(i.handleInactivity(e.timestamp),e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=n(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&i.isUserInteraction(l)){l.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=l);break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}if(i.nextUserInteractionEvent){var c=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/2e3),i.config.maxSpeed)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(M.SkipStart,u)}}}}return function(){var o,a;r&&r();try{for(var s=n(i.config.plugins||[]),l=s.next();!l.done;l=s.next()){l.value.handler(e,t,{replayer:i})}}catch(e){o={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}i.service.send({type:"CAST_EVENT",payload:{event:e}});var c=i.service.state.context.events.length-1;if(e===i.service.state.context.events[c]){var u=function(){c<i.service.state.context.events.length-1||(i.backToNormal(),i.service.send("END"),i.emitter.emit(M.Finish))};e.type===w.IncrementalSnapshot&&e.data.source===x.MouseMove&&e.data.positions.length?setTimeout((function(){u()}),Math.max(0,50-e.data.positions[0].timeOffset)):u()}i.emitter.emit(M.EventCast,e)}},e.prototype.handleInactivity=function(e,t){var r,i;if((e===this.inactiveEndTimestamp||t)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){try{for(var o=n(this.getActivityIntervals()),a=o.next();!a.done;a=o.next()){var s=a.value;if(e>=s.startTime&&e<s.endTime&&!s.active){this.inactiveEndTimestamp=s.endTime;break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}if(this.inactiveEndTimestamp){var l=this.inactiveEndTimestamp-e,c={speed:l/ue*this.config.inactiveSkipTime<1e3?l/1e3:Math.round(Math.max(l,ue)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:c}),this.emitter.emit(M.SkipStart,c)}}},e.prototype.rebuildFullSnapshot=function(e,t){var r,i,o=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=g(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)},cache:this.cache})[1];var s=function(e,t){l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e}))},l=this;try{for(var c=n(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}var f=this.iframe.contentDocument,h=f.documentElement,p=f.head;this.insertStyleRules(h,p),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(M.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,i=(n=this.config.blockClass,[".".concat(n," { background: currentColor }"),"noscript { display: none !important; }",".".concat(n," { background: currentColor; border-radius: 5px; }"),".".concat(n,":hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}")]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var o=0;o<i.length;o++)r.sheet.insertRule(i[o],o)},e.prototype.attachDocumentToIframe=function(e,r){var i,o,a=this,s=[];if(!r.contentDocument)for(var l=r.parentNode;l;){if(this.fragmentParentMap.has(l)){var c=l,u=this.fragmentParentMap.get(c);this.restoreRealParent(c,u);break}l=l.parentNode}y(e.node,{doc:r.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(a.collectIframeAndAttachDocument(s,e),e.__sn.type===t.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var n=r.contentDocument,i=n.documentElement,o=n.head;a.insertStyleRules(i,o)}},cache:this.cache});var d=function(e,t){f.attachDocumentToIframe(e,t),f.newDocumentQueue=f.newDocumentQueue.filter((function(t){return t!==e}))},f=this;try{for(var h=n(s),p=h.next();!p.done;p=h.next()){var m=p.value;d(m.mutationInQueue,m.builtNode)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(q(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,r=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(r){var n,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(M.Start,a),this.emitter.on(M.Pause,a);var s=function(){t.emitter.off(M.Start,a),t.emitter.off(M.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==n&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(M.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(M.LoadStylesheetStart),n=setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.hasImageArg=function(e){var t,r;try{for(var i=n(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(a&&"object"==typeof a)if("rr_type"in a&&"args"in a){if(this.hasImageArg(a.args))return!0}else{if("rr_type"in a&&"HTMLImageElement"===a.rr_type)return!0;if(a instanceof Array&&this.hasImageArg(a))return!0}else;}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return!1},e.prototype.getImageArgs=function(e){var t,r,a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value;c&&"object"==typeof c&&("rr_type"in c&&"args"in c?a.push.apply(a,o([],i(this.getImageArgs(c.args)),!1)):"rr_type"in c&&"HTMLImageElement"===c.rr_type?a.push(c.src):c instanceof Array&&a.push.apply(a,o([],i(this.getImageArgs(c)),!1)))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a},e.prototype.preloadAllImages=function(){var e,t,r=this;this.service.state;var i=function(){r.service.state};this.emitter.on(M.Start,i),this.emitter.on(M.Pause,i);var o=function(e){e.type===w.IncrementalSnapshot&&e.data.source===x.CanvasMutation&&("commands"in e.data?e.data.commands.forEach((function(t){return r.preloadImages(t,e)})):a.preloadImages(e.data,e))},a=this;try{for(var s=n(this.service.state.context.events),l=s.next();!l.done;l=s.next()){o(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}},e.prototype.preloadImages=function(e,t){var r=this;if("drawImage"!==e.property||"string"!=typeof e.args[0]||this.imageMap.has(t))this.hasImageArg(e.args)&&this.getImageArgs(e.args).forEach((function(e){var t=new Image;t.src=e,r.imageMap.set(e,t)}));else{var n=document.createElement("canvas"),i=n.getContext("2d"),o=null==i?void 0:i.createImageData(n.width,n.height);null==o||o.data,JSON.parse(e.args[0]),null==i||i.putImageData(o,0,0)}},e.prototype.applyIncremental=function(e,t){var n,i,o=this,a=e.data;switch(a.source){case x.Mutation:t&&(a.adds.forEach((function(e){return o.treeIndex.add(e)})),a.texts.forEach((function(e){var t=o.mirror.getNode(e.id),r=null==t?void 0:t.parentNode;r&&o.virtualStyleRulesMap.has(r)&&o.virtualStyleRulesMap.delete(r),o.treeIndex.text(e)})),a.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),a.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)})));try{this.applyMutation(a,t)}catch(e){this.warn("Exception in mutation ".concat(e.message||e),a)}break;case x.Drag:case x.TouchMove:case x.MouseMove:if(t){var s=a.positions[a.positions.length-1];this.mousePos={x:s.x,y:s.y,id:s.id,debugData:a}}else a.positions.forEach((function(r){var n={doAction:function(){o.moveAndHover(r.x,r.y,r.id,t,a)},delay:r.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=a.positions[0])||void 0===n?void 0:n.timeOffset)});break;case x.MouseInteraction:if(-1===a.id)break;var l=new Event(S[a.type].toLowerCase());if(!(b=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);this.emitter.emit(M.MouseInteraction,{type:a.type,target:b});var c=this.config.triggerFocus;switch(a.type){case S.Blur:"blur"in b&&b.blur();break;case S.Focus:c&&b.focus&&b.focus({preventScroll:!0});break;case S.Click:case S.TouchStart:case S.TouchEnd:t?(a.type===S.TouchStart?this.touchActive=!0:a.type===S.TouchEnd&&(this.touchActive=!1),this.mousePos={x:a.x,y:a.y,id:a.id,debugData:a}):(a.type===S.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x,a.y,a.id,t,a),a.type===S.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===S.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===S.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case S.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:b.dispatchEvent(l)}break;case x.Scroll:if(-1===a.id)break;if(t){this.treeIndex.scroll(a);break}this.applyScroll(a,!1);break;case x.ViewportResize:this.emitter.emit(M.Resize,{width:a.width,height:a.height});break;case x.Input:if(-1===a.id)break;if(t){this.treeIndex.input(a);break}this.applyInput(a);break;case x.MediaInteraction:if(!(b=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var u=b;try{a.currentTime&&(u.currentTime=a.currentTime),a.volume&&(u.volume=a.volume),a.muted&&(u.muted=a.muted),1===a.type&&u.pause(),0===a.type&&u.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: ".concat(e.message||e))}break;case x.StyleSheetRule:if(!(b=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var d,f=b,h=b.parentNode,p=this.fragmentParentMap.has(h),m=p?null:f.sheet;m||(this.virtualStyleRulesMap.has(b)?d=this.virtualStyleRulesMap.get(b):(d=[],this.virtualStyleRulesMap.set(b,d))),a.adds&&a.adds.forEach((function(e){var t=e.rule,r=e.index;if(m)try{if(Array.isArray(r)){var n=ee(r),i=n.positions,o=n.index;Z(m.cssRules,i).insertRule(t,o)}else{o=void 0===r?void 0:Math.min(r,m.cssRules.length);m.insertRule(t,o)}}catch(e){}else null==d||d.push({cssText:t,index:r,type:K.Insert})})),a.removes&&a.removes.forEach((function(e){var t=e.index;if(p)null==d||d.push({index:t,type:K.Remove});else try{if(Array.isArray(t)){var r=ee(t),n=r.positions,i=r.index;Z(m.cssRules,n).deleteRule(i||0)}else null==m||m.deleteRule(t)}catch(e){}}));break;case x.StyleDeclaration:if(!(b=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);f=b;var v=b.parentNode,y=this.fragmentParentMap.has(v)?null:f.sheet,g=[];if(y||(this.virtualStyleRulesMap.has(b)?g=this.virtualStyleRulesMap.get(b):(g=[],this.virtualStyleRulesMap.set(b,g))),a.set)if(y)Z(y.rules,a.index).style.setProperty(a.set.property,a.set.value,a.set.priority);else g.push(r({type:K.SetProperty,index:a.index},a.set));if(a.remove)if(y)Z(y.rules,a.index).style.removeProperty(a.remove.property);else g.push(r({type:K.RemoveProperty,index:a.index},a.remove));break;case x.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var b;if(!(b=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);!function(e){var t=e.event,r=e.mutation,n=e.target,i=e.imageMap,o=e.errorHandler;try{var a="commands"in r?r.commands:[r];[T.WebGL,T.WebGL2].includes(r.type)?a.forEach((function(e){ce({mutation:e,type:r.type,target:n,imageMap:i,errorHandler:o})})):a.forEach((function(e){!function(e){var t=e.event,r=e.mutation,n=e.target,i=e.imageMap,o=e.errorHandler;try{var a=n.getContext("2d");if(r.setter)return void(a[r.property]=r.args[0]);var s=a[r.property];if("drawImage"===r.property&&"string"==typeof r.args[0]){var l=i.get(t);r.args[0]=l,s.apply(a,r.args)}else s.apply(a,r.args)}catch(e){o(r,e)}}({event:t,mutation:e,target:n,imageMap:i,errorHandler:o})}))}catch(e){o(r,e)}}({event:e,mutation:a,target:b,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case x.Font:try{var w=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(w)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,i){var o,a,s=this;e.removes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return s.warnNodeNotFound(e,t.id)}s.virtualStyleRulesMap.has(r)&&s.virtualStyleRulesMap.delete(r);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&$(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var i=null,o="__sn"in n?s.fragmentParentMap.get(n):void 0;o&&o.contains(r)?n=o:s.fragmentParentMap.has(r)&&(i=s.fragmentParentMap.get(r),s.fragmentParentMap.delete(r),r=i);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;s.warn("parent could not remove child in mutation",n,o,r,i,e)}}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,o,a,u;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var d=s.mirror.getNode(e.parentId);if(!d)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var f=null;s.iframe.contentDocument.contains?f=s.iframe.contentDocument.contains(d):s.iframe.contentDocument.body.contains&&(f=s.iframe.contentDocument.body.contains(d));var h=(null===(u=(a=d).getElementsByTagName)||void 0===u?void 0:u.call(a,"iframe").length)>0;if(i&&f&&!q(d)&&!h){var p=document.createDocumentFragment();for(s.mirror.map[e.parentId]=p,s.fragmentParentMap.set(p,d),s.storeState(d);d.firstChild;)p.appendChild(d.firstChild);d=p}e.node.isShadow&&($(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);var m=null,v=null;if(e.previousId&&(m=s.mirror.getNode(e.previousId)),e.nextId&&(v=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var g=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(q(d))s.attachDocumentToIframe(e,d);else{var b=y(e.node,{doc:g,map:s.mirror.map,skipChild:!0,hackCss:!0,cache:s.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in d&&d.__sn.type===t.Element&&"textarea"===d.__sn.tagName&&e.node.type===t.Text)try{for(var w=n(Array.from(d.childNodes)),x=w.next();!x.done;x=w.next()){var S=x.value;S.nodeType===d.TEXT_NODE&&d.removeChild(S)}}catch(e){r={error:e}}finally{try{x&&!x.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(b,m.nextSibling);else if(v&&v.parentNode)d.contains(v)?d.insertBefore(b,v):d.insertBefore(b,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(b)}if(q(b)){var T=s.newDocumentQueue.find((function(e){return e.parentId===b.__sn.id}));T&&(s.attachDocumentToIframe(T,b),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==T})))}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,d,b,e)}else l[e.node.id]={node:b,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=X(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var h=(o=void 0,n(f)),p=h.next();!p.done;p=h.next()){var m=p.value;this.mirror.getNode(m.value.parentId)?Q(m,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}for(var n in s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var i=t.attributes[n];if(null===i)r.removeAttribute(n);else if("string"==typeof i)try{r.setAttribute(n,i)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var o=i,a=r;for(var l in o)if(!1===o[l])a.style.removeProperty(l);else if(o[l]instanceof Array){var c=o[l];a.style.setProperty(l,c[0],c[1])}else{var u=o[l];a.style.setProperty(l,u)}}}}))},e.prototype.applyScroll=function(e,r){var n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:r?"auto":"smooth"});else if(n.__sn.type===t.Document)n.defaultView.scrollTo({top:e.y,left:e.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=e.y,n.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.applyText=function(e,t){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(t,e.id);try{r.textContent=e.value}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,r,n){var i=n.previousId,o=n.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,r,n,i){var o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(i,r);var a=J(o,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left="".concat(s,"px"),this.mouse.style.top="".concat(l,"px"),n||this.drawMouseTail({x:s,y:l}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?he:Object.assign({},he,this.config.mouseTail),n=r.lineCap,i=r.lineWidth,o=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=n,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===w.IncrementalSnapshot&&(e.data.source>x.Mutation&&e.data.source<=x.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(M.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,r){this.mirror.map[r.__sn.id]=r,r.__sn.type===t.Element&&"textarea"===r.__sn.tagName&&e.textContent&&(r.value=e.textContent),r.appendChild(e),this.restoreState(r)},e.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]}),"STYLE"===i.tagName&&function(e,t){var r;try{var n=Array.from((null===(r=e.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:K.Snapshot,cssTexts:n}])}catch(e){}}(i,this.virtualStyleRulesMap);var o=i.children;try{for(var a=n(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var i=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(i.scrollLeft=o.scroll[0],i.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var a=i.children;try{for(var s=n(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&te(t,e))},e.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '".concat(t,"' was previously removed. "),e):this.warn("Node with id '".concat(t,"' not found. "),e)},e.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},e.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug(fe,"Node with id '".concat(t,"' was previously removed. "),e):this.debug(fe,"Node with id '".concat(t,"' not found. "),e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o([fe],i(e),!1))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o([fe],i(e),!1))},e}(),ve=Uint8Array,ye=Uint16Array,ge=Uint32Array,be=new ve([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,0,0,0]),we=new ve([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,0,0]),xe=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Se=function(e,t){for(var r=new ye(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new ge(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Te=Se(be,2),Ee=Te[0],Me=Te[1];Ee[28]=258,Me[258]=28;for(var Ie=Se(we,0)[0],Ne=new ye(32768),Ae=0;Ae<32768;++Ae){var Ce=(43690&Ae)>>>1|(21845&Ae)<<1;Ce=(61680&(Ce=(52428&Ce)>>>2|(13107&Ce)<<2))>>>4|(3855&Ce)<<4,Ne[Ae]=((65280&Ce)>>>8|(255&Ce)<<8)>>>1}var ke=function(e,t,r){for(var n=e.length,i=0,o=new ye(t);i<n;++i)++o[e[i]-1];var a,s=new ye(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(r){a=new ye(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)a[Ne[d]>>>l]=c}else for(a=new ye(n),i=0;i<n;++i)a[i]=Ne[s[e[i]-1]++]>>>15-e[i];return a},De=new ve(288);for(Ae=0;Ae<144;++Ae)De[Ae]=8;for(Ae=144;Ae<256;++Ae)De[Ae]=9;for(Ae=256;Ae<280;++Ae)De[Ae]=7;for(Ae=280;Ae<288;++Ae)De[Ae]=8;var _e=new ve(32);for(Ae=0;Ae<32;++Ae)_e[Ae]=5;var Re=ke(De,9,1),Le=ke(_e,5,1),Pe=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Oe=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(7&t)&r},Fe=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},We=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof ye?ye:e instanceof ge?ge:ve)(r-t);return n.set(e.subarray(t,r)),n};function Ue(e,t){return function(e,t,r){var n=e.length,i=!t||r,o=!r||r.i;r||(r={}),t||(t=new ve(3*n));var a,s=function(e){var r=t.length;if(e>r){var n=new ve(Math.max(2*r,e));n.set(t),t=n}},l=r.f||0,c=r.p||0,u=r.b||0,d=r.l,f=r.d,h=r.m,p=r.n,m=8*n;do{if(!d){r.f=l=Oe(e,c,1);var v=Oe(e,c+1,3);if(c+=3,!v){var y=e[(A=((a=c)/8>>0)+(7&a&&1)+4)-4]|e[A-3]<<8,g=A+y;if(g>n){if(o)throw"unexpected EOF";break}i&&s(u+y),t.set(e.subarray(A,g),u),r.b=u+=y,r.p=c=8*g;continue}if(1==v)d=Re,f=Le,h=9,p=5;else{if(2!=v)throw"invalid block type";var b=Oe(e,c,31)+257,w=Oe(e,c+10,15)+4,x=b+Oe(e,c+5,31)+1;c+=14;for(var S=new ve(x),T=new ve(19),E=0;E<w;++E)T[xe[E]]=Oe(e,c+3*E,7);c+=3*w;var M=Pe(T),I=(1<<M)-1;if(!o&&c+x*(M+7)>m)break;var N=ke(T,M,1);for(E=0;E<x;){var A,C=N[Oe(e,c,I)];if(c+=15&C,(A=C>>>4)<16)S[E++]=A;else{var k=0,D=0;for(16==A?(D=3+Oe(e,c,3),c+=2,k=S[E-1]):17==A?(D=3+Oe(e,c,7),c+=3):18==A&&(D=11+Oe(e,c,127),c+=7);D--;)S[E++]=k}}var _=S.subarray(0,b),R=S.subarray(b);h=Pe(_),p=Pe(R),d=ke(_,h,1),f=ke(R,p,1)}if(c>m)throw"unexpected EOF"}i&&s(u+131072);for(var L=(1<<h)-1,P=(1<<p)-1,O=h+p+18;o||c+O<m;){var F=(k=d[Fe(e,c)&L])>>>4;if((c+=15&k)>m)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(F<256)t[u++]=F;else{if(256==F){d=null;break}var W=F-254;if(F>264){var U=be[E=F-257];W=Oe(e,c,(1<<U)-1)+Ee[E],c+=U}var j=f[Fe(e,c)&P],B=j>>>4;if(!j)throw"invalid distance";if(c+=15&j,R=Ie[B],B>3&&(U=we[B],R+=Fe(e,c)&(1<<U)-1,c+=U),c>m)throw"unexpected EOF";i&&s(u+131072);for(var V=u+W;u<V;u+=4)t[u]=t[u-R],t[u+1]=t[u+1-R],t[u+2]=t[u+2-R],t[u+3]=t[u+3-R];u=V}}r.l=d,r.p=c,r.b=u,d&&(l=1,r.m=h,r.d=f,r.n=p)}while(!l);return u==t.length?t:We(t,0,u)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}return e.Replayer=me,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(Ue(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new ve(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},a=0;a<r;++a){if(i+5>n.length){var s=new ve(i+8+(r-a<<1));s.set(n),n=s}var l=e.charCodeAt(a);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return We(n,0,i)}(e,!0))))).v)return t;throw new Error("These events were packed with packer ".concat(t.v," which is incompatible with current packer ").concat("v1","."))}catch(e){throw console.error(e),new Error("Unknown data format.")}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
30
|
+
//# sourceMappingURL=rrweb-replay-unpack.min.js.map
|