@appsurify-testmap/rrweb-record 2.1.2-alpha.2 → 2.1.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ https://www.w3ctech.com/topic/2226`));let l=t(...n);return l.postcssPlugin=e,l.p
65
65
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
66
66
  https://www.w3ctech.com/topic/2226`));let l=t(...n);return l.postcssPlugin=e,l.postcssVersion=new Zs().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,l,a){return P([i(a)]).process(n,l)},i};P.stringify=Wh;P.parse=Yh;P.fromJSON=Vh;P.list=Zh;P.comment=s=>new ko(s);P.atRule=s=>new To(s);P.decl=s=>new $o(s);P.rule=s=>new Po(s);P.root=s=>new Lo(s);P.document=s=>new No(s);P.CssSyntaxError=Bh;P.Declaration=$o;P.Container=zh;P.Processor=Zs;P.Document=No;P.Comment=ko;P.Warning=Gh;P.AtRule=To;P.Result=jh;P.Input=Hh;P.Rule=Po;P.Root=Lo;P.Node=Jh;Uh.registerPostcss(P);var Xh=P;P.default=P;const V=lc(Xh);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;class Js{constructor(...e){oe(this,"parentElement",null),oe(this,"parentNode",null),oe(this,"ownerDocument"),oe(this,"firstChild",null),oe(this,"lastChild",null),oe(this,"previousSibling",null),oe(this,"nextSibling",null),oe(this,"ELEMENT_NODE",1),oe(this,"TEXT_NODE",3),oe(this,"nodeType"),oe(this,"nodeName"),oe(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof Js){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Hi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bt={},Kh=()=>!!globalThis.Zone;function Xs(s){if(Bt[s])return Bt[s];const e=globalThis[s],t=e.prototype,r=s in Hi?Hi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in Yi?Yi[s]:void 0,n=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&n&&!Kh())return Bt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?Bt[s]=u:t}catch(l){return t}}const _r={};function Ce(s,e,t){var r;const i=`${s}.${String(t)}`;if(_r[i])return _r[i].call(e);const o=Xs(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(_r[i]=n,n.call(e)):e[t]}const Fr={};function Do(s,e,t){const r=`${s}.${String(t)}`;if(Fr[r])return Fr[r].bind(e);const o=Xs(s)[t];return typeof o!="function"?e[t]:(Fr[r]=o,o.bind(e))}function qh(s){return Ce("Node",s,"childNodes")}function Qh(s){return Ce("Node",s,"parentNode")}function ef(s){return Ce("Node",s,"parentElement")}function tf(s){return Ce("Node",s,"textContent")}function rf(s,e){return Do("Node",s,"contains")(e)}function sf(s){return Do("Node",s,"getRootNode")()}function nf(s){return!s||!("host"in s)?null:Ce("ShadowRoot",s,"host")}function of(s){return s.styleSheets}function af(s){return!s||!("shadowRoot"in s)?null:Ce("Element",s,"shadowRoot")}function lf(s,e){return Ce("Element",s,"querySelector")(e)}function uf(s,e){return Ce("Element",s,"querySelectorAll")(e)}function _o(){return Xs("MutationObserver").constructor}function $e(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}function cf(s){const e=s.tagName.toLowerCase(),t=s.id?`#${s.id}`:"",r=s.classList.length?"."+Array.from(s.classList).join("."):"";return`${e}${t}${r}`}function hf(s){var d;var e,t;const r=(d=(e=s.ownerDocument)==null?void 0:e.defaultView)!=null?d:window,i=s.getBoundingClientRect(),o=r.innerWidth||r.document.documentElement.clientWidth||0,n=r.innerHeight||r.document.documentElement.clientHeight||0,l=i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<n&&i.left<o,a=(t=r.getComputedStyle)==null?void 0:t.call(r,s),c=!!a&&a.display!=="none"&&a.visibility!=="hidden"&&(parseFloat(a.opacity)||0)>0&&l;let f=0;if(c){const m=Math.max(0,Math.min(i.right,o)-Math.max(i.left,0)),p=Math.max(0,Math.min(i.bottom,n)-Math.max(i.top,0)),g=m*p,h=i.width*i.height;f=h>0?g/h:0}return{isVisible:c,ratio:f}}const E={childNodes:qh,parentNode:Qh,parentElement:ef,textContent:tf,contains:rf,getRootNode:sf,host:nf,styleSheets:of,shadowRoot:af,querySelector:lf,querySelectorAll:uf,mutationObserver:_o,patch:$e,describeNode:cf,getElementVisibility:hf};function K(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const Pe=`Please stop import mirror directly. Instead of that,\r
