@appsurify-testmap/rrweb-player 2.1.0-alpha.3 → 2.1.0-alpha.5

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.
@@ -64,7 +64,7 @@ https://www.w3ctech.com/topic/2226`));let l=t(...n);return l.postcssPlugin=e,l.p
64
64
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
65
65
  https://www.w3ctech.com/topic/2226`));let l=t(...n);return l.postcssPlugin=e,l.postcssVersion=new lr().version,l}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(n,l,a){return U([r(a)]).process(n,l)},r};U.stringify=pf;U.parse=wf;U.fromJSON=df;U.list=vf;U.comment=s=>new hl(s);U.atRule=s=>new fl(s);U.decl=s=>new ul(s);U.rule=s=>new pl(s);U.root=s=>new dl(s);U.document=s=>new cl(s);U.CssSyntaxError=cf;U.Declaration=ul;U.Container=ff;U.Processor=lr;U.Document=cl;U.Comment=hl;U.Warning=mf;U.AtRule=fl;U.Result=gf;U.Input=yf;U.Rule=pl;U.Root=dl;U.Node=bf;hf.registerPostcss(U);var Cf=U;U.default=U;const H=_c(Cf);H.stringify;H.fromJSON;H.plugin;H.parse;H.list;H.document;H.comment;H.atRule;H.rule;H.decl;H.root;H.CssSyntaxError;H.Declaration;H.Container;H.Processor;H.Document;H.Comment;H.Warning;H.AtRule;H.Result;H.Input;H.Rule;H.Root;H.Node;var D=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(D||{});function Sf(s){const e={},t=/;(?![^(]*\))/g,i=/:(.+)/,r=/\/\*.*?\*\//g;return s.replace(r,"").split(t).forEach(function(o){if(o){const n=o.split(i);n.length>1&&(e[Os(n[0].trim())]=n[1].trim())}}),e}function ln(s){const e=[];for(const t in s){const i=s[t];if(typeof i!="string")continue;const r=Rf(t);e.push(`${r}: ${i};`)}return e.join(" ")}const Ef=/-([a-z])/g,xf=/^--[a-zA-Z0-9-]+$/,Os=s=>xf.test(s)?s:s.replace(Ef,(e,t)=>t?t.toUpperCase():""),Af=/\B([A-Z])/g,Rf=s=>s.replace(Af,"-$1").toLowerCase();class ye{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof ye){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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"}}class ar extends ye{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",D.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===D.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===D.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===D.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===D.Element||t===D.DocumentType)&&this.childNodes.some(r=>r.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=ur(this,e);return i.parentElement=null,i}insertBefore(e,t){const i=e.RRNodeType;if((i===D.Element||i===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=vl(this,e,t);return r.parentElement=null,r}removeChild(e){return bl(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const i=this.createDocumentType("html",t,"");this.open(),this.appendChild(i)}}createDocument(e,t,i){return new ar}createDocumentType(e,t,i){const r=new ml(e,t,i);return r.ownerDocument=this,r}createElement(e){const t=new _i(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new gl(e);return t.ownerDocument=this,t}createComment(e){const t=new yl(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new wl(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class ml extends ye{constructor(e,t,i){super(),C(this,"nodeType",10),C(this,"RRNodeType",D.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=i,this.nodeName=e}toString(){return"RRDocumentType"}}class _i extends ye{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",D.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),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 If(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?Sf(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(i,r,o)=>{if(t.test(i))return;const n=Os(i);r?e[n]=r:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=ln(e)},e.removeProperty=i=>{if(t.test(i))return"";const r=Os(i),o=e[r]||"";return delete e[r],this.attributes.style=ln(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,i){this.setAttribute(t,i)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return ur(this,e)}insertBefore(e,t){return vl(this,e,t)}removeChild(e){return bl(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}`}}class Nf extends _i{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}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}}class Mf extends _i{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class gl extends ye{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",D.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class yl extends ye{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",D.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class wl extends ye{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",D.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class If{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...i)=>{for(const r of i){const o=String(r);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...i)=>{this.classes=this.classes.filter(r=>i.indexOf(r)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const i=e.trim().split(/\s+/);this.classes.push(...i)}this.onChange=t}}function ur(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function vl(s,e,t){if(!t)return ur(s,e);if(t.parentNode!==s)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 e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function bl(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var ue=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(ue||{});const Ds={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Of={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 Se=null;function gi(s,e,t,i=e.mirror||e.ownerDocument.mirror){s=Df(s,e,t,i),Cl(s,e,t,i),_f(s,e,t)}function Df(s,e,t,i){var r;if(t.afterAppend&&!Se&&(Se=new WeakSet,setTimeout(()=>{Se=null},0)),!cr(s,e)){const o=yi(e,t.mirror,i);(r=s.parentNode)==null||r.replaceChild(o,s),s=o}switch(e.RRNodeType){case D.Document:{if(!We(s,e,t.mirror,i)){const o=i.getMeta(e);o&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,o),Se==null||Se.add(s))}break}case D.Element:{const o=s,n=e;switch(n.tagName){case"IFRAME":{const l=s.contentDocument;if(!l)break;gi(l,e.contentDocument,t,i);break}}n.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Cl(o.shadowRoot,n.shadowRoot,t,i)),Tf(o,n,i);break}}return s}function _f(s,e,t){var i;switch(e.RRNodeType){case D.Document:{const r=e.scrollData;r&&t.applyScroll(r,!0);break}case D.Element:{const r=s,o=e;switch(o.scrollData&&t.applyScroll(o.scrollData,!0),o.inputData&&t.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const n=s,l=o;l.paused!==void 0&&(l.paused?n.pause():n.play()),l.muted!==void 0&&(n.muted=l.muted),l.volume!==void 0&&(n.volume=l.volume),l.currentTime!==void 0&&(n.currentTime=l.currentTime),l.playbackRate!==void 0&&(n.playbackRate=l.playbackRate),l.loop!==void 0&&(n.loop=l.loop);break}case"CANVAS":{const n=e;if(n.rr_dataURL!==null){const l=document.createElement("img");l.onload=()=>{const a=r.getContext("2d");a&&a.drawImage(l,0,0,l.width,l.height)},l.src=n.rr_dataURL}n.canvasMutations.forEach(l=>t.applyCanvas(l.event,l.mutation,s));break}case"STYLE":{const n=r.sheet;n&&e.rules.forEach(l=>t.applyStyleSheetMutation(l,n));break}case"DIALOG":{const n=r,l=o,a=n.open,u=n.matches("dialog:modal"),c=l.open,h=l.isModal,f=u!==h,g=a!==c;if((f||a&&g)&&n.close(),c&&(g||f))try{h?n.showModal():n.show()}catch(d){console.warn(d)}break}}break}case D.Text:case D.Comment:case D.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}Se!=null&&Se.has(s)&&(Se.delete(s),(i=t.afterAppend)==null||i.call(t,s,t.mirror.getId(s)))}function Tf(s,e,t){const i=s.attributes,r=e.attributes;for(const o in r){const n=r[o],l=t.getMeta(e);if(l!=null&&l.isSVG&&Ds[o])s.setAttributeNS(Ds[o],o,n);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const a=document.createElement("img");a.src=n,a.onload=()=>{const u=s.getContext("2d");u&&u.drawImage(a,0,0,a.width,a.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;try{s.setAttribute(o,n)}catch(a){console.warn(a)}}}for(const{name:o}of Array.from(i))o in r||s.removeAttribute(o);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function Cl(s,e,t,i){const r=Array.from(s.childNodes),o=e.childNodes;if(r.length===0&&o.length===0)return;let n=0,l=r.length-1,a=0,u=o.length-1,c=r[n],h=r[l],f=o[a],g=o[u],d,A;for(;n<=l&&a<=u;)if(c===void 0)c=r[++n];else if(h===void 0)h=r[--l];else if(We(c,f,t.mirror,i))c=r[++n],f=o[++a];else if(We(h,g,t.mirror,i))h=r[--l],g=o[--u];else if(We(c,g,t.mirror,i)){try{s.insertBefore(c,h.nextSibling)}catch(w){console.warn(w)}c=r[++n],g=o[--u]}else if(We(h,f,t.mirror,i)){try{s.insertBefore(h,c)}catch(w){console.warn(w)}h=r[--l],f=o[++a]}else{if(!d){d={};for(let v=n;v<=l;v++){const x=r[v];x&&t.mirror.hasNode(x)&&(d[t.mirror.getId(x)]=v)}}A=d[i.getId(f)];const w=r[A];if(A!==void 0&&w&&We(w,f,t.mirror,i)){try{s.insertBefore(w,c)}catch(v){console.warn(v)}r[A]=void 0}else{const v=yi(f,t.mirror,i);s.nodeName==="#document"&&c&&(v.nodeType===v.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||v.nodeType===v.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=r[++n]);try{s.insertBefore(v,c||null)}catch(x){console.warn(x)}}f=o[++a]}if(n>l){const w=o[u+1];let v=null;for(w&&(v=t.mirror.getNode(i.getId(w)));a<=u;++a){const x=yi(o[a],t.mirror,i);try{s.insertBefore(x,v)}catch(R){console.warn(R)}}}else if(a>u)for(;n<=l;n++){const w=r[n];if(!(!w||w.parentNode!==s))try{s.removeChild(w),t.mirror.removeNodeFromMap(w)}catch(v){console.warn(v)}}let p=s.firstChild,m=e.firstChild;for(;p!==null&&m!==null;)gi(p,m,t,i),p=p.nextSibling,m=m.nextSibling}function yi(s,e,t){const i=t.getId(s),r=t.getMeta(s);let o=null;if(i>-1&&(o=e.getNode(i)),o!==null&&cr(o,s))return o;switch(s.RRNodeType){case D.Document:o=new Document;break;case D.DocumentType:o=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case D.Element:{let n=s.tagName.toLowerCase();n=Of[n]||n,r&&"isSVG"in r&&(r!=null&&r.isSVG)?o=document.createElementNS(Ds.svg,n):o=document.createElement(s.tagName);break}case D.Text:o=document.createTextNode(s.data);break;case D.Comment:o=document.createComment(s.data);break;case D.CDATA:o=document.createCDATASection(s.data);break}r&&e.add(o,$({},r));try{Se==null||Se.add(o)}catch(n){}return o}function cr(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function We(s,e,t,i){const r=t.getId(s),o=i.getId(e);return r===-1||r!==o?!1:cr(s,e)}class rt extends ar{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",Yf()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,i){return new rt}createDocumentType(e,t,i){const r=new kf(e,t,i);return r.ownerDocument=this,r}createElement(e){const t=e.toUpperCase();let i;switch(t){case"AUDIO":case"VIDEO":i=new Pf(t);break;case"IFRAME":i=new Bf(t,this.mirror);break;case"CANVAS":i=new Lf(t);break;case"STYLE":i=new Ff(t);break;case"DIALOG":i=new $f(t);break;default:i=new Ti(t);break}return i.ownerDocument=this,i}createComment(e){const t=new zf(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Vf(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Uf(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 kf=ml;class Ti extends _i{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}}class Pf extends Nf{}class $f extends Mf{}class Lf extends Ti{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}}class Ff extends Ti{constructor(){super(...arguments),C(this,"rules",[])}}class Bf extends Ti{constructor(e,t){super(e),C(this,"contentDocument",new rt),this.contentDocument.mirror=t}}const Uf=gl,zf=yl,Vf=wl;function Wf(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Sl(s,e,t,i){let r;switch(s.nodeType){case ue.DOCUMENT_NODE:i&&i.nodeName==="IFRAME"?r=i.contentDocument:(r=e,r.compatMode=s.compatMode);break;case ue.DOCUMENT_TYPE_NODE:{const n=s;r=e.createDocumentType(n.name,n.publicId,n.systemId);break}case ue.ELEMENT_NODE:{const n=s,l=Wf(n);r=e.createElement(l);const a=r;for(const{name:u,value:c}of Array.from(n.attributes))a.attributes[u]=c;n.scrollLeft&&(a.scrollLeft=n.scrollLeft),n.scrollTop&&(a.scrollTop=n.scrollTop);break}case ue.TEXT_NODE:r=e.createTextNode(s.textContent||"");break;case ue.CDATA_SECTION_NODE:r=e.createCDATASection(s.data);break;case ue.COMMENT_NODE:r=e.createComment(s.textContent||"");break;case ue.DOCUMENT_FRAGMENT_NODE:r=i.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(s);return e instanceof rt&&(o||(o=El(r,e.unserializedId),t.add(s,o)),e.mirror.add(r,$({},o))),r}function Gf(s,e=Nc(),t=new rt){function i(r,o){const n=Sl(r,t,e,o);if(n!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&r.nodeType!==ue.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(n),n.parentNode=o,n.parentElement=o),r.nodeName==="IFRAME"){const l=r.contentDocument;l&&i(l,n)}else(r.nodeType===ue.DOCUMENT_NODE||r.nodeType===ue.ELEMENT_NODE||r.nodeType===ue.DOCUMENT_FRAGMENT_NODE)&&(r.nodeType===ue.ELEMENT_NODE&&r.shadowRoot&&i(r.shadowRoot,n),r.childNodes.forEach(l=>i(l,n)))}return i(s,null),t}function Yf(){return new jf}class jf{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const i=(t=this.getMeta(e))==null?void 0:t.id;return i!=null?i:-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(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){const i=this.getNode(e);if(i){const r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function El(s,e){switch(s.RRNodeType){case D.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case D.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case D.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case D.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case D.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const an={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},un={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jt={},Zf=()=>!!globalThis.Zone;function hr(s){if(Jt[s])return Jt[s];const e=globalThis[s],t=e.prototype,i=s in an?an[s]:void 0,r=!!(i&&i.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in un?un[s]:void 0,n=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(r&&n&&!Zf())return Jt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?Jt[s]=u:t}catch(l){return t}}const Gi={};function Te(s,e,t){var i;const r=`${s}.${String(t)}`;if(Gi[r])return Gi[r].call(e);const o=hr(s),n=(i=Object.getOwnPropertyDescriptor(o,t))==null?void 0:i.get;return n?(Gi[r]=n,n.call(e)):e[t]}const Yi={};function xl(s,e,t){const i=`${s}.${String(t)}`;if(Yi[i])return Yi[i].bind(e);const o=hr(s)[t];return typeof o!="function"?e[t]:(Yi[i]=o,o.bind(e))}function Hf(s){return Te("Node",s,"childNodes")}function Xf(s){return Te("Node",s,"parentNode")}function Jf(s){return Te("Node",s,"parentElement")}function Kf(s){return Te("Node",s,"textContent")}function Qf(s,e){return xl("Node",s,"contains")(e)}function qf(s){return xl("Node",s,"getRootNode")()}function ep(s){return!s||!("host"in s)?null:Te("ShadowRoot",s,"host")}function tp(s){return s.styleSheets}function ip(s){return!s||!("shadowRoot"in s)?null:Te("Element",s,"shadowRoot")}function sp(s,e){return Te("Element",s,"querySelector")(e)}function rp(s,e){return Te("Element",s,"querySelectorAll")(e)}function np(){return hr("MutationObserver").constructor}function op(s,e,t){try{if(!(e in s))return()=>{};const i=s[e],r=t(i);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),s[e]=r,()=>{s[e]=i}}catch(i){return()=>{}}}const lp={childNodes:Hf,parentNode:Xf,parentElement:Jf,textContent:Kf,contains:Qf,getRootNode:qf,host:ep,styleSheets:tp,shadowRoot:ip,querySelector:sp,querySelectorAll:rp,mutationObserver:np,patch:op},Ge=`Please stop import mirror directly. Instead of that,\r
