posthog-js 1.431.0 → 1.431.2

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.
Files changed (44) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/customizations.js +1 -1
  13. package/dist/default-extensions.js +1 -1
  14. package/dist/exception-autocapture.js +1 -1
  15. package/dist/exception-autocapture.js.map +1 -1
  16. package/dist/extension-bundles.js +1 -1
  17. package/dist/lazy-recorder.js +1 -1
  18. package/dist/lazy-recorder.js.map +1 -1
  19. package/dist/main.js +1 -1
  20. package/dist/module.full.cjs +1 -1
  21. package/dist/module.full.js +1 -1
  22. package/dist/module.full.js.map +1 -1
  23. package/dist/module.full.no-external.cjs +1 -1
  24. package/dist/module.full.no-external.js +1 -1
  25. package/dist/module.full.no-external.js.map +1 -1
  26. package/dist/module.js +1 -1
  27. package/dist/module.mjs +1 -1
  28. package/dist/module.no-external.cjs +1 -1
  29. package/dist/module.no-external.js +1 -1
  30. package/dist/module.slim.js +1 -1
  31. package/dist/module.slim.no-external.js +1 -1
  32. package/dist/posthog-recorder.js +1 -1
  33. package/dist/posthog-recorder.js.map +1 -1
  34. package/dist/product-tours.js +1 -1
  35. package/dist/recorder-v2.js +1 -1
  36. package/dist/recorder-v2.js.map +1 -1
  37. package/dist/recorder.js +1 -1
  38. package/dist/recorder.js.map +1 -1
  39. package/dist/rrweb.js +1 -1
  40. package/dist/rrweb.js.map +1 -1
  41. package/lib/package.json +1 -1
  42. package/lib/src/entrypoints/exception-autocapture.js +23 -14
  43. package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
  44. package/package.json +6 -6