67
67
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
68
- or you can use record.mirror to access the mirror instance during recording.`;let Zi={map:{},getId(){return console.error(Pe),-1},getNode(){return console.error(Pe),null},removeNodeFromMap(){console.error(Pe)},has(){return console.error(Pe),!1},reset(){console.error(Pe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Zi=new Proxy(Zi,{get(s,e,t){return e==="map"&&console.error(Pe),Reflect.get(s,e,t)}}));function ht(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const l=e-(n-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(a,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,o)},l))}}function br(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>br(s,e,o||{},!0)}function pe(){return Math.round(performance.timeOrigin+performance.now())}function Fo(s=window){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=E.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=E.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Bo(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Uo(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function zo(s){return s?s.nodeType===s.ELEMENT_NODE?s:E.parentElement(s):null}function Q(s,e,t,r){if(!s)return!1;const i=zo(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(qt(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function ff(s,e){return e.getId(s)!==-1}function Br(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===rt}function Wo(s,e){if(Qe(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=E.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Wo(r,e):!0}function vs(s){return!!s.changedTouches}function df(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Vo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Go(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Is(s){return s?s instanceof Js&&"shadowRoot"in s?!!s.shadowRoot:!!E.shadowRoot(s):!1}class pf{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 jo(s){var e;let t=null;return"getRootNode"in s&&((e=E.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&E.host(E.getRootNode(s))&&(t=E.host(E.getRootNode(s))),t}function mf(s){let e=s,t;for(;t=jo(e);)e=t;return e}function gf(s){const e=s.ownerDocument;if(!e)return!1;const t=mf(s);return E.contains(e,t)}function Ho(s){const e=s.ownerDocument;return e?E.contains(e,s)||gf(s):!1}var N=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(N||{}),A=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityMutation=17]="VisibilityMutation",s))(A||{}),re=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(re||{}),me=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(me||{}),He=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(He||{}),Le=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Le||{}),Yo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Yo||{});function Ji(s){return"__ln"in s}class yf{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ji(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ji(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Xi=(s,e)=>`${s}@${e}`;class wf{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new yf,i=a=>{let u=a,c=rt;for(;c===rt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=a=>{const u=E.parentNode(a);if(!u||!Ho(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const f=Qe(u)?this.mirror.getId(jo(a)):this.mirror.getId(u),d=i(a);if(f===-1||d===-1)return r.addNode(a);const m=_e(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Vo(p,this.mirror)&&this.iframeManager.addIframe(p),Go(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Is(a)&&this.shadowDomManager.addShadowRoot(E.shadowRoot(a),this.doc)},onIframeLoad:(p,g)=>{this.iframeManager.attachIframe(p,g),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,g)=>{this.stylesheetManager.attachLinkElement(p,g)},cssCaptured:c});m&&(e.push({parentId:f,nextId:d,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ki(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(E.parentNode(a))||o(a);for(const a of this.addedSet)!qi(this.droppedSet,a)&&!Ki(this.removesSubTreeCache,a,this.mirror)||qi(this.movedSet,a)?o(a):this.droppedSet.add(a);let n=null;for(;r.length;){let a=null;if(n){const u=this.mirror.getId(E.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(a=n)}if(!a){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const f=this.mirror.getId(E.parentNode(c.value));if(i(c.value)===-1)continue;if(f!==-1){a=c;break}else{const m=c.value,p=E.parentNode(m);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=E.host(p);if(this.mirror.getId(g)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}n=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{const u=a.node,c=E.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const c=JSON.stringify(a.styleDiff),f=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+f).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(E.childNodes(e),i=>E.textContent(i)||"").join("");t.attributes.value=Jt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Xt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Br(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=E.textContent(e.target);!Q(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:mn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);const n=t[r],l=typeof n=="boolean",a=document.contains(t),u=Ms(t),c=jr(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${pe()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c});return}if(jr(r,this.excludeAttribute)){console.debug(`[${pe()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const m=Xt(t);i=Jt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:m,value:i,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!pn(t.tagName,r))if(d.attributes[r]=dn(this.doc,Oe(t.tagName),Oe(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${pe()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===d.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:d.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(g){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const g of Array.from(t.style)){const h=t.style.getPropertyValue(g),b=t.style.getPropertyPriority(g);h!==p.style.getPropertyValue(g)||b!==p.style.getPropertyPriority(g)?b===""?d.styleDiff[g]=h:d.styleDiff[g]=[h,b]:d._unchangedStyles[g]=[h,b]}for(const g of Array.from(p.style))t.style.getPropertyValue(g)===""&&(d.styleDiff[g]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(Q(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=Qe(e.target)?this.mirror.getId(E.host(e.target)):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||Br(t,this.mirror,this.slimDOMOptions)||!ff(t,this.mirror)||(this.addedSet.has(t)?(xs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Wo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Xi(r,i)]?xs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Qe(e.target)&&et(e.target)?!0:void 0}),bf(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Br(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Xi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(E.childNodes(e).forEach(r=>this.genAdds(r)),Is(e)&&E.childNodes(E.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function xs(s,e){s.delete(e),E.childNodes(e).forEach(t=>xs(s,t))}function bf(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),E.childNodes(r).forEach(i=>t.push(i)))}}function Ki(s,e,t){return s.size===0?!1:Sf(s,e)}function Sf(s,e,t){const r=E.parentNode(e);return r?s.has(r):!1}function qi(s,e){return s.size===0?!1:Zo(s,e)}function Zo(s,e){const t=E.parentNode(e);return t?s.has(t)?!0:Zo(s,t):!1}let tt;function Cf(s){tt=s}function vf(){tt=void 0}const $=s=>tt?(...t)=>{try{return s(...t)}catch(r){if(tt&&tt(r)===!0)return;throw r}}:s,Me=[];function Ye(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function Jo(s,e){const t=new wf;Me.push(t),t.init(s);const r=new(_o())($(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function If({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],l;const a=ht($(f=>{const d=Date.now()-l;s(n.map(m=>(m.timeOffset-=d,m)),f),n=[],l=null}),o),u=$(ht($(f=>{const d=Ye(f),{clientX:m,clientY:p}=vs(f)?f.changedTouches[0]:f;l||(l=pe()),n.push({x:m,y:p,id:r.getId(d),timeOffset:pe()-l}),a(typeof DragEvent!="undefined"&&f instanceof DragEvent?A.Drag:f instanceof MouseEvent?A.MouseMove:A.TouchMove)}),i,{trailing:!1})),c=[K("mousemove",u,t),K("touchmove",u,t),K("drag",u,t)];return $(()=>{c.forEach(f=>f())})}function xf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let a=null;const u=c=>f=>{const d=Ye(f);if(Q(d,r,i,!0))return;let m=null,p=c;if("pointerType"in f){switch(f.pointerType){case"mouse":m=me.Mouse;break;case"touch":m=me.Touch;break;case"pen":m=me.Pen;break}m===me.Touch?re[c]===re.MouseDown?p="TouchStart":re[c]===re.MouseUp&&(p="TouchEnd"):me.Pen}else vs(f)&&(m=me.Touch);m!==null?(a=m,(p.startsWith("Touch")&&m===me.Touch||p.startsWith("Mouse")&&m===me.Mouse)&&(m=null)):re[c]===re.Click&&(m=a,a=null);const g=vs(f)?f.changedTouches[0]:f;if(!g)return;const h=t.getId(d),{clientX:b,clientY:I}=g;$(s)(R({type:re[p],id:h,x:b,y:I},m!==null&&{pointerType:m}))};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let f=Oe(c);const d=u(c);if(window.PointerEvent)switch(re[c]){case re.MouseDown:case re.MouseUp:f=f.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(K(f,d,e))}),$(()=>{l.forEach(c=>c())})}function Xo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=$(ht($(l=>{const a=Ye(l);if(!a||Q(a,r,i,!0))return;const u=t.getId(a);if(a===e&&e.defaultView){const c=Fo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100));return K("scroll",n,e)}function Ef({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=$(ht($(()=>{const o=Bo(),n=Uo();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return K("resize",i,e)}const Ur=["INPUT","TEXTAREA","SELECT"],Qi=new WeakMap,Mf=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],en=new WeakMap;function Of({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function f(C){let y=Ye(C);const S=C.isTrusted,v=y&&y.tagName;if(y&&v==="OPTION"&&(y=E.parentElement(y)),!y||!v||Ur.indexOf(v)<0||Q(y,r,i,!0)||y.classList.contains(o)||n&&y.matches(n))return;let k=y.value,O=!1;const D=Xt(y)||"";D==="radio"||D==="checkbox"?O=y.checked:(l[v.toLowerCase()]||l[D])&&(k=Jt({element:y,maskInputOptions:l,tagName:v,type:D,value:k,maskInputFn:a})),d(y,c?{text:k,isChecked:O,userTriggered:S}:{text:k,isChecked:O});const F=y.name;D==="radio"&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(H=>{if(H!==y){const X=H.value;d(H,c?{text:X,isChecked:!O,userTriggered:!1}:{text:X,isChecked:!O})}})}function d(C,y){const S=Qi.get(C),v=C,k=v.hasAttribute("placeholder"),O=v.value==="",D=typeof v.defaultValue=="string"?v.defaultValue==="":!0,F=!y.userTriggered,H=!S||S.text==="",X=k&&O&&D&&H&&F&&!y.isChecked&&v.type!=="hidden"&&Ur.includes(v.tagName),ee=v.tagName==="INPUT"&&v.type==="text"&&!y.userTriggered&&y.text===v.defaultValue&&!S&&v.hasAttribute("placeholder"),x=!y.userTriggered&&v.value===v.defaultValue&&!S&&v.hasAttribute("placeholder")&&!y.isChecked&&v.type!=="hidden"&&Ur.includes(v.tagName),te=v.type==="checkbox"&&!y.userTriggered&&!y.isChecked&&!S,se=v.type==="radio"&&!y.userTriggered&&!y.isChecked&&!S;if(X||ee||x||te||se){console.debug(`[${pe()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:E.describeNode(v),tag:v.tagName,nodeType:v.nodeType,attribute:v.attributes,value:v.value,isLikelyPhantom:X,isRenderDrivenTextInput:ee,isValueFromDefault:x,isPhantomCheckbox:te,isPhantomRadio:se});return}if(!S||S.text!==y.text||S.isChecked!==y.isChecked){Qi.set(C,y);const G=t.getId(C);$(s)(ne(R({},y),{id:G}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(C=>K(C,$(f),e)),g=C=>{const y=Ye(C);if(!y||!y.tagName)return;if(u.input==="all"){f(C);return}const S=y.tagName,v=C.key,k=Mf.includes(v),O=S==="TEXTAREA",D=e.activeElement===y,F=y.value,H=en.get(y);if(en.set(y,F),!D){f(C);return}if(k){if(!O){f(C);return}let X=H!=null?H:"",ee=0;const x=2,te=()=>{const se=y.value,G=e.activeElement===y,he=se!==X;if(!G){f(C);return}if(he)ee=0,X=se;else if(ee++,ee>=x){f(C);return}requestAnimationFrame(te)};requestAnimationFrame(te);return}};p.push(K("keydown",$(g),e));const h=e.defaultView;if(!h)return()=>{p.forEach(C=>C())};const b=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),I=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&p.push(...I.map(C=>br(C[0],C[1],{set(){$(f)({target:this,isTrusted:!1})}},!1,h))),$(()=>{p.forEach(C=>C())})}function ar(s){const e=[];function t(r,i){if(Ut("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ut("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ut("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ut("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function be(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Af({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:$((c,f,d)=>{const[m,p]=d,{id:g,styleId:h}=be(f,e,t.styleMirror);return(g&&g!==-1||h&&h!==-1)&&s({id:g,styleId:h,adds:[{rule:m,index:p}]}),c.apply(f,d)})}),r.CSSStyleSheet.prototype.addRule=function(c,f,d=this.cssRules.length){const m=`${c} { ${f} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,d])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,removes:[{index:m}]}),c.apply(f,d)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,replace:m}),c.apply(f,d)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,replaceSync:m}),c.apply(f,d)})}));const a={};zt("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(zt("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),zt("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),zt("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([c,f])=>{u[c]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(u[c].insertRule,{apply:$((d,m,p)=>{const[g,h]=p,{id:b,styleId:I}=be(m.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||I&&I!==-1)&&s({id:b,styleId:I,adds:[{rule:g,index:[...ar(m),h||0]}]}),d.apply(m,p)})}),f.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:$((d,m,p)=>{const[g]=p,{id:h,styleId:b}=be(m.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||b&&b!==-1)&&s({id:h,styleId:b,removes:[{index:[...ar(m),g]}]}),d.apply(m,p)})})}),$(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,f])=>{f.prototype.insertRule=u[c].insertRule,f.prototype.deleteRule=u[c].deleteRule})})}function Ko({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(E.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;const f=(c=a.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(d){}return f}}),$(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Rf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:$((l,a,u)=>{var c;const[f,d,m]=u;if(t.has(f))return o.apply(a,[f,d,m]);const{id:p,styleId:g}=be((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,set:{property:f,value:d,priority:m},index:ar(a.parentRule)}),l.apply(a,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:$((l,a,u)=>{var c;const[f]=u;if(t.has(f))return n.apply(a,[f]);const{id:d,styleId:m}=be((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,remove:{property:f},index:ar(a.parentRule)}),l.apply(a,u)})}),$(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function $f({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=$(a=>ht($(u=>{const c=Ye(u);if(!c||Q(c,e,t,!0))return;const{currentTime:f,volume:d,muted:m,playbackRate:p,loop:g}=c;s({type:a,id:r.getId(c),currentTime:f,volume:d,muted:m,playbackRate:p,loop:g})}),i.media||500)),l=[K("play",n(Le.Play),o),K("pause",n(Le.Pause),o),K("seeked",n(Le.Seeked),o),K("volumechange",n(Le.VolumeChange),o),K("ratechange",n(Le.RateChange),o)];return $(()=>{l.forEach(a=>a())})}function Nf({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(a,u,c){const f=new o(a,u,c);return i.set(f,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),f};const n=$e(e.fonts,"add",function(l){return function(a){return setTimeout($(()=>{const u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=o}),r.push(n),$(()=>{r.forEach(l=>l())})}function kf(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const l=$(()=>{const a=e.getSelection();if(!a||n&&(a!=null&&a.isCollapsed))return;n=a.isCollapsed||!1;const u=[],c=a.rangeCount||0;for(let f=0;f<c;f++){const d=a.getRangeAt(f),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=d;Q(m,r,i,!0)||Q(g,r,i,!0)||u.push({start:t.getId(m),startOffset:p,end:t.getId(g),endOffset:h})}o({ranges:u})});return l(),K("selectionchange",l)}function Tf({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:$e(t.customElements,"define",function(i){return function(o,n,l){try{e({define:{name:o}})}catch(a){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,l])}})}function Pf(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:f,visibilityMutationCb:d,fontCb:m,selectionCb:p,customElementCb:g}=s;s.mutationCb=(...h)=>{e.mutation&&e.mutation(...h),t(...h)},s.mousemoveCb=(...h)=>{e.mousemove&&e.mousemove(...h),r(...h)},s.mouseInteractionCb=(...h)=>{e.mouseInteraction&&e.mouseInteraction(...h),i(...h)},s.scrollCb=(...h)=>{e.scroll&&e.scroll(...h),o(...h)},s.viewportResizeCb=(...h)=>{e.viewportResize&&e.viewportResize(...h),n(...h)},s.inputCb=(...h)=>{e.input&&e.input(...h),l(...h)},s.mediaInteractionCb=(...h)=>{e.mediaInteaction&&e.mediaInteaction(...h),a(...h)},s.styleSheetRuleCb=(...h)=>{e.styleSheetRule&&e.styleSheetRule(...h),u(...h)},s.styleDeclarationCb=(...h)=>{e.styleDeclaration&&e.styleDeclaration(...h),c(...h)},s.canvasMutationCb=(...h)=>{e.canvasMutation&&e.canvasMutation(...h),f(...h)},s.visibilityMutationCb=(...h)=>{e.visibilityMutation&&e.visibilityMutation(...h),d(...h)},s.fontCb=(...h)=>{e.font&&e.font(...h),m(...h)},s.selectionCb=(...h)=>{e.selection&&e.selection(...h),p(...h)},s.customElementCb=(...h)=>{e.customElement&&e.customElement(...h),g(...h)}}function Lf(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Pf(s,e);let r;s.recordDOM&&(r=Jo(s,s.doc));const i=If(s),o=xf(s),n=Xo(s),l=Ef(s,{win:t}),a=Of(s),u=$f(s);let c=()=>{},f=()=>{},d=()=>{},m=()=>{};s.recordDOM&&(c=Af(s,{win:t}),f=Ko(s,s.doc),d=Rf(s,{win:t}),s.collectFonts&&(m=Nf(s)));const p=kf(s),g=Tf(s),h=[];for(const b of s.plugins)h.push(b.observer(b.callback,t,b.options));return $(()=>{Me.forEach(b=>b.reset()),r==null||r.disconnect(),i(),o(),n(),l(),a(),u(),c(),f(),d(),m(),p(),g(),h.forEach(b=>b())})}function Ut(s){return typeof window[s]!="undefined"}function zt(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class tn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),n.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Df{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tn(fn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tn(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 r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case N.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:N.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case N.Meta:case N.Load:case N.DomContentLoaded:return!1;case N.Plugin:return t;case N.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case N.IncrementalSnapshot:switch(t.data.source){case A.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.Drag:case A.TouchMove:case A.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(t.data,e,["id"]),t;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case A.Font:return t;case A.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case A.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Yo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class _f{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!et(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Jo(ne(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Xo(ne(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(E.host(e))),this.restoreHandlers.push(Ko({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push($e(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),l=E.shadowRoot(this);return l&&Ho(this)&&r.addShadowRoot(l,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ff=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Wt=0;Wt<Fe.length;Wt++)Ff[Fe.charCodeAt(Wt)]=Wt;var Bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Fe[e[t]>>2],i+=Fe[(e[t]&3)<<4|e[t+1]>>4],i+=Fe[(e[t+1]&15)<<2|e[t+2]>>6],i+=Fe[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const rn=new Map;function Uf(s,e){let t=rn.get(s);return t||(t=new Map,rn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const qo=(s,e,t)=>{if(!s||!(ea(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Uf(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function Zt(s,e,t){if(s instanceof Array)return s.map(r=>Zt(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Zt(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Zt(s.data,e,t),s.width,s.height]};if(ea(s,e)||typeof s=="object"){const r=s.constructor.name,i=qo(s,e,t);return{rr_type:r,index:i}}}}return s}const Qo=(s,e,t)=>s.map(r=>Zt(r,e,t)),ea=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function zf(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const l=$e(e.CanvasRenderingContext2D.prototype,n,function(a){return function(...u){return Q(this.canvas,t,r,!0)||setTimeout(()=>{const c=Qo(u,e,this);s(this.canvas,{type:He["2D"],property:n,args:c})},0),a.apply(this,u)}});i.push(l)}catch(l){const a=br(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:He["2D"],property:n,args:[u],setter:!0})}});i.push(a)}return()=>{i.forEach(n=>n())}}function Wf(s){return s==="experimental-webgl"?"webgl":s}function sn(s,e,t,r){const i=[];try{const o=$e(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(l,...a){if(!Q(this,e,t,!0)){const u=Wf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){const c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[l,...a])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function nn(s,e,t,r,i,o){const n=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const u=$e(s,a,function(c){return function(...f){const d=c.apply(this,f);if(qo(d,o,this),"tagName"in this.canvas&&!Q(this.canvas,r,i,!0)){const m=Qo(f,o,this),p={type:e,property:a,args:m};t(this.canvas,p)}return d}});n.push(u)}catch(u){const c=br(s,a,{set(f){t(this.canvas,{type:e,property:a,args:[f],setter:!0})}});n.push(c)}return n}function Vf(s,e,t,r){const i=[];return i.push(...nn(e.WebGLRenderingContext.prototype,He.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...nn(e.WebGL2RenderingContext.prototype,He.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ta="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Gf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),on=typeof window!="undefined"&&window.Blob&&new Blob([Gf(ta)],{type:"text/javascript;charset=utf-8"});function jf(s){let e;try{if(e=on&&(window.URL||window.webkitURL).createObjectURL(on),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+ta,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Hf{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=sn(t,r,i,!0),l=new Map,a=new jf;a.onmessage=p=>{const{id:g}=p.data;if(l.set(g,!1),!("base64"in p.data))return;const{base64:h,type:b,width:I,height:C}=p.data;this.mutationCb({id:g,type:He["2D"],commands:[{property:"clearRect",args:[0,0,I,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:b}]},0,0]}]})};const u=1e3/e;let c=0,f;const d=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(g=>{Q(g,r,i,!0)||p.push(g)}),p},m=p=>{if(c&&p-c<u){f=requestAnimationFrame(m);return}c=p,d().forEach(async g=>{var h;const b=this.mirror.getId(g);if(l.get(b)||g.width===0||g.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(g.__context)){const C=g.getContext(g.__context);((h=C==null?void 0:C.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&C.clear(C.COLOR_BUFFER_BIT)}const I=await createImageBitmap(g);a.postMessage({id:b,bitmap:I,width:g.width,height:g.height,dataURLOptions:o.dataURLOptions},[I])}),f=requestAnimationFrame(m)};f=requestAnimationFrame(m),this.resetObservers=()=>{n(),cancelAnimationFrame(f)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=sn(e,t,r,!1),o=zf(this.processMutation.bind(this),e,t,r),n=Vf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:l}=u;return ke(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Yf{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new pf),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(l,a)=>({rule:un(l,o.href),index:a}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Zf{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}function Jf(s,e,t){var c,f,d,m,p,g;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(f=t==null?void 0:t.threshold)!=null?f:.5,o=(d=t==null?void 0:t.sensitivity)!=null?d:.05,n=Xf((m=t==null?void 0:t.rootMargin)!=null?m:"0px"),l=new Map,a=Kf(r),u=qf(a,n);for(const h of s){const b=h.getBoundingClientRect();let I=td(),C=0;b.width>0&&b.height>0&&(I=Qf(b,u),C=ed(b,I),C=Math.round(C*100)/100);const y=rd(h),S=(p=e.get(h))!=null?p:null,v=(g=S==null?void 0:S.intersectionRatio)!=null?g:0,k=C,O=(S==null?void 0:S.isStyleVisible)&&v>i,D=y&&k>i;!S||O!==D||O!==D&&Math.abs(k-v)>o?l.set(h,{target:h,isVisible:D,isStyleVisible:y,intersectionRatio:k,intersectionRect:I,oldValue:S}):l.set(h,S)}return l}function Xf(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),l=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:l,width:0,height:0}}}function Kf(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function qf(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function Qf(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),l=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:l}}function ed(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function td(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function rd(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class sd{constructor(e){var u,c,f,d,m,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const l=typeof i=="object"&&i!==null?i:{};this.mode=(u=l==null?void 0:l.mode)!=null?u:"none",this.debounce=Number((c=l==null?void 0:l.debounce)!=null?c:100),this.throttle=Number((f=l==null?void 0:l.throttle)!=null?f:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((m=l==null?void 0:l.sensitivity)!=null?m:.05),this.rafThrottle=Number((p=l==null?void 0:l.rafThrottle)!=null?p:100),t.querySelectorAll("*").forEach(g=>this.observe(g)),new MutationObserver(g=>{g.forEach(h=>{h.addedNodes.forEach(b=>{b.nodeType===Node.ELEMENT_NODE&&(this.observe(b),b.querySelectorAll("*").forEach(I=>this.observe(I)))}),h.removedNodes.forEach(b=>{b.nodeType===Node.ELEMENT_NODE&&this.unobserve(b)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(this.disabled)return;const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Jf(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&cancelAnimationFrame(this.rafId)}}const id="2.1.2-alpha.2";let z,qe,zr,Wr,Be=!1;const lr=[];let Ee;function nd(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ni=s.contentWindow)==null?void 0:ni.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ae=ka();function ve(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:l="rr-ignore",ignoreSelector:a=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:d=!0,maskAllInputs:m,maskInputOptions:p,slimDOMOptions:g,maskInputFn:h,maskTextFn:b,hooks:I,packFn:C,sampling:y={},dataURLOptions:S={},mousemoveWait:v,recordDOM:k=!0,recordCanvas:O=!1,recordCrossOriginIframes:D=!1,recordAfter:F=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:H=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:X=!1,collectFonts:ee=!1,inlineImages:x=!1,plugins:te,keepIframeSrcFn:se=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:he}=s;Cf(he);const we=D?window.parent===window:!0;let ie=!1;if(!we)try{window.parent.document&&(ie=!1)}catch(M){ie=!0}if(we&&!e)throw new Error("emit function is required");if(!we&&!ie)return()=>{};v!==void 0&&y.mousemove===void 0&&(y.mousemove=v),ae.reset();const Sr=u===void 0?/.^/:u,Cr=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},vr=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all",headTitleMutations:g==="all"}:g||{};df();let Ks,Ir=0,xr=0;const ra=M=>{xr+=M},qs=M=>{for(const q of te||[])q.eventProcessor&&(M=q.eventProcessor(M));return C&&!ie&&(M=C(M)),M};z=(M,q)=>{var j;const J=M;if(J.timestamp=pe(),(j=Me[0])!=null&&j.isFrozen()&&J.type!==N.FullSnapshot&&!(J.type===N.IncrementalSnapshot&&J.data.source===A.Mutation)&&Me.forEach(le=>le.unfreeze()),we)e==null||e(qs(J),q);else if(ie){const le={type:"rrweb",event:qs(J),origin:window.location.origin,isCheckout:q};window.parent.postMessage(le,"*")}if(J.type===N.FullSnapshot)Ks=J,Ir=0;else if(J.type===N.IncrementalSnapshot){if(J.data.source===A.Mutation&&J.data.isAttachIframe)return;Ir++;const le=r&&Ir>=r,Ne=t&&J.timestamp-Ks.timestamp>t,L=i&&xr>=i;(le||Ne||L)&&(L&&(xr=0),qe(!0))}};const gt=M=>{z({type:N.IncrementalSnapshot,data:R({source:A.Mutation},M)})},Qs=M=>z({type:N.IncrementalSnapshot,data:R({source:A.Scroll},M)}),ei=M=>z({type:N.IncrementalSnapshot,data:R({source:A.CanvasMutation},M)}),ti=M=>{var q;(q=I==null?void 0:I.visibilityMutation)==null||q.call(I,M),z({type:N.IncrementalSnapshot,data:R({source:A.VisibilityMutation},M)})},sa=M=>z({type:N.IncrementalSnapshot,data:R({source:A.AdoptedStyleSheet},M)}),Ie=new Yf({mutationCb:gt,adoptedStyleSheetCb:sa}),xe=new Df({mirror:ae,mutationCb:gt,stylesheetManager:Ie,recordCrossOriginIframes:D,wrappedEmit:z});for(const M of te||[])M.getMirror&&M.getMirror({nodeMirror:ae,crossOriginIframeMirror:xe.crossOriginIframeMirror,crossOriginIframeStyleMirror:xe.crossOriginIframeStyleMirror});const Er=new Zf;zr=new Hf({recordCanvas:O,mutationCb:ei,win:window,blockClass:o,blockSelector:n,mirror:ae,sampling:y.canvas,dataURLOptions:S}),Wr=new sd({doc:window.document,mirror:ae,sampling:y.visibility,mutationCb:ti,notifyActivity:ra});const yt=new _f({mutationCb:gt,scrollCb:Qs,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,inlineStylesheet:d,maskInputOptions:Cr,dataURLOptions:S,maskTextFn:b,maskInputFn:h,recordCanvas:O,inlineImages:x,sampling:y,slimDOMOptions:vr,iframeManager:xe,stylesheetManager:Ie,canvasManager:zr,visibilityManager:Wr,keepIframeSrcFn:se,processedNodeManager:Er},mirror:ae});qe=(M=!1)=>{if(!k)return;z({type:N.Meta,data:{href:window.location.href,width:Uo(),height:Bo()}},M),Ie.reset(),yt.init(),Me.forEach(j=>j.lock());const q=fl(document,{mirror:ae,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,inlineStylesheet:d,maskAllInputs:Cr,maskTextFn:b,maskInputFn:h,slimDOM:vr,dataURLOptions:S,recordCanvas:O,inlineImages:x,onSerialize:j=>{Vo(j,ae)&&xe.addIframe(j),Go(j,ae)&&Ie.trackLinkElement(j),Is(j)&&yt.addShadowRoot(E.shadowRoot(j),document)},onIframeLoad:(j,J)=>{xe.attachIframe(j,J),yt.observeAttachShadow(j)},onStylesheetLoad:(j,J)=>{Ie.attachLinkElement(j,J)},keepIframeSrcFn:se});if(!q)return console.warn("Failed to snapshot the document");z({type:N.FullSnapshot,data:{node:q,initialOffset:Fo(window)}},M),Me.forEach(j=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ie.adoptStyleSheets(document.adoptedStyleSheets,ae.getId(document))},Ee=()=>{for(const M of lr)z(M);lr.length=0};try{const M=[],q=le=>{var Ne;return $(Lf)({mutationCb:gt,mousemoveCb:(L,Mr)=>z({type:N.IncrementalSnapshot,data:{source:Mr,positions:L}}),mouseInteractionCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.MouseInteraction},L)}),scrollCb:Qs,viewportResizeCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.ViewportResize},L)}),inputCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.Input},L)}),mediaInteractionCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.MediaInteraction},L)}),styleSheetRuleCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.StyleSheetRule},L)}),styleDeclarationCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.StyleDeclaration},L)}),canvasMutationCb:ei,visibilityMutationCb:ti,fontCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.Font},L)}),selectionCb:L=>{z({type:N.IncrementalSnapshot,data:R({source:A.Selection},L)})},customElementCb:L=>{z({type:N.IncrementalSnapshot,data:R({source:A.CustomElement},L)})},blockClass:o,ignoreClass:l,ignoreSelector:a,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,maskInputOptions:Cr,inlineStylesheet:d,sampling:y,recordDOM:k,recordCanvas:O,inlineImages:x,userTriggeredOnInput:X,collectFonts:ee,doc:le,maskInputFn:h,maskTextFn:b,keepIframeSrcFn:se,blockSelector:n,slimDOMOptions:vr,dataURLOptions:S,mirror:ae,iframeManager:xe,stylesheetManager:Ie,shadowDomManager:yt,processedNodeManager:Er,canvasManager:zr,visibilityManager:Wr,ignoreCSSAttributes:G,plugins:((Ne=te==null?void 0:te.filter(L=>L.observer))==null?void 0:Ne.map(L=>({observer:L.observer,options:L.options,callback:Mr=>z({type:N.Plugin,data:{plugin:L.name,payload:Mr}})})))||[]},I)};xe.addLoadListener(le=>{try{M.push(q(le.contentDocument))}catch(Ne){console.warn(Ne)}});const j=()=>{H==="before"&&Ee(),qe(),M.push(q(document)),Be=!0,H==="after"&&Ee()},J=async()=>{H==="before"&&Ee(),F==="DOMContentStabilized"&&(console.debug(`[${pe()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await nd(window),console.debug(`[${pe()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${pe()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),qe(),M.push(q(document)),Be=!0,H==="after"&&Ee()};return document.readyState==="interactive"||document.readyState==="complete"?j():(M.push(K("DOMContentLoaded",()=>{z({type:N.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&j()})),M.push(K("load",()=>{z({type:N.Load,data:{}}),F==="load"&&j()},window))),()=>{Ee(),M.forEach(le=>le()),Er.destroy(),Be=!1,vf()}}catch(M){console.warn(M)}}ve.getVersion=()=>id;ve.isRecording=()=>Be;ve.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${lr.length} events`),Ee()};ve.addCustomEvent=(s,e)=>{const t={type:N.Custom,data:{tag:s,payload:e}};if(!Be){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),lr.push(t);return}z(t)};ve.freezePage=()=>{Me.forEach(s=>s.freeze())};ve.takeFullSnapshot=s=>{if(!Be)throw new Error("please take full snapshot after start recording");qe(s)};ve.mirror=ae;var an;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(an||(an={}));exports.record=ve;
68
+ or you can use record.mirror to access the mirror instance during recording.`;let Zi={map:{},getId(){return console.error(Pe),-1},getNode(){return console.error(Pe),null},removeNodeFromMap(){console.error(Pe)},has(){return console.error(Pe),!1},reset(){console.error(Pe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Zi=new Proxy(Zi,{get(s,e,t){return e==="map"&&console.error(Pe),Reflect.get(s,e,t)}}));function ht(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const l=e-(n-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(a,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,o)},l))}}function br(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>br(s,e,o||{},!0)}function pe(){return Math.round(performance.timeOrigin+performance.now())}function Fo(s=window){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=E.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=E.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Bo(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Uo(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function zo(s){return s?s.nodeType===s.ELEMENT_NODE?s:E.parentElement(s):null}function Q(s,e,t,r){if(!s)return!1;const i=zo(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(qt(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function ff(s,e){return e.getId(s)!==-1}function Br(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===rt}function Wo(s,e){if(Qe(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=E.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Wo(r,e):!0}function vs(s){return!!s.changedTouches}function df(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Vo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Go(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Is(s){return s?s instanceof Js&&"shadowRoot"in s?!!s.shadowRoot:!!E.shadowRoot(s):!1}class pf{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 jo(s){var e;let t=null;return"getRootNode"in s&&((e=E.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&E.host(E.getRootNode(s))&&(t=E.host(E.getRootNode(s))),t}function mf(s){let e=s,t;for(;t=jo(e);)e=t;return e}function gf(s){const e=s.ownerDocument;if(!e)return!1;const t=mf(s);return E.contains(e,t)}function Ho(s){const e=s.ownerDocument;return e?E.contains(e,s)||gf(s):!1}var N=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(N||{}),A=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityMutation=17]="VisibilityMutation",s))(A||{}),re=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(re||{}),me=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(me||{}),He=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(He||{}),Le=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Le||{}),Yo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Yo||{});function Ji(s){return"__ln"in s}class yf{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ji(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ji(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Xi=(s,e)=>`${s}@${e}`;class wf{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new yf,i=a=>{let u=a,c=rt;for(;c===rt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=a=>{const u=E.parentNode(a);if(!u||!Ho(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const f=Qe(u)?this.mirror.getId(jo(a)):this.mirror.getId(u),d=i(a);if(f===-1||d===-1)return r.addNode(a);const m=_e(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Vo(p,this.mirror)&&this.iframeManager.addIframe(p),Go(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Is(a)&&this.shadowDomManager.addShadowRoot(E.shadowRoot(a),this.doc)},onIframeLoad:(p,g)=>{this.iframeManager.attachIframe(p,g),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,g)=>{this.stylesheetManager.attachLinkElement(p,g)},cssCaptured:c});m&&(e.push({parentId:f,nextId:d,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ki(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(E.parentNode(a))||o(a);for(const a of this.addedSet)!qi(this.droppedSet,a)&&!Ki(this.removesSubTreeCache,a,this.mirror)||qi(this.movedSet,a)?o(a):this.droppedSet.add(a);let n=null;for(;r.length;){let a=null;if(n){const u=this.mirror.getId(E.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(a=n)}if(!a){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const f=this.mirror.getId(E.parentNode(c.value));if(i(c.value)===-1)continue;if(f!==-1){a=c;break}else{const m=c.value,p=E.parentNode(m);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=E.host(p);if(this.mirror.getId(g)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}n=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{const u=a.node,c=E.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const c=JSON.stringify(a.styleDiff),f=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+f).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(E.childNodes(e),i=>E.textContent(i)||"").join("");t.attributes.value=Jt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Xt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Br(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=E.textContent(e.target);!Q(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:mn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);const n=t[r],l=typeof n=="boolean",a=document.contains(t),u=Ms(t),c=jr(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${pe()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c});return}if(jr(r,this.excludeAttribute)){console.debug(`[${pe()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const m=Xt(t);i=Jt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:m,value:i,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!pn(t.tagName,r))if(d.attributes[r]=dn(this.doc,Oe(t.tagName),Oe(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${pe()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===d.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:E.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:d.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:l,inDOM:a,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(g){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const g of Array.from(t.style)){const h=t.style.getPropertyValue(g),b=t.style.getPropertyPriority(g);h!==p.style.getPropertyValue(g)||b!==p.style.getPropertyPriority(g)?b===""?d.styleDiff[g]=h:d.styleDiff[g]=[h,b]:d._unchangedStyles[g]=[h,b]}for(const g of Array.from(p.style))t.style.getPropertyValue(g)===""&&(d.styleDiff[g]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(Q(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=Qe(e.target)?this.mirror.getId(E.host(e.target)):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||Br(t,this.mirror,this.slimDOMOptions)||!ff(t,this.mirror)||(this.addedSet.has(t)?(xs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Wo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Xi(r,i)]?xs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Qe(e.target)&&et(e.target)?!0:void 0}),bf(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Br(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Xi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(E.childNodes(e).forEach(r=>this.genAdds(r)),Is(e)&&E.childNodes(E.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function xs(s,e){s.delete(e),E.childNodes(e).forEach(t=>xs(s,t))}function bf(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),E.childNodes(r).forEach(i=>t.push(i)))}}function Ki(s,e,t){return s.size===0?!1:Sf(s,e)}function Sf(s,e,t){const r=E.parentNode(e);return r?s.has(r):!1}function qi(s,e){return s.size===0?!1:Zo(s,e)}function Zo(s,e){const t=E.parentNode(e);return t?s.has(t)?!0:Zo(s,t):!1}let tt;function Cf(s){tt=s}function vf(){tt=void 0}const $=s=>tt?(...t)=>{try{return s(...t)}catch(r){if(tt&&tt(r)===!0)return;throw r}}:s,Me=[];function Ye(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function Jo(s,e){const t=new wf;Me.push(t),t.init(s);const r=new(_o())($(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function If({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],l;const a=ht($(f=>{const d=Date.now()-l;s(n.map(m=>(m.timeOffset-=d,m)),f),n=[],l=null}),o),u=$(ht($(f=>{const d=Ye(f),{clientX:m,clientY:p}=vs(f)?f.changedTouches[0]:f;l||(l=pe()),n.push({x:m,y:p,id:r.getId(d),timeOffset:pe()-l}),a(typeof DragEvent!="undefined"&&f instanceof DragEvent?A.Drag:f instanceof MouseEvent?A.MouseMove:A.TouchMove)}),i,{trailing:!1})),c=[K("mousemove",u,t),K("touchmove",u,t),K("drag",u,t)];return $(()=>{c.forEach(f=>f())})}function xf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let a=null;const u=c=>f=>{const d=Ye(f);if(Q(d,r,i,!0))return;let m=null,p=c;if("pointerType"in f){switch(f.pointerType){case"mouse":m=me.Mouse;break;case"touch":m=me.Touch;break;case"pen":m=me.Pen;break}m===me.Touch?re[c]===re.MouseDown?p="TouchStart":re[c]===re.MouseUp&&(p="TouchEnd"):me.Pen}else vs(f)&&(m=me.Touch);m!==null?(a=m,(p.startsWith("Touch")&&m===me.Touch||p.startsWith("Mouse")&&m===me.Mouse)&&(m=null)):re[c]===re.Click&&(m=a,a=null);const g=vs(f)?f.changedTouches[0]:f;if(!g)return;const h=t.getId(d),{clientX:b,clientY:I}=g;$(s)(R({type:re[p],id:h,x:b,y:I},m!==null&&{pointerType:m}))};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let f=Oe(c);const d=u(c);if(window.PointerEvent)switch(re[c]){case re.MouseDown:case re.MouseUp:f=f.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(K(f,d,e))}),$(()=>{l.forEach(c=>c())})}function Xo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=$(ht($(l=>{const a=Ye(l);if(!a||Q(a,r,i,!0))return;const u=t.getId(a);if(a===e&&e.defaultView){const c=Fo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100));return K("scroll",n,e)}function Ef({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=$(ht($(()=>{const o=Bo(),n=Uo();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return K("resize",i,e)}const Ur=["INPUT","TEXTAREA","SELECT"],Qi=new WeakMap,Mf=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],en=new WeakMap;function Of({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function f(C){let y=Ye(C);const S=C.isTrusted,v=y&&y.tagName;if(y&&v==="OPTION"&&(y=E.parentElement(y)),!y||!v||Ur.indexOf(v)<0||Q(y,r,i,!0)||y.classList.contains(o)||n&&y.matches(n))return;let k=y.value,O=!1;const D=Xt(y)||"";D==="radio"||D==="checkbox"?O=y.checked:(l[v.toLowerCase()]||l[D])&&(k=Jt({element:y,maskInputOptions:l,tagName:v,type:D,value:k,maskInputFn:a})),d(y,c?{text:k,isChecked:O,userTriggered:S}:{text:k,isChecked:O});const F=y.name;D==="radio"&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(H=>{if(H!==y){const X=H.value;d(H,c?{text:X,isChecked:!O,userTriggered:!1}:{text:X,isChecked:!O})}})}function d(C,y){const S=Qi.get(C),v=C,k=v.hasAttribute("placeholder"),O=v.value==="",D=typeof v.defaultValue=="string"?v.defaultValue==="":!0,F=!y.userTriggered,H=!S||S.text==="",X=k&&O&&D&&H&&F&&!y.isChecked&&v.type!=="hidden"&&Ur.includes(v.tagName),ee=v.tagName==="INPUT"&&v.type==="text"&&!y.userTriggered&&y.text===v.defaultValue&&!S&&v.hasAttribute("placeholder"),x=!y.userTriggered&&v.value===v.defaultValue&&!S&&v.hasAttribute("placeholder")&&!y.isChecked&&v.type!=="hidden"&&Ur.includes(v.tagName),te=v.type==="checkbox"&&!y.userTriggered&&!y.isChecked&&!S,se=v.type==="radio"&&!y.userTriggered&&!y.isChecked&&!S;if(X||ee||x||te||se){console.debug(`[${pe()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:E.describeNode(v),tag:v.tagName,nodeType:v.nodeType,attribute:v.attributes,value:v.value,isLikelyPhantom:X,isRenderDrivenTextInput:ee,isValueFromDefault:x,isPhantomCheckbox:te,isPhantomRadio:se});return}if(!S||S.text!==y.text||S.isChecked!==y.isChecked){Qi.set(C,y);const G=t.getId(C);$(s)(ne(R({},y),{id:G}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(C=>K(C,$(f),e)),g=C=>{const y=Ye(C);if(!y||!y.tagName)return;if(u.input==="all"){f(C);return}const S=y.tagName,v=C.key,k=Mf.includes(v),O=S==="TEXTAREA",D=e.activeElement===y,F=y.value,H=en.get(y);if(en.set(y,F),!D){f(C);return}if(k){if(!O){f(C);return}let X=H!=null?H:"",ee=0;const x=2,te=()=>{const se=y.value,G=e.activeElement===y,he=se!==X;if(!G){f(C);return}if(he)ee=0,X=se;else if(ee++,ee>=x){f(C);return}requestAnimationFrame(te)};requestAnimationFrame(te);return}};p.push(K("keydown",$(g),e));const h=e.defaultView;if(!h)return()=>{p.forEach(C=>C())};const b=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),I=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&p.push(...I.map(C=>br(C[0],C[1],{set(){$(f)({target:this,isTrusted:!1})}},!1,h))),$(()=>{p.forEach(C=>C())})}function ar(s){const e=[];function t(r,i){if(Ut("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ut("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ut("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ut("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function be(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Af({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:$((c,f,d)=>{const[m,p]=d,{id:g,styleId:h}=be(f,e,t.styleMirror);return(g&&g!==-1||h&&h!==-1)&&s({id:g,styleId:h,adds:[{rule:m,index:p}]}),c.apply(f,d)})}),r.CSSStyleSheet.prototype.addRule=function(c,f,d=this.cssRules.length){const m=`${c} { ${f} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,d])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,removes:[{index:m}]}),c.apply(f,d)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,replace:m}),c.apply(f,d)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:$((c,f,d)=>{const[m]=d,{id:p,styleId:g}=be(f,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,replaceSync:m}),c.apply(f,d)})}));const a={};zt("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(zt("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),zt("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),zt("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([c,f])=>{u[c]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(u[c].insertRule,{apply:$((d,m,p)=>{const[g,h]=p,{id:b,styleId:I}=be(m.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||I&&I!==-1)&&s({id:b,styleId:I,adds:[{rule:g,index:[...ar(m),h||0]}]}),d.apply(m,p)})}),f.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:$((d,m,p)=>{const[g]=p,{id:h,styleId:b}=be(m.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||b&&b!==-1)&&s({id:h,styleId:b,removes:[{index:[...ar(m),g]}]}),d.apply(m,p)})})}),$(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,f])=>{f.prototype.insertRule=u[c].insertRule,f.prototype.deleteRule=u[c].deleteRule})})}function Ko({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(E.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;const f=(c=a.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(d){}return f}}),$(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Rf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:$((l,a,u)=>{var c;const[f,d,m]=u;if(t.has(f))return o.apply(a,[f,d,m]);const{id:p,styleId:g}=be((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,set:{property:f,value:d,priority:m},index:ar(a.parentRule)}),l.apply(a,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:$((l,a,u)=>{var c;const[f]=u;if(t.has(f))return n.apply(a,[f]);const{id:d,styleId:m}=be((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,remove:{property:f},index:ar(a.parentRule)}),l.apply(a,u)})}),$(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function $f({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=$(a=>ht($(u=>{const c=Ye(u);if(!c||Q(c,e,t,!0))return;const{currentTime:f,volume:d,muted:m,playbackRate:p,loop:g}=c;s({type:a,id:r.getId(c),currentTime:f,volume:d,muted:m,playbackRate:p,loop:g})}),i.media||500)),l=[K("play",n(Le.Play),o),K("pause",n(Le.Pause),o),K("seeked",n(Le.Seeked),o),K("volumechange",n(Le.VolumeChange),o),K("ratechange",n(Le.RateChange),o)];return $(()=>{l.forEach(a=>a())})}function Nf({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(a,u,c){const f=new o(a,u,c);return i.set(f,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),f};const n=$e(e.fonts,"add",function(l){return function(a){return setTimeout($(()=>{const u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=o}),r.push(n),$(()=>{r.forEach(l=>l())})}function kf(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const l=$(()=>{const a=e.getSelection();if(!a||n&&(a!=null&&a.isCollapsed))return;n=a.isCollapsed||!1;const u=[],c=a.rangeCount||0;for(let f=0;f<c;f++){const d=a.getRangeAt(f),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=d;Q(m,r,i,!0)||Q(g,r,i,!0)||u.push({start:t.getId(m),startOffset:p,end:t.getId(g),endOffset:h})}o({ranges:u})});return l(),K("selectionchange",l)}function Tf({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:$e(t.customElements,"define",function(i){return function(o,n,l){try{e({define:{name:o}})}catch(a){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,l])}})}function Pf(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:f,visibilityMutationCb:d,fontCb:m,selectionCb:p,customElementCb:g}=s;s.mutationCb=(...h)=>{e.mutation&&e.mutation(...h),t(...h)},s.mousemoveCb=(...h)=>{e.mousemove&&e.mousemove(...h),r(...h)},s.mouseInteractionCb=(...h)=>{e.mouseInteraction&&e.mouseInteraction(...h),i(...h)},s.scrollCb=(...h)=>{e.scroll&&e.scroll(...h),o(...h)},s.viewportResizeCb=(...h)=>{e.viewportResize&&e.viewportResize(...h),n(...h)},s.inputCb=(...h)=>{e.input&&e.input(...h),l(...h)},s.mediaInteractionCb=(...h)=>{e.mediaInteaction&&e.mediaInteaction(...h),a(...h)},s.styleSheetRuleCb=(...h)=>{e.styleSheetRule&&e.styleSheetRule(...h),u(...h)},s.styleDeclarationCb=(...h)=>{e.styleDeclaration&&e.styleDeclaration(...h),c(...h)},s.canvasMutationCb=(...h)=>{e.canvasMutation&&e.canvasMutation(...h),f(...h)},s.visibilityMutationCb=(...h)=>{e.visibilityMutation&&e.visibilityMutation(...h),d(...h)},s.fontCb=(...h)=>{e.font&&e.font(...h),m(...h)},s.selectionCb=(...h)=>{e.selection&&e.selection(...h),p(...h)},s.customElementCb=(...h)=>{e.customElement&&e.customElement(...h),g(...h)}}function Lf(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Pf(s,e);let r;s.recordDOM&&(r=Jo(s,s.doc));const i=If(s),o=xf(s),n=Xo(s),l=Ef(s,{win:t}),a=Of(s),u=$f(s);let c=()=>{},f=()=>{},d=()=>{},m=()=>{};s.recordDOM&&(c=Af(s,{win:t}),f=Ko(s,s.doc),d=Rf(s,{win:t}),s.collectFonts&&(m=Nf(s)));const p=kf(s),g=Tf(s),h=[];for(const b of s.plugins)h.push(b.observer(b.callback,t,b.options));return $(()=>{Me.forEach(b=>b.reset()),r==null||r.disconnect(),i(),o(),n(),l(),a(),u(),c(),f(),d(),m(),p(),g(),h.forEach(b=>b())})}function Ut(s){return typeof window[s]!="undefined"}function zt(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class tn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),n.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Df{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tn(fn)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tn(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 r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case N.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:N.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case N.Meta:case N.Load:case N.DomContentLoaded:return!1;case N.Plugin:return t;case N.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case N.IncrementalSnapshot:switch(t.data.source){case A.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.Drag:case A.TouchMove:case A.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(t.data,e,["id"]),t;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case A.Font:return t;case A.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case A.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Yo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class _f{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!et(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Jo(ne(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Xo(ne(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(E.host(e))),this.restoreHandlers.push(Ko({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push($e(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),l=E.shadowRoot(this);return l&&Ho(this)&&r.addShadowRoot(l,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ff=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Wt=0;Wt<Fe.length;Wt++)Ff[Fe.charCodeAt(Wt)]=Wt;var Bf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Fe[e[t]>>2],i+=Fe[(e[t]&3)<<4|e[t+1]>>4],i+=Fe[(e[t+1]&15)<<2|e[t+2]>>6],i+=Fe[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const rn=new Map;function Uf(s,e){let t=rn.get(s);return t||(t=new Map,rn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const qo=(s,e,t)=>{if(!s||!(ea(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Uf(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function Zt(s,e,t){if(s instanceof Array)return s.map(r=>Zt(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Bf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Zt(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Zt(s.data,e,t),s.width,s.height]};if(ea(s,e)||typeof s=="object"){const r=s.constructor.name,i=qo(s,e,t);return{rr_type:r,index:i}}}}return s}const Qo=(s,e,t)=>s.map(r=>Zt(r,e,t)),ea=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function zf(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const l=$e(e.CanvasRenderingContext2D.prototype,n,function(a){return function(...u){return Q(this.canvas,t,r,!0)||setTimeout(()=>{const c=Qo(u,e,this);s(this.canvas,{type:He["2D"],property:n,args:c})},0),a.apply(this,u)}});i.push(l)}catch(l){const a=br(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:He["2D"],property:n,args:[u],setter:!0})}});i.push(a)}return()=>{i.forEach(n=>n())}}function Wf(s){return s==="experimental-webgl"?"webgl":s}function sn(s,e,t,r){const i=[];try{const o=$e(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(l,...a){if(!Q(this,e,t,!0)){const u=Wf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){const c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[l,...a])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function nn(s,e,t,r,i,o){const n=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const u=$e(s,a,function(c){return function(...f){const d=c.apply(this,f);if(qo(d,o,this),"tagName"in this.canvas&&!Q(this.canvas,r,i,!0)){const m=Qo(f,o,this),p={type:e,property:a,args:m};t(this.canvas,p)}return d}});n.push(u)}catch(u){const c=br(s,a,{set(f){t(this.canvas,{type:e,property:a,args:[f],setter:!0})}});n.push(c)}return n}function Vf(s,e,t,r){const i=[];return i.push(...nn(e.WebGLRenderingContext.prototype,He.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...nn(e.WebGL2RenderingContext.prototype,He.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ta="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Gf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),on=typeof window!="undefined"&&window.Blob&&new Blob([Gf(ta)],{type:"text/javascript;charset=utf-8"});function jf(s){let e;try{if(e=on&&(window.URL||window.webkitURL).createObjectURL(on),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+ta,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Hf{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=sn(t,r,i,!0),l=new Map,a=new jf;a.onmessage=p=>{const{id:g}=p.data;if(l.set(g,!1),!("base64"in p.data))return;const{base64:h,type:b,width:I,height:C}=p.data;this.mutationCb({id:g,type:He["2D"],commands:[{property:"clearRect",args:[0,0,I,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:b}]},0,0]}]})};const u=1e3/e;let c=0,f;const d=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(g=>{Q(g,r,i,!0)||p.push(g)}),p},m=p=>{if(c&&p-c<u){f=requestAnimationFrame(m);return}c=p,d().forEach(async g=>{var h;const b=this.mirror.getId(g);if(l.get(b)||g.width===0||g.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(g.__context)){const C=g.getContext(g.__context);((h=C==null?void 0:C.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&C.clear(C.COLOR_BUFFER_BIT)}const I=await createImageBitmap(g);a.postMessage({id:b,bitmap:I,width:g.width,height:g.height,dataURLOptions:o.dataURLOptions},[I])}),f=requestAnimationFrame(m)};f=requestAnimationFrame(m),this.resetObservers=()=>{n(),cancelAnimationFrame(f)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=sn(e,t,r,!1),o=zf(this.processMutation.bind(this),e,t,r),n=Vf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:l}=u;return ke(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Yf{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new pf),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(l,a)=>({rule:un(l,o.href),index:a}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Zf{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}function Jf(s,e,t){var c,f,d,m,p,g;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(f=t==null?void 0:t.threshold)!=null?f:.5,o=(d=t==null?void 0:t.sensitivity)!=null?d:.05,n=Xf((m=t==null?void 0:t.rootMargin)!=null?m:"0px"),l=new Map,a=Kf(r),u=qf(a,n);for(const h of s){const b=h.getBoundingClientRect();let I=td(),C=0;b.width>0&&b.height>0&&(I=Qf(b,u),C=ed(b,I),C=Math.round(C*100)/100);const y=rd(h),S=(p=e.get(h))!=null?p:null,v=(g=S==null?void 0:S.intersectionRatio)!=null?g:0,k=C,O=(S==null?void 0:S.isStyleVisible)&&v>i,D=y&&k>i;!S||O!==D||O!==D&&Math.abs(k-v)>o?l.set(h,{target:h,isVisible:D,isStyleVisible:y,intersectionRatio:k,intersectionRect:I,oldValue:S}):l.set(h,S)}return l}function Xf(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),l=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:l,width:0,height:0}}}function Kf(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function qf(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function Qf(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),l=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:l}}function ed(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function td(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function rd(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class sd{constructor(e){var u,c,f,d,m,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"intervalId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const l=typeof i=="object"&&i!==null?i:{};this.mode=(u=l==null?void 0:l.mode)!=null?u:"none",this.debounce=Number((c=l==null?void 0:l.debounce)!=null?c:100),this.throttle=Number((f=l==null?void 0:l.throttle)!=null?f:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((m=l==null?void 0:l.sensitivity)!=null?m:.05),this.rafThrottle=Number((p=l==null?void 0:l.rafThrottle)!=null?p:50),t.querySelectorAll("*").forEach(g=>this.observe(g)),new MutationObserver(g=>{g.forEach(h=>{h.addedNodes.forEach(b=>{b.nodeType===Node.ELEMENT_NODE&&(this.observe(b),b.querySelectorAll("*").forEach(I=>this.observe(I)))}),h.removedNodes.forEach(b=>{b.nodeType===Node.ELEMENT_NODE&&this.unobserve(b)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Jf(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const id="2.1.3-alpha.1";let z,qe,zr,Wr,Be=!1;const lr=[];let Ee;function nd(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ni=s.contentWindow)==null?void 0:ni.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ae=ka();function ve(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:l="rr-ignore",ignoreSelector:a=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:d=!0,maskAllInputs:m,maskInputOptions:p,slimDOMOptions:g,maskInputFn:h,maskTextFn:b,hooks:I,packFn:C,sampling:y={},dataURLOptions:S={},mousemoveWait:v,recordDOM:k=!0,recordCanvas:O=!1,recordCrossOriginIframes:D=!1,recordAfter:F=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:H=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:X=!1,collectFonts:ee=!1,inlineImages:x=!1,plugins:te,keepIframeSrcFn:se=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:he}=s;Cf(he);const we=D?window.parent===window:!0;let ie=!1;if(!we)try{window.parent.document&&(ie=!1)}catch(M){ie=!0}if(we&&!e)throw new Error("emit function is required");if(!we&&!ie)return()=>{};v!==void 0&&y.mousemove===void 0&&(y.mousemove=v),ae.reset();const Sr=u===void 0?/.^/:u,Cr=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},vr=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all",headTitleMutations:g==="all"}:g||{};df();let Ks,Ir=0,xr=0;const ra=M=>{xr+=M},qs=M=>{for(const q of te||[])q.eventProcessor&&(M=q.eventProcessor(M));return C&&!ie&&(M=C(M)),M};z=(M,q)=>{var j;const J=M;if(J.timestamp=pe(),(j=Me[0])!=null&&j.isFrozen()&&J.type!==N.FullSnapshot&&!(J.type===N.IncrementalSnapshot&&J.data.source===A.Mutation)&&Me.forEach(le=>le.unfreeze()),we)e==null||e(qs(J),q);else if(ie){const le={type:"rrweb",event:qs(J),origin:window.location.origin,isCheckout:q};window.parent.postMessage(le,"*")}if(J.type===N.FullSnapshot)Ks=J,Ir=0;else if(J.type===N.IncrementalSnapshot){if(J.data.source===A.Mutation&&J.data.isAttachIframe)return;Ir++;const le=r&&Ir>=r,Ne=t&&J.timestamp-Ks.timestamp>t,L=i&&xr>=i;(le||Ne||L)&&(L&&(xr=0),qe(!0))}};const gt=M=>{z({type:N.IncrementalSnapshot,data:R({source:A.Mutation},M)})},Qs=M=>z({type:N.IncrementalSnapshot,data:R({source:A.Scroll},M)}),ei=M=>z({type:N.IncrementalSnapshot,data:R({source:A.CanvasMutation},M)}),ti=M=>{var q;(q=I==null?void 0:I.visibilityMutation)==null||q.call(I,M),z({type:N.IncrementalSnapshot,data:R({source:A.VisibilityMutation},M)})},sa=M=>z({type:N.IncrementalSnapshot,data:R({source:A.AdoptedStyleSheet},M)}),Ie=new Yf({mutationCb:gt,adoptedStyleSheetCb:sa}),xe=new Df({mirror:ae,mutationCb:gt,stylesheetManager:Ie,recordCrossOriginIframes:D,wrappedEmit:z});for(const M of te||[])M.getMirror&&M.getMirror({nodeMirror:ae,crossOriginIframeMirror:xe.crossOriginIframeMirror,crossOriginIframeStyleMirror:xe.crossOriginIframeStyleMirror});const Er=new Zf;zr=new Hf({recordCanvas:O,mutationCb:ei,win:window,blockClass:o,blockSelector:n,mirror:ae,sampling:y.canvas,dataURLOptions:S}),Wr=new sd({doc:window.document,mirror:ae,sampling:y.visibility,mutationCb:ti,notifyActivity:ra});const yt=new _f({mutationCb:gt,scrollCb:Qs,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,inlineStylesheet:d,maskInputOptions:Cr,dataURLOptions:S,maskTextFn:b,maskInputFn:h,recordCanvas:O,inlineImages:x,sampling:y,slimDOMOptions:vr,iframeManager:xe,stylesheetManager:Ie,canvasManager:zr,visibilityManager:Wr,keepIframeSrcFn:se,processedNodeManager:Er},mirror:ae});qe=(M=!1)=>{if(!k)return;z({type:N.Meta,data:{href:window.location.href,width:Uo(),height:Bo()}},M),Ie.reset(),yt.init(),Me.forEach(j=>j.lock());const q=fl(document,{mirror:ae,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,inlineStylesheet:d,maskAllInputs:Cr,maskTextFn:b,maskInputFn:h,slimDOM:vr,dataURLOptions:S,recordCanvas:O,inlineImages:x,onSerialize:j=>{Vo(j,ae)&&xe.addIframe(j),Go(j,ae)&&Ie.trackLinkElement(j),Is(j)&&yt.addShadowRoot(E.shadowRoot(j),document)},onIframeLoad:(j,J)=>{xe.attachIframe(j,J),yt.observeAttachShadow(j)},onStylesheetLoad:(j,J)=>{Ie.attachLinkElement(j,J)},keepIframeSrcFn:se});if(!q)return console.warn("Failed to snapshot the document");z({type:N.FullSnapshot,data:{node:q,initialOffset:Fo(window)}},M),Me.forEach(j=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ie.adoptStyleSheets(document.adoptedStyleSheets,ae.getId(document))},Ee=()=>{for(const M of lr)z(M);lr.length=0};try{const M=[],q=le=>{var Ne;return $(Lf)({mutationCb:gt,mousemoveCb:(L,Mr)=>z({type:N.IncrementalSnapshot,data:{source:Mr,positions:L}}),mouseInteractionCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.MouseInteraction},L)}),scrollCb:Qs,viewportResizeCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.ViewportResize},L)}),inputCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.Input},L)}),mediaInteractionCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.MediaInteraction},L)}),styleSheetRuleCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.StyleSheetRule},L)}),styleDeclarationCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.StyleDeclaration},L)}),canvasMutationCb:ei,visibilityMutationCb:ti,fontCb:L=>z({type:N.IncrementalSnapshot,data:R({source:A.Font},L)}),selectionCb:L=>{z({type:N.IncrementalSnapshot,data:R({source:A.Selection},L)})},customElementCb:L=>{z({type:N.IncrementalSnapshot,data:R({source:A.CustomElement},L)})},blockClass:o,ignoreClass:l,ignoreSelector:a,maskTextClass:c,maskTextSelector:f,excludeAttribute:Sr,maskInputOptions:Cr,inlineStylesheet:d,sampling:y,recordDOM:k,recordCanvas:O,inlineImages:x,userTriggeredOnInput:X,collectFonts:ee,doc:le,maskInputFn:h,maskTextFn:b,keepIframeSrcFn:se,blockSelector:n,slimDOMOptions:vr,dataURLOptions:S,mirror:ae,iframeManager:xe,stylesheetManager:Ie,shadowDomManager:yt,processedNodeManager:Er,canvasManager:zr,visibilityManager:Wr,ignoreCSSAttributes:G,plugins:((Ne=te==null?void 0:te.filter(L=>L.observer))==null?void 0:Ne.map(L=>({observer:L.observer,options:L.options,callback:Mr=>z({type:N.Plugin,data:{plugin:L.name,payload:Mr}})})))||[]},I)};xe.addLoadListener(le=>{try{M.push(q(le.contentDocument))}catch(Ne){console.warn(Ne)}});const j=()=>{H==="before"&&Ee(),qe(),M.push(q(document)),Be=!0,H==="after"&&Ee()},J=async()=>{H==="before"&&Ee(),F==="DOMContentStabilized"&&(console.debug(`[${pe()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await nd(window),console.debug(`[${pe()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${pe()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),qe(),M.push(q(document)),Be=!0,H==="after"&&Ee()};return document.readyState==="interactive"||document.readyState==="complete"?j():(M.push(K("DOMContentLoaded",()=>{z({type:N.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&j()})),M.push(K("load",()=>{z({type:N.Load,data:{}}),F==="load"&&j()},window))),()=>{Ee(),M.forEach(le=>le()),Er.destroy(),Be=!1,vf()}}catch(M){console.warn(M)}}ve.getVersion=()=>id;ve.isRecording=()=>Be;ve.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${lr.length} events`),Ee()};ve.addCustomEvent=(s,e)=>{const t={type:N.Custom,data:{tag:s,payload:e}};if(!Be){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),lr.push(t);return}z(t)};ve.freezePage=()=>{Me.forEach(s=>s.freeze())};ve.takeFullSnapshot=s=>{if(!Be)throw new Error("please take full snapshot after start recording");qe(s)};ve.mirror=ae;var an;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(an||(an={}));exports.record=ve;
69
69
  if (typeof module.exports == "object" && typeof exports == "object") {
70
70
  var __cp = (to, from, except, desc) => {
71
71
  if ((from && typeof from === "object") || typeof from === "function") {