66
66
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
67
- or you can use record.mirror to access the mirror instance during recording.`;let cn={map:{},getId(){return console.error(Ge),-1},getNode(){return console.error(Ge),null},removeNodeFromMap(){console.error(Ge)},has(){return console.error(Ge),!1},reset(){console.error(Ge)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get(s,e,t){return e==="map"&&console.error(Ge),Reflect.get(s,e,t)}}));function ap(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function up(s){const e={},t=(r,o)=>{const n={value:r,parent:o,children:[]};return e[r.node.id]=n,n},i=[];for(const r of s){const{nextId:o,parentId:n}=r;if(o&&o in e){const l=e[o];if(l.parent){const a=l.parent.children.indexOf(l);l.parent.children.splice(a,0,t(r,l.parent))}else{const a=i.indexOf(l);i.splice(a,0,t(r,null))}continue}if(n in e){const l=e[n];l.children.push(t(r,l));continue}i.push(t(r,null))}return i}function Al(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Al(s.children[t],e)}function ji(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Rl(s,e){var t,i;const r=(i=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:i.frameElement;if(!r||r===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=r.getBoundingClientRect(),n=Rl(r,e),l=o.height/r.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:l,absoluteScale:n.absoluteScale*l}}function Kt(s){return s?s instanceof ye&&"shadowRoot"in s?!!s.shadowRoot:!!lp.shadowRoot(s):!1}function ht(s,e){const t=s[e[0]];return e.length===1?t:ht(t.cssRules[e[1]].cssRules,e.slice(2))}function hn(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function cp(s){const e=new Set,t=[];for(let i=s.length;i--;){const r=s[i];e.has(r.id)||(t.push(r),e.add(r.id))}return t}class hp{constructor(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let i;return t===void 0?i=this.id++:i=t,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var J=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(J||{}),L=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityChange=17]="VisibilityChange",s))(L||{}),ie=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(ie||{}),wi=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(wi||{}),_s=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(_s||{}),_=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(_||{}),Oe=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Oe||{}),fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Qt=0;Qt<fn.length;Qt++)ft[fn.charCodeAt(Qt)]=Qt;var fp=function(s){var e=s.length*.75,t=s.length,i,r=0,o,n,l,a;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(i=0;i<t;i+=4)o=ft[s.charCodeAt(i)],n=ft[s.charCodeAt(i+1)],l=ft[s.charCodeAt(i+2)],a=ft[s.charCodeAt(i+3)],c[r++]=o<<2|n>>4,c[r++]=(n&15)<<4|l>>2,c[r++]=(l&3)<<6|a&63;return u};const pp="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",dp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0));typeof window!="undefined"&&window.Blob&&new Blob([dp(pp)],{type:"text/javascript;charset=utf-8"});try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((br=s.contentWindow)==null?void 0:br.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}Zn();function Nl(s){return{all:s=s||new Map,on:function(e,t){var i=s.get(e);i?i.push(t):s.set(e,[t])},off:function(e,t){var i=s.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var i=s.get(e);i&&i.slice().map(function(r){r(t)}),(i=s.get("*"))&&i.slice().map(function(r){r(e,t)})}}}const mp=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"}));function gp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,i=468,r={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(m){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(m)}const l=n(s.navigator.userAgent)?1:0;function a(m,w){this.scrollLeft=m,this.scrollTop=w}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,w){if(w==="Y")return m.clientHeight+l<m.scrollHeight;if(w==="X")return m.clientWidth+l<m.scrollWidth}function f(m,w){const v=s.getComputedStyle(m,null)["overflow"+w];return v==="auto"||v==="scroll"}function g(m){const w=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return w||v}function d(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function A(m){const w=o();let v,x,R,O=(w-m.startTime)/i;O=O>1?1:O,v=u(O),x=m.startX+(m.x-m.startX)*v,R=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,x,R),(x!==m.x||R!==m.y)&&s.requestAnimationFrame(A.bind(s,m))}function p(m,w,v){let x,R,O,Z;const I=o();m===e.body?(x=s,R=s.scrollX||s.pageXOffset,O=s.scrollY||s.pageYOffset,Z=r.scroll):(x=m,R=m.scrollLeft,O=m.scrollTop,Z=a),A({scrollable:x,method:Z,startTime:I,startX:R,startY:O,x:w,y:v})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){r.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}p.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){r.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}p.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const m=arguments[0].left,w=arguments[0].top;p.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,typeof w=="undefined"?this.scrollTop:~~w)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const m=d(this),w=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(p.call(this,m,m.scrollLeft+v.left-w.left,m.scrollTop+v.top-w.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class yp{constructor(e=[],t){N(this,"timeOffset",0),N(this,"speed"),N(this,"actions"),N(this,"raf",null),N(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const i=this.findActionIndex(e);this.actions.splice(i,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 t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,i=this.actions.length-1;for(;t<=i;){const r=Math.floor((t+i)/2);if(this.actions[r].delay<e.delay)t=r+1;else if(this.actions[r].delay>e.delay)i=r-1;else return r+1}return t}}function pn(s,e){if(s.type===J.IncrementalSnapshot&&s.data.source===L.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,i=s.timestamp+t;return s.delay=i-e,i-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
67
+ or you can use record.mirror to access the mirror instance during recording.`;let cn={map:{},getId(){return console.error(Ge),-1},getNode(){return console.error(Ge),null},removeNodeFromMap(){console.error(Ge)},has(){return console.error(Ge),!1},reset(){console.error(Ge)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get(s,e,t){return e==="map"&&console.error(Ge),Reflect.get(s,e,t)}}));function ap(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function up(s){const e={},t=(r,o)=>{const n={value:r,parent:o,children:[]};return e[r.node.id]=n,n},i=[];for(const r of s){const{nextId:o,parentId:n}=r;if(o&&o in e){const l=e[o];if(l.parent){const a=l.parent.children.indexOf(l);l.parent.children.splice(a,0,t(r,l.parent))}else{const a=i.indexOf(l);i.splice(a,0,t(r,null))}continue}if(n in e){const l=e[n];l.children.push(t(r,l));continue}i.push(t(r,null))}return i}function Al(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Al(s.children[t],e)}function ji(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Rl(s,e){var t,i;const r=(i=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:i.frameElement;if(!r||r===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=r.getBoundingClientRect(),n=Rl(r,e),l=o.height/r.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:l,absoluteScale:n.absoluteScale*l}}function Kt(s){return s?s instanceof ye&&"shadowRoot"in s?!!s.shadowRoot:!!lp.shadowRoot(s):!1}function ht(s,e){const t=s[e[0]];return e.length===1?t:ht(t.cssRules[e[1]].cssRules,e.slice(2))}function hn(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function cp(s){const e=new Set,t=[];for(let i=s.length;i--;){const r=s[i];e.has(r.id)||(t.push(r),e.add(r.id))}return t}class hp{constructor(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let i;return t===void 0?i=this.id++:i=t,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var J=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(J||{}),L=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(L||{}),ie=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(ie||{}),wi=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(wi||{}),_s=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(_s||{}),_=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(_||{}),Oe=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Oe||{}),fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Qt=0;Qt<fn.length;Qt++)ft[fn.charCodeAt(Qt)]=Qt;var fp=function(s){var e=s.length*.75,t=s.length,i,r=0,o,n,l,a;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(i=0;i<t;i+=4)o=ft[s.charCodeAt(i)],n=ft[s.charCodeAt(i+1)],l=ft[s.charCodeAt(i+2)],a=ft[s.charCodeAt(i+3)],c[r++]=o<<2|n>>4,c[r++]=(n&15)<<4|l>>2,c[r++]=(l&3)<<6|a&63;return u};const pp="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",dp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0));typeof window!="undefined"&&window.Blob&&new Blob([dp(pp)],{type:"text/javascript;charset=utf-8"});try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((br=s.contentWindow)==null?void 0:br.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}Zn();function Nl(s){return{all:s=s||new Map,on:function(e,t){var i=s.get(e);i?i.push(t):s.set(e,[t])},off:function(e,t){var i=s.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var i=s.get(e);i&&i.slice().map(function(r){r(t)}),(i=s.get("*"))&&i.slice().map(function(r){r(e,t)})}}}const mp=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"}));function gp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,i=468,r={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(m){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(m)}const l=n(s.navigator.userAgent)?1:0;function a(m,w){this.scrollLeft=m,this.scrollTop=w}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,w){if(w==="Y")return m.clientHeight+l<m.scrollHeight;if(w==="X")return m.clientWidth+l<m.scrollWidth}function f(m,w){const v=s.getComputedStyle(m,null)["overflow"+w];return v==="auto"||v==="scroll"}function g(m){const w=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return w||v}function d(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function A(m){const w=o();let v,x,R,O=(w-m.startTime)/i;O=O>1?1:O,v=u(O),x=m.startX+(m.x-m.startX)*v,R=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,x,R),(x!==m.x||R!==m.y)&&s.requestAnimationFrame(A.bind(s,m))}function p(m,w,v){let x,R,O,Z;const I=o();m===e.body?(x=s,R=s.scrollX||s.pageXOffset,O=s.scrollY||s.pageYOffset,Z=r.scroll):(x=m,R=m.scrollLeft,O=m.scrollTop,Z=a),A({scrollable:x,method:Z,startTime:I,startX:R,startY:O,x:w,y:v})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){r.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}p.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){r.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}p.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const m=arguments[0].left,w=arguments[0].top;p.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,typeof w=="undefined"?this.scrollTop:~~w)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const m=d(this),w=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(p.call(this,m,m.scrollLeft+v.left-w.left,m.scrollTop+v.top-w.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class yp{constructor(e=[],t){N(this,"timeOffset",0),N(this,"speed"),N(this,"actions"),N(this,"raf",null),N(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const i=this.findActionIndex(e);this.actions.splice(i,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 t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,i=this.actions.length-1;for(;t<=i;){const r=Math.floor((t+i)/2);if(this.actions[r].delay<e.delay)t=r+1;else if(this.actions[r].delay>e.delay)i=r-1;else return r+1}return t}}function pn(s,e){if(s.type===J.IncrementalSnapshot&&s.data.source===L.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,i=s.timestamp+t;return s.delay=i-e,i-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
68
68
  Copyright (c) Microsoft Corporation.
69
69
 
70
70
  Permission to use, copy, modify, and/or distribute this software for any
@@ -77,7 +77,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
77
77
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
78
78
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
79
79
  PERFORMANCE OF THIS SOFTWARE.
80
- ***************************************************************************** */function dn(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var i,r,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(l){r={error:l}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return n}var Ze;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ze||(Ze={}));var Ml={type:"xstate.init"};function Zi(s){return s===void 0?[]:[].concat(s)}function Ye(s){return{type:"xstate.assign",assignment:s}}function mn(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function vi(s){return function(e){return s===e}}function Il(s){return typeof s=="string"?{type:s}:s}function gn(s,e){return{value:s,context:e,actions:[],changed:!1,matches:vi(s)}}function yn(s,e,t){var i=e,r=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){r=!0;var n=Object.assign({},i);return typeof o.assignment=="function"?n=o.assignment(i,t):Object.keys(o.assignment).forEach(function(l){n[l]=typeof o.assignment[l]=="function"?o.assignment[l](i,t):o.assignment[l]}),i=n,!1}return!0}),i,r]}function Ol(s,e){e===void 0&&(e={});var t=dn(yn(Zi(s.states[s.initial].entry).map(function(n){return mn(n,e.actions)}),s.context,Ml),2),i=t[0],r=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:i,context:r,matches:vi(s.initial)},transition:function(n,l){var a,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=Il(l),d=s.states[h];if(d.on){var A=Zi(d.on[g.type]);try{for(var p=function(V){var le=typeof Symbol=="function"&&Symbol.iterator,re=le&&V[le],te=0;if(re)return re.call(V);if(V&&typeof V.length=="number")return{next:function(){return V&&te>=V.length&&(V=void 0),{value:V&&V[te++],done:!V}}};throw new TypeError(le?"Object is not iterable.":"Symbol.iterator is not defined.")}(A),m=p.next();!m.done;m=p.next()){var w=m.value;if(w===void 0)return gn(h,f);var v=typeof w=="string"?{target:w}:w,x=v.target,R=v.actions,O=R===void 0?[]:R,Z=v.cond,I=Z===void 0?function(){return!0}:Z,X=x===void 0,z=x!=null?x:h,fe=s.states[z];if(I(f,g)){var ae=dn(yn((X?Zi(O):[].concat(d.exit,O,fe.entry).filter(function(V){return V})).map(function(V){return mn(V,o._options.actions)}),f,g),3),q=ae[0],F=ae[1],ne=ae[2],k=x!=null?x:h;return{value:k,context:F,actions:q,changed:x!==h||q.length>0||ne,matches:vi(k)}}}}catch(V){a={error:V}}finally{try{m&&!m.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}}return gn(h,f)}};return o}var wn=function(s,e){return s.actions.forEach(function(t){var i=t.exec;return i&&i(s.context,e)})};function Dl(s){var e=s.initialState,t=Ze.NotStarted,i=new Set,r={_machine:s,send:function(o){t===Ze.Running&&(e=s.transition(e,o),wn(e,Il(o)),i.forEach(function(n){return n(e)}))},subscribe:function(o){return i.add(o),o(e),{unsubscribe:function(){return i.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:vi(n.value)}}return t=Ze.Running,wn(e,Ml),r},stop:function(){return t=Ze.Stopped,i.clear(),r},get state(){return e},get status(){return t}};return r}function wp(s,e){for(let t=s.length-1;t>=0;t--){const i=s[t];if(i.type===J.Meta&&i.timestamp<=e)return s.slice(t)}return s}function vp(s,{getCastFn:e,applyEventsSynchronously:t,emitter:i}){const r=Ol({id:"player",context:s,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:Ye({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:Ye((o,n)=>{let l=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(l=n.payload.timeOffset),oe($({},o),{timeOffset:l,baselineTime:o.events[0].timestamp+l})}),play(o){var n;const{timer:l,events:a,baselineTime:u,lastPlayedEvent:c}=o;l.clear();for(const d of a)pn(d,u);const h=wp(a,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===J.IncrementalSnapshot&&c.data.source===L.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&i.emit(_.PlayBack);const g=new Array;for(const d of h)if(!(f&&f<u&&(d.timestamp<=f||d===c)))if(d.timestamp<u)g.push(d);else{const A=e(d,!1);l.addAction({doAction:()=>{A()},delay:d.delay})}t(g),i.emit(_.Flush),l.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:Ye(o=>oe($({},o),{lastPlayedEvent:null})),startLive:Ye({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:Ye((o,n)=>{const{baselineTime:l,timer:a,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;pn(c,l);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let d=-1,A=0;for(;A<=h;){const p=Math.floor((A+h)/2);u[p].timestamp<=c.timestamp?A=p+1:h=p-1}d===-1&&(d=A),u.splice(d,0,c)}const f=c.timestamp<l,g=e(c,f);f?g():a.isActive()&&a.addAction({doAction:()=>{g()},delay:c.delay})}return oe($({},o),{events:u})})}});return Dl(r)}function bp(s){const e=Ol({id:"speed",context:s,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:(t,i)=>{"payload"in i&&t.timer.setSpeed(i.payload.speed)},recordSpeed:Ye({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Dl(e)}const Cp=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],vn=new Map;function _l(s,e){let t=vn.get(s);return t||(t=new Map,vn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function De(s,e,t){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(t&&(t.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){const r=await De(s,e,t)(i.args);return await createImageBitmap.apply(null,r)}else if("index"in i){if(t||e===null)return i;const{rr_type:r,index:o}=i;return _l(e,r)[o]}else if("args"in i){const{rr_type:r,args:o}=i,n=window[r];return new n(...await Promise.all(o.map(De(s,e,t))))}else{if("base64"in i)return fp(i.base64);if("src"in i){const r=s.get(i.src);if(r)return r;{const o=new Image;return o.src=i.src,s.set(i.src,o),o}}else if("data"in i&&i.rr_type==="Blob"){const r=await Promise.all(i.data.map(De(s,e,t)));return new Blob(r,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map(De(s,e,t)));return i}}function Sp(s,e){try{return e===wi.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const Ep=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function xp(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Ep.includes(t))return;const i=_l(s,t);i.includes(e)||i.push(e)}async function Ap({mutation:s,target:e,type:t,imageMap:i,errorHandler:r}){try{const o=Sp(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],l=await Promise.all(s.args.map(De(i,o))),a=n.apply(o,l);xp(o,a);const u=!1}catch(o){r(s,o)}}async function Rp({event:s,mutations:e,target:t,imageMap:i,errorHandler:r}){const o=t.getContext("2d");if(!o){r(e[0],new Error("Canvas context is null"));return}const n=e.map(async a=>Promise.all(a.args.map(De(i,o))));(await Promise.all(n)).forEach((a,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(i.get(s),h.apply(o,c.args)):h.apply(o,a)}catch(h){r(c,h)}})}async function bn({event:s,mutation:e,target:t,imageMap:i,canvasEventMap:r,errorHandler:o}){try{const n=r.get(s)||e,l="commands"in n?n.commands:[n];if([wi.WebGL,wi.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const u=l[a];await Ap({mutation:u,type:e.type,target:t,imageMap:i,errorHandler:o})}return}await Rp({event:s,mutations:l,target:t,imageMap:i,errorHandler:o})}catch(n){o(e,n)}}class Np{constructor(e){N(this,"mediaMap",new Map),N(this,"warn"),N(this,"service"),N(this,"speedService"),N(this,"emitter"),N(this,"getCurrentTime"),N(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(_.Start,this.start.bind(this)),this.emitter.on(_.SkipStart,this.start.bind(this)),this.emitter.on(_.Pause,this.pause.bind(this)),this.emitter.on(_.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,i)=>{this.syncTargetWithState(i),e.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:i}){if(i.isPlaying){const o=(e-i.lastInteractionTimeOffset)/1e3*i.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let l=i.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(l=l%n),t.currentTime=l}else t.pause(),t.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const i=this.mediaMap.get(e);i&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:i})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:i}){var g,d,A,p,m;const r=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:l,muted:a,volume:u,loop:c}=i;return{isPlaying:o===_s.Play||o!==_s.Pause&&((r==null?void 0:r.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=l!=null?l:r==null?void 0:r.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(d=n!=null?n:r==null?void 0:r.playbackRate)!=null?d:1,volume:(A=u!=null?u:r==null?void 0:r.volume)!=null?A:1,muted:(p=a!=null?a:r==null?void 0:r.muted)!=null?p:e.getAttribute("muted")===null,loop:(m=c!=null?c:r==null?void 0:r.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:i,loop:r,volume:o,isPlaying:n}=t,l=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=i,e.loop=r,e.playbackRate!==a&&(e.playbackRate=a),n&&!l?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,i){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const r=e,o=i.getMeta(r);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),l=o.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=r.getAttribute("autoplay")!==null,a&&n&&r.pause();let u=1;typeof l.rr_mediaPlaybackRate=="number"&&(u=l.rr_mediaPlaybackRate);let c=!1;typeof l.rr_mediaMuted=="boolean"?c=l.rr_mediaMuted:c=r.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=r.getAttribute("loop")!==null;let f=1;typeof l.rr_mediaVolume=="number"&&(f=l.rr_mediaVolume);let g=0;typeof l.rr_mediaCurrentTime=="number"&&(g=l.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:a,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:i}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:i})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function qt(s,e){if(s.nodeName!=="DIALOG"||s instanceof ye)return;const t=s,i=t.open,r=i&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=o==="modal";if(!(i&&!(r&&o==="non-modal"||!r&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}i&&t.close(),n&&(l?t.showModal():t.show())}}function Mp(s,e){if(s.nodeName!=="DIALOG"||s instanceof ye)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const Ip=5*1e3,Op=Nl||mp,Cn="[replayer]",Hi={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Sn(s){return s.type==J.IncrementalSnapshot&&(s.data.source==L.TouchMove||s.data.source==L.MouseInteraction&&s.data.type==ie.TouchStart)}class Dp{constructor(e,t){if(N(this,"wrapper"),N(this,"iframe"),N(this,"service"),N(this,"speedService"),N(this,"config"),N(this,"usingVirtualDom",!1),N(this,"virtualDom",new rt),N(this,"mouse"),N(this,"mouseTail",null),N(this,"tailPositions",[]),N(this,"emitter",Op()),N(this,"nextUserInteractionEvent"),N(this,"legacy_missingNodeRetryMap",{}),N(this,"cache",zr()),N(this,"imageMap",new Map),N(this,"canvasEventMap",new Map),N(this,"mirror",Zn()),N(this,"styleMirror",new hp),N(this,"mediaManager"),N(this,"firstFullSnapshot",null),N(this,"newDocumentQueue",[]),N(this,"mousePos",null),N(this,"touchActive",null),N(this,"lastMouseDownEvent",null),N(this,"lastHoveredRootNode"),N(this,"lastSelectionData",null),N(this,"constructedStyleMutations",[]),N(this,"adoptedStyleSheets",[]),N(this,"handleResize",l=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))}),N(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case J.DomContentLoaded:case J.Load:case J.Custom:continue;case J.FullSnapshot:case J.Meta:case J.Plugin:case J.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),N(this,"getCastFn",(l,a=!1)=>{let u;switch(l.type){case J.DomContentLoaded:case J.Load:break;case J.Custom:u=()=>{this.emitter.emit(_.CustomEvent,l)};break;case J.Meta:u=()=>this.emitter.emit(_.Resize,{width:l.data.width,height:l.data.height});break;case J.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,a),(h=this.iframe.contentWindow)==null||h.scrollTo(l.data.initialOffset)};break;case J.IncrementalSnapshot:u=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=l.timestamp)&&this.isUserInteraction(h)){h.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-l.delay,f={speed:Math.min(Math.round(h/Ip),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(_.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(_.Finish))};let g=50;l.type===J.IncrementalSnapshot&&l.data.source===L.MouseMove&&l.data.positions.length&&(g+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(_.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Hi,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(_.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(_.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,u,c)=>{bn({event:a,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,u)=>{a.source===L.StyleSheetRule?this.applyStyleSheetRule(a,u):a.source===L.StyleDeclaration&&this.applyStyleDeclaration(a,u)},afterAppend:(a,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{gi(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(a){console.warn(a)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[a],c=yi(u.node,this.mirror,this.virtualDom.mirror);gi(c,u.node,l,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[l,a]=this.lastMouseDownEvent;l.dispatchEvent(a)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(_.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const r=new yp([],{speed:this.config.speed});this.service=vp({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(_.StateChange,{player:l})}),this.speedService=bp({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(_.StateChange,{speed:l})}),this.mediaManager=new Np({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(l=>l.type===J.Meta),n=this.service.state.context.events.find(l=>l.type===J.FullSnapshot);if(o){const{width:l,height:a}=o.data;setTimeout(()=>{this.emitter.emit(_.Resize,{width:l,height:a})},0)}n&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(l=this.iframe.contentWindow)==null||l.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(Sn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}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(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?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,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.remove("rrweb-paused"),this.emitter.emit(_.Start)}pause(e){var t,i;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.add("rrweb-paused"),this.emitter.emit(_.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(_.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(_.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Sn(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=zr()}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),this.config.mouseTail!==!1&&(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&&(gp(this.iframe.contentWindow,this.iframe.contentDocument),ap(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 i=[],r=new Set,o=(a,u)=>{if(a.nodeName==="DIALOG"&&r.add(a),this.collectIframeAndAttachDocument(i,a),this.mediaManager.isSupportedMediaElement(a)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Cc(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:u}of i)this.attachDocumentToIframe(a,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:n,head:l}=this.iframe.contentDocument;this.insertStyleRules(n,l),r.forEach(a=>qt(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(_.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var i;const r=Cp(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,El(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:L.StyleSheetRule,adds:r.map((n,l)=>({rule:n,index:l}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<r.length;n++)(i=o.sheet)==null||i.insertRule(r[n],n)}}attachDocumentToIframe(e,t){const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],o=new Set,n=(l,a)=>{l.nodeName==="DIALOG"&&o.add(l),this.collectIframeAndAttachDocument(r,l);const u=i.getMeta(l);if((u==null?void 0:u.type)===Oe.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:a,replayer:this})};dt(e.node,{doc:t.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==l);o.forEach(l=>qt(l))}collectIframeAndAttachDocument(e,t){if(ji(t,this.mirror)){const i=this.newDocumentQueue.find(r=>r.parentId===this.mirror.getId(t));i&&e.push({mutationInQueue:i,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const i=new Set;let r,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(_.Start,n),this.emitter.on(_.Pause,n);const l=()=>{this.emitter.off(_.Start,n),this.emitter.off(_.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(i.add(a),a.addEventListener("load",()=>{i.delete(a),i.size===0&&r!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(_.LoadStylesheetEnd),r&&clearTimeout(r),l())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(_.LoadStylesheetStart),r=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),r=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===J.IncrementalSnapshot&&t.data.source===L.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(r=>{this.preloadImages(r,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const i=document.createElement("canvas"),r=i.getContext("2d"),o=r==null?void 0:r.createImageData(i.width,i.height);r==null||r.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const i={isUnchanged:!0};if("commands"in e){const r=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(De(this.imageMap,null,i)));return oe($({},o),{args:n})}));i.isUnchanged===!1&&this.canvasEventMap.set(t,oe($({},e),{commands:r}))}else{const r=await Promise.all(e.args.map(De(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(t,oe($({},e),{args:r}))}}}applyIncremental(e,t){var i,r,o;const{data:n}=e;switch(n.source){case L.Mutation:{try{this.applyMutation(n,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,n)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(t){const l=n.positions[n.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:n}}else n.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,n)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((i=n.positions[0])==null?void 0:i.timeOffset)});break;case L.MouseInteraction:{if(n.id===-1)break;const l=new Event(ga(ie[n.type])),a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);this.emitter.emit(_.MouseInteraction,{type:n.type,target:a});const{triggerFocus:u}=this.config;switch(n.type){case ie.Blur:"blur"in a&&a.blur();break;case ie.Focus:u&&a.focus&&a.focus({preventScroll:!0});break;case ie.Click:case ie.TouchStart:case ie.TouchEnd:case ie.MouseDown:case ie.MouseUp:t?(n.type===ie.TouchStart?this.touchActive=!0:n.type===ie.TouchEnd&&(this.touchActive=!1),n.type===ie.MouseDown?this.lastMouseDownEvent=[a,l]:n.type===ie.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===ie.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===ie.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===ie.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===ie.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case ie.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case L.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.scrollData=n;break}this.applyScroll(n,t);break}case L.ViewportResize:this.emitter.emit(_.Resize,{width:n.width,height:n.height});break;case L.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.inputData=n;break}this.applyInput(n);break}case L.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);const a=l,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case L.StyleSheetRule:case L.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((r=this.virtualDom.mirror.getNode(n.id))==null||r.rules.push(n)):this.applyStyleSheetMutation(n);break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.canvasMutations.push({event:e,mutation:n})}else{const l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);bn({event:e,mutation:n,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{const l=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(l)}catch(l){this.warn(l)}break}case L.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case L.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Gf(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Sl(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>i.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return;let f=i.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Kt(f)&&(f=f.shadowRoot),i.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const r=$({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=i.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},l=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=i.getNode(u.parentId);if(!f)return u.node.type===Oe.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Kt(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,d=null;if(u.previousId&&(g=i.getNode(u.previousId)),u.nextId&&(d=i.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!i.getNode(u.node.rootId))return;const A=u.node.rootId?i.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ji(f,i)){this.attachDocumentToIframe(u,f);return}const p=(v,x)=>{if(!this.usingVirtualDom){qt(v);for(const R of this.config.plugins||[])R.onBuild&&R.onBuild(v,{id:x,replayer:this})}},m=dt(u.node,{doc:A,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(u.previousId===-1||u.nextId===-1){r[u.node.id]={node:m,mutation:u};return}const w=i.getMeta(f);if(w&&w.type===Oe.Element&&u.node.type===Oe.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(w.tagName==="textarea")for(const x of v)x.nodeType===f.TEXT_NODE&&f.removeChild(x);else if(w.tagName==="style"&&v.length===1)for(const x of v)x.nodeType===f.TEXT_NODE&&!i.hasNode(x)&&(m.textContent=x.textContent,f.removeChild(x))}else if((w==null?void 0:w.type)===Oe.Document){const v=f;u.node.type===Oe.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):d&&d.parentNode?f.contains(d)?f.insertBefore(m,d):f.insertBefore(m,null):f.appendChild(m),p(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),ji(m,this.mirror)){const v=this.mirror.getId(m),x=this.newDocumentQueue.find(R=>R.parentId===v);x&&(this.attachDocumentToIframe(x,m),this.newDocumentQueue=this.newDocumentQueue.filter(R=>R!==x))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(r,f,m,u)};e.adds.forEach(u=>{l(u)});const a=Date.now();for(;o.length;){const u=up(o);if(o.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)i.getNode(c.value.parentId)?Al(c,f=>{l(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),cp(e.texts).forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Ri(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&Mp(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const d=i.getMeta(h),A=dt(oe($({},d),{attributes:$($({},d.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(d.attributes,u.attributes);const p=h.nextSibling,m=h.parentNode;if(A&&m){m.removeChild(h),m.insertBefore(A,p),i.replace(u.id,A);break}}catch(d){}if(f==="value"&&h.nodeName==="TEXTAREA"){const d=h;d.childNodes.forEach(p=>d.removeChild(p));const A=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);A&&d.appendChild(A)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&qt(h,u)}catch(d){this.warn("An error occurred may due to the checkout feature.",d)}else if(f==="style"){const d=g,A=h;for(const p in d)if(d[p]===!1)A.style.removeProperty(p);else if(d[p]instanceof Array){const m=d[p];A.style.setProperty(p,m[0],m[1])}else{const m=d[p];A.style.setProperty(p,m)}}}})}applyScroll(e,t){var i,r;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Oe.Document)(r=o.defaultView)==null||r.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(l){}}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(i){}}applySelection(e){try{const t=new Set,i=e.ranges.map(({start:r,startOffset:o,end:n,endOffset:l})=>{const a=this.mirror.getNode(r),u=this.mirror.getNode(n);if(!a||!u)return;const c=new Range;c.setStart(a,o),c.setEnd(u,l);const h=a.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(r=>r.removeAllRanges()),i.forEach(r=>{var o;return r&&((o=r.selection)==null?void 0:o.addRange(r.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let i=null;e.styleId?i=this.styleMirror.getStyle(e.styleId):e.id&&(i=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),i&&(e.source===L.StyleSheetRule?this.applyStyleSheetRule(e,i):e.source===L.StyleDeclaration&&this.applyStyleDeclaration(e,i))}applyStyleSheetRule(e,t){var i,r,o,n;if((i=e.adds)==null||i.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:u,index:c}=hn(a);ht(t.cssRules,u).insertRule(l,c)}else{const u=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,u)}}catch(u){}}),(r=e.removes)==null||r.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:u}=hn(l);ht(t.cssRules,a).deleteRule(u||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&ht(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&ht(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const i=this.mirror.getNode(e.id);if(!i)return;(t=e.styles)==null||t.forEach(l=>{var a;let u=null,c=null;if(Kt(i)?c=((a=i.ownerDocument)==null?void 0:a.defaultView)||null:i.nodeName==="#document"&&(c=i.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,l.styleId),this.applyStyleSheetRule({source:L.StyleSheetRule,adds:l.rules},u)}catch(h){}});const r=10;let o=0;const n=(l,a)=>{const u=a.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Kt(l)?l.shadowRoot.adoptedStyleSheets=u:l.nodeName==="#document"&&(l.adoptedStyleSheets=u),u.length!==a.length&&o<r&&(setTimeout(()=>n(l,a),0+100*o),o++)};n(i,e.styleIds)}legacy_resolveMissingNode(e,t,i,r){const{previousId:o,nextId:n}=r,l=o&&e[o],a=n&&e[n];if(l){const{node:u,mutation:c}=l;t.insertBefore(u,i),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(a){const{node:u,mutation:c}=a;t.insertBefore(u,i.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,i,r,o){const n=this.mirror.getNode(i);if(!n)return this.debugNodeNotFound(o,i);const l=Rl(n,this.iframe),a=e*l.absoluteScale+l.x,u=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${u}px`,r||this.drawMouseTail({x:a,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:i,strokeStyle:r,duration:o}=this.config.mouseTail===!0?Hi:Object.assign({},Hi,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=i,l.lineCap=t,l.strokeStyle=r,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let i=e;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(e){return e.type!==J.IncrementalSnapshot?!1:e.data.source>L.Mutation&&e.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(_.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(Cn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Cn,...e)}}var he=Uint8Array,_e=Uint16Array,Ts=Uint32Array,Tl=new he([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]),kl=new he([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]),_p=new he([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pl=function(s,e){for(var t=new _e(31),i=0;i<31;++i)t[i]=e+=1<<s[i-1];for(var r=new Ts(t[30]),i=1;i<30;++i)for(var o=t[i];o<t[i+1];++o)r[o]=o-t[i]<<5|i;return[t,r]},$l=Pl(Tl,2),Ll=$l[0],Tp=$l[1];Ll[28]=258,Tp[258]=28;var kp=Pl(kl,0),Pp=kp[0],ks=new _e(32768);for(var Y=0;Y<32768;++Y){var Ie=(Y&43690)>>>1|(Y&21845)<<1;Ie=(Ie&52428)>>>2|(Ie&13107)<<2,Ie=(Ie&61680)>>>4|(Ie&3855)<<4,ks[Y]=((Ie&65280)>>>8|(Ie&255)<<8)>>>1}var mt=function(s,e,t){for(var i=s.length,r=0,o=new _e(e);r<i;++r)++o[s[r]-1];var n=new _e(e);for(r=0;r<e;++r)n[r]=n[r-1]+o[r-1]<<1;var l;if(t){l=new _e(1<<e);var a=15-e;for(r=0;r<i;++r)if(s[r])for(var u=r<<4|s[r],c=e-s[r],h=n[s[r]-1]++<<c,f=h|(1<<c)-1;h<=f;++h)l[ks[h]>>>a]=u}else for(l=new _e(i),r=0;r<i;++r)l[r]=ks[n[s[r]-1]++]>>>15-s[r];return l},Ot=new he(288);for(var Y=0;Y<144;++Y)Ot[Y]=8;for(var Y=144;Y<256;++Y)Ot[Y]=9;for(var Y=256;Y<280;++Y)Ot[Y]=7;for(var Y=280;Y<288;++Y)Ot[Y]=8;var Fl=new he(32);for(var Y=0;Y<32;++Y)Fl[Y]=5;var $p=mt(Ot,9,1),Lp=mt(Fl,5,1),Xi=function(s){for(var e=s[0],t=1;t<s.length;++t)s[t]>e&&(e=s[t]);return e},de=function(s,e,t){var i=e/8>>0;return(s[i]|s[i+1]<<8)>>>(e&7)&t},Ji=function(s,e){var t=e/8>>0;return(s[t]|s[t+1]<<8|s[t+2]<<16)>>>(e&7)},Fp=function(s){return(s/8>>0)+(s&7&&1)},Bl=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var i=new(s instanceof _e?_e:s instanceof Ts?Ts:he)(t-e);return i.set(s.subarray(e,t)),i},Bp=function(s,e,t){var i=s.length,r=!e||t,o=!t||t.i;t||(t={}),e||(e=new he(i*3));var n=function(y){var E=e.length;if(y>E){var P=new he(Math.max(E*2,y));P.set(e),e=P}},l=t.f||0,a=t.p||0,u=t.b||0,c=t.l,h=t.d,f=t.m,g=t.n,d=i*8;do{if(!c){t.f=l=de(s,a,1);var A=de(s,a+1,3);if(a+=3,A)if(A==1)c=$p,h=Lp,f=9,g=5;else if(A==2){var v=de(s,a,31)+257,x=de(s,a+10,15)+4,R=v+de(s,a+5,31)+1;a+=14;for(var O=new he(R),Z=new he(19),I=0;I<x;++I)Z[_p[I]]=de(s,a+I*3,7);a+=x*3;var X=Xi(Z),z=(1<<X)-1;if(!o&&a+R*(X+7)>d)break;for(var fe=mt(Z,X,1),I=0;I<R;){var ae=fe[de(s,a,z)];a+=ae&15;var p=ae>>>4;if(p<16)O[I++]=p;else{var q=0,F=0;for(p==16?(F=3+de(s,a,3),a+=2,q=O[I-1]):p==17?(F=3+de(s,a,7),a+=3):p==18&&(F=11+de(s,a,127),a+=7);F--;)O[I++]=q}}var ne=O.subarray(0,v),k=O.subarray(v);f=Xi(ne),g=Xi(k),c=mt(ne,f,1),h=mt(k,g,1)}else throw"invalid block type";else{var p=Fp(a)+4,m=s[p-4]|s[p-3]<<8,w=p+m;if(w>i){if(o)throw"unexpected EOF";break}r&&n(u+m),e.set(s.subarray(p,w),u),t.b=u+=m,t.p=a=w*8;continue}if(a>d)throw"unexpected EOF"}r&&n(u+131072);for(var V=(1<<f)-1,le=(1<<g)-1,re=f+g+18;o||a+re<d;){var q=c[Ji(s,a)&V],te=q>>>4;if(a+=q&15,a>d)throw"unexpected EOF";if(!q)throw"invalid length/literal";if(te<256)e[u++]=te;else if(te==256){c=null;break}else{var K=te-254;if(te>264){var I=te-257,pe=Tl[I];K=de(s,a,(1<<pe)-1)+Ll[I],a+=pe}var we=h[Ji(s,a)&le],S=we>>>4;if(!we)throw"invalid distance";a+=we&15;var k=Pp[S];if(S>3){var pe=kl[S];k+=Ji(s,a)&(1<<pe)-1,a+=pe}if(a>d)throw"unexpected EOF";r&&n(u+131072);for(var b=u+K;u<b;u+=4)e[u]=e[u-k],e[u+1]=e[u+1-k],e[u+2]=e[u+2-k],e[u+3]=e[u+3-k];u=b}}t.l=c,t.p=a,t.b=u,c&&(l=1,t.m=f,t.d=h,t.n=g)}while(!l);return u==e.length?e:Bl(e,0,u)},Up=function(s){if((s[0]&15)!=8||s[0]>>>4>7||(s[0]<<8|s[1])%31)throw"invalid zlib data";if(s[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function zp(s,e){return Bp((Up(s),s.subarray(2,-4)),e)}function Vp(s,e){for(var t=s.length,i=new he(s.length+(s.length>>>1)),r=0,o=function(u){i[r++]=u},n=0;n<t;++n){if(r+5>i.length){var l=new he(r+8+(t-n<<1));l.set(i),i=l}var a=s.charCodeAt(n);a<128||e?o(a):a<2048?(o(192|a>>>6),o(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|s.charCodeAt(++n)&1023,o(240|a>>>18),o(128|a>>>12&63),o(128|a>>>6&63),o(128|a&63)):(o(224|a>>>12),o(128|a>>>6&63),o(128|a&63))}return Bl(i,0,r)}function Wp(s,e){var t="";if(typeof TextDecoder!="undefined")return new TextDecoder().decode(s);for(var i=0;i<s.length;){var r=s[i++];r<128||e?t+=String.fromCharCode(r):r<224?t+=String.fromCharCode((r&31)<<6|s[i++]&63):r<240?t+=String.fromCharCode((r&15)<<12|(s[i++]&63)<<6|s[i++]&63):(r=((r&15)<<18|(s[i++]&63)<<12|(s[i++]&63)<<6|s[i++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023))}return t}const En="v1",Gp=s=>{if(typeof s!="string")return s;try{const e=JSON.parse(s);if(e.timestamp)return e}catch(e){}try{const e=JSON.parse(Wp(zp(Vp(s,!0))));if(e.v===En)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${En}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};var fr=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(fr||{}),Ps=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityChange=17]="VisibilityChange",s))(Ps||{});function xn(s){let e="";return Object.keys(s).forEach(t=>{e+=`${t}: ${s[t]};`}),e}function ct(s,e=2){let t=String(s);const i=Math.pow(10,e-1);if(s<i)for(;String(i).length>t.length;)t=`0${s}`;return t}const Ul=1e3,$s=60*Ul,An=60*$s;function ei(s){if(s<=0)return"00:00";const e=Math.floor(s/An);s=s%An;const t=Math.floor(s/$s);s=s%$s;const i=Math.floor(s/Ul);return e?`${ct(e)}:${ct(t)}:${ct(i)}`:`${ct(t)}:${ct(i)}`}function Yp(s){return s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen?s.msRequestFullscreen():Promise.resolve()}function jp(){return document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen?document.msExitFullscreen():Promise.resolve()}function Rn(){let s=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach(e=>{e in document&&(s=s||!!document[e])}),s}function Zp(s){return document.addEventListener("fullscreenchange",s),document.addEventListener("webkitfullscreenchange",s),document.addEventListener("mozfullscreenchange",s),document.addEventListener("MSFullscreenChange",s),()=>{document.removeEventListener("fullscreenchange",s),document.removeEventListener("webkitfullscreenchange",s),document.removeEventListener("mozfullscreenchange",s),document.removeEventListener("MSFullscreenChange",s)}}function Nn(s){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(s)]}function Hp(s){return s.type!==fr.IncrementalSnapshot?!1:s.data.source>Ps.Mutation&&s.data.source<=Ps.Input}function Xp(s,e){const t=[];let i=s[0].timestamp;for(const r of s)Hp(r)&&(r.timestamp-i>e&&t.push([i,r.timestamp]),i=r.timestamp);return t}function Jp(s){let e,t,i,r,o,n,l,a,u;return{c(){e=se("div"),t=se("input"),i=ce(),r=se("label"),o=ce(),n=se("span"),l=Le(s[3]),M(t,"type","checkbox"),M(t,"id",s[2]),t.disabled=s[1],M(t,"class","svelte-a6h7w7"),M(r,"for",s[2]),M(r,"class","svelte-a6h7w7"),M(n,"class","label svelte-a6h7w7"),M(e,"class","switch svelte-a6h7w7"),Xe(e,"disabled",s[1])},m(c,h){Me(c,e,h),T(e,t),t.checked=s[0],T(e,i),T(e,r),T(e,o),T(e,n),T(n,l),a||(u=je(t,"change",s[4]),a=!0)},p(c,[h]){h&4&&M(t,"id",c[2]),h&2&&(t.disabled=c[1]),h&1&&(t.checked=c[0]),h&4&&M(r,"for",c[2]),h&8&&li(l,c[3]),h&2&&Xe(e,"disabled",c[1])},i:gt,o:gt,d(c){c&&Ee(e),a=!1,u()}}}function Kp(s,e,t){let{disabled:i}=e,{checked:r}=e,{id:o}=e,{label:n}=e;function l(){r=this.checked,t(0,r)}return s.$$set=a=>{"disabled"in a&&t(1,i=a.disabled),"checked"in a&&t(0,r=a.checked),"id"in a&&t(2,o=a.id),"label"in a&&t(3,n=a.label)},[r,i,o,n,l]}class Qp extends zs{constructor(e){super(),Us(this,e,Kp,Jp,Ls,{disabled:1,checked:0,id:2,label:3})}}function Mn(s,e,t){const i=s.slice();return i[38]=e[t],i}function In(s,e,t){const i=s.slice();return i[41]=e[t],i}function On(s,e,t){const i=s.slice();return i[44]=e[t],i}function Dn(s){let e,t,i,r=ei(s[6])+"",o,n,l,a,u,c,h,f,g,d,A=ei(s[8].totalTime)+"",p,m,w,v,x,R,O,Z,I,X,z,fe,ae,q=ze(s[13]),F=[];for(let S=0;S<q.length;S+=1)F[S]=_n(On(s,q,S));let ne=ze(s[9]),k=[];for(let S=0;S<ne.length;S+=1)k[S]=Tn(In(s,ne,S));function V(S,b){return S[7]==="playing"?ed:qp}let le=V(s),re=le(s),te=ze(s[3]),K=[];for(let S=0;S<te.length;S+=1)K[S]=kn(Mn(s,te,S));function pe(S){s[29](S)}let we={id:"skip",disabled:s[10]==="skipping",label:"skip inactive"};return s[0]!==void 0&&(we.checked=s[0]),O=new Qp({props:we}),$e.push(()=>aa(O,"checked",pe)),{c(){e=se("div"),t=se("div"),i=se("span"),o=Le(r),n=ce(),l=se("div"),a=se("div"),u=ce();for(let S=0;S<F.length;S+=1)F[S].c();c=ce();for(let S=0;S<k.length;S+=1)k[S].c();h=ce(),f=se("div"),g=ce(),d=se("span"),p=Le(A),m=ce(),w=se("div"),v=se("button"),re.c(),x=ce();for(let S=0;S<K.length;S+=1)K[S].c();R=ce(),Yn(O.$$.fragment),I=ce(),X=se("button"),X.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
80
+ ***************************************************************************** */function dn(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var i,r,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(l){r={error:l}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return n}var Ze;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ze||(Ze={}));var Ml={type:"xstate.init"};function Zi(s){return s===void 0?[]:[].concat(s)}function Ye(s){return{type:"xstate.assign",assignment:s}}function mn(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function vi(s){return function(e){return s===e}}function Il(s){return typeof s=="string"?{type:s}:s}function gn(s,e){return{value:s,context:e,actions:[],changed:!1,matches:vi(s)}}function yn(s,e,t){var i=e,r=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){r=!0;var n=Object.assign({},i);return typeof o.assignment=="function"?n=o.assignment(i,t):Object.keys(o.assignment).forEach(function(l){n[l]=typeof o.assignment[l]=="function"?o.assignment[l](i,t):o.assignment[l]}),i=n,!1}return!0}),i,r]}function Ol(s,e){e===void 0&&(e={});var t=dn(yn(Zi(s.states[s.initial].entry).map(function(n){return mn(n,e.actions)}),s.context,Ml),2),i=t[0],r=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:i,context:r,matches:vi(s.initial)},transition:function(n,l){var a,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=Il(l),d=s.states[h];if(d.on){var A=Zi(d.on[g.type]);try{for(var p=function(V){var le=typeof Symbol=="function"&&Symbol.iterator,re=le&&V[le],te=0;if(re)return re.call(V);if(V&&typeof V.length=="number")return{next:function(){return V&&te>=V.length&&(V=void 0),{value:V&&V[te++],done:!V}}};throw new TypeError(le?"Object is not iterable.":"Symbol.iterator is not defined.")}(A),m=p.next();!m.done;m=p.next()){var w=m.value;if(w===void 0)return gn(h,f);var v=typeof w=="string"?{target:w}:w,x=v.target,R=v.actions,O=R===void 0?[]:R,Z=v.cond,I=Z===void 0?function(){return!0}:Z,X=x===void 0,z=x!=null?x:h,fe=s.states[z];if(I(f,g)){var ae=dn(yn((X?Zi(O):[].concat(d.exit,O,fe.entry).filter(function(V){return V})).map(function(V){return mn(V,o._options.actions)}),f,g),3),q=ae[0],F=ae[1],ne=ae[2],k=x!=null?x:h;return{value:k,context:F,actions:q,changed:x!==h||q.length>0||ne,matches:vi(k)}}}}catch(V){a={error:V}}finally{try{m&&!m.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}}return gn(h,f)}};return o}var wn=function(s,e){return s.actions.forEach(function(t){var i=t.exec;return i&&i(s.context,e)})};function Dl(s){var e=s.initialState,t=Ze.NotStarted,i=new Set,r={_machine:s,send:function(o){t===Ze.Running&&(e=s.transition(e,o),wn(e,Il(o)),i.forEach(function(n){return n(e)}))},subscribe:function(o){return i.add(o),o(e),{unsubscribe:function(){return i.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:vi(n.value)}}return t=Ze.Running,wn(e,Ml),r},stop:function(){return t=Ze.Stopped,i.clear(),r},get state(){return e},get status(){return t}};return r}function wp(s,e){for(let t=s.length-1;t>=0;t--){const i=s[t];if(i.type===J.Meta&&i.timestamp<=e)return s.slice(t)}return s}function vp(s,{getCastFn:e,applyEventsSynchronously:t,emitter:i}){const r=Ol({id:"player",context:s,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:Ye({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:Ye((o,n)=>{let l=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(l=n.payload.timeOffset),oe($({},o),{timeOffset:l,baselineTime:o.events[0].timestamp+l})}),play(o){var n;const{timer:l,events:a,baselineTime:u,lastPlayedEvent:c}=o;l.clear();for(const d of a)pn(d,u);const h=wp(a,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===J.IncrementalSnapshot&&c.data.source===L.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&i.emit(_.PlayBack);const g=new Array;for(const d of h)if(!(f&&f<u&&(d.timestamp<=f||d===c)))if(d.timestamp<u)g.push(d);else{const A=e(d,!1);l.addAction({doAction:()=>{A()},delay:d.delay})}t(g),i.emit(_.Flush),l.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:Ye(o=>oe($({},o),{lastPlayedEvent:null})),startLive:Ye({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:Ye((o,n)=>{const{baselineTime:l,timer:a,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;pn(c,l);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let d=-1,A=0;for(;A<=h;){const p=Math.floor((A+h)/2);u[p].timestamp<=c.timestamp?A=p+1:h=p-1}d===-1&&(d=A),u.splice(d,0,c)}const f=c.timestamp<l,g=e(c,f);f?g():a.isActive()&&a.addAction({doAction:()=>{g()},delay:c.delay})}return oe($({},o),{events:u})})}});return Dl(r)}function bp(s){const e=Ol({id:"speed",context:s,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:(t,i)=>{"payload"in i&&t.timer.setSpeed(i.payload.speed)},recordSpeed:Ye({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Dl(e)}const Cp=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],vn=new Map;function _l(s,e){let t=vn.get(s);return t||(t=new Map,vn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function De(s,e,t){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(t&&(t.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){const r=await De(s,e,t)(i.args);return await createImageBitmap.apply(null,r)}else if("index"in i){if(t||e===null)return i;const{rr_type:r,index:o}=i;return _l(e,r)[o]}else if("args"in i){const{rr_type:r,args:o}=i,n=window[r];return new n(...await Promise.all(o.map(De(s,e,t))))}else{if("base64"in i)return fp(i.base64);if("src"in i){const r=s.get(i.src);if(r)return r;{const o=new Image;return o.src=i.src,s.set(i.src,o),o}}else if("data"in i&&i.rr_type==="Blob"){const r=await Promise.all(i.data.map(De(s,e,t)));return new Blob(r,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map(De(s,e,t)));return i}}function Sp(s,e){try{return e===wi.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const Ep=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function xp(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Ep.includes(t))return;const i=_l(s,t);i.includes(e)||i.push(e)}async function Ap({mutation:s,target:e,type:t,imageMap:i,errorHandler:r}){try{const o=Sp(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],l=await Promise.all(s.args.map(De(i,o))),a=n.apply(o,l);xp(o,a);const u=!1}catch(o){r(s,o)}}async function Rp({event:s,mutations:e,target:t,imageMap:i,errorHandler:r}){const o=t.getContext("2d");if(!o){r(e[0],new Error("Canvas context is null"));return}const n=e.map(async a=>Promise.all(a.args.map(De(i,o))));(await Promise.all(n)).forEach((a,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(i.get(s),h.apply(o,c.args)):h.apply(o,a)}catch(h){r(c,h)}})}async function bn({event:s,mutation:e,target:t,imageMap:i,canvasEventMap:r,errorHandler:o}){try{const n=r.get(s)||e,l="commands"in n?n.commands:[n];if([wi.WebGL,wi.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const u=l[a];await Ap({mutation:u,type:e.type,target:t,imageMap:i,errorHandler:o})}return}await Rp({event:s,mutations:l,target:t,imageMap:i,errorHandler:o})}catch(n){o(e,n)}}class Np{constructor(e){N(this,"mediaMap",new Map),N(this,"warn"),N(this,"service"),N(this,"speedService"),N(this,"emitter"),N(this,"getCurrentTime"),N(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(_.Start,this.start.bind(this)),this.emitter.on(_.SkipStart,this.start.bind(this)),this.emitter.on(_.Pause,this.pause.bind(this)),this.emitter.on(_.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,i)=>{this.syncTargetWithState(i),e.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:i}){if(i.isPlaying){const o=(e-i.lastInteractionTimeOffset)/1e3*i.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let l=i.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(l=l%n),t.currentTime=l}else t.pause(),t.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const i=this.mediaMap.get(e);i&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:i})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:i}){var g,d,A,p,m;const r=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:l,muted:a,volume:u,loop:c}=i;return{isPlaying:o===_s.Play||o!==_s.Pause&&((r==null?void 0:r.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=l!=null?l:r==null?void 0:r.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(d=n!=null?n:r==null?void 0:r.playbackRate)!=null?d:1,volume:(A=u!=null?u:r==null?void 0:r.volume)!=null?A:1,muted:(p=a!=null?a:r==null?void 0:r.muted)!=null?p:e.getAttribute("muted")===null,loop:(m=c!=null?c:r==null?void 0:r.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:i,loop:r,volume:o,isPlaying:n}=t,l=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=i,e.loop=r,e.playbackRate!==a&&(e.playbackRate=a),n&&!l?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,i){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const r=e,o=i.getMeta(r);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),l=o.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=r.getAttribute("autoplay")!==null,a&&n&&r.pause();let u=1;typeof l.rr_mediaPlaybackRate=="number"&&(u=l.rr_mediaPlaybackRate);let c=!1;typeof l.rr_mediaMuted=="boolean"?c=l.rr_mediaMuted:c=r.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=r.getAttribute("loop")!==null;let f=1;typeof l.rr_mediaVolume=="number"&&(f=l.rr_mediaVolume);let g=0;typeof l.rr_mediaCurrentTime=="number"&&(g=l.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:a,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:i}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:i})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function qt(s,e){if(s.nodeName!=="DIALOG"||s instanceof ye)return;const t=s,i=t.open,r=i&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=o==="modal";if(!(i&&!(r&&o==="non-modal"||!r&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}i&&t.close(),n&&(l?t.showModal():t.show())}}function Mp(s,e){if(s.nodeName!=="DIALOG"||s instanceof ye)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const Ip=5*1e3,Op=Nl||mp,Cn="[replayer]",Hi={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Sn(s){return s.type==J.IncrementalSnapshot&&(s.data.source==L.TouchMove||s.data.source==L.MouseInteraction&&s.data.type==ie.TouchStart)}class Dp{constructor(e,t){if(N(this,"wrapper"),N(this,"iframe"),N(this,"service"),N(this,"speedService"),N(this,"config"),N(this,"usingVirtualDom",!1),N(this,"virtualDom",new rt),N(this,"mouse"),N(this,"mouseTail",null),N(this,"tailPositions",[]),N(this,"emitter",Op()),N(this,"nextUserInteractionEvent"),N(this,"legacy_missingNodeRetryMap",{}),N(this,"cache",zr()),N(this,"imageMap",new Map),N(this,"canvasEventMap",new Map),N(this,"mirror",Zn()),N(this,"styleMirror",new hp),N(this,"mediaManager"),N(this,"firstFullSnapshot",null),N(this,"newDocumentQueue",[]),N(this,"mousePos",null),N(this,"touchActive",null),N(this,"lastMouseDownEvent",null),N(this,"lastHoveredRootNode"),N(this,"lastSelectionData",null),N(this,"constructedStyleMutations",[]),N(this,"adoptedStyleSheets",[]),N(this,"handleResize",l=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))}),N(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case J.DomContentLoaded:case J.Load:case J.Custom:continue;case J.FullSnapshot:case J.Meta:case J.Plugin:case J.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),N(this,"getCastFn",(l,a=!1)=>{let u;switch(l.type){case J.DomContentLoaded:case J.Load:break;case J.Custom:u=()=>{this.emitter.emit(_.CustomEvent,l)};break;case J.Meta:u=()=>this.emitter.emit(_.Resize,{width:l.data.width,height:l.data.height});break;case J.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,a),(h=this.iframe.contentWindow)==null||h.scrollTo(l.data.initialOffset)};break;case J.IncrementalSnapshot:u=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=l.timestamp)&&this.isUserInteraction(h)){h.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-l.delay,f={speed:Math.min(Math.round(h/Ip),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(_.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(_.Finish))};let g=50;l.type===J.IncrementalSnapshot&&l.data.source===L.MouseMove&&l.data.positions.length&&(g+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(_.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Hi,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(_.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(_.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,u,c)=>{bn({event:a,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,u)=>{a.source===L.StyleSheetRule?this.applyStyleSheetRule(a,u):a.source===L.StyleDeclaration&&this.applyStyleDeclaration(a,u)},afterAppend:(a,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{gi(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(a){console.warn(a)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[a],c=yi(u.node,this.mirror,this.virtualDom.mirror);gi(c,u.node,l,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[l,a]=this.lastMouseDownEvent;l.dispatchEvent(a)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(_.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const r=new yp([],{speed:this.config.speed});this.service=vp({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(_.StateChange,{player:l})}),this.speedService=bp({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(_.StateChange,{speed:l})}),this.mediaManager=new Np({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(l=>l.type===J.Meta),n=this.service.state.context.events.find(l=>l.type===J.FullSnapshot);if(o){const{width:l,height:a}=o.data;setTimeout(()=>{this.emitter.emit(_.Resize,{width:l,height:a})},0)}n&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(l=this.iframe.contentWindow)==null||l.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(Sn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}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(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?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,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.remove("rrweb-paused"),this.emitter.emit(_.Start)}pause(e){var t,i;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.add("rrweb-paused"),this.emitter.emit(_.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(_.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(_.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Sn(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=zr()}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),this.config.mouseTail!==!1&&(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&&(gp(this.iframe.contentWindow,this.iframe.contentDocument),ap(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 i=[],r=new Set,o=(a,u)=>{if(a.nodeName==="DIALOG"&&r.add(a),this.collectIframeAndAttachDocument(i,a),this.mediaManager.isSupportedMediaElement(a)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Cc(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:u}of i)this.attachDocumentToIframe(a,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:n,head:l}=this.iframe.contentDocument;this.insertStyleRules(n,l),r.forEach(a=>qt(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(_.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var i;const r=Cp(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,El(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:L.StyleSheetRule,adds:r.map((n,l)=>({rule:n,index:l}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<r.length;n++)(i=o.sheet)==null||i.insertRule(r[n],n)}}attachDocumentToIframe(e,t){const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],o=new Set,n=(l,a)=>{l.nodeName==="DIALOG"&&o.add(l),this.collectIframeAndAttachDocument(r,l);const u=i.getMeta(l);if((u==null?void 0:u.type)===Oe.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:a,replayer:this})};dt(e.node,{doc:t.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==l);o.forEach(l=>qt(l))}collectIframeAndAttachDocument(e,t){if(ji(t,this.mirror)){const i=this.newDocumentQueue.find(r=>r.parentId===this.mirror.getId(t));i&&e.push({mutationInQueue:i,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const i=new Set;let r,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(_.Start,n),this.emitter.on(_.Pause,n);const l=()=>{this.emitter.off(_.Start,n),this.emitter.off(_.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(i.add(a),a.addEventListener("load",()=>{i.delete(a),i.size===0&&r!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(_.LoadStylesheetEnd),r&&clearTimeout(r),l())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(_.LoadStylesheetStart),r=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),r=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===J.IncrementalSnapshot&&t.data.source===L.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(r=>{this.preloadImages(r,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const i=document.createElement("canvas"),r=i.getContext("2d"),o=r==null?void 0:r.createImageData(i.width,i.height);r==null||r.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const i={isUnchanged:!0};if("commands"in e){const r=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(De(this.imageMap,null,i)));return oe($({},o),{args:n})}));i.isUnchanged===!1&&this.canvasEventMap.set(t,oe($({},e),{commands:r}))}else{const r=await Promise.all(e.args.map(De(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(t,oe($({},e),{args:r}))}}}applyIncremental(e,t){var i,r,o;const{data:n}=e;switch(n.source){case L.Mutation:{try{this.applyMutation(n,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,n)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(t){const l=n.positions[n.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:n}}else n.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,n)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((i=n.positions[0])==null?void 0:i.timeOffset)});break;case L.MouseInteraction:{if(n.id===-1)break;const l=new Event(ga(ie[n.type])),a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);this.emitter.emit(_.MouseInteraction,{type:n.type,target:a});const{triggerFocus:u}=this.config;switch(n.type){case ie.Blur:"blur"in a&&a.blur();break;case ie.Focus:u&&a.focus&&a.focus({preventScroll:!0});break;case ie.Click:case ie.TouchStart:case ie.TouchEnd:case ie.MouseDown:case ie.MouseUp:t?(n.type===ie.TouchStart?this.touchActive=!0:n.type===ie.TouchEnd&&(this.touchActive=!1),n.type===ie.MouseDown?this.lastMouseDownEvent=[a,l]:n.type===ie.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===ie.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===ie.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===ie.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===ie.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case ie.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case L.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.scrollData=n;break}this.applyScroll(n,t);break}case L.ViewportResize:this.emitter.emit(_.Resize,{width:n.width,height:n.height});break;case L.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.inputData=n;break}this.applyInput(n);break}case L.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);const a=l,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case L.StyleSheetRule:case L.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((r=this.virtualDom.mirror.getNode(n.id))==null||r.rules.push(n)):this.applyStyleSheetMutation(n);break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);l.canvasMutations.push({event:e,mutation:n})}else{const l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);bn({event:e,mutation:n,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{const l=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(l)}catch(l){this.warn(l)}break}case L.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case L.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Gf(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Sl(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>i.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return;let f=i.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Kt(f)&&(f=f.shadowRoot),i.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const r=$({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=i.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},l=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=i.getNode(u.parentId);if(!f)return u.node.type===Oe.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Kt(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,d=null;if(u.previousId&&(g=i.getNode(u.previousId)),u.nextId&&(d=i.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!i.getNode(u.node.rootId))return;const A=u.node.rootId?i.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ji(f,i)){this.attachDocumentToIframe(u,f);return}const p=(v,x)=>{if(!this.usingVirtualDom){qt(v);for(const R of this.config.plugins||[])R.onBuild&&R.onBuild(v,{id:x,replayer:this})}},m=dt(u.node,{doc:A,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(u.previousId===-1||u.nextId===-1){r[u.node.id]={node:m,mutation:u};return}const w=i.getMeta(f);if(w&&w.type===Oe.Element&&u.node.type===Oe.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(w.tagName==="textarea")for(const x of v)x.nodeType===f.TEXT_NODE&&f.removeChild(x);else if(w.tagName==="style"&&v.length===1)for(const x of v)x.nodeType===f.TEXT_NODE&&!i.hasNode(x)&&(m.textContent=x.textContent,f.removeChild(x))}else if((w==null?void 0:w.type)===Oe.Document){const v=f;u.node.type===Oe.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):d&&d.parentNode?f.contains(d)?f.insertBefore(m,d):f.insertBefore(m,null):f.appendChild(m),p(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),ji(m,this.mirror)){const v=this.mirror.getId(m),x=this.newDocumentQueue.find(R=>R.parentId===v);x&&(this.attachDocumentToIframe(x,m),this.newDocumentQueue=this.newDocumentQueue.filter(R=>R!==x))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(r,f,m,u)};e.adds.forEach(u=>{l(u)});const a=Date.now();for(;o.length;){const u=up(o);if(o.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)i.getNode(c.value.parentId)?Al(c,f=>{l(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),cp(e.texts).forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Ri(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=i.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&Mp(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const d=i.getMeta(h),A=dt(oe($({},d),{attributes:$($({},d.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(d.attributes,u.attributes);const p=h.nextSibling,m=h.parentNode;if(A&&m){m.removeChild(h),m.insertBefore(A,p),i.replace(u.id,A);break}}catch(d){}if(f==="value"&&h.nodeName==="TEXTAREA"){const d=h;d.childNodes.forEach(p=>d.removeChild(p));const A=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);A&&d.appendChild(A)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&qt(h,u)}catch(d){this.warn("An error occurred may due to the checkout feature.",d)}else if(f==="style"){const d=g,A=h;for(const p in d)if(d[p]===!1)A.style.removeProperty(p);else if(d[p]instanceof Array){const m=d[p];A.style.setProperty(p,m[0],m[1])}else{const m=d[p];A.style.setProperty(p,m)}}}})}applyScroll(e,t){var i,r;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Oe.Document)(r=o.defaultView)==null||r.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(l){}}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(i){}}applySelection(e){try{const t=new Set,i=e.ranges.map(({start:r,startOffset:o,end:n,endOffset:l})=>{const a=this.mirror.getNode(r),u=this.mirror.getNode(n);if(!a||!u)return;const c=new Range;c.setStart(a,o),c.setEnd(u,l);const h=a.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(r=>r.removeAllRanges()),i.forEach(r=>{var o;return r&&((o=r.selection)==null?void 0:o.addRange(r.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let i=null;e.styleId?i=this.styleMirror.getStyle(e.styleId):e.id&&(i=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),i&&(e.source===L.StyleSheetRule?this.applyStyleSheetRule(e,i):e.source===L.StyleDeclaration&&this.applyStyleDeclaration(e,i))}applyStyleSheetRule(e,t){var i,r,o,n;if((i=e.adds)==null||i.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:u,index:c}=hn(a);ht(t.cssRules,u).insertRule(l,c)}else{const u=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,u)}}catch(u){}}),(r=e.removes)==null||r.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:u}=hn(l);ht(t.cssRules,a).deleteRule(u||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&ht(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&ht(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const i=this.mirror.getNode(e.id);if(!i)return;(t=e.styles)==null||t.forEach(l=>{var a;let u=null,c=null;if(Kt(i)?c=((a=i.ownerDocument)==null?void 0:a.defaultView)||null:i.nodeName==="#document"&&(c=i.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,l.styleId),this.applyStyleSheetRule({source:L.StyleSheetRule,adds:l.rules},u)}catch(h){}});const r=10;let o=0;const n=(l,a)=>{const u=a.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Kt(l)?l.shadowRoot.adoptedStyleSheets=u:l.nodeName==="#document"&&(l.adoptedStyleSheets=u),u.length!==a.length&&o<r&&(setTimeout(()=>n(l,a),0+100*o),o++)};n(i,e.styleIds)}legacy_resolveMissingNode(e,t,i,r){const{previousId:o,nextId:n}=r,l=o&&e[o],a=n&&e[n];if(l){const{node:u,mutation:c}=l;t.insertBefore(u,i),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(a){const{node:u,mutation:c}=a;t.insertBefore(u,i.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,i,r,o){const n=this.mirror.getNode(i);if(!n)return this.debugNodeNotFound(o,i);const l=Rl(n,this.iframe),a=e*l.absoluteScale+l.x,u=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${u}px`,r||this.drawMouseTail({x:a,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:i,strokeStyle:r,duration:o}=this.config.mouseTail===!0?Hi:Object.assign({},Hi,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=i,l.lineCap=t,l.strokeStyle=r,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let i=e;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(e){return e.type!==J.IncrementalSnapshot?!1:e.data.source>L.Mutation&&e.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(_.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(Cn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Cn,...e)}}var he=Uint8Array,_e=Uint16Array,Ts=Uint32Array,Tl=new he([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]),kl=new he([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]),_p=new he([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pl=function(s,e){for(var t=new _e(31),i=0;i<31;++i)t[i]=e+=1<<s[i-1];for(var r=new Ts(t[30]),i=1;i<30;++i)for(var o=t[i];o<t[i+1];++o)r[o]=o-t[i]<<5|i;return[t,r]},$l=Pl(Tl,2),Ll=$l[0],Tp=$l[1];Ll[28]=258,Tp[258]=28;var kp=Pl(kl,0),Pp=kp[0],ks=new _e(32768);for(var Y=0;Y<32768;++Y){var Ie=(Y&43690)>>>1|(Y&21845)<<1;Ie=(Ie&52428)>>>2|(Ie&13107)<<2,Ie=(Ie&61680)>>>4|(Ie&3855)<<4,ks[Y]=((Ie&65280)>>>8|(Ie&255)<<8)>>>1}var mt=function(s,e,t){for(var i=s.length,r=0,o=new _e(e);r<i;++r)++o[s[r]-1];var n=new _e(e);for(r=0;r<e;++r)n[r]=n[r-1]+o[r-1]<<1;var l;if(t){l=new _e(1<<e);var a=15-e;for(r=0;r<i;++r)if(s[r])for(var u=r<<4|s[r],c=e-s[r],h=n[s[r]-1]++<<c,f=h|(1<<c)-1;h<=f;++h)l[ks[h]>>>a]=u}else for(l=new _e(i),r=0;r<i;++r)l[r]=ks[n[s[r]-1]++]>>>15-s[r];return l},Ot=new he(288);for(var Y=0;Y<144;++Y)Ot[Y]=8;for(var Y=144;Y<256;++Y)Ot[Y]=9;for(var Y=256;Y<280;++Y)Ot[Y]=7;for(var Y=280;Y<288;++Y)Ot[Y]=8;var Fl=new he(32);for(var Y=0;Y<32;++Y)Fl[Y]=5;var $p=mt(Ot,9,1),Lp=mt(Fl,5,1),Xi=function(s){for(var e=s[0],t=1;t<s.length;++t)s[t]>e&&(e=s[t]);return e},de=function(s,e,t){var i=e/8>>0;return(s[i]|s[i+1]<<8)>>>(e&7)&t},Ji=function(s,e){var t=e/8>>0;return(s[t]|s[t+1]<<8|s[t+2]<<16)>>>(e&7)},Fp=function(s){return(s/8>>0)+(s&7&&1)},Bl=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var i=new(s instanceof _e?_e:s instanceof Ts?Ts:he)(t-e);return i.set(s.subarray(e,t)),i},Bp=function(s,e,t){var i=s.length,r=!e||t,o=!t||t.i;t||(t={}),e||(e=new he(i*3));var n=function(y){var E=e.length;if(y>E){var P=new he(Math.max(E*2,y));P.set(e),e=P}},l=t.f||0,a=t.p||0,u=t.b||0,c=t.l,h=t.d,f=t.m,g=t.n,d=i*8;do{if(!c){t.f=l=de(s,a,1);var A=de(s,a+1,3);if(a+=3,A)if(A==1)c=$p,h=Lp,f=9,g=5;else if(A==2){var v=de(s,a,31)+257,x=de(s,a+10,15)+4,R=v+de(s,a+5,31)+1;a+=14;for(var O=new he(R),Z=new he(19),I=0;I<x;++I)Z[_p[I]]=de(s,a+I*3,7);a+=x*3;var X=Xi(Z),z=(1<<X)-1;if(!o&&a+R*(X+7)>d)break;for(var fe=mt(Z,X,1),I=0;I<R;){var ae=fe[de(s,a,z)];a+=ae&15;var p=ae>>>4;if(p<16)O[I++]=p;else{var q=0,F=0;for(p==16?(F=3+de(s,a,3),a+=2,q=O[I-1]):p==17?(F=3+de(s,a,7),a+=3):p==18&&(F=11+de(s,a,127),a+=7);F--;)O[I++]=q}}var ne=O.subarray(0,v),k=O.subarray(v);f=Xi(ne),g=Xi(k),c=mt(ne,f,1),h=mt(k,g,1)}else throw"invalid block type";else{var p=Fp(a)+4,m=s[p-4]|s[p-3]<<8,w=p+m;if(w>i){if(o)throw"unexpected EOF";break}r&&n(u+m),e.set(s.subarray(p,w),u),t.b=u+=m,t.p=a=w*8;continue}if(a>d)throw"unexpected EOF"}r&&n(u+131072);for(var V=(1<<f)-1,le=(1<<g)-1,re=f+g+18;o||a+re<d;){var q=c[Ji(s,a)&V],te=q>>>4;if(a+=q&15,a>d)throw"unexpected EOF";if(!q)throw"invalid length/literal";if(te<256)e[u++]=te;else if(te==256){c=null;break}else{var K=te-254;if(te>264){var I=te-257,pe=Tl[I];K=de(s,a,(1<<pe)-1)+Ll[I],a+=pe}var we=h[Ji(s,a)&le],S=we>>>4;if(!we)throw"invalid distance";a+=we&15;var k=Pp[S];if(S>3){var pe=kl[S];k+=Ji(s,a)&(1<<pe)-1,a+=pe}if(a>d)throw"unexpected EOF";r&&n(u+131072);for(var b=u+K;u<b;u+=4)e[u]=e[u-k],e[u+1]=e[u+1-k],e[u+2]=e[u+2-k],e[u+3]=e[u+3-k];u=b}}t.l=c,t.p=a,t.b=u,c&&(l=1,t.m=f,t.d=h,t.n=g)}while(!l);return u==e.length?e:Bl(e,0,u)},Up=function(s){if((s[0]&15)!=8||s[0]>>>4>7||(s[0]<<8|s[1])%31)throw"invalid zlib data";if(s[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function zp(s,e){return Bp((Up(s),s.subarray(2,-4)),e)}function Vp(s,e){for(var t=s.length,i=new he(s.length+(s.length>>>1)),r=0,o=function(u){i[r++]=u},n=0;n<t;++n){if(r+5>i.length){var l=new he(r+8+(t-n<<1));l.set(i),i=l}var a=s.charCodeAt(n);a<128||e?o(a):a<2048?(o(192|a>>>6),o(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|s.charCodeAt(++n)&1023,o(240|a>>>18),o(128|a>>>12&63),o(128|a>>>6&63),o(128|a&63)):(o(224|a>>>12),o(128|a>>>6&63),o(128|a&63))}return Bl(i,0,r)}function Wp(s,e){var t="";if(typeof TextDecoder!="undefined")return new TextDecoder().decode(s);for(var i=0;i<s.length;){var r=s[i++];r<128||e?t+=String.fromCharCode(r):r<224?t+=String.fromCharCode((r&31)<<6|s[i++]&63):r<240?t+=String.fromCharCode((r&15)<<12|(s[i++]&63)<<6|s[i++]&63):(r=((r&15)<<18|(s[i++]&63)<<12|(s[i++]&63)<<6|s[i++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023))}return t}const En="v1",Gp=s=>{if(typeof s!="string")return s;try{const e=JSON.parse(s);if(e.timestamp)return e}catch(e){}try{const e=JSON.parse(Wp(zp(Vp(s,!0))));if(e.v===En)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${En}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};var fr=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(fr||{}),Ps=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(Ps||{});function xn(s){let e="";return Object.keys(s).forEach(t=>{e+=`${t}: ${s[t]};`}),e}function ct(s,e=2){let t=String(s);const i=Math.pow(10,e-1);if(s<i)for(;String(i).length>t.length;)t=`0${s}`;return t}const Ul=1e3,$s=60*Ul,An=60*$s;function ei(s){if(s<=0)return"00:00";const e=Math.floor(s/An);s=s%An;const t=Math.floor(s/$s);s=s%$s;const i=Math.floor(s/Ul);return e?`${ct(e)}:${ct(t)}:${ct(i)}`:`${ct(t)}:${ct(i)}`}function Yp(s){return s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen?s.msRequestFullscreen():Promise.resolve()}function jp(){return document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen?document.msExitFullscreen():Promise.resolve()}function Rn(){let s=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach(e=>{e in document&&(s=s||!!document[e])}),s}function Zp(s){return document.addEventListener("fullscreenchange",s),document.addEventListener("webkitfullscreenchange",s),document.addEventListener("mozfullscreenchange",s),document.addEventListener("MSFullscreenChange",s),()=>{document.removeEventListener("fullscreenchange",s),document.removeEventListener("webkitfullscreenchange",s),document.removeEventListener("mozfullscreenchange",s),document.removeEventListener("MSFullscreenChange",s)}}function Nn(s){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(s)]}function Hp(s){return s.type!==fr.IncrementalSnapshot?!1:s.data.source>Ps.Mutation&&s.data.source<=Ps.Input}function Xp(s,e){const t=[];let i=s[0].timestamp;for(const r of s)Hp(r)&&(r.timestamp-i>e&&t.push([i,r.timestamp]),i=r.timestamp);return t}function Jp(s){let e,t,i,r,o,n,l,a,u;return{c(){e=se("div"),t=se("input"),i=ce(),r=se("label"),o=ce(),n=se("span"),l=Le(s[3]),M(t,"type","checkbox"),M(t,"id",s[2]),t.disabled=s[1],M(t,"class","svelte-a6h7w7"),M(r,"for",s[2]),M(r,"class","svelte-a6h7w7"),M(n,"class","label svelte-a6h7w7"),M(e,"class","switch svelte-a6h7w7"),Xe(e,"disabled",s[1])},m(c,h){Me(c,e,h),T(e,t),t.checked=s[0],T(e,i),T(e,r),T(e,o),T(e,n),T(n,l),a||(u=je(t,"change",s[4]),a=!0)},p(c,[h]){h&4&&M(t,"id",c[2]),h&2&&(t.disabled=c[1]),h&1&&(t.checked=c[0]),h&4&&M(r,"for",c[2]),h&8&&li(l,c[3]),h&2&&Xe(e,"disabled",c[1])},i:gt,o:gt,d(c){c&&Ee(e),a=!1,u()}}}function Kp(s,e,t){let{disabled:i}=e,{checked:r}=e,{id:o}=e,{label:n}=e;function l(){r=this.checked,t(0,r)}return s.$$set=a=>{"disabled"in a&&t(1,i=a.disabled),"checked"in a&&t(0,r=a.checked),"id"in a&&t(2,o=a.id),"label"in a&&t(3,n=a.label)},[r,i,o,n,l]}class Qp extends zs{constructor(e){super(),Us(this,e,Kp,Jp,Ls,{disabled:1,checked:0,id:2,label:3})}}function Mn(s,e,t){const i=s.slice();return i[38]=e[t],i}function In(s,e,t){const i=s.slice();return i[41]=e[t],i}function On(s,e,t){const i=s.slice();return i[44]=e[t],i}function Dn(s){let e,t,i,r=ei(s[6])+"",o,n,l,a,u,c,h,f,g,d,A=ei(s[8].totalTime)+"",p,m,w,v,x,R,O,Z,I,X,z,fe,ae,q=ze(s[13]),F=[];for(let S=0;S<q.length;S+=1)F[S]=_n(On(s,q,S));let ne=ze(s[9]),k=[];for(let S=0;S<ne.length;S+=1)k[S]=Tn(In(s,ne,S));function V(S,b){return S[7]==="playing"?ed:qp}let le=V(s),re=le(s),te=ze(s[3]),K=[];for(let S=0;S<te.length;S+=1)K[S]=kn(Mn(s,te,S));function pe(S){s[29](S)}let we={id:"skip",disabled:s[10]==="skipping",label:"skip inactive"};return s[0]!==void 0&&(we.checked=s[0]),O=new Qp({props:we}),$e.push(()=>aa(O,"checked",pe)),{c(){e=se("div"),t=se("div"),i=se("span"),o=Le(r),n=ce(),l=se("div"),a=se("div"),u=ce();for(let S=0;S<F.length;S+=1)F[S].c();c=ce();for(let S=0;S<k.length;S+=1)k[S].c();h=ce(),f=se("div"),g=ce(),d=se("span"),p=Le(A),m=ce(),w=se("div"),v=se("button"),re.c(),x=ce();for(let S=0;S<K.length;S+=1)K[S].c();R=ce(),Yn(O.$$.fragment),I=ce(),X=se("button"),X.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
81
81
  18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4
82
82
  0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0
83
83
  224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48