@amplitude/rrweb-player 2.0.0-alpha.20 → 2.0.0-alpha.22
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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/lib/index.cjs +3 -3
- package/lib/index.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function f(e){return document.createTextNode(e)}function m(){return f(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function w(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function b(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function S(){if(!E)throw new Error("Function called outside component initialization");return E}function T(e){S().$$.on_mount.push(e)}function D(e){S().$$.on_destroy.push(e)}function M(){const e=S();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let B;function U(){B={r:0,c:[],p:B}}function j(){B.r||o(B.c),B=B.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),B.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let f=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),f&&Y(t,e)),n})):[],p.update(),f=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=D()||M());)t&&(n.push(t),f(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function f(e=[]){let t;for(;t=m();)t&&e.push(t),t=m();return e}function m(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}const g=new RegExp("^(("+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^{]"].join("|")+")+)");function y(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(g);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",i=0,o=0,s=null;for(const r of e){const e=n.endsWith("\\");s?s!==r||e||(s=null):"("===r?i++:")"===r?i--:"["===r?o++:"]"===r?o--:"'\"".includes(r)&&(s=r),","===r&&0===i&&0===o?(t.push(n),n=""):n+=r}n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function v(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function w(){const e=[];if(!c())return l("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e)),t=v();return u()?e:l("missing '}'")}function b(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}const E=T("import"),N=T("charset"),S=T("namespace");function T(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function D(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=f();for(;o=b();)r.push(o),r=r.concat(f());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=f().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=f().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||E()||N()||S()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=y()||[];if(!c())return l("@page missing '{'");let n,i=f();for(;n=v();)i.push(n),i=i.concat(f());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function M(){const e=s(),t=y();return t?(f(),e({type:"rule",selectors:t,declarations:w()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const oe={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"};function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){const{doc:n,hackCss:i,cache:o}=t;switch(e.type){case Q.Document:return n.implementation.createDocument(null,"",null);case Q.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let s;s=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",t):n.createElement(t);const r={};for(const a in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,a))continue;let l=e.attributes[a];if("option"===t&&"selected"===a&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),a.startsWith("rr_")){r[a]=l;continue}const c="textarea"===t&&"value"===a,u="style"===t&&"_cssText"===a;if(u&&i&&"string"==typeof l&&(l=ue(l,o)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===a)s.setAttributeNS("http://www.w3.org/1999/xlink",a,l.toString());else if("onload"===a||"onclick"===a||"onmouse"===a.substring(0,7))s.setAttribute("_"+a,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===a){s.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(a,l.toString())))}}catch(e){}else s.appendChild(n.createTextNode(l)),e.childNodes=[]}for(const n in r){const i=r[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=s.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.toString(),s.RRNodeType&&(s.rr_dataURL=i.toString())}else if("img"===t&&"rr_dataURL"===n){const t=s;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=i.toString())}if("rr_width"===n)s.style.width=i.toString();else if("rr_height"===n)s.style.height=i.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof i)s.currentTime=i;else if("rr_mediaState"===n)switch(i){case"played":s.play().catch((e=>console.warn("media playback error",e)));break;case"paused":s.pause()}}if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s}case Q.Text:return n.createTextNode(e.isStyle&&i?ue(e.textContent,o):e.textContent);case Q.CDATA:return n.createCDATASection(e.textContent);case Q.Comment:return n.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.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" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function fe(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var me=(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",e))(me||{}),ge=(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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(ge||{}),ye=(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",e))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),we=(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",e.Destroy="destroy",e))(we||{});const be="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.";let Ee={map:{},getId:()=>(console.error(be),-1),getNode:()=>(console.error(be),null),removeNodeFromMap(){console.error(be)},has:()=>(console.error(be),!1),reset(){console.error(be)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Se(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Se(e.children[n],t)}function Te(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function De(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=De(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function Me(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(be),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
|
|
1
|
+
var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function m(e){return document.createTextNode(e)}function f(){return m(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function b(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function w(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function T(){if(!E)throw new Error("Function called outside component initialization");return E}function S(e){T().$$.on_mount.push(e)}function M(e){T().$$.on_destroy.push(e)}function D(){const e=T();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let B;function U(){B={r:0,c:[],p:B}}function j(){B.r||o(B.c),B=B.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),B.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let m=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),m&&Y(t,e)),n})):[],p.update(),m=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=M()||D());)t&&(n.push(t),m(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function m(e=[]){let t;for(;t=f();)t&&e.push(t),t=f();return e}function f(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}const g=new RegExp("^(("+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^{]"].join("|")+")+)");function y(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(g);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",i=0,o=0,s=null;for(const r of e){const e=n.endsWith("\\");s?s!==r||e||(s=null):"("===r?i++:")"===r?i--:"["===r?o++:"]"===r?o--:"'\"".includes(r)&&(s=r),","===r&&0===i&&0===o?(t.push(n),n=""):n+=r}n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function v(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function b(){const e=[];if(!c())return l("missing '{'");let t;for(m(e);t=v();)!1!==t&&(e.push(t),m(e)),t=v();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const E=S("import"),N=S("charset"),T=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function M(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=m();for(;o=w();)r.push(o),r=r.concat(m());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=m().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=m().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||E()||N()||T()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=y()||[];if(!c())return l("@page missing '{'");let n,i=m();for(;n=v();)i.push(n),i=i.concat(m());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=m();for(;t=v();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const oe={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"};function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){var n;const{doc:i,hackCss:o,cache:s}=t;switch(e.type){case Q.Document:return i.implementation.createDocument(null,"",null);case Q.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let r;e.isSVG?r=i.createElementNS("http://www.w3.org/2000/svg",t):(e.isCustom&&(null===(n=i.defaultView)||void 0===n?void 0:n.customElements)&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),r=i.createElement(t));const a={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;let l=e.attributes[n];if("option"===t&&"selected"===n&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),n.startsWith("rr_")){a[n]=l;continue}const c="textarea"===t&&"value"===n,u="style"===t&&"_cssText"===n;if(u&&o&&"string"==typeof l&&(l=ue(l,s)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===n)r.setAttributeNS("http://www.w3.org/1999/xlink",n,l.toString());else if("onload"===n||"onclick"===n||"onmouse"===n.substring(0,7))r.setAttribute("_"+n,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===n){r.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?r.setAttribute("rrweb-original-srcset",e.attributes.srcset):r.setAttribute(n,l.toString())))}}catch(e){}else r.appendChild(i.createTextNode(l)),e.childNodes=[]}for(const n in a){const i=a[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.toString(),r.RRNodeType&&(r.rr_dataURL=i.toString())}else if("img"===t&&"rr_dataURL"===n){const t=r;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=i.toString())}if("rr_width"===n)r.style.width=i.toString();else if("rr_height"===n)r.style.height=i.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof i)r.currentTime=i;else if("rr_mediaState"===n)switch(i){case"played":r.play().catch((e=>console.warn("media playback error",e)));break;case"paused":r.pause()}else"rr_mediaPlaybackRate"===n&&"number"==typeof i?r.playbackRate=i:"rr_mediaMuted"===n&&"boolean"==typeof i?r.muted=i:"rr_mediaLoop"===n&&"boolean"==typeof i?r.loop=i:"rr_mediaVolume"===n&&"number"==typeof i&&(r.volume=i)}if(e.isShadowHost)if(r.shadowRoot)for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.firstChild);else r.attachShadow({mode:"open"});return r}case Q.Text:return i.createTextNode(e.isStyle&&o?ue(e.textContent,s):e.textContent);case Q.CDATA:return i.createCDATASection(e.textContent);case Q.Comment:return i.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.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" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function me(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var fe=(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",e))(fe||{}),ge=(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",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ge||{}),ye=(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",e))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),be=(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",e.Destroy="destroy",e))(be||{});const we="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.";let Ee={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Te(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Te(e.children[n],t)}function Se(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=Me(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function De(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function ke(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ie="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;Oe<Ae.length;Oe++)Ie[Ae.charCodeAt(Oe)]=Oe;var _e;K(),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"}(_e||(_e={}));class $e{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Le(e){const t=[];for(const n in e){const i=e[n];if("string"!=typeof i)continue;const o=je(n);t.push(`${o}: ${i};`)}return t.join(" ")}const Fe=/-([a-z])/g,Pe=/^--[a-zA-Z0-9-]+$/,Be=e=>Pe.test(e)?e:e.replace(Fe,((e,t)=>t?t.toUpperCase():"")),Ue=/\B([A-Z])/g,je=e=>e.replace(Ue,"-$1").toLowerCase();class Ve{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=Ze.ELEMENT_NODE,this.TEXT_NODE=Ze.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Ve))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function We(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Ze.DOCUMENT_TYPE_NODE,this.RRNodeType=_e.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(e){super(),this.nodeType=Ze.ELEMENT_NODE,this.RRNodeType=_e.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new qe(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const i=e.split(n);i.length>1&&(t[Be(i[0].trim())]=i[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,i,o)=>{if(t.test(n))return;const s=Be(n);i?e[s]=i:delete e[s],"important"===o&&(e[s]+=" !important"),this.attributes.style=Le(e)},e.removeProperty=n=>{if(t.test(n))return"";const i=Be(n),o=e[i]||"";return delete e[i],this.attributes.style=Le(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Xe(this,e)}insertBefore(e,t){return Qe(this,e,t)}removeChild(e){return Je(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function Ge(e){return class extends e{constructor(e){super(),this.nodeType=Ze.TEXT_NODE,this.nodeName="#text",this.RRNodeType=_e.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function He(e){return class extends e{constructor(e){super(),this.nodeType=Ze.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=_e.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Ye(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Ze.CDATA_SECTION_NODE,this.RRNodeType=_e.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class qe{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function Xe(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Qe(e,t,n){if(!n)return Xe(e,t);if(n.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Je(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Ze;!function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Ze||(Ze={}));const Ke={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},et={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"};let tt=null;function nt(e,t,n,i=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,i){var o;n.afterAppend&&!tt&&(tt=new WeakSet,setTimeout((()=>{tt=null}),0));if(!st(e,t)){const s=ot(t,n.mirror,i);null===(o=e.parentNode)||void 0===o||o.replaceChild(s,e),e=s}switch(t.RRNodeType){case _e.Document:if(!rt(e,t,n.mirror,i)){const o=i.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==tt||tt.add(e))}break;case _e.Element:{const o=e,s=t;switch(s.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;nt(o,t.contentDocument,n,i);break}}s.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),it(o.shadowRoot,s.shadowRoot,n,i));break}}return e}(e,t,n,i),it(e,t,n,i),function(e,t,n,i){var o;switch(t.RRNodeType){case _e.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case _e.Element:{const o=e,s=t;switch(function(e,t,n){const i=e.attributes,o=t.attributes;for(const i in o){const s=o[i],r=n.getMeta(t);if((null==r?void 0:r.isSVG)&&Ke[i])e.setAttributeNS(Ke[i],i,s);else if("CANVAS"===t.tagName&&"rr_dataURL"===i){const t=document.createElement("img");t.src=s,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===i)continue;e.setAttribute(i,s)}}for(const{name:t}of Array.from(i))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,s,i),s.scrollData&&n.applyScroll(s.scrollData,!0),s.inputData&&n.applyInput(s.inputData),s.tagName){case"AUDIO":case"VIDEO":{const t=e,n=s;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate);break}case"CANVAS":{const i=t;if(null!==i.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=o.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.rr_dataURL}i.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=o.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case _e.Text:case _e.Comment:case _e.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==tt?void 0:tt.has(e))&&(tt.delete(e),null===(o=n.afterAppend)||void 0===o||o.call(n,e,n.mirror.getId(e)))}(e,t,n,i)}function it(e,t,n,i){const o=Array.from(e.childNodes),s=t.childNodes;if(0===o.length&&0===s.length)return;let r,a,l=0,c=o.length-1,u=0,d=s.length-1,h=o[l],p=o[c],f=s[u],m=s[d];for(;l<=c&&u<=d;)if(void 0===h)h=o[++l];else if(void 0===p)p=o[--c];else if(rt(h,f,n.mirror,i))h=o[++l],f=s[++u];else if(rt(p,m,n.mirror,i))p=o[--c],m=s[--d];else if(rt(h,m,n.mirror,i)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++l],m=s[--d]}else if(rt(p,f,n.mirror,i)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--c],f=s[++u]}else{if(!r){r={};for(let e=l;e<=c;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(r[n.mirror.getId(t)]=e)}}a=r[i.getId(f)];const t=o[a];if(void 0!==a&&t&&rt(t,f,n.mirror,i)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=ot(f,n.mirror,i);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++l]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}f=s[++u]}if(l>c){const t=s[d+1];let o=null;for(t&&(o=n.mirror.getNode(i.getId(t)));u<=d;++u){const t=ot(s[u],n.mirror,i);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;l<=c;l++){const t=o[l];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)nt(g,y,n,i),g=g.nextSibling,y=y.nextSibling}function ot(e,t,n){const i=n.getId(e),o=n.getMeta(e);let s=null;if(i>-1&&(s=t.getNode(i)),null!==s&&st(s,e))return s;switch(e.RRNodeType){case _e.Document:s=new Document;break;case _e.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case _e.Element:{let t=e.tagName.toLowerCase();t=et[t]||t,s=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(Ke.svg,t):document.createElement(e.tagName);break}case _e.Text:s=document.createTextNode(e.data);break;case _e.Comment:s=document.createComment(e.data);break;case _e.CDATA:s=document.createCDATASection(e.data)}o&&t.add(s,Object.assign({},o));try{null==tt||tt.add(s)}catch(e){}return s}function st(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function rt(e,t,n,i){const o=n.getId(e),s=i.getId(t);return-1!==o&&o===s&&st(e,t)}class at extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=Ze.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=_e.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===_e.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===_e.Element||t===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=Xe(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===_e.Element||n===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Qe(this,e,t);return i.parentElement=null,i}removeChild(e){return Je(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,i){return new t}createDocumentType(e,t,n){const i=new(We(Ve))(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=new(ze(Ve))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(Ge(Ve))(e);return t.ownerDocument=this,t}createComment(e){const t=new(He(Ve))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(Ye(Ve))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(Ve)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new wt,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new at}createDocumentType(e,t,n){const i=new lt(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new ut(t);break;case"IFRAME":n=new pt(t,this.mirror);break;case"CANVAS":n=new dt(t);break;case"STYLE":n=new ht(t);break;default:n=new ct(t)}return n.ownerDocument=this,n}createComment(e){const t=new mt(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new gt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new ft(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const lt=We(Ve);class ct extends(ze(Ve)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ut extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(ct)){}class dt extends ct{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class ht extends ct{constructor(){super(...arguments),this.rules=[]}}class pt extends ct{constructor(e,t){super(e),this.contentDocument=new at,this.contentDocument.mirror=t}}const ft=Ge(Ve),mt=He(Ve),gt=Ye(Ve);function yt(e,t,n,i){let o;switch(e.nodeType){case Ze.DOCUMENT_NODE:i&&"IFRAME"===i.nodeName?o=i.contentDocument:(o=t,o.compatMode=e.compatMode);break;case Ze.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Ze.ELEMENT_NODE:{const n=e,i=function(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}(n);o=t.createElement(i);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Ze.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case Ze.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case Ze.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case Ze.DOCUMENT_FRAGMENT_NODE:o=i.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof at&&(s||(s=bt(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function vt(e,t=function(){return new $e}(),n=new at){return function e(i,o){const s=yt(i,n,t,o);if(null!==s)if("IFRAME"!==(null==o?void 0:o.nodeName)&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(s),s.parentNode=o,s.parentElement=o),"IFRAME"===i.nodeName){const t=i.contentDocument;t&&e(t,s)}else i.nodeType!==Ze.DOCUMENT_NODE&&i.nodeType!==Ze.ELEMENT_NODE&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE||(i.nodeType===Ze.ELEMENT_NODE&&i.shadowRoot&&e(i.shadowRoot,s),i.childNodes.forEach((t=>e(t,s))))}(e,null),n}class wt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function bt(e,t){switch(e.RRNodeType){case _e.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case _e.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case _e.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case _e.Text:case _e.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _e.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Et=Uint8Array,Nt=Uint16Array,St=Uint32Array,Tt=new Et([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]),Dt=new Et([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]),Mt=new Et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ct=function(e,t){for(var n=new Nt(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new St(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},xt=Ct(Tt,2),Rt=xt[0],kt=xt[1];Rt[28]=258,kt[258]=28;for(var At=Ct(Dt,0)[0],It=new Nt(32768),Ot=0;Ot<32768;++Ot){var _t=(43690&Ot)>>>1|(21845&Ot)<<1;_t=(61680&(_t=(52428&_t)>>>2|(13107&_t)<<2))>>>4|(3855&_t)<<4,It[Ot]=((65280&_t)>>>8|(255&_t)<<8)>>>1}var $t=function(e,t,n){for(var i=e.length,o=0,s=new Nt(t);o<i;++o)++s[e[o]-1];var r,a=new Nt(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new Nt(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=a[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)r[It[d]>>>l]=c}else for(r=new Nt(i),o=0;o<i;++o)r[o]=It[a[e[o]-1]++]>>>15-e[o];return r},Lt=new Et(288);for(Ot=0;Ot<144;++Ot)Lt[Ot]=8;for(Ot=144;Ot<256;++Ot)Lt[Ot]=9;for(Ot=256;Ot<280;++Ot)Lt[Ot]=7;for(Ot=280;Ot<288;++Ot)Lt[Ot]=8;var Ft=new Et(32);for(Ot=0;Ot<32;++Ot)Ft[Ot]=5;var Pt=$t(Lt,9,1),Bt=$t(Ft,5,1),Ut=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},jt=function(e,t,n){var i=t/8>>0;return(e[i]|e[i+1]<<8)>>>(7&t)&n},Vt=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},Wt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Nt?Nt:e instanceof St?St:Et)(n-t);return i.set(e.subarray(t,n)),i};function zt(e,t){return function(e,t,n){var i=e.length,o=!t||n,s=!n||n.i;n||(n={}),t||(t=new Et(3*i));var r,a=function(e){var n=t.length;if(e>n){var i=new Et(Math.max(2*n,e));i.set(t),t=i}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,f=n.n,m=8*i;do{if(!d){n.f=l=jt(e,c,1);var g=jt(e,c+1,3);if(c+=3,!g){var y=e[(x=((r=c)/8>>0)+(7&r&&1)+4)-4]|e[x-3]<<8,v=x+y;if(v>i){if(s)throw"unexpected EOF";break}o&&a(u+y),t.set(e.subarray(x,v),u),n.b=u+=y,n.p=c=8*v;continue}if(1==g)d=Pt,h=Bt,p=9,f=5;else{if(2!=g)throw"invalid block type";var w=jt(e,c,31)+257,b=jt(e,c+10,15)+4,E=w+jt(e,c+5,31)+1;c+=14;for(var N=new Et(E),S=new Et(19),T=0;T<b;++T)S[Mt[T]]=jt(e,c+3*T,7);c+=3*b;var D=Ut(S),M=(1<<D)-1;if(!s&&c+E*(D+7)>m)break;var C=$t(S,D,1);for(T=0;T<E;){var x,R=C[jt(e,c,M)];if(c+=15&R,(x=R>>>4)<16)N[T++]=x;else{var k=0,A=0;for(16==x?(A=3+jt(e,c,3),c+=2,k=N[T-1]):17==x?(A=3+jt(e,c,7),c+=3):18==x&&(A=11+jt(e,c,127),c+=7);A--;)N[T++]=k}}var I=N.subarray(0,w),O=N.subarray(w);p=Ut(I),f=Ut(O),d=$t(I,p,1),h=$t(O,f,1)}if(c>m)throw"unexpected EOF"}o&&a(u+131072);for(var _=(1<<p)-1,$=(1<<f)-1,L=p+f+18;s||c+L<m;){var F=(k=d[Vt(e,c)&_])>>>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 P=F-254;if(F>264){var B=Tt[T=F-257];P=jt(e,c,(1<<B)-1)+Rt[T],c+=B}var U=h[Vt(e,c)&$],j=U>>>4;if(!U)throw"invalid distance";if(c+=15&U,O=At[j],j>3&&(B=Dt[j],O+=Vt(e,c)&(1<<B)-1,c+=B),c>m)throw"unexpected EOF";o&&a(u+131072);for(var V=u+P;u<V;u+=4)t[u]=t[u-O],t[u+1]=t[u+1-O],t[u+2]=t[u+2-O],t[u+3]=t[u+3-O];u=V}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=h,n.n=f)}while(!l);return u==t.length?t:Wt(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)}const Gt=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var i=0;i<e.length;){var o=e[i++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[i++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[i++])<<6|63&e[i++]):(o=((15&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(zt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Et(e.length+(e.length>>>1)),o=0,s=function(e){i[o++]=e},r=0;r<n;++r){if(o+5>i.length){var a=new Et(o+8+(n-r<<1));a.set(i),i=a}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Wt(i,0,o)}(e,!0))));if("v1"===t.v)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};function Ht(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map((function(e){e(n)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,n)}))}}}var Yt=Object.freeze({__proto__:null,default:Ht});const qt=new Map;function Xt(e,t){let n=qt.get(e);return n||(n=new Map,qt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Qt(e,t,n){return i=>ke(this,void 0,void 0,(function*(){if(i&&"object"==typeof i&&"rr_type"in i){if(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i){const o=yield Qt(e,t,n)(i.args);return yield createImageBitmap.apply(null,o)}if("index"in i){if(n||null===t)return i;const{rr_type:e,index:o}=i;return Xt(t,e)[o]}if("args"in i){const{rr_type:o,args:s}=i;return new(0,window[o])(...yield Promise.all(s.map(Qt(e,t,n))))}if("base64"in i)return function(e){var t,n,i,o,s,r=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);var c=new ArrayBuffer(r),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=Ie[e.charCodeAt(t)],i=Ie[e.charCodeAt(t+1)],o=Ie[e.charCodeAt(t+2)],s=Ie[e.charCodeAt(t+3)],u[l++]=n<<2|i>>4,u[l++]=(15&i)<<4|o>>2,u[l++]=(3&o)<<6|63&s;return c}(i.base64);if("src"in i){const t=e.get(i.src);if(t)return t;{const t=new Image;return t.src=i.src,e.set(i.src,t),t}}if("data"in i&&"Blob"===i.rr_type){const o=yield Promise.all(i.data.map(Qt(e,t,n)));return new Blob(o,{type:i.type})}}else if(Array.isArray(i)){return yield Promise.all(i.map(Qt(e,t,n)))}return i}))}const Jt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Zt({mutation:e,target:t,type:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const s=o[e.property],r=yield Promise.all(e.args.map(Qt(i,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!Jt.includes(n))return;const i=Xt(e,n);i.includes(t)||i.push(t)}(o,s.apply(o,r))}catch(t){o(e,t)}}))}function Kt({event:e,mutation:t,target:n,imageMap:i,canvasEventMap:o,errorHandler:s}){return ke(this,void 0,void 0,(function*(){try{const r=o.get(e)||t,a="commands"in r?r.commands:[r];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const o=a[e];yield Zt({mutation:o,type:t.type,target:n,imageMap:i,errorHandler:s})}return}yield function({event:e,mutations:t,target:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){const s=n.getContext("2d");if(!s)return void o(t[0],new Error("Canvas context is null"));const r=t.map((e=>ke(this,void 0,void 0,(function*(){return Promise.all(e.args.map(Qt(i,s)))}))));(yield Promise.all(r)).forEach(((n,r)=>{const a=t[r];try{if(a.setter)return void(s[a.property]=a.args[0]);const t=s[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(i.get(e),t.apply(s,a.args)):t.apply(s,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:i,errorHandler:s})}catch(e){s(t,e)}}))}
|
|
15
|
+
***************************************************************************** */function ke(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ie="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;Oe<Ae.length;Oe++)Ie[Ae.charCodeAt(Oe)]=Oe;var _e;K(),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"}(_e||(_e={}));class $e{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Le(e){const t=[];for(const n in e){const i=e[n];if("string"!=typeof i)continue;const o=je(n);t.push(`${o}: ${i};`)}return t.join(" ")}const Fe=/-([a-z])/g,Pe=/^--[a-zA-Z0-9-]+$/,Be=e=>Pe.test(e)?e:e.replace(Fe,((e,t)=>t?t.toUpperCase():"")),Ue=/\B([A-Z])/g,je=e=>e.replace(Ue,"-$1").toLowerCase();class Ve{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=Ze.ELEMENT_NODE,this.TEXT_NODE=Ze.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Ve))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function We(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Ze.DOCUMENT_TYPE_NODE,this.RRNodeType=_e.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(e){super(),this.nodeType=Ze.ELEMENT_NODE,this.RRNodeType=_e.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new qe(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const i=e.split(n);i.length>1&&(t[Be(i[0].trim())]=i[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,i,o)=>{if(t.test(n))return;const s=Be(n);i?e[s]=i:delete e[s],"important"===o&&(e[s]+=" !important"),this.attributes.style=Le(e)},e.removeProperty=n=>{if(t.test(n))return"";const i=Be(n),o=e[i]||"";return delete e[i],this.attributes.style=Le(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Xe(this,e)}insertBefore(e,t){return Qe(this,e,t)}removeChild(e){return Je(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function Ge(e){return class extends e{constructor(e){super(),this.nodeType=Ze.TEXT_NODE,this.nodeName="#text",this.RRNodeType=_e.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function He(e){return class extends e{constructor(e){super(),this.nodeType=Ze.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=_e.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Ye(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Ze.CDATA_SECTION_NODE,this.RRNodeType=_e.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class qe{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function Xe(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Qe(e,t,n){if(!n)return Xe(e,t);if(n.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Je(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Ze;!function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Ze||(Ze={}));const Ke={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},et={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"};let tt=null;function nt(e,t,n,i=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,i){var o;n.afterAppend&&!tt&&(tt=new WeakSet,setTimeout((()=>{tt=null}),0));if(!st(e,t)){const s=ot(t,n.mirror,i);null===(o=e.parentNode)||void 0===o||o.replaceChild(s,e),e=s}switch(t.RRNodeType){case _e.Document:if(!rt(e,t,n.mirror,i)){const o=i.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==tt||tt.add(e))}break;case _e.Element:{const o=e,s=t;switch(s.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;nt(o,t.contentDocument,n,i);break}}s.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),it(o.shadowRoot,s.shadowRoot,n,i)),function(e,t,n){const i=e.attributes,o=t.attributes;for(const i in o){const s=o[i],r=n.getMeta(t);if((null==r?void 0:r.isSVG)&&Ke[i])e.setAttributeNS(Ke[i],i,s);else if("CANVAS"===t.tagName&&"rr_dataURL"===i){const t=document.createElement("img");t.src=s,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===i)continue;e.setAttribute(i,s)}}for(const{name:t}of Array.from(i))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,s,i);break}}return e}(e,t,n,i),it(e,t,n,i),function(e,t,n){var i;switch(t.RRNodeType){case _e.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case _e.Element:{const i=e,o=t;switch(o.scrollData&&n.applyScroll(o.scrollData,!0),o.inputData&&n.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const t=e,n=o;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate),void 0!==n.loop&&(t.loop=n.loop);break}case"CANVAS":{const o=t;if(null!==o.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=i.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.rr_dataURL}o.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=i.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case _e.Text:case _e.Comment:case _e.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==tt?void 0:tt.has(e))&&(tt.delete(e),null===(i=n.afterAppend)||void 0===i||i.call(n,e,n.mirror.getId(e)))}(e,t,n)}function it(e,t,n,i){const o=Array.from(e.childNodes),s=t.childNodes;if(0===o.length&&0===s.length)return;let r,a,l=0,c=o.length-1,u=0,d=s.length-1,h=o[l],p=o[c],m=s[u],f=s[d];for(;l<=c&&u<=d;)if(void 0===h)h=o[++l];else if(void 0===p)p=o[--c];else if(rt(h,m,n.mirror,i))h=o[++l],m=s[++u];else if(rt(p,f,n.mirror,i))p=o[--c],f=s[--d];else if(rt(h,f,n.mirror,i)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++l],f=s[--d]}else if(rt(p,m,n.mirror,i)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--c],m=s[++u]}else{if(!r){r={};for(let e=l;e<=c;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(r[n.mirror.getId(t)]=e)}}a=r[i.getId(m)];const t=o[a];if(void 0!==a&&t&&rt(t,m,n.mirror,i)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=ot(m,n.mirror,i);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++l]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}m=s[++u]}if(l>c){const t=s[d+1];let o=null;for(t&&(o=n.mirror.getNode(i.getId(t)));u<=d;++u){const t=ot(s[u],n.mirror,i);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;l<=c;l++){const t=o[l];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)nt(g,y,n,i),g=g.nextSibling,y=y.nextSibling}function ot(e,t,n){const i=n.getId(e),o=n.getMeta(e);let s=null;if(i>-1&&(s=t.getNode(i)),null!==s&&st(s,e))return s;switch(e.RRNodeType){case _e.Document:s=new Document;break;case _e.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case _e.Element:{let t=e.tagName.toLowerCase();t=et[t]||t,s=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(Ke.svg,t):document.createElement(e.tagName);break}case _e.Text:s=document.createTextNode(e.data);break;case _e.Comment:s=document.createComment(e.data);break;case _e.CDATA:s=document.createCDATASection(e.data)}o&&t.add(s,Object.assign({},o));try{null==tt||tt.add(s)}catch(e){}return s}function st(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function rt(e,t,n,i){const o=n.getId(e),s=i.getId(t);return-1!==o&&o===s&&st(e,t)}class at extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=Ze.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=_e.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===_e.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===_e.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===_e.Element||t===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=Xe(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===_e.Element||n===_e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===_e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Qe(this,e,t);return i.parentElement=null,i}removeChild(e){return Je(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,i){return new t}createDocumentType(e,t,n){const i=new(We(Ve))(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=new(ze(Ve))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(Ge(Ve))(e);return t.ownerDocument=this,t}createComment(e){const t=new(He(Ve))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(Ye(Ve))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(Ve)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new bt,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new at}createDocumentType(e,t,n){const i=new lt(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new ut(t);break;case"IFRAME":n=new pt(t,this.mirror);break;case"CANVAS":n=new dt(t);break;case"STYLE":n=new ht(t);break;default:n=new ct(t)}return n.ownerDocument=this,n}createComment(e){const t=new ft(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new gt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new mt(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const lt=We(Ve);class ct extends(ze(Ve)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ut extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(ct)){}class dt extends ct{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class ht extends ct{constructor(){super(...arguments),this.rules=[]}}class pt extends ct{constructor(e,t){super(e),this.contentDocument=new at,this.contentDocument.mirror=t}}const mt=Ge(Ve),ft=He(Ve),gt=Ye(Ve);function yt(e,t,n,i){let o;switch(e.nodeType){case Ze.DOCUMENT_NODE:i&&"IFRAME"===i.nodeName?o=i.contentDocument:(o=t,o.compatMode=e.compatMode);break;case Ze.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Ze.ELEMENT_NODE:{const n=e,i=function(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}(n);o=t.createElement(i);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Ze.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case Ze.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case Ze.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case Ze.DOCUMENT_FRAGMENT_NODE:o=i.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof at&&(s||(s=wt(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function vt(e,t=function(){return new $e}(),n=new at){return function e(i,o){const s=yt(i,n,t,o);if(null!==s)if("IFRAME"!==(null==o?void 0:o.nodeName)&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(s),s.parentNode=o,s.parentElement=o),"IFRAME"===i.nodeName){const t=i.contentDocument;t&&e(t,s)}else i.nodeType!==Ze.DOCUMENT_NODE&&i.nodeType!==Ze.ELEMENT_NODE&&i.nodeType!==Ze.DOCUMENT_FRAGMENT_NODE||(i.nodeType===Ze.ELEMENT_NODE&&i.shadowRoot&&e(i.shadowRoot,s),i.childNodes.forEach((t=>e(t,s))))}(e,null),n}class bt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wt(e,t){switch(e.RRNodeType){case _e.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case _e.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case _e.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case _e.Text:case _e.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _e.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Et=Uint8Array,Nt=Uint16Array,Tt=Uint32Array,St=new Et([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]),Mt=new Et([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]),Dt=new Et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ct=function(e,t){for(var n=new Nt(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new Tt(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},xt=Ct(St,2),Rt=xt[0],kt=xt[1];Rt[28]=258,kt[258]=28;for(var At=Ct(Mt,0)[0],It=new Nt(32768),Ot=0;Ot<32768;++Ot){var _t=(43690&Ot)>>>1|(21845&Ot)<<1;_t=(61680&(_t=(52428&_t)>>>2|(13107&_t)<<2))>>>4|(3855&_t)<<4,It[Ot]=((65280&_t)>>>8|(255&_t)<<8)>>>1}var $t=function(e,t,n){for(var i=e.length,o=0,s=new Nt(t);o<i;++o)++s[e[o]-1];var r,a=new Nt(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new Nt(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=a[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)r[It[d]>>>l]=c}else for(r=new Nt(i),o=0;o<i;++o)r[o]=It[a[e[o]-1]++]>>>15-e[o];return r},Lt=new Et(288);for(Ot=0;Ot<144;++Ot)Lt[Ot]=8;for(Ot=144;Ot<256;++Ot)Lt[Ot]=9;for(Ot=256;Ot<280;++Ot)Lt[Ot]=7;for(Ot=280;Ot<288;++Ot)Lt[Ot]=8;var Ft=new Et(32);for(Ot=0;Ot<32;++Ot)Ft[Ot]=5;var Pt=$t(Lt,9,1),Bt=$t(Ft,5,1),Ut=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},jt=function(e,t,n){var i=t/8>>0;return(e[i]|e[i+1]<<8)>>>(7&t)&n},Vt=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},Wt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Nt?Nt:e instanceof Tt?Tt:Et)(n-t);return i.set(e.subarray(t,n)),i};function zt(e,t){return function(e,t,n){var i=e.length,o=!t||n,s=!n||n.i;n||(n={}),t||(t=new Et(3*i));var r,a=function(e){var n=t.length;if(e>n){var i=new Et(Math.max(2*n,e));i.set(t),t=i}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,m=n.n,f=8*i;do{if(!d){n.f=l=jt(e,c,1);var g=jt(e,c+1,3);if(c+=3,!g){var y=e[(x=((r=c)/8>>0)+(7&r&&1)+4)-4]|e[x-3]<<8,v=x+y;if(v>i){if(s)throw"unexpected EOF";break}o&&a(u+y),t.set(e.subarray(x,v),u),n.b=u+=y,n.p=c=8*v;continue}if(1==g)d=Pt,h=Bt,p=9,m=5;else{if(2!=g)throw"invalid block type";var b=jt(e,c,31)+257,w=jt(e,c+10,15)+4,E=b+jt(e,c+5,31)+1;c+=14;for(var N=new Et(E),T=new Et(19),S=0;S<w;++S)T[Dt[S]]=jt(e,c+3*S,7);c+=3*w;var M=Ut(T),D=(1<<M)-1;if(!s&&c+E*(M+7)>f)break;var C=$t(T,M,1);for(S=0;S<E;){var x,R=C[jt(e,c,D)];if(c+=15&R,(x=R>>>4)<16)N[S++]=x;else{var k=0,A=0;for(16==x?(A=3+jt(e,c,3),c+=2,k=N[S-1]):17==x?(A=3+jt(e,c,7),c+=3):18==x&&(A=11+jt(e,c,127),c+=7);A--;)N[S++]=k}}var I=N.subarray(0,b),O=N.subarray(b);p=Ut(I),m=Ut(O),d=$t(I,p,1),h=$t(O,m,1)}if(c>f)throw"unexpected EOF"}o&&a(u+131072);for(var _=(1<<p)-1,$=(1<<m)-1,L=p+m+18;s||c+L<f;){var F=(k=d[Vt(e,c)&_])>>>4;if((c+=15&k)>f)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(F<256)t[u++]=F;else{if(256==F){d=null;break}var P=F-254;if(F>264){var B=St[S=F-257];P=jt(e,c,(1<<B)-1)+Rt[S],c+=B}var U=h[Vt(e,c)&$],j=U>>>4;if(!U)throw"invalid distance";if(c+=15&U,O=At[j],j>3&&(B=Mt[j],O+=Vt(e,c)&(1<<B)-1,c+=B),c>f)throw"unexpected EOF";o&&a(u+131072);for(var V=u+P;u<V;u+=4)t[u]=t[u-O],t[u+1]=t[u+1-O],t[u+2]=t[u+2-O],t[u+3]=t[u+3-O];u=V}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=h,n.n=m)}while(!l);return u==t.length?t:Wt(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)}const Gt=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var i=0;i<e.length;){var o=e[i++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[i++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[i++])<<6|63&e[i++]):(o=((15&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(zt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Et(e.length+(e.length>>>1)),o=0,s=function(e){i[o++]=e},r=0;r<n;++r){if(o+5>i.length){var a=new Et(o+8+(n-r<<1));a.set(i),i=a}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Wt(i,0,o)}(e,!0))));if("v1"===t.v)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}},Ht=new Map;function Yt(e,t){let n=Ht.get(e);return n||(n=new Map,Ht.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function qt(e,t,n){return i=>ke(this,void 0,void 0,(function*(){if(i&&"object"==typeof i&&"rr_type"in i){if(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i){const o=yield qt(e,t,n)(i.args);return yield createImageBitmap.apply(null,o)}if("index"in i){if(n||null===t)return i;const{rr_type:e,index:o}=i;return Yt(t,e)[o]}if("args"in i){const{rr_type:o,args:s}=i;return new(0,window[o])(...yield Promise.all(s.map(qt(e,t,n))))}if("base64"in i)return function(e){var t,n,i,o,s,r=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);var c=new ArrayBuffer(r),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=Ie[e.charCodeAt(t)],i=Ie[e.charCodeAt(t+1)],o=Ie[e.charCodeAt(t+2)],s=Ie[e.charCodeAt(t+3)],u[l++]=n<<2|i>>4,u[l++]=(15&i)<<4|o>>2,u[l++]=(3&o)<<6|63&s;return c}(i.base64);if("src"in i){const t=e.get(i.src);if(t)return t;{const t=new Image;return t.src=i.src,e.set(i.src,t),t}}if("data"in i&&"Blob"===i.rr_type){const o=yield Promise.all(i.data.map(qt(e,t,n)));return new Blob(o,{type:i.type})}}else if(Array.isArray(i)){return yield Promise.all(i.map(qt(e,t,n)))}return i}))}const Xt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Qt({mutation:e,target:t,type:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const s=o[e.property],r=yield Promise.all(e.args.map(qt(i,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!Xt.includes(n))return;const i=Yt(e,n);i.includes(t)||i.push(t)}(o,s.apply(o,r))}catch(t){o(e,t)}}))}function Jt({event:e,mutation:t,target:n,imageMap:i,canvasEventMap:o,errorHandler:s}){return ke(this,void 0,void 0,(function*(){try{const r=o.get(e)||t,a="commands"in r?r.commands:[r];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const o=a[e];yield Qt({mutation:o,type:t.type,target:n,imageMap:i,errorHandler:s})}return}yield function({event:e,mutations:t,target:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){const s=n.getContext("2d");if(!s)return void o(t[0],new Error("Canvas context is null"));const r=t.map((e=>ke(this,void 0,void 0,(function*(){return Promise.all(e.args.map(qt(i,s)))}))));(yield Promise.all(r)).forEach(((n,r)=>{const a=t[r];try{if(a.setter)return void(s[a.property]=a.args[0]);const t=s[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(i.get(e),t.apply(s,a.args)):t.apply(s,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:i,errorHandler:s})}catch(e){s(t,e)}}))}function Zt(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map((function(e){e(n)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,n)}))}}}var Kt,en=Object.freeze({__proto__:null,default:Zt});
|
|
16
16
|
/*! *****************************************************************************
|
|
17
17
|
Copyright (c) Microsoft Corporation.
|
|
18
18
|
|
|
@@ -26,5 +26,5 @@ var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const
|
|
|
26
26
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
27
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
28
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */function en(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}var tn;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(tn||(tn={}));var nn={type:"xstate.init"};function on(e){return void 0===e?[]:[].concat(e)}function sn(e){return{type:"xstate.assign",assignment:e}}function rn(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 an(e){return function(t){return e===t}}function ln(e){return"string"==typeof e?{type:e}:e}function cn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:an(e)}}function un(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function dn(e,t){void 0===t&&(t={});var n=en(un(on(e.states[e.initial].entry).map((function(e){return rn(e,t.actions)})),e.context,nn),2),i=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:i,context:o,matches:an(e.initial)},transition:function(t,n){var i,o,r="string"==typeof t?{value:t,context:e.context}:t,a=r.value,l=r.context,c=ln(n),u=e.states[a];if(u.on){var d=on(u.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var f=p.value;if(void 0===f)return cn(a,l);var m="string"==typeof f?{target:f}:f,g=m.target,y=m.actions,v=void 0===y?[]:y,w=m.cond,b=void 0===w?function(){return!0}:w,E=void 0===g,N=null!=g?g:a,S=e.states[N];if(b(l,c)){var T=en(un((E?on(v):[].concat(u.exit,v,S.entry).filter((function(e){return e}))).map((function(e){return rn(e,s._options.actions)})),l,c),3),D=T[0],M=T[1],C=T[2],x=null!=g?g:a;return{value:x,context:M,actions:D,changed:g!==a||D.length>0||C,matches:an(x)}}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return cn(a,l)}};return s}var hn=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function pn(e){var t=e.initialState,n=tn.NotStarted,i=new Set,o={_machine:e,send:function(o){n===tn.Running&&(t=e.transition(t,o),hn(t,ln(o)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:an(s.value)}}return n=tn.Running,hn(t,nn),o},stop:function(){return n=tn.Stopped,i.clear(),o},get state(){return t},get status(){return n}};return o}class fn{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i+1;n=i-1}}return t}}function mn(e,t){if(e.type===me.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function gn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:i}){const o=dn({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"]}}},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"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:sn({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:sn(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:s,events:r,baselineTime:a,lastPlayedEvent:l}=e;s.clear();for(const e of r)mn(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.type===me.Meta&&i.timestamp<=t)return e.slice(n)}return e}(r,a);let u=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===me.IncrementalSnapshot&&l.data.source===ge.MouseMove&&(u=l.timestamp+(null===(o=l.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&i.emit(we.PlayBack);const d=new Array;for(const e of c)if(!(u&&u<a&&(e.timestamp<=u||e===l)))if(e.timestamp<a)d.push(e);else{const n=t(e,!1);s.addAction({doAction:()=>{n()},delay:e.delay})}n(d),i.emit(we.Flush),s.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:sn((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:sn({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:sn(((e,n)=>{const{baselineTime:i,timer:o,events:s}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;mn(e,i);let r=s.length-1;if(!s[r]||s[r].timestamp<=e.timestamp)s.push(e);else{let t=-1,n=0;for(;n<=r;){const t=Math.floor((n+r)/2);s[t].timestamp<=e.timestamp?n=t+1:r=t-1}-1===t&&(t=n),s.splice(t,0,e)}const a=e.timestamp<i,l=t(e,a);a?l():o.isActive()&&o.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:s})}))}});return pn(o)}function yn(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(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+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function u(t,n){const i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function d(e){const t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){let n,i,s,r=(o()-t.startTime)/468;var a;r=r>1?1:r,a=r,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,s),i===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function f(n,s,r){let l,c,u,d;const h=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=a),p({scrollable:l,method:d,startTime:h,startX:c,startY:u,x:s,y:r})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?f.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):f.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])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void 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)}const e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},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]))return void i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=h(this),o=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==t.body?(f.call(this,n,n.scrollLeft+s.left-o.left,n.scrollTop+s.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}}const vn=Ht||Yt,wn="[replayer]",bn={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function En(e){return e.type==me.IncrementalSnapshot&&(e.data.source==ge.TouchMove||e.data.source==ge.MouseInteraction&&e.data.type==ye.TouchStart)}class Nn{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new at,this.mouseTail=null,this.tailPositions=[],this.emitter=vn(),this.legacy_missingNodeRetryMap={},this.cache=de(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=K(),this.styleMirror=new Re,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case me.DomContentLoaded:case me.Load:case me.Custom:continue;case me.FullSnapshot:case me.Meta:case me.Plugin:case me.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case me.DomContentLoaded:case me.Load:break;case me.Custom:n=()=>{this.emitter.emit(we.CustomEvent,e)};break;case me.Meta:n=()=>this.emitter.emit(we.Resize,{width:e.data.width,height:e.data.height});break;case me.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset),this.styleMirror.reset()};break;case me.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&this.config.skipInactive&&!this.nextUserInteractionEvent){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay;this.play(this.getCurrentTime()+t),this.nextUserInteractionEvent=null}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const i=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[i]){const t=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(we.Finish))};let n=50;e.type===me.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(we.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:bn,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(we.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(we.Flush,(()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Kt({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{nt(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],i=ot(n.node,this.mirror,this.virtualDom.mirror);nt(i,n.node,e,this.virtualDom.mirror),n.node=i}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(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,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(we.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()}));const i=new fn([],{speed:this.config.speed});this.service=gn({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>e.timestamp-t.timestamp)),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((e=>{this.emitter.emit(we.StateChange,{player:e})})),this.speedService=pn(dn({id:"speed",context:{normalSpeed:-1,timer:i},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:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:sn({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(we.StateChange,{speed:e})}));const o=this.service.state.context.events.find((e=>e.type===me.Meta)),s=this.service.state.context.events.find((e=>e.type===me.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(we.Resize,{width:e,height:t})}),0)}s&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(En)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(we.Start)}pause(e){var t,n;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===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(we.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(we.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(we.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;En(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event:t}})))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=de()}setupDom(){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");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(yn(this.iframe.contentWindow,this.iframe.contentDocument),function(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=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],i=(e,t)=>{this.collectIframeAndAttachDocument(n,e);for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),fe(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(we.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const i=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,bt(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:ge.StyleSheetRule,adds:i.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e<i.length;e++)null===(n=o.sheet)||void 0===n||n.insertRule(i[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(e,o)=>{this.collectIframeAndAttachDocument(i,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===Q.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};pe(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of i)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Te(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,i=this.service.state;const o=()=>{i=this.service.state};this.emitter.on(we.Start,o),this.emitter.on(we.Pause,o);const s=()=>{this.emitter.off(we.Start,o),this.emitter.off(we.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(we.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(we.LoadStylesheetStart),n=setTimeout((()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}}preloadAllImages(){return ke(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(we.Start,e),this.emitter.on(we.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===me.IncrementalSnapshot&&e.data.source===ge.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),i=null==n?void 0:n.createImageData(t.width,t.height);null==i||i.data,JSON.parse(e.args[0]),null==n||n.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return ke(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map((e=>ke(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(Qt(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Qt(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:i}))}}}))}applyIncremental(e,t){var n,i,o;const{data:s}=e;switch(s.source){case ge.Mutation:try{this.applyMutation(s,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,s)}break;case ge.Drag:case ge.TouchMove:case ge.MouseMove:if(t){const e=s.positions[s.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:s}}else s.positions.forEach((n=>{const i={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,s)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(i)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=s.positions[0])||void 0===n?void 0:n.timeOffset)});break;case ge.MouseInteraction:{if(-1===s.id)break;const e=new Event(ye[s.type].toLowerCase()),n=this.mirror.getNode(s.id);if(!n)return this.debugNodeNotFound(s,s.id);this.emitter.emit(we.MouseInteraction,{type:s.type,target:n});const{triggerFocus:i}=this.config;switch(s.type){case ye.Blur:"blur"in n&&n.blur();break;case ye.Focus:i&&n.focus&&n.focus({preventScroll:!0});break;case ye.Click:case ye.TouchStart:case ye.TouchEnd:case ye.MouseDown:case ye.MouseUp:t?(s.type===ye.TouchStart?this.touchActive=!0:s.type===ye.TouchEnd&&(this.touchActive=!1),s.type===ye.MouseDown?this.lastMouseDownEvent=[n,e]:s.type===ye.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ye.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,t,s),s.type===ye.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ye.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ye.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case ye.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case ge.Scroll:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.scrollData=s;break}this.applyScroll(s,t);break;case ge.ViewportResize:this.emitter.emit(we.Resize,{width:s.width,height:s.height});break;case ge.Input:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.inputData=s;break}this.applyInput(s);break;case ge.MediaInteraction:{const e=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);const t=e;try{void 0!==s.currentTime&&(t.currentTime=s.currentTime),void 0!==s.volume&&(t.volume=s.volume),void 0!==s.muted&&(t.muted=s.muted),1===s.type&&t.pause(),0===s.type&&t.play(),4===s.type&&(t.playbackRate=s.playbackRate)}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}break}case ge.StyleSheetRule:case ge.StyleDeclaration:this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&(null===(i=this.virtualDom.mirror.getNode(s.id))||void 0===i||i.rules.push(s)):this.applyStyleSheetMutation(s);break;case ge.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);t.canvasMutations.push({event:e,mutation:s})}else{const t=this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);Kt({event:e,mutation:s,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case ge.Font:try{const e=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case ge.Selection:if(t){this.lastSelectionData=s;break}this.applySelection(s);break;case ge.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,vt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=yt(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o)return;let s=n.getNode(t.parentId);if(!s)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Me(s)&&(s=s.shadowRoot),n.removeNodeFromMap(o),s)try{s.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",s,o,e)}}));const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=e=>{var t,s;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let r=n.getNode(e.parentId);if(!r)return e.node.type===Q.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(Me(r)||r.attachShadow({mode:"open"}),r=r.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Te(r,n))return void this.attachDocumentToIframe(e,r);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=pe(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(i[e.node.id]={node:d,mutation:e});const h=n.getMeta(r);if(h&&h.type===Q.Element&&"textarea"===h.tagName&&e.node.type===Q.Text){const e=Array.isArray(r.childNodes)?r.childNodes:Array.from(r.childNodes);for(const t of e)t.nodeType===r.TEXT_NODE&&r.removeChild(t)}else if((null==h?void 0:h.type)===Q.Document){const n=r;e.node.type===Q.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?r.insertBefore(d,a.nextSibling):l&&l.parentNode?r.contains(l)?r.insertBefore(d,l):r.insertBefore(d,null):r.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===r.nodeName&&(null===(s=r.rules)||void 0===s?void 0:s.length)>0&&(r.rules=[]),Te(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(i,r,d,e)};e.adds.forEach((e=>{s(e)}));const r=Date.now();for(;o.length;){const e=Ne(o);if(o.length=0,Date.now()-r>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?Se(t,(e=>{s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),function(e){const t=new Set,n=[];for(let i=e.length;i--;){const o=e[i];t.has(o.id)||(n.push(o),t.add(o.id))}return n}(e.texts).forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(i=null==e?void 0:e.rules)||void 0===i?void 0:i.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const s=t.attributes[e];if(null===s)o.removeAttribute(e);else if("string"==typeof s)try{if("_cssText"===e&&("LINK"===o.nodeName||"STYLE"===o.nodeName))try{const e=n.getMeta(o);Object.assign(e.attributes,t.attributes);const i=pe(e,{doc:o.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),s=o.nextSibling,r=o.parentNode;if(i&&r){r.removeChild(o),r.insertBefore(i,s),n.replace(t.id,i);break}}catch(e){}if("value"===e&&"TEXTAREA"===o.nodeName){const e=o;e.childNodes.forEach((t=>e.removeChild(t)));const t=null===(i=o.ownerDocument)||void 0===i?void 0:i.createTextNode(s);t&&e.appendChild(t)}else o.setAttribute(e,s)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=s,t=o;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const i=e[n];t.style.setProperty(n,i[0],i[1])}else{const i=e[n];t.style.setProperty(n,i)}}}}))}applyScroll(e,t){var n,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===Q.Document)null===(i=o.defaultView)||void 0===i||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const 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){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:i,endOffset:o})=>{const s=this.mirror.getNode(e),r=this.mirror.getNode(i);if(!s||!r)return;const a=new Range;a.setStart(s,n),a.setEnd(r,o);const l=s.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,i,o,s;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:i,index:o}=xe(n);Ce(t.cssRules,i).insertRule(e,o)}else{const i=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,i)}}catch(e){}})),null===(i=e.removes)||void 0===i||i.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:i}=xe(e);Ce(t.cssRules,n).deleteRule(i||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(s=t.replaceSync)||void 0===s||s.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Ce(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Ce(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let i=null,o=null;if(Me(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{i=new o.CSSStyleSheet,this.styleMirror.add(i,e.styleId),this.applyStyleSheetRule({source:ge.StyleSheetRule,adds:e.rules},i)}catch(e){}}));let i=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));Me(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&i<10&&(setTimeout((()=>o(e,t)),0+100*i),i++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,i){const{previousId:o,nextId:s}=i,r=o&&e[o],a=s&&e[s];if(r){const{node:i,mutation:o}=r;t.insertBefore(i,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}if(a){const{node:i,mutation:o}=a;t.insertBefore(i,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}}moveAndHover(e,t,n,i,o){const s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);const r=De(s,this.iframe),a=e*r.absoluteScale+r.x,l=t*r.absoluteScale+r.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:a,y:l}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:i,duration:o}=!0===this.config.mouseTail?bn:Object.assign({},bn,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=i,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),s(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),s()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===me.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(we.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(wn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(wn,...e)}}function Sn(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function Tn(e,t=2){let n=String(e);const i=Math.pow(10,t-1);if(e<i)for(;String(i).length>n.length;)n=`0${e}`;return n}const Dn=6e4,Mn=36e5;function Cn(e){if(e<=0)return"00:00";const t=Math.floor(e/Mn);e%=Mn;const n=Math.floor(e/Dn);e%=Dn;const i=Math.floor(e/1e3);return t?`${Tn(t)}:${Tn(n)}:${Tn(i)}`:`${Tn(n)}:${Tn(i)}`}function xn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach((t=>{t in document&&(e=e||Boolean(document[t]))})),e}function Rn(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function kn(e){return e.type===me.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}function An(t){let n,i,o,s,r,a,d,p,w;return{c(){n=h("div"),i=h("input"),o=m(),s=h("label"),r=m(),a=h("span"),d=f(t[3]),y(i,"type","checkbox"),y(i,"id",t[2]),i.disabled=t[1],y(i,"class","svelte-9brlez"),y(s,"for",t[2]),y(s,"class","svelte-9brlez"),y(a,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),b(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,i),i.checked=t[0],l(n,o),l(n,s),l(n,r),l(n,a),l(a,d),p||(w=g(i,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(i,"id",e[2]),2&t&&(i.disabled=e[1]),1&t&&(i.checked=e[0]),4&t&&y(s,"for",e[2]),8&t&&v(d,e[3]),2&t&&b(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,w()}}}function In(e,t,n){let{disabled:i}=t,{checked:o}=t,{id:s}=t,{label:r}=t;return e.$$set=e=>{"disabled"in e&&n(1,i=e.disabled),"checked"in e&&n(0,o=e.checked),"id"in e&&n(2,s=e.id),"label"in e&&n(3,r=e.label)},[o,i,s,r,function(){o=this.checked,n(0,o)}]}class On extends X{constructor(e){super(),q(this,e,In,An,r,{disabled:1,checked:0,id:2,label:3})}}function _n(e,t,n){const i=e.slice();return i[39]=t[n],i}function $n(e,t,n){const i=e.slice();return i[42]=t[n],i}function Ln(e,t,n){const i=e.slice();return i[45]=t[n],i}function Fn(e){let t,n,i,s,r,a,p,E,N,S,T,D,M,C,R,A,I,O,_,$,L,F,P,B,U,j,Y=Cn(e[6])+"",q=Cn(e[8].totalTime)+"",X=e[14],Q=[];for(let t=0;t<X.length;t+=1)Q[t]=Pn(Ln(e,X,t));let J=e[9],Z=[];for(let t=0;t<J.length;t+=1)Z[t]=Bn($n(e,J,t));function K(e,t){return"playing"===e[7]?jn:Un}let ee=K(e),te=ee(e),ne=e[3],ie=[];for(let t=0;t<ne.length;t+=1)ie[t]=Vn(_n(e,ne,t));function oe(t){e[30](t)}let se={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(se.checked=e[0]),$=new On({props:se}),x.push((()=>function(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}($,"checked",oe))),{c(){t=h("div"),n=h("div"),i=h("span"),s=f(Y),r=m(),a=h("div"),p=h("div"),E=m();for(let e=0;e<Q.length;e+=1)Q[e].c();N=m();for(let e=0;e<Z.length;e+=1)Z[e].c();S=m(),T=h("div"),D=m(),M=h("span"),C=f(q),R=m(),A=h("div"),I=h("button"),te.c(),O=m();for(let e=0;e<ie.length;e+=1)ie[e].c();_=m(),z($.$$.fragment),F=m(),P=h("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(i,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),w(p,"width",e[13]),y(T,"class","rr-progress__handler svelte-19ke1iv"),w(T,"left",e[13]),y(a,"class","rr-progress svelte-19ke1iv"),b(a,"disabled","skipping"===e[10]),y(M,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(I,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(A,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(o,u){c(o,t,u),l(t,n),l(n,i),l(i,s),l(n,r),l(n,a),l(a,p),e[27](p),l(a,E);for(let e=0;e<Q.length;e+=1)Q[e]&&Q[e].m(a,null);l(a,N);for(let e=0;e<Z.length;e+=1)Z[e]&&Z[e].m(a,null);l(a,S),l(a,T),e[28](a),l(n,D),l(n,M),l(M,C),l(t,R),l(t,A),l(A,I),te.m(I,null),l(A,O);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(A,null);l(A,_),G($,A,null),l(A,F),l(A,P),B=!0,U||(j=[g(a,"click",e[16]),g(I,"click",e[4]),g(P,"click",e[31])],U=!0)},p(e,t){if((!B||64&t[0])&&Y!==(Y=Cn(e[6])+"")&&v(s,Y),(!B||8192&t[0])&&w(p,"width",e[13]),16384&t[0]){let n;for(X=e[14],n=0;n<X.length;n+=1){const i=Ln(e,X,n);Q[n]?Q[n].p(i,t):(Q[n]=Pn(i),Q[n].c(),Q[n].m(a,N))}for(;n<Q.length;n+=1)Q[n].d(1);Q.length=X.length}if(512&t[0]){let n;for(J=e[9],n=0;n<J.length;n+=1){const i=$n(e,J,n);Z[n]?Z[n].p(i,t):(Z[n]=Bn(i),Z[n].c(),Z[n].m(a,S))}for(;n<Z.length;n+=1)Z[n].d(1);Z.length=J.length}if((!B||8192&t[0])&&w(T,"left",e[13]),(!B||1024&t[0])&&b(a,"disabled","skipping"===e[10]),(!B||256&t[0])&&q!==(q=Cn(e[8].totalTime)+"")&&v(C,q),ee!==(ee=K(e))&&(te.d(1),te=ee(e),te&&(te.c(),te.m(I,null))),1066&t[0]){let n;for(ne=e[3],n=0;n<ne.length;n+=1){const i=_n(e,ne,n);ie[n]?ie[n].p(i,t):(ie[n]=Vn(i),ie[n].c(),ie[n].m(A,_))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=ne.length}const n={};var i;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],i=()=>L=!1,k.push(i)),$.$set(n)},i(e){B||(V($.$$.fragment,e),B=!0)},o(e){W($.$$.fragment,e),B=!1},d(n){n&&u(t),e[27](null),d(Q,n),d(Z,n),e[28](null),te.d(),d(ie,n),H($),U=!1,o(j)}}}function Pn(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[45].name),w(t,"width",e[45].width),w(t,"height","4px"),w(t,"position","absolute"),w(t,"background",e[45].background),w(t,"left",e[45].position)},m(e,n){c(e,t,n)},p(e,i){16384&i[0]&&n!==(n=e[45].name)&&y(t,"title",n),16384&i[0]&&w(t,"width",e[45].width),16384&i[0]&&w(t,"background",e[45].background),16384&i[0]&&w(t,"left",e[45].position)},d(e){e&&u(t)}}}function Bn(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[42].name),w(t,"width","10px"),w(t,"height","5px"),w(t,"position","absolute"),w(t,"top","2px"),w(t,"transform","translate(-50%, -50%)"),w(t,"background",e[42].background),w(t,"left",e[42].position)},m(e,n){c(e,t,n)},p(e,i){512&i[0]&&n!==(n=e[42].name)&&y(t,"title",n),512&i[0]&&w(t,"background",e[42].background),512&i[0]&&w(t,"left",e[42].position)},d(e){e&&u(t)}}}function Un(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function jn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Vn(e){let t,n,i,o,s,r,a=e[39]+"";function d(){return e[29](e[39])}return{c(){t=h("button"),n=f(a),i=f("x"),t.disabled=o="skipping"===e[10],y(t,"class","svelte-19ke1iv"),b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},m(e,o){c(e,t,o),l(t,n),l(t,i),s||(r=g(t,"click",d),s=!0)},p(i,s){e=i,8&s[0]&&a!==(a=e[39]+"")&&v(n,a),1024&s[0]&&o!==(o="skipping"===e[10])&&(t.disabled=o),1034&s[0]&&b(t,"active",e[39]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),s=!1,r()}}}function Wn(e){let t,n,i=e[2]&&Fn(e);return{c(){i&&i.c(),t=f("")},m(e,o){i&&i.m(e,o),c(e,t,o),n=!0},p(e,n){e[2]?i?(i.p(e,n),4&n[0]&&V(i,1)):(i=Fn(e),i.c(),V(i,1),i.m(t.parentNode,t)):i&&(U(),W(i,1,1,(()=>{i=null})),j())},i(e){n||(V(i),n=!0)},o(e){W(i),n=!1},d(e){i&&i.d(e),e&&u(t)}}}function zn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Gn(e,t,n){const i=M();let o,s,r,a,l,c,u,d,h,p,{replayer:f}=t,{showController:m}=t,{autoPlay:g}=t,{skipInactive:y}=t,{speedOption:v}=t,{speed:w=(v.length?v[0]:1)}=t,{tags:b={}}=t,{inactiveColor:E}=t,N=0,C=null,R=!1,k=null;const A=()=>{C&&(cancelAnimationFrame(C),C=null)},I=()=>{"paused"===o&&(l?(f.play(),l=!1):f.play(N))},O=()=>{"playing"===o&&(f.pause(),R=!1)},_=(e,t)=>{n(6,N=e),R=!1,l=!1;("boolean"==typeof t?t:"playing"===o)?f.play(e):f.pause(e)},$=(e,t,i=!1,o)=>{k=i?{start:e,end:t}:null,n(6,N=e),R=t,c=o,f.play(e)},L=e=>{let t="playing"===o;n(1,w=e),t&&f.pause(),f.setConfig({speed:w}),t&&f.play(N)};var F;T((()=>{n(7,o=f.service.state.value),n(10,s=f.speedService.state.value),f.on("state-change",(e=>{const{player:t,speed:i}=e;if((null==t?void 0:t.value)&&o!==t.value)switch(n(7,o=t.value),o){case"playing":A(),C=requestAnimationFrame((function e(){n(6,N=f.getCurrentTime()),R&&N>=R&&(k?$(k.start,k.end,!0,void 0):(f.pause(),c&&(c(),c=null))),N<u.totalTime&&(C=requestAnimationFrame(e))}));break;case"paused":A()}(null==i?void 0:i.value)&&s!==i.value&&n(10,s=i.value)})),f.on("finish",(()=>{l=!0,c&&(c(),c=null)})),g&&f.play()})),F=()=>{y!==f.config.skipInactive&&f.setConfig({skipInactive:y})},S().$$.after_update.push(F),D((()=>{f.pause(),A()}));return e.$$set=e=>{"replayer"in e&&n(17,f=e.replayer),"showController"in e&&n(2,m=e.showController),"autoPlay"in e&&n(18,g=e.autoPlay),"skipInactive"in e&&n(0,y=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,w=e.speed),"tags"in e&&n(19,b=e.tags),"inactiveColor"in e&&n(20,E=e.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&i("ui-update-current-time",{payload:N}),128&e.$$.dirty[0]&&i("ui-update-player-state",{payload:o}),131072&e.$$.dirty[0]&&n(8,u=f.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,N/u.totalTime);n(13,d=100*e+"%"),i("ui-update-progress",{payload:e})}655360&e.$$.dirty[0]&&n(9,h=(()=>{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=[];return e.events.forEach((e=>{if(e.type===me.Custom){const t={name:e.data.tag,background:b[e.data.tag]||"rgb(73, 80, 246)",position:`${zn(n,i,e.timestamp)}%`};o.push(t)}})),o})()),1179648&e.$$.dirty[0]&&n(14,p=(()=>{try{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=function(e){const t=[];let n=e[0].timestamp;for(const i of e)kn(i)&&(i.timestamp-n>1e4&&t.push([n,i.timestamp]),n=i.timestamp);return t}(e.events),s=(e,t,n,i)=>((i-n)/(t-e)*100).toFixed(2);return o.map((e=>({name:"inactive period",background:E,position:`${zn(n,i,e[0])}%`,width:`${s(n,i,e[0],e[1])}%`})))}catch(e){return[]}})())},[y,w,m,v,()=>{switch(o){case"playing":O();break;case"paused":I()}},L,N,o,u,h,s,r,a,d,p,i,e=>{if("skipping"===s)return;const t=r.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const i=u.totalTime*n;_(i)},f,g,b,E,I,O,_,$,()=>{n(0,y=!y)},()=>Promise.resolve().then((()=>{n(8,u=f.getMetaData())})),function(e){x[e?"unshift":"push"]((()=>{a=e,n(12,a)}))},function(e){x[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},e=>L(e),function(e){y=e,n(0,y)},()=>i("fullscreen")]}class Hn extends X{constructor(e){super(),q(this,e,Gn,Wn,r,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}}function Yn(e){let t,n,i={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new Hn({props:i}),e[32](t),t.$on("fullscreen",e[33]),{c(){z(t.$$.fragment)},m(e,i){G(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.replayer=e[7]),8&n[0]&&(i.showController=e[3]),2&n[0]&&(i.autoPlay=e[1]),4&n[0]&&(i.speedOption=e[2]),1&n[0]&&(i.skipInactive=e[0]),16&n[0]&&(i.tags=e[4]),32&n[0]&&(i.inactiveColor=e[5]),t.$set(i)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(n){e[32](null),H(t,n)}}}function qn(e){let t,n,i,o,s=e[7]&&Yn(e);return{c(){t=h("div"),n=h("div"),i=m(),s&&s.c(),y(n,"class","rr-player__frame"),y(n,"style",e[11]),y(t,"class","rr-player"),y(t,"style",e[12])},m(r,a){c(r,t,a),l(t,n),e[31](n),l(t,i),s&&s.m(t,null),e[34](t),o=!0},p(e,i){(!o||2048&i[0])&&y(n,"style",e[11]),e[7]?s?(s.p(e,i),128&i[0]&&V(s,1)):(s=Yn(e),s.c(),V(s,1),s.m(t,null)):s&&(U(),W(s,1,1,(()=>{s=null})),j()),(!o||4096&i[0])&&y(t,"style",e[12])},i(e){o||(V(s),o=!0)},o(e){W(s),o=!1},d(n){n&&u(t),e[31](null),s&&s.d(),e[34](null)}}}function Xn(e,n,i){let o,{width:s=1024}=n,{height:r=576}=n,{maxScale:l=1}=n,{events:c=[]}=n,{skipInactive:u=!0}=n,{autoPlay:d=!0}=n,{speedOption:h=[1,2,4,8]}=n,{speed:p=1}=n,{showController:f=!0}=n,{tags:m={}}=n,{inactiveColor:g="#D4D4D4"}=n;let y,v,w,b,E,N,S=s,M=r;const C=(e,t)=>{const n=[s/t.width,r/t.height];l&&n.push(l),e.style.transform=`scale(${Math.min(...n)})translate(-50%, -50%)`},R=()=>{var e;y&&(xn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=y).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};T((()=>{if(void 0!==h&&"array"!==Rn(h))throw new Error("speedOption must be array");if(h.forEach((e=>{if("number"!==Rn(e))throw new Error("item of speedOption must be number")})),h.indexOf(p)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${p},\n speedOption: [${h.toString()}]\n ...\n }\n `);var e;i(7,o=new Nn(c,Object.assign({speed:p,root:v,unpackFn:Gt},n))),o.on("resize",(e=>{C(o.wrapper,e)})),e=()=>{xn()?setTimeout((()=>{S=s,M=r,i(13,s=y.offsetWidth),i(14,r=y.offsetHeight-(f?80:0)),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})}),0):(i(13,s=S),i(14,r=M),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),w=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),D((()=>{w&&w()}));return e.$$set=e=>{i(39,n=t(t({},n),a(e))),"width"in e&&i(13,s=e.width),"height"in e&&i(14,r=e.height),"maxScale"in e&&i(15,l=e.maxScale),"events"in e&&i(16,c=e.events),"skipInactive"in e&&i(0,u=e.skipInactive),"autoPlay"in e&&i(1,d=e.autoPlay),"speedOption"in e&&i(2,h=e.speedOption),"speed"in e&&i(17,p=e.speed),"showController"in e&&i(3,f=e.showController),"tags"in e&&i(4,m=e.tags),"inactiveColor"in e&&i(5,g=e.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&i(11,E=Sn({width:`${s}px`,height:`${r}px`})),24584&e.$$.dirty[0]&&i(12,N=Sn({width:`${s}px`,height:`${r+(f?80:0)}px`}))},n=a(n),[u,d,h,f,m,g,R,o,y,v,b,E,N,s,r,l,c,p,()=>o.getMirror(),()=>{C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(e,t)=>{switch(o.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":b.$on(e,(({detail:e})=>t(e)))}},e=>{o.addEvent(e),b.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{b.toggle()},e=>{b.setSpeed(e)},()=>{b.toggleSkipInactive()},()=>{b.play()},()=>{b.pause()},(e,t)=>{b.goto(e,t)},(e,t,n=!1,i)=>{b.playRange(e,t,n,i)},function(e){x[e?"unshift":"push"]((()=>{v=e,i(9,v)}))},function(e){x[e?"unshift":"push"]((()=>{b=e,i(10,b)}))},()=>R(),function(e){x[e?"unshift":"push"]((()=>{y=e,i(8,y)}))}]}class Qn extends X{constructor(e){super(),q(this,e,Xn,qn,r,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}}return class extends Qn{constructor(e){super({target:e.target,props:e.data||e.props})}}}();
|
|
29
|
+
***************************************************************************** */function tn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Kt||(Kt={}));var nn={type:"xstate.init"};function on(e){return void 0===e?[]:[].concat(e)}function sn(e){return{type:"xstate.assign",assignment:e}}function rn(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 an(e){return function(t){return e===t}}function ln(e){return"string"==typeof e?{type:e}:e}function cn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:an(e)}}function un(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function dn(e,t){void 0===t&&(t={});var n=tn(un(on(e.states[e.initial].entry).map((function(e){return rn(e,t.actions)})),e.context,nn),2),i=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:i,context:o,matches:an(e.initial)},transition:function(t,n){var i,o,r="string"==typeof t?{value:t,context:e.context}:t,a=r.value,l=r.context,c=ln(n),u=e.states[a];if(u.on){var d=on(u.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var m=p.value;if(void 0===m)return cn(a,l);var f="string"==typeof m?{target:m}:m,g=f.target,y=f.actions,v=void 0===y?[]:y,b=f.cond,w=void 0===b?function(){return!0}:b,E=void 0===g,N=null!=g?g:a,T=e.states[N];if(w(l,c)){var S=tn(un((E?on(v):[].concat(u.exit,v,T.entry).filter((function(e){return e}))).map((function(e){return rn(e,s._options.actions)})),l,c),3),M=S[0],D=S[1],C=S[2],x=null!=g?g:a;return{value:x,context:D,actions:M,changed:g!==a||M.length>0||C,matches:an(x)}}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return cn(a,l)}};return s}var hn=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function pn(e){var t=e.initialState,n=Kt.NotStarted,i=new Set,o={_machine:e,send:function(o){n===Kt.Running&&(t=e.transition(t,o),hn(t,ln(o)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:an(s.value)}}return n=Kt.Running,hn(t,nn),o},stop:function(){return n=Kt.Stopped,i.clear(),o},get state(){return t},get status(){return n}};return o}class mn{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i+1;n=i-1}}return t}}function fn(e,t){if(e.type===fe.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function gn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:i}){const o=dn({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"]}}},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"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:sn({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:sn(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:s,events:r,baselineTime:a,lastPlayedEvent:l}=e;s.clear();for(const e of r)fn(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.type===fe.Meta&&i.timestamp<=t)return e.slice(n)}return e}(r,a);let u=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===fe.IncrementalSnapshot&&l.data.source===ge.MouseMove&&(u=l.timestamp+(null===(o=l.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&i.emit(be.PlayBack);const d=new Array;for(const e of c)if(!(u&&u<a&&(e.timestamp<=u||e===l)))if(e.timestamp<a)d.push(e);else{const n=t(e,!1);s.addAction({doAction:()=>{n()},delay:e.delay})}n(d),i.emit(be.Flush),s.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:sn((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:sn({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:sn(((e,n)=>{const{baselineTime:i,timer:o,events:s}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;fn(e,i);let r=s.length-1;if(!s[r]||s[r].timestamp<=e.timestamp)s.push(e);else{let t=-1,n=0;for(;n<=r;){const t=Math.floor((n+r)/2);s[t].timestamp<=e.timestamp?n=t+1:r=t-1}-1===t&&(t=n),s.splice(t,0,e)}const a=e.timestamp<i,l=t(e,a);a?l():o.isActive()&&o.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:s})}))}});return pn(o)}function yn(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(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+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function u(t,n){const i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function d(e){const t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){let n,i,s,r=(o()-t.startTime)/468;var a;r=r>1?1:r,a=r,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,s),i===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function m(n,s,r){let l,c,u,d;const h=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=a),p({scrollable:l,method:d,startTime:h,startX:c,startY:u,x:s,y:r})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?m.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):m.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])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void 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)}const e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},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]))return void i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=h(this),o=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+s.left-o.left,n.scrollTop+s.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}}class vn{constructor(e){this.mediaMap=new Map,this.metadataCallbackMap=new Map,this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(be.Start,this.start.bind(this)),this.emitter.on(be.SkipStart,this.start.bind(this)),this.emitter.on(be.Pause,this.pause.bind(this)),this.emitter.on(be.Finish,this.pause.bind(this)),this.speedService.subscribe((()=>{this.syncAllMediaElements()}))}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach(((t,n)=>{this.syncTargetWithState(n),e.pause&&n.pause()}))}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:n}){if(n.isPlaying){const i=(e-n.lastInteractionTimeOffset)/1e3*n.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o))return void this.waitForMetadata(t);let s=n.currentTimeAtLastInteraction+i;t.loop&&!1!==o&&(s%=o),t.currentTime=s}else t.pause(),t.currentTime=n.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e))return;if(!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const t=this.mediaMap.get(e);t&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:n}){var i,o,s,r,a;const l=this.mediaMap.get(e),{type:c,playbackRate:u,currentTime:d,muted:h,volume:p,loop:m}=n;return{isPlaying:0===c||1!==c&&((null==l?void 0:l.isPlaying)||null!==e.getAttribute("autoplay")),currentTimeAtLastInteraction:null!==(i=null!=d?d:null==l?void 0:l.currentTimeAtLastInteraction)&&void 0!==i?i:0,lastInteractionTimeOffset:t,playbackRate:null!==(o=null!=u?u:null==l?void 0:l.playbackRate)&&void 0!==o?o:1,volume:null!==(s=null!=p?p:null==l?void 0:l.volume)&&void 0!==s?s:1,muted:null!==(r=null!=h?h:null==l?void 0:l.muted)&&void 0!==r?r:null===e.getAttribute("muted"),loop:null!==(a=null!=m?m:null==l?void 0:l.loop)&&void 0!==a?a:null===e.getAttribute("loop")}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:n,loop:i,volume:o,isPlaying:s}=t,r=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=n,e.loop=i,e.playbackRate!==a&&(e.playbackRate=a),s&&!r?e.play():e.pause()}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}}addMediaElements(e,t,n){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=n.getMeta(i);if(!o||!("attributes"in o))return;const s=this.service.state.matches("paused"),r=o.attributes;let a=!1;a=r.rr_mediaState?"played"===r.rr_mediaState:null!==i.getAttribute("autoplay"),a&&s&&i.pause();let l=1;"number"==typeof r.rr_mediaPlaybackRate&&(l=r.rr_mediaPlaybackRate);let c=!1;c="boolean"==typeof r.rr_mediaMuted?r.rr_mediaMuted:null!==i.getAttribute("muted");let u=!1;u="boolean"==typeof r.rr_mediaLoop?r.rr_mediaLoop:null!==i.getAttribute("loop");let d=1;"number"==typeof r.rr_mediaVolume&&(d=r.rr_mediaVolume);let h=0;"number"==typeof r.rr_mediaCurrentTime&&(h=r.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:a,currentTimeAtLastInteraction:h,lastInteractionTimeOffset:t,playbackRate:l,volume:d,muted:c,loop:u}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:n}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:n})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}const bn=Zt||en,wn="[replayer]",En={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Nn(e){return e.type==fe.IncrementalSnapshot&&(e.data.source==ge.TouchMove||e.data.source==ge.MouseInteraction&&e.data.type==ye.TouchStart)}class Tn{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new at,this.mouseTail=null,this.tailPositions=[],this.emitter=bn(),this.legacy_missingNodeRetryMap={},this.cache=de(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=K(),this.styleMirror=new Re,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case fe.DomContentLoaded:case fe.Load:case fe.Custom:continue;case fe.FullSnapshot:case fe.Meta:case fe.Plugin:case fe.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case fe.DomContentLoaded:case fe.Load:break;case fe.Custom:n=()=>{this.emitter.emit(be.CustomEvent,e)};break;case fe.Meta:n=()=>this.emitter.emit(be.Resize,{width:e.data.width,height:e.data.height});break;case fe.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset)};break;case fe.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&this.config.skipInactive&&!this.nextUserInteractionEvent){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay;this.play(this.getCurrentTime()+t),this.nextUserInteractionEvent=null}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const i=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[i]){const t=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(be.Finish))};let n=50;e.type===fe.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(be.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:1e4,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:En,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(be.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(be.Flush,(()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Jt({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{nt(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],i=ot(n.node,this.mirror,this.virtualDom.mirror);nt(i,n.node,e,this.virtualDom.mirror),n.node=i}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(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,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(be.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()}));const i=new mn([],{speed:this.config.speed});this.service=gn({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>e.timestamp-t.timestamp)),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((e=>{this.emitter.emit(be.StateChange,{player:e})})),this.speedService=pn(dn({id:"speed",context:{normalSpeed:-1,timer:i},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:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:sn({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(be.StateChange,{speed:e})})),this.mediaManager=new vn({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find((e=>e.type===fe.Meta)),s=this.service.state.context.events.find((e=>e.type===fe.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(be.Resize,{width:e,height:t})}),0)}s&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(Nn)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(be.Start)}pause(e){var t,n;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===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(be.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(be.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(be.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Nn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event:t}})))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=de()}setupDom(){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");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(yn(this.iframe.contentWindow,this.iframe.contentDocument),function(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=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],i=(t,i)=>{if(this.collectIframeAndAttachDocument(n,t),this.mediaManager.isSupportedMediaElement(t)){const{events:n}=this.service.state.context;this.mediaManager.addMediaElements(t,e.timestamp-n[0].timestamp,this.mirror)}for(const e of this.config.plugins||[])e.onBuild&&e.onBuild(t,{id:i,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),me(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(be.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const i=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,wt(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:ge.StyleSheetRule,adds:i.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e<i.length;e++)null===(n=o.sheet)||void 0===n||n.insertRule(i[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(e,o)=>{this.collectIframeAndAttachDocument(i,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===Q.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};pe(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of i)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Se(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,i=this.service.state;const o=()=>{i=this.service.state};this.emitter.on(be.Start,o),this.emitter.on(be.Pause,o);const s=()=>{this.emitter.off(be.Start,o),this.emitter.off(be.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(be.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(be.LoadStylesheetStart),n=setTimeout((()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}}preloadAllImages(){return ke(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(be.Start,e),this.emitter.on(be.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===fe.IncrementalSnapshot&&e.data.source===ge.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),i=null==n?void 0:n.createImageData(t.width,t.height);null==i||i.data,JSON.parse(e.args[0]),null==n||n.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return ke(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map((e=>ke(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(qt(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(qt(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:i}))}}}))}applyIncremental(e,t){var n,i,o;const{data:s}=e;switch(s.source){case ge.Mutation:try{this.applyMutation(s,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,s)}break;case ge.Drag:case ge.TouchMove:case ge.MouseMove:if(t){const e=s.positions[s.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:s}}else s.positions.forEach((n=>{const i={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,s)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(i)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=s.positions[0])||void 0===n?void 0:n.timeOffset)});break;case ge.MouseInteraction:{if(-1===s.id)break;const e=new Event(ye[s.type].toLowerCase()),n=this.mirror.getNode(s.id);if(!n)return this.debugNodeNotFound(s,s.id);this.emitter.emit(be.MouseInteraction,{type:s.type,target:n});const{triggerFocus:i}=this.config;switch(s.type){case ye.Blur:"blur"in n&&n.blur();break;case ye.Focus:i&&n.focus&&n.focus({preventScroll:!0});break;case ye.Click:case ye.TouchStart:case ye.TouchEnd:case ye.MouseDown:case ye.MouseUp:t?(s.type===ye.TouchStart?this.touchActive=!0:s.type===ye.TouchEnd&&(this.touchActive=!1),s.type===ye.MouseDown?this.lastMouseDownEvent=[n,e]:s.type===ye.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x||0,y:s.y||0,id:s.id,debugData:s}):(s.type===ye.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x||0,s.y||0,s.id,t,s),s.type===ye.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ye.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ye.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case ye.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case ge.Scroll:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.scrollData=s;break}this.applyScroll(s,t);break;case ge.ViewportResize:this.emitter.emit(be.Resize,{width:s.width,height:s.height});break;case ge.Input:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.inputData=s;break}this.applyInput(s);break;case ge.MediaInteraction:{const t=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);const n=t,{events:i}=this.service.state.context;this.mediaManager.mediaMutation({target:n,timeOffset:e.timestamp-i[0].timestamp,mutation:s});break}case ge.StyleSheetRule:case ge.StyleDeclaration:this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&(null===(i=this.virtualDom.mirror.getNode(s.id))||void 0===i||i.rules.push(s)):this.applyStyleSheetMutation(s);break;case ge.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);t.canvasMutations.push({event:e,mutation:s})}else{const t=this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);Jt({event:e,mutation:s,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case ge.Font:try{const e=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case ge.Selection:if(t){this.lastSelectionData=s;break}this.applySelection(s);break;case ge.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,vt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=yt(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o)return;let s=n.getNode(t.parentId);if(!s)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&De(s)&&(s=s.shadowRoot),n.removeNodeFromMap(o),s)try{s.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",s,o,e)}}));const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=e=>{var t,s;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let r=n.getNode(e.parentId);if(!r)return e.node.type===Q.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(De(r)||r.attachShadow({mode:"open"}),r=r.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Se(r,n))return void this.attachDocumentToIframe(e,r);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=pe(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(i[e.node.id]={node:d,mutation:e});const h=n.getMeta(r);if(h&&h.type===Q.Element&&"textarea"===h.tagName&&e.node.type===Q.Text){const e=Array.isArray(r.childNodes)?r.childNodes:Array.from(r.childNodes);for(const t of e)t.nodeType===r.TEXT_NODE&&r.removeChild(t)}else if((null==h?void 0:h.type)===Q.Document){const n=r;e.node.type===Q.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?r.insertBefore(d,a.nextSibling):l&&l.parentNode?r.contains(l)?r.insertBefore(d,l):r.insertBefore(d,null):r.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===r.nodeName&&(null===(s=r.rules)||void 0===s?void 0:s.length)>0&&(r.rules=[]),Se(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(i,r,d,e)};e.adds.forEach((e=>{s(e)}));const r=Date.now();for(;o.length;){const e=Ne(o);if(o.length=0,Date.now()-r>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?Te(t,(e=>{s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),function(e){const t=new Set,n=[];for(let i=e.length;i--;){const o=e[i];t.has(o.id)||(n.push(o),t.add(o.id))}return n}(e.texts).forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(i=null==e?void 0:e.rules)||void 0===i?void 0:i.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const s=t.attributes[e];if(null===s)o.removeAttribute(e);else if("string"==typeof s)try{if("_cssText"===e&&("LINK"===o.nodeName||"STYLE"===o.nodeName))try{const e=n.getMeta(o);Object.assign(e.attributes,t.attributes);const i=pe(e,{doc:o.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),s=o.nextSibling,r=o.parentNode;if(i&&r){r.removeChild(o),r.insertBefore(i,s),n.replace(t.id,i);break}}catch(e){}if("value"===e&&"TEXTAREA"===o.nodeName){const e=o;e.childNodes.forEach((t=>e.removeChild(t)));const t=null===(i=o.ownerDocument)||void 0===i?void 0:i.createTextNode(s);t&&e.appendChild(t)}else o.setAttribute(e,s)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=s,t=o;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const i=e[n];t.style.setProperty(n,i[0],i[1])}else{const i=e[n];t.style.setProperty(n,i)}}}}))}applyScroll(e,t){var n,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===Q.Document)null===(i=o.defaultView)||void 0===i||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const 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){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:i,endOffset:o})=>{const s=this.mirror.getNode(e),r=this.mirror.getNode(i);if(!s||!r)return;const a=new Range;a.setStart(s,n),a.setEnd(r,o);const l=s.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,i,o,s;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:i,index:o}=xe(n);Ce(t.cssRules,i).insertRule(e,o)}else{const i=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,i)}}catch(e){}})),null===(i=e.removes)||void 0===i||i.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:i}=xe(e);Ce(t.cssRules,n).deleteRule(i||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(s=t.replaceSync)||void 0===s||s.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Ce(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Ce(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let i=null,o=null;if(De(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{i=new o.CSSStyleSheet,this.styleMirror.add(i,e.styleId),this.applyStyleSheetRule({source:ge.StyleSheetRule,adds:e.rules},i)}catch(e){}}));let i=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));De(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&i<10&&(setTimeout((()=>o(e,t)),0+100*i),i++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,i){const{previousId:o,nextId:s}=i,r=o&&e[o],a=s&&e[s];if(r){const{node:i,mutation:o}=r;t.insertBefore(i,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}if(a){const{node:i,mutation:o}=a;t.insertBefore(i,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}}moveAndHover(e,t,n,i,o){const s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);const r=Me(s,this.iframe),a=e*r.absoluteScale+r.x,l=t*r.absoluteScale+r.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:a,y:l}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:i,duration:o}=!0===this.config.mouseTail?En:Object.assign({},En,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=i,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),s(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),s()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===fe.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(be.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(wn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(wn,...e)}}function Sn(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function Mn(e,t=2){let n=String(e);const i=Math.pow(10,t-1);if(e<i)for(;String(i).length>n.length;)n=`0${e}`;return n}const Dn=6e4,Cn=36e5;function xn(e){if(e<=0)return"00:00";const t=Math.floor(e/Cn);e%=Cn;const n=Math.floor(e/Dn);e%=Dn;const i=Math.floor(e/1e3);return t?`${Mn(t)}:${Mn(n)}:${Mn(i)}`:`${Mn(n)}:${Mn(i)}`}function Rn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach((t=>{t in document&&(e=e||Boolean(document[t]))})),e}function kn(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function An(e){return e.type===fe.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}function In(t){let n,i,o,s,r,a,d,p,b;return{c(){n=h("div"),i=h("input"),o=f(),s=h("label"),r=f(),a=h("span"),d=m(t[3]),y(i,"type","checkbox"),y(i,"id",t[2]),i.disabled=t[1],y(i,"class","svelte-9brlez"),y(s,"for",t[2]),y(s,"class","svelte-9brlez"),y(a,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),w(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,i),i.checked=t[0],l(n,o),l(n,s),l(n,r),l(n,a),l(a,d),p||(b=g(i,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(i,"id",e[2]),2&t&&(i.disabled=e[1]),1&t&&(i.checked=e[0]),4&t&&y(s,"for",e[2]),8&t&&v(d,e[3]),2&t&&w(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,b()}}}function On(e,t,n){let{disabled:i}=t,{checked:o}=t,{id:s}=t,{label:r}=t;return e.$$set=e=>{"disabled"in e&&n(1,i=e.disabled),"checked"in e&&n(0,o=e.checked),"id"in e&&n(2,s=e.id),"label"in e&&n(3,r=e.label)},[o,i,s,r,function(){o=this.checked,n(0,o)}]}class _n extends X{constructor(e){super(),q(this,e,On,In,r,{disabled:1,checked:0,id:2,label:3})}}function $n(e,t,n){const i=e.slice();return i[39]=t[n],i}function Ln(e,t,n){const i=e.slice();return i[42]=t[n],i}function Fn(e,t,n){const i=e.slice();return i[45]=t[n],i}function Pn(e){let t,n,i,s,r,a,p,E,N,T,S,M,D,C,R,A,I,O,_,$,L,F,P,B,U,j,Y=xn(e[6])+"",q=xn(e[8].totalTime)+"",X=e[14],Q=[];for(let t=0;t<X.length;t+=1)Q[t]=Bn(Fn(e,X,t));let J=e[9],Z=[];for(let t=0;t<J.length;t+=1)Z[t]=Un(Ln(e,J,t));function K(e,t){return"playing"===e[7]?Vn:jn}let ee=K(e),te=ee(e),ne=e[3],ie=[];for(let t=0;t<ne.length;t+=1)ie[t]=Wn($n(e,ne,t));function oe(t){e[30](t)}let se={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(se.checked=e[0]),$=new _n({props:se}),x.push((()=>function(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}($,"checked",oe))),{c(){t=h("div"),n=h("div"),i=h("span"),s=m(Y),r=f(),a=h("div"),p=h("div"),E=f();for(let e=0;e<Q.length;e+=1)Q[e].c();N=f();for(let e=0;e<Z.length;e+=1)Z[e].c();T=f(),S=h("div"),M=f(),D=h("span"),C=m(q),R=f(),A=h("div"),I=h("button"),te.c(),O=f();for(let e=0;e<ie.length;e+=1)ie[e].c();_=f(),z($.$$.fragment),F=f(),P=h("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(i,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),b(p,"width",e[13]),y(S,"class","rr-progress__handler svelte-19ke1iv"),b(S,"left",e[13]),y(a,"class","rr-progress svelte-19ke1iv"),w(a,"disabled","skipping"===e[10]),y(D,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(I,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(A,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(o,u){c(o,t,u),l(t,n),l(n,i),l(i,s),l(n,r),l(n,a),l(a,p),e[27](p),l(a,E);for(let e=0;e<Q.length;e+=1)Q[e]&&Q[e].m(a,null);l(a,N);for(let e=0;e<Z.length;e+=1)Z[e]&&Z[e].m(a,null);l(a,T),l(a,S),e[28](a),l(n,M),l(n,D),l(D,C),l(t,R),l(t,A),l(A,I),te.m(I,null),l(A,O);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(A,null);l(A,_),G($,A,null),l(A,F),l(A,P),B=!0,U||(j=[g(a,"click",e[16]),g(I,"click",e[4]),g(P,"click",e[31])],U=!0)},p(e,t){if((!B||64&t[0])&&Y!==(Y=xn(e[6])+"")&&v(s,Y),(!B||8192&t[0])&&b(p,"width",e[13]),16384&t[0]){let n;for(X=e[14],n=0;n<X.length;n+=1){const i=Fn(e,X,n);Q[n]?Q[n].p(i,t):(Q[n]=Bn(i),Q[n].c(),Q[n].m(a,N))}for(;n<Q.length;n+=1)Q[n].d(1);Q.length=X.length}if(512&t[0]){let n;for(J=e[9],n=0;n<J.length;n+=1){const i=Ln(e,J,n);Z[n]?Z[n].p(i,t):(Z[n]=Un(i),Z[n].c(),Z[n].m(a,T))}for(;n<Z.length;n+=1)Z[n].d(1);Z.length=J.length}if((!B||8192&t[0])&&b(S,"left",e[13]),(!B||1024&t[0])&&w(a,"disabled","skipping"===e[10]),(!B||256&t[0])&&q!==(q=xn(e[8].totalTime)+"")&&v(C,q),ee!==(ee=K(e))&&(te.d(1),te=ee(e),te&&(te.c(),te.m(I,null))),1066&t[0]){let n;for(ne=e[3],n=0;n<ne.length;n+=1){const i=$n(e,ne,n);ie[n]?ie[n].p(i,t):(ie[n]=Wn(i),ie[n].c(),ie[n].m(A,_))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=ne.length}const n={};var i;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],i=()=>L=!1,k.push(i)),$.$set(n)},i(e){B||(V($.$$.fragment,e),B=!0)},o(e){W($.$$.fragment,e),B=!1},d(n){n&&u(t),e[27](null),d(Q,n),d(Z,n),e[28](null),te.d(),d(ie,n),H($),U=!1,o(j)}}}function Bn(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[45].name),b(t,"width",e[45].width),b(t,"height","4px"),b(t,"position","absolute"),b(t,"background",e[45].background),b(t,"left",e[45].position)},m(e,n){c(e,t,n)},p(e,i){16384&i[0]&&n!==(n=e[45].name)&&y(t,"title",n),16384&i[0]&&b(t,"width",e[45].width),16384&i[0]&&b(t,"background",e[45].background),16384&i[0]&&b(t,"left",e[45].position)},d(e){e&&u(t)}}}function Un(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[42].name),b(t,"width","10px"),b(t,"height","5px"),b(t,"position","absolute"),b(t,"top","2px"),b(t,"transform","translate(-50%, -50%)"),b(t,"background",e[42].background),b(t,"left",e[42].position)},m(e,n){c(e,t,n)},p(e,i){512&i[0]&&n!==(n=e[42].name)&&y(t,"title",n),512&i[0]&&b(t,"background",e[42].background),512&i[0]&&b(t,"left",e[42].position)},d(e){e&&u(t)}}}function jn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Vn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Wn(e){let t,n,i,o,s,r,a=e[39]+"";function d(){return e[29](e[39])}return{c(){t=h("button"),n=m(a),i=m("x"),t.disabled=o="skipping"===e[10],y(t,"class","svelte-19ke1iv"),w(t,"active",e[39]===e[1]&&"skipping"!==e[10])},m(e,o){c(e,t,o),l(t,n),l(t,i),s||(r=g(t,"click",d),s=!0)},p(i,s){e=i,8&s[0]&&a!==(a=e[39]+"")&&v(n,a),1024&s[0]&&o!==(o="skipping"===e[10])&&(t.disabled=o),1034&s[0]&&w(t,"active",e[39]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),s=!1,r()}}}function zn(e){let t,n,i=e[2]&&Pn(e);return{c(){i&&i.c(),t=m("")},m(e,o){i&&i.m(e,o),c(e,t,o),n=!0},p(e,n){e[2]?i?(i.p(e,n),4&n[0]&&V(i,1)):(i=Pn(e),i.c(),V(i,1),i.m(t.parentNode,t)):i&&(U(),W(i,1,1,(()=>{i=null})),j())},i(e){n||(V(i),n=!0)},o(e){W(i),n=!1},d(e){i&&i.d(e),e&&u(t)}}}function Gn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Hn(e,t,n){const i=D();let o,s,r,a,l,c,u,d,h,p,{replayer:m}=t,{showController:f}=t,{autoPlay:g}=t,{skipInactive:y}=t,{speedOption:v}=t,{speed:b=(v.length?v[0]:1)}=t,{tags:w={}}=t,{inactiveColor:E}=t,N=0,C=null,R=!1,k=null;const A=()=>{C&&(cancelAnimationFrame(C),C=null)},I=()=>{"paused"===o&&(l?(m.play(),l=!1):m.play(N))},O=()=>{"playing"===o&&(m.pause(),R=!1)},_=(e,t)=>{n(6,N=e),R=!1,l=!1;("boolean"==typeof t?t:"playing"===o)?m.play(e):m.pause(e)},$=(e,t,i=!1,o)=>{k=i?{start:e,end:t}:null,n(6,N=e),R=t,c=o,m.play(e)},L=e=>{let t="playing"===o;n(1,b=e),t&&m.pause(),m.setConfig({speed:b}),t&&m.play(N)};var F;S((()=>{n(7,o=m.service.state.value),n(10,s=m.speedService.state.value),m.on("state-change",(e=>{const{player:t,speed:i}=e;if((null==t?void 0:t.value)&&o!==t.value)switch(n(7,o=t.value),o){case"playing":A(),C=requestAnimationFrame((function e(){n(6,N=m.getCurrentTime()),R&&N>=R&&(k?$(k.start,k.end,!0,void 0):(m.pause(),c&&(c(),c=null))),N<u.totalTime&&(C=requestAnimationFrame(e))}));break;case"paused":A()}(null==i?void 0:i.value)&&s!==i.value&&n(10,s=i.value)})),m.on("finish",(()=>{l=!0,c&&(c(),c=null)})),g&&m.play()})),F=()=>{y!==m.config.skipInactive&&m.setConfig({skipInactive:y})},T().$$.after_update.push(F),M((()=>{m.pause(),A()}));return e.$$set=e=>{"replayer"in e&&n(17,m=e.replayer),"showController"in e&&n(2,f=e.showController),"autoPlay"in e&&n(18,g=e.autoPlay),"skipInactive"in e&&n(0,y=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,b=e.speed),"tags"in e&&n(19,w=e.tags),"inactiveColor"in e&&n(20,E=e.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&i("ui-update-current-time",{payload:N}),128&e.$$.dirty[0]&&i("ui-update-player-state",{payload:o}),131072&e.$$.dirty[0]&&n(8,u=m.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,N/u.totalTime);n(13,d=100*e+"%"),i("ui-update-progress",{payload:e})}655360&e.$$.dirty[0]&&n(9,h=(()=>{const{context:e}=m.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=[];return e.events.forEach((e=>{if(e.type===fe.Custom){const t={name:e.data.tag,background:w[e.data.tag]||"rgb(73, 80, 246)",position:`${Gn(n,i,e.timestamp)}%`};o.push(t)}})),o})()),1179648&e.$$.dirty[0]&&n(14,p=(()=>{try{const{context:e}=m.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=function(e,t){const n=[];let i=e[0].timestamp;for(const o of e)An(o)&&(o.timestamp-i>t&&n.push([i,o.timestamp]),i=o.timestamp);return n}(e.events,m.config.inactivePeriodThreshold),s=(e,t,n,i)=>((i-n)/(t-e)*100).toFixed(2);return o.map((e=>({name:"inactive period",background:E,position:`${Gn(n,i,e[0])}%`,width:`${s(n,i,e[0],e[1])}%`})))}catch(e){return[]}})())},[y,b,f,v,()=>{switch(o){case"playing":O();break;case"paused":I()}},L,N,o,u,h,s,r,a,d,p,i,e=>{if("skipping"===s)return;const t=r.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const i=u.totalTime*n;_(i)},m,g,w,E,I,O,_,$,()=>{n(0,y=!y)},()=>Promise.resolve().then((()=>{n(8,u=m.getMetaData())})),function(e){x[e?"unshift":"push"]((()=>{a=e,n(12,a)}))},function(e){x[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},e=>L(e),function(e){y=e,n(0,y)},()=>i("fullscreen")]}class Yn extends X{constructor(e){super(),q(this,e,Hn,zn,r,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}}function qn(e){let t,n,i={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new Yn({props:i}),e[32](t),t.$on("fullscreen",e[33]),{c(){z(t.$$.fragment)},m(e,i){G(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.replayer=e[7]),8&n[0]&&(i.showController=e[3]),2&n[0]&&(i.autoPlay=e[1]),4&n[0]&&(i.speedOption=e[2]),1&n[0]&&(i.skipInactive=e[0]),16&n[0]&&(i.tags=e[4]),32&n[0]&&(i.inactiveColor=e[5]),t.$set(i)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(n){e[32](null),H(t,n)}}}function Xn(e){let t,n,i,o,s=e[7]&&qn(e);return{c(){t=h("div"),n=h("div"),i=f(),s&&s.c(),y(n,"class","rr-player__frame"),y(n,"style",e[11]),y(t,"class","rr-player"),y(t,"style",e[12])},m(r,a){c(r,t,a),l(t,n),e[31](n),l(t,i),s&&s.m(t,null),e[34](t),o=!0},p(e,i){(!o||2048&i[0])&&y(n,"style",e[11]),e[7]?s?(s.p(e,i),128&i[0]&&V(s,1)):(s=qn(e),s.c(),V(s,1),s.m(t,null)):s&&(U(),W(s,1,1,(()=>{s=null})),j()),(!o||4096&i[0])&&y(t,"style",e[12])},i(e){o||(V(s),o=!0)},o(e){W(s),o=!1},d(n){n&&u(t),e[31](null),s&&s.d(),e[34](null)}}}function Qn(e,n,i){let o,{width:s=1024}=n,{height:r=576}=n,{maxScale:l=1}=n,{events:c=[]}=n,{skipInactive:u=!0}=n,{autoPlay:d=!0}=n,{speedOption:h=[1,2,4,8]}=n,{speed:p=1}=n,{showController:m=!0}=n,{tags:f={}}=n,{inactiveColor:g="#D4D4D4"}=n;let y,v,b,w,E,N,T=s,D=r;const C=(e,t)=>{const n=[s/t.width,r/t.height];l&&n.push(l),e.style.transform=`scale(${Math.min(...n)})translate(-50%, -50%)`},R=()=>{var e;y&&(Rn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=y).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};S((()=>{if(void 0!==h&&"array"!==kn(h))throw new Error("speedOption must be array");if(h.forEach((e=>{if("number"!==kn(e))throw new Error("item of speedOption must be number")})),h.indexOf(p)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${p},\n speedOption: [${h.toString()}]\n ...\n }\n `);var e;i(7,o=new Tn(c,Object.assign({speed:p,root:v,unpackFn:Gt},n))),o.on("resize",(e=>{C(o.wrapper,e)})),e=()=>{Rn()?setTimeout((()=>{T=s,D=r,i(13,s=y.offsetWidth),i(14,r=y.offsetHeight-(m?80:0)),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})}),0):(i(13,s=T),i(14,r=D),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),b=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),M((()=>{b&&b()}));return e.$$set=e=>{i(39,n=t(t({},n),a(e))),"width"in e&&i(13,s=e.width),"height"in e&&i(14,r=e.height),"maxScale"in e&&i(15,l=e.maxScale),"events"in e&&i(16,c=e.events),"skipInactive"in e&&i(0,u=e.skipInactive),"autoPlay"in e&&i(1,d=e.autoPlay),"speedOption"in e&&i(2,h=e.speedOption),"speed"in e&&i(17,p=e.speed),"showController"in e&&i(3,m=e.showController),"tags"in e&&i(4,f=e.tags),"inactiveColor"in e&&i(5,g=e.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&i(11,E=Sn({width:`${s}px`,height:`${r}px`})),24584&e.$$.dirty[0]&&i(12,N=Sn({width:`${s}px`,height:`${r+(m?80:0)}px`}))},n=a(n),[u,d,h,m,f,g,R,o,y,v,w,E,N,s,r,l,c,p,()=>o.getMirror(),()=>{C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(e,t)=>{switch(o.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":w.$on(e,(({detail:e})=>t(e)))}},e=>{o.addEvent(e),w.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{w.toggle()},e=>{w.setSpeed(e)},()=>{w.toggleSkipInactive()},()=>{w.play()},()=>{w.pause()},(e,t)=>{w.goto(e,t)},(e,t,n=!1,i)=>{w.playRange(e,t,n,i)},function(e){x[e?"unshift":"push"]((()=>{v=e,i(9,v)}))},function(e){x[e?"unshift":"push"]((()=>{w=e,i(10,w)}))},()=>R(),function(e){x[e?"unshift":"push"]((()=>{y=e,i(8,y)}))}]}class Jn extends X{constructor(e){super(),q(this,e,Qn,Xn,r,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}}return class extends Jn{constructor(e){super({target:e.target,props:e.data||e.props})}}}();
|
|
30
30
|
//# sourceMappingURL=index.js.map
|