@applitools/nlp-web-runner 5.16.0 → 5.17.0-dev.240c8ac59
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/_inline/_chunks/rolldown-runtime-D7D4PA-g.js +1 -1
- package/dist/_inline/_externals/nlp-runner.externals.json +5 -5
- package/dist/_inline/assets/{extract-ax-tree-DbK-5fPe.js → extract-ax-tree-BoQlk00-.js} +1 -1
- package/dist/_inline/assets/index-DDs3RDNV.html +10 -0
- package/dist/_inline/assets/mock-FmX1aJGy.html +36 -0
- package/dist/_inline/assets/{recorder-DNoRX6KO.js → recorder-YUoRBu4F.js} +1 -1
- package/dist/_inline/assets/{session-replay-CIK-O8Jw.js → session-replay-BbzxeL6s.js} +3 -3
- package/dist/_inline/nlp-runner/web/index.d.ts +4170 -1940
- package/dist/_inline/nlp-runner/web/index.js +1 -1
- package/package.json +7 -6
|
@@ -50,7 +50,7 @@ https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.p
|
|
|
50
50
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
51
51
|
https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),hi=v,v.default=v,hi}let B=Ln(_i());B.stringify,B.fromJSON,B.plugin,B.parse,B.list,B.document,B.comment,B.atRule,B.rule,B.decl,B.root,B.CssSyntaxError,B.Declaration,B.Container,B.Processor,B.Document,B.Comment,B.Warning,B.AtRule,B.Result,B.Input,B.Rule,B.Root,B.Node;var vi=class e{constructor(...e){R(this,`parentElement`,null),R(this,`parentNode`,null),R(this,`ownerDocument`),R(this,`firstChild`,null),R(this,`lastChild`,null),R(this,`previousSibling`,null),R(this,`nextSibling`,null),R(this,`ELEMENT_NODE`,1),R(this,`TEXT_NODE`,3),R(this,`nodeType`),R(this,`nodeName`),R(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}};let yi={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},bi={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},xi={},Si={},Ci=()=>!!globalThis.Zone;function wi(e){if(xi[e])return xi[e];let t=globalThis[e],n=t.prototype,r=e in yi?yi[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in bi?bi[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!Ci())return xi[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),Si[e]=()=>r.remove()):r.remove(),xi[e]=a}catch{return n}}let Ti={};function V(e,t,n){let r=`${e}.${String(n)}`;if(Ti[r])return Ti[r].call(t);let i=wi(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(Ti[r]=a,a.call(t)):t[n]}let Ei={};function Di(e,t,n){let r=`${e}.${String(n)}`;if(Ei[r])return Ei[r].bind(t);let i=wi(e)[n];return typeof i==`function`?(Ei[r]=i,i.bind(t)):t[n]}function Oi(e){return V(`Node`,e,`ownerDocument`)}function ki(e){return V(`Node`,e,`childNodes`)}function Ai(e){return V(`Node`,e,`parentNode`)}function ji(e){return V(`Node`,e,`parentElement`)}function Mi(e){return V(`Node`,e,`textContent`)}function Ni(e,t){return Di(`Node`,e,`contains`)(t)}function Pi(e){return Di(`Node`,e,`getRootNode`)()}function Fi(e){return!e||!(`host`in e)?null:V(`ShadowRoot`,e,`host`)}function Ii(e){return e.styleSheets}function Li(e){return!e||!(`shadowRoot`in e)?null:V(`Element`,e,`shadowRoot`)}function Ri(e,t){return V(`Element`,e,`querySelector`)(t)}function zi(e,t){return V(`Element`,e,`querySelectorAll`)(t)}function Bi(){return[wi(`MutationObserver`).constructor,Si.MutationObserver??(()=>{})]}let Vi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Vi=()=>new Date().getTime());function Hi(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}let H={ownerDocument:Oi,childNodes:ki,parentNode:Ai,parentElement:ji,textContent:Mi,contains:Ni,getRootNode:Pi,host:Fi,styleSheets:Ii,shadowRoot:Li,querySelector:Ri,querySelectorAll:zi,nowTimestamp:Vi,mutationObserverCtor:Bi,patch:Hi};function U(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let Ui=`Please stop import mirror directly. Instead of that,\r
|
|
52
52
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
53
|
-
or you can use record.mirror to access the mirror instance during recording.`,Wi={map:{},getId(){return console.error(Ui),-1},getNode(){return console.error(Ui),null},removeNodeFromMap(){console.error(Ui)},has(){return console.error(Ui),!1},reset(){console.error(Ui)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Wi=new Proxy(Wi,{get(e,t,n){return t===`map`&&console.error(Ui),Reflect.get(e,t,n)}}));function Gi(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Ki(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Ki(e,t,a||{},!0)}function qi(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&H.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&H.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function Ji(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Yi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xi(e){return e?e.nodeType===e.ELEMENT_NODE?e:H.parentElement(e):null}function W(e,t,n,r){if(!e)return!1;let i=Xi(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(Ve(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function Zi(e,t){return t.getId(e)!==-1}function Qi(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===-2}function $i(e,t){if(A(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=H.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?$i(r,t):!0}function ea(e){return!!e.changedTouches}function ta(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function na(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function ra(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function ia(e){return e?e instanceof vi&&`shadowRoot`in e?!!e.shadowRoot:!!H.shadowRoot(e):!1}var aa=class{constructor(){n(this,`id`,1),n(this,`styleIDMap`,new WeakMap),n(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function oa(e){let t=null;return`getRootNode`in e&&H.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&H.host(H.getRootNode(e))&&(t=H.host(H.getRootNode(e))),t}function sa(e){let t=e,n;for(;n=oa(t);)t=n;return t}function ca(e){let t=H.ownerDocument(e);if(!t)return!1;let n=sa(e);return H.contains(t,n)}function la(e){let t=H.ownerDocument(e);return t?H.contains(t,e)||ca(e):!1}var G=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e[e.Asset=7]=`Asset`,e))(G||{}),K=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(K||{}),q=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(q||{}),J=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(J||{}),ua=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(ua||{}),da=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(da||{}),fa=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(fa||{});function pa(e){return`__ln`in e}var ma=class{constructor(){n(this,`length`,0),n(this,`head`,null),n(this,`tail`,null)}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pa(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pa(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.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){let 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--)}};let ha=(e,t)=>`${e}@${t}`;var ga=class{constructor(){n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`texts`,[]),n(this,`attributes`,[]),n(this,`attributeMap`,new WeakMap),n(this,`removes`,[]),n(this,`mapRemoves`,[]),n(this,`movedMap`,{}),n(this,`addedSet`,new Set),n(this,`movedSet`,new Set),n(this,`droppedSet`,new Set),n(this,`removesSubTreeCache`,new Set),n(this,`mutationCb`),n(this,`blockClass`),n(this,`blockSelector`),n(this,`maskTextClass`),n(this,`maskTextSelector`),n(this,`inlineStylesheet`),n(this,`maskInputOptions`),n(this,`maskTextFn`),n(this,`maskInputFn`),n(this,`keepIframeSrcFn`),n(this,`recordCanvas`),n(this,`inlineImages`),n(this,`slimDOMOptions`),n(this,`dataURLOptions`),n(this,`doc`),n(this,`mirror`),n(this,`iframeManager`),n(this,`stylesheetManager`),n(this,`shadowDomManager`),n(this,`canvasManager`),n(this,`processedNodeManager`),n(this,`unattachedDoc`),n(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),n(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new ma,r=e=>{let t=e,n=-2;for(;n===-2;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{let a=H.parentNode(i);if(!a||!la(i))return;let o=!1;if(i.nodeType===Node.TEXT_NODE){let e=a.tagName;if(e===`TEXTAREA`)return;e===`STYLE`&&this.addedSet.has(a)&&(o=!0)}let s=A(a)?this.mirror.getId(oa(i)):this.mirror.getId(a),c=r(i);if(s===-1||c===-1)return n.addNode(i);let l=Ze(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,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:e=>{na(e,this.mirror)&&this.iframeManager.addIframe(e),ra(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ia(i)&&this.shadowDomManager.addShadowRoot(H.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:o});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)ya(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(H.parentNode(e))||i(e);for(let e of this.addedSet)!xa(this.droppedSet,e)&&!ya(this.removesSubTreeCache,e,this.mirror)||xa(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(H.parentNode(a.value)),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(H.parentNode(n.value));if(r(n.value)===-1)continue;if(t!==-1){e=n;break}else{let t=n.value,r=H.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let t=H.host(r);if(this.mirror.getId(t)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>{let t=e.node,n=H.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.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(o))}),n(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));let n=Array.from(H.childNodes(e),e=>H.textContent(e)||``).join(``);t.attributes.value=P({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:me(e),value:n,maskInputFn:this.maskInputFn})}),n(this,`processMutation`,e=>{if(!Qi(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=H.textContent(e.target);!W(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:He(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xi(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let e=me(t);r=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(W(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!ze(t.tagName,n))if(i.attributes[n]=Re(this.doc,de(t.tagName),de(n),r),n===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}else n===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?i.attributes.rr_open_mode=`modal`:i.attributes.rr_open_mode=`non-modal`);break}case`childList`:if(W(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=>{let n=this.mirror.getId(t),r=A(e.target)?this.mirror.getId(H.host(e.target)):this.mirror.getId(e.target);W(e.target,this.blockClass,this.blockSelector,!1)||Qi(t,this.mirror,this.slimDOMOptions)||!Zi(t,this.mirror)||(this.addedSet.has(t)?(_a(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||$i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ha(n,r)]?_a(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:A(e.target)&&j(e.target)?!0:void 0}),va(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}),n(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Qi(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[ha(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);W(e,this.blockClass,this.blockSelector,!1)||(H.childNodes(e).forEach(e=>this.genAdds(e)),ia(e)&&H.childNodes(H.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`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()}};function _a(e,t){e.delete(t),H.childNodes(t).forEach(t=>_a(e,t))}function va(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),H.childNodes(e).forEach(e=>n.push(e)))}}function ya(e,t,n){return e.size===0?!1:ba(e,t)}function ba(e,t,n){let r=H.parentNode(t);return r?e.has(r):!1}function xa(e,t){return e.size===0?!1:Sa(e,t)}function Sa(e,t){let n=H.parentNode(t);return n?e.has(n)?!0:Sa(e,n):!1}let Ca;function wa(e){Ca=e}function Ta(){Ca=void 0}let Y=e=>Ca?(...t)=>{try{return e(...t)}catch(e){if(Ca&&Ca(e)===!0)return;throw e}}:e,Ea=[];function Da(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Oa(e,t){let n=new ga;Ea.push(n),n.init(e);let[r,i]=Bi(),a=new r(Y(n.processMutations.bind(n)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,i]}function ka({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=Gi(Y(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=Y(Gi(Y(e=>{let t=Da(e),{clientX:n,clientY:i}=ea(e)?e.changedTouches[0]:e;s||=Vi(),o.push({x:n,y:i,id:r.getId(t),timeOffset:Vi()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?K.Drag:e instanceof MouseEvent?K.MouseMove:K.TouchMove)}),i,{trailing:!1})),u=[U(`mousemove`,l,n),U(`touchmove`,l,n),U(`drag`,l,n)];return Y(()=>{u.forEach(e=>e())})}function Aa({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=Da(a);if(W(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=J.Mouse;break;case`touch`:s=J.Touch;break;case`pen`:s=J.Pen;break}s===J.Touch?q[t]===q.MouseDown?l=`TouchStart`:q[t]===q.MouseUp&&(l=`TouchEnd`):J.Pen}else ea(a)&&(s=J.Touch);s===null?q[t]===q.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===J.Touch||l.startsWith(`Mouse`)&&s===J.Mouse)&&(s=null));let u=ea(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;Y(e)({type:q[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(q).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=de(e),r=l(e);if(window.PointerEvent)switch(q[e]){case q.MouseDown:case q.MouseUp:n=n.replace(`mouse`,`pointer`);break;case q.TouchStart:case q.TouchEnd:return}s.push(U(n,r,t))}),Y(()=>{s.forEach(e=>e())})}function ja({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return U(`scroll`,Y(Gi(Y(a=>{let o=Da(a);if(!o||W(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=qi(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function Ma({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return U(`resize`,Y(Gi(Y(()=>{let t=Ji(),i=Yi();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}let Na=[`INPUT`,`TEXTAREA`,`SELECT`],Pa=new WeakMap;function Fa({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Da(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=H.parentElement(n)),!n||!d||Na.indexOf(d)<0||W(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=me(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=P({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=Pa.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pa.set(t,r);let i=n.getId(t);Y(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>U(e,Y(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>Ki(e[0],e[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{p.forEach(e=>e())})}function Ia(e){let t=[];function n(e,t){if(qa(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||qa(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||qa(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||qa(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);return t.unshift(r),n(e.parentRule,t)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function La(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Ra({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=La(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=La(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=La(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=La(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};Ja(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(Ja(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),Ja(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),Ja(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Y((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=La(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Ia(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=La(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...Ia(i),o]}]}),r.apply(i,a)})})}),Y(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function za({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(H.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),Y(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Ba({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Y((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=La(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:Ia(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Y((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=La(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:Ia(a.parentRule)}),i.apply(a,s)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Va({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=Y(a=>Gi(Y(i=>{let o=Da(i);if(!o||W(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[U(`play`,o(da.Play),a),U(`pause`,o(da.Pause),a),U(`seeked`,o(da.Seeked),a),U(`volumechange`,o(da.VolumeChange),a),U(`ratechange`,o(da.RateChange),a)];return Y(()=>{s.forEach(e=>e())})}function Ha({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Hi(t.fonts,`add`,function(t){return function(n){return setTimeout(Y(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),Y(()=>{r.forEach(e=>e())})}function Ua(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=Y(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);W(a,r,i,!0)||W(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),U(`selectionchange`,s)}function Wa({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Hi(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function Ga(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function Ka(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Ga(e,t);let r,i=()=>{};e.recordDOM&&([r,i]=Oa(e,e.doc));let a=ka(e),o=Aa(e),s=ja(e),c=Ma(e,{win:n}),l=Fa(e),u=Va(e),d=()=>{},f=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(d=Ra(e,{win:n}),f=za(e,e.doc),p=Ba(e,{win:n}),e.collectFonts&&(m=Ha(e)));let h=Ua(e),g=Wa(e),_=[];for(let t of e.plugins)_.push(t.observer(t.callback,n,t.options));return Y(()=>{Ea.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g(),_.forEach(e=>e())})}function qa(e){return window[e]!==void 0}function Ja(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var Ya=class{constructor(e){n(this,`iframeIdToRemoteIdMap`,new WeakMap),n(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}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}},Xa=class{constructor(e){n(this,`iframes`,new WeakMap),n(this,`crossOriginIframeMap`,new WeakMap),n(this,`crossOriginIframeMirror`,new Ya(De)),n(this,`crossOriginIframeStyleMirror`),n(this,`crossOriginIframeRootIdMap`,new WeakMap),n(this,`mirror`),n(this,`mutationCb`),n(this,`wrappedEmit`),n(this,`loadListener`),n(this,`stylesheetManager`),n(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ya(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.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){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case G.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:G.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case G.Meta:case G.Load:case G.DomContentLoaded:return!1;case G.Plugin:return t;case G.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case G.IncrementalSnapshot:switch(t.data.source){case K.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case K.Drag:case K.TouchMove:case K.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(t.data,e,[`id`]),t;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case K.Font:return t;case K.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case K.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==fa.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Za=class{constructor(e){n(this,`shadowDoms`,new WeakSet),n(this,`mutationCb`),n(this,`scrollCb`),n(this,`bypassOptions`),n(this,`mirror`),n(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(!j(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[n]=Oa({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ja({...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(H.host(e))),this.restoreHandlers.push(za({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){let n=this;this.restoreHandlers.push(Hi(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=H.shadowRoot(this);return a&&la(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Qa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,$a=typeof Uint8Array>`u`?[]:new Uint8Array(256),eo=0;eo<Qa.length;eo++)$a[Qa.charCodeAt(eo)]=eo;var to=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Qa[t[n]>>2],i+=Qa[(t[n]&3)<<4|t[n+1]>>4],i+=Qa[(t[n+1]&15)<<2|t[n+2]>>6],i+=Qa[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i};let no=new Map;function ro(e,t){let n=no.get(e);return n||(n=new Map,no.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}let io=(e,t,n)=>{if(!e||!(so(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=ro(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function ao(e,t,n){if(e instanceof Array)return e.map(e=>ao(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:to(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ao(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}else if(e instanceof HTMLCanvasElement)return{rr_type:`HTMLImageElement`,src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ao(e.data,t,n),e.width,e.height]};else if(so(e,t)||typeof e==`object`)return{rr_type:e.constructor.name,index:io(e,t,n)};return e}let oo=(e,t,n)=>e.map(e=>ao(e,t,n)),so=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function co(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=Hi(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return W(this.canvas,n,r,!0)||setTimeout(()=>{let n=oo(a,t,this);e(this.canvas,{type:ua[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=Ki(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:ua[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}function lo(e){return e===`experimental-webgl`?`webgl`:e}function uo(e,t,n,r){let i=[];try{let a=Hi(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!W(this,t,n,!0)){let e=lo(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e))if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function fo(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=Hi(e,c,function(e){return function(...o){let s=e.apply(this,o);if(io(s,a,this),`tagName`in this.canvas&&!W(this.canvas,r,i,!0)){let e={type:t,property:c,args:oo(o,a,this)};n(this.canvas,e)}return s}});o.push(s)}catch{let r=Ki(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function po(e,t,n,r){let i=[];return t.WebGLRenderingContext!==void 0&&i.push(...fo(t.WebGLRenderingContext.prototype,ua.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...fo(t.WebGL2RenderingContext.prototype,ua.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}let mo=typeof self<`u`&&self.Blob&&new Blob([`(function() {
|
|
53
|
+
or you can use record.mirror to access the mirror instance during recording.`,Wi={map:{},getId(){return console.error(Ui),-1},getNode(){return console.error(Ui),null},removeNodeFromMap(){console.error(Ui)},has(){return console.error(Ui),!1},reset(){console.error(Ui)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Wi=new Proxy(Wi,{get(e,t,n){return t===`map`&&console.error(Ui),Reflect.get(e,t,n)}}));function Gi(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Ki(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Ki(e,t,a||{},!0)}function qi(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&H.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&H.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function Ji(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Yi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xi(e){return e?e.nodeType===e.ELEMENT_NODE?e:H.parentElement(e):null}function W(e,t,n,r){if(!e)return!1;let i=Xi(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(Ve(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function Zi(e,t){return t.getId(e)!==-1}function Qi(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===-2}function $i(e,t){if(A(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=H.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?$i(r,t):!0}function ea(e){return!!e.changedTouches}function ta(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function na(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function ra(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function ia(e){return e?e instanceof vi&&`shadowRoot`in e?!!e.shadowRoot:!!H.shadowRoot(e):!1}var aa=class{constructor(){n(this,`id`,1),n(this,`styleIDMap`,new WeakMap),n(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function oa(e){let t=null;return`getRootNode`in e&&H.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&H.host(H.getRootNode(e))&&(t=H.host(H.getRootNode(e))),t}function sa(e){let t=e,n;for(;n=oa(t);)t=n;return t}function ca(e){let t=H.ownerDocument(e);if(!t)return!1;let n=sa(e);return H.contains(t,n)}function la(e){let t=H.ownerDocument(e);return t?H.contains(t,e)||ca(e):!1}var G=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e[e.Asset=7]=`Asset`,e))(G||{}),K=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(K||{}),q=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(q||{}),J=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(J||{}),ua=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(ua||{}),da=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(da||{}),fa=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(fa||{});function pa(e){return`__ln`in e}var ma=class{constructor(){n(this,`length`,0),n(this,`head`,null),n(this,`tail`,null)}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pa(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pa(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.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){let 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--)}};let ha=(e,t)=>`${e}@${t}`;var ga=class{constructor(){n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`texts`,[]),n(this,`attributes`,[]),n(this,`attributeMap`,new WeakMap),n(this,`removes`,[]),n(this,`mapRemoves`,[]),n(this,`movedMap`,{}),n(this,`addedSet`,new Set),n(this,`movedSet`,new Set),n(this,`droppedSet`,new Set),n(this,`removesSubTreeCache`,new Set),n(this,`mutationCb`),n(this,`blockClass`),n(this,`blockSelector`),n(this,`maskTextClass`),n(this,`maskTextSelector`),n(this,`inlineStylesheet`),n(this,`maskInputOptions`),n(this,`maskTextFn`),n(this,`maskInputFn`),n(this,`keepIframeSrcFn`),n(this,`recordCanvas`),n(this,`inlineImages`),n(this,`slimDOMOptions`),n(this,`dataURLOptions`),n(this,`doc`),n(this,`mirror`),n(this,`iframeManager`),n(this,`stylesheetManager`),n(this,`shadowDomManager`),n(this,`canvasManager`),n(this,`processedNodeManager`),n(this,`unattachedDoc`),n(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),n(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new ma,r=e=>{let t=e,n=-2;for(;n===-2;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{let a=H.parentNode(i);if(!a||!la(i))return;let o=!1;if(i.nodeType===Node.TEXT_NODE){let e=a.tagName;if(e===`TEXTAREA`)return;e===`STYLE`&&this.addedSet.has(a)&&(o=!0)}let s=A(a)?this.mirror.getId(oa(i)):this.mirror.getId(a),c=r(i);if(s===-1||c===-1)return n.addNode(i);let l=Ze(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,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:e=>{na(e,this.mirror)&&this.iframeManager.addIframe(e),ra(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ia(i)&&this.shadowDomManager.addShadowRoot(H.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:o});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)ya(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(H.parentNode(e))||i(e);for(let e of this.addedSet)!xa(this.droppedSet,e)&&!ya(this.removesSubTreeCache,e,this.mirror)||xa(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(H.parentNode(a.value)),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(H.parentNode(n.value));if(r(n.value)===-1)continue;if(t!==-1){e=n;break}else{let t=n.value,r=H.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let t=H.host(r);if(this.mirror.getId(t)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>{let t=e.node,n=H.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.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(o))}),n(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));let n=Array.from(H.childNodes(e),e=>H.textContent(e)||``).join(``);t.attributes.value=P({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:me(e),value:n,maskInputFn:this.maskInputFn})}),n(this,`processMutation`,e=>{if(!Qi(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=H.textContent(e.target);!W(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:He(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xi(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let e=me(t);r=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(W(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!ze(t.tagName,n))if(i.attributes[n]=Re(this.doc,de(t.tagName),de(n),r),n===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}else n===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?i.attributes.rr_open_mode=`modal`:i.attributes.rr_open_mode=`non-modal`);break}case`childList`:if(W(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=>{let n=this.mirror.getId(t),r=A(e.target)?this.mirror.getId(H.host(e.target)):this.mirror.getId(e.target);W(e.target,this.blockClass,this.blockSelector,!1)||Qi(t,this.mirror,this.slimDOMOptions)||!Zi(t,this.mirror)||(this.addedSet.has(t)?(_a(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||$i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ha(n,r)]?_a(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:A(e.target)&&j(e.target)?!0:void 0}),va(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}),n(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Qi(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[ha(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);W(e,this.blockClass,this.blockSelector,!1)||(H.childNodes(e).forEach(e=>this.genAdds(e)),ia(e)&&H.childNodes(H.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`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()}};function _a(e,t){e.delete(t),H.childNodes(t).forEach(t=>_a(e,t))}function va(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),H.childNodes(e).forEach(e=>n.push(e)))}}function ya(e,t,n){return e.size===0?!1:ba(e,t)}function ba(e,t,n){let r=H.parentNode(t);return r?e.has(r):!1}function xa(e,t){return e.size===0?!1:Sa(e,t)}function Sa(e,t){let n=H.parentNode(t);return n?e.has(n)?!0:Sa(e,n):!1}let Ca;function wa(e){Ca=e}function Ta(){Ca=void 0}let Y=e=>Ca?(...t)=>{try{return e(...t)}catch(e){if(Ca&&Ca(e)===!0)return;throw e}}:e,Ea=[];function Da(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Oa(e,t){let n=new ga;Ea.push(n),n.init(e);let[r,i]=Bi(),a=new r(Y(n.processMutations.bind(n)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,i]}function ka({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=Gi(Y(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=Y(Gi(Y(e=>{let t=Da(e),{clientX:n,clientY:i}=ea(e)?e.changedTouches[0]:e;s||=Vi(),o.push({x:n,y:i,id:r.getId(t),timeOffset:Vi()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?K.Drag:e instanceof MouseEvent?K.MouseMove:K.TouchMove)}),i,{trailing:!1})),u=[U(`mousemove`,l,n),U(`touchmove`,l,n),U(`drag`,l,n)];return Y(()=>{u.forEach(e=>e())})}function Aa({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=Da(a);if(W(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=J.Mouse;break;case`touch`:s=J.Touch;break;case`pen`:s=J.Pen;break}s===J.Touch?q[t]===q.MouseDown?l=`TouchStart`:q[t]===q.MouseUp&&(l=`TouchEnd`):J.Pen}else ea(a)&&(s=J.Touch);s===null?q[t]===q.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===J.Touch||l.startsWith(`Mouse`)&&s===J.Mouse)&&(s=null));let u=ea(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;Y(e)({type:q[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(q).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=de(e),r=l(e);if(window.PointerEvent)switch(q[e]){case q.MouseDown:case q.MouseUp:n=n.replace(`mouse`,`pointer`);break;case q.TouchStart:case q.TouchEnd:return}s.push(U(n,r,t))}),Y(()=>{s.forEach(e=>e())})}function ja({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return U(`scroll`,Y(Gi(Y(a=>{let o=Da(a);if(!o||W(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=qi(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function Ma({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return U(`resize`,Y(Gi(Y(()=>{let t=Ji(),i=Yi();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}let Na=[`INPUT`,`TEXTAREA`,`SELECT`],Pa=new WeakMap;function Fa({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Da(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=H.parentElement(n)),!n||!d||Na.indexOf(d)<0||W(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=me(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=P({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=Pa.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pa.set(t,r);let i=n.getId(t);Y(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>U(e,Y(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>Ki(e[0],e[1],{set(){Y(d)({target:this,isTrusted:!1})}},!1,m))),Y(()=>{p.forEach(e=>e())})}function Ia(e){let t=[];function n(e,t){if(Ka(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||Ka(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||Ka(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||Ka(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);return t.unshift(r),n(e.parentRule,t)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function X(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function La({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Y((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=X(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};qa(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(qa(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),qa(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),qa(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Y((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=X(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Ia(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Y((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...Ia(i),o]}]}),r.apply(i,a)})})}),Y(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function Ra({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(H.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),Y(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function za({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Y((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=X(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:Ia(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Y((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=X(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:Ia(a.parentRule)}),i.apply(a,s)})}),Y(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ba({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=Y(a=>Gi(Y(i=>{let o=Da(i);if(!o||W(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[U(`play`,o(da.Play),a),U(`pause`,o(da.Pause),a),U(`seeked`,o(da.Seeked),a),U(`volumechange`,o(da.VolumeChange),a),U(`ratechange`,o(da.RateChange),a)];return Y(()=>{s.forEach(e=>e())})}function Va({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Hi(t.fonts,`add`,function(t){return function(n){return setTimeout(Y(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),Y(()=>{r.forEach(e=>e())})}function Ha(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=Y(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);W(a,r,i,!0)||W(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),U(`selectionchange`,s)}function Ua({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Hi(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function Wa(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function Ga(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Wa(e,t);let r,i=()=>{};e.recordDOM&&([r,i]=Oa(e,e.doc));let a=ka(e),o=Aa(e),s=ja(e),c=Ma(e,{win:n}),l=Fa(e),u=Ba(e),d=()=>{},f=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(d=La(e,{win:n}),f=Ra(e,e.doc),p=za(e,{win:n}),e.collectFonts&&(m=Va(e)));let h=Ha(e),g=Ua(e),_=[];for(let t of e.plugins)_.push(t.observer(t.callback,n,t.options));return Y(()=>{Ea.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g(),_.forEach(e=>e())})}function Ka(e){return window[e]!==void 0}function qa(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var Ja=class{constructor(e){n(this,`iframeIdToRemoteIdMap`,new WeakMap),n(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}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}},Ya=class{constructor(e){n(this,`iframes`,new WeakMap),n(this,`crossOriginIframeMap`,new WeakMap),n(this,`crossOriginIframeMirror`,new Ja(De)),n(this,`crossOriginIframeStyleMirror`),n(this,`crossOriginIframeRootIdMap`,new WeakMap),n(this,`mirror`),n(this,`mutationCb`),n(this,`wrappedEmit`),n(this,`loadListener`),n(this,`stylesheetManager`),n(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ja(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.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){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case G.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:G.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case G.Meta:case G.Load:case G.DomContentLoaded:return!1;case G.Plugin:return t;case G.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case G.IncrementalSnapshot:switch(t.data.source){case K.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case K.Drag:case K.TouchMove:case K.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(t.data,e,[`id`]),t;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case K.Font:return t;case K.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case K.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==fa.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Xa=class{constructor(e){n(this,`shadowDoms`,new WeakSet),n(this,`mutationCb`),n(this,`scrollCb`),n(this,`bypassOptions`),n(this,`mirror`),n(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(!j(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[n]=Oa({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ja({...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(H.host(e))),this.restoreHandlers.push(Ra({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){let n=this;this.restoreHandlers.push(Hi(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=H.shadowRoot(this);return a&&la(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Za=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Qa=typeof Uint8Array>`u`?[]:new Uint8Array(256),$a=0;$a<Za.length;$a++)Qa[Za.charCodeAt($a)]=$a;var eo=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Za[t[n]>>2],i+=Za[(t[n]&3)<<4|t[n+1]>>4],i+=Za[(t[n+1]&15)<<2|t[n+2]>>6],i+=Za[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i};let to=new Map;function no(e,t){let n=to.get(e);return n||(n=new Map,to.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}let ro=(e,t,n)=>{if(!e||!(oo(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=no(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function io(e,t,n){if(e instanceof Array)return e.map(e=>io(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:eo(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[io(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}else if(e instanceof HTMLCanvasElement)return{rr_type:`HTMLImageElement`,src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[io(e.data,t,n),e.width,e.height]};else if(oo(e,t)||typeof e==`object`)return{rr_type:e.constructor.name,index:ro(e,t,n)};return e}let ao=(e,t,n)=>e.map(e=>io(e,t,n)),oo=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function so(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=Hi(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return W(this.canvas,n,r,!0)||setTimeout(()=>{let n=ao(a,t,this);e(this.canvas,{type:ua[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=Ki(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:ua[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}function co(e){return e===`experimental-webgl`?`webgl`:e}function lo(e,t,n,r){let i=[];try{let a=Hi(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!W(this,t,n,!0)){let e=co(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e))if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function uo(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=Hi(e,c,function(e){return function(...o){let s=e.apply(this,o);if(ro(s,a,this),`tagName`in this.canvas&&!W(this.canvas,r,i,!0)){let e={type:t,property:c,args:ao(o,a,this)};n(this.canvas,e)}return s}});o.push(s)}catch{let r=Ki(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function fo(e,t,n,r){let i=[];return t.WebGLRenderingContext!==void 0&&i.push(...uo(t.WebGLRenderingContext.prototype,ua.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...uo(t.WebGL2RenderingContext.prototype,ua.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}let po=typeof self<`u`&&self.Blob&&new Blob([`(function() {
|
|
54
54
|
"use strict";
|
|
55
55
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
56
56
|
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
@@ -125,7 +125,7 @@ or you can use record.mirror to access the mirror instance during recording.`,Wi
|
|
|
125
125
|
};
|
|
126
126
|
})();
|
|
127
127
|
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
128
|
-
`],{type:`text/javascript;charset=utf-8`});function ho(e){let t;try{if(t=mo&&(self.URL||self.webkitURL).createObjectURL(mo),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,(function()%20%7B%0A%20%20%22use%20strict%22%3B%0A%20%20var%20chars%20%3D%20%22ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%2B%2F%22%3B%0A%20%20var%20lookup%20%3D%20typeof%20Uint8Array%20%3D%3D%3D%20%22undefined%22%20%3F%20%5B%5D%20%3A%20new%20Uint8Array(256)%3B%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20chars.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20lookup%5Bchars.charCodeAt(i)%5D%20%3D%20i%3B%0A%20%20%7D%0A%20%20var%20encode%20%3D%20function(arraybuffer)%20%7B%0A%20%20%20%20var%20bytes%20%3D%20new%20Uint8Array(arraybuffer)%2C%20i2%2C%20len%20%3D%20bytes.length%2C%20base64%20%3D%20%22%22%3B%0A%20%20%20%20for%20(i2%20%3D%200%3B%20i2%20%3C%20len%3B%20i2%20%2B%3D%203)%20%7B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5Bbytes%5Bi2%5D%20%3E%3E%202%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5B(bytes%5Bi2%5D%20%26%203)%20%3C%3C%204%20%7C%20bytes%5Bi2%20%2B%201%5D%20%3E%3E%204%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5B(bytes%5Bi2%20%2B%201%5D%20%26%2015)%20%3C%3C%202%20%7C%20bytes%5Bi2%20%2B%202%5D%20%3E%3E%206%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5Bbytes%5Bi2%20%2B%202%5D%20%26%2063%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20(len%20%25%203%20%3D%3D%3D%202)%20%7B%0A%20%20%20%20%20%20base64%20%3D%20base64.substring(0%2C%20base64.length%20-%201)%20%2B%20%22%3D%22%3B%0A%20%20%20%20%7D%20else%20if%20(len%20%25%203%20%3D%3D%3D%201)%20%7B%0A%20%20%20%20%20%20base64%20%3D%20base64.substring(0%2C%20base64.length%20-%202)%20%2B%20%22%3D%3D%22%3B%0A%20%20%20%20%7D%0A%20%20%20%20return%20base64%3B%0A%20%20%7D%3B%0A%20%20const%20lastBlobMap%20%3D%20%2F*%20%40__PURE__%20*%2F%20new%20Map()%3B%0A%20%20const%20transparentBlobMap%20%3D%20%2F*%20%40__PURE__%20*%2F%20new%20Map()%3B%0A%20%20async%20function%20getTransparentBlobFor(width%2C%20height%2C%20dataURLOptions)%20%7B%0A%20%20%20%20const%20id%20%3D%20%60%24%7Bwidth%7D-%24%7Bheight%7D%60%3B%0A%20%20%20%20if%20(%22OffscreenCanvas%22%20in%20globalThis)%20%7B%0A%20%20%20%20%20%20if%20(transparentBlobMap.has(id))%20return%20transparentBlobMap.get(id)%3B%0A%20%20%20%20%20%20const%20offscreen%20%3D%20new%20OffscreenCanvas(width%2C%20height)%3B%0A%20%20%20%20%20%20offscreen.getContext(%222d%22)%3B%0A%20%20%20%20%20%20const%20blob%20%3D%20await%20offscreen.convertToBlob(dataURLOptions)%3B%0A%20%20%20%20%20%20const%20arrayBuffer%20%3D%20await%20blob.arrayBuffer()%3B%0A%20%20%20%20%20%20const%20base64%20%3D%20encode(arrayBuffer)%3B%0A%20%20%20%20%20%20transparentBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%20%20return%20base64%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20return%20%22%22%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20const%20worker%20%3D%20self%3B%0A%20%20worker.onmessage%20%3D%20async%20function(e)%20%7B%0A%20%20%20%20if%20(%22OffscreenCanvas%22%20in%20globalThis)%20%7B%0A%20%20%20%20%20%20const%20%7B%20id%2C%20bitmap%2C%20width%2C%20height%2C%20dataURLOptions%20%7D%20%3D%20e.data%3B%0A%20%20%20%20%20%20const%20transparentBase64%20%3D%20getTransparentBlobFor(%0A%20%20%20%20%20%20%20%20width%2C%0A%20%20%20%20%20%20%20%20height%2C%0A%20%20%20%20%20%20%20%20dataURLOptions%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20const%20offscreen%20%3D%20new%20OffscreenCanvas(width%2C%20height)%3B%0A%20%20%20%20%20%20const%20ctx%20%3D%20offscreen.getContext(%222d%22)%3B%0A%20%20%20%20%20%20ctx.drawImage(bitmap%2C%200%2C%200)%3B%0A%20%20%20%20%20%20bitmap.close()%3B%0A%20%20%20%20%20%20const%20blob%20%3D%20await%20offscreen.convertToBlob(dataURLOptions)%3B%0A%20%20%20%20%20%20const%20type%20%3D%20blob.type%3B%0A%20%20%20%20%20%20const%20arrayBuffer%20%3D%20await%20blob.arrayBuffer()%3B%0A%20%20%20%20%20%20const%20base64%20%3D%20encode(arrayBuffer)%3B%0A%20%20%20%20%20%20if%20(!lastBlobMap.has(id)%20%26%26%20await%20transparentBase64%20%3D%3D%3D%20base64)%20%7B%0A%20%20%20%20%20%20%20%20lastBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%20%20%20%20return%20worker.postMessage(%7B%20id%20%7D)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(lastBlobMap.get(id)%20%3D%3D%3D%20base64)%20return%20worker.postMessage(%7B%20id%20%7D)%3B%0A%20%20%20%20%20%20worker.postMessage(%7B%0A%20%20%20%20%20%20%20%20id%2C%0A%20%20%20%20%20%20%20%20type%2C%0A%20%20%20%20%20%20%20%20base64%2C%0A%20%20%20%20%20%20%20%20width%2C%0A%20%20%20%20%20%20%20%20height%0A%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20lastBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20return%20worker.postMessage(%7B%20id%3A%20e.data.id%20%7D)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%7D)()%3B%0A%2F%2F%23%20sourceMappingURL%3Dimage-bitmap-data-url-worker-IJpC7g_b.js.map%0A`,{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var go=class{constructor(e){n(this,`pendingCanvasMutations`,new Map),n(this,`rafStamps`,{latestId:0,invokeId:null}),n(this,`mirror`),n(this,`mutationCb`),n(this,`resetObservers`),n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:r,blockClass:i,blockSelector:a,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t===`all`&&this.initCanvasMutationObserver(r,i,a),o&&typeof t==`number`&&this.initCanvasFPSObserver(t,r,i,a,{dataURLOptions:s})}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,n,r,i){let a=uo(t,n,r,!0),o=new Map,s=new ho;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:ua[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{W(t,n,r,!0)||e.push(t)}),e},f=e=>{if(l&&e-l<c){u=requestAnimationFrame(f);return}l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=uo(e,t,n,!1),i=co(this.processMutation.bind(this),e,t,n),a=po(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},_o=class{constructor(e){n(this,`trackedLinkElements`,new WeakSet),n(this,`mutationCb`),n(this,`adoptedStyleSheetCb`),n(this,`styleMirror`,new aa),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;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:se(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vo=class{constructor(){n(this,`nodeMap`,new WeakMap),n(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==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(){}};let X,yo,bo,xo=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}let Z=ue();function Q(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,hooks:g,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:x=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:w=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:ee=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:D,keepIframeSrcFn:te=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ne}=e;wa(ne);let k=C?window.parent===window:!0,re=!1;if(!k)try{window.parent.document&&(re=!1)}catch{re=!0}if(k&&!t)throw Error(`emit function is required`);if(!k&&!re)return()=>{};b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),Z.reset();let A=d===!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}:f===void 0?{password:!0}:f,j=Ye(p);ta();let ie,ae=0,oe=e=>{for(let t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!re&&(e=_(e)),e};X=(e,i)=>{let a=e;if(a.timestamp=Vi(),Ea[0]?.isFrozen()&&a.type!==G.FullSnapshot&&!(a.type===G.IncrementalSnapshot&&a.data.source===K.Mutation)&&Ea.forEach(e=>e.unfreeze()),k)t?.(oe(a),i);else if(re){let e={type:`rrweb`,event:oe(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===G.FullSnapshot)ie=a,ae=0;else if(a.type===G.IncrementalSnapshot){if(a.data.source===K.Mutation&&a.data.isAttachIframe)return;ae++;let e=r&&ae>=r,t=n&&a.timestamp-ie.timestamp>n;(e||t)&&yo(!0)}};let se=e=>{X({type:G.IncrementalSnapshot,data:{source:K.Mutation,...e}})},ce=e=>X({type:G.IncrementalSnapshot,data:{source:K.Scroll,...e}}),le=e=>X({type:G.IncrementalSnapshot,data:{source:K.CanvasMutation,...e}}),M=new _o({mutationCb:se,adoptedStyleSheetCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.AdoptedStyleSheet,...e}})}),N=new Xa({mirror:Z,mutationCb:se,stylesheetManager:M,recordCrossOriginIframes:C,wrappedEmit:X});for(let e of D||[])e.getMirror&&e.getMirror({nodeMirror:Z,crossOriginIframeMirror:N.crossOriginIframeMirror,crossOriginIframeStyleMirror:N.crossOriginIframeStyleMirror});let ue=new vo;bo=new go({recordCanvas:S,mutationCb:le,win:window,blockClass:i,blockSelector:a,mirror:Z,sampling:v.canvas,dataURLOptions:y});let P=new Za({mutationCb:se,scrollCb:ce,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:A,dataURLOptions:y,maskTextFn:h,maskInputFn:m,recordCanvas:S,inlineImages:E,sampling:v,slimDOMOptions:j,iframeManager:N,stylesheetManager:M,canvasManager:bo,keepIframeSrcFn:te,processedNodeManager:ue},mirror:Z});yo=(e=!1)=>{if(!x)return;X({type:G.Meta,data:{href:window.location.href,width:Yi(),height:Ji()}},e),M.reset(),P.init(),Ea.forEach(e=>e.lock());let t=Qe(document,{mirror:Z,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:A,maskTextFn:h,maskInputFn:m,slimDOM:j,dataURLOptions:y,recordCanvas:S,inlineImages:E,onSerialize:e=>{na(e,Z)&&N.addIframe(e),ra(e,Z)&&M.trackLinkElement(e),ia(e)&&P.addShadowRoot(H.shadowRoot(e),document)},onIframeLoad:(e,t)=>{N.attachIframe(e,t),P.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{M.attachLinkElement(e,t)},keepIframeSrcFn:te});if(!t)return console.warn(`Failed to snapshot the document`);X({type:G.FullSnapshot,data:{node:t,initialOffset:qi(window)}},e),Ea.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&M.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document))};try{let e=[],t=e=>Y(Ka)({mutationCb:se,mousemoveCb:(e,t)=>X({type:G.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.MouseInteraction,...e}}),scrollCb:ce,viewportResizeCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.ViewportResize,...e}}),inputCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.Input,...e}}),mediaInteractionCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.MediaInteraction,...e}}),styleSheetRuleCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.StyleSheetRule,...e}}),styleDeclarationCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.StyleDeclaration,...e}}),canvasMutationCb:le,fontCb:e=>X({type:G.IncrementalSnapshot,data:{source:K.Font,...e}}),selectionCb:e=>{X({type:G.IncrementalSnapshot,data:{source:K.Selection,...e}})},customElementCb:e=>{X({type:G.IncrementalSnapshot,data:{source:K.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:A,inlineStylesheet:u,sampling:v,recordDOM:x,recordCanvas:S,inlineImages:E,userTriggeredOnInput:ee,collectFonts:T,doc:e,maskInputFn:m,maskTextFn:h,keepIframeSrcFn:te,blockSelector:a,slimDOMOptions:j,dataURLOptions:y,mirror:Z,iframeManager:N,stylesheetManager:M,shadowDomManager:P,processedNodeManager:ue,canvasManager:bo,ignoreCSSAttributes:O,plugins:(D?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>X({type:G.Plugin,data:{plugin:e.name,payload:t}})}))||[]},g);N.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{yo(),e.push(t(document)),xo=!0};return[`interactive`,`complete`].includes(document.readyState)?n():(e.push(U(`DOMContentLoaded`,()=>{X({type:G.DomContentLoaded,data:{}}),w===`DOMContentLoaded`&&n()})),e.push(U(`load`,()=>{X({type:G.Load,data:{}}),w===`load`&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes(`cross-origin`)||console.warn(e)}}),ue.destroy(),xo=!1,Ta()}}catch(e){console.warn(e)}}Q.addCustomEvent=(e,t)=>{if(!xo)throw Error(`please add custom event after start recording`);X({type:G.Custom,data:{tag:e,payload:t}})},Q.freezePage=()=>{Ea.forEach(e=>e.freeze())},Q.takeFullSnapshot=e=>{if(!xo)throw Error(`please take full snapshot after start recording`);yo(e)},Q.mirror=Z;
|
|
128
|
+
`],{type:`text/javascript;charset=utf-8`});function mo(e){let t;try{if(t=po&&(self.URL||self.webkitURL).createObjectURL(po),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,(function()%20%7B%0A%20%20%22use%20strict%22%3B%0A%20%20var%20chars%20%3D%20%22ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%2B%2F%22%3B%0A%20%20var%20lookup%20%3D%20typeof%20Uint8Array%20%3D%3D%3D%20%22undefined%22%20%3F%20%5B%5D%20%3A%20new%20Uint8Array(256)%3B%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20chars.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20lookup%5Bchars.charCodeAt(i)%5D%20%3D%20i%3B%0A%20%20%7D%0A%20%20var%20encode%20%3D%20function(arraybuffer)%20%7B%0A%20%20%20%20var%20bytes%20%3D%20new%20Uint8Array(arraybuffer)%2C%20i2%2C%20len%20%3D%20bytes.length%2C%20base64%20%3D%20%22%22%3B%0A%20%20%20%20for%20(i2%20%3D%200%3B%20i2%20%3C%20len%3B%20i2%20%2B%3D%203)%20%7B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5Bbytes%5Bi2%5D%20%3E%3E%202%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5B(bytes%5Bi2%5D%20%26%203)%20%3C%3C%204%20%7C%20bytes%5Bi2%20%2B%201%5D%20%3E%3E%204%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5B(bytes%5Bi2%20%2B%201%5D%20%26%2015)%20%3C%3C%202%20%7C%20bytes%5Bi2%20%2B%202%5D%20%3E%3E%206%5D%3B%0A%20%20%20%20%20%20base64%20%2B%3D%20chars%5Bbytes%5Bi2%20%2B%202%5D%20%26%2063%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20(len%20%25%203%20%3D%3D%3D%202)%20%7B%0A%20%20%20%20%20%20base64%20%3D%20base64.substring(0%2C%20base64.length%20-%201)%20%2B%20%22%3D%22%3B%0A%20%20%20%20%7D%20else%20if%20(len%20%25%203%20%3D%3D%3D%201)%20%7B%0A%20%20%20%20%20%20base64%20%3D%20base64.substring(0%2C%20base64.length%20-%202)%20%2B%20%22%3D%3D%22%3B%0A%20%20%20%20%7D%0A%20%20%20%20return%20base64%3B%0A%20%20%7D%3B%0A%20%20const%20lastBlobMap%20%3D%20%2F*%20%40__PURE__%20*%2F%20new%20Map()%3B%0A%20%20const%20transparentBlobMap%20%3D%20%2F*%20%40__PURE__%20*%2F%20new%20Map()%3B%0A%20%20async%20function%20getTransparentBlobFor(width%2C%20height%2C%20dataURLOptions)%20%7B%0A%20%20%20%20const%20id%20%3D%20%60%24%7Bwidth%7D-%24%7Bheight%7D%60%3B%0A%20%20%20%20if%20(%22OffscreenCanvas%22%20in%20globalThis)%20%7B%0A%20%20%20%20%20%20if%20(transparentBlobMap.has(id))%20return%20transparentBlobMap.get(id)%3B%0A%20%20%20%20%20%20const%20offscreen%20%3D%20new%20OffscreenCanvas(width%2C%20height)%3B%0A%20%20%20%20%20%20offscreen.getContext(%222d%22)%3B%0A%20%20%20%20%20%20const%20blob%20%3D%20await%20offscreen.convertToBlob(dataURLOptions)%3B%0A%20%20%20%20%20%20const%20arrayBuffer%20%3D%20await%20blob.arrayBuffer()%3B%0A%20%20%20%20%20%20const%20base64%20%3D%20encode(arrayBuffer)%3B%0A%20%20%20%20%20%20transparentBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%20%20return%20base64%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20return%20%22%22%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20const%20worker%20%3D%20self%3B%0A%20%20worker.onmessage%20%3D%20async%20function(e)%20%7B%0A%20%20%20%20if%20(%22OffscreenCanvas%22%20in%20globalThis)%20%7B%0A%20%20%20%20%20%20const%20%7B%20id%2C%20bitmap%2C%20width%2C%20height%2C%20dataURLOptions%20%7D%20%3D%20e.data%3B%0A%20%20%20%20%20%20const%20transparentBase64%20%3D%20getTransparentBlobFor(%0A%20%20%20%20%20%20%20%20width%2C%0A%20%20%20%20%20%20%20%20height%2C%0A%20%20%20%20%20%20%20%20dataURLOptions%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20const%20offscreen%20%3D%20new%20OffscreenCanvas(width%2C%20height)%3B%0A%20%20%20%20%20%20const%20ctx%20%3D%20offscreen.getContext(%222d%22)%3B%0A%20%20%20%20%20%20ctx.drawImage(bitmap%2C%200%2C%200)%3B%0A%20%20%20%20%20%20bitmap.close()%3B%0A%20%20%20%20%20%20const%20blob%20%3D%20await%20offscreen.convertToBlob(dataURLOptions)%3B%0A%20%20%20%20%20%20const%20type%20%3D%20blob.type%3B%0A%20%20%20%20%20%20const%20arrayBuffer%20%3D%20await%20blob.arrayBuffer()%3B%0A%20%20%20%20%20%20const%20base64%20%3D%20encode(arrayBuffer)%3B%0A%20%20%20%20%20%20if%20(!lastBlobMap.has(id)%20%26%26%20await%20transparentBase64%20%3D%3D%3D%20base64)%20%7B%0A%20%20%20%20%20%20%20%20lastBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%20%20%20%20return%20worker.postMessage(%7B%20id%20%7D)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(lastBlobMap.get(id)%20%3D%3D%3D%20base64)%20return%20worker.postMessage(%7B%20id%20%7D)%3B%0A%20%20%20%20%20%20worker.postMessage(%7B%0A%20%20%20%20%20%20%20%20id%2C%0A%20%20%20%20%20%20%20%20type%2C%0A%20%20%20%20%20%20%20%20base64%2C%0A%20%20%20%20%20%20%20%20width%2C%0A%20%20%20%20%20%20%20%20height%0A%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20lastBlobMap.set(id%2C%20base64)%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20return%20worker.postMessage(%7B%20id%3A%20e.data.id%20%7D)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%7D)()%3B%0A%2F%2F%23%20sourceMappingURL%3Dimage-bitmap-data-url-worker-IJpC7g_b.js.map%0A`,{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var ho=class{constructor(e){n(this,`pendingCanvasMutations`,new Map),n(this,`rafStamps`,{latestId:0,invokeId:null}),n(this,`mirror`),n(this,`mutationCb`),n(this,`resetObservers`),n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:r,blockClass:i,blockSelector:a,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t===`all`&&this.initCanvasMutationObserver(r,i,a),o&&typeof t==`number`&&this.initCanvasFPSObserver(t,r,i,a,{dataURLOptions:s})}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,n,r,i){let a=lo(t,n,r,!0),o=new Map,s=new mo;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:ua[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{W(t,n,r,!0)||e.push(t)}),e},f=e=>{if(l&&e-l<c){u=requestAnimationFrame(f);return}l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=lo(e,t,n,!1),i=so(this.processMutation.bind(this),e,t,n),a=fo(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},go=class{constructor(e){n(this,`trackedLinkElements`,new WeakSet),n(this,`mutationCb`),n(this,`adoptedStyleSheetCb`),n(this,`styleMirror`,new aa),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;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:se(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},_o=class{constructor(){n(this,`nodeMap`,new WeakMap),n(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==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(){}};let Z,vo,yo,bo=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}let Q=ue();function xo(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,hooks:g,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:x=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:w=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:ee=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:D,keepIframeSrcFn:te=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ne}=e;wa(ne);let k=C?window.parent===window:!0,re=!1;if(!k)try{window.parent.document&&(re=!1)}catch{re=!0}if(k&&!t)throw Error(`emit function is required`);if(!k&&!re)return()=>{};b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),Q.reset();let A=d===!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}:f===void 0?{password:!0}:f,j=Ye(p);ta();let ie,ae=0,oe=e=>{for(let t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!re&&(e=_(e)),e};Z=(e,i)=>{let a=e;if(a.timestamp=Vi(),Ea[0]?.isFrozen()&&a.type!==G.FullSnapshot&&!(a.type===G.IncrementalSnapshot&&a.data.source===K.Mutation)&&Ea.forEach(e=>e.unfreeze()),k)t?.(oe(a),i);else if(re){let e={type:`rrweb`,event:oe(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===G.FullSnapshot)ie=a,ae=0;else if(a.type===G.IncrementalSnapshot){if(a.data.source===K.Mutation&&a.data.isAttachIframe)return;ae++;let e=r&&ae>=r,t=n&&a.timestamp-ie.timestamp>n;(e||t)&&vo(!0)}};let se=e=>{Z({type:G.IncrementalSnapshot,data:{source:K.Mutation,...e}})},ce=e=>Z({type:G.IncrementalSnapshot,data:{source:K.Scroll,...e}}),le=e=>Z({type:G.IncrementalSnapshot,data:{source:K.CanvasMutation,...e}}),M=new go({mutationCb:se,adoptedStyleSheetCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.AdoptedStyleSheet,...e}})}),N=new Ya({mirror:Q,mutationCb:se,stylesheetManager:M,recordCrossOriginIframes:C,wrappedEmit:Z});for(let e of D||[])e.getMirror&&e.getMirror({nodeMirror:Q,crossOriginIframeMirror:N.crossOriginIframeMirror,crossOriginIframeStyleMirror:N.crossOriginIframeStyleMirror});let ue=new _o;yo=new ho({recordCanvas:S,mutationCb:le,win:window,blockClass:i,blockSelector:a,mirror:Q,sampling:v.canvas,dataURLOptions:y});let P=new Xa({mutationCb:se,scrollCb:ce,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:A,dataURLOptions:y,maskTextFn:h,maskInputFn:m,recordCanvas:S,inlineImages:E,sampling:v,slimDOMOptions:j,iframeManager:N,stylesheetManager:M,canvasManager:yo,keepIframeSrcFn:te,processedNodeManager:ue},mirror:Q});vo=(e=!1)=>{if(!x)return;Z({type:G.Meta,data:{href:window.location.href,width:Yi(),height:Ji()}},e),M.reset(),P.init(),Ea.forEach(e=>e.lock());let t=Qe(document,{mirror:Q,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:A,maskTextFn:h,maskInputFn:m,slimDOM:j,dataURLOptions:y,recordCanvas:S,inlineImages:E,onSerialize:e=>{na(e,Q)&&N.addIframe(e),ra(e,Q)&&M.trackLinkElement(e),ia(e)&&P.addShadowRoot(H.shadowRoot(e),document)},onIframeLoad:(e,t)=>{N.attachIframe(e,t),P.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{M.attachLinkElement(e,t)},keepIframeSrcFn:te});if(!t)return console.warn(`Failed to snapshot the document`);Z({type:G.FullSnapshot,data:{node:t,initialOffset:qi(window)}},e),Ea.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&M.adoptStyleSheets(document.adoptedStyleSheets,Q.getId(document))};try{let e=[],t=e=>Y(Ga)({mutationCb:se,mousemoveCb:(e,t)=>Z({type:G.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.MouseInteraction,...e}}),scrollCb:ce,viewportResizeCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.ViewportResize,...e}}),inputCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.Input,...e}}),mediaInteractionCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.MediaInteraction,...e}}),styleSheetRuleCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.StyleSheetRule,...e}}),styleDeclarationCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.StyleDeclaration,...e}}),canvasMutationCb:le,fontCb:e=>Z({type:G.IncrementalSnapshot,data:{source:K.Font,...e}}),selectionCb:e=>{Z({type:G.IncrementalSnapshot,data:{source:K.Selection,...e}})},customElementCb:e=>{Z({type:G.IncrementalSnapshot,data:{source:K.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:A,inlineStylesheet:u,sampling:v,recordDOM:x,recordCanvas:S,inlineImages:E,userTriggeredOnInput:ee,collectFonts:T,doc:e,maskInputFn:m,maskTextFn:h,keepIframeSrcFn:te,blockSelector:a,slimDOMOptions:j,dataURLOptions:y,mirror:Q,iframeManager:N,stylesheetManager:M,shadowDomManager:P,processedNodeManager:ue,canvasManager:yo,ignoreCSSAttributes:O,plugins:(D?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>Z({type:G.Plugin,data:{plugin:e.name,payload:t}})}))||[]},g);N.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{vo(),e.push(t(document)),bo=!0};return[`interactive`,`complete`].includes(document.readyState)?n():(e.push(U(`DOMContentLoaded`,()=>{Z({type:G.DomContentLoaded,data:{}}),w===`DOMContentLoaded`&&n()})),e.push(U(`load`,()=>{Z({type:G.Load,data:{}}),w===`load`&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes(`cross-origin`)||console.warn(e)}}),ue.destroy(),bo=!1,Ta()}}catch(e){console.warn(e)}}xo.addCustomEvent=(e,t)=>{if(!bo)throw Error(`please add custom event after start recording`);Z({type:G.Custom,data:{tag:e,payload:t}})},xo.freezePage=()=>{Ea.forEach(e=>e.freeze())},xo.takeFullSnapshot=e=>{if(!bo)throw Error(`please take full snapshot after start recording`);vo(e)},xo.mirror=Q;
|
|
129
129
|
/*! *****************************************************************************
|
|
130
130
|
Copyright (c) Microsoft Corporation.
|
|
131
131
|
|
|
@@ -140,4 +140,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
140
140
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
141
141
|
PERFORMANCE OF THIS SOFTWARE.
|
|
142
142
|
***************************************************************************** */
|
|
143
|
-
var So;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(So||={});let{addCustomEvent:Co}=
|
|
143
|
+
var So;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(So||={});let{addCustomEvent:Co}=xo,{freezePage:wo}=xo,{takeFullSnapshot:To}=xo;var Eo=class extends Event{name;payload;constructor(e,t){super(`outgoingMessage`),this.name=e,this.payload=t}},Do=class extends Event{name;payload;constructor(e,t){super(`incommingMessage`),this.name=e,this.payload=t}};function Oo(e){let t=globalThis,n=new EventTarget;return n.addEventListener(`outgoingMessage`,n=>{let{name:r,payload:i}=n;t[`__${e}_post_message`](JSON.stringify({name:r,payload:i}))}),t.PortOutgoingMessageEvent??=Eo,t.PortIncommingMessageEvent??=Do,t.ports??={},t.ports[e]=n,n}let ko=Oo(`sessionReplay`),Ao,jo=[],Mo,$;function No(){if(Mo=void 0,jo.length===0)return;let e=jo;jo=[],ko.dispatchEvent(new Eo(`eventsRecorded`,{events:e}))}function Po(){if(!(Ao||$)){if(document.readyState!==`loading`){Fo();return}$=setTimeout(()=>{$=void 0,Object.defineProperty(document,"readyState",{value:`interactive`,configurable:!0});try{Fo()}finally{delete document.readyState}},2e3),document.addEventListener(`DOMContentLoaded`,()=>{$&&(clearTimeout($),$=void 0,Fo())},{once:!0})}}function Fo(){Ao||=xo({emit(e){jo.push(e),Mo??=setTimeout(No,250)},sampling:{mouseInteraction:{MouseUp:!1,MouseDown:!1,Focus:!1,Blur:!1,TouchEnd:!1},scroll:150,media:800},userTriggeredOnInput:!0,recordCrossOriginIframes:!0,slimDOMOptions:{comment:!0,headFavicon:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaVerification:!0},recordCanvas:!1,collectFonts:!1})??void 0}function Io(){$&&clearTimeout($),$=void 0,Ao?.(),Ao=void 0,Mo&&clearTimeout(Mo),No()}ko.addEventListener(`incommingMessage`,e=>{let{name:t}=e;switch(t){case`startRecording`:Po();break;case`stopRecording`:Io();break;default:break}}),ko.dispatchEvent(new Eo(`ready`,void 0))})();
|