@@ -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 R(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var A=0;function O(){A+=1}function T(){return A}function F(t,e){return(e!==A||t>6e4)&&!0}var E=0,L=0,N=0,_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},D=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;(E+=1)>1||(_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},W=[],P=0,j=(e=t)&&e>0?e:null,L=R(),N=A)}function z(){return 0===E?D||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(E-=1)>0?_:(_.durationMs=R()-L,_.deferredStylesheetCount=P,U.deferredCount+=P,j=null,F(_.durationMs,N)?_: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===E)return;const e=G(t,null,0);_.cssRuleCount+=e,B>0&&(_.nonDeferrableCssRuleCount+=e)}function V(t){B+=1;try{return t()}finally{B-=1}}function X(t){E>0&&(_.stylesheetMs+=t)}function Y(t){if(0===E||null===j)return!1;const e=_.cssRuleCount-_.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?R():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(R()-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 Rt(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ht(t)&&t.selectorText.includes(":")&&(n=ct(n)),e?Rt(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=Rt(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?Rt(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?Rt(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=R();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(R()-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&&gt.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 Rt(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 At,Ot,Tt=new Map,Ft=1,Et=new RegExp("[^a-z0-9-_:]");function Lt(){return Ft++}var Nt=/^[^ \t\n\r\u000c]+/,_t=/^[, \t\n\r\u000c]+/,Dt=new WeakMap;function jt(t,e){return e&&""!==e.trim()?$t(t,e):e}function $t(t,e){let n=Dt.get(t);if(n||(n=t.createElement("a"),Dt.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Wt(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 Pt(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=jt(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)),Wt(t,o)}if("image"===e)return Wt(n,o)}return n}if("xlink:href"===n&&"#"!==r[0]){const n=jt(t,r);return"image"===e&&n.startsWith("data:")?Wt(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(Nt);if(","===o.slice(-1))o=jt(t,o.substring(0,o.length-1)),i.push(o);else{let r="";o=jt(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?Rt(r,$t(t)):"object"===e&&"data"===n?jt(t,r):r:jt(t,r)}function Bt(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===bt(e)}function Ht(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Ht(x.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Ht(x.parentNode(t),e,n)}function Ut(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(Ht(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 qt(t,e,n){const r=t.removeEventListener;"function"==typeof r&&r.call(t,e,n)}var zt=new Map;function Gt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Zt(t){return null==t?"":t.toLowerCase()}var Vt=!1,Xt=!1;function Yt(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:R=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:O=!1,depth:T=0,maxDepth:F=50}=e;let{needsMask:L}=e,{preserveWhiteSpace:N=!0}=e;if(T>=F)return Xt=!0,Vt||(Vt=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${F}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;L||(L=Ut(t,s,a,void 0===L)),E>0&&(_.nodeCount+=1);const D=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 Et.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];Bt(g,r.name)||(k[r.name]=Pt(n,g,bt(r.name),r.value,t,c))}if("link"===g&&o&&!b){let e=t.sheet;if(!e){const r=function(t){return t.href}(t);r&&(e=Gt(n,r),!e&&r.includes(".css"))&&(e=Gt(n,window.location.origin+"/"+r.replace(window.location.href,"")))}let r=null;e&&(Y(e)?E>0&&(W.push(t),P+=1):r=lt(e)),r&&(delete k.rel,delete k.href,k._cssText=r)}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()))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;if(new Uint32Array((kt in i?i[kt]:i).call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r)).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)}let C,I=!1;if("img"===g&&d){At||(At=n.createElement("canvas"),Ot=At.getContext("2d"));const e=t,r=e.currentSrc||e.getAttribute("src")||"<unknown-src>",i=e.crossOrigin,o=(e,n)=>I?wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{qt(e,"load",s);try{At.width=e.naturalWidth,At.height=e.naturalHeight,Ot.drawImage(e,0,0);const t=At.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 M,R,A;const{width:e,height:r,left:i,top:o}=t.getBoundingClientRect(),s=null===(M=n.defaultView)||void 0===M?void 0:M.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===(A=n.defaultView)||void 0===A?void 0:A.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)}));I=!0;try{customElements.get(g)&&(C=!0)}catch(t){}return{type:f.Element,tagName:g,attributes:k,childNodes:[],isSVG:(O=t,Boolean("svg"===O.tagName||O.ownerSVGElement)||void 0),needBlock:b,rootId:v,isCustom:C};var O}(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=Rt(a,$t(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:A,newlyAddedElement:O});if(!D)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&&(Zt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Zt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Zt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Zt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Zt(t.attributes.property).match(/^(og|twitter|fb):/)||Zt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Zt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Zt(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(Zt(t.attributes.name))||Zt(t.attributes.property).match(/^article:/)||Zt(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(Zt(t.attributes.name)))return!0}}return!1}(D,y)||!N&&D.type===f.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Lt();const B=Object.assign(D,{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:R,keepIframeSrcFn:A,depth:T+1,maxDepth:F};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=Yt(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=Yt(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),qt(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?qt(t,"load",s):(r=!0,qt(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),qt(t,"load",s)}}return t.addEventListener("load",s),()=>{qt(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&S){const n=Yt(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:R,keepIframeSrcFn:A,depth:T+1,maxDepth:F});n&&S(t,n)}},C);null==I||I(t,e)}return B.type===f.Element&&"link"===B.tagName&&"stylesheet"===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 E=()=>{if(!O){O=!0;try{(()=>{if(M){const e=Yt(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:R,keepIframeSrcFn:A,depth:T,maxDepth:F});e&&M(t,e)}})()}finally{zt.delete(e),x.abort()}}},_=setTimeout(E,f);x.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",E,{signal:x.signal,once:!0}),zt.set(e,x)}(t,0,R),B}function Jt(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 Qt=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 Kt(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>te(n,t,e,r)}function te(t,e,n,r){ee(()=>{const i=t.removeEventListener;"function"==typeof i&&(void 0!==r?i.call(t,e,n,r):i.call(t,e,n))})}function ee(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ne(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var re="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.",ie={map:{},getId(){return console.error(re),-1},getNode(){return console.error(re),null},removeNodeFromMap(){console.error(re)},has(){return console.error(re),!1},reset(){console.error(re)}};function oe(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 se(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)}}}),()=>se(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ie=new Proxy(ie,{get(t,e,n){return"map"===e&&console.error(re),Reflect.get(t,e,n)}}));var ae=Date.now;function le(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 ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function de(t){return t?t.nodeType===t.ELEMENT_NODE?t:x.parentElement(t):null}function he(t,e,n,r){if(!t)return!1;const i=de(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(Ht(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 fe(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function me(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||me(r,e))}function pe(t){return Boolean(t.changedTouches)}function ye(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ve(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function be(t){return!!t&&(t instanceof Qt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(x.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ae=()=>(new Date).getTime());var ge=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 we(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 ke(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=we(n);)n=e;return n}(t);return x.contains(e,n)}(t)}function Se(t){return"__ln"in t}var Ce,Ie=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&&Se(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&&Se(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--)}},Me=(t,e)=>`${t}@${e}`,xe=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=R(),e=T();try{this.processBufferedMutations()}finally{n=R()-t,r=e,E>0||F(n,null!=r?r:A)||n>H.slowestBatchMs&&(H.slowestBatchMs=n)}var n,r}),et(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new Ie,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||!ke(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=rt(a)?this.mirror.getId(we(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=>{ye(t,this.mirror)&&this.iframeManager.addIframe(t),ve(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),be(t)&&!he(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=Yt(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)Ae(this.removesSubTreeCache,t)&&!this.movedSet.has(x.parentNode(t))||o(t);for(const t of this.addedSet)Oe(this.droppedSet,t)||Ae(this.removesSubTreeCache,t)?Oe(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(!fe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=x.textContent(t.target);he(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ut(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,de(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(he(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"),!Bt(i,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Pt(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(he(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);he(t.target,this.blockClass,this.blockSelector,!1)||fe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Re(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||me(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Me(n,r)]?Re(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(fe(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[Me(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!he(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(be(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),he(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 Re(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 Ae(t,e,n){return 0!==t.size&&function(t,e){const n=x.parentNode(e);return!!n&&t.has(n)}(t,e)}function Oe(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 Te(t){Ce=t}function Fe(){Ce=void 0}var Ee=(t,e="rrweb")=>Ce?(...n)=>{try{return t(...n)}catch(t){if(Ce&&!0===Ce(t,e))return;throw t}}:t,Le=[];function Ne(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 _e(t,e){const n=new xe;let r;n.init(t);try{r=new(I())(Ee(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),Le.push(n),{observer:r,buffer:n}}catch(t){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function De({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const s=new Map,a=o=>{const a=Ne(o);if(!a||he(a,r,i,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=le(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=[Kt("scroll",Ee(oe(Ee(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Kt("scrollend",Ee(a),e)),()=>l.forEach(t=>t())}function je(t,e){for(let n=Le.length-1;n>=0;n--){const r=Le[n];if(!r)continue;let i=r.bufferBelongsToIframe(t);!i&&e&&e.has(r.bufferDoc())&&(i=!0),i&&(r.reset(),Le.splice(n,1))}}var $e=["INPUT","TEXTAREA","SELECT"],We=new WeakMap;function Pe(t){return function t(e,n){if(qe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qe("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 Be(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function He({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}}),Ee(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Ue(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=Ee(()=>{try{if(o)try{o.destroy(),o.reset()}finally{const t=Le.indexOf(o);-1!==t&&Le.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ne(s)}});try{if(t.recordDOM){const e=_e(t,t.doc);i=e.observer,o=e.buffer}if(s.push(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=oe(Ee(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),c=Ee(oe(Ee(t=>{const e=Ne(t),{clientX:n,clientY:i}=pe(t)?t.changedTouches[0]:t;s||(s=ae()),a.push({x:n,y:i,id:r.getId(e),timeOffset:ae()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)}),i,{trailing:!1})),d=[Kt("mousemove",c,n),Kt("touchmove",c,n),Kt("drag",c,n)];return Ee(()=>{d.forEach(t=>t())})}(t)),s.push(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=Ne(s);if(he(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 pe(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=pe(s)?s.changedTouches[0]:s;if(!f)return;const m=n.getId(a),{clientX:p,clientY:y}=f;Ee(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(Kt(a,h,e))}),Ee(()=>{l.forEach(t=>t())})}(t)),s.push(De(t)),s.push(function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return Kt("resize",Ee(oe(Ee(()=>{const e=ue(),i=ce();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200)),e)}(t,{win:n})),s.push(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=Ne(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>$e.indexOf(h)||he(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=We.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){We.set(e,i);const o=n.getId(e);Ee(t)(r(r({},i),{},{id:o}))}}const m=("last"===c.input?["change"]:["input","change"]).map(t=>Kt(t,Ee(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=>se(t[0],t[1],{set(){Ee(h)({target:this,isTrusted:!1})}},!1,p))),Ee(()=>{ne(m)})}(t)),s.push(function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Ee(o=>oe(Ee(i=>{const s=Ne(i);if(!s||he(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=[Kt("play",s(h.Play),o),Kt("pause",s(h.Pause),o),Kt("seeked",s(h.Seeked),o),Kt("volumechange",s(h.VolumeChange),o),Kt("ratechange",s(h.RateChange),o)];return Ee(()=>{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),s.push(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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:Ee((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}=Be(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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={};ze("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(ze("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),ze("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),ze("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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Be(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Pe(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Be(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Pe(o),a];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ee(()=>{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})),s.push(He(t,t.doc)),s.push(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:Ee((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}=Be(f,e,r.styleMirror);if(m&&-1!==m||p&&-1!==p){const e=Pe(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:Ee((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}=Be(d,e,r.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=Pe(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ee(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&s.push(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(Ee(()=>{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),Ee(()=>{r.forEach(t=>t())})}(t))}s.push(function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=t;let s=!0;const a=Ee(()=>{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);he(o,r,i,!0)||he(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Kt("selectionchange",a)}(t)),s.push(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)s.push(e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function qe(t){return void 0!==window[t]}function ze(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Ge=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}},Ze=class{constructor(t){et(this,"iframes",new WeakMap),et(this,"crossOriginIframeMap",new WeakMap),et(this,"crossOriginIframeMirror",new Ge(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 Ge(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=>ee(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{te(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);ee(()=>{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)})}ee(()=>{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&&(te(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(te(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=>{ee(()=>this.mirror.removeNodeFromMap(t))}),ee(()=>je(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&&te(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{te(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}},Ve=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}=_e(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=Le.indexOf(a);-1!==t&&Le.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:De(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:He({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&&ke(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}},Xe="skip-frame";function Ye(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 Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ke=0;64>Ke;Ke++)Qe[Je.charCodeAt(Ke)]=Ke;var tn=function(t){var e,n=new Uint8Array(t),r=n.length,i="";for(e=0;r>e;e+=3)i+=Je[n[e]>>2],i+=Je[(3&n[e])<<4|n[e+1]>>4],i+=Je[(15&n[e+1])<<2|n[e+2]>>6],i+=Je[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},en=new Map,nn=(t,e,n)=>{if(!t||!sn(t,e)&&"object"!=typeof t)return;const r=function(t,e){let n=en.get(t);return n||(n=new Map,en.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 rn(t,e,n,r){if(t instanceof Array)return t.map(t=>rn(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:tn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[rn(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}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[rn(t.data,e,n,r),t.width,t.height]}:sn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:nn(t,e,n)}:t}var on=(t,e,n,r)=>t.map(t=>rn(t,e,n,r)),sn=(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]))},an=["webgl","webgl2"];function ln(t){return"nodeType"in t}function un(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||ln(s)&&he(s,e,n,!0))return i.call(this,o);ln(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(!he(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&an.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.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(t=>t())}}function cn(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(nn(l,o,this),this.canvas&&"tagName"in this.canvas&&!he(this.canvas,r,i,!0)){const t=on(a,o,this,s);n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=se(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!he(this.canvas,r,i,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var dn='(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',hn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",dn],{type:"text/javascript;charset=utf-8"});function fn(t){let e;try{if(e=hn&&(self.URL||self.webkitURL).createObjectURL(hn),!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(dn),{name:null==t?void 0:t.name})}}var mn,pn,yn,vn=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;const a="number"==typeof i.resolutionScale&&Number.isFinite(i.resolutionScale)?Math.min(1,Math.max(.1,i.resolutionScale)):1,l=un(e,n,r,!0),u=new Map;let c;try{c=new fn}catch(t){return}let h=!1;c.onerror=()=>{var t;h=!0,cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.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})};const f=1e3/t;let m,p=0;const y=t=>{var l;h||(p&&f>t-p||(p=t,(()=>{const t=[],i=e=>{try{e.querySelectorAll("canvas").forEach(e=>{he(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(!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 Xe}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ye))return Xe;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 void u.set(e,!1);const f=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:d,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:d});c.postMessage({id:e,bitmap:f,width:l,height:d,displayWidth:o,displayHeight:s,dataURLOptions:i.dataURLOptions,maskRegions:h},[f])}catch(t){u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),m=requestAnimationFrame(y))};m=requestAnimationFrame(y),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=un(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 he(this.canvas,n,r,!0)||setTimeout(()=>{const n=on(s,e,this,i);t(this.canvas,{type:d["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(i){const s=se(e.CanvasRenderingContext2D.prototype,a,{set(e){he(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(...cn(e.WebGLRenderingContext.prototype,d.WebGL,t,n,r,e,i)),void 0!==e.WebGL2RenderingContext&&o.push(...cn(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)}},bn=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 ge),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=R(),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),F(d=R()-l,null!=(h=u)?h:A)||(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=R();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(R()-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){}},gn=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(){}},wn=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var kn;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(kn=t.contentWindow)||void 0===kn?void 0:kn.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Sn=new yt,Cn=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function In(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 Mn(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:R={},canvasResolutionScale:A,canvasMasking:T,mousemoveWait:F,recordDOM:E=!0,recordCanvas:L=!1,recordCrossOriginIframes:N=!1,recordAfter:_=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:D=!1,collectFonts:j=!1,inlineImages:W=!1,plugins:P,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:H=new Set([]),attributeFilter:U,errorHandler:G}=t;Te(G);const Z=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},R),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!==F&&void 0===M.mousemove&&(M.mousemove=F),Sn.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=Jt(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};mn=(t,e)=>{var r;const s=t;if(s.timestamp=ae(),!(null===(r=Le[0])||void 0===r?void 0:r.isFrozen())||s.type===a.FullSnapshot||s.type===a.IncrementalSnapshot&&Cn.has(s.data.source)||Le.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)&&pn(!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=Sn.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()}mn({type:a.IncrementalSnapshot,data:r({source:l.Mutation},t)})},at=t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Scroll},t)}),lt=t=>mn({type:a.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),ut=new bn({mutationCb:st,adoptedStyleSheetCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S}),ct=new Ze({mirror:Sn,mutationCb:st,stylesheetManager:ut,recordCrossOriginIframes:N,wrappedEmit:mn});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:Sn,crossOriginIframeMirror:ct.crossOriginIframeMirror,crossOriginIframeStyleMirror:ct.crossOriginIframeStyleMirror});const dt=new gn,ht=null==T?void 0:T.configured;yn=new vn({recordCanvas:L,mutationCb:lt,win:window,blockClass:s,blockSelector:u,mirror:Sn,sampling:M.canvas,dataURLOptions:Z,resolutionScale:A,canvasMasking:T});const ft=new Ve({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:yn,keepIframeSrcFn:B,processedNodeManager:dt,attributeFilter:U},mirror:Sn});pn=(t=!1)=>{if(E){q(p);try{mn({type:a.Meta,data:{href:window.location.href,width:ce(),height:ue()}},t),null==e||e.cancel(),e=void 0,ut.reset(),ft.init(),Le.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:R}=e||{},A=!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=Jt(y);q(R);try{return Yt(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,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:Sn,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){ye(t,Sn)&&ct.addIframe(t),ve(t,Sn)&&ut.trackLinkElement(t),be(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(mn({type:a.FullSnapshot,data:{node:n,initialOffset:le(window)}},t),Le.forEach(t=>t.unlock()),yn.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&&ee(()=>{s=e.beginDeferredLinkInlining(n,Sn.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;ee(()=>{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=In(d):n())};return i=In(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,Sn.getId(document))}finally{z()}}};try{const t=[];t.push(Kt("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Kt(e,O,document));rt=e=>{const n=nt.get(e);n&&(n.forEach(e=>{ee(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),nt.delete(e))},it=()=>{for(const[t]of nt){const e=Sn.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 Ee(Ue)({mutationCb:st,mousemoveCb:(t,e)=>mn({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:at,viewportResizeCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:lt,fontCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){mn({type:a.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){mn({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:E,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,userTriggeredOnInput:D,collectFonts:j,doc:t,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:B,blockSelector:u,slimDOMOptions:Q,dataURLOptions:Z,mirror:Sn,iframeManager:ct,stylesheetManager:ut,shadowDomManager:ft,processedNodeManager:dt,canvasManager:yn,ignoreCSSAttributes:H,attributeFilter:U,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>mn({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},C)};ct.addLoadListener(e=>{try{const r=Sn.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=Sn.getId(t);null==rt||rt(e),je(t)});let i=-1;const o=t=>mn({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?Sn.getId(a):-1;l!==i&&(-1!==i&&o({id:i,enter:!1}),i=l,-1!==l&&o({id:l,enter:!0}))},y=()=>{pn();const e=n(document);"function"==typeof e&&t.push(e),t.push(Kt("fullscreenchange",p)),t.push(Kt("webkitfullscreenchange",p)),t.push(Kt("mozfullscreenchange",p)),t.push(Kt("MSFullscreenChange",p)),wn=!0};return["interactive","complete"].includes(document.readyState)?y():(t.push(Kt("DOMContentLoaded",()=>{mn({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===_&&y()})),t.push(Kt("load",()=>{mn({type:a.Load,data:{}}),"load"===_&&y()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ne(t),dt.destroy(),ct.removeLoadListener(),ct.destroy(),nt.clear(),ft.reset(),Sn.reset(),wn=!1,Fe()}}catch(t){console.warn(t)}}Mn.addCustomEvent=(t,e)=>{if(!wn)throw new Error("please add custom event after start recording");mn({type:a.Custom,data:{tag:t,payload:e}})},Mn.freezePage=()=>{Le.forEach(t=>t.freeze())},Mn.takeFullSnapshot=t=>{if(!wn)throw new Error("please take full snapshot after start recording");pn(t)},Mn.mirror=Sn,"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 xn=Object.create(null);function Rn(t){return Rn="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},Rn(t)}function An(t,e,n){return(e=function(t){var e=function(t){if("object"!=Rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}xn.Node=Object.create(null),xn.ShadowRoot=Object.create(null),xn.MutationObserver=Object.create(null),xn.Element=Object.create(null);var On=class{constructor(t){An(this,"fileName",void 0),An(this,"functionName",void 0),An(this,"lineNumber",void 0),An(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}`}},Tn=/(^|@)\S+:\d+/,Fn=/^\s*at .*(\S+:\d+|\(native\))/m,En=/^(eval@)?(\[native code])?$/,Ln={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Fn)?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(Fn)},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 On({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(En)},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 On({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(e,""));return new On({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 On({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 On({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(Tn)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new On({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Nn(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 _n(t){return Array.isArray(t)}function Dn(t){return"object"==typeof t&&null!==t&&!_n(t)}function jn(t,e){if(0===e)return!0;const n=Object.keys(t);for(const r of n)if(Dn(t[r])&&jn(t[r],e-1))return!0;return!1}function $n(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(Dn(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Dn(o)&&jn(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]=_n(r)?Nn(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 Wn={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 Pn(t,e,n){const r=n?Object.assign({},Wn,n):Wn,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:Ln.parse(e.error).map(t=>t.toString()),payload:[$n(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=[$n(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,i=[$n("Uncaught (in promise)",r.stringifyOptions),$n(e.reason,r.stringifyOptions)]),t({level:"error",trace:Ln.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=Ln.parse(new Error).map(t=>t.toString()).splice(1),i=("assert"===n?o.slice(1):o).map(t=>$n(t,r.stringifyOptions));s++,r.lengthThreshold>s?t({level:n,trace:e,payload:i}):s===r.lengthThreshold&&t({level:"warn",trace:[],payload:[$n("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 Bn=t=>({name:"rrweb/console@1",observer:Pn,options:t});const Hn=Object.prototype,Un=Hn.hasOwnProperty,qn=Hn.toString,zn=Array.isArray||function(t){return"[object Array]"===qn.call(t)},Gn=t=>"function"==typeof t,Zn=t=>t===Object(t)&&!zn(t),Vn=t=>void 0===t,Xn=t=>null===t,Yn=t=>Vn(t)||Xn(t),Jn=t=>"[object Boolean]"===qn.call(t),Qn=t=>t instanceof FormData,Kn="u">typeof window?window:void 0,tr="u">typeof globalThis?globalThis:Kn;null!=tr&&tr.XMLHttpRequest&&new tr.XMLHttpRequest;const er=(t,{debugEnabled:e}={})=>{const n={N(n,...r){Kn&&(Kn.POSTHOG_DEBUG||e)&&!Vn(Kn.console)&&Kn.console&&("__rrweb_original__"in Kn.console[n]?Kn.console[n].__rrweb_original__:Kn.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)=>er(`${t} ${e}`,n)};return n},nr=er("[PostHog.js]").createLogger,rr=()=>{},ir=t=>{var e;if(Gn(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function or(t,e,n){try{if(!(e in t))return rr;const r={next:t[e]},i=n(function(...t){return r.next.apply(this,t)});return Gn(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=ir(n);for(;o;){if(o.next===i)return void(o.next=r.next);n=o.next,o=ir(n)}}}catch(t){return rr}}function sr(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 ar=1e6,lr={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:ar,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},ur=new WeakSet,cr=nr("[Recorder]"),dr=t=>"navigation"===t.entryType,hr=t=>"resource"===t.entryType;function fr(t,e){return!!e&&(Jn(e)||e[t])}function mr(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 pr=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function yr({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:!!mr(e)&&t(e.url)}catch(t){return!1}}(r))return!1;if(i(pr))return!1;if(Jn(e))return!0;if(zn(e))return i(e);const o=e[t];return Jn(o)?o:i(o)}function vr(t,e,n,r,i){return br.apply(this,arguments)}function br(){return br=o(function*(t,e,n,r,i,o=0){if(o>10)return cr.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=>hr(t)&&t.initiatorType===e&&(Vn(r)||t.startTime>=r)&&(Vn(i)||i>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),vr(t,e,n,r,i,o+1))}),br.apply(this,arguments)}function gr({body:t,options:e,url:n}){if(Yn(t))return null;const{hostname:r,isHostDenied:i}=sr(n,e);if(i)return r+" is in deny list";if("[object String]"==qn.call(t))return t;if(o=t,"u">typeof Document&&o instanceof Document)return t.textContent;var o;if(Qn(t))return function(t,e="&"){let n,r;const i=[];return function(t,e){if(!Yn(t))if(zn(t))t.forEach(e);else if(Qn(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Un.call(t,n)&&e(t[n],n)}(t,function(t,e){Vn(t)||Vn(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(Zn(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 wr=t=>!Xn(t)&&("navigation"===t.entryType||"resource"===t.entryType);function kr({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:Vn(s)?void 0:Math.round(s),endTime:Vn(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(wr(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 Sr=["video/","audio/"];function Cr(t){return Zn(t)&&Gn(t.getReader)&&Gn(t.tee)}const Ir="[SessionReplay] Timeout while trying to read body",Mr="[SessionReplay] Failed to read body";function xr(t){return`${Mr}: ${t}`}function Rr(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function Ar(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Ir),500);try{t.clone().text().then(t=>e(t),t=>e(xr(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Mr)}})}(t);const n=function(t){var e;return Math.min(ar,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ar)}(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(Rr(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(Ir),500);let l;try{l=t.clone()}catch(t){return void s(Mr)}const u=l.body;if(!Cr(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(xr(t)))}catch(t){s(Mr)}return}try{r=u.getReader()}catch(t){return void s(Mr)}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(Rr(e));d+=r.byteLength,c.push(r)}t()}},t=>s(xr(t)))}()})}(t,n)}function Or(){return(Or=o(function*({r:t,options:e,url:n}){const{hostname:r,isHostDenied:i}=sr(n,e);return i?Promise.resolve(r+" is in deny list"):Ar(t,e)})).apply(this,arguments)}function Tr(){return(Tr=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=Sr.some(t=>null==i?void 0:i.startsWith(t));if(i&&o)return`Content-Type ${i} is not supported`;const{hostname:s,isHostDenied:a}=sr(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Xn(r)?Ar(t,e):Promise.resolve(r)})).apply(this,arguments)}let Fr=null;function Er(t,e,n){if(!("performance"in e))return()=>{};if(Fr)return cr.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},lr,n):lr,s=e=>{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&&ur.has(t))(r)),r&&n.push(r)}),n.length>0&&t(r(r({},e),{},{requests:n}))},a=function(t,e,n){n.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>dr(t)||hr(t)&&n.initiatorTypes.includes(t.initiatorType)).flatMap(t=>kr({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});const r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>dr(t)||hr(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>kr({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()}}(s,e,i);let l=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(l=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=fr("request",n.recordHeaders),i=fr("response",n.recordHeaders),o=or(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=>(yr({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=gr({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),yr({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(l.responseBody=gr({body:d.response,options:n,url:a})),vr(e,"xmlhttprequest",o.url,u,c).then(e=>{t({requests:kr({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){cr.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),u=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=fr("request",n.recordHeaders),i=fr("response",n.recordHeaders),s=or(e,"fetch",s=>function(){var a=o(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return cr.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),!Cr(null==a?void 0:a.body)&&yr({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return Or.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){cr.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=mr(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),yr({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return Tr.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){cr.error("Failed to record fetch response for network capture",t)}return u}finally{vr(e,"fetch",l.url,d,h).then(e=>{t({requests:kr({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()}}(s,e,i)),Fr=()=>{a(),l(),u(),Fr=null},Fr}const Lr=t=>({name:"rrweb/network@1",observer:Er,options:t}),Nr="undefined"!=typeof globalThis?globalThis:Kn;Nr&&"undefined"==typeof self&&(Nr.self=Nr),Nr&&"undefined"==typeof File&&(Nr.File=function(){});const _r=null!=Kn?Kn:{};_r.__PosthogExtensions__=_r.__PosthogExtensions__||{},_r.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Bn,getRecordNetworkPlugin:Lr},_r.__PosthogExtensions__.rrweb={record:Mn,version:"v2",wasMaxDepthReached:()=>Xt,resetMaxDepthState(){Xt=!1,Vt=!1},getLastSnapshotCost:()=>D,getMutationCost:()=>r({},H),resetSnapshotCostState(){E=0,L=0,N=0,A=0,_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},D=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},_r.rrweb={record:Mn,version:"v2"},_r.rrwebConsoleRecord={getRecordConsolePlugin:Bn},_r.getRecordNetworkPlugin=Lr}();
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 R(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var A=0;function O(){A+=1}function T(){return A}function F(t,e){return(e!==A||t>6e4)&&!0}var E=0,L=0,N=0,_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},D=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;(E+=1)>1||(_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},W=[],P=0,j=(e=t)&&e>0?e:null,L=R(),N=A)}function z(){return 0===E?D||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(E-=1)>0?_:(_.durationMs=R()-L,_.deferredStylesheetCount=P,U.deferredCount+=P,j=null,F(_.durationMs,N)?_: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===E)return;const e=G(t,null,0);_.cssRuleCount+=e,B>0&&(_.nonDeferrableCssRuleCount+=e)}function V(t){B+=1;try{return t()}finally{B-=1}}function X(t){E>0&&(_.stylesheetMs+=t)}function Y(t){if(0===E||null===j)return!1;const e=_.cssRuleCount-_.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?R():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(R()-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 Rt(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return ht(t)&&t.selectorText.includes(":")&&(n=ct(n)),e?Rt(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=Rt(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?Rt(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?Rt(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=R();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(R()-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&&gt.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 Rt(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 At,Ot,Tt=new Map,Ft=1,Et=new RegExp("[^a-z0-9-_:]");function Lt(){return Ft++}var Nt=/^[^ \t\n\r\u000c]+/,_t=/^[, \t\n\r\u000c]+/,Dt=new WeakMap;function jt(t,e){return e&&""!==e.trim()?$t(t,e):e}function $t(t,e){let n=Dt.get(t);if(n||(n=t.createElement("a"),Dt.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Wt(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 Pt(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=jt(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)),Wt(t,o)}if("image"===e)return Wt(n,o)}return n}if("xlink:href"===n&&"#"!==r[0]){const n=jt(t,r);return"image"===e&&n.startsWith("data:")?Wt(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(Nt);if(","===o.slice(-1))o=jt(t,o.substring(0,o.length-1)),i.push(o);else{let r="";o=jt(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?Rt(r,$t(t)):"object"===e&&"data"===n?jt(t,r):r:jt(t,r)}function Bt(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===bt(e)}function Ht(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Ht(x.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Ht(x.parentNode(t),e,n)}function Ut(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(Ht(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 qt(t,e,n){const r=t.removeEventListener;"function"==typeof r&&r.call(t,e,n)}var zt=new Map;function Gt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Zt(t){return null==t?"":t.toLowerCase()}var Vt=!1,Xt=!1;function Yt(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:R=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:O=!1,depth:T=0,maxDepth:F=50}=e;let{needsMask:L}=e,{preserveWhiteSpace:N=!0}=e;if(T>=F)return Xt=!0,Vt||(Vt=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${F}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;L||(L=Ut(t,s,a,void 0===L)),E>0&&(_.nodeCount+=1);const D=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 Et.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];Bt(g,r.name)||(k[r.name]=Pt(n,g,bt(r.name),r.value,t,c))}if("link"===g&&o&&!b){let e=t.sheet;if(!e){const r=function(t){return t.href}(t);r&&(e=Gt(n,r),!e&&r.includes(".css"))&&(e=Gt(n,window.location.origin+"/"+r.replace(window.location.href,"")))}let r=null;e&&(Y(e)?E>0&&(W.push(t),P+=1):r=lt(e)),r&&(delete k.rel,delete k.href,k._cssText=r)}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()))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;if(new Uint32Array((kt in i?i[kt]:i).call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r)).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)}let C,I=!1;if("img"===g&&d){At||(At=n.createElement("canvas"),Ot=At.getContext("2d"));const e=t,r=e.currentSrc||e.getAttribute("src")||"<unknown-src>",i=e.crossOrigin,o=(e,n)=>I?wt({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{qt(e,"load",s);try{At.width=e.naturalWidth,At.height=e.naturalHeight,Ot.drawImage(e,0,0);const t=At.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 M,R,A;const{width:e,height:r,left:i,top:o}=t.getBoundingClientRect(),s=null===(M=n.defaultView)||void 0===M?void 0:M.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===(A=n.defaultView)||void 0===A?void 0:A.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)}));I=!0;try{customElements.get(g)&&(C=!0)}catch(t){}return{type:f.Element,tagName:g,attributes:k,childNodes:[],isSVG:(O=t,Boolean("svg"===O.tagName||O.ownerSVGElement)||void 0),needBlock:b,rootId:v,isCustom:C};var O}(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=Rt(a,$t(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:A,newlyAddedElement:O});if(!D)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&&(Zt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Zt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Zt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Zt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Zt(t.attributes.property).match(/^(og|twitter|fb):/)||Zt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Zt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Zt(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(Zt(t.attributes.name))||Zt(t.attributes.property).match(/^article:/)||Zt(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(Zt(t.attributes.name)))return!0}}return!1}(D,y)||!N&&D.type===f.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Lt();const B=Object.assign(D,{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:R,keepIframeSrcFn:A,depth:T+1,maxDepth:F};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=Yt(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=Yt(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),qt(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?qt(t,"load",s):(r=!0,qt(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),qt(t,"load",s)}}return t.addEventListener("load",s),()=>{qt(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&S){const n=Yt(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:R,keepIframeSrcFn:A,depth:T+1,maxDepth:F});n&&S(t,n)}},C);null==I||I(t,e)}return B.type===f.Element&&"link"===B.tagName&&"stylesheet"===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 E=()=>{if(!O){O=!0;try{(()=>{if(M){const e=Yt(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:R,keepIframeSrcFn:A,depth:T,maxDepth:F});e&&M(t,e)}})()}finally{zt.delete(e),x.abort()}}},_=setTimeout(E,f);x.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",E,{signal:x.signal,once:!0}),zt.set(e,x)}(t,0,R),B}function Jt(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 Qt=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 Kt(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>te(n,t,e,r)}function te(t,e,n,r){ee(()=>{const i=t.removeEventListener;"function"==typeof i&&(void 0!==r?i.call(t,e,n,r):i.call(t,e,n))})}function ee(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ne(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var re="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.",ie={map:{},getId(){return console.warn(re),-1},getNode(){return console.warn(re),null},removeNodeFromMap(){console.warn(re)},has(){return console.warn(re),!1},reset(){console.warn(re)}};function oe(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 se(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)}}}),()=>se(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ie=new Proxy(ie,{get(t,e,n){return"map"===e&&console.warn(re),Reflect.get(t,e,n)}}));var ae=Date.now;function le(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 ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function de(t){return t?t.nodeType===t.ELEMENT_NODE?t:x.parentElement(t):null}function he(t,e,n,r){if(!t)return!1;const i=de(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(Ht(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 fe(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function me(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||me(r,e))}function pe(t){return Boolean(t.changedTouches)}function ye(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ve(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function be(t){return!!t&&(t instanceof Qt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(x.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ae=()=>(new Date).getTime());var ge=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 we(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 ke(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=we(n);)n=e;return n}(t);return x.contains(e,n)}(t)}function Se(t){return"__ln"in t}var Ce,Ie=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&&Se(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&&Se(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--)}},Me=(t,e)=>`${t}@${e}`,xe=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=R(),e=T();try{this.processBufferedMutations()}finally{n=R()-t,r=e,E>0||F(n,null!=r?r:A)||n>H.slowestBatchMs&&(H.slowestBatchMs=n)}var n,r}),et(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new Ie,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||!ke(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=rt(a)?this.mirror.getId(we(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=>{ye(t,this.mirror)&&this.iframeManager.addIframe(t),ve(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),be(t)&&!he(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=Yt(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)Ae(this.removesSubTreeCache,t)&&!this.movedSet.has(x.parentNode(t))||o(t);for(const t of this.addedSet)Oe(this.droppedSet,t)||Ae(this.removesSubTreeCache,t)?Oe(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(!fe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=x.textContent(t.target);he(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ut(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,de(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(he(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"),!Bt(i,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Pt(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(he(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);he(t.target,this.blockClass,this.blockSelector,!1)||fe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Re(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||me(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Me(n,r)]?Re(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(fe(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[Me(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!he(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(be(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),he(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 Re(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 Ae(t,e,n){return 0!==t.size&&function(t,e){const n=x.parentNode(e);return!!n&&t.has(n)}(t,e)}function Oe(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 Te(t){Ce=t}function Fe(){Ce=void 0}var Ee=(t,e="rrweb")=>Ce?(...n)=>{try{return t(...n)}catch(t){if(Ce&&!0===Ce(t,e))return;throw t}}:t,Le=[];function Ne(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 _e(t,e){const n=new xe;let r;n.init(t);try{r=new(I())(Ee(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),Le.push(n),{observer:r,buffer:n}}catch(t){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function De({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const s=new Map,a=o=>{const a=Ne(o);if(!a||he(a,r,i,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=le(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=[Kt("scroll",Ee(oe(Ee(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Kt("scrollend",Ee(a),e)),()=>l.forEach(t=>t())}function je(t,e){for(let n=Le.length-1;n>=0;n--){const r=Le[n];if(!r)continue;let i=r.bufferBelongsToIframe(t);!i&&e&&e.has(r.bufferDoc())&&(i=!0),i&&(r.reset(),Le.splice(n,1))}}var $e=["INPUT","TEXTAREA","SELECT"],We=new WeakMap;function Pe(t){return function t(e,n){if(qe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qe("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 Be(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function He({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}}),Ee(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Ue(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=Ee(()=>{try{if(o)try{o.destroy(),o.reset()}finally{const t=Le.indexOf(o);-1!==t&&Le.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ne(s)}});try{if(t.recordDOM){const e=_e(t,t.doc);i=e.observer,o=e.buffer}if(s.push(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=oe(Ee(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),c=Ee(oe(Ee(t=>{const e=Ne(t),{clientX:n,clientY:i}=pe(t)?t.changedTouches[0]:t;s||(s=ae()),a.push({x:n,y:i,id:r.getId(e),timeOffset:ae()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)}),i,{trailing:!1})),d=[Kt("mousemove",c,n),Kt("touchmove",c,n),Kt("drag",c,n)];return Ee(()=>{d.forEach(t=>t())})}(t)),s.push(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=Ne(s);if(he(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 pe(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=pe(s)?s.changedTouches[0]:s;if(!f)return;const m=n.getId(a),{clientX:p,clientY:y}=f;Ee(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(Kt(a,h,e))}),Ee(()=>{l.forEach(t=>t())})}(t)),s.push(De(t)),s.push(function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return Kt("resize",Ee(oe(Ee(()=>{const e=ue(),i=ce();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200)),e)}(t,{win:n})),s.push(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=Ne(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>$e.indexOf(h)||he(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=We.get(e);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){We.set(e,i);const o=n.getId(e);Ee(t)(r(r({},i),{},{id:o}))}}const m=("last"===c.input?["change"]:["input","change"]).map(t=>Kt(t,Ee(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=>se(t[0],t[1],{set(){Ee(h)({target:this,isTrusted:!1})}},!1,p))),Ee(()=>{ne(m)})}(t)),s.push(function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Ee(o=>oe(Ee(i=>{const s=Ne(i);if(!s||he(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=[Kt("play",s(h.Play),o),Kt("pause",s(h.Pause),o),Kt("seeked",s(h.Seeked),o),Kt("volumechange",s(h.VolumeChange),o),Kt("ratechange",s(h.RateChange),o)];return Ee(()=>{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),s.push(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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:Ee((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}=Be(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Be(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={};ze("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(ze("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),ze("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),ze("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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Be(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Pe(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:Ee((r,o,s)=>{const[a]=s,l=r.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Be(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Pe(o),a];i.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ee(()=>{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})),s.push(He(t,t.doc)),s.push(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:Ee((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}=Be(f,e,r.styleMirror);if(m&&-1!==m||p&&-1!==p){const e=Pe(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:Ee((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}=Be(d,e,r.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=Pe(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ee(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&s.push(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(Ee(()=>{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),Ee(()=>{r.forEach(t=>t())})}(t))}s.push(function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=t;let s=!0;const a=Ee(()=>{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);he(o,r,i,!0)||he(l,r,i,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Kt("selectionchange",a)}(t)),s.push(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)s.push(e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function qe(t){return void 0!==window[t]}function ze(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Ge=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}},Ze=class{constructor(t){et(this,"iframes",new WeakMap),et(this,"crossOriginIframeMap",new WeakMap),et(this,"crossOriginIframeMirror",new Ge(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 Ge(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=>ee(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{te(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);ee(()=>{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)})}ee(()=>{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&&(te(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(te(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=>{ee(()=>this.mirror.removeNodeFromMap(t))}),ee(()=>je(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&&te(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{te(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}},Ve=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}=_e(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=Le.indexOf(a);-1!==t&&Le.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:De(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:He({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&&ke(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}},Xe="skip-frame";function Ye(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 Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ke=0;64>Ke;Ke++)Qe[Je.charCodeAt(Ke)]=Ke;var tn=function(t){var e,n=new Uint8Array(t),r=n.length,i="";for(e=0;r>e;e+=3)i+=Je[n[e]>>2],i+=Je[(3&n[e])<<4|n[e+1]>>4],i+=Je[(15&n[e+1])<<2|n[e+2]>>6],i+=Je[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},en=new Map,nn=(t,e,n)=>{if(!t||!sn(t,e)&&"object"!=typeof t)return;const r=function(t,e){let n=en.get(t);return n||(n=new Map,en.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 rn(t,e,n,r){if(t instanceof Array)return t.map(t=>rn(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:tn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[rn(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}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[rn(t.data,e,n,r),t.width,t.height]}:sn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:nn(t,e,n)}:t}var on=(t,e,n,r)=>t.map(t=>rn(t,e,n,r)),sn=(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]))},an=["webgl","webgl2"];function ln(t){return"nodeType"in t}function un(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||ln(s)&&he(s,e,n,!0))return i.call(this,o);ln(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(!he(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&an.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 cn(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(nn(l,o,this),this.canvas&&"tagName"in this.canvas&&!he(this.canvas,r,i,!0)){const t=on(a,o,this,s);n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=se(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!he(this.canvas,r,i,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var dn='(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',hn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",dn],{type:"text/javascript;charset=utf-8"});function fn(t){let e;try{if(e=hn&&(self.URL||self.webkitURL).createObjectURL(hn),!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(dn),{name:null==t?void 0:t.name})}}var mn,pn,yn,vn=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;const a="number"==typeof i.resolutionScale&&Number.isFinite(i.resolutionScale)?Math.min(1,Math.max(.1,i.resolutionScale)):1,l=un(e,n,r,!0),u=new Map;let c;try{c=new fn}catch(t){return}let h=!1;c.onerror=()=>{var t;h=!0,cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.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})};const f=1e3/t;let m,p=0;const y=t=>{var l;h||(p&&f>t-p||(p=t,(()=>{const t=[],i=e=>{try{e.querySelectorAll("canvas").forEach(e=>{he(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(!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 Xe}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ye))return Xe;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 void u.set(e,!1);const f=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:d,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:d});c.postMessage({id:e,bitmap:f,width:l,height:d,displayWidth:o,displayHeight:s,dataURLOptions:i.dataURLOptions,maskRegions:h},[f])}catch(t){u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),m=requestAnimationFrame(y))};m=requestAnimationFrame(y),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=un(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 he(this.canvas,n,r,!0)||setTimeout(()=>{const n=on(s,e,this,i);t(this.canvas,{type:d["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(i){const s=se(e.CanvasRenderingContext2D.prototype,a,{set(e){he(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(...cn(e.WebGLRenderingContext.prototype,d.WebGL,t,n,r,e,i)),void 0!==e.WebGL2RenderingContext&&o.push(...cn(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)}},bn=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 ge),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=R(),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),F(d=R()-l,null!=(h=u)?h:A)||(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=R();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(R()-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){}},gn=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(){}},wn=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var kn;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(kn=t.contentWindow)||void 0===kn?void 0:kn.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var Sn=new yt,Cn=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function In(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 Mn(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:R={},canvasResolutionScale:A,canvasMasking:T,mousemoveWait:F,recordDOM:E=!0,recordCanvas:L=!1,recordCrossOriginIframes:N=!1,recordAfter:_=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:D=!1,collectFonts:j=!1,inlineImages:W=!1,plugins:P,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:H=new Set([]),attributeFilter:U,errorHandler:G}=t;Te(G);const Z=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},R),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!==F&&void 0===M.mousemove&&(M.mousemove=F),Sn.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=Jt(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};mn=(t,e)=>{var r;const s=t;if(s.timestamp=ae(),!(null===(r=Le[0])||void 0===r?void 0:r.isFrozen())||s.type===a.FullSnapshot||s.type===a.IncrementalSnapshot&&Cn.has(s.data.source)||Le.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)&&pn(!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=Sn.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()}mn({type:a.IncrementalSnapshot,data:r({source:l.Mutation},t)})},at=t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Scroll},t)}),lt=t=>mn({type:a.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),ut=new bn({mutationCb:st,adoptedStyleSheetCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S}),ct=new Ze({mirror:Sn,mutationCb:st,stylesheetManager:ut,recordCrossOriginIframes:N,wrappedEmit:mn});for(const t of P||[])t.getMirror&&t.getMirror({nodeMirror:Sn,crossOriginIframeMirror:ct.crossOriginIframeMirror,crossOriginIframeStyleMirror:ct.crossOriginIframeStyleMirror});const dt=new gn,ht=null==T?void 0:T.configured;yn=new vn({recordCanvas:L,mutationCb:lt,win:window,blockClass:s,blockSelector:u,mirror:Sn,sampling:M.canvas,dataURLOptions:Z,resolutionScale:A,canvasMasking:T});const ft=new Ve({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:yn,keepIframeSrcFn:B,processedNodeManager:dt,attributeFilter:U},mirror:Sn});pn=(t=!1)=>{if(E){q(p);try{mn({type:a.Meta,data:{href:window.location.href,width:ce(),height:ue()}},t),null==e||e.cancel(),e=void 0,ut.reset(),ft.init(),Le.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:R}=e||{},A=!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=Jt(y);q(R);try{return Yt(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,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:Sn,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){ye(t,Sn)&&ct.addIframe(t),ve(t,Sn)&&ut.trackLinkElement(t),be(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(mn({type:a.FullSnapshot,data:{node:n,initialOffset:le(window)}},t),Le.forEach(t=>t.unlock()),yn.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&&ee(()=>{s=e.beginDeferredLinkInlining(n,Sn.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;ee(()=>{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=In(d):n())};return i=In(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,Sn.getId(document))}finally{z()}}};try{const t=[];t.push(Kt("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Kt(e,O,document));rt=e=>{const n=nt.get(e);n&&(n.forEach(e=>{ee(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),nt.delete(e))},it=()=>{for(const[t]of nt){const e=Sn.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 Ee(Ue)({mutationCb:st,mousemoveCb:(t,e)=>mn({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:at,viewportResizeCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:lt,fontCb:t=>mn({type:a.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){mn({type:a.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){mn({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:E,recordCanvas:L,canvasMaskingConfigured:ht,inlineImages:W,userTriggeredOnInput:D,collectFonts:j,doc:t,maskInputFn:g,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:B,blockSelector:u,slimDOMOptions:Q,dataURLOptions:Z,mirror:Sn,iframeManager:ct,stylesheetManager:ut,shadowDomManager:ft,processedNodeManager:dt,canvasManager:yn,ignoreCSSAttributes:H,attributeFilter:U,plugins:(null==P||null===(e=P.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>mn({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},C)};ct.addLoadListener(e=>{try{const r=Sn.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=Sn.getId(t);null==rt||rt(e),je(t)});let i=-1;const o=t=>mn({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?Sn.getId(a):-1;l!==i&&(-1!==i&&o({id:i,enter:!1}),i=l,-1!==l&&o({id:l,enter:!0}))},y=()=>{pn();const e=n(document);"function"==typeof e&&t.push(e),t.push(Kt("fullscreenchange",p)),t.push(Kt("webkitfullscreenchange",p)),t.push(Kt("mozfullscreenchange",p)),t.push(Kt("MSFullscreenChange",p)),wn=!0};return["interactive","complete"].includes(document.readyState)?y():(t.push(Kt("DOMContentLoaded",()=>{mn({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===_&&y()})),t.push(Kt("load",()=>{mn({type:a.Load,data:{}}),"load"===_&&y()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ne(t),dt.destroy(),ct.removeLoadListener(),ct.destroy(),nt.clear(),ft.reset(),Sn.reset(),wn=!1,Fe()}}catch(t){console.warn(t)}}Mn.addCustomEvent=(t,e)=>{if(!wn)throw new Error("please add custom event after start recording");mn({type:a.Custom,data:{tag:t,payload:e}})},Mn.freezePage=()=>{Le.forEach(t=>t.freeze())},Mn.takeFullSnapshot=t=>{if(!wn)throw new Error("please take full snapshot after start recording");pn(t)},Mn.mirror=Sn,"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 xn=Object.create(null);function Rn(t){return Rn="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},Rn(t)}function An(t,e,n){return(e=function(t){var e=function(t){if("object"!=Rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}xn.Node=Object.create(null),xn.ShadowRoot=Object.create(null),xn.MutationObserver=Object.create(null),xn.Element=Object.create(null);var On=class{constructor(t){An(this,"fileName",void 0),An(this,"functionName",void 0),An(this,"lineNumber",void 0),An(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}`}},Tn=/(^|@)\S+:\d+/,Fn=/^\s*at .*(\S+:\d+|\(native\))/m,En=/^(eval@)?(\[native code])?$/,Ln={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Fn)?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(Fn)},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 On({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(En)},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 On({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(e,""));return new On({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 On({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 On({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(Tn)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new On({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Nn(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 _n(t){return Array.isArray(t)}function Dn(t){return"object"==typeof t&&null!==t&&!_n(t)}function jn(t,e){if(0===e)return!0;const n=Object.keys(t);for(const r of n)if(Dn(t[r])&&jn(t[r],e-1))return!0;return!1}function $n(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(Dn(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Dn(o)&&jn(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]=_n(r)?Nn(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 Wn={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 Pn(t,e,n){const r=n?Object.assign({},Wn,n):Wn,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:Ln.parse(e.error).map(t=>t.toString()),payload:[$n(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=[$n(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,i=[$n("Uncaught (in promise)",r.stringifyOptions),$n(e.reason,r.stringifyOptions)]),t({level:"error",trace:Ln.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=Ln.parse(new Error).map(t=>t.toString()).splice(1),i=("assert"===n?o.slice(1):o).map(t=>$n(t,r.stringifyOptions));s++,r.lengthThreshold>s?t({level:n,trace:e,payload:i}):s===r.lengthThreshold&&t({level:"warn",trace:[],payload:[$n("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 Bn=t=>({name:"rrweb/console@1",observer:Pn,options:t});const Hn=Object.prototype,Un=Hn.hasOwnProperty,qn=Hn.toString,zn=Array.isArray||function(t){return"[object Array]"===qn.call(t)},Gn=t=>"function"==typeof t,Zn=t=>t===Object(t)&&!zn(t),Vn=t=>void 0===t,Xn=t=>null===t,Yn=t=>Vn(t)||Xn(t),Jn=t=>"[object Boolean]"===qn.call(t),Qn=t=>t instanceof FormData,Kn="u">typeof window?window:void 0,tr="u">typeof globalThis?globalThis:Kn;null!=tr&&tr.XMLHttpRequest&&new tr.XMLHttpRequest;const er=(t,{debugEnabled:e}={})=>{const n={N(n,...r){Kn&&(Kn.POSTHOG_DEBUG||e)&&!Vn(Kn.console)&&Kn.console&&("__rrweb_original__"in Kn.console[n]?Kn.console[n].__rrweb_original__:Kn.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)=>er(`${t} ${e}`,n)};return n},nr=er("[PostHog.js]").createLogger,rr=()=>{},ir=t=>{var e;if(Gn(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function or(t,e,n){try{if(!(e in t))return rr;const r={next:t[e]},i=n(function(...t){return r.next.apply(this,t)});return Gn(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=ir(n);for(;o;){if(o.next===i)return void(o.next=r.next);n=o.next,o=ir(n)}}}catch(t){return rr}}function sr(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 ar=1e6,lr={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:ar,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},ur=new WeakSet,cr=nr("[Recorder]"),dr=t=>"navigation"===t.entryType,hr=t=>"resource"===t.entryType;function fr(t,e){return!!e&&(Jn(e)||e[t])}function mr(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 pr=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function yr({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:!!mr(e)&&t(e.url)}catch(t){return!1}}(r))return!1;if(i(pr))return!1;if(Jn(e))return!0;if(zn(e))return i(e);const o=e[t];return Jn(o)?o:i(o)}function vr(t,e,n,r,i){return br.apply(this,arguments)}function br(){return br=o(function*(t,e,n,r,i,o=0){if(o>10)return cr.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=>hr(t)&&t.initiatorType===e&&(Vn(r)||t.startTime>=r)&&(Vn(i)||i>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),vr(t,e,n,r,i,o+1))}),br.apply(this,arguments)}function gr({body:t,options:e,url:n}){if(Yn(t))return null;const{hostname:r,isHostDenied:i}=sr(n,e);if(i)return r+" is in deny list";if("[object String]"==qn.call(t))return t;if(o=t,"u">typeof Document&&o instanceof Document)return t.textContent;var o;if(Qn(t))return function(t,e="&"){let n,r;const i=[];return function(t,e){if(!Yn(t))if(zn(t))t.forEach(e);else if(Qn(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Un.call(t,n)&&e(t[n],n)}(t,function(t,e){Vn(t)||Vn(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(Zn(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 wr=t=>!Xn(t)&&("navigation"===t.entryType||"resource"===t.entryType);function kr({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:Vn(s)?void 0:Math.round(s),endTime:Vn(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(wr(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 Sr=["video/","audio/"];function Cr(t){return Zn(t)&&Gn(t.getReader)&&Gn(t.tee)}const Ir="[SessionReplay] Timeout while trying to read body",Mr="[SessionReplay] Failed to read body";function xr(t){return`${Mr}: ${t}`}function Rr(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function Ar(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Ir),500);try{t.clone().text().then(t=>e(t),t=>e(xr(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Mr)}})}(t);const n=function(t){var e;return Math.min(ar,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ar)}(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(Rr(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(Ir),500);let l;try{l=t.clone()}catch(t){return void s(Mr)}const u=l.body;if(!Cr(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(xr(t)))}catch(t){s(Mr)}return}try{r=u.getReader()}catch(t){return void s(Mr)}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(Rr(e));d+=r.byteLength,c.push(r)}t()}},t=>s(xr(t)))}()})}(t,n)}function Or(){return(Or=o(function*({r:t,options:e,url:n}){const{hostname:r,isHostDenied:i}=sr(n,e);return i?Promise.resolve(r+" is in deny list"):Ar(t,e)})).apply(this,arguments)}function Tr(){return(Tr=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=Sr.some(t=>null==i?void 0:i.startsWith(t));if(i&&o)return`Content-Type ${i} is not supported`;const{hostname:s,isHostDenied:a}=sr(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Xn(r)?Ar(t,e):Promise.resolve(r)})).apply(this,arguments)}let Fr=null;function Er(t,e,n){if(!("performance"in e))return()=>{};if(Fr)return cr.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},lr,n):lr,s=e=>{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&&ur.has(t))(r)),r&&n.push(r)}),n.length>0&&t(r(r({},e),{},{requests:n}))},a=function(t,e,n){n.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>dr(t)||hr(t)&&n.initiatorTypes.includes(t.initiatorType)).flatMap(t=>kr({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});const r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>dr(t)||hr(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>kr({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()}}(s,e,i);let l=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(l=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=fr("request",n.recordHeaders),i=fr("response",n.recordHeaders),o=or(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=>(yr({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=gr({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),yr({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(l.responseBody=gr({body:d.response,options:n,url:a})),vr(e,"xmlhttprequest",o.url,u,c).then(e=>{t({requests:kr({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){cr.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),u=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=fr("request",n.recordHeaders),i=fr("response",n.recordHeaders),s=or(e,"fetch",s=>function(){var a=o(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return cr.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),!Cr(null==a?void 0:a.body)&&yr({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return Or.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){cr.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=mr(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),yr({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return Tr.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){cr.error("Failed to record fetch response for network capture",t)}return u}finally{vr(e,"fetch",l.url,d,h).then(e=>{t({requests:kr({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()}}(s,e,i)),Fr=()=>{a(),l(),u(),Fr=null},Fr}const Lr=t=>({name:"rrweb/network@1",observer:Er,options:t}),Nr="undefined"!=typeof globalThis?globalThis:Kn;Nr&&"undefined"==typeof self&&(Nr.self=Nr),Nr&&"undefined"==typeof File&&(Nr.File=function(){});const _r=null!=Kn?Kn:{};_r.__PosthogExtensions__=_r.__PosthogExtensions__||{},_r.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Bn,getRecordNetworkPlugin:Lr},_r.__PosthogExtensions__.rrweb={record:Mn,version:"v2",wasMaxDepthReached:()=>Xt,resetMaxDepthState(){Xt=!1,Vt=!1},getLastSnapshotCost:()=>D,getMutationCost:()=>r({},H),resetSnapshotCostState(){E=0,L=0,N=0,A=0,_={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},D=null,j=null,W=[],P=0,B=0,H={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},_r.rrweb={record:Mn,version:"v2"},_r.rrwebConsoleRecord={getRecordConsolePlugin:Bn},_r.getRecordNetworkPlugin=Lr}();
2
2
  //# sourceMappingURL=recorder-v2.js.map