@appsurify-testmap/rrweb-all 3.3.0-alpha.1 → 3.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rrweb-all.cjs +7 -9
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +7 -9
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +7 -9
- package/dist/rrweb-all.umd.cjs.map +2 -2
- package/dist/rrweb-all.umd.min.cjs +2 -2
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
|
@@ -76,7 +76,7 @@ Common causes:
|
|
|
76
76
|
2. Element from one iframe, root from another
|
|
77
77
|
3. Element from main document, root from iframe (or vice versa)
|
|
78
78
|
|
|
79
|
-
Solution: Ensure element and root parameter are from the same document context.`)}function uy(r,e={}){var _,B,W,N;var t;if(!r||!r.ownerDocument||!r.isConnected)return null;const s=R(R({},kg),e);if(s.root)try{cy(r,s.root)}catch(T){return console.error("Cross-document generation detected:",T),null}const i=(_=s.cache)!=null?_:ly(),n=i.getEID(r);if(n!==void 0)return n;if(r.tagName.toLowerCase()==="html"){const T=new ia(s,i),D=fy(r,s,T);return i.setEID(r,D),D}const o=new _g(s,i),l=new Wg(s,i),a=new ia(s,i),c=new ry,u=o.findAnchor(r);if(!u&&!s.fallbackToBody)return null;const h=(W=(B=u==null?void 0:u.element)!=null?B:(t=r.ownerDocument)==null?void 0:t.body)!=null?W:null;if(!h)return null;const d=!u||u.tier==="C",f=h.tagName.toLowerCase(),m=h.parentElement;let y;if(m&&f!=="body"&&f!=="html"){const T=Array.from(m.children).indexOf(h);T!==-1&&(y=T+1)}const p=a.extract(h),g={tag:h.tagName.toLowerCase(),semantics:p,score:(N=u==null?void 0:u.score)!=null?N:Pe.DEGRADED_SCORE,degraded:d,nthChild:y},w=l.buildPath(h,r,a),S=a.extract(r);s.enableSvgFingerprint&&hy(r)&&(S.svg=c.fingerprint(r));const b=r.parentElement;let C;if(b){const T=Array.from(b.children).indexOf(r);T!==-1&&(C=T+1)}const x={tag:r.tagName.toLowerCase(),semantics:S,score:a.scoreElement(r),nthChild:C},M=[],E={onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},$=g.degraded||w.degraded,k=dy(g.degraded,w),L={version:"1.0",anchor:g,path:w.path,target:x,constraints:M,fallback:E,meta:{confidence:0,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:s.source,degraded:$,degradationReason:k}};return L.meta.confidence=iy(L),L.meta.confidence<s.confidenceThreshold?null:(i.setEID(r,L),L)}function hy(r){return r.namespaceURI==="http://www.w3.org/2000/svg"||r.tagName.toLowerCase()==="svg"||r instanceof SVGElement}function dy(r,e){if(r&&e.degraded)return"anchor-and-path-degraded";if(r)return"no-semantic-anchor";if(e.degraded)return e.degradationReason}function fy(r,e,t,s){const i={tag:"html",semantics:t.extract(r),score:1,degraded:!1,nthChild:void 0};return{version:"1.0",anchor:i,path:[],target:i,constraints:[],fallback:{onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},meta:{confidence:1,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:e.source,degraded:!1,degradationReason:void 0}}}const Nc={maxClasses:2,maxAttributes:5,includeText:!0,maxTextLength:50,simplifyTarget:!0,includeConstraints:!0};function oa(r){return r==="id"?101:st[r]!==void 0?st[r]:r.startsWith("data-")?st["data-*"]:r.startsWith("aria-")?st["aria-*"]:0}function py(r){return["id","data-testid","data-qa","data-cy","href","text","role"].includes(r)}function my(r){return!!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r)||/(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r)||/\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r))}function gy(r,e){const t=R(R({},Nc),e),s=`v${r.version}`,i=Qr(r.anchor,!1,t),n=r.path.length>0?r.path.map(a=>Qr(a,!1,t)).join(" > ")+" > ":"",o=Qr(r.target,!0,t),l=t.includeConstraints?yy(r):"";return`${s}: ${i} :: ${n}${o}${l}`}function Qr(r,e=!1,t=Nc){const{tag:s,semantics:i}=r;let n=s;const o=[],l=R({},i.attributes);i.id&&(l.id=i.id),i.role&&!l.role&&(l.role=i.role);const a=Object.entries(l).map(([h,d])=>{const f=oa(h),m=h==="href"||h==="src"?Ic(h,d):d;return{name:h,value:m,priority:f}}).filter(h=>h.name!=="id"&&h.name!=="class"&&Ec.has(h.name)||Mc.has(h.name)&&Ac(h.value)?!1:h.priority>0||h.name==="role"||h.name==="id");a.sort((h,d)=>d.priority-h.priority);const c=a.slice(0,t.maxAttributes);c.sort((h,d)=>h.name.localeCompare(d.name));for(const{name:h,value:d}of c)o.push(`${h}="${Vi(d)}"`);if(t.includeText&&i.text&&!my(i.text.normalized)){const h=i.text.normalized;h.length>0&&h.length<=t.maxTextLength&&o.push(`text="${Vi(h)}"`)}let u=o;if(o.length>0&&(e&&t.simplifyTarget&&i.id&&(u=o.filter(h=>{const d=h.split("=")[0];return oa(d)>=60||d==="text"||d==="id"||d==="role"})),u.length>0&&u.sort((h,d)=>h.localeCompare(d))),i.classes&&i.classes.length>0){const h=zg(i.classes),d=!!i.id||o.some(f=>f.startsWith("href=")||f.startsWith("data-testid=")||f.startsWith("text=")||f.startsWith("role="));if(!(e&&t.simplifyTarget&&d)&&h.length>0){const f=h.sort().slice(0,t.maxClasses);n+=f.map(m=>`.${m}`).join("")}}if(u.length>0&&(n+=`[${u.join(",")}]`),"nthChild"in r&&r.nthChild){const h=!!i.id||i.attributes&&Object.keys(i.attributes).some(py);e&&t.simplifyTarget&&h||(n+=`#${r.nthChild}`)}return n}function yy(r){if(!r.constraints||r.constraints.length===0)return"";const e=[];for(const t of r.constraints)switch(t.type){case"uniqueness":e.push("unique=true");break;case"position":t.params&&t.params.strategy&&e.push(`pos=${t.params.strategy}`);break;case"text-proximity":if(t.params&&t.params.reference){const s=Vi(String(t.params.reference));e.push(`text="${s}"`)}break}return e.length===0?"":` {${e.join(",")}}`}function Vi(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/>/g,"\\>").replace(/:/g,"\\:")}function by(r,e,t){const s=uy(r,e);return s?gy(s,t):null}const Ht={maxPathDepth:10,enableSvgFingerprint:!0,confidenceThreshold:0,fallbackToBody:!0};function vy(r){var e,t,s,i;return r===!1?null:r===!0||r===void 0?R({},Ht):{maxPathDepth:(e=r.maxPathDepth)!=null?e:Ht.maxPathDepth,enableSvgFingerprint:(t=r.enableSvgFingerprint)!=null?t:Ht.enableSvgFingerprint,confidenceThreshold:(s=r.confidenceThreshold)!=null?s:Ht.confidenceThreshold,fallbackToBody:(i=r.fallbackToBody)!=null?i:Ht.fallbackToBody}}function aa(r,e,t,s){const i=e.getMeta(r),n=i==null?void 0:i.selector;if(n&&!(s!=null&&s.force))return n;const o=r.nodeType===Node.ELEMENT_NODE?r:Or(r);if(!o)return n;const l=e.getMeta(o),a=l==null?void 0:l.selector;if(a&&!(s!=null&&s.force))return a;if(!t)return a!=null?a:n;const c={maxPathDepth:t.maxPathDepth,enableSvgFingerprint:t.enableSvgFingerprint,fallbackToBody:t.fallbackToBody};try{const u=by(o,c);if(u)return l?l.selector=u:i&&(i.selector=u),u}catch(u){}return a!=null?a:n}function la(r){return"__ln"in r}class wy{constructor(){v(this,"length",0),v(this,"head",null),v(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&la(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&la(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ca=(r,e)=>`${r}@${e}`,Sy=new Set(["id","class","name","role","title","alt","placeholder","for","type"]);function Cy(r){const e=r.toLowerCase();return Sy.has(e)||e.startsWith("data-")||e.startsWith("aria-")}class xy{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"excludeAttribute"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"selectorOptions",null),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new wy,i=a=>{let c=a,u=ts;for(;u===ts;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{const c=V.parentNode(a);if(!c||!Un(a))return;let u=!1;if(a.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=!0)}const h=Jt(c)?this.mirror.getId(Wn(a)):this.mirror.getId(c),d=i(a);if(h===-1||d===-1)return s.addNode(a);const f=Ct(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{At(m,this.mirror)&&this.iframeManager.addIframe(m),Fn(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),tt(a)&&this.shadowDomManager.addShadowRoot(V.shadowRoot(a),this.doc)},onIframeLoad:(m,y)=>{this.iframeManager.attachIframe(m,y),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,y)=>{this.stylesheetManager.attachLinkElement(m,y)},cssCaptured:u,selectorOptions:this.selectorOptions});f&&(e.push({parentId:h,nextId:d,node:f}),t.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ua(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(V.parentNode(a))||n(a);for(const a of this.addedSet)!ha(this.droppedSet,a)&&!ua(this.removesSubTreeCache,a,this.mirror)||ha(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;s.length;){let a=null;if(o){const c=this.mirror.getId(V.parentNode(o.value)),u=i(o.value);c!==-1&&u!==-1&&(a=o)}if(!a){let c=s.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(V.parentNode(u.value));if(i(u.value)===-1)continue;if(h!==-1){a=u;break}else{const f=u.value,m=V.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=V.host(m);if(this.mirror.getId(y)!==-1){a=u;break}}}}}}if(!a){for(;s.head;)s.removeNode(s.head.value);break}o=a.previous,s.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const c=a.node,u=V.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value,selector:aa(c,this.mirror,this.selectorOptions)}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const u=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:c,selector:aa(a.node,this.mirror,this.selectorOptions,{force:Object.keys(c).some(Cy)})}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),v(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const s=Array.from(V.childNodes(e),i=>V.textContent(i)||"").join("");t.attributes.value=er({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:tr(e),value:s,maskInputFn:this.maskInputFn})}),v(this,"processMutation",e=>{if(!Ks(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=V.textContent(e.target);!ge(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Va(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Or(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,i=e.target.getAttribute(s);const o=t[s],l=typeof o=="boolean",a=document.contains(t),c=tn(t),u=ci(s,this.excludeAttribute);if(i===null&&!t.hasAttribute(s)&&e.oldValue!==null&&(o===""||o===null||typeof o=="undefined")){console.debug(`[${Ae()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(ci(s,this.excludeAttribute)){console.debug(`[${Ae()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(s==="value"){const f=tr(t);i=er({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:f,value:i,maskInputFn:this.maskInputFn})}if(ge(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)s="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),s==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ua(t.tagName,s))if(d.attributes[s]=Wa(this.doc,it(t.tagName),it(s),i),s!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${Ae()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===o?"mirrored in DOM property":null,i===d.attributes[s]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,transformedValue:d.attributes[s],excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u}),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const m=this.unattachedDoc.createElement("span");e.oldValue&&m.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const p=t.style.getPropertyValue(y),g=t.style.getPropertyPriority(y);p!==m.style.getPropertyValue(y)||g!==m.style.getPropertyPriority(y)?g===""?d.styleDiff[y]=p:d.styleDiff[y]=[p,g]:d._unchangedStyles[y]=[p,g]}for(const y of Array.from(m.style))t.style.getPropertyValue(y)===""&&(d.styleDiff[y]=!1)}else s==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(ge(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),i=Jt(e.target)?this.mirror.getId(V.host(e.target)):this.mirror.getId(e.target);ge(e.target,this.blockClass,this.blockSelector,!1)||Ks(t,this.mirror,this.slimDOMOptions)||!vc(t,this.mirror)||(this.addedSet.has(t)?(Hi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&s===-1||_n(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ca(s,i)]?Hi(this.movedSet,t):(this.removes.push({parentId:i,id:s,isShadow:Jt(e.target)&&qt(e.target)?!0:void 0}),Ey(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ks(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&s!==-1&&(this.movedMap[ca(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ge(e,this.blockClass,this.blockSelector,!1)||(V.childNodes(e).forEach(s=>this.genAdds(s)),tt(e)&&V.childNodes(V.shadowRoot(e)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","selectorOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}resetBuffers(){this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.mapRemoves=[],this.movedMap={},this.attributes=[],this.texts=[],this.attributeMap=new WeakMap,this.removes=[]}unsetFrozen(){this.frozen=!1,this.canvasManager.unfreeze()}}function Hi(r,e){r.delete(e),V.childNodes(e).forEach(t=>Hi(r,t))}function Ey(r,e){const t=[r];for(;t.length;){const s=t.pop();e.has(s)||(e.add(s),V.childNodes(s).forEach(i=>t.push(i)))}}function ua(r,e,t){return r.size===0?!1:My(r,e)}function My(r,e,t){const s=V.parentNode(e);return s?r.has(s):!1}function ha(r,e){return r.size===0?!1:Rc(r,e)}function Rc(r,e){const t=V.parentNode(e);return t?r.has(t)?!0:Rc(r,t):!1}let Qt;function Ay(r){Qt=r}function Iy(){Qt=void 0}const G=r=>Qt?(...t)=>{try{return r(...t)}catch(s){if(Qt&&Qt(s)===!0)return;throw s}}:r,Re=[];function kt(r){try{if("composedPath"in r){const e=r.composedPath();if(e.length)return e[0]}else if("path"in r&&r.path.length)return r.path[0]}catch(e){}return r&&r.target}function Tc(r,e){const t=new xy;Re.push(t),t.init(r);const s=new(On())(G(t.processMutations.bind(t)));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ny({mousemoveCb:r,sampling:e,doc:t,mirror:s}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=$t(G(h=>{const d=Date.now()-l;r(o.map(f=>(f.timeOffset-=d,f)),h),o=[],l=null}),n),c=G($t(G(h=>{const d=kt(h),{clientX:f,clientY:m}=pr(h)?h.changedTouches[0]:h;l||(l=Ae()),o.push({x:f,y:m,id:s.getId(d),timeOffset:Ae()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?A.Drag:h instanceof MouseEvent?A.MouseMove:A.TouchMove)}),i,{trailing:!1})),u=[ue("mousemove",c,t),ue("touchmove",c,t),ue("drag",c,t)];return G(()=>{u.forEach(h=>h())})}function Ry({mouseInteractionCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const d=kt(h);if(ge(d,s,i,!0))return;let f=null,m=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=Ve.Mouse;break;case"touch":f=Ve.Touch;break;case"pen":f=Ve.Pen;break}f===Ve.Touch?Z[u]===Z.MouseDown?m="TouchStart":Z[u]===Z.MouseUp&&(m="TouchEnd"):Ve.Pen}else pr(h)&&(f=Ve.Touch);f!==null?(a=f,(m.startsWith("Touch")&&f===Ve.Touch||m.startsWith("Mouse")&&f===Ve.Mouse)&&(f=null)):Z[u]===Z.Click&&(f=a,a=null);const y=pr(h)?h.changedTouches[0]:h;if(!y)return;const p=t.getId(d),{clientX:g,clientY:w}=y;G(r)(R({type:Z[m],id:p,x:g,y:w},f!==null&&{pointerType:f}))};return Object.keys(Z).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=it(u);const d=c(u);if(window.PointerEvent)switch(Z[u]){case Z.MouseDown:case Z.MouseUp:h=h.replace("mouse","pointer");break;case Z.TouchStart:case Z.TouchEnd:return}l.push(ue(h,d,e))}),G(()=>{l.forEach(u=>u())})}function Oc({scrollCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,sampling:n}){const o=G($t(G(l=>{const a=kt(l);if(!a||ge(a,s,i,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=Dn(e.defaultView);r({id:c,x:u.left,y:u.top})}else r({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ue("scroll",o,e)}function Ty({viewportResizeCb:r},{win:e}){let t=-1,s=-1;const i=G($t(G(()=>{const n=$n(),o=kn();(t!==n||s!==o)&&(r({width:Number(o),height:Number(n)}),t=n,s=o)}),200));return ue("resize",i,e)}function Oy({navigationCb:r,doc:e,sampling:t}){var u;if(t.navigation===!1)return()=>{};const s=e.defaultView;if(!s)return()=>{};let i=s.location.href;const n=[],o=G(h=>{const d=s.location.href;d!==i&&(r({href:d,oldHref:i,navigationType:h}),i=d)}),l=Ye(s.history,"pushState",function(h){return function(...d){const f=h.apply(this,d);return o("pushState"),f}});n.push(l);const a=Ye(s.history,"replaceState",function(h){return function(...d){const f=h.apply(this,d);return o("replaceState"),f}});if(n.push(a),n.push(ue("popstate",()=>o("popstate"),s)),n.push(ue("hashchange",()=>o("hashchange"),s)),(typeof t.navigation=="object"&&(u=t.navigation.useNavigationAPI)!=null?u:!0)&&"navigation"in s)try{const h=s.navigation,d=f=>{var m;const y=f;if(y.navigationType==="push"||y.navigationType==="replace"){const p=(m=y.destination)==null?void 0:m.url;p&&p!==i&&(r({href:p,oldHref:i,navigationType:"navigate"}),i=p)}};h.addEventListener("navigate",d),n.push(()=>h.removeEventListener("navigate",d))}catch(h){}return G(()=>{n.forEach(h=>h())})}const ei=["INPUT","TEXTAREA","SELECT"],da=new WeakMap,Dy=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],fa=new WeakMap;function $y({inputCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(S){let b=kt(S);const C=S.isTrusted,x=b&&b.tagName;if(b&&x==="OPTION"&&(b=V.parentElement(b)),!b||!x||ei.indexOf(x)<0||ge(b,s,i,!0)||b.classList.contains(n)||o&&b.matches(o))return;let M=b.value,E=!1;const $=tr(b)||"";$==="radio"||$==="checkbox"?E=b.checked:(l[x.toLowerCase()]||l[$])&&(M=er({element:b,maskInputOptions:l,tagName:x,type:$,value:M,maskInputFn:a})),d(b,u?{text:M,isChecked:E,userTriggered:C}:{text:M,isChecked:E});const k=b.name;$==="radio"&&k&&E&&e.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(L=>{if(L!==b){const _=L.value;d(L,u?{text:_,isChecked:!E,userTriggered:!1}:{text:_,isChecked:!E})}})}function d(S,b){const C=da.get(S),x=S,M=x.hasAttribute("placeholder"),E=x.value==="",$=typeof x.defaultValue=="string"?x.defaultValue==="":!0,k=!b.userTriggered,L=!C||C.text==="",_=M&&E&&$&&L&&k&&!b.isChecked&&x.type!=="hidden"&&ei.includes(x.tagName),B=x.tagName==="INPUT"&&x.type==="text"&&!b.userTriggered&&b.text===x.defaultValue&&!C&&x.hasAttribute("placeholder"),W=!b.userTriggered&&x.value===x.defaultValue&&!C&&x.hasAttribute("placeholder")&&!b.isChecked&&x.type!=="hidden"&&ei.includes(x.tagName),N=x.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,T=x.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(_||B||W||N||T){console.debug(`[${Ae()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:V.describeNode(x),tag:x.tagName,nodeType:x.nodeType,attribute:x.attributes,value:x.value,isLikelyPhantom:_,isRenderDrivenTextInput:B,isValueFromDefault:W,isPhantomCheckbox:N,isPhantomRadio:T});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){da.set(S,b);const D=t.getId(S);G(r)(ae(R({},b),{id:D}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(S=>ue(S,G(h),e)),y=S=>{const b=kt(S);if(!b||!b.tagName)return;if(c.input==="all"){h(S);return}const C=b.tagName,x=S.key,M=Dy.includes(x),E=C==="TEXTAREA",$=e.activeElement===b,k=b.value,L=fa.get(b);if(fa.set(b,k),!$){h(S);return}if(M){if(!E){h(S);return}let _=L!=null?L:"",B=0;const W=2,N=()=>{const T=b.value,D=e.activeElement===b,U=T!==_;if(!D){h(S);return}if(U)B=0,_=T;else if(B++,B>=W){h(S);return}requestAnimationFrame(N)};requestAnimationFrame(N);return}};m.push(ue("keydown",G(y),e));const p=e.defaultView;if(!p)return()=>{m.forEach(S=>S())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),w=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...w.map(S=>bs(S[0],S[1],{set(){G(h)({target:this,isTrusted:!1})}},!1,p))),G(()=>{m.forEach(S=>S())})}function mr(r){const e=[];function t(s,i){if(Hs("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Hs("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Hs("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Hs("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const o=Array.from(s.parentRule.cssRules).indexOf(s);i.unshift(o)}else if(s.parentStyleSheet){const o=Array.from(s.parentStyleSheet.cssRules).indexOf(s);i.unshift(o)}return i}return t(r,e)}function Ke(r,e,t){let s,i;return r?(r.ownerNode?s=e.getId(r.ownerNode):i=t.getId(r),{styleId:i,id:s}):{}}function ky({styleSheetRuleCb:r,mirror:e,stylesheetManager:t},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:G((u,h,d)=>{const[f,m]=d,{id:y,styleId:p}=Ke(h,e,t.styleMirror);return(y&&y!==-1||p&&p!==-1)&&r({id:y,styleId:p,adds:[{rule:f,index:m}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.addRule=function(u,h,d=this.cssRules.length){const f=`${u} { ${h} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,d])};const n=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,removes:[{index:f}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.removeRule=function(u){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,replace:f}),u.apply(h,d)})}));let l;s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,replaceSync:f}),u.apply(h,d)})}));const a={};Gs("CSSGroupingRule")?a.CSSGroupingRule=s.CSSGroupingRule:(Gs("CSSMediaRule")&&(a.CSSMediaRule=s.CSSMediaRule),Gs("CSSConditionRule")&&(a.CSSConditionRule=s.CSSConditionRule),Gs("CSSSupportsRule")&&(a.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:G((d,f,m)=>{const[y,p]=m,{id:g,styleId:w}=Ke(f.parentStyleSheet,e,t.styleMirror);return(g&&g!==-1||w&&w!==-1)&&r({id:g,styleId:w,adds:[{rule:y,index:[...mr(f),p||0]}]}),d.apply(f,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:G((d,f,m)=>{const[y]=m,{id:p,styleId:g}=Ke(f.parentStyleSheet,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&r({id:p,styleId:g,removes:[{index:[...mr(f),y]}]}),d.apply(f,m)})})}),G(()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=n,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function Dc({mirror:r,stylesheetManager:e},t){var s,i,n;let o=null;t.nodeName==="#document"?o=r.getId(t):o=r.getId(V.host(t));const l=t.nodeName==="#document"?(s=t.defaultView)==null?void 0:s.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var u;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(d){}return h}}),G(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function _y({styleDeclarationCb:r,mirror:e,ignoreCSSAttributes:t,stylesheetManager:s},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:G((l,a,c)=>{var u;const[h,d,f]=c;if(t.has(h))return n.apply(a,[h,d,f]);const{id:m,styleId:y}=Ke((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,set:{property:h,value:d,priority:f},index:mr(a.parentRule)}),l.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:G((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:d,styleId:f}=Ke((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(d&&d!==-1||f&&f!==-1)&&r({id:d,styleId:f,remove:{property:h},index:mr(a.parentRule)}),l.apply(a,c)})}),G(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ly({mediaInteractionCb:r,blockClass:e,blockSelector:t,mirror:s,sampling:i,doc:n}){const o=G(a=>$t(G(c=>{const u=kt(c);if(!u||ge(u,e,t,!0))return;const{currentTime:h,volume:d,muted:f,playbackRate:m,loop:y}=u;r({type:a,id:s.getId(u),currentTime:h,volume:d,muted:f,playbackRate:m,loop:y})}),i.media||500)),l=[ue("play",o(Qe.Play),n),ue("pause",o(Qe.Pause),n),ue("seeked",o(Qe.Seeked),n),ue("volumechange",o(Qe.VolumeChange),n),ue("ratechange",o(Qe.RateChange),n)];return G(()=>{l.forEach(a=>a())})}function Py({fontCb:r,doc:e}){const t=e.defaultView;if(!t)return()=>{};const s=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c)))}),h};const o=Ye(e.fonts,"add",function(l){return function(a){return setTimeout(G(()=>{const c=i.get(a);c&&(r(c),i.delete(a))}),0),l.apply(this,[a])}});return s.push(()=>{t.FontFace=n}),s.push(o),G(()=>{s.forEach(l=>l())})}function Fy(r){const{doc:e,mirror:t,blockClass:s,blockSelector:i,selectionCb:n}=r;let o=!0;const l=G(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const d=a.getRangeAt(h),{startContainer:f,startOffset:m,endContainer:y,endOffset:p}=d;ge(f,s,i,!0)||ge(y,s,i,!0)||c.push({start:t.getId(f),startOffset:m,end:t.getId(y),endOffset:p})}n({ranges:c})});return l(),ue("selectionchange",l)}function zy({doc:r,customElementCb:e}){const t=r.defaultView;return!t||!t.customElements?()=>{}:Ye(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function By(r,e){const{mutationCb:t,mousemoveCb:s,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,navigationCb:l,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:f,selectionCb:m,customElementCb:y}=r;r.mutationCb=(...p)=>{e.mutation&&e.mutation(...p),t(...p)},r.mousemoveCb=(...p)=>{e.mousemove&&e.mousemove(...p),s(...p)},r.mouseInteractionCb=(...p)=>{e.mouseInteraction&&e.mouseInteraction(...p),i(...p)},r.scrollCb=(...p)=>{e.scroll&&e.scroll(...p),n(...p)},r.viewportResizeCb=(...p)=>{e.viewportResize&&e.viewportResize(...p),o(...p)},r.navigationCb=(...p)=>{e.navigation&&e.navigation(...p),l(...p)},r.inputCb=(...p)=>{e.input&&e.input(...p),a(...p)},r.mediaInteractionCb=(...p)=>{e.mediaInteaction&&e.mediaInteaction(...p),c(...p)},r.styleSheetRuleCb=(...p)=>{e.styleSheetRule&&e.styleSheetRule(...p),u(...p)},r.styleDeclarationCb=(...p)=>{e.styleDeclaration&&e.styleDeclaration(...p),h(...p)},r.canvasMutationCb=(...p)=>{e.canvasMutation&&e.canvasMutation(...p),d(...p)},r.fontCb=(...p)=>{e.font&&e.font(...p),f(...p)},r.selectionCb=(...p)=>{e.selection&&e.selection(...p),m(...p)},r.customElementCb=(...p)=>{e.customElement&&e.customElement(...p),y(...p)}}function Wy(r,e={}){const t=r.doc.defaultView;if(!t)return()=>{};By(r,e);let s;r.recordDOM&&(s=Tc(r,r.doc));const i=Ny(r),n=Ry(r),o=Oc(r),l=Ty(r,{win:t}),a=Oy(r),c=$y(r),u=Ly(r);let h=()=>{},d=()=>{},f=()=>{},m=()=>{};r.recordDOM&&(h=ky(r,{win:t}),d=Dc(r,r.doc),f=_y(r,{win:t}),r.collectFonts&&(m=Py(r)));const y=Fy(r),p=zy(r),g=[];for(const w of r.plugins)g.push(w.observer(w.callback,t,w.options));return G(()=>{var w;Re.forEach(S=>S.reset()),(w=r.visibilityManager)==null||w.reset(),s==null||s.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),d(),f(),m(),y(),p(),g.forEach(S=>S())})}function Hs(r){return typeof window[r]!="undefined"}function Gs(r){return!!(typeof window[r]!="undefined"&&window[r].prototype&&"insertRule"in window[r].prototype&&"deleteRule"in window[r].prototype)}class pa{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,i){const n=s||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const s=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,s,i))}getRemoteId(e,t,s){const i=s||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,s))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Uy{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new pa(Ba)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pa(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=e.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case O.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:O.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case O.Meta:case O.Load:case O.DomContentLoaded:return!1;case O.Plugin:return t;case O.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case O.IncrementalSnapshot:switch(t.data.source){case A.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.Drag:case A.TouchMove:case A.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(t.data,e,["id"]),t;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case A.Font:return t;case A.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case A.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(s=t.data.styles)==null||s.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,s,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(s=>{this.replaceIdOnNode(s,t)})}patchRootIdOnNode(e,t){e.type!==He.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(s=>{this.patchRootIdOnNode(s,t)})}}class Vy{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!qt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=Tc(ae(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Oc(ae(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(V.host(e))),this.restoreHandlers.push(Dc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const s=this;this.restoreHandlers.push(Ye(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=V.shadowRoot(this);return l&&Un(this)&&s.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var js=0;js<Et.length;js++)Yt[Et.charCodeAt(js)]=js;var Hy=function(r){var e=new Uint8Array(r),t,s=e.length,i="";for(t=0;t<s;t+=3)i+=Et[e[t]>>2],i+=Et[(e[t]&3)<<4|e[t+1]>>4],i+=Et[(e[t+1]&15)<<2|e[t+2]>>6],i+=Et[e[t+2]&63];return s%3===2?i=i.substring(0,i.length-1)+"=":s%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Gy=function(r){var e=r.length*.75,t=r.length,s,i=0,n,o,l,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(s=0;s<t;s+=4)n=Yt[r.charCodeAt(s)],o=Yt[r.charCodeAt(s+1)],l=Yt[r.charCodeAt(s+2)],a=Yt[r.charCodeAt(s+3)],u[i++]=n<<2|o>>4,u[i++]=(o&15)<<4|l>>2,u[i++]=(l&3)<<6|a&63;return c};const ma=new Map;function jy(r,e){let t=ma.get(r);return t||(t=new Map,ma.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}const $c=(r,e,t)=>{if(!r||!(_c(r,e)||typeof r=="object"))return;const s=r.constructor.name,i=jy(t,s);let n=i.indexOf(r);return n===-1&&(n=i.length,i.push(r)),n};function Qs(r,e,t){if(r instanceof Array)return r.map(s=>Qs(s,e,t));if(r===null)return r;if(r instanceof Float32Array||r instanceof Float64Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Uint8Array||r instanceof Uint16Array||r instanceof Int16Array||r instanceof Int8Array||r instanceof Uint8ClampedArray)return{rr_type:r.constructor.name,args:[Object.values(r)]};if(r instanceof ArrayBuffer){const s=r.constructor.name,i=Hy(r);return{rr_type:s,base64:i}}else{if(r instanceof DataView)return{rr_type:r.constructor.name,args:[Qs(r.buffer,e,t),r.byteOffset,r.byteLength]};if(r instanceof HTMLImageElement){const s=r.constructor.name,{src:i}=r;return{rr_type:s,src:i}}else if(r instanceof HTMLCanvasElement){const s="HTMLImageElement",i=r.toDataURL();return{rr_type:s,src:i}}else{if(r instanceof ImageData)return{rr_type:r.constructor.name,args:[Qs(r.data,e,t),r.width,r.height]};if(_c(r,e)||typeof r=="object"){const s=r.constructor.name,i=$c(r,e,t);return{rr_type:s,index:i}}}}return r}const kc=(r,e,t)=>r.map(s=>Qs(s,e,t)),_c=(r,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>r instanceof e[i]);function Yy(r,e,t,s){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Ye(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return ge(this.canvas,t,s,!0)||setTimeout(()=>{const u=kc(c,e,this);r(this.canvas,{type:Ze["2D"],property:o,args:u})},0),a.apply(this,c)}});i.push(l)}catch(l){const a=bs(e.CanvasRenderingContext2D.prototype,o,{set(c){r(this.canvas,{type:Ze["2D"],property:o,args:[c],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function Zy(r){return r==="experimental-webgl"?"webgl":r}function ga(r,e,t,s){const i=[];try{const n=Ye(r.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!ge(this,e,t,!0)){const c=Zy(l);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ya(r,e,t,s,i,n){const o=[],l=Object.getOwnPropertyNames(r);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof r[a]!="function")continue;const c=Ye(r,a,function(u){return function(...h){const d=u.apply(this,h);if($c(d,n,this),"tagName"in this.canvas&&!ge(this.canvas,s,i,!0)){const f=kc(h,n,this),m={type:e,property:a,args:f};t(this.canvas,m)}return d}});o.push(c)}catch(c){const u=bs(r,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function Xy(r,e,t,s){const i=[];return i.push(...ya(e.WebGLRenderingContext.prototype,Ze.WebGL,r,t,s,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...ya(e.WebGL2RenderingContext.prototype,Ze.WebGL2,r,t,s,e)),()=>{i.forEach(n=>n())}}const Lc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Jy=r=>Uint8Array.from(atob(r),e=>e.charCodeAt(0)),ba=typeof self!="undefined"&&self.Blob&&new Blob([Jy(Lc)],{type:"text/javascript;charset=utf-8"});function qy(r){let e;try{if(e=ba&&(self.URL||self.webkitURL).createObjectURL(ba),!e)throw"";const t=new Worker(e,{name:r==null?void 0:r.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+Lc,{name:r==null?void 0:r.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ky{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)});const{sampling:t="all",win:s,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(s,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,s,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,i,n){const o=ga(t,s,i,!0),l=new Map,a=new qy;a.onmessage=m=>{const{id:y}=m.data;if(l.set(y,!1),!("base64"in m.data))return;const{base64:p,type:g,width:w,height:S}=m.data;this.mutationCb({id:y,type:Ze["2D"],commands:[{property:"clearRect",args:[0,0,w,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:g}]},0,0]}]})};const c=1e3/e;let u=0,h;const d=()=>{const m=[];return t.document.querySelectorAll("canvas").forEach(y=>{ge(y,s,i,!0)||m.push(y)}),m},f=m=>{if(u&&m-u<c){h=requestAnimationFrame(f);return}u=m,d().forEach(async y=>{var p;const g=this.mirror.getId(y);if(l.get(g)||y.width===0||y.height===0)return;if(l.set(g,!0),["webgl","webgl2"].includes(y.__context)){const S=y.getContext(y.__context);((p=S==null?void 0:S.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const w=await createImageBitmap(y);a.postMessage({id:g,bitmap:w,width:y.width,height:y.height,dataURLOptions:n.dataURLOptions},[w])}),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=ga(e,t,s,!1),n=Yy(this.processMutation.bind(this),e,t,s),o=Xy(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||t===-1)return;const i=s.map(o=>{const c=o,{type:l}=c;return gt(c,["type"])}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}function va(r,e,t){var u,h,d,f,m,y;const s=(u=t==null?void 0:t.root)!=null?u:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,n=(d=t==null?void 0:t.sensitivity)!=null?d:.05,o=Qy((f=t==null?void 0:t.rootMargin)!=null?f:"0px"),l=new Map,a=eb(s),c=tb(a,o);for(const p of r){const g=p.getBoundingClientRect();let w=ib(),S=0;g.width>0&&g.height>0&&(w=sb(g,c),S=rb(g,w),S=Math.round(S*100)/100);const b=nb(p),C=(m=e.get(p))!=null?m:null,x=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,M=S,E=(C==null?void 0:C.isStyleVisible)&&x>i,$=b&&M>i;!C||E!==$||E!==$&&Math.abs(M-x)>n?l.set(p,{target:p,isVisible:$,isStyleVisible:b,intersectionRatio:M,intersectionRect:w,oldValue:C}):l.set(p,C)}return l}function Qy(r){const e=r.trim().split(/\s+/),t=(s,i)=>s.endsWith("%")?parseFloat(s)/100*i:parseFloat(s)||0;return function(s){const i=t(e[0]||"0px",s.height),n=t(e[1]||e[0]||"0px",s.width),o=t(e[2]||e[0]||"0px",s.height),l=t(e[3]||e[1]||e[0]||"0px",s.width);return{top:i,right:n,bottom:o,left:l,width:0,height:0}}}function eb(r){return r?r.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function tb(r,e){const t=e(r);return new DOMRect(r.left-t.left,r.top-t.top,r.width+t.left+t.right,r.height+t.top+t.bottom)}function sb(r,e){const t=Math.max(r.top,e.top),s=Math.max(r.left,e.left),i=Math.min(r.bottom,e.bottom),n=Math.min(r.right,e.right),o=Math.max(0,n-s),l=Math.max(0,i-t);return{top:t,left:s,bottom:i,right:n,width:o,height:l}}function rb(r,e){const t=r.width*r.height,s=e.width*e.height;return t>0?s/t:0}function ib(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function nb(r){const e=getComputedStyle(r);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class ob{constructor(e){var c,u,h,d,f,m;v(this,"frozen",!1),v(this,"locked",!1),v(this,"pending",new Map),v(this,"mirror"),v(this,"mutationCb"),v(this,"rafId",null),v(this,"intervalId",null),v(this,"rafThrottle"),v(this,"lastFlushTime",0),v(this,"elements",new Set),v(this,"previousState",new Map),v(this,"root",null),v(this,"threshold"),v(this,"sensitivity"),v(this,"rootMargin"),v(this,"hasInitialized",!1),v(this,"mode","none"),v(this,"debounce",50),v(this,"throttle",100),v(this,"buffer",new Map),v(this,"debounceTimer",null),v(this,"lastThrottleTime",0),v(this,"disabled",!1),v(this,"notifyActivity");const{doc:t,mirror:s,sampling:i,mutationCb:n,notifyActivity:o}=e;if(this.mirror=s,this.mutationCb=n,this.notifyActivity=o,this.rootMargin="0px",i===!1){this.disabled=!0;return}const l=typeof i=="object"&&i!==null?i:{};this.mode=(c=l==null?void 0:l.mode)!=null?c:"none",this.debounce=Number((u=l==null?void 0:l.debounce)!=null?u:100),this.throttle=Number((h=l==null?void 0:l.throttle)!=null?h:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((f=l==null?void 0:l.sensitivity)!=null?f:.05),this.rafThrottle=Number((m=l==null?void 0:l.rafThrottle)!=null?m:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(p=>{p.addedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&(this.observe(g),g.querySelectorAll("*").forEach(w=>this.observe(w)))}),p.removedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&this.unobserve(g)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=va(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,s]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==s.isVisible||Math.abs(i.intersectionRatio-s.intersectionRatio)>this.sensitivity){const o=this.mirror.getId(t);o!==-1&&this.buffer.set(t,{id:o,isVisible:s.isVisible,ratio:s.intersectionRatio}),this.previousState.set(t,s)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;if(this.frozen||this.locked||this.buffer.size===0)return;const t=Array.from(this.buffer.values()),s=t.length;this.buffer.clear(),this.mutationCb({mutations:t}),(e=this.notifyActivity)==null||e.call(this,s)}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unlock(){this.locked=!1,this.buffer.clear(),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),!this.disabled&&this.elements.size>0&&(this.previousState=va(this.elements,new Map,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin}))}unsetFrozen(){this.frozen=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const ab=150,lb=5e3,cb=100;class ub{constructor(e){var n,o,l;v(this,"frozen",!1),v(this,"locked",!1),v(this,"disabled",!1),v(this,"settleTimeout"),v(this,"maxWait"),v(this,"debounceMs"),v(this,"settlingObserver",null),v(this,"debounceTimer",null),v(this,"settleCheckTimer",null),v(this,"maxWaitTimer",null),v(this,"lastMutationTime",0),v(this,"pendingNavigation",null),v(this,"doc"),v(this,"onSnapshot");const{doc:t,config:s,onSnapshot:i}=e;this.doc=t,this.onSnapshot=G(i),this.settleTimeout=(n=s.settleTimeout)!=null?n:ab,this.maxWait=(o=s.maxWait)!=null?o:lb,this.debounceMs=(l=s.debounce)!=null?l:cb}handleNavigation(e){this.disabled||this.locked||(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=e,!this.frozen&&this.startDebounce())}cancelPending(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null}freeze(){this.frozen=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unfreeze(){this.frozen=!1,this.pendingNavigation&&!this.locked&&!this.disabled&&this.startDebounce()}lock(){this.locked=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unlock(){this.locked=!1,this.pendingNavigation=null}unsetFrozen(){this.frozen=!1}reset(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.frozen=!1,this.locked=!1}destroy(){this.reset(),this.disabled=!0}startDebounce(){this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.startDOMSettling()},this.debounceMs)}startDOMSettling(){if(this.frozen||this.locked||this.disabled)return;this.lastMutationTime=performance.now();const e=On();this.settlingObserver=new e(()=>{this.lastMutationTime=performance.now(),this.settleCheckTimer!==null&&clearTimeout(this.settleCheckTimer),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout)}),this.settlingObserver.observe(this.doc,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout),this.maxWaitTimer=setTimeout(()=>{this.maxWaitTimer=null,this.completeSettling()},this.maxWait)}checkSettled(){this.settleCheckTimer=null;const e=performance.now()-this.lastMutationTime;e>=this.settleTimeout?this.completeSettling():this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout-e)}completeSettling(){this.frozen||this.locked||this.disabled||this.pendingNavigation&&(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,requestAnimationFrame(()=>{requestAnimationFrame(()=>{!this.frozen&&!this.locked&&!this.disabled&&this.onSnapshot(!0)})}))}cancelTimers(){this.debounceTimer!==null&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.settleCheckTimer!==null&&(clearTimeout(this.settleCheckTimer),this.settleCheckTimer=null),this.maxWaitTimer!==null&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=null)}disconnectSettlingObserver(){this.settlingObserver&&(this.settlingObserver.disconnect(),this.settlingObserver=null)}}class hb{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new Bn),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const s={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:$a(l,n.href),index:a}))})),s.styleIds.push(o)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class db{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}const fb="3.3.0-alpha.1";let ne,qe,ti,hs=!1;const gr=[];let Zt;try{if(Array.from([1],r=>r*2)[0]!==2){const r=document.createElement("iframe");document.body.appendChild(r),Array.from=((Kn=r.contentWindow)==null?void 0:Kn.Array.from)||Array.from,document.body.removeChild(r)}}catch(r){console.debug("Unable to override Array.from",r)}const Me=ka();function Ce(r={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:s,checkoutEveryNvm:i,checkoutDebounce:n,blockClass:o="rr-block",blockSelector:l=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,excludeAttribute:u,maskTextClass:h="rr-mask",maskTextSelector:d=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:p,maskInputFn:g,maskTextFn:w,hooks:S,packFn:b,sampling:C={},dataURLOptions:x={},mousemoveWait:M,recordDOM:E=!0,recordCanvas:$=!1,recordCrossOriginIframes:k=!1,recordAfter:L=r.recordAfter==="DOMContentLoaded"?r.recordAfter:"load",flushCustomEvent:_=r.flushCustomEvent!==void 0?r.flushCustomEvent:"after",userTriggeredOnInput:B=!1,collectFonts:W=!1,inlineImages:N=!1,plugins:T,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:U=new Set([]),selector:Q,errorHandler:ce}=r;Ay(ce);const se=k?window.parent===window:!0;let fe=!1;if(!se)try{window.parent.document&&(fe=!1)}catch(P){fe=!0}if(se&&!e)throw new Error("emit function is required");if(!se&&!fe)return()=>{};M!==void 0&&C.mousemove===void 0&&(C.mousemove=M),Me.reset();const Se=u===void 0?/.^/:u,he=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y!==void 0?y:{password:!0},le=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{},lt=vy(Q);Ln();let Xe,$e=0,ft=0,Lt=0,Ie=!1,pe=null,pt=null;const mt=P=>{for(const ve of T||[])ve.eventProcessor&&(P=ve.eventProcessor(P));return b&&!fe&&(P=b(P)),P},vs=()=>{pe=null,Ie=!1,pt=null,be==null||be.cancelPending(),qe(!0),Re.forEach(P=>{P.resetBuffers(),P.unsetFrozen()}),me&&me.unsetFrozen(),be&&be.unsetFrozen()};ne=(P,ve)=>{var K;const ee=P;if(ee.timestamp=Ae(),ee.checkoutId=Lt,(K=Re[0])!=null&&K.isFrozen()&&!Ie&&ee.type!==O.FullSnapshot&&!(ee.type===O.IncrementalSnapshot&&ee.data.source===A.Mutation)&&(Re.forEach(Ee=>Ee.unfreeze()),me==null||me.unfreeze(),be==null||be.unfreeze()),se)e==null||e(mt(ee),ve);else if(fe){const Ee={type:"rrweb",event:mt(ee),isCheckout:ve};window.parent.postMessage(Ee,"*")}if(ee.type===O.FullSnapshot)Xe=ee,$e=0,ft=0;else if(ee.type===O.IncrementalSnapshot){if(ee.data.source===A.Mutation&&ee.data.isAttachIframe)return;if(ee.data.source!==A.Visibility){$e++;const Ee=s&&$e>=s,X=t&&ee.timestamp-Xe.timestamp>t;if(Ee||X)if(n){Ie||(Ie=!0,pt=Ae(),Re.forEach(Qc=>Qc.freeze()),me==null||me.freeze()),pe&&clearTimeout(pe);const Pt=Ae()-pt,Kc=n*3;Pt>=Kc?vs():pe=setTimeout(()=>vs(),n)}else qe(!0)}}};const ws=P=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Mutation},P)})},Xc=P=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Visibility},P)})},Yn=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.Scroll},P)}),Zn=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.CanvasMutation},P)}),Jc=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.AdoptedStyleSheet},P)}),ct=new hb({mutationCb:ws,adoptedStyleSheetCb:Jc}),ut=new Uy({mirror:Me,mutationCb:ws,stylesheetManager:ct,recordCrossOriginIframes:k,wrappedEmit:ne});for(const P of T||[])P.getMirror&&P.getMirror({nodeMirror:Me,crossOriginIframeMirror:ut.crossOriginIframeMirror,crossOriginIframeStyleMirror:ut.crossOriginIframeStyleMirror});const kr=new db;ti=new Ky({recordCanvas:$,mutationCb:Zn,win:window,blockClass:o,blockSelector:l,mirror:Me,sampling:C.canvas,dataURLOptions:x});const Ss=new Vy({mutationCb:ws,scrollCb:Yn,bypassOptions:{blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,inlineStylesheet:f,maskInputOptions:he,dataURLOptions:x,maskTextFn:w,maskInputFn:g,recordCanvas:$,inlineImages:N,sampling:C,slimDOMOptions:le,iframeManager:ut,stylesheetManager:ct,canvasManager:ti,keepIframeSrcFn:D,processedNodeManager:kr,selectorOptions:lt},mirror:Me}),qc=E&&(i!=null||(C==null?void 0:C.visibility)!==void 0&&(C==null?void 0:C.visibility)!==!1);let me;if(qc){const P=typeof(C==null?void 0:C.visibility)=="object"&&(C==null?void 0:C.visibility)!==null?C.visibility:{},ve=P.recordVisibility===!0;me=new ob({doc:document,mirror:Me,sampling:P,mutationCb:ve?Xc:()=>{},notifyActivity:i!=null?K=>{if(ft+=K,ft>=i)if(ft=0,n){Ie||(Ie=!0,pt=Ae(),Re.forEach(X=>X.freeze()),me==null||me.freeze()),pe&&clearTimeout(pe);const ee=Ae()-pt,Ee=n*3;ee>=Ee?vs():pe=setTimeout(()=>vs(),n)}else qe(!0)}:void 0})}qe=(P=!1)=>{if(!E)return;Lt++,ne({type:O.Meta,data:{href:window.location.href,width:kn(),height:$n()}},P),ct.reset(),Ss.init(),Re.forEach(K=>K.lock()),me==null||me.lock(),be==null||be.lock();const ve=Yh(document,{mirror:Me,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,inlineStylesheet:f,maskAllInputs:he,maskTextFn:w,maskInputFn:g,slimDOM:le,dataURLOptions:x,recordCanvas:$,inlineImages:N,onSerialize:K=>{At(K,Me)&&ut.addIframe(K),Fn(K,Me)&&ct.trackLinkElement(K),tt(K)&&Ss.addShadowRoot(V.shadowRoot(K),document)},onIframeLoad:(K,ee)=>{ut.attachIframe(K,ee),Ss.observeAttachShadow(K)},onStylesheetLoad:(K,ee)=>{ct.attachLinkElement(K,ee)},keepIframeSrcFn:D,selector:Q});if(!ve)return console.warn("Failed to snapshot the document");ne({type:O.FullSnapshot,data:{node:ve,initialOffset:Dn(window)}},P),Re.forEach(K=>K.unlock()),me==null||me.unlock(),be==null||be.unlock(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,Me.getId(document))},Zt=()=>{for(const P of gr)ne(P);gr.length=0};let be;const _r=C.navigation;if(_r!==!1){const P=typeof _r=="object"?_r:{};be=new ub({doc:document,config:P,onSnapshot:ve=>{Ie&&(pe&&(clearTimeout(pe),pe=null),Ie=!1,pt=null,Re.forEach(K=>{K.resetBuffers(),K.unsetFrozen()}),me==null||me.unsetFrozen()),qe(ve)}})}try{const P=[],ve=ee=>{var Ee;return G(Wy)({mutationCb:ws,mousemoveCb:(X,Pt)=>ne({type:O.IncrementalSnapshot,data:{source:Pt,positions:X}}),mouseInteractionCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.MouseInteraction},X)}),scrollCb:Yn,viewportResizeCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.ViewportResize},X)}),navigationCb:X=>{be?be.handleNavigation(X):qe(!0)},inputCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.Input},X)}),mediaInteractionCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.MediaInteraction},X)}),styleSheetRuleCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.StyleSheetRule},X)}),styleDeclarationCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.StyleDeclaration},X)}),canvasMutationCb:Zn,visibilityManager:me,fontCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.Font},X)}),selectionCb:X=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Selection},X)})},customElementCb:X=>{ne({type:O.IncrementalSnapshot,data:R({source:A.CustomElement},X)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,maskInputOptions:he,inlineStylesheet:f,sampling:C,recordDOM:E,recordCanvas:$,inlineImages:N,userTriggeredOnInput:B,collectFonts:W,doc:ee,maskInputFn:g,maskTextFn:w,keepIframeSrcFn:D,blockSelector:l,slimDOMOptions:le,dataURLOptions:x,selectorOptions:lt,mirror:Me,iframeManager:ut,stylesheetManager:ct,shadowDomManager:Ss,processedNodeManager:kr,canvasManager:ti,ignoreCSSAttributes:U,plugins:((Ee=T==null?void 0:T.filter(X=>X.observer))==null?void 0:Ee.map(X=>({observer:X.observer,options:X.options,callback:Pt=>ne({type:O.Plugin,data:{plugin:X.name,payload:Pt}})})))||[]},S)};ut.addLoadListener(ee=>{try{P.push(ve(ee.contentDocument))}catch(Ee){console.warn(Ee)}});const K=()=>{_==="before"&&Zt(),qe(),P.push(ve(document)),hs=!0,_==="after"&&Zt()};return document.readyState==="interactive"||document.readyState==="complete"?K():(P.push(ue("DOMContentLoaded",()=>{ne({type:O.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&K()})),P.push(ue("load",()=>{ne({type:O.Load,data:{}}),L==="load"&&K()},window))),()=>{pe&&(clearTimeout(pe),pe=null),Zt(),P.forEach(ee=>ee()),be==null||be.destroy(),kr.destroy(),hs=!1,Iy()}}catch(P){console.warn(P)}}Ce.getVersion=()=>fb;Ce.isRecording=()=>hs;Ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${gr.length} events`),Zt()};Ce.addCustomEvent=(r,e)=>{const t={type:O.Custom,data:{tag:r,payload:e}};if(!hs){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${r}`),gr.push(t);return}ne(t)};Ce.freezePage=()=>{Re.forEach(r=>r.freeze())};Ce.takeFullSnapshot=r=>{if(!hs)throw new Error("please take full snapshot after start recording");qe(r)};Ce.mirror=Me;function Pc(r){return{all:r=r||new Map,on:function(e,t){var s=r.get(e);s?s.push(t):r.set(e,[t])},off:function(e,t){var s=r.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):r.set(e,[]))},emit:function(e,t){var s=r.get(e);s&&s.slice().map(function(i){i(t)}),(s=r.get("*"))&&s.slice().map(function(i){i(e,t)})}}}const pb=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"}));function mb(r=window,e=document){if("scrollBehavior"in e.documentElement.style&&r.__forceSmoothScrollPolyfill__!==!0)return;const t=r.HTMLElement||r.Element,s=468,i={scroll:r.scroll||r.scrollTo,scrollBy:r.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},n=r.performance&&r.performance.now?r.performance.now.bind(r.performance):Date.now;function o(g){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(g)}const l=o(r.navigator.userAgent)?1:0;function a(g,w){this.scrollLeft=g,this.scrollTop=w}function c(g){return .5*(1-Math.cos(Math.PI*g))}function u(g){if(g===null||typeof g!="object"||g.behavior===void 0||g.behavior==="auto"||g.behavior==="instant")return!0;if(typeof g=="object"&&g.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+g.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(g,w){if(w==="Y")return g.clientHeight+l<g.scrollHeight;if(w==="X")return g.clientWidth+l<g.scrollWidth}function d(g,w){const S=r.getComputedStyle(g,null)["overflow"+w];return S==="auto"||S==="scroll"}function f(g){const w=h(g,"Y")&&d(g,"Y"),S=h(g,"X")&&d(g,"X");return w||S}function m(g){for(;g!==e.body&&f(g)===!1;)g=g.parentNode||g.host;return g}function y(g){const w=n();let S,b,C,x=(w-g.startTime)/s;x=x>1?1:x,S=c(x),b=g.startX+(g.x-g.startX)*S,C=g.startY+(g.y-g.startY)*S,g.method.call(g.scrollable,b,C),(b!==g.x||C!==g.y)&&r.requestAnimationFrame(y.bind(r,g))}function p(g,w,S){let b,C,x,M;const E=n();g===e.body?(b=r,C=r.scrollX||r.pageXOffset,x=r.scrollY||r.pageYOffset,M=i.scroll):(b=g,C=g.scrollLeft,x=g.scrollTop,M=a),y({scrollable:b,method:M,startTime:E,startX:C,startY:x,x:w,y:S})}r.scroll=r.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:r.scrollY||r.pageYOffset);return}p.call(r,e.body,arguments[0].left!==void 0?~~arguments[0].left:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:r.scrollY||r.pageYOffset)}},r.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(r,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(r,e.body,~~arguments[0].left+(r.scrollX||r.pageXOffset),~~arguments[0].top+(r.scrollY||r.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.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 g=arguments[0].left,w=arguments[0].top;p.call(this,this,typeof g=="undefined"?this.scrollLeft:~~g,typeof w=="undefined"?this.scrollTop:~~w)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const g=m(this),w=g.getBoundingClientRect(),S=this.getBoundingClientRect();g!==e.body?(p.call(this,g,g.scrollLeft+S.left-w.left,g.scrollTop+S.top-w.top),r.getComputedStyle(g).position!=="fixed"&&r.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):r.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class gb{constructor(e=[],t){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(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 s=this.findActionIndex(e);this.actions.splice(s,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,s=this.actions.length-1;for(;t<=s;){const i=Math.floor((t+s)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)s=i-1;else return i+1}return t}}function wa(r,e){if(r.type===O.IncrementalSnapshot&&r.data.source===A.MouseMove&&r.data.positions&&r.data.positions.length){const t=r.data.positions[0].timeOffset,s=r.timestamp+t;return r.delay=s-e,s-e}return r.delay=r.timestamp-e,r.delay}/*! *****************************************************************************
|
|
79
|
+
Solution: Ensure element and root parameter are from the same document context.`)}function uy(r,e={}){var _,B,W,N;var t;if(!r||!r.ownerDocument||!r.isConnected)return null;const s=R(R({},kg),e);if(s.root)try{cy(r,s.root)}catch(T){return console.error("Cross-document generation detected:",T),null}const i=(_=s.cache)!=null?_:ly(),n=i.getEID(r);if(n!==void 0)return n;if(r.tagName.toLowerCase()==="html"){const T=new ia(s,i),D=fy(r,s,T);return i.setEID(r,D),D}const o=new _g(s,i),l=new Wg(s,i),a=new ia(s,i),c=new ry,u=o.findAnchor(r);if(!u&&!s.fallbackToBody)return null;const h=(W=(B=u==null?void 0:u.element)!=null?B:(t=r.ownerDocument)==null?void 0:t.body)!=null?W:null;if(!h)return null;const d=!u||u.tier==="C",f=h.tagName.toLowerCase(),m=h.parentElement;let y;if(m&&f!=="body"&&f!=="html"){const T=Array.from(m.children).indexOf(h);T!==-1&&(y=T+1)}const p=a.extract(h),g={tag:h.tagName.toLowerCase(),semantics:p,score:(N=u==null?void 0:u.score)!=null?N:Pe.DEGRADED_SCORE,degraded:d,nthChild:y},w=l.buildPath(h,r,a),S=a.extract(r);s.enableSvgFingerprint&&hy(r)&&(S.svg=c.fingerprint(r));const b=r.parentElement;let C;if(b){const T=Array.from(b.children).indexOf(r);T!==-1&&(C=T+1)}const x={tag:r.tagName.toLowerCase(),semantics:S,score:a.scoreElement(r),nthChild:C},M=[],E={onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},$=g.degraded||w.degraded,k=dy(g.degraded,w),L={version:"1.0",anchor:g,path:w.path,target:x,constraints:M,fallback:E,meta:{confidence:0,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:s.source,degraded:$,degradationReason:k}};return L.meta.confidence=iy(L),L.meta.confidence<s.confidenceThreshold?null:(i.setEID(r,L),L)}function hy(r){return r.namespaceURI==="http://www.w3.org/2000/svg"||r.tagName.toLowerCase()==="svg"||r instanceof SVGElement}function dy(r,e){if(r&&e.degraded)return"anchor-and-path-degraded";if(r)return"no-semantic-anchor";if(e.degraded)return e.degradationReason}function fy(r,e,t,s){const i={tag:"html",semantics:t.extract(r),score:1,degraded:!1,nthChild:void 0};return{version:"1.0",anchor:i,path:[],target:i,constraints:[],fallback:{onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},meta:{confidence:1,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:e.source,degraded:!1,degradationReason:void 0}}}const Nc={maxClasses:2,maxAttributes:5,includeText:!0,maxTextLength:50,simplifyTarget:!0,includeConstraints:!0};function oa(r){return r==="id"?101:st[r]!==void 0?st[r]:r.startsWith("data-")?st["data-*"]:r.startsWith("aria-")?st["aria-*"]:0}function py(r){return["id","data-testid","data-qa","data-cy","href","text","role"].includes(r)}function my(r){return!!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r)||/(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r)||/\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r))}function gy(r,e){const t=R(R({},Nc),e),s=`v${r.version}`,i=Qr(r.anchor,!1,t),n=r.path.length>0?r.path.map(a=>Qr(a,!1,t)).join(" > ")+" > ":"",o=Qr(r.target,!0,t),l=t.includeConstraints?yy(r):"";return`${s}: ${i} :: ${n}${o}${l}`}function Qr(r,e=!1,t=Nc){const{tag:s,semantics:i}=r;let n=s;const o=[],l=R({},i.attributes);i.id&&(l.id=i.id),i.role&&!l.role&&(l.role=i.role);const a=Object.entries(l).map(([h,d])=>{const f=oa(h),m=h==="href"||h==="src"?Ic(h,d):d;return{name:h,value:m,priority:f}}).filter(h=>h.name!=="id"&&h.name!=="class"&&Ec.has(h.name)||Mc.has(h.name)&&Ac(h.value)?!1:h.priority>0||h.name==="role"||h.name==="id");a.sort((h,d)=>d.priority-h.priority);const c=a.slice(0,t.maxAttributes);c.sort((h,d)=>h.name.localeCompare(d.name));for(const{name:h,value:d}of c)o.push(`${h}="${Vi(d)}"`);if(t.includeText&&i.text&&!my(i.text.normalized)){const h=i.text.normalized;h.length>0&&h.length<=t.maxTextLength&&o.push(`text="${Vi(h)}"`)}let u=o;if(o.length>0&&(e&&t.simplifyTarget&&i.id&&(u=o.filter(h=>{const d=h.split("=")[0];return oa(d)>=60||d==="text"||d==="id"||d==="role"})),u.length>0&&u.sort((h,d)=>h.localeCompare(d))),i.classes&&i.classes.length>0){const h=zg(i.classes),d=!!i.id||o.some(f=>f.startsWith("href=")||f.startsWith("data-testid=")||f.startsWith("text=")||f.startsWith("role="));if(!(e&&t.simplifyTarget&&d)&&h.length>0){const f=h.sort().slice(0,t.maxClasses);n+=f.map(m=>`.${m}`).join("")}}if(u.length>0&&(n+=`[${u.join(",")}]`),"nthChild"in r&&r.nthChild){const h=!!i.id||i.attributes&&Object.keys(i.attributes).some(py);e&&t.simplifyTarget&&h||(n+=`#${r.nthChild}`)}return n}function yy(r){if(!r.constraints||r.constraints.length===0)return"";const e=[];for(const t of r.constraints)switch(t.type){case"uniqueness":e.push("unique=true");break;case"position":t.params&&t.params.strategy&&e.push(`pos=${t.params.strategy}`);break;case"text-proximity":if(t.params&&t.params.reference){const s=Vi(String(t.params.reference));e.push(`text="${s}"`)}break}return e.length===0?"":` {${e.join(",")}}`}function Vi(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/>/g,"\\>").replace(/:/g,"\\:")}function by(r,e,t){const s=uy(r,e);return s?gy(s,t):null}const Ht={maxPathDepth:10,enableSvgFingerprint:!0,confidenceThreshold:0,fallbackToBody:!0};function vy(r){var e,t,s,i;return r===!1?null:r===!0||r===void 0?R({},Ht):{maxPathDepth:(e=r.maxPathDepth)!=null?e:Ht.maxPathDepth,enableSvgFingerprint:(t=r.enableSvgFingerprint)!=null?t:Ht.enableSvgFingerprint,confidenceThreshold:(s=r.confidenceThreshold)!=null?s:Ht.confidenceThreshold,fallbackToBody:(i=r.fallbackToBody)!=null?i:Ht.fallbackToBody}}function aa(r,e,t,s){const i=e.getMeta(r),n=i==null?void 0:i.selector;if(n&&!(s!=null&&s.force))return n;const o=r.nodeType===Node.ELEMENT_NODE?r:Or(r);if(!o)return n;const l=e.getMeta(o),a=l==null?void 0:l.selector;if(a&&!(s!=null&&s.force))return a;if(!t)return a!=null?a:n;const c={maxPathDepth:t.maxPathDepth,enableSvgFingerprint:t.enableSvgFingerprint,fallbackToBody:t.fallbackToBody};try{const u=by(o,c);if(u)return l?l.selector=u:i&&(i.selector=u),u}catch(u){}return a!=null?a:n}function la(r){return"__ln"in r}class wy{constructor(){v(this,"length",0),v(this,"head",null),v(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&la(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&la(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ca=(r,e)=>`${r}@${e}`,Sy=new Set(["id","class","name","role","title","alt","placeholder","for","type"]);function Cy(r){const e=r.toLowerCase();return Sy.has(e)||e.startsWith("data-")||e.startsWith("aria-")}class xy{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"excludeAttribute"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"selectorOptions",null),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new wy,i=a=>{let c=a,u=ts;for(;u===ts;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{const c=V.parentNode(a);if(!c||!Un(a))return;let u=!1;if(a.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=!0)}const h=Jt(c)?this.mirror.getId(Wn(a)):this.mirror.getId(c),d=i(a);if(h===-1||d===-1)return s.addNode(a);const f=Ct(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{At(m,this.mirror)&&this.iframeManager.addIframe(m),Fn(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),tt(a)&&this.shadowDomManager.addShadowRoot(V.shadowRoot(a),this.doc)},onIframeLoad:(m,y)=>{this.iframeManager.attachIframe(m,y),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,y)=>{this.stylesheetManager.attachLinkElement(m,y)},cssCaptured:u,selectorOptions:this.selectorOptions});f&&(e.push({parentId:h,nextId:d,node:f}),t.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ua(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(V.parentNode(a))||n(a);for(const a of this.addedSet)!ha(this.droppedSet,a)&&!ua(this.removesSubTreeCache,a,this.mirror)||ha(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;s.length;){let a=null;if(o){const c=this.mirror.getId(V.parentNode(o.value)),u=i(o.value);c!==-1&&u!==-1&&(a=o)}if(!a){let c=s.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(V.parentNode(u.value));if(i(u.value)===-1)continue;if(h!==-1){a=u;break}else{const f=u.value,m=V.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=V.host(m);if(this.mirror.getId(y)!==-1){a=u;break}}}}}}if(!a){for(;s.head;)s.removeNode(s.head.value);break}o=a.previous,s.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const c=a.node,u=V.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value,selector:aa(c,this.mirror,this.selectorOptions)}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const u=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:c,selector:aa(a.node,this.mirror,this.selectorOptions,{force:Object.keys(c).some(Cy)})}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),v(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const s=Array.from(V.childNodes(e),i=>V.textContent(i)||"").join("");t.attributes.value=er({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:tr(e),value:s,maskInputFn:this.maskInputFn})}),v(this,"processMutation",e=>{if(!Ks(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=V.textContent(e.target);!ge(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Va(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Or(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,i=e.target.getAttribute(s);const o=t[s],l=typeof o=="boolean",a=document.contains(t),c=tn(t),u=ci(s,this.excludeAttribute);if(i===null&&!t.hasAttribute(s)&&e.oldValue!==null&&(o===""||o===null||typeof o=="undefined")){console.debug(`[${Ae()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(ci(s,this.excludeAttribute)){console.debug(`[${Ae()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(s==="value"){const f=tr(t);i=er({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:f,value:i,maskInputFn:this.maskInputFn})}if(ge(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)s="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),s==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ua(t.tagName,s))if(d.attributes[s]=Wa(this.doc,it(t.tagName),it(s),i),s!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${Ae()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===o?"mirrored in DOM property":null,i===d.attributes[s]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:V.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:i,oldValue:e.oldValue,transformedValue:d.attributes[s],excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u}),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const m=this.unattachedDoc.createElement("span");e.oldValue&&m.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const p=t.style.getPropertyValue(y),g=t.style.getPropertyPriority(y);p!==m.style.getPropertyValue(y)||g!==m.style.getPropertyPriority(y)?g===""?d.styleDiff[y]=p:d.styleDiff[y]=[p,g]:d._unchangedStyles[y]=[p,g]}for(const y of Array.from(m.style))t.style.getPropertyValue(y)===""&&(d.styleDiff[y]=!1)}else s==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(ge(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),i=Jt(e.target)?this.mirror.getId(V.host(e.target)):this.mirror.getId(e.target);ge(e.target,this.blockClass,this.blockSelector,!1)||Ks(t,this.mirror,this.slimDOMOptions)||!vc(t,this.mirror)||(this.addedSet.has(t)?(Hi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&s===-1||_n(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ca(s,i)]?Hi(this.movedSet,t):(this.removes.push({parentId:i,id:s,isShadow:Jt(e.target)&&qt(e.target)?!0:void 0}),Ey(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ks(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&s!==-1&&(this.movedMap[ca(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ge(e,this.blockClass,this.blockSelector,!1)||(V.childNodes(e).forEach(s=>this.genAdds(s)),tt(e)&&V.childNodes(V.shadowRoot(e)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","selectorOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}resetBuffers(){this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.mapRemoves=[],this.movedMap={},this.attributes=[],this.texts=[],this.attributeMap=new WeakMap,this.removes=[]}unsetFrozen(){this.frozen=!1,this.canvasManager.unfreeze()}}function Hi(r,e){r.delete(e),V.childNodes(e).forEach(t=>Hi(r,t))}function Ey(r,e){const t=[r];for(;t.length;){const s=t.pop();e.has(s)||(e.add(s),V.childNodes(s).forEach(i=>t.push(i)))}}function ua(r,e,t){return r.size===0?!1:My(r,e)}function My(r,e,t){const s=V.parentNode(e);return s?r.has(s):!1}function ha(r,e){return r.size===0?!1:Rc(r,e)}function Rc(r,e){const t=V.parentNode(e);return t?r.has(t)?!0:Rc(r,t):!1}let Qt;function Ay(r){Qt=r}function Iy(){Qt=void 0}const G=r=>Qt?(...t)=>{try{return r(...t)}catch(s){if(Qt&&Qt(s)===!0)return;throw s}}:r,Re=[];function kt(r){try{if("composedPath"in r){const e=r.composedPath();if(e.length)return e[0]}else if("path"in r&&r.path.length)return r.path[0]}catch(e){}return r&&r.target}function Tc(r,e){const t=new xy;Re.push(t),t.init(r);const s=new(On())(G(t.processMutations.bind(t)));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ny({mousemoveCb:r,sampling:e,doc:t,mirror:s}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=$t(G(h=>{const d=Date.now()-l;r(o.map(f=>(f.timeOffset-=d,f)),h),o=[],l=null}),n),c=G($t(G(h=>{const d=kt(h),{clientX:f,clientY:m}=pr(h)?h.changedTouches[0]:h;l||(l=Ae()),o.push({x:f,y:m,id:s.getId(d),timeOffset:Ae()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?A.Drag:h instanceof MouseEvent?A.MouseMove:A.TouchMove)}),i,{trailing:!1})),u=[ue("mousemove",c,t),ue("touchmove",c,t),ue("drag",c,t)];return G(()=>{u.forEach(h=>h())})}function Ry({mouseInteractionCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const d=kt(h);if(ge(d,s,i,!0))return;let f=null,m=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=Ve.Mouse;break;case"touch":f=Ve.Touch;break;case"pen":f=Ve.Pen;break}f===Ve.Touch?Z[u]===Z.MouseDown?m="TouchStart":Z[u]===Z.MouseUp&&(m="TouchEnd"):Ve.Pen}else pr(h)&&(f=Ve.Touch);f!==null?(a=f,(m.startsWith("Touch")&&f===Ve.Touch||m.startsWith("Mouse")&&f===Ve.Mouse)&&(f=null)):Z[u]===Z.Click&&(f=a,a=null);const y=pr(h)?h.changedTouches[0]:h;if(!y)return;const p=t.getId(d),{clientX:g,clientY:w}=y;G(r)(R({type:Z[m],id:p,x:g,y:w},f!==null&&{pointerType:f}))};return Object.keys(Z).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=it(u);const d=c(u);if(window.PointerEvent)switch(Z[u]){case Z.MouseDown:case Z.MouseUp:h=h.replace("mouse","pointer");break;case Z.TouchStart:case Z.TouchEnd:return}l.push(ue(h,d,e))}),G(()=>{l.forEach(u=>u())})}function Oc({scrollCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,sampling:n}){const o=G($t(G(l=>{const a=kt(l);if(!a||ge(a,s,i,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=Dn(e.defaultView);r({id:c,x:u.left,y:u.top})}else r({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ue("scroll",o,e)}function Ty({viewportResizeCb:r},{win:e}){let t=-1,s=-1;const i=G($t(G(()=>{const n=$n(),o=kn();(t!==n||s!==o)&&(r({width:Number(o),height:Number(n)}),t=n,s=o)}),200));return ue("resize",i,e)}function Oy({navigationCb:r,doc:e,sampling:t}){var u;if(t.navigation===!1)return()=>{};const s=e.defaultView;if(!s)return()=>{};let i=s.location.href;const n=[],o=G(h=>{const d=s.location.href;d!==i&&(r({href:d,oldHref:i,navigationType:h}),i=d)}),l=Ye(s.history,"pushState",function(h){return function(...d){const f=h.apply(this,d);return o("pushState"),f}});n.push(l);const a=Ye(s.history,"replaceState",function(h){return function(...d){const f=h.apply(this,d);return o("replaceState"),f}});if(n.push(a),n.push(ue("popstate",()=>o("popstate"),s)),n.push(ue("hashchange",()=>o("hashchange"),s)),(typeof t.navigation=="object"&&(u=t.navigation.useNavigationAPI)!=null?u:!0)&&"navigation"in s)try{const h=s.navigation,d=f=>{var m;const y=f;if(y.navigationType==="push"||y.navigationType==="replace"){const p=(m=y.destination)==null?void 0:m.url;p&&p!==i&&(r({href:p,oldHref:i,navigationType:"navigate"}),i=p)}};h.addEventListener("navigate",d),n.push(()=>h.removeEventListener("navigate",d))}catch(h){}return G(()=>{n.forEach(h=>h())})}const ei=["INPUT","TEXTAREA","SELECT"],da=new WeakMap,Dy=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],fa=new WeakMap;function $y({inputCb:r,doc:e,mirror:t,blockClass:s,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(S){let b=kt(S);const C=S.isTrusted,x=b&&b.tagName;if(b&&x==="OPTION"&&(b=V.parentElement(b)),!b||!x||ei.indexOf(x)<0||ge(b,s,i,!0)||b.classList.contains(n)||o&&b.matches(o))return;let M=b.value,E=!1;const $=tr(b)||"";$==="radio"||$==="checkbox"?E=b.checked:(l[x.toLowerCase()]||l[$])&&(M=er({element:b,maskInputOptions:l,tagName:x,type:$,value:M,maskInputFn:a})),d(b,u?{text:M,isChecked:E,userTriggered:C}:{text:M,isChecked:E});const k=b.name;$==="radio"&&k&&E&&e.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(L=>{if(L!==b){const _=L.value;d(L,u?{text:_,isChecked:!E,userTriggered:!1}:{text:_,isChecked:!E})}})}function d(S,b){const C=da.get(S),x=S,M=x.hasAttribute("placeholder"),E=x.value==="",$=typeof x.defaultValue=="string"?x.defaultValue==="":!0,k=!b.userTriggered,L=!C||C.text==="",_=M&&E&&$&&L&&k&&!b.isChecked&&x.type!=="hidden"&&ei.includes(x.tagName),B=x.tagName==="INPUT"&&x.type==="text"&&!b.userTriggered&&b.text===x.defaultValue&&!C&&x.hasAttribute("placeholder"),W=!b.userTriggered&&x.value===x.defaultValue&&!C&&x.hasAttribute("placeholder")&&!b.isChecked&&x.type!=="hidden"&&ei.includes(x.tagName),N=x.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,T=x.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(_||B||W||N||T){console.debug(`[${Ae()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:V.describeNode(x),tag:x.tagName,nodeType:x.nodeType,attribute:x.attributes,value:x.value,isLikelyPhantom:_,isRenderDrivenTextInput:B,isValueFromDefault:W,isPhantomCheckbox:N,isPhantomRadio:T});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){da.set(S,b);const D=t.getId(S);G(r)(ae(R({},b),{id:D}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(S=>ue(S,G(h),e)),y=S=>{const b=kt(S);if(!b||!b.tagName)return;if(c.input==="all"){h(S);return}const C=b.tagName,x=S.key,M=Dy.includes(x),E=C==="TEXTAREA",$=e.activeElement===b,k=b.value,L=fa.get(b);if(fa.set(b,k),!$){h(S);return}if(M){if(!E){h(S);return}let _=L!=null?L:"",B=0;const W=2,N=()=>{const T=b.value,D=e.activeElement===b,U=T!==_;if(!D){h(S);return}if(U)B=0,_=T;else if(B++,B>=W){h(S);return}requestAnimationFrame(N)};requestAnimationFrame(N);return}};m.push(ue("keydown",G(y),e));const p=e.defaultView;if(!p)return()=>{m.forEach(S=>S())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),w=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...w.map(S=>bs(S[0],S[1],{set(){G(h)({target:this,isTrusted:!1})}},!1,p))),G(()=>{m.forEach(S=>S())})}function mr(r){const e=[];function t(s,i){if(Hs("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Hs("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Hs("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Hs("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const o=Array.from(s.parentRule.cssRules).indexOf(s);i.unshift(o)}else if(s.parentStyleSheet){const o=Array.from(s.parentStyleSheet.cssRules).indexOf(s);i.unshift(o)}return i}return t(r,e)}function Ke(r,e,t){let s,i;return r?(r.ownerNode?s=e.getId(r.ownerNode):i=t.getId(r),{styleId:i,id:s}):{}}function ky({styleSheetRuleCb:r,mirror:e,stylesheetManager:t},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:G((u,h,d)=>{const[f,m]=d,{id:y,styleId:p}=Ke(h,e,t.styleMirror);return(y&&y!==-1||p&&p!==-1)&&r({id:y,styleId:p,adds:[{rule:f,index:m}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.addRule=function(u,h,d=this.cssRules.length){const f=`${u} { ${h} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,d])};const n=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,removes:[{index:f}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.removeRule=function(u){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,replace:f}),u.apply(h,d)})}));let l;s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:G((u,h,d)=>{const[f]=d,{id:m,styleId:y}=Ke(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,replaceSync:f}),u.apply(h,d)})}));const a={};Gs("CSSGroupingRule")?a.CSSGroupingRule=s.CSSGroupingRule:(Gs("CSSMediaRule")&&(a.CSSMediaRule=s.CSSMediaRule),Gs("CSSConditionRule")&&(a.CSSConditionRule=s.CSSConditionRule),Gs("CSSSupportsRule")&&(a.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:G((d,f,m)=>{const[y,p]=m,{id:g,styleId:w}=Ke(f.parentStyleSheet,e,t.styleMirror);return(g&&g!==-1||w&&w!==-1)&&r({id:g,styleId:w,adds:[{rule:y,index:[...mr(f),p||0]}]}),d.apply(f,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:G((d,f,m)=>{const[y]=m,{id:p,styleId:g}=Ke(f.parentStyleSheet,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&r({id:p,styleId:g,removes:[{index:[...mr(f),y]}]}),d.apply(f,m)})})}),G(()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=n,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function Dc({mirror:r,stylesheetManager:e},t){var s,i,n;let o=null;t.nodeName==="#document"?o=r.getId(t):o=r.getId(V.host(t));const l=t.nodeName==="#document"?(s=t.defaultView)==null?void 0:s.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var u;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(d){}return h}}),G(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function _y({styleDeclarationCb:r,mirror:e,ignoreCSSAttributes:t,stylesheetManager:s},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:G((l,a,c)=>{var u;const[h,d,f]=c;if(t.has(h))return n.apply(a,[h,d,f]);const{id:m,styleId:y}=Ke((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(m&&m!==-1||y&&y!==-1)&&r({id:m,styleId:y,set:{property:h,value:d,priority:f},index:mr(a.parentRule)}),l.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:G((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:d,styleId:f}=Ke((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(d&&d!==-1||f&&f!==-1)&&r({id:d,styleId:f,remove:{property:h},index:mr(a.parentRule)}),l.apply(a,c)})}),G(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ly({mediaInteractionCb:r,blockClass:e,blockSelector:t,mirror:s,sampling:i,doc:n}){const o=G(a=>$t(G(c=>{const u=kt(c);if(!u||ge(u,e,t,!0))return;const{currentTime:h,volume:d,muted:f,playbackRate:m,loop:y}=u;r({type:a,id:s.getId(u),currentTime:h,volume:d,muted:f,playbackRate:m,loop:y})}),i.media||500)),l=[ue("play",o(Qe.Play),n),ue("pause",o(Qe.Pause),n),ue("seeked",o(Qe.Seeked),n),ue("volumechange",o(Qe.VolumeChange),n),ue("ratechange",o(Qe.RateChange),n)];return G(()=>{l.forEach(a=>a())})}function Py({fontCb:r,doc:e}){const t=e.defaultView;if(!t)return()=>{};const s=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c)))}),h};const o=Ye(e.fonts,"add",function(l){return function(a){return setTimeout(G(()=>{const c=i.get(a);c&&(r(c),i.delete(a))}),0),l.apply(this,[a])}});return s.push(()=>{t.FontFace=n}),s.push(o),G(()=>{s.forEach(l=>l())})}function Fy(r){const{doc:e,mirror:t,blockClass:s,blockSelector:i,selectionCb:n}=r;let o=!0;const l=G(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const d=a.getRangeAt(h),{startContainer:f,startOffset:m,endContainer:y,endOffset:p}=d;ge(f,s,i,!0)||ge(y,s,i,!0)||c.push({start:t.getId(f),startOffset:m,end:t.getId(y),endOffset:p})}n({ranges:c})});return l(),ue("selectionchange",l)}function zy({doc:r,customElementCb:e}){const t=r.defaultView;return!t||!t.customElements?()=>{}:Ye(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function By(r,e){const{mutationCb:t,mousemoveCb:s,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,navigationCb:l,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:f,selectionCb:m,customElementCb:y}=r;r.mutationCb=(...p)=>{e.mutation&&e.mutation(...p),t(...p)},r.mousemoveCb=(...p)=>{e.mousemove&&e.mousemove(...p),s(...p)},r.mouseInteractionCb=(...p)=>{e.mouseInteraction&&e.mouseInteraction(...p),i(...p)},r.scrollCb=(...p)=>{e.scroll&&e.scroll(...p),n(...p)},r.viewportResizeCb=(...p)=>{e.viewportResize&&e.viewportResize(...p),o(...p)},r.navigationCb=(...p)=>{e.navigation&&e.navigation(...p),l(...p)},r.inputCb=(...p)=>{e.input&&e.input(...p),a(...p)},r.mediaInteractionCb=(...p)=>{e.mediaInteaction&&e.mediaInteaction(...p),c(...p)},r.styleSheetRuleCb=(...p)=>{e.styleSheetRule&&e.styleSheetRule(...p),u(...p)},r.styleDeclarationCb=(...p)=>{e.styleDeclaration&&e.styleDeclaration(...p),h(...p)},r.canvasMutationCb=(...p)=>{e.canvasMutation&&e.canvasMutation(...p),d(...p)},r.fontCb=(...p)=>{e.font&&e.font(...p),f(...p)},r.selectionCb=(...p)=>{e.selection&&e.selection(...p),m(...p)},r.customElementCb=(...p)=>{e.customElement&&e.customElement(...p),y(...p)}}function Wy(r,e={}){const t=r.doc.defaultView;if(!t)return()=>{};By(r,e);let s;r.recordDOM&&(s=Tc(r,r.doc));const i=Ny(r),n=Ry(r),o=Oc(r),l=Ty(r,{win:t}),a=Oy(r),c=$y(r),u=Ly(r);let h=()=>{},d=()=>{},f=()=>{},m=()=>{};r.recordDOM&&(h=ky(r,{win:t}),d=Dc(r,r.doc),f=_y(r,{win:t}),r.collectFonts&&(m=Py(r)));const y=Fy(r),p=zy(r),g=[];for(const w of r.plugins)g.push(w.observer(w.callback,t,w.options));return G(()=>{var w;Re.forEach(S=>S.reset()),(w=r.visibilityManager)==null||w.reset(),s==null||s.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),d(),f(),m(),y(),p(),g.forEach(S=>S())})}function Hs(r){return typeof window[r]!="undefined"}function Gs(r){return!!(typeof window[r]!="undefined"&&window[r].prototype&&"insertRule"in window[r].prototype&&"deleteRule"in window[r].prototype)}class pa{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,i){const n=s||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const s=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,s,i))}getRemoteId(e,t,s){const i=s||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,s))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Uy{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new pa(Ba)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pa(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=e.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case O.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:O.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case O.Meta:case O.Load:case O.DomContentLoaded:return!1;case O.Plugin:return t;case O.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case O.IncrementalSnapshot:switch(t.data.source){case A.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.Drag:case A.TouchMove:case A.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(t.data,e,["id"]),t;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case A.Font:return t;case A.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case A.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(s=t.data.styles)==null||s.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,s,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(s=>{this.replaceIdOnNode(s,t)})}patchRootIdOnNode(e,t){e.type!==He.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(s=>{this.patchRootIdOnNode(s,t)})}}class Vy{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!qt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=Tc(ae(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Oc(ae(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(V.host(e))),this.restoreHandlers.push(Dc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const s=this;this.restoreHandlers.push(Ye(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=V.shadowRoot(this);return l&&Un(this)&&s.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var js=0;js<Et.length;js++)Yt[Et.charCodeAt(js)]=js;var Hy=function(r){var e=new Uint8Array(r),t,s=e.length,i="";for(t=0;t<s;t+=3)i+=Et[e[t]>>2],i+=Et[(e[t]&3)<<4|e[t+1]>>4],i+=Et[(e[t+1]&15)<<2|e[t+2]>>6],i+=Et[e[t+2]&63];return s%3===2?i=i.substring(0,i.length-1)+"=":s%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Gy=function(r){var e=r.length*.75,t=r.length,s,i=0,n,o,l,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(s=0;s<t;s+=4)n=Yt[r.charCodeAt(s)],o=Yt[r.charCodeAt(s+1)],l=Yt[r.charCodeAt(s+2)],a=Yt[r.charCodeAt(s+3)],u[i++]=n<<2|o>>4,u[i++]=(o&15)<<4|l>>2,u[i++]=(l&3)<<6|a&63;return c};const ma=new Map;function jy(r,e){let t=ma.get(r);return t||(t=new Map,ma.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}const $c=(r,e,t)=>{if(!r||!(_c(r,e)||typeof r=="object"))return;const s=r.constructor.name,i=jy(t,s);let n=i.indexOf(r);return n===-1&&(n=i.length,i.push(r)),n};function Qs(r,e,t){if(r instanceof Array)return r.map(s=>Qs(s,e,t));if(r===null)return r;if(r instanceof Float32Array||r instanceof Float64Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Uint8Array||r instanceof Uint16Array||r instanceof Int16Array||r instanceof Int8Array||r instanceof Uint8ClampedArray)return{rr_type:r.constructor.name,args:[Object.values(r)]};if(r instanceof ArrayBuffer){const s=r.constructor.name,i=Hy(r);return{rr_type:s,base64:i}}else{if(r instanceof DataView)return{rr_type:r.constructor.name,args:[Qs(r.buffer,e,t),r.byteOffset,r.byteLength]};if(r instanceof HTMLImageElement){const s=r.constructor.name,{src:i}=r;return{rr_type:s,src:i}}else if(r instanceof HTMLCanvasElement){const s="HTMLImageElement",i=r.toDataURL();return{rr_type:s,src:i}}else{if(r instanceof ImageData)return{rr_type:r.constructor.name,args:[Qs(r.data,e,t),r.width,r.height]};if(_c(r,e)||typeof r=="object"){const s=r.constructor.name,i=$c(r,e,t);return{rr_type:s,index:i}}}}return r}const kc=(r,e,t)=>r.map(s=>Qs(s,e,t)),_c=(r,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>r instanceof e[i]);function Yy(r,e,t,s){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Ye(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return ge(this.canvas,t,s,!0)||setTimeout(()=>{const u=kc(c,e,this);r(this.canvas,{type:Ze["2D"],property:o,args:u})},0),a.apply(this,c)}});i.push(l)}catch(l){const a=bs(e.CanvasRenderingContext2D.prototype,o,{set(c){r(this.canvas,{type:Ze["2D"],property:o,args:[c],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function Zy(r){return r==="experimental-webgl"?"webgl":r}function ga(r,e,t,s){const i=[];try{const n=Ye(r.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!ge(this,e,t,!0)){const c=Zy(l);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ya(r,e,t,s,i,n){const o=[],l=Object.getOwnPropertyNames(r);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof r[a]!="function")continue;const c=Ye(r,a,function(u){return function(...h){const d=u.apply(this,h);if($c(d,n,this),"tagName"in this.canvas&&!ge(this.canvas,s,i,!0)){const f=kc(h,n,this),m={type:e,property:a,args:f};t(this.canvas,m)}return d}});o.push(c)}catch(c){const u=bs(r,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function Xy(r,e,t,s){const i=[];return i.push(...ya(e.WebGLRenderingContext.prototype,Ze.WebGL,r,t,s,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...ya(e.WebGL2RenderingContext.prototype,Ze.WebGL2,r,t,s,e)),()=>{i.forEach(n=>n())}}const Lc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Jy=r=>Uint8Array.from(atob(r),e=>e.charCodeAt(0)),ba=typeof self!="undefined"&&self.Blob&&new Blob([Jy(Lc)],{type:"text/javascript;charset=utf-8"});function qy(r){let e;try{if(e=ba&&(self.URL||self.webkitURL).createObjectURL(ba),!e)throw"";const t=new Worker(e,{name:r==null?void 0:r.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+Lc,{name:r==null?void 0:r.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ky{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)});const{sampling:t="all",win:s,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(s,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,s,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,i,n){const o=ga(t,s,i,!0),l=new Map,a=new qy;a.onmessage=m=>{const{id:y}=m.data;if(l.set(y,!1),!("base64"in m.data))return;const{base64:p,type:g,width:w,height:S}=m.data;this.mutationCb({id:y,type:Ze["2D"],commands:[{property:"clearRect",args:[0,0,w,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:g}]},0,0]}]})};const c=1e3/e;let u=0,h;const d=()=>{const m=[];return t.document.querySelectorAll("canvas").forEach(y=>{ge(y,s,i,!0)||m.push(y)}),m},f=m=>{if(u&&m-u<c){h=requestAnimationFrame(f);return}u=m,d().forEach(async y=>{var p;const g=this.mirror.getId(y);if(l.get(g)||y.width===0||y.height===0)return;if(l.set(g,!0),["webgl","webgl2"].includes(y.__context)){const S=y.getContext(y.__context);((p=S==null?void 0:S.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const w=await createImageBitmap(y);a.postMessage({id:g,bitmap:w,width:y.width,height:y.height,dataURLOptions:n.dataURLOptions},[w])}),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=ga(e,t,s,!1),n=Yy(this.processMutation.bind(this),e,t,s),o=Xy(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||t===-1)return;const i=s.map(o=>{const c=o,{type:l}=c;return gt(c,["type"])}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}function va(r,e,t){var u,h,d,f,m,y;const s=(u=t==null?void 0:t.root)!=null?u:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,n=(d=t==null?void 0:t.sensitivity)!=null?d:.05,o=Qy((f=t==null?void 0:t.rootMargin)!=null?f:"0px"),l=new Map,a=eb(s),c=tb(a,o);for(const p of r){const g=p.getBoundingClientRect();let w=ib(),S=0;g.width>0&&g.height>0&&(w=sb(g,c),S=rb(g,w),S=Math.round(S*100)/100);const b=nb(p),C=(m=e.get(p))!=null?m:null,x=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,M=S,E=(C==null?void 0:C.isStyleVisible)&&x>i,$=b&&M>i;!C||E!==$||E!==$&&Math.abs(M-x)>n?l.set(p,{target:p,isVisible:$,isStyleVisible:b,intersectionRatio:M,intersectionRect:w,oldValue:C}):l.set(p,C)}return l}function Qy(r){const e=r.trim().split(/\s+/),t=(s,i)=>s.endsWith("%")?parseFloat(s)/100*i:parseFloat(s)||0;return function(s){const i=t(e[0]||"0px",s.height),n=t(e[1]||e[0]||"0px",s.width),o=t(e[2]||e[0]||"0px",s.height),l=t(e[3]||e[1]||e[0]||"0px",s.width);return{top:i,right:n,bottom:o,left:l,width:0,height:0}}}function eb(r){return r?r.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function tb(r,e){const t=e(r);return new DOMRect(r.left-t.left,r.top-t.top,r.width+t.left+t.right,r.height+t.top+t.bottom)}function sb(r,e){const t=Math.max(r.top,e.top),s=Math.max(r.left,e.left),i=Math.min(r.bottom,e.bottom),n=Math.min(r.right,e.right),o=Math.max(0,n-s),l=Math.max(0,i-t);return{top:t,left:s,bottom:i,right:n,width:o,height:l}}function rb(r,e){const t=r.width*r.height,s=e.width*e.height;return t>0?s/t:0}function ib(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function nb(r){const e=getComputedStyle(r);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class ob{constructor(e){var c,u,h,d,f,m;v(this,"frozen",!1),v(this,"locked",!1),v(this,"pending",new Map),v(this,"mirror"),v(this,"mutationCb"),v(this,"rafId",null),v(this,"intervalId",null),v(this,"rafThrottle"),v(this,"lastFlushTime",0),v(this,"elements",new Set),v(this,"previousState",new Map),v(this,"root",null),v(this,"threshold"),v(this,"sensitivity"),v(this,"rootMargin"),v(this,"hasInitialized",!1),v(this,"mode","none"),v(this,"debounce",50),v(this,"throttle",100),v(this,"buffer",new Map),v(this,"debounceTimer",null),v(this,"lastThrottleTime",0),v(this,"disabled",!1),v(this,"notifyActivity");const{doc:t,mirror:s,sampling:i,mutationCb:n,notifyActivity:o}=e;if(this.mirror=s,this.mutationCb=n,this.notifyActivity=o,this.rootMargin="0px",i===!1){this.disabled=!0;return}const l=typeof i=="object"&&i!==null?i:{};this.mode=(c=l==null?void 0:l.mode)!=null?c:"none",this.debounce=Number((u=l==null?void 0:l.debounce)!=null?u:100),this.throttle=Number((h=l==null?void 0:l.throttle)!=null?h:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((f=l==null?void 0:l.sensitivity)!=null?f:.05),this.rafThrottle=Number((m=l==null?void 0:l.rafThrottle)!=null?m:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(p=>{p.addedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&(this.observe(g),g.querySelectorAll("*").forEach(w=>this.observe(w)))}),p.removedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&this.unobserve(g)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=va(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,s]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==s.isVisible||Math.abs(i.intersectionRatio-s.intersectionRatio)>this.sensitivity){const o=this.mirror.getId(t);o!==-1&&this.buffer.set(t,{id:o,isVisible:s.isVisible,ratio:s.intersectionRatio}),this.previousState.set(t,s)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;if(this.frozen||this.locked||this.buffer.size===0)return;const t=Array.from(this.buffer.values()),s=t.length;this.buffer.clear(),this.mutationCb({mutations:t}),(e=this.notifyActivity)==null||e.call(this,s)}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unlock(){this.locked=!1,this.buffer.clear(),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),!this.disabled&&this.elements.size>0&&(this.previousState=va(this.elements,new Map,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin}))}unsetFrozen(){this.frozen=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const ab=150,lb=5e3,cb=100;class ub{constructor(e){var n,o,l;v(this,"frozen",!1),v(this,"locked",!1),v(this,"disabled",!1),v(this,"settleTimeout"),v(this,"maxWait"),v(this,"debounceMs"),v(this,"settlingObserver",null),v(this,"debounceTimer",null),v(this,"settleCheckTimer",null),v(this,"maxWaitTimer",null),v(this,"lastMutationTime",0),v(this,"pendingNavigation",null),v(this,"doc"),v(this,"onSnapshot");const{doc:t,config:s,onSnapshot:i}=e;this.doc=t,this.onSnapshot=G(i),this.settleTimeout=(n=s.settleTimeout)!=null?n:ab,this.maxWait=(o=s.maxWait)!=null?o:lb,this.debounceMs=(l=s.debounce)!=null?l:cb}handleNavigation(e){this.disabled||this.locked||(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=e,!this.frozen&&this.startDebounce())}cancelPending(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null}freeze(){this.frozen=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unfreeze(){this.frozen=!1,this.pendingNavigation&&!this.locked&&!this.disabled&&this.startDebounce()}lock(){this.locked=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unlock(){this.locked=!1,this.pendingNavigation=null}unsetFrozen(){this.frozen=!1}reset(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.frozen=!1,this.locked=!1}destroy(){const e=this.pendingNavigation!==null;this.reset(),this.disabled=!0,e&&this.onSnapshot(!0)}startDebounce(){this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.startDOMSettling()},this.debounceMs)}startDOMSettling(){if(this.frozen||this.locked||this.disabled)return;this.lastMutationTime=performance.now();const e=On();this.settlingObserver=new e(()=>{this.lastMutationTime=performance.now(),this.settleCheckTimer!==null&&clearTimeout(this.settleCheckTimer),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout)}),this.settlingObserver.observe(this.doc,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout),this.maxWaitTimer=setTimeout(()=>{this.maxWaitTimer=null,this.completeSettling()},this.maxWait)}checkSettled(){this.settleCheckTimer=null;const e=performance.now()-this.lastMutationTime;e>=this.settleTimeout?this.completeSettling():this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout-e)}completeSettling(){this.frozen||this.locked||this.disabled||this.pendingNavigation&&(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.onSnapshot(!0))}cancelTimers(){this.debounceTimer!==null&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.settleCheckTimer!==null&&(clearTimeout(this.settleCheckTimer),this.settleCheckTimer=null),this.maxWaitTimer!==null&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=null)}disconnectSettlingObserver(){this.settlingObserver&&(this.settlingObserver.disconnect(),this.settlingObserver=null)}}class hb{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new Bn),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const s={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:$a(l,n.href),index:a}))})),s.styleIds.push(o)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class db{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}const fb="3.4.0-alpha.1";let ne,qe,ti,hs=!1;const gr=[];let Zt;try{if(Array.from([1],r=>r*2)[0]!==2){const r=document.createElement("iframe");document.body.appendChild(r),Array.from=((Kn=r.contentWindow)==null?void 0:Kn.Array.from)||Array.from,document.body.removeChild(r)}}catch(r){console.debug("Unable to override Array.from",r)}const Me=ka();function Ce(r={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:s,checkoutEveryNvm:i,checkoutDebounce:n,blockClass:o="rr-block",blockSelector:l=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,excludeAttribute:u,maskTextClass:h="rr-mask",maskTextSelector:d=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:p,maskInputFn:g,maskTextFn:w,hooks:S,packFn:b,sampling:C={},dataURLOptions:x={},mousemoveWait:M,recordDOM:E=!0,recordCanvas:$=!1,recordCrossOriginIframes:k=!1,recordAfter:L=r.recordAfter==="DOMContentLoaded"?r.recordAfter:"load",flushCustomEvent:_=r.flushCustomEvent!==void 0?r.flushCustomEvent:"after",userTriggeredOnInput:B=!1,collectFonts:W=!1,inlineImages:N=!1,plugins:T,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:U=new Set([]),selector:Q,errorHandler:ce}=r;Ay(ce);const se=k?window.parent===window:!0;let fe=!1;if(!se)try{window.parent.document&&(fe=!1)}catch(P){fe=!0}if(se&&!e)throw new Error("emit function is required");if(!se&&!fe)return()=>{};M!==void 0&&C.mousemove===void 0&&(C.mousemove=M),Me.reset();const Se=u===void 0?/.^/:u,he=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y!==void 0?y:{password:!0},le=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{},lt=vy(Q);Ln();let Xe,$e=0,ft=0,Lt=0,Ie=!1,pe=null,pt=null;const mt=P=>{for(const ve of T||[])ve.eventProcessor&&(P=ve.eventProcessor(P));return b&&!fe&&(P=b(P)),P},vs=()=>{pe=null,Ie=!1,pt=null,be==null||be.cancelPending(),qe(!0),Re.forEach(P=>{P.resetBuffers(),P.unsetFrozen()}),me&&me.unsetFrozen(),be&&be.unsetFrozen()};ne=(P,ve)=>{var K;const ee=P;if(ee.timestamp=Ae(),ee.checkoutId=Lt,(K=Re[0])!=null&&K.isFrozen()&&!Ie&&ee.type!==O.FullSnapshot&&!(ee.type===O.IncrementalSnapshot&&ee.data.source===A.Mutation)&&(Re.forEach(Ee=>Ee.unfreeze()),me==null||me.unfreeze(),be==null||be.unfreeze()),se)e==null||e(mt(ee),ve);else if(fe){const Ee={type:"rrweb",event:mt(ee),isCheckout:ve};window.parent.postMessage(Ee,"*")}if(ee.type===O.FullSnapshot)Xe=ee,$e=0,ft=0;else if(ee.type===O.IncrementalSnapshot){if(ee.data.source===A.Mutation&&ee.data.isAttachIframe)return;if(ee.data.source!==A.Visibility){$e++;const Ee=s&&$e>=s,X=t&&ee.timestamp-Xe.timestamp>t;if(Ee||X)if(n){Ie||(Ie=!0,pt=Ae(),Re.forEach(Qc=>Qc.freeze()),me==null||me.freeze()),pe&&clearTimeout(pe);const Pt=Ae()-pt,Kc=n*3;Pt>=Kc?vs():pe=setTimeout(()=>vs(),n)}else qe(!0)}}};const ws=P=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Mutation},P)})},Xc=P=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Visibility},P)})},Yn=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.Scroll},P)}),Zn=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.CanvasMutation},P)}),Jc=P=>ne({type:O.IncrementalSnapshot,data:R({source:A.AdoptedStyleSheet},P)}),ct=new hb({mutationCb:ws,adoptedStyleSheetCb:Jc}),ut=new Uy({mirror:Me,mutationCb:ws,stylesheetManager:ct,recordCrossOriginIframes:k,wrappedEmit:ne});for(const P of T||[])P.getMirror&&P.getMirror({nodeMirror:Me,crossOriginIframeMirror:ut.crossOriginIframeMirror,crossOriginIframeStyleMirror:ut.crossOriginIframeStyleMirror});const kr=new db;ti=new Ky({recordCanvas:$,mutationCb:Zn,win:window,blockClass:o,blockSelector:l,mirror:Me,sampling:C.canvas,dataURLOptions:x});const Ss=new Vy({mutationCb:ws,scrollCb:Yn,bypassOptions:{blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,inlineStylesheet:f,maskInputOptions:he,dataURLOptions:x,maskTextFn:w,maskInputFn:g,recordCanvas:$,inlineImages:N,sampling:C,slimDOMOptions:le,iframeManager:ut,stylesheetManager:ct,canvasManager:ti,keepIframeSrcFn:D,processedNodeManager:kr,selectorOptions:lt},mirror:Me}),qc=E&&(i!=null||(C==null?void 0:C.visibility)!==void 0&&(C==null?void 0:C.visibility)!==!1);let me;if(qc){const P=typeof(C==null?void 0:C.visibility)=="object"&&(C==null?void 0:C.visibility)!==null?C.visibility:{},ve=P.recordVisibility===!0;me=new ob({doc:document,mirror:Me,sampling:P,mutationCb:ve?Xc:()=>{},notifyActivity:i!=null?K=>{if(ft+=K,ft>=i)if(ft=0,n){Ie||(Ie=!0,pt=Ae(),Re.forEach(X=>X.freeze()),me==null||me.freeze()),pe&&clearTimeout(pe);const ee=Ae()-pt,Ee=n*3;ee>=Ee?vs():pe=setTimeout(()=>vs(),n)}else qe(!0)}:void 0})}qe=(P=!1)=>{if(!E)return;Lt++,ne({type:O.Meta,data:{href:window.location.href,width:kn(),height:$n()}},P),ct.reset(),Ss.init(),Re.forEach(K=>K.lock()),me==null||me.lock(),be==null||be.lock();const ve=Yh(document,{mirror:Me,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,inlineStylesheet:f,maskAllInputs:he,maskTextFn:w,maskInputFn:g,slimDOM:le,dataURLOptions:x,recordCanvas:$,inlineImages:N,onSerialize:K=>{At(K,Me)&&ut.addIframe(K),Fn(K,Me)&&ct.trackLinkElement(K),tt(K)&&Ss.addShadowRoot(V.shadowRoot(K),document)},onIframeLoad:(K,ee)=>{ut.attachIframe(K,ee),Ss.observeAttachShadow(K)},onStylesheetLoad:(K,ee)=>{ct.attachLinkElement(K,ee)},keepIframeSrcFn:D,selector:Q});if(!ve)return console.warn("Failed to snapshot the document");ne({type:O.FullSnapshot,data:{node:ve,initialOffset:Dn(window)}},P),Re.forEach(K=>K.unlock()),me==null||me.unlock(),be==null||be.unlock(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,Me.getId(document))},Zt=()=>{for(const P of gr)ne(P);gr.length=0};let be;const _r=C.navigation;if(_r!==!1){const P=typeof _r=="object"?_r:{};be=new ub({doc:document,config:P,onSnapshot:ve=>{Ie&&(pe&&(clearTimeout(pe),pe=null),Ie=!1,pt=null,Re.forEach(K=>{K.resetBuffers(),K.unsetFrozen()}),me==null||me.unsetFrozen()),qe(ve)}})}try{const P=[],ve=ee=>{var Ee;return G(Wy)({mutationCb:ws,mousemoveCb:(X,Pt)=>ne({type:O.IncrementalSnapshot,data:{source:Pt,positions:X}}),mouseInteractionCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.MouseInteraction},X)}),scrollCb:Yn,viewportResizeCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.ViewportResize},X)}),navigationCb:X=>{be?be.handleNavigation(X):qe(!0)},inputCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.Input},X)}),mediaInteractionCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.MediaInteraction},X)}),styleSheetRuleCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.StyleSheetRule},X)}),styleDeclarationCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.StyleDeclaration},X)}),canvasMutationCb:Zn,visibilityManager:me,fontCb:X=>ne({type:O.IncrementalSnapshot,data:R({source:A.Font},X)}),selectionCb:X=>{ne({type:O.IncrementalSnapshot,data:R({source:A.Selection},X)})},customElementCb:X=>{ne({type:O.IncrementalSnapshot,data:R({source:A.CustomElement},X)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskTextClass:h,maskTextSelector:d,excludeAttribute:Se,maskInputOptions:he,inlineStylesheet:f,sampling:C,recordDOM:E,recordCanvas:$,inlineImages:N,userTriggeredOnInput:B,collectFonts:W,doc:ee,maskInputFn:g,maskTextFn:w,keepIframeSrcFn:D,blockSelector:l,slimDOMOptions:le,dataURLOptions:x,selectorOptions:lt,mirror:Me,iframeManager:ut,stylesheetManager:ct,shadowDomManager:Ss,processedNodeManager:kr,canvasManager:ti,ignoreCSSAttributes:U,plugins:((Ee=T==null?void 0:T.filter(X=>X.observer))==null?void 0:Ee.map(X=>({observer:X.observer,options:X.options,callback:Pt=>ne({type:O.Plugin,data:{plugin:X.name,payload:Pt}})})))||[]},S)};ut.addLoadListener(ee=>{try{P.push(ve(ee.contentDocument))}catch(Ee){console.warn(Ee)}});const K=()=>{_==="before"&&Zt(),qe(),P.push(ve(document)),hs=!0,_==="after"&&Zt()};return document.readyState==="interactive"||document.readyState==="complete"?K():(P.push(ue("DOMContentLoaded",()=>{ne({type:O.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&K()})),P.push(ue("load",()=>{ne({type:O.Load,data:{}}),L==="load"&&K()},window))),()=>{pe&&(clearTimeout(pe),pe=null),Zt(),P.forEach(ee=>ee()),be==null||be.destroy(),kr.destroy(),hs=!1,Iy()}}catch(P){console.warn(P)}}Ce.getVersion=()=>fb;Ce.isRecording=()=>hs;Ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${gr.length} events`),Zt()};Ce.addCustomEvent=(r,e)=>{const t={type:O.Custom,data:{tag:r,payload:e}};if(!hs){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${r}`),gr.push(t);return}ne(t)};Ce.freezePage=()=>{Re.forEach(r=>r.freeze())};Ce.takeFullSnapshot=r=>{if(!hs)throw new Error("please take full snapshot after start recording");qe(r)};Ce.mirror=Me;function Pc(r){return{all:r=r||new Map,on:function(e,t){var s=r.get(e);s?s.push(t):r.set(e,[t])},off:function(e,t){var s=r.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):r.set(e,[]))},emit:function(e,t){var s=r.get(e);s&&s.slice().map(function(i){i(t)}),(s=r.get("*"))&&s.slice().map(function(i){i(e,t)})}}}const pb=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"}));function mb(r=window,e=document){if("scrollBehavior"in e.documentElement.style&&r.__forceSmoothScrollPolyfill__!==!0)return;const t=r.HTMLElement||r.Element,s=468,i={scroll:r.scroll||r.scrollTo,scrollBy:r.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},n=r.performance&&r.performance.now?r.performance.now.bind(r.performance):Date.now;function o(g){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(g)}const l=o(r.navigator.userAgent)?1:0;function a(g,w){this.scrollLeft=g,this.scrollTop=w}function c(g){return .5*(1-Math.cos(Math.PI*g))}function u(g){if(g===null||typeof g!="object"||g.behavior===void 0||g.behavior==="auto"||g.behavior==="instant")return!0;if(typeof g=="object"&&g.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+g.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(g,w){if(w==="Y")return g.clientHeight+l<g.scrollHeight;if(w==="X")return g.clientWidth+l<g.scrollWidth}function d(g,w){const S=r.getComputedStyle(g,null)["overflow"+w];return S==="auto"||S==="scroll"}function f(g){const w=h(g,"Y")&&d(g,"Y"),S=h(g,"X")&&d(g,"X");return w||S}function m(g){for(;g!==e.body&&f(g)===!1;)g=g.parentNode||g.host;return g}function y(g){const w=n();let S,b,C,x=(w-g.startTime)/s;x=x>1?1:x,S=c(x),b=g.startX+(g.x-g.startX)*S,C=g.startY+(g.y-g.startY)*S,g.method.call(g.scrollable,b,C),(b!==g.x||C!==g.y)&&r.requestAnimationFrame(y.bind(r,g))}function p(g,w,S){let b,C,x,M;const E=n();g===e.body?(b=r,C=r.scrollX||r.pageXOffset,x=r.scrollY||r.pageYOffset,M=i.scroll):(b=g,C=g.scrollLeft,x=g.scrollTop,M=a),y({scrollable:b,method:M,startTime:E,startX:C,startY:x,x:w,y:S})}r.scroll=r.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:r.scrollY||r.pageYOffset);return}p.call(r,e.body,arguments[0].left!==void 0?~~arguments[0].left:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:r.scrollY||r.pageYOffset)}},r.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(r,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(r,e.body,~~arguments[0].left+(r.scrollX||r.pageXOffset),~~arguments[0].top+(r.scrollY||r.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.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 g=arguments[0].left,w=arguments[0].top;p.call(this,this,typeof g=="undefined"?this.scrollLeft:~~g,typeof w=="undefined"?this.scrollTop:~~w)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const g=m(this),w=g.getBoundingClientRect(),S=this.getBoundingClientRect();g!==e.body?(p.call(this,g,g.scrollLeft+S.left-w.left,g.scrollTop+S.top-w.top),r.getComputedStyle(g).position!=="fixed"&&r.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):r.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class gb{constructor(e=[],t){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(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 s=this.findActionIndex(e);this.actions.splice(s,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,s=this.actions.length-1;for(;t<=s;){const i=Math.floor((t+s)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)s=i-1;else return i+1}return t}}function wa(r,e){if(r.type===O.IncrementalSnapshot&&r.data.source===A.MouseMove&&r.data.positions&&r.data.positions.length){const t=r.data.positions[0].timeOffset,s=r.timestamp+t;return r.delay=s-e,s-e}return r.delay=r.timestamp-e,r.delay}/*! *****************************************************************************
|
|
80
80
|
Copyright (c) Microsoft Corporation.
|
|
81
81
|
|
|
82
82
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -89,7 +89,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
89
89
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
90
90
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
91
91
|
PERFORMANCE OF THIS SOFTWARE.
|
|
92
|
-
***************************************************************************** */function Sa(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var s,i,n=t.call(r),o=[];try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(l){i={error:l}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}var Mt;(function(r){r[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped"})(Mt||(Mt={}));var Fc={type:"xstate.init"};function si(r){return r===void 0?[]:[].concat(r)}function wt(r){return{type:"xstate.assign",assignment:r}}function Ca(r,e){return typeof(r=typeof r=="string"&&e&&e[r]?e[r]:r)=="string"?{type:r}:typeof r=="function"?{type:r.name,exec:r}:r}function yr(r){return function(e){return r===e}}function zc(r){return typeof r=="string"?{type:r}:r}function xa(r,e){return{value:r,context:e,actions:[],changed:!1,matches:yr(r)}}function Ea(r,e,t){var s=e,i=!1;return[r.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},s);return typeof n.assignment=="function"?o=n.assignment(s,t):Object.keys(n.assignment).forEach(function(l){o[l]=typeof n.assignment[l]=="function"?n.assignment[l](s,t):n.assignment[l]}),s=o,!1}return!0}),s,i]}function Bc(r,e){e===void 0&&(e={});var t=Sa(Ea(si(r.states[r.initial].entry).map(function(o){return Ca(o,e.actions)}),r.context,Fc),2),s=t[0],i=t[1],n={config:r,_options:e,initialState:{value:r.initial,actions:s,context:i,matches:yr(r.initial)},transition:function(o,l){var a,c,u=typeof o=="string"?{value:o,context:r.context}:o,h=u.value,d=u.context,f=zc(l),m=r.states[h];if(m.on){var y=si(m.on[f.type]);try{for(var p=function(D){var U=typeof Symbol=="function"&&Symbol.iterator,Q=U&&D[U],ce=0;if(Q)return Q.call(D);if(D&&typeof D.length=="number")return{next:function(){return D&&ce>=D.length&&(D=void 0),{value:D&&D[ce++],done:!D}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),g=p.next();!g.done;g=p.next()){var w=g.value;if(w===void 0)return xa(h,d);var S=typeof w=="string"?{target:w}:w,b=S.target,C=S.actions,x=C===void 0?[]:C,M=S.cond,E=M===void 0?function(){return!0}:M,$=b===void 0,k=b!=null?b:h,L=r.states[k];if(E(d,f)){var _=Sa(Ea(($?si(x):[].concat(m.exit,x,L.entry).filter(function(D){return D})).map(function(D){return Ca(D,n._options.actions)}),d,f),3),B=_[0],W=_[1],N=_[2],T=b!=null?b:h;return{value:T,context:W,actions:B,changed:b!==h||B.length>0||N,matches:yr(T)}}}}catch(D){a={error:D}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(a)throw a.error}}}return xa(h,d)}};return n}var Ma=function(r,e){return r.actions.forEach(function(t){var s=t.exec;return s&&s(r.context,e)})};function Wc(r){var e=r.initialState,t=Mt.NotStarted,s=new Set,i={_machine:r,send:function(n){t===Mt.Running&&(e=r.transition(e,n),Ma(e,zc(n)),s.forEach(function(o){return o(e)}))},subscribe:function(n){return s.add(n),n(e),{unsubscribe:function(){return s.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:r.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:yr(o.value)}}return t=Mt.Running,Ma(e,Fc),i},stop:function(){return t=Mt.Stopped,s.clear(),i},get state(){return e},get status(){return t}};return i}function yb(r,e){for(let t=r.length-1;t>=0;t--){const s=r[t];if(s.type===O.Meta&&s.timestamp<=e)return r.slice(t)}return r}function bb(r,{getCastFn:e,applyEventsSynchronously:t,emitter:s}){const i=Bc({id:"player",context:r,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:wt({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:wt((n,o)=>{let l=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),ae(R({},n),{timeOffset:l,baselineTime:n.events[0].timestamp+l})}),play(n){var o;const{timer:l,events:a,baselineTime:c,lastPlayedEvent:u}=n;l.clear();for(const m of a)wa(m,c);const h=yb(a,c);let d=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===O.IncrementalSnapshot&&u.data.source===A.MouseMove&&(d=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&s.emit(Y.PlayBack);const f=new Array;for(const m of h)if(!(d&&d<c&&(m.timestamp<=d||m===u)))if(m.timestamp<=c)f.push(m);else{const y=e(m,!1);l.addAction({doAction:()=>{y()},delay:m.delay})}t(f),s.emit(Y.Flush),l.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:wt(n=>ae(R({},n),{lastPlayedEvent:null})),startLive:wt({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:wt((n,o)=>{const{baselineTime:l,timer:a,events:c}=n;if(o.type==="ADD_EVENT"){const{event:u}=o.payload;wa(u,l);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let m=-1,y=0;for(;y<=h;){const p=Math.floor((y+h)/2);c[p].timestamp<=u.timestamp?y=p+1:h=p-1}m===-1&&(m=y),c.splice(m,0,u)}const d=u.timestamp<l,f=e(u,d);d?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:u.delay})}return ae(R({},n),{events:c})})}});return Wc(i)}function vb(r){const e=Bc({id:"speed",context:r,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,s)=>{"payload"in s&&t.timer.setSpeed(s.payload.speed)},recordSpeed:wt({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Wc(e)}const wb=r=>[`.${r} { background: currentColor }`,"noscript { display: none !important; }"],Aa=new Map;function Uc(r,e){let t=Aa.get(r);return t||(t=new Map,Aa.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}function rt(r,e,t){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(t&&(t.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){const i=await rt(r,e,t)(s.args);return await createImageBitmap.apply(null,i)}else if("index"in s){if(t||e===null)return s;const{rr_type:i,index:n}=s;return Uc(e,i)[n]}else if("args"in s){const{rr_type:i,args:n}=s,o=window[i];return new o(...await Promise.all(n.map(rt(r,e,t))))}else{if("base64"in s)return Gy(s.base64);if("src"in s){const i=r.get(s.src);if(i)return i;{const n=new Image;return n.src=s.src,r.set(s.src,n),n}}else if("data"in s&&s.rr_type==="Blob"){const i=await Promise.all(s.data.map(rt(r,e,t)));return new Blob(i,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(rt(r,e,t)));return s}}function Sb(r,e){try{return e===Ze.WebGL?r.getContext("webgl")||r.getContext("experimental-webgl"):r.getContext("webgl2")}catch(t){return null}}const Cb=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function xb(r,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Cb.includes(t))return;const s=Uc(r,t);s.includes(e)||s.push(e)}async function Eb({mutation:r,target:e,type:t,imageMap:s,errorHandler:i}){try{const n=Sb(e,t);if(!n)return;if(r.setter){n[r.property]=r.args[0];return}const o=n[r.property],l=await Promise.all(r.args.map(rt(s,n))),a=o.apply(n,l);xb(n,a);const c=!1}catch(n){i(r,n)}}async function Mb({event:r,mutations:e,target:t,imageMap:s,errorHandler:i}){const n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}const o=e.map(async a=>Promise.all(a.args.map(rt(s,n))));(await Promise.all(o)).forEach((a,c)=>{const u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}const h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(s.get(r),h.apply(n,u.args)):h.apply(n,a)}catch(h){i(u,h)}})}async function Gi({event:r,mutation:e,target:t,imageMap:s,canvasEventMap:i,errorHandler:n}){try{const o=i.get(r)||e,l="commands"in o?o.commands:[o];if([Ze.WebGL,Ze.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const c=l[a];await Eb({mutation:c,type:e.type,target:t,imageMap:s,errorHandler:n})}return}await Mb({event:r,mutations:l,target:t,imageMap:s,errorHandler:n})}catch(o){n(e,o)}}class Ab{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(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(Y.Start,this.start.bind(this)),this.emitter.on(Y.SkipStart,this.start.bind(this)),this.emitter.on(Y.Pause,this.pause.bind(this)),this.emitter.on(Y.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,s)=>{this.syncTargetWithState(s),e.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:s}){if(s.isPlaying){const n=(e-s.lastInteractionTimeOffset)/1e3*s.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let l=s.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(l=l%o),t.currentTime=l}else t.pause(),t.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const s=this.mediaMap.get(e);s&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:s}){var f,m,y,p,g;const i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:l,muted:a,volume:c,loop:u}=s;return{isPlaying:n===Qe.Play||n!==Qe.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=l!=null?l:i==null?void 0:i.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:t,playbackRate:(m=o!=null?o:i==null?void 0:i.playbackRate)!=null?m:1,volume:(y=c!=null?c:i==null?void 0:i.volume)!=null?y:1,muted:(p=a!=null?a:i==null?void 0:i.muted)!=null?p:e.getAttribute("muted")===null,loop:(g=u!=null?u:i==null?void 0:i.loop)!=null?g:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:s,loop:i,volume:n,isPlaying:o}=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!==n&&(e.volume=n),e.muted=s,e.loop=i,e.playbackRate!==a&&(e.playbackRate=a),o&&!l?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,s){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,n=s.getMeta(i);if(!n||!("attributes"in n))return;const o=this.service.state.matches("paused"),l=n.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=i.getAttribute("autoplay")!==null,a&&o&&i.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let u=!1;typeof l.rr_mediaMuted=="boolean"?u=l.rr_mediaMuted:u=i.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=i.getAttribute("loop")!==null;let d=1;typeof l.rr_mediaVolume=="number"&&(d=l.rr_mediaVolume);let f=0;typeof l.rr_mediaCurrentTime=="number"&&(f=l.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:a,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:u,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:s}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:s})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Ys(r,e){if(r.nodeName!=="DIALOG"||r instanceof De)return;const t=r,s=t.open,i=s&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=n==="modal";if(!(s&&!(i&&n==="non-modal"||!i&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}s&&t.close(),o&&(l?t.showModal():t.show())}}function Ib(r,e){if(r.nodeName!=="DIALOG"||r instanceof De)return;const t=r;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 Nb=5*1e3,Rb=Pc||pb,Ia="[replayer]",ri={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Na(r){return r.type==O.IncrementalSnapshot&&(r.data.source==A.TouchMove||r.data.source==A.MouseInteraction&&r.data.type==Z.TouchStart)}class Tb{constructor(e,t){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new _t),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Rb()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",Do()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",ka()),v(this,"styleMirror",new Bn),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(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)))}),v(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case O.DomContentLoaded:case O.Load:case O.Custom:continue;case O.FullSnapshot:case O.Meta:case O.Plugin:case O.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),v(this,"getCastFn",(l,a=!1)=>{let c;switch(l.type){case O.DomContentLoaded:case O.Load:break;case O.Custom:c=()=>{this.emitter.emit(Y.CustomEvent,l)};break;case O.Meta:c=()=>this.emitter.emit(Y.Resize,{width:l.data.width,height:l.data.height});break;case O.FullSnapshot:c=()=>{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 O.IncrementalSnapshot:c=()=>{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,d={speed:Math.min(Math.round(h/Nb),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(Y.SkipStart,d)}}};break}return()=>{c&&c();for(const d of this.config.plugins||[])d.handler&&d.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 d=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};let f=50;l.type===O.IncrementalSnapshot&&l.data.source===A.MouseMove&&l.data.positions.length&&(f+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(d,f)}this.emitter.emit(Y.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const s={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:ri,useVirtualDom:!0,logger:console};this.config=Object.assign({},s,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,c,u)=>{Gi({event:a,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===A.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===A.StyleDeclaration&&this.applyStyleDeclaration(a,c)},afterAppend:(a,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{dr(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 c=this.legacy_missingNodeRetryMap[a],u=fr(c.node,this.mirror,this.virtualDom.mirror);dr(u,c.node,l,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}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(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new gb([],{speed:this.config.speed});this.service=bb({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:i,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(Y.StateChange,{player:l})}),this.speedService=vb({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(Y.StateChange,{speed:l})}),this.mediaManager=new Ab({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(l=>l.type===O.Meta),o=this.service.state.context.events.find(l=>l.type===O.FullSnapshot);if(n){const{width:l,height:a}=n.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:l,height:a})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Na)&&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,s;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}})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start)}pause(e){var t,s;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit(Y.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(Y.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Y.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Na(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=Do()}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","allow-scripts"];this.config.UNSAFE_replayCanvas,this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(mb(this.iframe.contentWindow,this.iframe.contentDocument),Ln(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 s=[],i=new Set,n=(a,c)=>{if(a.nodeName==="DIALOG"&&i.add(a),this.collectIframeAndAttachDocument(s,a),this.mediaManager.isSupportedMediaElement(a)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Yf(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:c}of s)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);const{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),i.forEach(a=>Ys(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var s;const i=wb(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,yc(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:A.StyleSheetRule,adds:i.map((o,l)=>({rule:o,index:l}))})}else{const n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(s=n.sheet)==null||s.insertRule(i[o],o)}}attachDocumentToIframe(e,t){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(l,a)=>{l.nodeName==="DIALOG"&&n.add(l),this.collectIframeAndAttachDocument(i,l);const c=s.getMeta(l);if((c==null?void 0:c.type)===He.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:a,replayer:this})};Kt(e.node,{doc:t.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of i)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);n.forEach(l=>Ys(l))}collectIframeAndAttachDocument(e,t){if(At(t,this.mirror)){const s=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));s&&e.push({mutationInQueue:s,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const s=new Set;let i,n=this.service.state;const o=()=>{n=this.service.state};this.emitter.on(Y.Start,o),this.emitter.on(Y.Pause,o);const l=()=>{this.emitter.off(Y.Start,o),this.emitter.off(Y.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(s.add(a),a.addEventListener("load",()=>{s.delete(a),s.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===O.IncrementalSnapshot&&t.data.source===A.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const s=document.createElement("canvas"),i=s.getContext("2d"),n=i==null?void 0:i.createImageData(s.width,s.height);i==null||i.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const s={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async n=>{const o=await Promise.all(n.args.map(rt(this.imageMap,null,s)));return ae(R({},n),{args:o})}));s.isUnchanged===!1&&this.canvasEventMap.set(t,ae(R({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(rt(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(t,ae(R({},e),{args:i}))}}}applyIncremental(e,t){var s,i,n;const{data:o}=e;switch(o.source){case A.Mutation:{try{this.applyMutation(o,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(t){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,o)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((s=o.positions[0])==null?void 0:s.timeOffset)});break;case A.MouseInteraction:{if(o.id===-1)break;const l=new Event(it(Z[o.type])),a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);this.emitter.emit(Y.MouseInteraction,{type:o.type,target:a});const{triggerFocus:c}=this.config;switch(o.type){case Z.Blur:"blur"in a&&a.blur();break;case Z.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case Z.Click:case Z.TouchStart:case Z.TouchEnd:case Z.MouseDown:case Z.MouseUp:t?(o.type===Z.TouchStart?this.touchActive=!0:o.type===Z.TouchEnd&&(this.touchActive=!1),o.type===Z.MouseDown?this.lastMouseDownEvent=[a,l]:o.type===Z.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===Z.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===Z.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===Z.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===Z.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case Z.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case A.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,t);break}case A.ViewportResize:this.emitter.emit(Y.Resize,{width:o.width,height:o.height});break;case A.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case A.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const a=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case A.StyleSheetRule:case A.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:e,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Gi({event:e,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(l)}catch(l){this.warn(l)}break}case A.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case A.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}case A.Visibility:{const{mutations:l}=o;for(const a of l){const c=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);c&&c instanceof Element&&(c.style.visibility=a.isVisible?"visible":"hidden")}break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,pg(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=gc(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return;let d=s.getNode(c.parentId);if(!d)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&tt(d)&&(d=d.shadowRoot),s.removeNodeFromMap(h),d)try{d.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",d,h,e);else throw f}});const i=R({},this.legacy_missingNodeRetryMap),n=[],o=c=>{let u=null;return c.nextId&&(u=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},l=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=s.getNode(c.parentId);if(!d)return c.node.type===He.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(tt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const y=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(At(d,s)){this.attachDocumentToIframe(c,d);return}const p=(S,b)=>{if(!this.usingVirtualDom){Ys(S);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(S,{id:b,replayer:this})}},g=Kt(c.node,{doc:y,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:g,mutation:c};return}const w=s.getMeta(d);if(w&&w.type===He.Element&&c.node.type===He.Text){const S=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(w.tagName==="textarea")for(const b of S)b.nodeType===d.TEXT_NODE&&d.removeChild(b);else if(w.tagName==="style"&&S.length===1)for(const b of S)b.nodeType===d.TEXT_NODE&&!s.hasNode(b)&&(g.textContent=b.textContent,d.removeChild(b))}else if((w==null?void 0:w.type)===He.Document){const S=d;c.node.type===He.DocumentType&&((u=S.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&S.removeChild(S.childNodes[0]),g.nodeName==="HTML"&&S.documentElement&&S.removeChild(S.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?d.insertBefore(g,f.nextSibling):m&&m.parentNode?d.contains(m)?d.insertBefore(g,m):d.insertBefore(g,null):d.appendChild(g),p(g,c.node.id),this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[]),At(g,this.mirror)){const S=this.mirror.getId(g),b=this.newDocumentQueue.find(C=>C.parentId===S);b&&(this.attachDocumentToIframe(b,g),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,d,g,c)};e.adds.forEach(c=>{l(c)});const a=Date.now();for(;n.length;){const c=wc(n);if(n.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)s.getNode(u.value.parentId)?Pn(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Sc(e.texts).forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);const d=h.parentElement;if(c.value&&d&&d.tagName==="STYLE"?h.textContent=xr(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){const f=h.parentNode;((u=f==null?void 0:f.rules)==null?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)h.removeAttribute(d),d==="open"&&Ib(h,c);else if(typeof f=="string")try{if(d==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const m=s.getMeta(h),y=Kt(ae(R({},m),{attributes:R(R({},m.attributes),c.attributes)}),{doc:h.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const p=h.nextSibling,g=h.parentNode;if(y&&g){g.removeChild(h),g.insertBefore(y,p),s.replace(c.id,y);break}}catch(m){}if(d==="value"&&h.nodeName==="TEXTAREA"){const m=h;m.childNodes.forEach(p=>m.removeChild(p));const y=(u=h.ownerDocument)==null?void 0:u.createTextNode(f);y&&m.appendChild(y)}else h.setAttribute(d,f);d==="rr_open_mode"&&h.nodeName==="DIALOG"&&Ys(h,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=f,y=h;for(const p in m)if(m[p]===!1)y.style.removeProperty(p);else if(m[p]instanceof Array){const g=m[p];y.style.setProperty(p,g[0],g[1])}else{const g=m[p];y.style.setProperty(p,g)}}}})}applyScroll(e,t){var s,i;const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===He.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.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(s){}}applySelection(e){try{const t=new Set,s=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:l})=>{const a=this.mirror.getNode(i),c=this.mirror.getNode(o);if(!a||!c)return;const u=new Range;u.setStart(a,n),u.setEnd(c,l);const h=a.ownerDocument,d=h==null?void 0:h.getSelection();return d&&t.add(d),{range:u,selection:d}});t.forEach(i=>i.removeAllRanges()),s.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let s=null;e.styleId?s=this.styleMirror.getStyle(e.styleId):e.id&&(s=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),s&&(e.source===A.StyleSheetRule?this.applyStyleSheetRule(e,s):e.source===A.StyleDeclaration&&this.applyStyleDeclaration(e,s))}applyStyleSheetRule(e,t){var s,i,n,o;if((s=e.adds)==null||s.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:c,index:u}=Ui(a);xt(t.cssRules,c).insertRule(l,u)}else{const c=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,c)}}catch(c){}}),(i=e.removes)==null||i.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:c}=Ui(l);xt(t.cssRules,a).deleteRule(c||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&xt(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&xt(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const s=this.mirror.getNode(e.id);if(!s)return;(t=e.styles)==null||t.forEach(l=>{var a;let c=null,u=null;if(tt(s)?u=((a=s.ownerDocument)==null?void 0:a.defaultView)||null:s.nodeName==="#document"&&(u=s.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:A.StyleSheetRule,adds:l.rules},c)}catch(h){}});const i=10;let n=0;const o=(l,a)=>{const c=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);tt(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&n<i&&(setTimeout(()=>o(l,a),0+100*n),n++)};o(s,e.styleIds)}legacy_resolveMissingNode(e,t,s,i){const{previousId:n,nextId:o}=i,l=n&&e[n],a=o&&e[o];if(l){const{node:c,mutation:u}=l;t.insertBefore(c,s),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(a){const{node:c,mutation:u}=a;t.insertBefore(c,s.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,s,i,n){const o=this.mirror.getNode(s);if(!o)return this.debugNodeNotFound(n,s);const l=zn(o,this.iframe),a=e*l.absoluteScale+l.x,c=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:a,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:s,strokeStyle:i,duration:n}=this.config.mouseTail===!0?ri:Object.assign({},ri,this.config.mouseTail),o=()=>{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=s,l.lineCap=t,l.strokeStyle=i,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),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let s=e;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(e){return e.type!==O.IncrementalSnapshot?!1:e.data.source>A.Mutation&&e.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.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(Ia,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Ia,...e)}}const Ob="3.3.0-alpha.1",{getVersion:Db}=Ce,{isRecording:$b}=Ce,{flushCustomEventQueue:kb}=Ce,{addCustomEvent:_b}=Ce,{freezePage:Lb}=Ce,{takeFullSnapshot:Pb}=Ce;var ye=Uint8Array,we=Uint16Array,ds=Uint32Array,Dr=new ye([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]),$r=new ye([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]),ji=new ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vc=function(r,e){for(var t=new we(31),s=0;s<31;++s)t[s]=e+=1<<r[s-1];for(var i=new ds(t[30]),s=1;s<30;++s)for(var n=t[s];n<t[s+1];++n)i[n]=n-t[s]<<5|s;return[t,i]},Hc=Vc(Dr,2),Gc=Hc[0],Yi=Hc[1];Gc[28]=258,Yi[258]=28;var jc=Vc($r,0),Fb=jc[0],Ra=jc[1],Zi=new we(32768);for(var re=0;re<32768;++re){var Je=(re&43690)>>>1|(re&21845)<<1;Je=(Je&52428)>>>2|(Je&13107)<<2,Je=(Je&61680)>>>4|(Je&3855)<<4,Zi[re]=((Je&65280)>>>8|(Je&255)<<8)>>>1}var ze=function(r,e,t){for(var s=r.length,i=0,n=new we(e);i<s;++i)++n[r[i]-1];var o=new we(e);for(i=0;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;var l;if(t){l=new we(1<<e);var a=15-e;for(i=0;i<s;++i)if(r[i])for(var c=i<<4|r[i],u=e-r[i],h=o[r[i]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)l[Zi[h]>>>a]=c}else for(l=new we(s),i=0;i<s;++i)l[i]=Zi[o[r[i]-1]++]>>>15-r[i];return l},nt=new ye(288);for(var re=0;re<144;++re)nt[re]=8;for(var re=144;re<256;++re)nt[re]=9;for(var re=256;re<280;++re)nt[re]=7;for(var re=280;re<288;++re)nt[re]=8;var fs=new ye(32);for(var re=0;re<32;++re)fs[re]=5;var zb=ze(nt,9,0),Bb=ze(nt,9,1),Wb=ze(fs,5,0),Ub=ze(fs,5,1),ii=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},Ne=function(r,e,t){var s=e/8>>0;return(r[s]|r[s+1]<<8)>>>(e&7)&t},ni=function(r,e){var t=e/8>>0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>>(e&7)},Gn=function(r){return(r/8>>0)+(r&7&&1)},jn=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var s=new(r instanceof we?we:r instanceof ds?ds:ye)(t-e);return s.set(r.subarray(e,t)),s},Vb=function(r,e,t){var s=r.length,i=!e||t,n=!t||t.i;t||(t={}),e||(e=new ye(s*3));var o=function(lt){var Xe=e.length;if(lt>Xe){var $e=new ye(Math.max(Xe*2,lt));$e.set(e),e=$e}},l=t.f||0,a=t.p||0,c=t.b||0,u=t.l,h=t.d,d=t.m,f=t.n,m=s*8;do{if(!u){t.f=l=Ne(r,a,1);var y=Ne(r,a+1,3);if(a+=3,y)if(y==1)u=Bb,h=Ub,d=9,f=5;else if(y==2){var S=Ne(r,a,31)+257,b=Ne(r,a+10,15)+4,C=S+Ne(r,a+5,31)+1;a+=14;for(var x=new ye(C),M=new ye(19),E=0;E<b;++E)M[ji[E]]=Ne(r,a+E*3,7);a+=b*3;var $=ii(M),k=(1<<$)-1;if(!n&&a+C*($+7)>m)break;for(var L=ze(M,$,1),E=0;E<C;){var _=L[Ne(r,a,k)];a+=_&15;var p=_>>>4;if(p<16)x[E++]=p;else{var B=0,W=0;for(p==16?(W=3+Ne(r,a,3),a+=2,B=x[E-1]):p==17?(W=3+Ne(r,a,7),a+=3):p==18&&(W=11+Ne(r,a,127),a+=7);W--;)x[E++]=B}}var N=x.subarray(0,S),T=x.subarray(S);d=ii(N),f=ii(T),u=ze(N,d,1),h=ze(T,f,1)}else throw"invalid block type";else{var p=Gn(a)+4,g=r[p-4]|r[p-3]<<8,w=p+g;if(w>s){if(n)throw"unexpected EOF";break}i&&o(c+g),e.set(r.subarray(p,w),c),t.b=c+=g,t.p=a=w*8;continue}if(a>m)throw"unexpected EOF"}i&&o(c+131072);for(var D=(1<<d)-1,U=(1<<f)-1,Q=d+f+18;n||a+Q<m;){var B=u[ni(r,a)&D],ce=B>>>4;if(a+=B&15,a>m)throw"unexpected EOF";if(!B)throw"invalid length/literal";if(ce<256)e[c++]=ce;else if(ce==256){u=null;break}else{var se=ce-254;if(ce>264){var E=ce-257,fe=Dr[E];se=Ne(r,a,(1<<fe)-1)+Gc[E],a+=fe}var Se=h[ni(r,a)&U],he=Se>>>4;if(!Se)throw"invalid distance";a+=Se&15;var T=Fb[he];if(he>3){var fe=$r[he];T+=ni(r,a)&(1<<fe)-1,a+=fe}if(a>m)throw"unexpected EOF";i&&o(c+131072);for(var le=c+se;c<le;c+=4)e[c]=e[c-T],e[c+1]=e[c+1-T],e[c+2]=e[c+2-T],e[c+3]=e[c+3-T];c=le}}t.l=u,t.p=a,t.b=c,u&&(l=1,t.m=d,t.d=h,t.n=f)}while(!l);return c==e.length?e:jn(e,0,c)},Ue=function(r,e,t){t<<=e&7;var s=e/8>>0;r[s]|=t,r[s+1]|=t>>>8},Gt=function(r,e,t){t<<=e&7;var s=e/8>>0;r[s]|=t,r[s+1]|=t>>>8,r[s+2]|=t>>>16},oi=function(r,e){for(var t=[],s=0;s<r.length;++s)r[s]&&t.push({s,f:r[s]});var i=t.length,n=t.slice();if(!i)return[new ye(0),0];if(i==1){var o=new ye(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(C,x){return C.f-x.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,u=1,h=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};u!=i-1;)l=t[t[c].f<t[h].f?c++:h++],a=t[c!=u&&t[c].f<t[h].f?c++:h++],t[u++]={s:-1,f:l.f+a.f,l,r:a};for(var d=n[0].s,s=1;s<i;++s)n[s].s>d&&(d=n[s].s);var f=new we(d+1),m=Xi(t[u-1],f,0);if(m>e){var s=0,y=0,p=m-e,g=1<<p;for(n.sort(function(x,M){return f[M.s]-f[x.s]||x.f-M.f});s<i;++s){var w=n[s].s;if(f[w]>e)y+=g-(1<<m-f[w]),f[w]=e;else break}for(y>>>=p;y>0;){var S=n[s].s;f[S]<e?y-=1<<e-f[S]++-1:++s}for(;s>=0&&y;--s){var b=n[s].s;f[b]==e&&(--f[b],++y)}m=e}return[new ye(f),m]},Xi=function(r,e,t){return r.s==-1?Math.max(Xi(r.l,e,t+1),Xi(r.r,e,t+1)):e[r.s]=t},Ta=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new we(++e),s=0,i=r[0],n=1,o=function(a){t[s++]=a},l=1;l<=e;++l)if(r[l]==i&&l!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=r[l]}return[t.subarray(0,s),e]},jt=function(r,e){for(var t=0,s=0;s<e.length;++s)t+=r[s]*e[s];return t},Ji=function(r,e,t){var s=t.length,i=Gn(e+2);r[i]=s&255,r[i+1]=s>>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var n=0;n<s;++n)r[i+n+4]=t[n];return(i+4+s)*8},Oa=function(r,e,t,s,i,n,o,l,a,c,u){Ue(e,u++,t),++i[256];for(var h=oi(i,15),d=h[0],f=h[1],m=oi(n,15),y=m[0],p=m[1],g=Ta(d),w=g[0],S=g[1],b=Ta(y),C=b[0],x=b[1],M=new we(19),E=0;E<w.length;++E)M[w[E]&31]++;for(var E=0;E<C.length;++E)M[C[E]&31]++;for(var $=oi(M,7),k=$[0],L=$[1],_=19;_>4&&!k[ji[_-1]];--_);var B=c+5<<3,W=jt(i,nt)+jt(n,fs)+o,N=jt(i,d)+jt(n,y)+o+14+3*_+jt(M,k)+(2*M[16]+3*M[17]+7*M[18]);if(B<=W&&B<=N)return Ji(e,u,r.subarray(a,a+c));var T,D,U,Q;if(Ue(e,u,1+(N<W)),u+=2,N<W){T=ze(d,f,0),D=d,U=ze(y,p,0),Q=y;var ce=ze(k,L,0);Ue(e,u,S-257),Ue(e,u+5,x-1),Ue(e,u+10,_-4),u+=14;for(var E=0;E<_;++E)Ue(e,u+3*E,k[ji[E]]);u+=3*_;for(var se=[w,C],fe=0;fe<2;++fe)for(var Se=se[fe],E=0;E<Se.length;++E){var he=Se[E]&31;Ue(e,u,ce[he]),u+=k[he],he>15&&(Ue(e,u,Se[E]>>>5&127),u+=Se[E]>>>12)}}else T=zb,D=nt,U=Wb,Q=fs;for(var E=0;E<l;++E)if(s[E]>255){var he=s[E]>>>18&31;Gt(e,u,T[he+257]),u+=D[he+257],he>7&&(Ue(e,u,s[E]>>>23&31),u+=Dr[he]);var le=s[E]&31;Gt(e,u,U[le]),u+=Q[le],le>3&&(Gt(e,u,s[E]>>>5&8191),u+=$r[le])}else Gt(e,u,T[s[E]]),u+=D[s[E]];return Gt(e,u,T[256]),u+D[256]},Hb=new ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gb=function(r,e,t,s,i,n){var o=r.length,l=new ye(s+o+5*(1+Math.floor(o/7e3))+i),a=l.subarray(s,l.length-i),c=0;if(!e||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Ji(a,c,r.subarray(u,h)):(a[u]=n,c=Ji(a,c,r.subarray(u,o)))}else{for(var d=Hb[e-1],f=d>>>13,m=d&8191,y=(1<<t)-1,p=new we(32768),g=new we(y+1),w=Math.ceil(t/3),S=2*w,b=function(mt){return(r[mt]^r[mt+1]<<w^r[mt+2]<<S)&y},C=new ds(25e3),x=new we(288),M=new we(32),E=0,$=0,u=0,k=0,L=0,_=0;u<o;++u){var B=b(u),W=u&32767,N=g[B];if(p[W]=N,g[B]=W,L<=u){var T=o-u;if((E>7e3||k>24576)&&T>423){c=Oa(r,a,0,C,x,M,$,k,_,u-_,c),k=E=$=0,_=u;for(var D=0;D<286;++D)x[D]=0;for(var D=0;D<30;++D)M[D]=0}var U=2,Q=0,ce=m,se=W-N&32767;if(T>2&&B==b(u-se))for(var fe=Math.min(f,T)-1,Se=Math.min(32767,u),he=Math.min(258,T);se<=Se&&--ce&&W!=N;){if(r[u+U]==r[u+U-se]){for(var le=0;le<he&&r[u+le]==r[u+le-se];++le);if(le>U){if(U=le,Q=se,le>fe)break;for(var lt=Math.min(se,le-2),Xe=0,D=0;D<lt;++D){var $e=u-se+D+32768&32767,ft=p[$e],Lt=$e-ft+32768&32767;Lt>Xe&&(Xe=Lt,N=$e)}}}W=N,N=p[W],se+=W-N+32768&32767}if(Q){C[k++]=268435456|Yi[U]<<18|Ra[Q];var Ie=Yi[U]&31,pe=Ra[Q]&31;$+=Dr[Ie]+$r[pe],++x[257+Ie],++M[pe],L=u+U,++E}else C[k++]=r[u],++x[r[u]]}}c=Oa(r,a,n,C,x,M,$,k,_,u-_,c)}return jn(l,0,s+Gn(c)+i)},jb=function(){var r=1,e=0;return{p:function(t){for(var s=r,i=e,n=t.length,o=0;o!=n;){for(var l=Math.min(o+5552,n);o<l;++o)s+=t[o],i+=s;s%=65521,i%=65521}r=s,e=i},d:function(){return(r>>>8<<16|(e&255)<<8|e>>>8)+((r&255)<<23)*2}}},Yb=function(r,e,t,s,i){return Gb(r,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):12+e.mem,t,s,!0)},Zb=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Xb=function(r,e){var t=e.level,s=t==0?0:t<6?1:t==9?3:2;r[0]=120,r[1]=s<<6|(s?32-2*s:1)},Jb=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function qb(r,e){e===void 0&&(e={});var t=jb();t.p(r);var s=Yb(r,e,2,4);return Xb(s,e),Zb(s,s.length-4,t.d()),s}function Kb(r,e){return Vb((Jb(r),r.subarray(2,-4)),e)}function Yc(r,e){var t=r.length;if(!e&&typeof TextEncoder!="undefined")return new TextEncoder().encode(r);for(var s=new ye(r.length+(r.length>>>1)),i=0,n=function(c){s[i++]=c},o=0;o<t;++o){if(i+5>s.length){var l=new ye(i+8+(t-o<<1));l.set(s),s=l}var a=r.charCodeAt(o);a<128||e?n(a):a<2048?(n(192|a>>>6),n(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|r.charCodeAt(++o)&1023,n(240|a>>>18),n(128|a>>>12&63),n(128|a>>>6&63),n(128|a&63)):(n(224|a>>>12),n(128|a>>>6&63),n(128|a&63))}return jn(s,0,i)}function Zc(r,e){var t="";if(!e&&typeof TextDecoder!="undefined")return new TextDecoder().decode(r);for(var s=0;s<r.length;){var i=r[s++];i<128||e?t+=String.fromCharCode(i):i<224?t+=String.fromCharCode((i&31)<<6|r[s++]&63):i<240?t+=String.fromCharCode((i&15)<<12|(r[s++]&63)<<6|r[s++]&63):(i=((i&15)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023))}return t}const qi="v1",Qb=r=>{const e=ae(R({},r),{v:qi});return Zc(qb(Yc(JSON.stringify(e))),!0)},ev=r=>{if(typeof r!="string")return r;try{const e=JSON.parse(r);if(e.timestamp)return e}catch(e){}try{const e=JSON.parse(Zc(Kb(Yc(r,!0))));if(e.v===qi)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${qi}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};exports.EventType=O;exports.IncrementalSource=A;exports.MouseInteractions=Z;exports.Replayer=Tb;exports.ReplayerEvents=Y;exports.addCustomEvent=_b;exports.canvasMutation=Gi;exports.flushCustomEventQueue=kb;exports.freezePage=Lb;exports.getVersion=Db;exports.isRecording=$b;exports.pack=Qb;exports.record=Ce;exports.takeFullSnapshot=Pb;exports.unpack=ev;exports.utils=Og;exports.version=Ob;
|
|
92
|
+
***************************************************************************** */function Sa(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var s,i,n=t.call(r),o=[];try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(l){i={error:l}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}var Mt;(function(r){r[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped"})(Mt||(Mt={}));var Fc={type:"xstate.init"};function si(r){return r===void 0?[]:[].concat(r)}function wt(r){return{type:"xstate.assign",assignment:r}}function Ca(r,e){return typeof(r=typeof r=="string"&&e&&e[r]?e[r]:r)=="string"?{type:r}:typeof r=="function"?{type:r.name,exec:r}:r}function yr(r){return function(e){return r===e}}function zc(r){return typeof r=="string"?{type:r}:r}function xa(r,e){return{value:r,context:e,actions:[],changed:!1,matches:yr(r)}}function Ea(r,e,t){var s=e,i=!1;return[r.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},s);return typeof n.assignment=="function"?o=n.assignment(s,t):Object.keys(n.assignment).forEach(function(l){o[l]=typeof n.assignment[l]=="function"?n.assignment[l](s,t):n.assignment[l]}),s=o,!1}return!0}),s,i]}function Bc(r,e){e===void 0&&(e={});var t=Sa(Ea(si(r.states[r.initial].entry).map(function(o){return Ca(o,e.actions)}),r.context,Fc),2),s=t[0],i=t[1],n={config:r,_options:e,initialState:{value:r.initial,actions:s,context:i,matches:yr(r.initial)},transition:function(o,l){var a,c,u=typeof o=="string"?{value:o,context:r.context}:o,h=u.value,d=u.context,f=zc(l),m=r.states[h];if(m.on){var y=si(m.on[f.type]);try{for(var p=function(D){var U=typeof Symbol=="function"&&Symbol.iterator,Q=U&&D[U],ce=0;if(Q)return Q.call(D);if(D&&typeof D.length=="number")return{next:function(){return D&&ce>=D.length&&(D=void 0),{value:D&&D[ce++],done:!D}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),g=p.next();!g.done;g=p.next()){var w=g.value;if(w===void 0)return xa(h,d);var S=typeof w=="string"?{target:w}:w,b=S.target,C=S.actions,x=C===void 0?[]:C,M=S.cond,E=M===void 0?function(){return!0}:M,$=b===void 0,k=b!=null?b:h,L=r.states[k];if(E(d,f)){var _=Sa(Ea(($?si(x):[].concat(m.exit,x,L.entry).filter(function(D){return D})).map(function(D){return Ca(D,n._options.actions)}),d,f),3),B=_[0],W=_[1],N=_[2],T=b!=null?b:h;return{value:T,context:W,actions:B,changed:b!==h||B.length>0||N,matches:yr(T)}}}}catch(D){a={error:D}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(a)throw a.error}}}return xa(h,d)}};return n}var Ma=function(r,e){return r.actions.forEach(function(t){var s=t.exec;return s&&s(r.context,e)})};function Wc(r){var e=r.initialState,t=Mt.NotStarted,s=new Set,i={_machine:r,send:function(n){t===Mt.Running&&(e=r.transition(e,n),Ma(e,zc(n)),s.forEach(function(o){return o(e)}))},subscribe:function(n){return s.add(n),n(e),{unsubscribe:function(){return s.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:r.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:yr(o.value)}}return t=Mt.Running,Ma(e,Fc),i},stop:function(){return t=Mt.Stopped,s.clear(),i},get state(){return e},get status(){return t}};return i}function yb(r,e){for(let t=r.length-1;t>=0;t--){const s=r[t];if(s.type===O.Meta&&s.timestamp<=e)return r.slice(t)}return r}function bb(r,{getCastFn:e,applyEventsSynchronously:t,emitter:s}){const i=Bc({id:"player",context:r,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:wt({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:wt((n,o)=>{let l=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),ae(R({},n),{timeOffset:l,baselineTime:n.events[0].timestamp+l})}),play(n){var o;const{timer:l,events:a,baselineTime:c,lastPlayedEvent:u}=n;l.clear();for(const m of a)wa(m,c);const h=yb(a,c);let d=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===O.IncrementalSnapshot&&u.data.source===A.MouseMove&&(d=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&s.emit(Y.PlayBack);const f=new Array;for(const m of h)if(!(d&&d<c&&(m.timestamp<=d||m===u)))if(m.timestamp<=c)f.push(m);else{const y=e(m,!1);l.addAction({doAction:()=>{y()},delay:m.delay})}t(f),s.emit(Y.Flush),l.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:wt(n=>ae(R({},n),{lastPlayedEvent:null})),startLive:wt({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:wt((n,o)=>{const{baselineTime:l,timer:a,events:c}=n;if(o.type==="ADD_EVENT"){const{event:u}=o.payload;wa(u,l);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let m=-1,y=0;for(;y<=h;){const p=Math.floor((y+h)/2);c[p].timestamp<=u.timestamp?y=p+1:h=p-1}m===-1&&(m=y),c.splice(m,0,u)}const d=u.timestamp<l,f=e(u,d);d?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:u.delay})}return ae(R({},n),{events:c})})}});return Wc(i)}function vb(r){const e=Bc({id:"speed",context:r,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,s)=>{"payload"in s&&t.timer.setSpeed(s.payload.speed)},recordSpeed:wt({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Wc(e)}const wb=r=>[`.${r} { background: currentColor }`,"noscript { display: none !important; }"],Aa=new Map;function Uc(r,e){let t=Aa.get(r);return t||(t=new Map,Aa.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}function rt(r,e,t){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(t&&(t.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){const i=await rt(r,e,t)(s.args);return await createImageBitmap.apply(null,i)}else if("index"in s){if(t||e===null)return s;const{rr_type:i,index:n}=s;return Uc(e,i)[n]}else if("args"in s){const{rr_type:i,args:n}=s,o=window[i];return new o(...await Promise.all(n.map(rt(r,e,t))))}else{if("base64"in s)return Gy(s.base64);if("src"in s){const i=r.get(s.src);if(i)return i;{const n=new Image;return n.src=s.src,r.set(s.src,n),n}}else if("data"in s&&s.rr_type==="Blob"){const i=await Promise.all(s.data.map(rt(r,e,t)));return new Blob(i,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(rt(r,e,t)));return s}}function Sb(r,e){try{return e===Ze.WebGL?r.getContext("webgl")||r.getContext("experimental-webgl"):r.getContext("webgl2")}catch(t){return null}}const Cb=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function xb(r,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Cb.includes(t))return;const s=Uc(r,t);s.includes(e)||s.push(e)}async function Eb({mutation:r,target:e,type:t,imageMap:s,errorHandler:i}){try{const n=Sb(e,t);if(!n)return;if(r.setter){n[r.property]=r.args[0];return}const o=n[r.property],l=await Promise.all(r.args.map(rt(s,n))),a=o.apply(n,l);xb(n,a);const c=!1}catch(n){i(r,n)}}async function Mb({event:r,mutations:e,target:t,imageMap:s,errorHandler:i}){const n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}const o=e.map(async a=>Promise.all(a.args.map(rt(s,n))));(await Promise.all(o)).forEach((a,c)=>{const u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}const h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(s.get(r),h.apply(n,u.args)):h.apply(n,a)}catch(h){i(u,h)}})}async function Gi({event:r,mutation:e,target:t,imageMap:s,canvasEventMap:i,errorHandler:n}){try{const o=i.get(r)||e,l="commands"in o?o.commands:[o];if([Ze.WebGL,Ze.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const c=l[a];await Eb({mutation:c,type:e.type,target:t,imageMap:s,errorHandler:n})}return}await Mb({event:r,mutations:l,target:t,imageMap:s,errorHandler:n})}catch(o){n(e,o)}}class Ab{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(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(Y.Start,this.start.bind(this)),this.emitter.on(Y.SkipStart,this.start.bind(this)),this.emitter.on(Y.Pause,this.pause.bind(this)),this.emitter.on(Y.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,s)=>{this.syncTargetWithState(s),e.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:s}){if(s.isPlaying){const n=(e-s.lastInteractionTimeOffset)/1e3*s.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let l=s.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(l=l%o),t.currentTime=l}else t.pause(),t.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const s=this.mediaMap.get(e);s&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:s}){var f,m,y,p,g;const i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:l,muted:a,volume:c,loop:u}=s;return{isPlaying:n===Qe.Play||n!==Qe.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=l!=null?l:i==null?void 0:i.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:t,playbackRate:(m=o!=null?o:i==null?void 0:i.playbackRate)!=null?m:1,volume:(y=c!=null?c:i==null?void 0:i.volume)!=null?y:1,muted:(p=a!=null?a:i==null?void 0:i.muted)!=null?p:e.getAttribute("muted")===null,loop:(g=u!=null?u:i==null?void 0:i.loop)!=null?g:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:s,loop:i,volume:n,isPlaying:o}=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!==n&&(e.volume=n),e.muted=s,e.loop=i,e.playbackRate!==a&&(e.playbackRate=a),o&&!l?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,s){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,n=s.getMeta(i);if(!n||!("attributes"in n))return;const o=this.service.state.matches("paused"),l=n.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=i.getAttribute("autoplay")!==null,a&&o&&i.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let u=!1;typeof l.rr_mediaMuted=="boolean"?u=l.rr_mediaMuted:u=i.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=i.getAttribute("loop")!==null;let d=1;typeof l.rr_mediaVolume=="number"&&(d=l.rr_mediaVolume);let f=0;typeof l.rr_mediaCurrentTime=="number"&&(f=l.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:a,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:u,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:s}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:s})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Ys(r,e){if(r.nodeName!=="DIALOG"||r instanceof De)return;const t=r,s=t.open,i=s&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=n==="modal";if(!(s&&!(i&&n==="non-modal"||!i&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}s&&t.close(),o&&(l?t.showModal():t.show())}}function Ib(r,e){if(r.nodeName!=="DIALOG"||r instanceof De)return;const t=r;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 Nb=5*1e3,Rb=Pc||pb,Ia="[replayer]",ri={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Na(r){return r.type==O.IncrementalSnapshot&&(r.data.source==A.TouchMove||r.data.source==A.MouseInteraction&&r.data.type==Z.TouchStart)}class Tb{constructor(e,t){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new _t),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Rb()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",Do()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",ka()),v(this,"styleMirror",new Bn),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(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)))}),v(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case O.DomContentLoaded:case O.Load:case O.Custom:continue;case O.FullSnapshot:case O.Meta:case O.Plugin:case O.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),v(this,"getCastFn",(l,a=!1)=>{let c;switch(l.type){case O.DomContentLoaded:case O.Load:break;case O.Custom:c=()=>{this.emitter.emit(Y.CustomEvent,l)};break;case O.Meta:c=()=>this.emitter.emit(Y.Resize,{width:l.data.width,height:l.data.height});break;case O.FullSnapshot:c=()=>{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 O.IncrementalSnapshot:c=()=>{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,d={speed:Math.min(Math.round(h/Nb),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(Y.SkipStart,d)}}};break}return()=>{c&&c();for(const d of this.config.plugins||[])d.handler&&d.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 d=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};let f=50;l.type===O.IncrementalSnapshot&&l.data.source===A.MouseMove&&l.data.positions.length&&(f+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(d,f)}this.emitter.emit(Y.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const s={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:ri,useVirtualDom:!0,logger:console};this.config=Object.assign({},s,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,c,u)=>{Gi({event:a,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===A.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===A.StyleDeclaration&&this.applyStyleDeclaration(a,c)},afterAppend:(a,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{dr(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 c=this.legacy_missingNodeRetryMap[a],u=fr(c.node,this.mirror,this.virtualDom.mirror);dr(u,c.node,l,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}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(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new gb([],{speed:this.config.speed});this.service=bb({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:i,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(Y.StateChange,{player:l})}),this.speedService=vb({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(Y.StateChange,{speed:l})}),this.mediaManager=new Ab({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(l=>l.type===O.Meta),o=this.service.state.context.events.find(l=>l.type===O.FullSnapshot);if(n){const{width:l,height:a}=n.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:l,height:a})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Na)&&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,s;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}})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start)}pause(e){var t,s;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit(Y.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(Y.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Y.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Na(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=Do()}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","allow-scripts"];this.config.UNSAFE_replayCanvas,this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(mb(this.iframe.contentWindow,this.iframe.contentDocument),Ln(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 s=[],i=new Set,n=(a,c)=>{if(a.nodeName==="DIALOG"&&i.add(a),this.collectIframeAndAttachDocument(s,a),this.mediaManager.isSupportedMediaElement(a)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Yf(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:c}of s)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);const{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),i.forEach(a=>Ys(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var s;const i=wb(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,yc(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:A.StyleSheetRule,adds:i.map((o,l)=>({rule:o,index:l}))})}else{const n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(s=n.sheet)==null||s.insertRule(i[o],o)}}attachDocumentToIframe(e,t){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(l,a)=>{l.nodeName==="DIALOG"&&n.add(l),this.collectIframeAndAttachDocument(i,l);const c=s.getMeta(l);if((c==null?void 0:c.type)===He.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:a,replayer:this})};Kt(e.node,{doc:t.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of i)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);n.forEach(l=>Ys(l))}collectIframeAndAttachDocument(e,t){if(At(t,this.mirror)){const s=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));s&&e.push({mutationInQueue:s,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const s=new Set;let i,n=this.service.state;const o=()=>{n=this.service.state};this.emitter.on(Y.Start,o),this.emitter.on(Y.Pause,o);const l=()=>{this.emitter.off(Y.Start,o),this.emitter.off(Y.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(s.add(a),a.addEventListener("load",()=>{s.delete(a),s.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===O.IncrementalSnapshot&&t.data.source===A.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const s=document.createElement("canvas"),i=s.getContext("2d"),n=i==null?void 0:i.createImageData(s.width,s.height);i==null||i.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const s={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async n=>{const o=await Promise.all(n.args.map(rt(this.imageMap,null,s)));return ae(R({},n),{args:o})}));s.isUnchanged===!1&&this.canvasEventMap.set(t,ae(R({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(rt(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(t,ae(R({},e),{args:i}))}}}applyIncremental(e,t){var s,i,n;const{data:o}=e;switch(o.source){case A.Mutation:{try{this.applyMutation(o,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(t){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,o)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((s=o.positions[0])==null?void 0:s.timeOffset)});break;case A.MouseInteraction:{if(o.id===-1)break;const l=new Event(it(Z[o.type])),a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);this.emitter.emit(Y.MouseInteraction,{type:o.type,target:a});const{triggerFocus:c}=this.config;switch(o.type){case Z.Blur:"blur"in a&&a.blur();break;case Z.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case Z.Click:case Z.TouchStart:case Z.TouchEnd:case Z.MouseDown:case Z.MouseUp:t?(o.type===Z.TouchStart?this.touchActive=!0:o.type===Z.TouchEnd&&(this.touchActive=!1),o.type===Z.MouseDown?this.lastMouseDownEvent=[a,l]:o.type===Z.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===Z.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===Z.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===Z.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===Z.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case Z.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case A.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,t);break}case A.ViewportResize:this.emitter.emit(Y.Resize,{width:o.width,height:o.height});break;case A.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case A.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const a=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case A.StyleSheetRule:case A.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:e,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Gi({event:e,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(l)}catch(l){this.warn(l)}break}case A.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case A.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}case A.Visibility:{const{mutations:l}=o;for(const a of l){const c=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);c&&c instanceof Element&&(c.style.visibility=a.isVisible?"visible":"hidden")}break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,pg(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=gc(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return;let d=s.getNode(c.parentId);if(!d)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&tt(d)&&(d=d.shadowRoot),s.removeNodeFromMap(h),d)try{d.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",d,h,e);else throw f}});const i=R({},this.legacy_missingNodeRetryMap),n=[],o=c=>{let u=null;return c.nextId&&(u=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},l=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=s.getNode(c.parentId);if(!d)return c.node.type===He.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(tt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const y=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(At(d,s)){this.attachDocumentToIframe(c,d);return}const p=(S,b)=>{if(!this.usingVirtualDom){Ys(S);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(S,{id:b,replayer:this})}},g=Kt(c.node,{doc:y,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:g,mutation:c};return}const w=s.getMeta(d);if(w&&w.type===He.Element&&c.node.type===He.Text){const S=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(w.tagName==="textarea")for(const b of S)b.nodeType===d.TEXT_NODE&&d.removeChild(b);else if(w.tagName==="style"&&S.length===1)for(const b of S)b.nodeType===d.TEXT_NODE&&!s.hasNode(b)&&(g.textContent=b.textContent,d.removeChild(b))}else if((w==null?void 0:w.type)===He.Document){const S=d;c.node.type===He.DocumentType&&((u=S.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&S.removeChild(S.childNodes[0]),g.nodeName==="HTML"&&S.documentElement&&S.removeChild(S.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?d.insertBefore(g,f.nextSibling):m&&m.parentNode?d.contains(m)?d.insertBefore(g,m):d.insertBefore(g,null):d.appendChild(g),p(g,c.node.id),this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[]),At(g,this.mirror)){const S=this.mirror.getId(g),b=this.newDocumentQueue.find(C=>C.parentId===S);b&&(this.attachDocumentToIframe(b,g),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,d,g,c)};e.adds.forEach(c=>{l(c)});const a=Date.now();for(;n.length;){const c=wc(n);if(n.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)s.getNode(u.value.parentId)?Pn(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Sc(e.texts).forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);const d=h.parentElement;if(c.value&&d&&d.tagName==="STYLE"?h.textContent=xr(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){const f=h.parentNode;((u=f==null?void 0:f.rules)==null?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)h.removeAttribute(d),d==="open"&&Ib(h,c);else if(typeof f=="string")try{if(d==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const m=s.getMeta(h),y=Kt(ae(R({},m),{attributes:R(R({},m.attributes),c.attributes)}),{doc:h.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const p=h.nextSibling,g=h.parentNode;if(y&&g){g.removeChild(h),g.insertBefore(y,p),s.replace(c.id,y);break}}catch(m){}if(d==="value"&&h.nodeName==="TEXTAREA"){const m=h;m.childNodes.forEach(p=>m.removeChild(p));const y=(u=h.ownerDocument)==null?void 0:u.createTextNode(f);y&&m.appendChild(y)}else h.setAttribute(d,f);d==="rr_open_mode"&&h.nodeName==="DIALOG"&&Ys(h,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=f,y=h;for(const p in m)if(m[p]===!1)y.style.removeProperty(p);else if(m[p]instanceof Array){const g=m[p];y.style.setProperty(p,g[0],g[1])}else{const g=m[p];y.style.setProperty(p,g)}}}})}applyScroll(e,t){var s,i;const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===He.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.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(s){}}applySelection(e){try{const t=new Set,s=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:l})=>{const a=this.mirror.getNode(i),c=this.mirror.getNode(o);if(!a||!c)return;const u=new Range;u.setStart(a,n),u.setEnd(c,l);const h=a.ownerDocument,d=h==null?void 0:h.getSelection();return d&&t.add(d),{range:u,selection:d}});t.forEach(i=>i.removeAllRanges()),s.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let s=null;e.styleId?s=this.styleMirror.getStyle(e.styleId):e.id&&(s=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),s&&(e.source===A.StyleSheetRule?this.applyStyleSheetRule(e,s):e.source===A.StyleDeclaration&&this.applyStyleDeclaration(e,s))}applyStyleSheetRule(e,t){var s,i,n,o;if((s=e.adds)==null||s.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:c,index:u}=Ui(a);xt(t.cssRules,c).insertRule(l,u)}else{const c=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,c)}}catch(c){}}),(i=e.removes)==null||i.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:c}=Ui(l);xt(t.cssRules,a).deleteRule(c||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&xt(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&xt(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const s=this.mirror.getNode(e.id);if(!s)return;(t=e.styles)==null||t.forEach(l=>{var a;let c=null,u=null;if(tt(s)?u=((a=s.ownerDocument)==null?void 0:a.defaultView)||null:s.nodeName==="#document"&&(u=s.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:A.StyleSheetRule,adds:l.rules},c)}catch(h){}});const i=10;let n=0;const o=(l,a)=>{const c=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);tt(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&n<i&&(setTimeout(()=>o(l,a),0+100*n),n++)};o(s,e.styleIds)}legacy_resolveMissingNode(e,t,s,i){const{previousId:n,nextId:o}=i,l=n&&e[n],a=o&&e[o];if(l){const{node:c,mutation:u}=l;t.insertBefore(c,s),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(a){const{node:c,mutation:u}=a;t.insertBefore(c,s.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,s,i,n){const o=this.mirror.getNode(s);if(!o)return this.debugNodeNotFound(n,s);const l=zn(o,this.iframe),a=e*l.absoluteScale+l.x,c=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:a,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:s,strokeStyle:i,duration:n}=this.config.mouseTail===!0?ri:Object.assign({},ri,this.config.mouseTail),o=()=>{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=s,l.lineCap=t,l.strokeStyle=i,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),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let s=e;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(e){return e.type!==O.IncrementalSnapshot?!1:e.data.source>A.Mutation&&e.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.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(Ia,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Ia,...e)}}const Ob="3.4.0-alpha.1",{getVersion:Db}=Ce,{isRecording:$b}=Ce,{flushCustomEventQueue:kb}=Ce,{addCustomEvent:_b}=Ce,{freezePage:Lb}=Ce,{takeFullSnapshot:Pb}=Ce;var ye=Uint8Array,we=Uint16Array,ds=Uint32Array,Dr=new ye([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]),$r=new ye([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]),ji=new ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vc=function(r,e){for(var t=new we(31),s=0;s<31;++s)t[s]=e+=1<<r[s-1];for(var i=new ds(t[30]),s=1;s<30;++s)for(var n=t[s];n<t[s+1];++n)i[n]=n-t[s]<<5|s;return[t,i]},Hc=Vc(Dr,2),Gc=Hc[0],Yi=Hc[1];Gc[28]=258,Yi[258]=28;var jc=Vc($r,0),Fb=jc[0],Ra=jc[1],Zi=new we(32768);for(var re=0;re<32768;++re){var Je=(re&43690)>>>1|(re&21845)<<1;Je=(Je&52428)>>>2|(Je&13107)<<2,Je=(Je&61680)>>>4|(Je&3855)<<4,Zi[re]=((Je&65280)>>>8|(Je&255)<<8)>>>1}var ze=function(r,e,t){for(var s=r.length,i=0,n=new we(e);i<s;++i)++n[r[i]-1];var o=new we(e);for(i=0;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;var l;if(t){l=new we(1<<e);var a=15-e;for(i=0;i<s;++i)if(r[i])for(var c=i<<4|r[i],u=e-r[i],h=o[r[i]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)l[Zi[h]>>>a]=c}else for(l=new we(s),i=0;i<s;++i)l[i]=Zi[o[r[i]-1]++]>>>15-r[i];return l},nt=new ye(288);for(var re=0;re<144;++re)nt[re]=8;for(var re=144;re<256;++re)nt[re]=9;for(var re=256;re<280;++re)nt[re]=7;for(var re=280;re<288;++re)nt[re]=8;var fs=new ye(32);for(var re=0;re<32;++re)fs[re]=5;var zb=ze(nt,9,0),Bb=ze(nt,9,1),Wb=ze(fs,5,0),Ub=ze(fs,5,1),ii=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},Ne=function(r,e,t){var s=e/8>>0;return(r[s]|r[s+1]<<8)>>>(e&7)&t},ni=function(r,e){var t=e/8>>0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>>(e&7)},Gn=function(r){return(r/8>>0)+(r&7&&1)},jn=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var s=new(r instanceof we?we:r instanceof ds?ds:ye)(t-e);return s.set(r.subarray(e,t)),s},Vb=function(r,e,t){var s=r.length,i=!e||t,n=!t||t.i;t||(t={}),e||(e=new ye(s*3));var o=function(lt){var Xe=e.length;if(lt>Xe){var $e=new ye(Math.max(Xe*2,lt));$e.set(e),e=$e}},l=t.f||0,a=t.p||0,c=t.b||0,u=t.l,h=t.d,d=t.m,f=t.n,m=s*8;do{if(!u){t.f=l=Ne(r,a,1);var y=Ne(r,a+1,3);if(a+=3,y)if(y==1)u=Bb,h=Ub,d=9,f=5;else if(y==2){var S=Ne(r,a,31)+257,b=Ne(r,a+10,15)+4,C=S+Ne(r,a+5,31)+1;a+=14;for(var x=new ye(C),M=new ye(19),E=0;E<b;++E)M[ji[E]]=Ne(r,a+E*3,7);a+=b*3;var $=ii(M),k=(1<<$)-1;if(!n&&a+C*($+7)>m)break;for(var L=ze(M,$,1),E=0;E<C;){var _=L[Ne(r,a,k)];a+=_&15;var p=_>>>4;if(p<16)x[E++]=p;else{var B=0,W=0;for(p==16?(W=3+Ne(r,a,3),a+=2,B=x[E-1]):p==17?(W=3+Ne(r,a,7),a+=3):p==18&&(W=11+Ne(r,a,127),a+=7);W--;)x[E++]=B}}var N=x.subarray(0,S),T=x.subarray(S);d=ii(N),f=ii(T),u=ze(N,d,1),h=ze(T,f,1)}else throw"invalid block type";else{var p=Gn(a)+4,g=r[p-4]|r[p-3]<<8,w=p+g;if(w>s){if(n)throw"unexpected EOF";break}i&&o(c+g),e.set(r.subarray(p,w),c),t.b=c+=g,t.p=a=w*8;continue}if(a>m)throw"unexpected EOF"}i&&o(c+131072);for(var D=(1<<d)-1,U=(1<<f)-1,Q=d+f+18;n||a+Q<m;){var B=u[ni(r,a)&D],ce=B>>>4;if(a+=B&15,a>m)throw"unexpected EOF";if(!B)throw"invalid length/literal";if(ce<256)e[c++]=ce;else if(ce==256){u=null;break}else{var se=ce-254;if(ce>264){var E=ce-257,fe=Dr[E];se=Ne(r,a,(1<<fe)-1)+Gc[E],a+=fe}var Se=h[ni(r,a)&U],he=Se>>>4;if(!Se)throw"invalid distance";a+=Se&15;var T=Fb[he];if(he>3){var fe=$r[he];T+=ni(r,a)&(1<<fe)-1,a+=fe}if(a>m)throw"unexpected EOF";i&&o(c+131072);for(var le=c+se;c<le;c+=4)e[c]=e[c-T],e[c+1]=e[c+1-T],e[c+2]=e[c+2-T],e[c+3]=e[c+3-T];c=le}}t.l=u,t.p=a,t.b=c,u&&(l=1,t.m=d,t.d=h,t.n=f)}while(!l);return c==e.length?e:jn(e,0,c)},Ue=function(r,e,t){t<<=e&7;var s=e/8>>0;r[s]|=t,r[s+1]|=t>>>8},Gt=function(r,e,t){t<<=e&7;var s=e/8>>0;r[s]|=t,r[s+1]|=t>>>8,r[s+2]|=t>>>16},oi=function(r,e){for(var t=[],s=0;s<r.length;++s)r[s]&&t.push({s,f:r[s]});var i=t.length,n=t.slice();if(!i)return[new ye(0),0];if(i==1){var o=new ye(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(C,x){return C.f-x.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,u=1,h=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};u!=i-1;)l=t[t[c].f<t[h].f?c++:h++],a=t[c!=u&&t[c].f<t[h].f?c++:h++],t[u++]={s:-1,f:l.f+a.f,l,r:a};for(var d=n[0].s,s=1;s<i;++s)n[s].s>d&&(d=n[s].s);var f=new we(d+1),m=Xi(t[u-1],f,0);if(m>e){var s=0,y=0,p=m-e,g=1<<p;for(n.sort(function(x,M){return f[M.s]-f[x.s]||x.f-M.f});s<i;++s){var w=n[s].s;if(f[w]>e)y+=g-(1<<m-f[w]),f[w]=e;else break}for(y>>>=p;y>0;){var S=n[s].s;f[S]<e?y-=1<<e-f[S]++-1:++s}for(;s>=0&&y;--s){var b=n[s].s;f[b]==e&&(--f[b],++y)}m=e}return[new ye(f),m]},Xi=function(r,e,t){return r.s==-1?Math.max(Xi(r.l,e,t+1),Xi(r.r,e,t+1)):e[r.s]=t},Ta=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new we(++e),s=0,i=r[0],n=1,o=function(a){t[s++]=a},l=1;l<=e;++l)if(r[l]==i&&l!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=r[l]}return[t.subarray(0,s),e]},jt=function(r,e){for(var t=0,s=0;s<e.length;++s)t+=r[s]*e[s];return t},Ji=function(r,e,t){var s=t.length,i=Gn(e+2);r[i]=s&255,r[i+1]=s>>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var n=0;n<s;++n)r[i+n+4]=t[n];return(i+4+s)*8},Oa=function(r,e,t,s,i,n,o,l,a,c,u){Ue(e,u++,t),++i[256];for(var h=oi(i,15),d=h[0],f=h[1],m=oi(n,15),y=m[0],p=m[1],g=Ta(d),w=g[0],S=g[1],b=Ta(y),C=b[0],x=b[1],M=new we(19),E=0;E<w.length;++E)M[w[E]&31]++;for(var E=0;E<C.length;++E)M[C[E]&31]++;for(var $=oi(M,7),k=$[0],L=$[1],_=19;_>4&&!k[ji[_-1]];--_);var B=c+5<<3,W=jt(i,nt)+jt(n,fs)+o,N=jt(i,d)+jt(n,y)+o+14+3*_+jt(M,k)+(2*M[16]+3*M[17]+7*M[18]);if(B<=W&&B<=N)return Ji(e,u,r.subarray(a,a+c));var T,D,U,Q;if(Ue(e,u,1+(N<W)),u+=2,N<W){T=ze(d,f,0),D=d,U=ze(y,p,0),Q=y;var ce=ze(k,L,0);Ue(e,u,S-257),Ue(e,u+5,x-1),Ue(e,u+10,_-4),u+=14;for(var E=0;E<_;++E)Ue(e,u+3*E,k[ji[E]]);u+=3*_;for(var se=[w,C],fe=0;fe<2;++fe)for(var Se=se[fe],E=0;E<Se.length;++E){var he=Se[E]&31;Ue(e,u,ce[he]),u+=k[he],he>15&&(Ue(e,u,Se[E]>>>5&127),u+=Se[E]>>>12)}}else T=zb,D=nt,U=Wb,Q=fs;for(var E=0;E<l;++E)if(s[E]>255){var he=s[E]>>>18&31;Gt(e,u,T[he+257]),u+=D[he+257],he>7&&(Ue(e,u,s[E]>>>23&31),u+=Dr[he]);var le=s[E]&31;Gt(e,u,U[le]),u+=Q[le],le>3&&(Gt(e,u,s[E]>>>5&8191),u+=$r[le])}else Gt(e,u,T[s[E]]),u+=D[s[E]];return Gt(e,u,T[256]),u+D[256]},Hb=new ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gb=function(r,e,t,s,i,n){var o=r.length,l=new ye(s+o+5*(1+Math.floor(o/7e3))+i),a=l.subarray(s,l.length-i),c=0;if(!e||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Ji(a,c,r.subarray(u,h)):(a[u]=n,c=Ji(a,c,r.subarray(u,o)))}else{for(var d=Hb[e-1],f=d>>>13,m=d&8191,y=(1<<t)-1,p=new we(32768),g=new we(y+1),w=Math.ceil(t/3),S=2*w,b=function(mt){return(r[mt]^r[mt+1]<<w^r[mt+2]<<S)&y},C=new ds(25e3),x=new we(288),M=new we(32),E=0,$=0,u=0,k=0,L=0,_=0;u<o;++u){var B=b(u),W=u&32767,N=g[B];if(p[W]=N,g[B]=W,L<=u){var T=o-u;if((E>7e3||k>24576)&&T>423){c=Oa(r,a,0,C,x,M,$,k,_,u-_,c),k=E=$=0,_=u;for(var D=0;D<286;++D)x[D]=0;for(var D=0;D<30;++D)M[D]=0}var U=2,Q=0,ce=m,se=W-N&32767;if(T>2&&B==b(u-se))for(var fe=Math.min(f,T)-1,Se=Math.min(32767,u),he=Math.min(258,T);se<=Se&&--ce&&W!=N;){if(r[u+U]==r[u+U-se]){for(var le=0;le<he&&r[u+le]==r[u+le-se];++le);if(le>U){if(U=le,Q=se,le>fe)break;for(var lt=Math.min(se,le-2),Xe=0,D=0;D<lt;++D){var $e=u-se+D+32768&32767,ft=p[$e],Lt=$e-ft+32768&32767;Lt>Xe&&(Xe=Lt,N=$e)}}}W=N,N=p[W],se+=W-N+32768&32767}if(Q){C[k++]=268435456|Yi[U]<<18|Ra[Q];var Ie=Yi[U]&31,pe=Ra[Q]&31;$+=Dr[Ie]+$r[pe],++x[257+Ie],++M[pe],L=u+U,++E}else C[k++]=r[u],++x[r[u]]}}c=Oa(r,a,n,C,x,M,$,k,_,u-_,c)}return jn(l,0,s+Gn(c)+i)},jb=function(){var r=1,e=0;return{p:function(t){for(var s=r,i=e,n=t.length,o=0;o!=n;){for(var l=Math.min(o+5552,n);o<l;++o)s+=t[o],i+=s;s%=65521,i%=65521}r=s,e=i},d:function(){return(r>>>8<<16|(e&255)<<8|e>>>8)+((r&255)<<23)*2}}},Yb=function(r,e,t,s,i){return Gb(r,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):12+e.mem,t,s,!0)},Zb=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Xb=function(r,e){var t=e.level,s=t==0?0:t<6?1:t==9?3:2;r[0]=120,r[1]=s<<6|(s?32-2*s:1)},Jb=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function qb(r,e){e===void 0&&(e={});var t=jb();t.p(r);var s=Yb(r,e,2,4);return Xb(s,e),Zb(s,s.length-4,t.d()),s}function Kb(r,e){return Vb((Jb(r),r.subarray(2,-4)),e)}function Yc(r,e){var t=r.length;if(!e&&typeof TextEncoder!="undefined")return new TextEncoder().encode(r);for(var s=new ye(r.length+(r.length>>>1)),i=0,n=function(c){s[i++]=c},o=0;o<t;++o){if(i+5>s.length){var l=new ye(i+8+(t-o<<1));l.set(s),s=l}var a=r.charCodeAt(o);a<128||e?n(a):a<2048?(n(192|a>>>6),n(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|r.charCodeAt(++o)&1023,n(240|a>>>18),n(128|a>>>12&63),n(128|a>>>6&63),n(128|a&63)):(n(224|a>>>12),n(128|a>>>6&63),n(128|a&63))}return jn(s,0,i)}function Zc(r,e){var t="";if(!e&&typeof TextDecoder!="undefined")return new TextDecoder().decode(r);for(var s=0;s<r.length;){var i=r[s++];i<128||e?t+=String.fromCharCode(i):i<224?t+=String.fromCharCode((i&31)<<6|r[s++]&63):i<240?t+=String.fromCharCode((i&15)<<12|(r[s++]&63)<<6|r[s++]&63):(i=((i&15)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023))}return t}const qi="v1",Qb=r=>{const e=ae(R({},r),{v:qi});return Zc(qb(Yc(JSON.stringify(e))),!0)},ev=r=>{if(typeof r!="string")return r;try{const e=JSON.parse(r);if(e.timestamp)return e}catch(e){}try{const e=JSON.parse(Zc(Kb(Yc(r,!0))));if(e.v===qi)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${qi}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};exports.EventType=O;exports.IncrementalSource=A;exports.MouseInteractions=Z;exports.Replayer=Tb;exports.ReplayerEvents=Y;exports.addCustomEvent=_b;exports.canvasMutation=Gi;exports.flushCustomEventQueue=kb;exports.freezePage=Lb;exports.getVersion=Db;exports.isRecording=$b;exports.pack=Qb;exports.record=Ce;exports.takeFullSnapshot=Pb;exports.unpack=ev;exports.utils=Og;exports.version=Ob;
|
|
93
93
|
;if (typeof module.exports == "object" && typeof exports == "object") {
|
|
94
94
|
var __cp = (to, from, except, desc) => {
|
|
95
95
|
if ((from && typeof from === "object") || typeof from === "function") {
|