posthog-js 1.434.6 → 1.434.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.cjs +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.cjs +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.cjs +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/posthog-recorder.js.map +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/extensions/replay/external/network-plugin.js +40 -14
- package/lib/src/extensions/replay/external/network-plugin.js.map +1 -1
- package/package.json +3 -3
package/dist/recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n,r){return(n=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var r=1;arguments.length>r;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(r,i)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var s=t.apply(e,n);function a(t){i(s,r,o,a,l,"next",t)}function l(t){i(s,r,o,a,l,"throw",t)}a(void 0)})}}const s=["type"];var a=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),l=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),u=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),c=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),d=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),h=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),f=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function m(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},y={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},v={};function b(t){if(v[t])return v[t];const e=function(t){var e,n;const r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],n=e.prototype,r=t in p?p[t]:void 0,i=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in y?y[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(i&&s)return v[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const r=a.contentWindow;if(!r)return e.prototype;const i=r[t].prototype;return i?(m(u=navigator.userAgent,"AppleWebKit")&&!m(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),v[t]=i):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var g=Object.create(null);function w(t,e,n){var r;const i=g[t],o=i[n];if(o)return o.call(e);const s=b(t),a=null===(r=Object.getOwnPropertyDescriptor(s,n))||void 0===r?void 0:r.get;return a?(i[n]=a,a.call(e)):e[n]}g.Node=Object.create(null),g.ShadowRoot=Object.create(null),g.MutationObserver=Object.create(null),g.Element=Object.create(null);var k,S={};function C(t,e,n){const r=`${t}.${String(n)}`;if(S[r])return S[r].bind(e);const i=b(t)[n];return"function"!=typeof i?e[n]:(S[r]=i,i.bind(e))}function I(){return b("MutationObserver").constructor}function M(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i={next:r},o=n(function(...t){return i.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:i}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=i.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let r=t[e],s=n(r);for(;s;){if(s.next===o)return void(s.next=i.next);r=s.next,s=n(r)}}}catch(t){return()=>{}}}var x={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),isConnected(t){if(void 0===k){var e;const t=null===(e=Object.getOwnPropertyDescriptor(b("Node"),"isConnected"))||void 0===e?void 0:e.get;k=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==k?void 0:k.call(t)},contains:(t,e)=>C("Node",t,"contains")(e),getRootNode:t=>C("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>C("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>C("Element",t,"querySelectorAll")(e),mutationObserver:I,patch:M};function A(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var R=0;function O(){R+=1}function T(){return R}function E(t,e){return(e!==R||t>6e4)&&!0}var F=0,L=0,N=0,D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},_=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function q(t){var e;(F+=1)>1||(D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},W=[],P=0,j=(e=t)&&e>0?e:null,L=A(),N=R)}function z(){return 0===F?_||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(F-=1)>0?D:(D.durationMs=A()-L,D.deferredStylesheetCount=P,U.deferredCount+=P,j=null,E(D.durationMs,N)?D:_=D)}function G(t,e,n){let r=t.length;if(n>=32)return r;for(let i=0;t.length>i;i++){const o=t[i];try{const t=o.cssRules;if(t&&t.length)r+=G(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const i=t.rules||t.cssRules;i&&(r+=G(i,e,n+1))}}}catch(t){}}return r}function Z(t){if(0===F)return;const e=G(t,null,0);D.cssRuleCount+=e,B>0&&(D.nonDeferrableCssRuleCount+=e)}function V(t){B+=1;try{return t()}finally{B-=1}}function X(t){F>0&&(D.stylesheetMs+=t)}function Y(t){if(0===F||null===j)return!1;const e=D.cssRuleCount-D.nonDeferrableCssRuleCount;return e>=j||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),G(e,n,0)}catch(t){return 0}}(t)>j}function J(){const t=W;return W=[],t}function Q(){U.failedCount+=1}function K(t){t>0&&(U.abandonedCount+=t)}function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e,n){return(e=function(t){var e=function(t){if("object"!=tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nt(t){return t.nodeType===t.ELEMENT_NODE}function rt(t){const e=t&&"host"in t&&"mode"in t&&x.host(t)||null;return Boolean(e&&"shadowRoot"in e&&x.shadowRoot(e)===t)}function it(t){return"[object ShadowRoot]"==={}.toString.call(t)}function ot(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function st(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var at=0;function lt(t){const e=0===at,n=e?A():0;at+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Z(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),ot(Array.from(e,t=>ut(t,n)).join(""))}catch(t){return null}finally{at-=1,e&&X(A()-n)}}function ut(t,e){if(dt(t)){let e;try{e=lt(t.styleSheet)||st(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return At(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ht(t)&&t.selectorText.includes(":")&&(n=ct(n)),e?At(n,e):n}}function ct(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function dt(t){return"styleSheet"in t}function ht(t){return"selectorText"in t}var ft=/^-?[A-Za-z_][\w-]*$/,mt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function pt(t){const e=[];let n=!1,r=null;const i=new Map;function o(t){const i=e.pop();if("group"===i.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!i.importRule)return n=!0,void(r=t);s(e[e.length-1],i.importRule,t)}function s(t,e,n){try{let i;try{i=n||st(e)}catch(t){i=e.cssText}try{var r;i&&(null===(r=e.styleSheet)||void 0===r?void 0:r.href)&&(i=At(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&dt(n)){const r=i.get(n);return null===r?(t.parts.push(n.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const r=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(ht(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ft.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ft.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":mt.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===r)return!1;const i=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:i,index:0,parts:[],prelude:i?At(r,i):r,fixColons:"sheet"===n.kind&&ht(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let r=n.cssText;"sheet"===t.kind&&ht(n)&&n.selectorText.includes(":")&&(r=ct(r)),t.parts.push(t.sheetHref?At(r,t.sheetHref):r),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Z(n);let r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!dt(e)||i.has(e))continue;let r=null;try{r=e.styleSheet}catch(t){i.set(e,null);continue}if(r&&!n.some(t=>t.sheet===r))try{const t=r.rules||r.cssRules;if(!t)continue;Z(t);let o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);const s=Array.from(t);i.set(e,{sheet:r,rules:s,sheetHref:o}),n.push({sheet:r,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const i=A();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ct(n):n}else e=ot(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,r=null}finally{X(A()-i)}return n},text:()=>n?r:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var yt=class{constructor(){et(this,"idNodeMap",new Map),et(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),nt(t)){const e=x.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function vt({element:t,maskInputOptions:e,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&bt(r);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function bt(t){return t.toLowerCase()}var gt=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function wt({element:t,name:e,value:n,maskAllElementAttributes:r,maskAttributeFn:i,isGenerated:o=!1}){return n?r?o&>.has(bt(e))?n:"*".repeat(n.length):i?i(e,n,t):n:n}var kt="__rrweb_original__";function St(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?bt(e):null}catch(t){return null}}var Ct=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,It=/^(?:[a-z+]+:)?\/\//i,Mt=/^www\..*/i,xt=/^(data:)([^,]*),(.*)/i;function At(t,e){return(t||"").replace(Ct,(t,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return t;if(It.test(a)||Mt.test(a))return`url(${l}${a}${l})`;if(xt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var Rt,Ot,Tt=new Map,Et=1,Ft=new RegExp("[^a-z0-9-_:]");function Lt(){return Et++}var Nt=!1,Dt=/^[^ \t\n\r\u000c]+/,_t=/^[, \t\n\r\u000c]+/,jt=new WeakMap;function $t(t,e){return e&&""!==e.trim()?Wt(t,e):e}function Wt(t,e){let n=jt.get(t);if(n||(n=t.createElement("a"),jt.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Pt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Bt(t,e,n,r,i,o){if(!r)return r;if("src"===n||"href"===n&&("use"!==e||"#"!==r[0])){if("link"===e&&i){var s;const t=null===(s=i.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=$t(t,r);if(n.startsWith("data:")){if("img"===e&&i){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,r){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const i=Tt.get(e);if(i&&i.type===n&&i.quality===r)return i.result;try{const i=document.createElement("canvas");i.width=t.naturalWidth,i.height=t.naturalHeight;const o=i.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=i.toDataURL(n||"image/webp",null!=r?r:.4),a=e.length>s.length?s:e;if(Tt.size>=10){const t=Tt.keys().next().value;void 0!==t&&Tt.delete(t)}return Tt.set(e,{type:n,quality:r,result:a}),a}catch(t){return e}}(i,n,o.type,o.quality)),Pt(t,o)}if("image"===e)return Pt(n,o)}return n}if("xlink:href"===n&&"#"!==r[0]){const n=$t(t,r);return"image"===e&&n.startsWith("data:")?Pt(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function r(t){let r;const i=t.exec(e.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(_t),e.length>n;){let o=r(Dt);if(","===o.slice(-1))o=$t(t,o.substring(0,o.length-1)),i.push(o);else{let r="";o=$t(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){i.push((o+r).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,i.push((o+r).trim());break}"("===t&&(s=!0)}r+=t,n+=1}}}return i.join(", ")}(t,r):"style"===n?At(r,Wt(t)):"object"===e&&"data"===n?$t(t,r):r:$t(t,r)}function Ht(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===bt(e)}function Ut(t){return"string"==typeof t&&bt(t).split(/\s+/).includes("stylesheet")}function qt(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&qt(x.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&qt(x.parentNode(t),e,n)}function zt(t,e,n,r){let i;if(nt(t)){if(i=t,!x.childNodes(i).length)return!1}else{if(null===x.parentElement(t))return!1;i=x.parentElement(t)}try{if("string"==typeof e){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(qt(i,e,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(t){}return!1}function Gt(t,e,n){const r=t.removeEventListener;"function"==typeof r&&r.call(t,e,n)}var Zt=new Map;function Vt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Xt(t){return null==t?"":t.toLowerCase()}var Yt=!1,Jt=!1;function Qt(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m=!1,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v={},inlineImages:b=!1,recordCanvas:g=!1,canvasMaskingConfigured:w,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C=5e3,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:O=!1,depth:T=0,maxDepth:E=50}=e;let{needsMask:L}=e,{preserveWhiteSpace:N=!0}=e;if(T>=E)return Jt=!0,Yt||(Yt=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${E}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;L||(L=zt(t,s,a,void 0===L)),F>0&&(D.nodeCount+=1);const _=function(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:m={},inlineImages:p,recordCanvas:y,canvasMaskingConfigured:v,keepIframeSrcFn:b,newlyAddedElement:g=!1}=e,w=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:w};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:m,keepIframeSrcFn:p,newlyAddedElement:y=!1,rootId:v}=e,b=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,r,i),g=function(t){if(t instanceof HTMLFormElement)return"form";const e=bt(t.tagName);return Ft.test(e)?"div":e}(t),w=new Set;let k={};const S=t.attributes.length;for(let e=0;S>e;e++){const r=t.attributes[e];Ht(g,r.name)||(k[r.name]=Bt(n,g,bt(r.name),r.value,t,c))}if("link"===g&&o&&!b&&Ut(k.rel)){let e=t.sheet;if(!e){const r=function(t){return t.href}(t);r&&(e=Vt(n,r),!e&&r.includes(".css"))&&(e=Vt(n,window.location.origin+"/"+r.replace(window.location.href,"")))}let r=null;e&&(Y(e)?F>0&&(W.push(t),P+=1):r=lt(e)),r&&(delete k.rel,delete k.href,k._cssText=r)}var C;if("style"===g&&t.sheet&&!(t.innerText||x.textContent(t)||"").trim().length){const e=V(()=>lt(t.sheet));e&&(k._cssText=e)}if("input"===g||"textarea"===g||"select"===g){const e=t.value,n=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&e?k.value=vt({element:t,type:St(t),tagName:g,value:e,maskInputOptions:s,maskInputFn:a}):n&&(k.checked=n)}if("option"===g&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===g&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===g&&h&&!(null==m?void 0:m()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let r=0;t.height>r;r+=50){const i=e.getImageData,o=kt in i?i[kt]:i;let s;try{s=o.call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=t.width,r.height=t.height,e!==r.toDataURL(c.type,c.quality)&&(k.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(C=t)?void 0:C.name)?Nt||(Nt=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",C)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",C)}let I,M=!1;if("img"===g&&d){Rt||(Rt=n.createElement("canvas"),Ot=Rt.getContext("2d"));const e=t,r=e.currentSrc||e.getAttribute("src")||"<unknown-src>",i=e.crossOrigin,o=(e,n)=>M?wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Gt(e,"load",s);try{Rt.width=e.naturalWidth,Rt.height=e.naturalHeight,Ot.drawImage(e,0,0);const t=Rt.toDataURL(c.type,c.quality);k.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${r}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(i?k.crossOrigin=o("crossOrigin",i):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===g||"video"===g){const e=k;e.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var A,R,O;const{width:e,height:r,left:i,top:o}=t.getBoundingClientRect(),s=null===(A=n.defaultView)||void 0===A?void 0:A.getComputedStyle(t);k={class:k.class,rr_width:`${e}px`,rr_height:`${r}px`,rr_left:`${Math.floor(i+((null===(R=n.defaultView)||void 0===R?void 0:R.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(O=n.defaultView)||void 0===O?void 0:O.scrollY)||0))}px`},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),s&&(k.rr_position=s.position||"static",w.add("rr_position"),s.transform&&"none"!==s.transform&&(k.rr_transform=s.transform,w.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(k.rr_display=s.display,w.add("rr_display")))}if("iframe"!==g||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(const[e,n]of Object.entries(k))"string"!=typeof n&&null!==n||(k[e]=wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(e)}));M=!0;try{customElements.get(g)&&(I=!0)}catch(t){}return{type:f.Element,tagName:g,attributes:k,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:b,rootId:v,isCustom:I};var T}(t,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:m,inlineImages:p,recordCanvas:y,canvasMaskingConfigured:v,keepIframeSrcFn:b,newlyAddedElement:g,rootId:w});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:r,rootId:i}=e,o=x.parentNode(t),s=o&&o.tagName;let a=x.textContent(t);const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Y(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=lt(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=At(a,Wt(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=r?r(a,x.parentElement(t)):a.replace(/[\S]/g,"*")),{type:f.Text,textContent:a||"",isStyle:l,rootId:i}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:w});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:w};case t.COMMENT_NODE:return{type:f.Comment,textContent:x.textContent(t)||"",rootId:w};default:return!1}}(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,keepIframeSrcFn:R,newlyAddedElement:O});if(!_)return console.warn(t,"not serialized"),null;let j;j=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Xt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Xt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Xt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Xt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Xt(t.attributes.property).match(/^(og|twitter|fb):/)||Xt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Xt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Xt(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Xt(t.attributes.name))||Xt(t.attributes.property).match(/^article:/)||Xt(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Xt(t.attributes.name)))return!0}}return!1}(_,y)||!N&&_.type===f.Text&&!_.isStyle&&!_.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Lt();const B=Object.assign(_,{id:j});if(r.add(t,B),-2===j)return null;k&&k(t);let H=!l;if(B.type===f.Element){H=H&&!B.needBlock,delete B.needBlock;const e=x.shadowRoot(t);e&&it(e)&&(B.isShadowHost=!0)}if((B.type===f.Document||B.type===f.Element)&&H){y.headWhitespace&&B.type===f.Element&&"head"===B.tagName&&(N=!1);const e={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T+1,maxDepth:E};if(B.type===f.Element&&"textarea"===B.tagName&&void 0!==B.attributes.value);else for(const n of Array.from(x.childNodes(t))){const t=Qt(n,e);t&&B.childNodes.push(t)}let O=null;if(nt(t)&&(O=x.shadowRoot(t)))for(const t of Array.from(x.childNodes(O))){const n=Qt(t,e);n&&(it(O)&&(n.isShadow=!0),B.childNodes.push(n))}}const U=x.parentNode(t);if(U&&rt(U)&&it(U)&&(B.isShadow=!0),B.type===f.Element&&"iframe"===B.tagName){const e=function(t,e,n){const r=()=>{},i=t.contentWindow;if(!i)return r;let o;try{o=i.document.readyState}catch(t){return r}const s=()=>e();if("complete"!==o){let r=!1,i=null;const o=()=>{r||(r=!0,null!==i&&(clearTimeout(i),i=null),Gt(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return i=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==i&&(clearTimeout(i),i=null),r?Gt(t,"load",s):(r=!0,Gt(t,"load",a))}}const a="about:blank";let l;try{l=i.location.href}catch(t){return r}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),Gt(t,"load",s)}}return t.addEventListener("load",s),()=>{Gt(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&S){const n=Qt(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T+1,maxDepth:E});n&&S(t,n)}},C);null==I||I(t,e)}return B.type===f.Element&&"link"===B.tagName&&Ut(B.attributes.rel)&&function(e,l,f){if(Zt.has(e))return;let I;try{I=e.sheet}catch(t){return}if(I)return;const x=new AbortController;let O=!1;const F=()=>{if(!O){O=!0;try{(()=>{if(M){const e=Qt(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T,maxDepth:E});e&&M(t,e)}})()}finally{Zt.delete(e),x.abort()}}},D=setTimeout(F,f);x.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",F,{signal:x.signal,once:!0}),Zt.set(e,x)}(t,0,A),B}function Kt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var te=class t{constructor(...t){et(this,"parentElement",null),et(this,"parentNode",null),et(this,"ownerDocument",void 0),et(this,"firstChild",null),et(this,"lastChild",null),et(this,"previousSibling",null),et(this,"nextSibling",null),et(this,"ELEMENT_NODE",1),et(this,"TEXT_NODE",3),et(this,"nodeType",void 0),et(this,"nodeName",void 0),et(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function ee(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>ne(n,t,e,r)}function ne(t,e,n,r){re(()=>{const i=t.removeEventListener;"function"==typeof i&&(void 0!==r?i.call(t,e,n,r):i.call(t,e,n))})}function re(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ie(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var oe="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",se={map:{},getId(){return console.warn(oe),-1},getNode(){return console.warn(oe),null},removeNodeFromMap(){console.warn(oe)},has(){return console.warn(oe),!1},reset(){console.warn(oe)}};function ae(t,e,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=e-(s-i),l=this;0>=a||a>e?(r&&(clearTimeout(r),r=null),i=s,t.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,t.apply(l,o)},a))}}function le(t,e,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>le(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(se=new Proxy(se,{get(t,e,n){return"map"===e&&console.warn(oe),Reflect.get(t,e,n)}}));var ue=Date.now;function ce(t){var e,n,r,i;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=x.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(r=x.parentElement(o.body))||void 0===r?void 0:r.scrollTop)||(null==o||null===(i=o.body)||void 0===i?void 0:i.scrollTop)||0}}function de(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function he(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fe(t){return t?t.nodeType===t.ELEMENT_NODE?t:x.parentElement(t):null}function me(t,e,n,r){if(!t)return!1;const i=fe(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(r&&null!==i.closest("."+e))return!0}else if(qt(i,e,r))return!0}catch(t){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function pe(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ye(t,e){if(rt(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=x.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||ye(r,e))}function ve(t){return Boolean(t.changedTouches)}function be(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ge(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function we(t){return!!t&&(t instanceof te&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(x.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ue=()=>(new Date).getTime());var ke=class{constructor(){et(this,"id",1),et(this,"styleIDMap",new WeakMap),et(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Se(t){var e;let n=null;return"getRootNode"in t&&(null===(e=x.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&x.host(x.getRootNode(t))&&(n=x.host(x.getRootNode(t))),n}function Ce(t){const e=t.ownerDocument;if(!e)return!1;if(x.contains(e,t))return!0;const n=x.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Se(n);)n=e;return n}(t);return x.contains(e,n)}(t)}function Ie(t){return"__ln"in t}var Me,xe=class{constructor(){et(this,"length",0),et(this,"head",null),et(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ie(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&Ie(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Ae=(t,e)=>`${t}@${e}`,Re=class{constructor(){et(this,"frozen",!1),et(this,"locked",!1),et(this,"texts",[]),et(this,"attributes",[]),et(this,"attributeMap",new WeakMap),et(this,"generatedAttributes",new WeakMap),et(this,"removes",[]),et(this,"mapRemoves",new Set),et(this,"movedMap",{}),et(this,"addedSet",new Set),et(this,"movedSet",new Set),et(this,"droppedSet",new Set),et(this,"removesSubTreeCache",new Set),et(this,"mutationCb",void 0),et(this,"blockClass",void 0),et(this,"blockSelector",void 0),et(this,"maskTextClass",void 0),et(this,"maskTextSelector",void 0),et(this,"inlineStylesheet",void 0),et(this,"maskInputOptions",void 0),et(this,"maskTextFn",void 0),et(this,"maskInputFn",void 0),et(this,"maskAllElementAttributes",void 0),et(this,"maskAttributeFn",void 0),et(this,"keepIframeSrcFn",void 0),et(this,"recordCanvas",void 0),et(this,"canvasMaskingConfigured",void 0),et(this,"inlineImages",void 0),et(this,"slimDOMOptions",void 0),et(this,"dataURLOptions",void 0),et(this,"doc",void 0),et(this,"mirror",void 0),et(this,"iframeManager",void 0),et(this,"stylesheetManager",void 0),et(this,"shadowDomManager",void 0),et(this,"canvasManager",void 0),et(this,"processedNodeManager",void 0),et(this,"unattachedDoc",void 0),et(this,"canvasManagerReleased",!1),et(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),et(this,"emit",()=>{if(this.frozen||this.locked)return;const t=A(),e=T();try{this.processBufferedMutations()}finally{n=A()-t,r=e,F>0||E(n,null!=r?r:R)||n>H.slowestBatchMs&&(H.slowestBatchMs=n)}var n,r}),et(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new xe,r=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let i;const o=o=>{var s;const a=x.parentNode(o);if(!a||!Ce(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=rt(a)?this.mirror.getId(Se(o)):this.mirror.getId(a),u=r(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=i)&&void 0!==s||(i={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{be(t,this.mirror)&&this.iframeManager.addIframe(t),ge(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),we(t)&&!me(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(x.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Qt(o,i);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Te(this.removesSubTreeCache,t)&&!this.movedSet.has(x.parentNode(t))||o(t);for(const t of this.addedSet)Ee(this.droppedSet,t)||Te(this.removesSubTreeCache,t)?Ee(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(x.parentNode(s.value)),n=r(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(x.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==e){t=n;break}{const e=x.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=x.host(e);if(-1!==this.mirror.getId(r)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=x.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[r,i]of Object.entries(e))if("string"==typeof i||null===i){var n;e[r]=wt({element:t.node,name:r,value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(r)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),et(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),et(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(x.childNodes(t),t=>x.textContent(t)||"").join("");e.attributes.value=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:St(t),value:n,maskInputFn:this.maskInputFn})}),et(this,"processMutation",t=>{if(!pe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=x.textContent(t.target);me(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:zt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,fe(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const r=t.target,i=bt(r.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const r=t.getAttributeNodeNS(n,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const i=t.lookupPrefix(n);return i?`${i}:${e}`:e}(r,o,s),l=s?r.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=r,e=St(t);l=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(me(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===i&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&r.contentDocument)return;if("type"===a&&"input"===i&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!Ht(i,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Bt(this.doc,i,bt(a),l,r,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=r.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const r=n.getPropertyValue(t),i=n.getPropertyPriority(t);r!==e.style.getPropertyValue(t)||i!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===i?r:[r,i]:u._unchangedStyles[t]=[r,i]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===i){u.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(me(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),r=rt(t.target)?this.mirror.getId(x.host(t.target)):this.mirror.getId(t.target);me(t.target,this.blockClass,this.blockSelector,!1)||pe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Oe(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ye(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ae(n,r)]?Oe(this.movedSet,e):(this.removes.push({parentId:r,id:n,isShadow:!(!rt(t.target)||!it(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),x.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),et(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(pe(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ae(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!me(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=x.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(we(t)){const e=x.childNodes(x.shadowRoot(t));for(let n=0,r=e.length;r>n;n++){const r=e[n];r&&(this.processedNodeManager.add(r,this),this.genAdds(r,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),me(t,n||e,this.blockSelector,!0))return!0;const r="getRootNode"in t?x.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?x.host(r):null}return!1}};function Oe(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const r=x.childNodes(e);for(let t=0,e=r.length;e>t;t++){const e=r[t];e&&n.push(e)}}}function Te(t,e,n){return 0!==t.size&&function(t,e){const n=x.parentNode(e);return!!n&&t.has(n)}(t,e)}function Ee(t,e){if(0===t.size)return!1;let n=x.parentNode(e);for(;n;){if(t.has(n))return!0;n=x.parentNode(n)}return!1}function Fe(t){Me=t}function Le(){Me=void 0}var Ne=(t,e="rrweb")=>Me?(...n)=>{try{return t(...n)}catch(t){if(Me&&!0===Me(t,e))return;throw t}}:t,De=[];function _e(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function je(t,e){const n=new Re;let r;n.init(t);try{r=new(I())(Ne(n.processMutations.bind(n)));const i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(i.attributeFilter=t.attributeFilter),r.observe(e,i),De.push(n),{observer:r,buffer:n}}catch(t){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function $e({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const s=new Map,a=o=>{const a=_e(o);if(!a||me(a,r,i,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ce(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=[ee("scroll",Ne(ae(Ne(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(ee("scrollend",Ne(a),e)),()=>l.forEach(t=>t())}function We(t,e){for(let n=De.length-1;n>=0;n--){const r=De[n];if(!r)continue;let i=r.bufferBelongsToIframe(t);!i&&e&&e.has(r.bufferDoc())&&(i=!0),i&&(r.reset(),De.splice(n,1))}}var Pe=["INPUT","TEXTAREA","SELECT"],Be=new WeakMap;function He(t){return function t(e,n){if(Ze("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ze("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ze("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ze("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(r),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function Ue(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function qe({mirror:t,stylesheetManager:e},n){var r,i;let o=null;o=t.getId("#document"===n.nodeName?n:x.host(n));const s="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=n.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,a=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var r;n=null===(r=a.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ne(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var ze=new Set;function Ge(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,o;!function(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),r(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),i(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),m(...t)}}(t,e);const s=[],a=Ne(()=>{try{if(o)try{o.destroy(),o.reset()}finally{const t=De.indexOf(o);-1!==t&&De.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ie(s)}}),d=(t,e)=>{const n=Ne(()=>{try{return e()}catch(e){throw ze.add(t),e}})();"function"==typeof n&&s.push(n)};try{if(t.recordDOM&&d("mutation",()=>{const e=je(t,t.doc);i=e.observer,o=e.buffer}),d("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(!1===e.mousemove)return()=>{};const i="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const u=ae(Ne(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),c=Ne(ae(Ne(t=>{const e=_e(t),{clientX:n,clientY:i}=ve(t)?t.changedTouches[0]:t;s||(s=ue()),a.push({x:n,y:i,id:r.getId(e),timeOffset:ue()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)}),i,{trailing:!1})),d=[ee("mousemove",c,n),ee("touchmove",c,n),ee("drag",c,n)];return Ne(()=>{d.forEach(t=>t())})}(t)),d("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let d=null;return Object.keys(u).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t]).forEach(s=>{let a=bt(s);const h=(e=>s=>{const a=_e(s);if(me(a,i,o,!0))return;let l=null,h=e;if("pointerType"in s){switch(s.pointerType){case"mouse":l=c.Mouse;break;case"touch":l=c.Touch;break;case"pen":l=c.Pen}l===c.Touch&&(u[e]===u.MouseDown?h="TouchStart":u[e]===u.MouseUp&&(h="TouchEnd"))}else ve(s)&&(l=c.Touch);null!==l?(d=l,(h.startsWith("Touch")&&l===c.Touch||h.startsWith("Mouse")&&l===c.Mouse)&&(l=null)):u[e]===u.Click&&(l=d,d=null);const f=ve(s)?s.changedTouches[0]:s;if(!f)return;const m=n.getId(a),{clientX:p,clientY:y}=f;Ne(t)(r({type:u[h],id:m,x:p,y:y},null!==l&&{pointerType:l}))})(s);if(window.PointerEvent)switch(u[s]){case u.MouseDown:case u.MouseUp:a=a.replace("mouse","pointer");break;case u.TouchStart:case u.TouchEnd:return}l.push(ee(a,h,e))}),Ne(()=>{l.forEach(t=>t())})}(t)),d("scroll",()=>$e(t)),d("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return ee("resize",Ne(ae(Ne(()=>{const e=de(),i=he();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200)),e)}(t,{win:n})),d("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:u,sampling:c,userTriggeredOnInput:d}){function h(t){let n=_e(t);const r=t.isTrusted,c=e.defaultView;if(n&&c&&!(n instanceof c.HTMLElement))return;const h=n&&n.tagName;if(n&&"OPTION"===h&&(n=x.parentElement(n)),!n||!h||0>Pe.indexOf(h)||me(n,i,o,!0))return;if(n.classList.contains(s)||a&&n.matches(a))return;let m=n.value,p=!1;const y=St(n)||"";"radio"===y||"checkbox"===y?p=n.checked:(l[h.toLowerCase()]||l[y])&&(m=vt({element:n,maskInputOptions:l,tagName:h,type:y,value:m,maskInputFn:u})),f(n,d?{text:m,isChecked:p,userTriggered:r}:{text:m,isChecked:p});const v=n.name;"radio"===y&&v&&p&&e.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(t=>{if(t!==n){const e=t.value;f(t,d?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function f(e,i){const o=Be.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){Be.set(e,i);const o=n.getId(e);Ne(t)(r(r({},i),{},{id:o}))}}const m=("last"===c.input?["change"]:["input","change"]).map(t=>ee(t,Ne(h),e)),p=e.defaultView;if(!p)return()=>{m.forEach(t=>t())};const y=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return y&&y.set&&m.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>le(t[0],t[1],{set(){Ne(h)({target:this,isTrusted:!1})}},!1,p))),Ne(()=>{ie(m)})}(t)),d("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Ne(o=>ae(Ne(i=>{const s=_e(i);if(!s||me(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:r.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),i.media||500)),a=[ee("play",s(h.Play),o),ee("pause",s(h.Pause),o),ee("seeked",s(h.Seeked),o),ee("volumechange",s(h.VolumeChange),o),ee("ratechange",s(h.RateChange),o)];return Ne(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let r=!0;const i=t=>{if(r)try{t()}catch(t){}},o=t=>{var n;const r=e.get(t);if(r){for(;null===(n=r[0])||void 0===n?void 0:n.ready;){const t=r.shift();(null==t?void 0:t.emit)&&i(t.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void i(n);const r=e.get(t);r?(r.push({emit:n,ready:!0}),o(t)):i(n)},queuePendingMutation(s,a,l){if(!r)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const m=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(m,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){m()}return e=>{!f&&r&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&i(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){r=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);s.push(e.reset),d("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r,mutationQueue:i}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),r.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return r.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=r.CSSStyleSheet.prototype.deleteRule;let a,l;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),r.CSSStyleSheet.prototype.removeRule=function(t){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);try{const r=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof r)return l;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Ue(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=i.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=lt(o);null!==e&&t({id:s,styleId:u,replace:e})});try{r.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};Ve("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(Ve("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),Ve("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),Ve("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(u).forEach(([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ue(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...He(o),l];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ue(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...He(o),a];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ne(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,a&&(r.CSSStyleSheet.prototype.replace=a),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),d("adoptedStyleSheet",()=>qe(t,t.doc)),d("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i,mutationQueue:o}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ne((i,s,a)=>{var l;const[u,c,d]=a,h=i.apply(s,a);if(n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;r.onCssomSheetMutation(f);const{id:m,styleId:p}=Ue(f,e,r.styleMirror);if(m&&-1!==m||p&&-1!==p){const e=He(s.parentRule);o.queueMutation(f,()=>t({id:m,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ne((i,s,a)=>{var l;const[u]=a,c=i.apply(s,a);if(n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;r.onCssomSheetMutation(d);const{id:h,styleId:f}=Ue(d,e,r.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=He(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ne(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&d("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const r=new o(t,e,n);return i.set(r,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};const s=M(e.fonts,"add",function(e){return function(n){return setTimeout(Ne(()=>{const e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),Ne(()=>{r.forEach(t=>t())})}(t))}d("selection",()=>function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=t;let s=!0;const a=Ne(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);me(o,r,i,!0)||me(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),ee("selectionchange",a)}(t)),d("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?M(n.customElements,"define",function(t){return function(n,r,i){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,r,i])}}):()=>{}}(t));for(const e of t.plugins)d(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function Ze(t){return void 0!==window[t]}function Ve(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Xe=class{constructor(t){et(this,"generateIdFn",void 0),et(this,"iframeRemoteIdToLocalIdMap",new WeakMap),et(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,r){if(0>e)return e;const i=n||this.getRemoteIdToLocalIdMap(t),o=r||this.getLocalIdToRemoteIdMap(t);let s=i.get(e);return void 0===s&&(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,r))}getRemoteId(t,e,n){var r;return"number"!=typeof e||0>e?e:null!==(r=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Ye=class{constructor(t){et(this,"iframes",new WeakMap),et(this,"crossOriginIframeMap",new WeakMap),et(this,"crossOriginIframeMirror",new Xe(Lt)),et(this,"crossOriginIframeStyleMirror",void 0),et(this,"crossOriginIframeRootIdMap",new WeakMap),et(this,"mirror",void 0),et(this,"mutationCb",void 0),et(this,"wrappedEmit",void 0),et(this,"loadListener",void 0),et(this,"pageHideListener",void 0),et(this,"stylesheetManager",void 0),et(this,"recordCrossOriginIframes",void 0),et(this,"messageHandler",void 0),et(this,"nestedIframeListeners",new Map),et(this,"attachedWindows",new WeakMap),et(this,"attachedDocuments",new WeakMap),et(this,"attachedIframes",new Map),et(this,"loadListenerDisposers",new WeakMap),et(this,"iframeElementsById",new Map),et(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,n,r;return null!==(e=null!==(n=null===(r=this.attachedIframes.get(t))||void 0===r?void 0:r.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>re(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{ne(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const r=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const i=t.contentWindow;if(this.recordCrossOriginIframes&&i&&!this.nestedIframeListeners.has(i)){const e=this.handleMessage.bind(this);re(()=>{i.addEventListener("message",e),this.nestedIframeListeners.set(i,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(i)})}re(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const r=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",r),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:r})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case a.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:a.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case a.Meta:case a.Load:case a.DomContentLoaded:return!1;case a.Plugin:return e;case a.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case a.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:case l.Input:return this.replaceIds(e.data,t,["id"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case l.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,r){for(const i of r)(Array.isArray(e[i])||"number"==typeof e[i])&&(e[i]=Array.isArray(e[i])?t.getIds(n,e[i]):t.getId(n,e[i]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(ne(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(ne(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const r=this.attachedDocuments.get(n);r&&(r.forEach(t=>{re(()=>this.mirror.removeNodeFromMap(t))}),re(()=>We(n,r)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&ne(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{ne(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Je=class{constructor(t){et(this,"shadowDoms",new WeakSet),et(this,"mutationCb",void 0),et(this,"scrollCb",void 0),et(this,"bypassOptions",void 0),et(this,"mirror",void 0),et(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!it(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const o=null!==(n=null===(i=x.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:s,buffer:a}=je(r(r({},this.bypassOptions),{},{doc:o,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:o,handler(){s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=De.indexOf(a);-1!==t&&De.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:$e(r(r({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(x.host(t))),this.restoreHandlers.push({doc:o,handler:qe({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:M(t.prototype,"attachShadow",function(t){return function(r){const i=t.call(this,r),o=x.shadowRoot(this);return o&&Ce(this)&&n.addShadowRoot(o,e),i}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Qe="skip-frame";function Ke(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:r,height:i}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nn=0;64>nn;nn++)en[tn.charCodeAt(nn)]=nn;var rn=function(t){var e,n=new Uint8Array(t),r=n.length,i="";for(e=0;r>e;e+=3)i+=tn[n[e]>>2],i+=tn[(3&n[e])<<4|n[e+1]>>4],i+=tn[(15&n[e+1])<<2|n[e+2]>>6],i+=tn[63&n[e+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},on=!1,sn=new Map,an=(t,e,n)=>{if(!t||!cn(t,e)&&"object"!=typeof t)return;const r=function(t,e){let n=sn.get(t);return n||(n=new Map,sn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let i=r.indexOf(t);return-1===i&&(i=r.length,r.push(t)),i};function ln(t,e,n,r){if(t instanceof Array)return t.map(t=>ln(t,e,n,r));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:rn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ln(t.buffer,e,n,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(r.type,r.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?on||(on=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[ln(t.data,e,n,r),t.width,t.height]}:cn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:an(t,e,n)}:t}var un=(t,e,n,r)=>t.map(t=>ln(t,e,n,r)),cn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},dn=["webgl","webgl2"];function hn(t){return"nodeType"in t}function fn(t,e,n,i){const o=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return M(i.prototype,"configure",function(i){return function(o){const s=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!s||hn(s)&&me(s,e,n,!0))return i.call(this,o);hn(s)&&!("__context"in s)&&(s.__context="webgpu");const a=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==a&&o?r(r({},o),{},{usage:"number"==typeof o.usage?o.usage|a:a}):o)}})}(t,e,n);i&&o.push(i)}const s=M(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!me(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&dn.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});o.push(s)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(t=>t())}}function mn(t,e,n,r,i,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=M(t,u,function(t){return function(...a){const l=t.apply(this,a);if(an(l,o,this),this.canvas&&"tagName"in this.canvas&&!me(this.canvas,r,i,!0)){let t;try{t=un(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=le(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!me(this.canvas,r,i,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var pn='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',yn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",pn],{type:"text/javascript;charset=utf-8"});function vn(t){let e;try{if(e=yn&&(self.URL||self.webkitURL).createObjectURL(yn),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(pn),{name:null==t?void 0:t.name})}}var bn="A page CSP that omits blob: from worker-src or script-src blocks it";function gn(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var wn,kn,Sn,Cn=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){et(this,"pendingCanvasMutations",new Map),et(this,"rafStamps",{latestId:0,invokeId:null}),et(this,"mirror",void 0),et(this,"mutationCb",void 0),et(this,"resetObservers",void 0),et(this,"frozen",!1),et(this,"locked",!1),et(this,"rafIdTimestamp",null),et(this,"rafIdFlush",null),et(this,"refCount",0),et(this,"torndown",!1),et(this,"resetFrameDedup",null),et(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,r,i,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,r,i,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,r,i){var s=this;if(!("OffscreenCanvas"in e))return void gn("disabled because this browser does not support OffscreenCanvas");const a="number"==typeof i.resolutionScale&&Number.isFinite(i.resolutionScale)?Math.min(1,Math.max(.1,i.resolutionScale)):1,l=fn(e,n,r,!0),u=new Map;let c;try{c=new vn}catch(t){return gn(`disabled because the encode worker did not start. ${bn}`,t),void l()}let h=!1;c.onerror=t=>{var e;h=!0,gn(`stopped because the encode worker failed. ${bn}`,t),cancelAnimationFrame(y),null===(e=c.terminate)||void 0===e||e.call(c),this.resetFrameDedup=null},this.resetFrameDedup=()=>{c.postMessage({resetFrameDedup:!0})},c.onmessage=t=>{const{id:e}=t.data;if(u.set(e,!1),!("base64"in t.data))return;const{base64:n,type:r,displayWidth:i,displayHeight:o}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0,i,o]}],displayWidth:i,displayHeight:o})};let f=!1,m=!1;const p=1e3/t;let y,v=0;const b=t=>{var l;h||(v&&p>t-v||(v=t,(()=>{const t=[],i=e=>{try{e.querySelectorAll("canvas").forEach(e=>{me(e,n,r,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&i(t.shadowRoot)})}catch(t){}};return i(e.document),t})().forEach((l=o(function*(t){const e=s.mirror.getId(t);if(-1!==e&&!u.get(e)&&0!==t.width&&0!==t.height){u.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,r;const i=t.getContext(t.__context);if(null==i||null===(n=i.isContextLost)||void 0===n?void 0:n.call(i))return void u.set(e,!1);!1===(null==i||null===(r=i.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,s=t.clientHeight||t.height,l=Math.max(1,Math.round(o*a)),d=Math.max(1,Math.round(s*a)),h=function(t,e,n,r,i,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Qe}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ke))return Qe;const a=n/i,l=r/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(i.canvasMasking,t,l,d,o,s);if("skip-frame"===h)return f||(f=!0,gn("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void u.set(e,!1);const m=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:d,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:d});c.postMessage({id:e,bitmap:m,width:l,height:d,displayWidth:o,displayHeight:s,dataURLOptions:i.dataURLOptions,maskRegions:h},[m])}catch(t){m||(m=!0,gn("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),y=requestAnimationFrame(b))};y=requestAnimationFrame(b),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(y),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=fn(t,e,n,!1),o=function(t,e,n,r,i){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=M(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return me(this.canvas,n,r,!0)||setTimeout(()=>{let n;try{n=un(s,e,this,i)}catch(t){return}t(this.canvas,{type:d["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(i){const s=le(e.CanvasRenderingContext2D.prototype,a,{set(e){me(this.canvas,n,r,!0)||t(this.canvas,{type:d["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,r),s=function(t,e,n,r,i){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...mn(e.WebGLRenderingContext.prototype,d.WebGL,t,n,r,e,i)),void 0!==e.WebGL2RenderingContext&&o.push(...mn(e.WebGL2RenderingContext.prototype,d.WebGL2,t,n,r,e,i)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const r=n.map(t=>function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;o.length>r;r++)e.includes(n=o[r])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,s)),{type:i}=n[0];this.mutationCb({id:e,type:i,commands:r}),this.pendingCanvasMutations.delete(t)}},In=class{constructor(t){var e;et(this,"trackedLinkElements",new WeakSet),et(this,"pendingDeferredSheets",new Set),et(this,"mutationCb",void 0),et(this,"adoptedStyleSheetCb",void 0),et(this,"maskAllElementAttributes",void 0),et(this,"maskAttributeFn",void 0),et(this,"styleMirror",new ke),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,r=null;try{r=t.sheet,r&&(n=pt(r))}catch(t){}if(!n||!r)return Q(),null;const i=n;let o=!1;const s={sheet:r,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=A(),u=T();let c=!0;try{if(o)return a=!0,Q(),!0;if(!i.advance(n))return c=!1,!1;a=!0;const s=i.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==r?(Q(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(Q(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),E(d=A()-l,null!=(h=u)?h:R)||(U.totalMs+=d,d>U.slowestSliceMs&&(U.slowestSliceMs=d))}var d,h},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:wt({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},r=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const i=A();try{V(()=>{try{const t=e.rules||e.cssRules;t&&Z(t)}catch(t){}r.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:ut(t,e.href),index:n}))})})}finally{X(A()-i)}}n.styleIds.push(t)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Zt.forEach(t=>t.abort()),Zt.clear()}trackStylesheetInLinkElement(t){}},Mn=class{constructor(){et(this,"nodeMap",new WeakMap),et(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},xn=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var An;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(An=t.contentWindow)||void 0===An?void 0:An.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Rn=new yt,On=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function Tn(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}function En(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:o,blockClass:s="rr-block",blockSelector:u=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:h="rr-mask",maskTextSelector:f=null,inlineStylesheet:m=!0,inlineStylesheetBudgetRules:p,maskAllInputs:y,maskInputOptions:v,slimDOMOptions:b,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k=!1,maskAttributeFn:S,hooks:C,packFn:I,sampling:M={},dataURLOptions:A={},canvasResolutionScale:R,canvasMasking:T,mousemoveWait:E,recordDOM:F=!0,recordCanvas:L=!1,recordCrossOriginIframes:N=!1,recordAfter:D=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:_=!1,collectFonts:j=!1,inlineImages:W=!1,plugins:P,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:H=new Set([]),attributeFilter:U,errorHandler:G}=t;Fe(G);const Z=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),V=!N||window.parent===window;let X=!1;if(!V)try{window.parent.document&&(X=!1)}catch(t){X=!0}if(V&&!n)throw new Error("emit function is required");if(!V&&!X)return()=>{};void 0!==E&&void 0===M.mousemove&&(M.mousemove=E),Rn.reset();const Y=!0===y?{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}:void 0!==v?v:{password:!0},Q=Kt(void 0!==b&&b);let tt;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let et=0;const nt=new Map;let rt,it;const ot=t=>{for(const e of P||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!X&&(t=I(t)),t};wn=(t,e)=>{var r;const s=t;if(s.timestamp=ue(),!(null===(r=De[0])||void 0===r?void 0:r.isFrozen())||s.type===a.FullSnapshot||s.type===a.IncrementalSnapshot&&On.has(s.data.source)||De.forEach(t=>t.unfreeze()),V)null==n||n(ot(s),e);else if(X){const t={type:"rrweb",event:ot(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(s.type===a.FullSnapshot)tt=s,et=0;else if(s.type===a.IncrementalSnapshot){if(s.data.source===l.Mutation&&s.data.isAttachIframe)return;et++,(o&&et>=o||i&&s.timestamp-tt.timestamp>i)&&kn(!0)}};const st=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=Rn.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const r=ct.getIframeElementById(t);r&&n.has(r)?ct.forgetIframeId(t):(null==rt||rt(t),ct.removeIframeById(t))}),null==it||it(),ct.cleanupDetachedIframes()}wn({type:a.IncrementalSnapshot,data:r({source:l.Mutation},t)})},at=t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Scroll},t)}),lt=t=>wn({type:a.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),ut=new In({mutationCb:st,adoptedStyleSheetCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S}),ct=new Ye({mirror:Rn,mutationCb:st,stylesheetManager:ut,recordCrossOriginIframes:N,wrappedEmit:wn});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:Rn,crossOriginIframeMirror:ct.crossOriginIframeMirror,crossOriginIframeStyleMirror:ct.crossOriginIframeStyleMirror});const dt=new Mn,ht=null==T?void 0:T.configured;Sn=new Cn({recordCanvas:L,mutationCb:lt,win:window,blockClass:s,blockSelector:u,mirror:Rn,sampling:M.canvas,dataURLOptions:Z,resolutionScale:R,canvasMasking:T});const ft=new Je({mutationCb:st,scrollCb:at,bypassOptions:{blockClass:s,blockSelector:u,maskTextClass:h,maskTextSelector:f,inlineStylesheet:m,maskInputOptions:Y,dataURLOptions:Z,maskTextFn:w,maskInputFn:g,maskAllElementAttributes:k,maskAttributeFn:S,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,sampling:M,slimDOMOptions:Q,iframeManager:ct,stylesheetManager:ut,canvasManager:Sn,keepIframeSrcFn:B,processedNodeManager:dt,attributeFilter:U},mirror:Rn});kn=(t=!1)=>{if(F){q(p);try{wn({type:a.Meta,data:{href:window.location.href,width:he(),height:de()}},t),null==e||e.cancel(),e=void 0,ut.reset(),ft.init(),De.forEach(t=>t.lock());let n=null,r=[];try{n=function(t,e){const{mirror:n=new yt,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:m=!1,maskAttributeFn:p,slimDOM:y=!1,dataURLOptions:v,preserveWhiteSpace:b,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M=()=>!1,maxDepth:x,inlineStylesheetBudgetRules:A}=e||{},R=!0===d?{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}:!1===d?{password:!0}:d,O=Kt(y);q(A);try{return Qt(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:R,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:O,dataURLOptions:v,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,newlyAddedElement:!1,maxDepth:x})}finally{z()}}(document,{mirror:Rn,blockClass:s,blockSelector:u,maskTextClass:h,maskTextSelector:f,inlineStylesheet:m,maskAllInputs:Y,inlineStylesheetBudgetRules:p,maskTextFn:w,maskInputFn:g,maskAllElementAttributes:k,maskAttributeFn:S,slimDOM:Q,dataURLOptions:Z,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,onSerialize(t){be(t,Rn)&&ct.addIframe(t),ge(t,Rn)&&ut.trackLinkElement(t),we(t)&&ft.addShadowRoot(x.shadowRoot(t),document)},onIframeLoad(t,e){ct.attachIframe(t,e),ft.observeAttachShadow(t)},onIframeListenerRegistered(t,e){ct.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){ut.attachLinkElement(t,e)},keepIframeSrcFn:B})}finally{r=J()}if(!n)return console.warn("Failed to snapshot the document");if(wn({type:a.FullSnapshot,data:{node:n,initialOffset:ce(window)}},t),De.forEach(t=>t.unlock()),Sn.onFullSnapshot(),r.length){const t=function(t,e,n){let r=!1,i=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&re(()=>{s=e.beginDeferredLinkInlining(n,Rn.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;re(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(i=null,r)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,K(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?i=Tn(d):n())};return i=Tn(d),{cancel(){r=!0,null==s||s.discard(),s=null,null==i||i.cancel(),i=null},flush(){if(r)return;r=!0,null==i||i.cancel(),i=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);K(e),null==s||s.discard(),s=null}n()}}}(r,ut,()=>{e===t&&(e=void 0)});e=t}N&&ct.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ut.adoptStyleSheets(document.adoptedStyleSheets,Rn.getId(document))}finally{z()}}};try{const t=[];t.push(ee("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(ee(e,O,document));rt=e=>{const n=nt.get(e);n&&(n.forEach(e=>{re(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),nt.delete(e))},it=()=>{for(const[t]of nt){const e=Rn.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==rt||rt(t)}catch(e){null==rt||rt(t)}else null==rt||rt(t)}};const n=t=>{var e;return Ne(Ge)({mutationCb:st,mousemoveCb:(t,e)=>wn({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:at,viewportResizeCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:lt,fontCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){wn({type:a.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){wn({type:a.IncrementalSnapshot,data:r({source:l.CustomElement},t)})},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:h,maskTextSelector:f,maskInputOptions:Y,inlineStylesheet:m,sampling:M,recordDOM:F,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,userTriggeredOnInput:_,collectFonts:j,doc:t,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:B,blockSelector:u,slimDOMOptions:Q,dataURLOptions:Z,mirror:Rn,iframeManager:ct,stylesheetManager:ut,shadowDomManager:ft,processedNodeManager:dt,canvasManager:Sn,ignoreCSSAttributes:H,attributeFilter:U,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>wn({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},C)};ct.addLoadListener(e=>{try{const r=Rn.getId(e),i=n(e.contentDocument);if("function"==typeof i&&(t.push(i),-1!==r)){let t=nt.get(r);t||(t=new Set,nt.set(r,t)),t.add(i)}}catch(t){console.warn(t)}}),ct.addPageHideListener(t=>{const e=Rn.getId(t);null==rt||rt(e),We(t)});let i=-1;const o=t=>wn({type:a.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),p=()=>{var t,e,n,r;const s=document,a=null!==(t=null!==(e=null!==(n=null!==(r=s.fullscreenElement)&&void 0!==r?r:s.webkitFullscreenElement)&&void 0!==n?n:s.mozFullScreenElement)&&void 0!==e?e:s.msFullscreenElement)&&void 0!==t?t:null,l=a?Rn.getId(a):-1;l!==i&&(-1!==i&&o({id:i,enter:!1}),i=l,-1!==l&&o({id:l,enter:!0}))},y=()=>{kn();const e=n(document);"function"==typeof e&&t.push(e),t.push(ee("fullscreenchange",p)),t.push(ee("webkitfullscreenchange",p)),t.push(ee("mozfullscreenchange",p)),t.push(ee("MSFullscreenChange",p)),xn=!0};return["interactive","complete"].includes(document.readyState)?y():(t.push(ee("DOMContentLoaded",()=>{wn({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&y()})),t.push(ee("load",()=>{wn({type:a.Load,data:{}}),"load"===D&&y()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ie(t),dt.destroy(),ct.removeLoadListener(),ct.destroy(),nt.clear(),ft.reset(),Rn.reset(),xn=!1,Le()}}catch(t){console.warn(t)}}En.addCustomEvent=(t,e)=>{if(!xn)throw new Error("please add custom event after start recording");wn({type:a.Custom,data:{tag:t,payload:e}})},En.freezePage=()=>{De.forEach(t=>t.freeze())},En.takeFullSnapshot=t=>{if(!xn)throw new Error("please take full snapshot after start recording");kn(t)},En.mirror=Rn,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var Fn=Object.create(null);function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function Nn(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ln(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ln(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Fn.Node=Object.create(null),Fn.ShadowRoot=Object.create(null),Fn.MutationObserver=Object.create(null),Fn.Element=Object.create(null);var Dn=class{constructor(t){Nn(this,"fileName",void 0),Nn(this,"functionName",void 0),Nn(this,"lineNumber",void 0),Nn(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},_n=/(^|@)\S+:\d+/,jn=/^\s*at .*(\S+:\d+|\(native\))/m,$n=/^(eval@)?(\[native code])?$/,Wn={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(jn)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(jn)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const r=e.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop());return new Dn({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0],lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match($n)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Dn({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Dn({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[];for(let t=2,i=n.length;i>t;t+=2){const i=e.exec(n[t]);i&&r.push(new Dn({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),r=[];for(let t=0,i=n.length;i>t;t+=2){const i=e.exec(n[t]);i&&r.push(new Dn({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(_n)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Dn({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Pn(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const r=t.parentElement,i=[];if(r.children&&r.children.length>0)for(let t=0;r.children.length>t;t++){const e=r.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&i.push(e)}i.length>1&&(n+=`:eq(${i.indexOf(t)})`),e=n+(e?">"+e:""),t=r}return e}function Bn(t){return Array.isArray(t)}function Hn(t){return"object"==typeof t&&null!==t&&!Bn(t)}function Un(t,e){if(0===e)return!0;const n=Object.keys(t);for(const r of n)if(Hn(t[r])&&Un(t[r],e-1))return!0;return!1}function qn(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const r=[],i=[];return JSON.stringify(t,function(t,e){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?i.splice(n,1/0,t):i.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Hn(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Hn(o)&&Un(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const r=e[n];t[n]=Bn(r)?Pn(r.length?r[0]:null):r}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var zn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Gn(t,e,n){const r=n?Object.assign({},zn,n):zn,i=r.logger;if(!i)return()=>{};let o;o="string"==typeof i?e[i]:i;let s=0,a=!1,l=!0;const u=[];if(r.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Wn.parse(e.error).map(t=>t.toString()),payload:[qn(n,r.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const i=e=>{let n,i;e.reason instanceof Error?(n=e.reason,i=[qn(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,i=[qn("Uncaught (in promise)",r.stringifyOptions),qn(e.reason,r.stringifyOptions)]),t({level:"error",trace:Wn.parse(n).map(t=>t.toString()),payload:i})};e.addEventListener("unhandledrejection",i),u.push(()=>{e.removeEventListener("unhandledrejection",i)})}for(const t of r.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(i,o){try{if(!(o in i))return()=>{};const u=i[o],c={next:u},d=(i=>(...o)=>{if(i.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=Wn.parse(new Error).map(t=>t.toString()).splice(1),i=("assert"===n?o.slice(1):o).map(t=>qn(t,r.stringifyOptions));s++,r.lengthThreshold>s?t({level:n,trace:e,payload:i}):s===r.lengthThreshold&&t({level:"warn",trace:[],payload:[qn("The number of log records reached the threshold.")]})}catch(t){i.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),i[o]=d,()=>{if(i[o]===d)return void(i[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=i[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var Zn=t=>({name:"rrweb/console@1",observer:Gn,options:t});const Vn=Object.prototype,Xn=Vn.hasOwnProperty,Yn=Vn.toString,Jn=Array.isArray||function(t){return"[object Array]"===Yn.call(t)},Qn=t=>"function"==typeof t,Kn=t=>t===Object(t)&&!Jn(t),tr=t=>void 0===t,er=t=>null===t,nr=t=>tr(t)||er(t),rr=t=>"[object Boolean]"===Yn.call(t),ir=t=>t instanceof FormData,or="u">typeof window?window:void 0,sr="u">typeof globalThis?globalThis:or;null!=sr&&sr.XMLHttpRequest&&new sr.XMLHttpRequest;const ar=(t,{debugEnabled:e}={})=>{const n={N(n,...r){or&&(or.POSTHOG_DEBUG||e)&&!tr(or.console)&&or.console&&("__rrweb_original__"in or.console[n]?or.console[n].__rrweb_original__:or.console[n])(t,...r)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>ar(`${t} ${e}`,n)};return n},lr=ar("[PostHog.js]").createLogger,ur=()=>{},cr=t=>{var e;if(Qn(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function dr(t,e,n){try{if(!(e in t))return ur;const r={next:t[e]},i=n(function(...t){return r.next.apply(this,t)});return Qn(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=i,()=>{if(t[e]===i)return void(t[e]=r.next);let n=t[e],o=cr(n);for(;o;){if(o.next===i)return void(o.next=r.next);n=o.next,o=cr(n)}}}catch(t){return ur}}function hr(t,e){var n;const r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),i={hostname:r,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==r?void 0:r.trim().length))return i;for(const t of e.payloadHostDenyList)if(r.endsWith(t))return{hostname:r,isHostDenied:!0};return i}const fr=1e6,mr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:fr,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},pr=new WeakSet,yr=lr("[Recorder]"),vr=t=>"navigation"===t.entryType,br=t=>"resource"===t.entryType;function gr(t,e){var n;return vr(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function wr(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>gr(t,n)||br(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>gr(t,e))}(t):[]}function kr(t,e){return!!e&&(rr(e)||e[t])}function Sr(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Cr=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ir({type:t,recordBody:e,headers:n,url:r}){function i(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),r=e&&n[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Sr(e)&&t(e.url)}catch(t){return!1}}(r))return!1;if(i(Cr))return!1;if(rr(e))return!0;if(Jn(e))return i(e);const o=e[t];return rr(o)?o:i(o)}function Mr(t,e,n,r,i){return xr.apply(this,arguments)}function xr(){return xr=o(function*(t,e,n,r,i,o=0){if(o>10)return yr.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>br(t)&&t.initiatorType===e&&(tr(r)||t.startTime>=r)&&(tr(i)||i>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Mr(t,e,n,r,i,o+1))}),xr.apply(this,arguments)}function Ar({body:t,options:e,url:n}){if(nr(t))return null;const{hostname:r,isHostDenied:i}=hr(n,e);if(i)return r+" is in deny list";if("[object String]"==Yn.call(t))return t;if(o=t,"u">typeof Document&&o instanceof Document)return t.textContent;var o;if(ir(t))return function(t,e="&"){let n,r;const i=[];return function(t,e){if(!nr(t))if(Jn(t))t.forEach(e);else if(ir(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Xn.call(t,n)&&e(t[n],n)}(t,function(t,e){tr(t)||tr(e)||"undefined"===e||(n=encodeURIComponent(t instanceof File?t.name:t.toString()),r=encodeURIComponent(e),i[i.length]=r+"="+n)}),i.join(e)}(t);if(Kn(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Rr=t=>!er(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Or({entry:t,method:e,status:n,networkRequest:i,isInitial:o,start:s,end:a,url:l,initiatorType:u}){s=t?t.startTime:s,a=t?t.responseEnd:a;const c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(s||0)),h=[r(r({},t?t.toJSON():{name:l}),{},{startTime:tr(s)?void 0:Math.round(s),endTime:tr(a)?void 0:Math.round(a),timeOrigin:c,timestamp:d,method:e,initiatorType:u||(t?t.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(Rr(t))for(const e of t.serverTiming||[])h.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const Tr=["video/","audio/"];function Er(t){return Kn(t)&&Qn(t.getReader)&&Qn(t.tee)}const Fr="[SessionReplay] Timeout while trying to read body",Lr="[SessionReplay] Failed to read body";function Nr(t){return`${Lr}: ${t}`}function Dr(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function _r(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Fr),500);try{t.clone().text().then(t=>e(t),t=>e(Nr(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Lr)}})}(t);const n=function(t){var e;return Math.min(fr,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:fr)}(e);return function(t,e){try{var n,r;const i=null===(n=t.headers)||void 0===n||null===(r=n.get)||void 0===r?void 0:r.call(n,"content-length");if(!i)return!1;const o=parseInt(i,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(Dr(n)):function(t,e){return new Promise(n=>{let r,i=!1;function o(){try{null==r||r.cancel().catch(()=>{})}catch(t){}}function s(t){i||(i=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(Fr),500);let l;try{l=t.clone()}catch(t){return void s(Lr)}const u=l.body;if(!Er(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(Nr(t)))}catch(t){s(Lr)}return}try{r=u.getReader()}catch(t){return void s(Lr)}const c=[];let d=0;!function t(){r.read().then(({done:n,value:r})=>{if(i)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}(c,d)));else{if(r){if(d+r.byteLength>e)return void s(Dr(e));d+=r.byteLength,c.push(r)}t()}},t=>s(Nr(t)))}()})}(t,n)}function jr(){return(jr=o(function*({r:t,options:e,url:n}){const{hostname:r,isHostDenied:i}=hr(n,e);return i?Promise.resolve(r+" is in deny list"):_r(t,e)})).apply(this,arguments)}function $r(){return($r=o(function*({r:t,options:e,url:n}){const r=function({r:t,options:e,url:n}){var r;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(r=t.headers.get("Content-Type"))||void 0===r?void 0:r.toLowerCase(),o=Tr.some(t=>null==i?void 0:i.startsWith(t));if(i&&o)return`Content-Type ${i} is not supported`;const{hostname:s,isHostDenied:a}=hr(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return er(r)?_r(t,e):Promise.resolve(r)})).apply(this,arguments)}let Wr=null;function Pr(t,e,n){if(!("performance"in e))return()=>{};if(Wr)return yr.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},mr,n):mr;let s=!0;const a=e=>{if(!s)return;const n=[];let o=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&o)return;const r=i.maskRequestFn(t);e||(o=!r||(t=>!!t&&pr.has(t))(r)),r&&n.push(r)}),n.length>0&&t(r(r({},e),{},{requests:n}))},l=function(t,e,n){try{t({requests:wr(e,n).flatMap(t=>Or({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){yr.error("Failed to capture initial performance entries for network capture",t)}const r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>vr(t)||br(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Or({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),i=PerformanceObserver.supportedEntryTypes.filter(t=>n.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:i}),()=>{r.disconnect()}}(a,e,i);let u=()=>{},c=()=>{};return(i.recordHeaders||i.recordBody)&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=kr("request",n.recordHeaders),i=kr("response",n.recordHeaders),o=dr(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),r&&(l.requestHeaders=h);const m=d.send.bind(d);d.send=t=>(Ir({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=Ar({body:t,options:n,url:a})),u=e.performance.now(),m(t));const p=()=>{d.removeEventListener("readystatechange",y),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},y=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),i=e.join(": ");n&&(r[n]=i)}),i&&(l.responseHeaders=r),Ir({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(l.responseBody=Ar({body:d.response,options:n,url:a})),Mr(e,"xmlhttprequest",o.url,u,c).then(e=>{t({requests:Or({entry:e,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",y),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){yr.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(a,e,i),c=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=kr("request",n.recordHeaders),i=kr("response",n.recordHeaders),s=dr(e,"fetch",s=>function(){var a=o(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return yr.error("Failed to instrument fetch for network capture",t),s(o,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),r&&(c.requestHeaders=t),!Er(null==a?void 0:a.body)&&Ir({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return jr.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){yr.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Sr(o)?yield s(l):yield s(o,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),i&&(c.responseHeaders=t),Ir({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return $r.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){yr.error("Failed to record fetch response for network capture",t)}return u}finally{Mr(e,"fetch",l.url,d,h).then(e=>{t({requests:Or({entry:e,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(a,e,i)),Wr=()=>{s=!1,l(),u(),c(),Wr=null},Wr}const Br=t=>({name:"rrweb/network@1",observer:Pr,options:t}),Hr="undefined"!=typeof globalThis?globalThis:or;Hr&&"undefined"==typeof self&&(Hr.self=Hr),Hr&&"undefined"==typeof File&&(Hr.File=function(){});const Ur=null!=or?or:{};Ur.__PosthogExtensions__=Ur.__PosthogExtensions__||{},Ur.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Zn,getRecordNetworkPlugin:Br},Ur.__PosthogExtensions__.rrweb={record:En,version:"v2",wasMaxDepthReached:()=>Jt,resetMaxDepthState(){Jt=!1,Yt=!1},getLastSnapshotCost:()=>_,getMutationCost:()=>r({},H),getObserverInitFailures:()=>ze.size?Array.from(ze):void 0,resetSnapshotCostState(){F=0,L=0,N=0,R=0,D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},_=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Ur.rrweb={record:En,version:"v2"},Ur.rrwebConsoleRecord={getRecordConsolePlugin:Zn},Ur.getRecordNetworkPlugin=Br}();
|
|
1
|
+
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n,r){return(n=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var r=1;arguments.length>r;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(r,i)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var s=t.apply(e,n);function a(t){i(s,r,o,a,l,"next",t)}function l(t){i(s,r,o,a,l,"throw",t)}a(void 0)})}}const s=["type"];var a=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),l=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),u=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),c=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),d=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),h=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),f=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function m(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},y={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},v={};function b(t){if(v[t])return v[t];const e=function(t){var e,n;const r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],n=e.prototype,r=t in p?p[t]:void 0,i=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in y?y[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(i&&s)return v[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const r=a.contentWindow;if(!r)return e.prototype;const i=r[t].prototype;return i?(m(u=navigator.userAgent,"AppleWebKit")&&!m(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),v[t]=i):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var g=Object.create(null);function w(t,e,n){var r;const i=g[t],o=i[n];if(o)return o.call(e);const s=b(t),a=null===(r=Object.getOwnPropertyDescriptor(s,n))||void 0===r?void 0:r.get;return a?(i[n]=a,a.call(e)):e[n]}g.Node=Object.create(null),g.ShadowRoot=Object.create(null),g.MutationObserver=Object.create(null),g.Element=Object.create(null);var k,S={};function C(t,e,n){const r=`${t}.${String(n)}`;if(S[r])return S[r].bind(e);const i=b(t)[n];return"function"!=typeof i?e[n]:(S[r]=i,i.bind(e))}function I(){return b("MutationObserver").constructor}function M(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i={next:r},o=n(function(...t){return i.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:i}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=i.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let r=t[e],s=n(r);for(;s;){if(s.next===o)return void(s.next=i.next);r=s.next,s=n(r)}}}catch(t){return()=>{}}}var x={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),isConnected(t){if(void 0===k){var e;const t=null===(e=Object.getOwnPropertyDescriptor(b("Node"),"isConnected"))||void 0===e?void 0:e.get;k=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==k?void 0:k.call(t)},contains:(t,e)=>C("Node",t,"contains")(e),getRootNode:t=>C("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>C("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>C("Element",t,"querySelectorAll")(e),mutationObserver:I,patch:M};function A(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var R=0;function O(){R+=1}function T(){return R}function E(t,e){return(e!==R||t>6e4)&&!0}var F=0,L=0,N=0,D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},_=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function q(t){var e;(F+=1)>1||(D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},W=[],P=0,j=(e=t)&&e>0?e:null,L=A(),N=R)}function z(){return 0===F?_||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(F-=1)>0?D:(D.durationMs=A()-L,D.deferredStylesheetCount=P,U.deferredCount+=P,j=null,E(D.durationMs,N)?D:_=D)}function G(t,e,n){let r=t.length;if(n>=32)return r;for(let i=0;t.length>i;i++){const o=t[i];try{const t=o.cssRules;if(t&&t.length)r+=G(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const i=t.rules||t.cssRules;i&&(r+=G(i,e,n+1))}}}catch(t){}}return r}function Z(t){if(0===F)return;const e=G(t,null,0);D.cssRuleCount+=e,B>0&&(D.nonDeferrableCssRuleCount+=e)}function V(t){B+=1;try{return t()}finally{B-=1}}function X(t){F>0&&(D.stylesheetMs+=t)}function Y(t){if(0===F||null===j)return!1;const e=D.cssRuleCount-D.nonDeferrableCssRuleCount;return e>=j||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),G(e,n,0)}catch(t){return 0}}(t)>j}function J(){const t=W;return W=[],t}function Q(){U.failedCount+=1}function K(t){t>0&&(U.abandonedCount+=t)}function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e,n){return(e=function(t){var e=function(t){if("object"!=tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nt(t){return t.nodeType===t.ELEMENT_NODE}function rt(t){const e=t&&"host"in t&&"mode"in t&&x.host(t)||null;return Boolean(e&&"shadowRoot"in e&&x.shadowRoot(e)===t)}function it(t){return"[object ShadowRoot]"==={}.toString.call(t)}function ot(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function st(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var at=0;function lt(t){const e=0===at,n=e?A():0;at+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Z(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),ot(Array.from(e,t=>ut(t,n)).join(""))}catch(t){return null}finally{at-=1,e&&X(A()-n)}}function ut(t,e){if(dt(t)){let e;try{e=lt(t.styleSheet)||st(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return At(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ht(t)&&t.selectorText.includes(":")&&(n=ct(n)),e?At(n,e):n}}function ct(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function dt(t){return"styleSheet"in t}function ht(t){return"selectorText"in t}var ft=/^-?[A-Za-z_][\w-]*$/,mt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function pt(t){const e=[];let n=!1,r=null;const i=new Map;function o(t){const i=e.pop();if("group"===i.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!i.importRule)return n=!0,void(r=t);s(e[e.length-1],i.importRule,t)}function s(t,e,n){try{let i;try{i=n||st(e)}catch(t){i=e.cssText}try{var r;i&&(null===(r=e.styleSheet)||void 0===r?void 0:r.href)&&(i=At(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&dt(n)){const r=i.get(n);return null===r?(t.parts.push(n.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const r=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(ht(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ft.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ft.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":mt.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===r)return!1;const i=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:i,index:0,parts:[],prelude:i?At(r,i):r,fixColons:"sheet"===n.kind&&ht(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let r=n.cssText;"sheet"===t.kind&&ht(n)&&n.selectorText.includes(":")&&(r=ct(r)),t.parts.push(t.sheetHref?At(r,t.sheetHref):r),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Z(n);let r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!dt(e)||i.has(e))continue;let r=null;try{r=e.styleSheet}catch(t){i.set(e,null);continue}if(r&&!n.some(t=>t.sheet===r))try{const t=r.rules||r.cssRules;if(!t)continue;Z(t);let o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);const s=Array.from(t);i.set(e,{sheet:r,rules:s,sheetHref:o}),n.push({sheet:r,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const i=A();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ct(n):n}else e=ot(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,r=null}finally{X(A()-i)}return n},text:()=>n?r:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var yt=class{constructor(){et(this,"idNodeMap",new Map),et(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),nt(t)){const e=x.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function vt({element:t,maskInputOptions:e,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&bt(r);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function bt(t){return t.toLowerCase()}var gt=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function wt({element:t,name:e,value:n,maskAllElementAttributes:r,maskAttributeFn:i,isGenerated:o=!1}){return n?r?o&>.has(bt(e))?n:"*".repeat(n.length):i?i(e,n,t):n:n}var kt="__rrweb_original__";function St(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?bt(e):null}catch(t){return null}}var Ct=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,It=/^(?:[a-z+]+:)?\/\//i,Mt=/^www\..*/i,xt=/^(data:)([^,]*),(.*)/i;function At(t,e){return(t||"").replace(Ct,(t,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return t;if(It.test(a)||Mt.test(a))return`url(${l}${a}${l})`;if(xt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var Rt,Ot,Tt=new Map,Et=1,Ft=new RegExp("[^a-z0-9-_:]");function Lt(){return Et++}var Nt=!1,Dt=/^[^ \t\n\r\u000c]+/,_t=/^[, \t\n\r\u000c]+/,jt=new WeakMap;function $t(t,e){return e&&""!==e.trim()?Wt(t,e):e}function Wt(t,e){let n=jt.get(t);if(n||(n=t.createElement("a"),jt.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Pt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Bt(t,e,n,r,i,o){if(!r)return r;if("src"===n||"href"===n&&("use"!==e||"#"!==r[0])){if("link"===e&&i){var s;const t=null===(s=i.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=$t(t,r);if(n.startsWith("data:")){if("img"===e&&i){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,r){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const i=Tt.get(e);if(i&&i.type===n&&i.quality===r)return i.result;try{const i=document.createElement("canvas");i.width=t.naturalWidth,i.height=t.naturalHeight;const o=i.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=i.toDataURL(n||"image/webp",null!=r?r:.4),a=e.length>s.length?s:e;if(Tt.size>=10){const t=Tt.keys().next().value;void 0!==t&&Tt.delete(t)}return Tt.set(e,{type:n,quality:r,result:a}),a}catch(t){return e}}(i,n,o.type,o.quality)),Pt(t,o)}if("image"===e)return Pt(n,o)}return n}if("xlink:href"===n&&"#"!==r[0]){const n=$t(t,r);return"image"===e&&n.startsWith("data:")?Pt(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function r(t){let r;const i=t.exec(e.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(_t),e.length>n;){let o=r(Dt);if(","===o.slice(-1))o=$t(t,o.substring(0,o.length-1)),i.push(o);else{let r="";o=$t(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){i.push((o+r).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,i.push((o+r).trim());break}"("===t&&(s=!0)}r+=t,n+=1}}}return i.join(", ")}(t,r):"style"===n?At(r,Wt(t)):"object"===e&&"data"===n?$t(t,r):r:$t(t,r)}function Ht(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===bt(e)}function Ut(t){return"string"==typeof t&&bt(t).split(/\s+/).includes("stylesheet")}function qt(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&qt(x.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&qt(x.parentNode(t),e,n)}function zt(t,e,n,r){let i;if(nt(t)){if(i=t,!x.childNodes(i).length)return!1}else{if(null===x.parentElement(t))return!1;i=x.parentElement(t)}try{if("string"==typeof e){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(qt(i,e,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(t){}return!1}function Gt(t,e,n){const r=t.removeEventListener;"function"==typeof r&&r.call(t,e,n)}var Zt=new Map;function Vt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Xt(t){return null==t?"":t.toLowerCase()}var Yt=!1,Jt=!1;function Qt(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m=!1,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v={},inlineImages:b=!1,recordCanvas:g=!1,canvasMaskingConfigured:w,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C=5e3,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:O=!1,depth:T=0,maxDepth:E=50}=e;let{needsMask:L}=e,{preserveWhiteSpace:N=!0}=e;if(T>=E)return Jt=!0,Yt||(Yt=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${E}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;L||(L=zt(t,s,a,void 0===L)),F>0&&(D.nodeCount+=1);const _=function(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:m={},inlineImages:p,recordCanvas:y,canvasMaskingConfigured:v,keepIframeSrcFn:b,newlyAddedElement:g=!1}=e,w=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:w};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:m,keepIframeSrcFn:p,newlyAddedElement:y=!1,rootId:v}=e,b=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,r,i),g=function(t){if(t instanceof HTMLFormElement)return"form";const e=bt(t.tagName);return Ft.test(e)?"div":e}(t),w=new Set;let k={};const S=t.attributes.length;for(let e=0;S>e;e++){const r=t.attributes[e];Ht(g,r.name)||(k[r.name]=Bt(n,g,bt(r.name),r.value,t,c))}if("link"===g&&o&&!b&&Ut(k.rel)){let e=t.sheet;if(!e){const r=function(t){return t.href}(t);r&&(e=Vt(n,r),!e&&r.includes(".css"))&&(e=Vt(n,window.location.origin+"/"+r.replace(window.location.href,"")))}let r=null;e&&(Y(e)?F>0&&(W.push(t),P+=1):r=lt(e)),r&&(delete k.rel,delete k.href,k._cssText=r)}var C;if("style"===g&&t.sheet&&!(t.innerText||x.textContent(t)||"").trim().length){const e=V(()=>lt(t.sheet));e&&(k._cssText=e)}if("input"===g||"textarea"===g||"select"===g){const e=t.value,n=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&e?k.value=vt({element:t,type:St(t),tagName:g,value:e,maskInputOptions:s,maskInputFn:a}):n&&(k.checked=n)}if("option"===g&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===g&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===g&&h&&!(null==m?void 0:m()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let r=0;t.height>r;r+=50){const i=e.getImageData,o=kt in i?i[kt]:i;let s;try{s=o.call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=t.width,r.height=t.height,e!==r.toDataURL(c.type,c.quality)&&(k.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(C=t)?void 0:C.name)?Nt||(Nt=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",C)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",C)}let I,M=!1;if("img"===g&&d){Rt||(Rt=n.createElement("canvas"),Ot=Rt.getContext("2d"));const e=t,r=e.currentSrc||e.getAttribute("src")||"<unknown-src>",i=e.crossOrigin,o=(e,n)=>M?wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Gt(e,"load",s);try{Rt.width=e.naturalWidth,Rt.height=e.naturalHeight,Ot.drawImage(e,0,0);const t=Rt.toDataURL(c.type,c.quality);k.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${r}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(i?k.crossOrigin=o("crossOrigin",i):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===g||"video"===g){const e=k;e.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var A,R,O;const{width:e,height:r,left:i,top:o}=t.getBoundingClientRect(),s=null===(A=n.defaultView)||void 0===A?void 0:A.getComputedStyle(t);k={class:k.class,rr_width:`${e}px`,rr_height:`${r}px`,rr_left:`${Math.floor(i+((null===(R=n.defaultView)||void 0===R?void 0:R.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(O=n.defaultView)||void 0===O?void 0:O.scrollY)||0))}px`},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),s&&(k.rr_position=s.position||"static",w.add("rr_position"),s.transform&&"none"!==s.transform&&(k.rr_transform=s.transform,w.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(k.rr_display=s.display,w.add("rr_display")))}if("iframe"!==g||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(const[e,n]of Object.entries(k))"string"!=typeof n&&null!==n||(k[e]=wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(e)}));M=!0;try{customElements.get(g)&&(I=!0)}catch(t){}return{type:f.Element,tagName:g,attributes:k,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:b,rootId:v,isCustom:I};var T}(t,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:m,inlineImages:p,recordCanvas:y,canvasMaskingConfigured:v,keepIframeSrcFn:b,newlyAddedElement:g,rootId:w});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:r,rootId:i}=e,o=x.parentNode(t),s=o&&o.tagName;let a=x.textContent(t);const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Y(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=lt(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=At(a,Wt(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=r?r(a,x.parentElement(t)):a.replace(/[\S]/g,"*")),{type:f.Text,textContent:a||"",isStyle:l,rootId:i}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:w});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:w};case t.COMMENT_NODE:return{type:f.Comment,textContent:x.textContent(t)||"",rootId:w};default:return!1}}(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,keepIframeSrcFn:R,newlyAddedElement:O});if(!_)return console.warn(t,"not serialized"),null;let j;j=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Xt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Xt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Xt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Xt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Xt(t.attributes.property).match(/^(og|twitter|fb):/)||Xt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Xt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Xt(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Xt(t.attributes.name))||Xt(t.attributes.property).match(/^article:/)||Xt(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Xt(t.attributes.name)))return!0}}return!1}(_,y)||!N&&_.type===f.Text&&!_.isStyle&&!_.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Lt();const B=Object.assign(_,{id:j});if(r.add(t,B),-2===j)return null;k&&k(t);let H=!l;if(B.type===f.Element){H=H&&!B.needBlock,delete B.needBlock;const e=x.shadowRoot(t);e&&it(e)&&(B.isShadowHost=!0)}if((B.type===f.Document||B.type===f.Element)&&H){y.headWhitespace&&B.type===f.Element&&"head"===B.tagName&&(N=!1);const e={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T+1,maxDepth:E};if(B.type===f.Element&&"textarea"===B.tagName&&void 0!==B.attributes.value);else for(const n of Array.from(x.childNodes(t))){const t=Qt(n,e);t&&B.childNodes.push(t)}let O=null;if(nt(t)&&(O=x.shadowRoot(t)))for(const t of Array.from(x.childNodes(O))){const n=Qt(t,e);n&&(it(O)&&(n.isShadow=!0),B.childNodes.push(n))}}const U=x.parentNode(t);if(U&&rt(U)&&it(U)&&(B.isShadow=!0),B.type===f.Element&&"iframe"===B.tagName){const e=function(t,e,n){const r=()=>{},i=t.contentWindow;if(!i)return r;let o;try{o=i.document.readyState}catch(t){return r}const s=()=>e();if("complete"!==o){let r=!1,i=null;const o=()=>{r||(r=!0,null!==i&&(clearTimeout(i),i=null),Gt(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return i=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==i&&(clearTimeout(i),i=null),r?Gt(t,"load",s):(r=!0,Gt(t,"load",a))}}const a="about:blank";let l;try{l=i.location.href}catch(t){return r}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),Gt(t,"load",s)}}return t.addEventListener("load",s),()=>{Gt(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&S){const n=Qt(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onIframeListenerRegistered:I,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T+1,maxDepth:E});n&&S(t,n)}},C);null==I||I(t,e)}return B.type===f.Element&&"link"===B.tagName&&Ut(B.attributes.rel)&&function(e,l,f){if(Zt.has(e))return;let I;try{I=e.sheet}catch(t){return}if(I)return;const x=new AbortController;let O=!1;const F=()=>{if(!O){O=!0;try{(()=>{if(M){const e=Qt(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:y,dataURLOptions:v,inlineImages:b,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:N,onSerialize:k,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:M,stylesheetLoadTimeout:A,keepIframeSrcFn:R,depth:T,maxDepth:E});e&&M(t,e)}})()}finally{Zt.delete(e),x.abort()}}},D=setTimeout(F,f);x.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",F,{signal:x.signal,once:!0}),Zt.set(e,x)}(t,0,A),B}function Kt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var te=class t{constructor(...t){et(this,"parentElement",null),et(this,"parentNode",null),et(this,"ownerDocument",void 0),et(this,"firstChild",null),et(this,"lastChild",null),et(this,"previousSibling",null),et(this,"nextSibling",null),et(this,"ELEMENT_NODE",1),et(this,"TEXT_NODE",3),et(this,"nodeType",void 0),et(this,"nodeName",void 0),et(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function ee(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>ne(n,t,e,r)}function ne(t,e,n,r){re(()=>{const i=t.removeEventListener;"function"==typeof i&&(void 0!==r?i.call(t,e,n,r):i.call(t,e,n))})}function re(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ie(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var oe="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",se={map:{},getId(){return console.warn(oe),-1},getNode(){return console.warn(oe),null},removeNodeFromMap(){console.warn(oe)},has(){return console.warn(oe),!1},reset(){console.warn(oe)}};function ae(t,e,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=e-(s-i),l=this;0>=a||a>e?(r&&(clearTimeout(r),r=null),i=s,t.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,t.apply(l,o)},a))}}function le(t,e,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>le(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(se=new Proxy(se,{get(t,e,n){return"map"===e&&console.warn(oe),Reflect.get(t,e,n)}}));var ue=Date.now;function ce(t){var e,n,r,i;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=x.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(r=x.parentElement(o.body))||void 0===r?void 0:r.scrollTop)||(null==o||null===(i=o.body)||void 0===i?void 0:i.scrollTop)||0}}function de(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function he(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fe(t){return t?t.nodeType===t.ELEMENT_NODE?t:x.parentElement(t):null}function me(t,e,n,r){if(!t)return!1;const i=fe(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(r&&null!==i.closest("."+e))return!0}else if(qt(i,e,r))return!0}catch(t){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function pe(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ye(t,e){if(rt(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=x.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||ye(r,e))}function ve(t){return Boolean(t.changedTouches)}function be(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ge(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function we(t){return!!t&&(t instanceof te&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(x.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ue=()=>(new Date).getTime());var ke=class{constructor(){et(this,"id",1),et(this,"styleIDMap",new WeakMap),et(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Se(t){var e;let n=null;return"getRootNode"in t&&(null===(e=x.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&x.host(x.getRootNode(t))&&(n=x.host(x.getRootNode(t))),n}function Ce(t){const e=t.ownerDocument;if(!e)return!1;if(x.contains(e,t))return!0;const n=x.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Se(n);)n=e;return n}(t);return x.contains(e,n)}(t)}function Ie(t){return"__ln"in t}var Me,xe=class{constructor(){et(this,"length",0),et(this,"head",null),et(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ie(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&Ie(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Ae=(t,e)=>`${t}@${e}`,Re=class{constructor(){et(this,"frozen",!1),et(this,"locked",!1),et(this,"texts",[]),et(this,"attributes",[]),et(this,"attributeMap",new WeakMap),et(this,"generatedAttributes",new WeakMap),et(this,"removes",[]),et(this,"mapRemoves",new Set),et(this,"movedMap",{}),et(this,"addedSet",new Set),et(this,"movedSet",new Set),et(this,"droppedSet",new Set),et(this,"removesSubTreeCache",new Set),et(this,"mutationCb",void 0),et(this,"blockClass",void 0),et(this,"blockSelector",void 0),et(this,"maskTextClass",void 0),et(this,"maskTextSelector",void 0),et(this,"inlineStylesheet",void 0),et(this,"maskInputOptions",void 0),et(this,"maskTextFn",void 0),et(this,"maskInputFn",void 0),et(this,"maskAllElementAttributes",void 0),et(this,"maskAttributeFn",void 0),et(this,"keepIframeSrcFn",void 0),et(this,"recordCanvas",void 0),et(this,"canvasMaskingConfigured",void 0),et(this,"inlineImages",void 0),et(this,"slimDOMOptions",void 0),et(this,"dataURLOptions",void 0),et(this,"doc",void 0),et(this,"mirror",void 0),et(this,"iframeManager",void 0),et(this,"stylesheetManager",void 0),et(this,"shadowDomManager",void 0),et(this,"canvasManager",void 0),et(this,"processedNodeManager",void 0),et(this,"unattachedDoc",void 0),et(this,"canvasManagerReleased",!1),et(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),et(this,"emit",()=>{if(this.frozen||this.locked)return;const t=A(),e=T();try{this.processBufferedMutations()}finally{n=A()-t,r=e,F>0||E(n,null!=r?r:R)||n>H.slowestBatchMs&&(H.slowestBatchMs=n)}var n,r}),et(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new xe,r=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let i;const o=o=>{var s;const a=x.parentNode(o);if(!a||!Ce(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=rt(a)?this.mirror.getId(Se(o)):this.mirror.getId(a),u=r(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=i)&&void 0!==s||(i={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{be(t,this.mirror)&&this.iframeManager.addIframe(t),ge(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),we(t)&&!me(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(x.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Qt(o,i);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Te(this.removesSubTreeCache,t)&&!this.movedSet.has(x.parentNode(t))||o(t);for(const t of this.addedSet)Ee(this.droppedSet,t)||Te(this.removesSubTreeCache,t)?Ee(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(x.parentNode(s.value)),n=r(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(x.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==e){t=n;break}{const e=x.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=x.host(e);if(-1!==this.mirror.getId(r)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=x.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[r,i]of Object.entries(e))if("string"==typeof i||null===i){var n;e[r]=wt({element:t.node,name:r,value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(r)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),et(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),et(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(x.childNodes(t),t=>x.textContent(t)||"").join("");e.attributes.value=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:St(t),value:n,maskInputFn:this.maskInputFn})}),et(this,"processMutation",t=>{if(!pe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=x.textContent(t.target);me(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:zt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,fe(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const r=t.target,i=bt(r.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const r=t.getAttributeNodeNS(n,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const i=t.lookupPrefix(n);return i?`${i}:${e}`:e}(r,o,s),l=s?r.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=r,e=St(t);l=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(me(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===i&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&r.contentDocument)return;if("type"===a&&"input"===i&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!Ht(i,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Bt(this.doc,i,bt(a),l,r,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=r.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const r=n.getPropertyValue(t),i=n.getPropertyPriority(t);r!==e.style.getPropertyValue(t)||i!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===i?r:[r,i]:u._unchangedStyles[t]=[r,i]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===i){u.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(me(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),r=rt(t.target)?this.mirror.getId(x.host(t.target)):this.mirror.getId(t.target);me(t.target,this.blockClass,this.blockSelector,!1)||pe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Oe(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ye(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ae(n,r)]?Oe(this.movedSet,e):(this.removes.push({parentId:r,id:n,isShadow:!(!rt(t.target)||!it(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),x.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),et(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(pe(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ae(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!me(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=x.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(we(t)){const e=x.childNodes(x.shadowRoot(t));for(let n=0,r=e.length;r>n;n++){const r=e[n];r&&(this.processedNodeManager.add(r,this),this.genAdds(r,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),me(t,n||e,this.blockSelector,!0))return!0;const r="getRootNode"in t?x.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?x.host(r):null}return!1}};function Oe(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const r=x.childNodes(e);for(let t=0,e=r.length;e>t;t++){const e=r[t];e&&n.push(e)}}}function Te(t,e,n){return 0!==t.size&&function(t,e){const n=x.parentNode(e);return!!n&&t.has(n)}(t,e)}function Ee(t,e){if(0===t.size)return!1;let n=x.parentNode(e);for(;n;){if(t.has(n))return!0;n=x.parentNode(n)}return!1}function Fe(t){Me=t}function Le(){Me=void 0}var Ne=(t,e="rrweb")=>Me?(...n)=>{try{return t(...n)}catch(t){if(Me&&!0===Me(t,e))return;throw t}}:t,De=[];function _e(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function je(t,e){const n=new Re;let r;n.init(t);try{r=new(I())(Ne(n.processMutations.bind(n)));const i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(i.attributeFilter=t.attributeFilter),r.observe(e,i),De.push(n),{observer:r,buffer:n}}catch(t){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function $e({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const s=new Map,a=o=>{const a=_e(o);if(!a||me(a,r,i,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ce(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=[ee("scroll",Ne(ae(Ne(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(ee("scrollend",Ne(a),e)),()=>l.forEach(t=>t())}function We(t,e){for(let n=De.length-1;n>=0;n--){const r=De[n];if(!r)continue;let i=r.bufferBelongsToIframe(t);!i&&e&&e.has(r.bufferDoc())&&(i=!0),i&&(r.reset(),De.splice(n,1))}}var Pe=["INPUT","TEXTAREA","SELECT"],Be=new WeakMap;function He(t){return function t(e,n){if(Ze("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ze("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ze("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ze("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(r),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function Ue(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function qe({mirror:t,stylesheetManager:e},n){var r,i;let o=null;o=t.getId("#document"===n.nodeName?n:x.host(n));const s="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=n.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,a=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var r;n=null===(r=a.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ne(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var ze=new Set;function Ge(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,o;!function(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),r(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),i(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),m(...t)}}(t,e);const s=[],a=Ne(()=>{try{if(o)try{o.destroy(),o.reset()}finally{const t=De.indexOf(o);-1!==t&&De.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ie(s)}}),d=(t,e)=>{const n=Ne(()=>{try{return e()}catch(e){throw ze.add(t),e}})();"function"==typeof n&&s.push(n)};try{if(t.recordDOM&&d("mutation",()=>{const e=je(t,t.doc);i=e.observer,o=e.buffer}),d("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(!1===e.mousemove)return()=>{};const i="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const u=ae(Ne(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),c=Ne(ae(Ne(t=>{const e=_e(t),{clientX:n,clientY:i}=ve(t)?t.changedTouches[0]:t;s||(s=ue()),a.push({x:n,y:i,id:r.getId(e),timeOffset:ue()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)}),i,{trailing:!1})),d=[ee("mousemove",c,n),ee("touchmove",c,n),ee("drag",c,n)];return Ne(()=>{d.forEach(t=>t())})}(t)),d("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[];let d=null;return Object.keys(u).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t]).forEach(s=>{let a=bt(s);const h=(e=>s=>{const a=_e(s);if(me(a,i,o,!0))return;let l=null,h=e;if("pointerType"in s){switch(s.pointerType){case"mouse":l=c.Mouse;break;case"touch":l=c.Touch;break;case"pen":l=c.Pen}l===c.Touch&&(u[e]===u.MouseDown?h="TouchStart":u[e]===u.MouseUp&&(h="TouchEnd"))}else ve(s)&&(l=c.Touch);null!==l?(d=l,(h.startsWith("Touch")&&l===c.Touch||h.startsWith("Mouse")&&l===c.Mouse)&&(l=null)):u[e]===u.Click&&(l=d,d=null);const f=ve(s)?s.changedTouches[0]:s;if(!f)return;const m=n.getId(a),{clientX:p,clientY:y}=f;Ne(t)(r({type:u[h],id:m,x:p,y:y},null!==l&&{pointerType:l}))})(s);if(window.PointerEvent)switch(u[s]){case u.MouseDown:case u.MouseUp:a=a.replace("mouse","pointer");break;case u.TouchStart:case u.TouchEnd:return}l.push(ee(a,h,e))}),Ne(()=>{l.forEach(t=>t())})}(t)),d("scroll",()=>$e(t)),d("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return ee("resize",Ne(ae(Ne(()=>{const e=de(),i=he();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200)),e)}(t,{win:n})),d("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:u,sampling:c,userTriggeredOnInput:d}){function h(t){let n=_e(t);const r=t.isTrusted,c=e.defaultView;if(n&&c&&!(n instanceof c.HTMLElement))return;const h=n&&n.tagName;if(n&&"OPTION"===h&&(n=x.parentElement(n)),!n||!h||0>Pe.indexOf(h)||me(n,i,o,!0))return;if(n.classList.contains(s)||a&&n.matches(a))return;let m=n.value,p=!1;const y=St(n)||"";"radio"===y||"checkbox"===y?p=n.checked:(l[h.toLowerCase()]||l[y])&&(m=vt({element:n,maskInputOptions:l,tagName:h,type:y,value:m,maskInputFn:u})),f(n,d?{text:m,isChecked:p,userTriggered:r}:{text:m,isChecked:p});const v=n.name;"radio"===y&&v&&p&&e.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(t=>{if(t!==n){const e=t.value;f(t,d?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function f(e,i){const o=Be.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){Be.set(e,i);const o=n.getId(e);Ne(t)(r(r({},i),{},{id:o}))}}const m=("last"===c.input?["change"]:["input","change"]).map(t=>ee(t,Ne(h),e)),p=e.defaultView;if(!p)return()=>{m.forEach(t=>t())};const y=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return y&&y.set&&m.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>le(t[0],t[1],{set(){Ne(h)({target:this,isTrusted:!1})}},!1,p))),Ne(()=>{ie(m)})}(t)),d("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Ne(o=>ae(Ne(i=>{const s=_e(i);if(!s||me(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:r.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),i.media||500)),a=[ee("play",s(h.Play),o),ee("pause",s(h.Pause),o),ee("seeked",s(h.Seeked),o),ee("volumechange",s(h.VolumeChange),o),ee("ratechange",s(h.RateChange),o)];return Ne(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let r=!0;const i=t=>{if(r)try{t()}catch(t){}},o=t=>{var n;const r=e.get(t);if(r){for(;null===(n=r[0])||void 0===n?void 0:n.ready;){const t=r.shift();(null==t?void 0:t.emit)&&i(t.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void i(n);const r=e.get(t);r?(r.push({emit:n,ready:!0}),o(t)):i(n)},queuePendingMutation(s,a,l){if(!r)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const m=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(m,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){m()}return e=>{!f&&r&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&i(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){r=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);s.push(e.reset),d("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r,mutationQueue:i}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),r.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return r.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=r.CSSStyleSheet.prototype.deleteRule;let a,l;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),r.CSSStyleSheet.prototype.removeRule=function(t){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);try{const r=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof r)return l;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Ue(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=i.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=lt(o);null!==e&&t({id:s,styleId:u,replace:e})});try{r.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Ue(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&i.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};Ve("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(Ve("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),Ve("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),Ve("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(u).forEach(([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ue(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...He(o),l];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ne((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Ue(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...He(o),a];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ne(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,a&&(r.CSSStyleSheet.prototype.replace=a),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),d("adoptedStyleSheet",()=>qe(t,t.doc)),d("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i,mutationQueue:o}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Ne((i,s,a)=>{var l;const[u,c,d]=a,h=i.apply(s,a);if(n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;r.onCssomSheetMutation(f);const{id:m,styleId:p}=Ue(f,e,r.styleMirror);if(m&&-1!==m||p&&-1!==p){const e=He(s.parentRule);o.queueMutation(f,()=>t({id:m,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ne((i,s,a)=>{var l;const[u]=a,c=i.apply(s,a);if(n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;r.onCssomSheetMutation(d);const{id:h,styleId:f}=Ue(d,e,r.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=He(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ne(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&d("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const r=new o(t,e,n);return i.set(r,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};const s=M(e.fonts,"add",function(e){return function(n){return setTimeout(Ne(()=>{const e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),Ne(()=>{r.forEach(t=>t())})}(t))}d("selection",()=>function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=t;let s=!0;const a=Ne(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);me(o,r,i,!0)||me(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),ee("selectionchange",a)}(t)),d("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?M(n.customElements,"define",function(t){return function(n,r,i){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,r,i])}}):()=>{}}(t));for(const e of t.plugins)d(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function Ze(t){return void 0!==window[t]}function Ve(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Xe=class{constructor(t){et(this,"generateIdFn",void 0),et(this,"iframeRemoteIdToLocalIdMap",new WeakMap),et(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,r){if(0>e)return e;const i=n||this.getRemoteIdToLocalIdMap(t),o=r||this.getLocalIdToRemoteIdMap(t);let s=i.get(e);return void 0===s&&(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,r))}getRemoteId(t,e,n){var r;return"number"!=typeof e||0>e?e:null!==(r=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Ye=class{constructor(t){et(this,"iframes",new WeakMap),et(this,"crossOriginIframeMap",new WeakMap),et(this,"crossOriginIframeMirror",new Xe(Lt)),et(this,"crossOriginIframeStyleMirror",void 0),et(this,"crossOriginIframeRootIdMap",new WeakMap),et(this,"mirror",void 0),et(this,"mutationCb",void 0),et(this,"wrappedEmit",void 0),et(this,"loadListener",void 0),et(this,"pageHideListener",void 0),et(this,"stylesheetManager",void 0),et(this,"recordCrossOriginIframes",void 0),et(this,"messageHandler",void 0),et(this,"nestedIframeListeners",new Map),et(this,"attachedWindows",new WeakMap),et(this,"attachedDocuments",new WeakMap),et(this,"attachedIframes",new Map),et(this,"loadListenerDisposers",new WeakMap),et(this,"iframeElementsById",new Map),et(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,n,r;return null!==(e=null!==(n=null===(r=this.attachedIframes.get(t))||void 0===r?void 0:r.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>re(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{ne(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const r=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const i=t.contentWindow;if(this.recordCrossOriginIframes&&i&&!this.nestedIframeListeners.has(i)){const e=this.handleMessage.bind(this);re(()=>{i.addEventListener("message",e),this.nestedIframeListeners.set(i,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(i)})}re(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const r=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",r),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:r})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case a.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:a.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case a.Meta:case a.Load:case a.DomContentLoaded:return!1;case a.Plugin:return e;case a.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case a.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:case l.Input:return this.replaceIds(e.data,t,["id"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case l.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,r){for(const i of r)(Array.isArray(e[i])||"number"==typeof e[i])&&(e[i]=Array.isArray(e[i])?t.getIds(n,e[i]):t.getId(n,e[i]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(ne(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(ne(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const r=this.attachedDocuments.get(n);r&&(r.forEach(t=>{re(()=>this.mirror.removeNodeFromMap(t))}),re(()=>We(n,r)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&ne(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{ne(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Je=class{constructor(t){et(this,"shadowDoms",new WeakSet),et(this,"mutationCb",void 0),et(this,"scrollCb",void 0),et(this,"bypassOptions",void 0),et(this,"mirror",void 0),et(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!it(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const o=null!==(n=null===(i=x.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:s,buffer:a}=je(r(r({},this.bypassOptions),{},{doc:o,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:o,handler(){s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=De.indexOf(a);-1!==t&&De.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:$e(r(r({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(x.host(t))),this.restoreHandlers.push({doc:o,handler:qe({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:M(t.prototype,"attachShadow",function(t){return function(r){const i=t.call(this,r),o=x.shadowRoot(this);return o&&Ce(this)&&n.addShadowRoot(o,e),i}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Qe="skip-frame";function Ke(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:r,height:i}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nn=0;64>nn;nn++)en[tn.charCodeAt(nn)]=nn;var rn=function(t){var e,n=new Uint8Array(t),r=n.length,i="";for(e=0;r>e;e+=3)i+=tn[n[e]>>2],i+=tn[(3&n[e])<<4|n[e+1]>>4],i+=tn[(15&n[e+1])<<2|n[e+2]>>6],i+=tn[63&n[e+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},on=!1,sn=new Map,an=(t,e,n)=>{if(!t||!cn(t,e)&&"object"!=typeof t)return;const r=function(t,e){let n=sn.get(t);return n||(n=new Map,sn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let i=r.indexOf(t);return-1===i&&(i=r.length,r.push(t)),i};function ln(t,e,n,r){if(t instanceof Array)return t.map(t=>ln(t,e,n,r));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:rn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ln(t.buffer,e,n,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(r.type,r.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?on||(on=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[ln(t.data,e,n,r),t.width,t.height]}:cn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:an(t,e,n)}:t}var un=(t,e,n,r)=>t.map(t=>ln(t,e,n,r)),cn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},dn=["webgl","webgl2"];function hn(t){return"nodeType"in t}function fn(t,e,n,i){const o=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return M(i.prototype,"configure",function(i){return function(o){const s=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!s||hn(s)&&me(s,e,n,!0))return i.call(this,o);hn(s)&&!("__context"in s)&&(s.__context="webgpu");const a=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==a&&o?r(r({},o),{},{usage:"number"==typeof o.usage?o.usage|a:a}):o)}})}(t,e,n);i&&o.push(i)}const s=M(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!me(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&dn.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});o.push(s)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(t=>t())}}function mn(t,e,n,r,i,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=M(t,u,function(t){return function(...a){const l=t.apply(this,a);if(an(l,o,this),this.canvas&&"tagName"in this.canvas&&!me(this.canvas,r,i,!0)){let t;try{t=un(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=le(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!me(this.canvas,r,i,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var pn='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',yn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",pn],{type:"text/javascript;charset=utf-8"});function vn(t){let e;try{if(e=yn&&(self.URL||self.webkitURL).createObjectURL(yn),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(pn),{name:null==t?void 0:t.name})}}var bn="A page CSP that omits blob: from worker-src or script-src blocks it";function gn(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var wn,kn,Sn,Cn=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){et(this,"pendingCanvasMutations",new Map),et(this,"rafStamps",{latestId:0,invokeId:null}),et(this,"mirror",void 0),et(this,"mutationCb",void 0),et(this,"resetObservers",void 0),et(this,"frozen",!1),et(this,"locked",!1),et(this,"rafIdTimestamp",null),et(this,"rafIdFlush",null),et(this,"refCount",0),et(this,"torndown",!1),et(this,"resetFrameDedup",null),et(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,r,i,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,r,i,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,r,i){var s=this;if(!("OffscreenCanvas"in e))return void gn("disabled because this browser does not support OffscreenCanvas");const a="number"==typeof i.resolutionScale&&Number.isFinite(i.resolutionScale)?Math.min(1,Math.max(.1,i.resolutionScale)):1,l=fn(e,n,r,!0),u=new Map;let c;try{c=new vn}catch(t){return gn(`disabled because the encode worker did not start. ${bn}`,t),void l()}let h=!1;c.onerror=t=>{var e;h=!0,gn(`stopped because the encode worker failed. ${bn}`,t),cancelAnimationFrame(y),null===(e=c.terminate)||void 0===e||e.call(c),this.resetFrameDedup=null},this.resetFrameDedup=()=>{c.postMessage({resetFrameDedup:!0})},c.onmessage=t=>{const{id:e}=t.data;if(u.set(e,!1),!("base64"in t.data))return;const{base64:n,type:r,displayWidth:i,displayHeight:o}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0,i,o]}],displayWidth:i,displayHeight:o})};let f=!1,m=!1;const p=1e3/t;let y,v=0;const b=t=>{var l;h||(v&&p>t-v||(v=t,(()=>{const t=[],i=e=>{try{e.querySelectorAll("canvas").forEach(e=>{me(e,n,r,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&i(t.shadowRoot)})}catch(t){}};return i(e.document),t})().forEach((l=o(function*(t){const e=s.mirror.getId(t);if(-1!==e&&!u.get(e)&&0!==t.width&&0!==t.height){u.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,r;const i=t.getContext(t.__context);if(null==i||null===(n=i.isContextLost)||void 0===n?void 0:n.call(i))return void u.set(e,!1);!1===(null==i||null===(r=i.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,s=t.clientHeight||t.height,l=Math.max(1,Math.round(o*a)),d=Math.max(1,Math.round(s*a)),h=function(t,e,n,r,i,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Qe}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ke))return Qe;const a=n/i,l=r/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(i.canvasMasking,t,l,d,o,s);if("skip-frame"===h)return f||(f=!0,gn("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void u.set(e,!1);const m=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:d,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:d});c.postMessage({id:e,bitmap:m,width:l,height:d,displayWidth:o,displayHeight:s,dataURLOptions:i.dataURLOptions,maskRegions:h},[m])}catch(t){m||(m=!0,gn("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),y=requestAnimationFrame(b))};y=requestAnimationFrame(b),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(y),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=fn(t,e,n,!1),o=function(t,e,n,r,i){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=M(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return me(this.canvas,n,r,!0)||setTimeout(()=>{let n;try{n=un(s,e,this,i)}catch(t){return}t(this.canvas,{type:d["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(i){const s=le(e.CanvasRenderingContext2D.prototype,a,{set(e){me(this.canvas,n,r,!0)||t(this.canvas,{type:d["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,r),s=function(t,e,n,r,i){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...mn(e.WebGLRenderingContext.prototype,d.WebGL,t,n,r,e,i)),void 0!==e.WebGL2RenderingContext&&o.push(...mn(e.WebGL2RenderingContext.prototype,d.WebGL2,t,n,r,e,i)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const r=n.map(t=>function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;o.length>r;r++)e.includes(n=o[r])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,s)),{type:i}=n[0];this.mutationCb({id:e,type:i,commands:r}),this.pendingCanvasMutations.delete(t)}},In=class{constructor(t){var e;et(this,"trackedLinkElements",new WeakSet),et(this,"pendingDeferredSheets",new Set),et(this,"mutationCb",void 0),et(this,"adoptedStyleSheetCb",void 0),et(this,"maskAllElementAttributes",void 0),et(this,"maskAttributeFn",void 0),et(this,"styleMirror",new ke),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,r=null;try{r=t.sheet,r&&(n=pt(r))}catch(t){}if(!n||!r)return Q(),null;const i=n;let o=!1;const s={sheet:r,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=A(),u=T();let c=!0;try{if(o)return a=!0,Q(),!0;if(!i.advance(n))return c=!1,!1;a=!0;const s=i.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==r?(Q(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(Q(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),E(d=A()-l,null!=(h=u)?h:R)||(U.totalMs+=d,d>U.slowestSliceMs&&(U.slowestSliceMs=d))}var d,h},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:wt({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},r=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const i=A();try{V(()=>{try{const t=e.rules||e.cssRules;t&&Z(t)}catch(t){}r.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:ut(t,e.href),index:n}))})})}finally{X(A()-i)}}n.styleIds.push(t)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Zt.forEach(t=>t.abort()),Zt.clear()}trackStylesheetInLinkElement(t){}},Mn=class{constructor(){et(this,"nodeMap",new WeakMap),et(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},xn=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var An;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(An=t.contentWindow)||void 0===An?void 0:An.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Rn=new yt,On=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function Tn(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}function En(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:o,blockClass:s="rr-block",blockSelector:u=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:h="rr-mask",maskTextSelector:f=null,inlineStylesheet:m=!0,inlineStylesheetBudgetRules:p,maskAllInputs:y,maskInputOptions:v,slimDOMOptions:b,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k=!1,maskAttributeFn:S,hooks:C,packFn:I,sampling:M={},dataURLOptions:A={},canvasResolutionScale:R,canvasMasking:T,mousemoveWait:E,recordDOM:F=!0,recordCanvas:L=!1,recordCrossOriginIframes:N=!1,recordAfter:D=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:_=!1,collectFonts:j=!1,inlineImages:W=!1,plugins:P,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:H=new Set([]),attributeFilter:U,errorHandler:G}=t;Fe(G);const Z=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),V=!N||window.parent===window;let X=!1;if(!V)try{window.parent.document&&(X=!1)}catch(t){X=!0}if(V&&!n)throw new Error("emit function is required");if(!V&&!X)return()=>{};void 0!==E&&void 0===M.mousemove&&(M.mousemove=E),Rn.reset();const Y=!0===y?{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}:void 0!==v?v:{password:!0},Q=Kt(void 0!==b&&b);let tt;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let et=0;const nt=new Map;let rt,it;const ot=t=>{for(const e of P||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!X&&(t=I(t)),t};wn=(t,e)=>{var r;const s=t;if(s.timestamp=ue(),!(null===(r=De[0])||void 0===r?void 0:r.isFrozen())||s.type===a.FullSnapshot||s.type===a.IncrementalSnapshot&&On.has(s.data.source)||De.forEach(t=>t.unfreeze()),V)null==n||n(ot(s),e);else if(X){const t={type:"rrweb",event:ot(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(s.type===a.FullSnapshot)tt=s,et=0;else if(s.type===a.IncrementalSnapshot){if(s.data.source===l.Mutation&&s.data.isAttachIframe)return;et++,(o&&et>=o||i&&s.timestamp-tt.timestamp>i)&&kn(!0)}};const st=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=Rn.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const r=ct.getIframeElementById(t);r&&n.has(r)?ct.forgetIframeId(t):(null==rt||rt(t),ct.removeIframeById(t))}),null==it||it(),ct.cleanupDetachedIframes()}wn({type:a.IncrementalSnapshot,data:r({source:l.Mutation},t)})},at=t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Scroll},t)}),lt=t=>wn({type:a.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),ut=new In({mutationCb:st,adoptedStyleSheetCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S}),ct=new Ye({mirror:Rn,mutationCb:st,stylesheetManager:ut,recordCrossOriginIframes:N,wrappedEmit:wn});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:Rn,crossOriginIframeMirror:ct.crossOriginIframeMirror,crossOriginIframeStyleMirror:ct.crossOriginIframeStyleMirror});const dt=new Mn,ht=null==T?void 0:T.configured;Sn=new Cn({recordCanvas:L,mutationCb:lt,win:window,blockClass:s,blockSelector:u,mirror:Rn,sampling:M.canvas,dataURLOptions:Z,resolutionScale:R,canvasMasking:T});const ft=new Je({mutationCb:st,scrollCb:at,bypassOptions:{blockClass:s,blockSelector:u,maskTextClass:h,maskTextSelector:f,inlineStylesheet:m,maskInputOptions:Y,dataURLOptions:Z,maskTextFn:w,maskInputFn:g,maskAllElementAttributes:k,maskAttributeFn:S,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,sampling:M,slimDOMOptions:Q,iframeManager:ct,stylesheetManager:ut,canvasManager:Sn,keepIframeSrcFn:B,processedNodeManager:dt,attributeFilter:U},mirror:Rn});kn=(t=!1)=>{if(F){q(p);try{wn({type:a.Meta,data:{href:window.location.href,width:he(),height:de()}},t),null==e||e.cancel(),e=void 0,ut.reset(),ft.init(),De.forEach(t=>t.lock());let n=null,r=[];try{n=function(t,e){const{mirror:n=new yt,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:m=!1,maskAttributeFn:p,slimDOM:y=!1,dataURLOptions:v,preserveWhiteSpace:b,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M=()=>!1,maxDepth:x,inlineStylesheetBudgetRules:A}=e||{},R=!0===d?{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}:!1===d?{password:!0}:d,O=Kt(y);q(A);try{return Qt(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:R,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:m,maskAttributeFn:p,slimDOMOptions:O,dataURLOptions:v,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,newlyAddedElement:!1,maxDepth:x})}finally{z()}}(document,{mirror:Rn,blockClass:s,blockSelector:u,maskTextClass:h,maskTextSelector:f,inlineStylesheet:m,maskAllInputs:Y,inlineStylesheetBudgetRules:p,maskTextFn:w,maskInputFn:g,maskAllElementAttributes:k,maskAttributeFn:S,slimDOM:Q,dataURLOptions:Z,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,onSerialize(t){be(t,Rn)&&ct.addIframe(t),ge(t,Rn)&&ut.trackLinkElement(t),we(t)&&ft.addShadowRoot(x.shadowRoot(t),document)},onIframeLoad(t,e){ct.attachIframe(t,e),ft.observeAttachShadow(t)},onIframeListenerRegistered(t,e){ct.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){ut.attachLinkElement(t,e)},keepIframeSrcFn:B})}finally{r=J()}if(!n)return console.warn("Failed to snapshot the document");if(wn({type:a.FullSnapshot,data:{node:n,initialOffset:ce(window)}},t),De.forEach(t=>t.unlock()),Sn.onFullSnapshot(),r.length){const t=function(t,e,n){let r=!1,i=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&re(()=>{s=e.beginDeferredLinkInlining(n,Rn.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;re(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(i=null,r)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,K(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?i=Tn(d):n())};return i=Tn(d),{cancel(){r=!0,null==s||s.discard(),s=null,null==i||i.cancel(),i=null},flush(){if(r)return;r=!0,null==i||i.cancel(),i=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);K(e),null==s||s.discard(),s=null}n()}}}(r,ut,()=>{e===t&&(e=void 0)});e=t}N&&ct.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ut.adoptStyleSheets(document.adoptedStyleSheets,Rn.getId(document))}finally{z()}}};try{const t=[];t.push(ee("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(ee(e,O,document));rt=e=>{const n=nt.get(e);n&&(n.forEach(e=>{re(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),nt.delete(e))},it=()=>{for(const[t]of nt){const e=Rn.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==rt||rt(t)}catch(e){null==rt||rt(t)}else null==rt||rt(t)}};const n=t=>{var e;return Ne(Ge)({mutationCb:st,mousemoveCb:(t,e)=>wn({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:at,viewportResizeCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:lt,fontCb:t=>wn({type:a.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){wn({type:a.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){wn({type:a.IncrementalSnapshot,data:r({source:l.CustomElement},t)})},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:h,maskTextSelector:f,maskInputOptions:Y,inlineStylesheet:m,sampling:M,recordDOM:F,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,userTriggeredOnInput:_,collectFonts:j,doc:t,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:B,blockSelector:u,slimDOMOptions:Q,dataURLOptions:Z,mirror:Rn,iframeManager:ct,stylesheetManager:ut,shadowDomManager:ft,processedNodeManager:dt,canvasManager:Sn,ignoreCSSAttributes:H,attributeFilter:U,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>wn({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},C)};ct.addLoadListener(e=>{try{const r=Rn.getId(e),i=n(e.contentDocument);if("function"==typeof i&&(t.push(i),-1!==r)){let t=nt.get(r);t||(t=new Set,nt.set(r,t)),t.add(i)}}catch(t){console.warn(t)}}),ct.addPageHideListener(t=>{const e=Rn.getId(t);null==rt||rt(e),We(t)});let i=-1;const o=t=>wn({type:a.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),p=()=>{var t,e,n,r;const s=document,a=null!==(t=null!==(e=null!==(n=null!==(r=s.fullscreenElement)&&void 0!==r?r:s.webkitFullscreenElement)&&void 0!==n?n:s.mozFullScreenElement)&&void 0!==e?e:s.msFullscreenElement)&&void 0!==t?t:null,l=a?Rn.getId(a):-1;l!==i&&(-1!==i&&o({id:i,enter:!1}),i=l,-1!==l&&o({id:l,enter:!0}))},y=()=>{kn();const e=n(document);"function"==typeof e&&t.push(e),t.push(ee("fullscreenchange",p)),t.push(ee("webkitfullscreenchange",p)),t.push(ee("mozfullscreenchange",p)),t.push(ee("MSFullscreenChange",p)),xn=!0};return["interactive","complete"].includes(document.readyState)?y():(t.push(ee("DOMContentLoaded",()=>{wn({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&y()})),t.push(ee("load",()=>{wn({type:a.Load,data:{}}),"load"===D&&y()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ie(t),dt.destroy(),ct.removeLoadListener(),ct.destroy(),nt.clear(),ft.reset(),Rn.reset(),xn=!1,Le()}}catch(t){console.warn(t)}}En.addCustomEvent=(t,e)=>{if(!xn)throw new Error("please add custom event after start recording");wn({type:a.Custom,data:{tag:t,payload:e}})},En.freezePage=()=>{De.forEach(t=>t.freeze())},En.takeFullSnapshot=t=>{if(!xn)throw new Error("please take full snapshot after start recording");kn(t)},En.mirror=Rn,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var Fn=Object.create(null);function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function Nn(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ln(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ln(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Fn.Node=Object.create(null),Fn.ShadowRoot=Object.create(null),Fn.MutationObserver=Object.create(null),Fn.Element=Object.create(null);var Dn=class{constructor(t){Nn(this,"fileName",void 0),Nn(this,"functionName",void 0),Nn(this,"lineNumber",void 0),Nn(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},_n=/(^|@)\S+:\d+/,jn=/^\s*at .*(\S+:\d+|\(native\))/m,$n=/^(eval@)?(\[native code])?$/,Wn={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(jn)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(jn)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const r=e.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop());return new Dn({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0],lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match($n)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Dn({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Dn({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[];for(let t=2,i=n.length;i>t;t+=2){const i=e.exec(n[t]);i&&r.push(new Dn({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),r=[];for(let t=0,i=n.length;i>t;t+=2){const i=e.exec(n[t]);i&&r.push(new Dn({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(_n)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Dn({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Pn(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const r=t.parentElement,i=[];if(r.children&&r.children.length>0)for(let t=0;r.children.length>t;t++){const e=r.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&i.push(e)}i.length>1&&(n+=`:eq(${i.indexOf(t)})`),e=n+(e?">"+e:""),t=r}return e}function Bn(t){return Array.isArray(t)}function Hn(t){return"object"==typeof t&&null!==t&&!Bn(t)}function Un(t,e){if(0===e)return!0;const n=Object.keys(t);for(const r of n)if(Hn(t[r])&&Un(t[r],e-1))return!0;return!1}function qn(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const r=[],i=[];return JSON.stringify(t,function(t,e){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?i.splice(n,1/0,t):i.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Hn(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Hn(o)&&Un(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const r=e[n];t[n]=Bn(r)?Pn(r.length?r[0]:null):r}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var zn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Gn(t,e,n){const r=n?Object.assign({},zn,n):zn,i=r.logger;if(!i)return()=>{};let o;o="string"==typeof i?e[i]:i;let s=0,a=!1,l=!0;const u=[];if(r.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Wn.parse(e.error).map(t=>t.toString()),payload:[qn(n,r.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const i=e=>{let n,i;e.reason instanceof Error?(n=e.reason,i=[qn(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,i=[qn("Uncaught (in promise)",r.stringifyOptions),qn(e.reason,r.stringifyOptions)]),t({level:"error",trace:Wn.parse(n).map(t=>t.toString()),payload:i})};e.addEventListener("unhandledrejection",i),u.push(()=>{e.removeEventListener("unhandledrejection",i)})}for(const t of r.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(i,o){try{if(!(o in i))return()=>{};const u=i[o],c={next:u},d=(i=>(...o)=>{if(i.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=Wn.parse(new Error).map(t=>t.toString()).splice(1),i=("assert"===n?o.slice(1):o).map(t=>qn(t,r.stringifyOptions));s++,r.lengthThreshold>s?t({level:n,trace:e,payload:i}):s===r.lengthThreshold&&t({level:"warn",trace:[],payload:[qn("The number of log records reached the threshold.")]})}catch(t){i.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),i[o]=d,()=>{if(i[o]===d)return void(i[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=i[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var Zn=t=>({name:"rrweb/console@1",observer:Gn,options:t});const Vn=Object.prototype,Xn=Vn.hasOwnProperty,Yn=Vn.toString,Jn=Array.isArray||function(t){return"[object Array]"===Yn.call(t)},Qn=t=>"function"==typeof t,Kn=t=>t===Object(t)&&!Jn(t),tr=t=>void 0===t,er=t=>null===t,nr=t=>tr(t)||er(t),rr=t=>"[object Boolean]"===Yn.call(t),ir=t=>t instanceof FormData,or="u">typeof window?window:void 0,sr="u">typeof globalThis?globalThis:or;null!=sr&&sr.XMLHttpRequest&&new sr.XMLHttpRequest;const ar=(t,{debugEnabled:e}={})=>{const n={N(n,...r){or&&(or.POSTHOG_DEBUG||e)&&!tr(or.console)&&or.console&&("__rrweb_original__"in or.console[n]?or.console[n].__rrweb_original__:or.console[n])(t,...r)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>ar(`${t} ${e}`,n)};return n},lr=ar("[PostHog.js]").createLogger,ur=()=>{},cr=t=>{var e;if(Qn(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function dr(t,e,n){try{if(!(e in t))return ur;const r={next:t[e]},i=n(function(...t){return r.next.apply(this,t)});return Qn(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=i,()=>{if(t[e]===i)return void(t[e]=r.next);let n=t[e],o=cr(n);for(;o;){if(o.next===i)return void(o.next=r.next);n=o.next,o=cr(n)}}}catch(t){return ur}}function hr(t,e){var n;const r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),i={hostname:r,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==r?void 0:r.trim().length))return i;for(const t of e.payloadHostDenyList)if(r.endsWith(t))return{hostname:r,isHostDenied:!0};return i}const fr=1e6,mr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:fr,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},pr=new WeakSet,yr=lr("[Recorder]"),vr=t=>"navigation"===t.entryType,br=t=>"resource"===t.entryType,gr=()=>{};function wr(t,e){var n;return vr(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function kr(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>wr(t,n)||br(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>wr(t,e))}(t):[]}function Sr(t,e){return!!e&&(rr(e)||e[t])}function Cr(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Ir=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Mr({type:t,recordBody:e,headers:n,url:r}){function i(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),r=e&&n[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Cr(e)&&t(e.url)}catch(t){return!1}}(r))return!1;if(i(Ir))return!1;if(rr(e))return!0;if(Jn(e))return i(e);const o=e[t];return rr(o)?o:i(o)}function xr(t,e,n,r,i){return Ar.apply(this,arguments)}function Ar(){return Ar=o(function*(t,e,n,r,i,o=0){if(o>10)return yr.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>br(t)&&t.initiatorType===e&&(tr(r)||t.startTime>=r)&&(tr(i)||i>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),xr(t,e,n,r,i,o+1))}),Ar.apply(this,arguments)}function Rr({body:t,options:e,url:n}){if(nr(t))return null;const{hostname:r,isHostDenied:i}=hr(n,e);if(i)return r+" is in deny list";if("[object String]"==Yn.call(t))return t;if(o=t,"u">typeof Document&&o instanceof Document)return t.textContent;var o;if(ir(t))return function(t,e="&"){let n,r;const i=[];return function(t,e){if(!nr(t))if(Jn(t))t.forEach(e);else if(ir(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Xn.call(t,n)&&e(t[n],n)}(t,function(t,e){tr(t)||tr(e)||"undefined"===e||(n=encodeURIComponent(t instanceof File?t.name:t.toString()),r=encodeURIComponent(e),i[i.length]=r+"="+n)}),i.join(e)}(t);if(Kn(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Or=t=>!er(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Tr(t,{entry:e,method:n,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:u,initiatorType:c}){a=e?e.startTime:a,l=e?e.responseEnd:l;const d=Math.floor(Date.now()-t.performance.now()),h=Math.floor(d+(a||0)),f=[r(r({},e?e.toJSON():{name:u}),{},{startTime:tr(a)?void 0:Math.round(a),endTime:tr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(e?e.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Or(e))for(const t of e.serverTiming||[])f.push({timeOrigin:d,timestamp:h,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return f}const Er=["video/","audio/"];function Fr(t){return Kn(t)&&Qn(t.getReader)&&Qn(t.tee)}const Lr="[SessionReplay] Timeout while trying to read body",Nr="[SessionReplay] Failed to read body";function Dr(t){return`${Nr}: ${t}`}function _r(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function jr(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Lr),500);try{t.clone().text().then(t=>e(t),t=>e(Dr(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Nr)}})}(t);const n=function(t){var e;return Math.min(fr,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:fr)}(e);return function(t,e){try{var n,r;const i=null===(n=t.headers)||void 0===n||null===(r=n.get)||void 0===r?void 0:r.call(n,"content-length");if(!i)return!1;const o=parseInt(i,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(_r(n)):function(t,e){return new Promise(n=>{let r,i=!1;function o(){try{null==r||r.cancel().catch(()=>{})}catch(t){}}function s(t){i||(i=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(Lr),500);let l;try{l=t.clone()}catch(t){return void s(Nr)}const u=l.body;if(!Fr(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(Dr(t)))}catch(t){s(Nr)}return}try{r=u.getReader()}catch(t){return void s(Nr)}const c=[];let d=0;!function t(){r.read().then(({done:n,value:r})=>{if(i)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}(c,d)));else{if(r){if(d+r.byteLength>e)return void s(_r(e));d+=r.byteLength,c.push(r)}t()}},t=>s(Dr(t)))}()})}(t,n)}function $r(){return($r=o(function*({r:t,options:e,url:n}){const{hostname:r,isHostDenied:i}=hr(n,e);return i?Promise.resolve(r+" is in deny list"):jr(t,e)})).apply(this,arguments)}function Wr(){return(Wr=o(function*({r:t,options:e,url:n}){const r=function({r:t,options:e,url:n}){var r;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const i=null===(r=t.headers.get("Content-Type"))||void 0===r?void 0:r.toLowerCase(),o=Er.some(t=>null==i?void 0:i.startsWith(t));if(i&&o)return`Content-Type ${i} is not supported`;const{hostname:s,isHostDenied:a}=hr(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return er(r)?jr(t,e):Promise.resolve(r)})).apply(this,arguments)}let Pr=null;function Br(t,e,n){if(!("performance"in e))return()=>{};if(Pr)return yr.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},mr,n):mr;let s=!0;const a=e=>{if(!s)return;const n=[];let o=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&o)return;const r=i.maskRequestFn(t);e||(o=!r||(t=>!!t&&pr.has(t))(r)),r&&n.push(r)}),n.length>0&&t(r(r({},e),{},{requests:n}))},l=function(t,e,n){try{t({requests:kr(e,n).flatMap(t=>Tr(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){yr.error("Failed to capture initial performance entries for network capture",t)}const r=e.PerformanceObserver,i=null==r?void 0:r.supportedEntryTypes;if(!r||!Jn(i))return;const o=i.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!o.length)return;const s=new r(r=>{t({requests:r.getEntries().filter(t=>vr(t)||br(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Tr(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(a,e,i),u=i.recordHeaders||i.recordBody;if(!l&&!u)return s=!1,gr;let c=()=>{},d=()=>{};return u&&(c=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=Sr("request",n.recordHeaders),i=Sr("response",n.recordHeaders),o=dr(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),r&&(l.requestHeaders=h);const m=d.send.bind(d);d.send=t=>(Mr({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=Rr({body:t,options:n,url:a})),u=e.performance.now(),m(t));const p=()=>{d.removeEventListener("readystatechange",y),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},y=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),i=e.join(": ");n&&(r[n]=i)}),i&&(l.responseHeaders=r),Mr({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(l.responseBody=Rr({body:d.response,options:n,url:a})),xr(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:Tr(e,{entry:n,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",y),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){yr.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(a,e,i),d=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=Sr("request",n.recordHeaders),i=Sr("response",n.recordHeaders),s=dr(e,"fetch",s=>function(){var a=o(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return yr.error("Failed to instrument fetch for network capture",t),s(o,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),r&&(c.requestHeaders=t),!Fr(null==a?void 0:a.body)&&Mr({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return $r.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){yr.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Cr(o)?yield s(l):yield s(o,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),i&&(c.responseHeaders=t),Mr({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return Wr.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){yr.error("Failed to record fetch response for network capture",t)}return u}finally{xr(e,"fetch",l.url,d,h).then(n=>{t({requests:Tr(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(a,e,i)),Pr=()=>{s=!1,null==l||l(),c(),d(),Pr=null},Pr}const Hr=t=>({name:"rrweb/network@1",observer:Br,options:t}),Ur="undefined"!=typeof globalThis?globalThis:or;Ur&&"undefined"==typeof self&&(Ur.self=Ur),Ur&&"undefined"==typeof File&&(Ur.File=function(){});const qr=null!=or?or:{};qr.__PosthogExtensions__=qr.__PosthogExtensions__||{},qr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Zn,getRecordNetworkPlugin:Hr},qr.__PosthogExtensions__.rrweb={record:En,version:"v2",wasMaxDepthReached:()=>Jt,resetMaxDepthState(){Jt=!1,Yt=!1},getLastSnapshotCost:()=>_,getMutationCost:()=>r({},H),getObserverInitFailures:()=>ze.size?Array.from(ze):void 0,resetSnapshotCostState(){F=0,L=0,N=0,R=0,D={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},_=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},qr.rrweb={record:En,version:"v2"},qr.rrwebConsoleRecord={getRecordConsolePlugin:Zn},qr.getRecordNetworkPlugin=Hr}();
|
|
2
2
|
//# sourceMappingURL=recorder.js.map
|