posthog-js 1.427.0 → 1.427.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.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.js.map +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/module.slim.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/src/utils/stack-overflow.d.ts +1 -0
- package/lib/package.json +1 -1
- package/lib/src/browser-surveys.js +1 -1
- package/lib/src/customizations/before-send.js +1 -1
- package/lib/src/customizations/posthogReduxLogger.js +4 -4
- package/lib/src/customizations/posthogReduxLogger.js.map +1 -1
- package/lib/src/entrypoints/array.full.es5.js +1 -1
- package/lib/src/entrypoints/exception-autocapture.js +31 -19
- package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
- package/lib/src/entrypoints/external-scripts-loader.js +3 -3
- package/lib/src/entrypoints/tracing-headers.js +5 -5
- package/lib/src/entrypoints/tracing-headers.js.map +1 -1
- package/lib/src/extensions/browser-client.js +1 -1
- package/lib/src/extensions/conversations/external/components/RichContent.js +1 -1
- package/lib/src/extensions/conversations/external/index.js +5 -5
- package/lib/src/extensions/conversations/external/url-utils.js +2 -2
- package/lib/src/extensions/exception-autocapture/index.js +14 -8
- package/lib/src/extensions/exception-autocapture/index.js.map +1 -1
- package/lib/src/extensions/replay/external/config.js +1 -1
- package/lib/src/extensions/replay/external/config.js.map +1 -1
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +5 -5
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
- package/lib/src/extensions/replay/external/network-plugin.js +11 -11
- package/lib/src/extensions/replay/external/network-plugin.js.map +1 -1
- package/lib/src/extensions/segment-integration.js +1 -1
- package/lib/src/posthog-core.js +23 -16
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-exceptions.js +7 -2
- package/lib/src/posthog-exceptions.js.map +1 -1
- package/lib/src/posthog-logs.js +1 -1
- package/lib/src/posthog-metrics.js +1 -1
- package/lib/src/posthog-surveys.js +1 -1
- package/lib/src/utils/stack-overflow.d.ts +1 -0
- package/lib/src/utils/stack-overflow.js +11 -0
- package/lib/src/utils/stack-overflow.js.map +1 -0
- package/lib/src/web-experiments.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/dist/posthog-recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=e.apply(r,i);function o(e){t(a,n,s,o,u,"next",e)}function u(e){t(a,n,s,o,u,"throw",e)}o(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}var i=["type"],n=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}({}),s=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}({}),a=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}({}),o=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),u=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),l=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}({}),h=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 d(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase();var c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},f={};function p(t){if(f[t])return f[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))}))),s=t in v?v[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))})));if(n&&a)return f[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var p=h[t].prototype;return p?(d(u=navigator.userAgent,"AppleWebKit")&&!d(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),f[t]=p):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var m={};function g(t,e,r){var i,n=t+"."+String(r);if(m[n])return m[n].call(e);var s=p(t),a=null===(i=Object.getOwnPropertyDescriptor(s,r))||void 0===i?void 0:i.get;return a?(m[n]=a,a.call(e)):e[r]}var y={};function b(t,e,r){var i=t+"."+String(r);if(y[i])return y[i].bind(e);var n=p(t)[r];return"function"!=typeof n?e[r]:(y[i]=n,n.bind(e))}function w(){return p("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===s)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var _={childNodes:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),contains:(t,e)=>b("Node",t,"contains")(e),getRootNode:t=>b("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>b("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>b("Element",t,"querySelectorAll")(e),mutationObserver:w,patch:k},S=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function M(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var C=0,I=0;function R(){C+=1}function A(){return C}function T(t,e){return(e!==C||t>6e4)&&(I+=1,!0)}var x=0,E=0,O=0,F=S(),D=null,L=null,N=[],P=0,B=0,W={slowestBatchMs:0},z={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},j=t=>t&&t>0?t:null;function U(t){(x+=1)>1||(F=S(),N=[],P=0,L=j(t),E=M(),O=C)}function H(){return 0===x?D||S():(x-=1)>0?F:(F.durationMs=M()-E,F.deferredStylesheetCount=P,z.deferredCount+=P,L=null,T(F.durationMs,O)?F:D=F)}var q=32;function G(t,e,r){var i=t.length;if(r>=q)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=G(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=G(u,e,r+1))}}}catch(t){}}return i}function V(t){if(0!==x){var e=G(t,null,0);F.cssRuleCount+=e,B>0&&(F.nonDeferrableCssRuleCount+=e)}}function Z(t){B+=1;try{return t()}finally{B-=1}}function J(t){x>0&&(F.stylesheetMs+=t)}function Q(t){if(0===x||null===L)return!1;var e=F.cssRuleCount-F.nonDeferrableCssRuleCount;return e>=L||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),G(e,r,0)}catch(t){return 0}}(t)>L}function X(){z.failedCount+=1}function K(t){t>0&&(z.abandonedCount+=t)}function Y(t){return Y="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},Y(t)}function tt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Y(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Y(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function et(t){return t.nodeType===t.ELEMENT_NODE}function rt(t){var e=t&&"host"in t&&"mode"in t&&_.host(t)||null;return Boolean(e&&"shadowRoot"in e&&_.shadowRoot(e)===t)}function it(t){return"[object ShadowRoot]"==={}.toString.call(t)}function nt(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){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var at=0;function ot(t){var e=0===at,r=e?M():0;at+=1;try{var i=t.rules||t.cssRules;if(!i)return null;V(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),nt(Array.from(i,(t=>ut(t,n))).join(""))}catch(t){return null}finally{at-=1,e&&J(M()-r)}}function ut(t,e){if(ht(t)){var r;try{r=ot(t.styleSheet)||st(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return It(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return dt(t)&&t.selectorText.includes(":")&&(n=lt(n)),e?It(n,e):n}function lt(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ht(t){return"styleSheet"in t}function dt(t){return"selectorText"in t}var ct=/^-?[A-Za-z_][\w-]*$/,vt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ft(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||st(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=It(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&ht(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var 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(dt(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ct.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ct.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":vt.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?It(i,n):i,fixColons:"sheet"===r.kind&&dt(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&dt(r)&&r.selectorText.includes(":")&&(s=lt(s)),t.parts.push(t.sheetHref?It(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;V(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!ht(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;V(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=M(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?lt(h):h}else l=nt(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{J(M()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var pt=class{constructor(){tt(this,"idNodeMap",new Map),tt(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.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){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),et(t)){var r=_.shadowRoot(t);r&&this.removeNodeFromMap(r),"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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function mt(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&>(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function gt(t){return t.toLowerCase()}var yt=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 bt(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&yt.has(gt(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var wt="__rrweb_original__";function kt(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?gt(e):null}catch(t){return null}}var _t=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,St=/^(?:[a-z+]+:)?\/\//i,Mt=/^www\..*/i,Ct=/^(data:)([^,]*),(.*)/i;function It(t,e){return(t||"").replace(_t,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(St.test(u)||Mt.test(u))return"url("+l+u+l+")";if(Ct.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var Rt,At,Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",xt=4096,Et=1e5,Ot=10,Ft=new Map,Dt=1,Lt=new RegExp("[^a-z0-9-_:]");function Nt(){return Dt++}var Pt=/^[^ \t\n\r\u000c]+/,Bt=/^[, \t\n\r\u000c]+/,$t=new WeakMap;function Wt(t,e){return e&&""!==e.trim()?zt(t,e):e}function zt(t,e){var r=$t.get(t);if(r||(r=t.createElement("a"),$t.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function jt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Tt:t}(t,e.maxBase64ImageLength):t}function Ut(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,o=null===(a=n.sheet)||void 0===a?void 0:a.href;if(o)return o}var u=Wt(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(Et>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>xt||t.naturalHeight>xt)return e;var n=Ft.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(Ft.size>=Ot){var l=Ft.keys().next().value;void 0!==l&&Ft.delete(l)}return Ft.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),jt(l,s)}if("image"===e)return jt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Wt(t,i);return"image"===e&&h.startsWith("data:")?jt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Bt),e.length>r;){var s=i(Pt);if(","===s.slice(-1))s=Wt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Wt(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?It(i,zt(t)):"object"===e&&"data"===r?Wt(t,i):i:Wt(t,i)}function Ht(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function qt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&qt(_.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&qt(_.parentNode(t),e,r)}function Gt(t,e,r,i){var n;if(et(t)){if(!_.childNodes(n=t).length)return!1}else{if(null===_.parentElement(t))return!1;n=_.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(qt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Vt(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Zt=new Map;function Jt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Qt(t){return null==t?"":t.toLowerCase()}var Xt=!1,Kt=!1;function Yt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,d=e.inlineStylesheet,c=void 0===d||d,v=e.maskInputOptions,f=void 0===v?{}:v,p=e.maskTextFn,m=e.maskInputFn,g=e.maskAllElementAttributes,y=void 0!==g&&g,b=e.maskAttributeFn,w=e.slimDOMOptions,k=e.dataURLOptions,S=void 0===k?{}:k,M=e.inlineImages,C=void 0!==M&&M,I=e.recordCanvas,R=void 0!==I&&I,A=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,O=e.iframeLoadTimeout,D=void 0===O?5e3:O,L=e.onIframeListenerRegistered,B=e.onStylesheetLoad,W=e.stylesheetLoadTimeout,z=void 0===W?5e3:W,j=e.keepIframeSrcFn,U=void 0===j?()=>!1:j,H=e.newlyAddedElement,q=void 0!==H&&H,G=e.depth,V=void 0===G?0:G,J=e.maxDepth,X=void 0===J?50:J,K=e.needsMask,Y=e.preserveWhiteSpace,tt=void 0===Y||Y;if(V>=X)return Kt=!0,Xt||(Xt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+X+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;K||(K=Gt(t,a,o,void 0===K)),x>0&&(F.nodeCount+=1);var nt,st=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,d=e.maskInputFn,c=e.maskAllElementAttributes,v=void 0!==c&&c,f=e.maskAttributeFn,p=e.dataURLOptions,m=void 0===p?{}:p,g=e.inlineImages,y=e.recordCanvas,b=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,k=e.newlyAddedElement,S=void 0!==k&&k,M=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,a=e.maskInputFn,o=e.maskAllElementAttributes,u=void 0!==o&&o,l=e.maskAttributeFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,f=e.recordCanvas,p=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,g=e.newlyAddedElement,y=void 0!==g&&g,b=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),k=function(t){if(t instanceof HTMLFormElement)return"form";var e=gt(t.tagName);return Lt.test(e)?"div":e}(t),S=new Set,M={},C=t.attributes.length,I=0;C>I;I++){var R=t.attributes[I];Ht(k,R.name)||(M[R.name]=Ut(r,k,gt(R.name),R.value,t,c))}if("link"===k&&i&&!w){var A=t.sheet;if(!A){var T=function(t){return t.href}(t);T&&!(A=Jt(r,T))&&T.includes(".css")&&(A=Jt(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;A&&(Q(A)?x>0&&(N.push(t),P+=1):E=ot(A)),E&&(delete M.rel,delete M.href,M._cssText=E)}if("style"===k&&t.sheet&&!(t.innerText||_.textContent(t)||"").trim().length){var O=Z((()=>ot(t.sheet)));O&&(M._cssText=O)}if("input"===k||"textarea"===k||"select"===k){var F=t.value,D=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&F?M.value=mt({element:t,type:kt(t),tagName:k,value:F,maskInputOptions:s,maskInputFn:a}):D&&(M.checked=D)}if("option"===k&&(t.selected&&!s.select?M.selected=!0:delete M.selected),"dialog"===k&&t.open){try{M.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){M.rr_open_mode="modal",M.ph_rr_could_not_detect_modal=!0}S.add("rr_open_mode")}if("canvas"===k&&f&&!(null==p?void 0:p()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((wt in n?n[wt]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),B=r.createElement("canvas");B.width=t.width,B.height=t.height,L!==B.toDataURL(c.type,c.quality)&&(M.rr_dataURL=L)}var W,z,j=!1;if("img"===k&&v){Rt||(Rt=r.createElement("canvas"),At=Rt.getContext("2d"));var U=t,H=U.currentSrc||U.getAttribute("src")||"<unknown-src>",q=U.crossOrigin,G=(e,r)=>j?bt({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,V=()=>{Vt(U,"load",V);try{Rt.width=U.naturalWidth,Rt.height=U.naturalHeight,At.drawImage(U,0,0);var t=Rt.toDataURL(c.type,c.quality);M.rr_dataURL=G("rr_dataURL",t)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===U.crossOrigin&&(q?M.crossOrigin=G("crossOrigin",q):U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V)}if("audio"===k||"video"===k){var J=M;J.rr_mediaState=t.paused?"paused":"played",S.add("rr_mediaState"),J.rr_mediaCurrentTime=t.currentTime,J.rr_mediaPlaybackRate=t.playbackRate,J.rr_mediaMuted=t.muted,J.rr_mediaLoop=t.loop,J.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var X,K,Y,tt=t.getBoundingClientRect(),et=tt.width,rt=tt.height,it=tt.left,nt=tt.top,st=null===(X=r.defaultView)||void 0===X?void 0:X.getComputedStyle(t);M={class:M.class,rr_width:et+"px",rr_height:rt+"px",rr_left:Math.floor(it+((null===(K=r.defaultView)||void 0===K?void 0:K.scrollX)||0))+"px",rr_top:Math.floor(nt+((null===(Y=r.defaultView)||void 0===Y?void 0:Y.scrollY)||0))+"px"},S.add("rr_width"),S.add("rr_height"),S.add("rr_left"),S.add("rr_top"),st&&(M.rr_position=st.position||"static",S.add("rr_position"),st.transform&&"none"!==st.transform&&(M.rr_transform=st.transform,S.add("rr_transform")),st.display&&st.display.startsWith("inline")&&(M.rr_display=st.display,S.add("rr_display")))}if("iframe"!==k||m(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),u||l)for(var at of Object.entries(M)){var ut=at[0],lt=at[1];"string"!=typeof lt&&null!==lt||(M[ut]=bt({element:t,name:ut,value:lt,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:S.has(ut)}))}j=!0;try{customElements.get(k)&&(W=!0)}catch(t){}return{type:h.Element,tagName:k,attributes:M,childNodes:[],isSVG:(z=t,Boolean("svg"===z.tagName||z.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:W}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,maskAllElementAttributes:v,maskAttributeFn:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:S,rootId:M});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,s=_.parentNode(t),a=s&&s.tagName,o=_.textContent(t),u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&o){try{var d;if(t.nextSibling||t.previousSibling);else if(Q(s.sheet));else if(null===(d=s.sheet)||void 0===d?void 0:d.cssRules){var c=ot(s.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(o=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}o=It(o,zt(e.doc))}return l&&(o="SCRIPT_PLACEHOLDER"),!u&&!l&&o&&r&&(o=i?i(o,_.parentElement(t)):o.replace(/[\S]/g,"*")),{type:h.Text,textContent:o||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:M});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:h.Comment,textContent:_.textContent(t)||"",rootId:M};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,keepIframeSrcFn:U,newlyAddedElement:q});if(!st)return console.warn(t,"not serialized"),null;nt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.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,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Qt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Qt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Qt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Qt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Qt(t.attributes.property).match(/^(og|twitter|fb):/)||Qt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Qt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Qt(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(Qt(t.attributes.name))||Qt(t.attributes.property).match(/^article:/)||Qt(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(Qt(t.attributes.name)))return!0}}return!1}(st,w)||!tt&&st.type===h.Text&&!st.isStyle&&!st.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Nt();var at=Object.assign(st,{id:nt});if(i.add(t,at),-2===nt)return null;T&&T(t);var ut=!l;if(at.type===h.Element){ut=ut&&!at.needBlock,delete at.needBlock;var lt=_.shadowRoot(t);lt&&it(lt)&&(at.isShadowHost=!0)}if((at.type===h.Document||at.type===h.Element)&&ut){w.headWhitespace&&at.type===h.Element&&"head"===at.tagName&&(tt=!1);var ht={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:L,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V+1,maxDepth:X};if(at.type===h.Element&&"textarea"===at.tagName&&void 0!==at.attributes.value);else for(var dt of Array.from(_.childNodes(t))){var ct=Yt(dt,ht);ct&&at.childNodes.push(ct)}var vt=null;if(et(t)&&(vt=_.shadowRoot(t)))for(var ft of Array.from(_.childNodes(vt))){var pt=Yt(ft,ht);pt&&(it(vt)&&(pt.isShadow=!0),at.childNodes.push(pt))}}var yt=_.parentNode(t);if(yt&&rt(yt)&&it(yt)&&(at.isShadow=!0),at.type===h.Element&&"iframe"===at.tagName){var _t=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),Vt(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?Vt(t,"load",a):(o=!0,Vt(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),Vt(t,"load",a)}}return t.addEventListener("load",a),()=>{Vt(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var r=Yt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:L,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V+1,maxDepth:X});r&&E(t,r)}}),D);null==L||L(t,_t)}return at.type===h.Element&&"link"===at.tagName&&"stylesheet"===at.attributes.rel&&function(e,u,l){if(!Zt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,v=!1,g=()=>{if(!v){v=!0;try{(()=>{if(B){var e=Yt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V,maxDepth:X});e&&B(t,e)}})()}finally{Zt.delete(e),d.abort()}}},k=setTimeout(g,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",g,{signal:d.signal,once:!0}),Zt.set(e,d)}}}(t,0,z),at}function te(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 ee=class t{constructor(){tt(this,"parentElement",null),tt(this,"parentNode",null),tt(this,"ownerDocument",void 0),tt(this,"firstChild",null),tt(this,"lastChild",null),tt(this,"previousSibling",null),tt(this,"nextSibling",null),tt(this,"ELEMENT_NODE",1),tt(this,"TEXT_NODE",3),tt(this,"nodeType",void 0),tt(this,"nodeName",void 0),tt(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;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 re(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>ie(r,t,e,i)}function ie(t,e,r,i){ne((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function ne(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var se="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.",ae={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};function oe(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function ue(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>ue(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ae=new Proxy(ae,{get(t,e,r){return"map"===e&&console.error(se),Reflect.get(t,e,r)}}));var le=Date.now;function he(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=_.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(i=_.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function de(){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 ve(t){return t?t.nodeType===t.ELEMENT_NODE?t:_.parentElement(t):null}function fe(t,e,r,i){if(!t)return!1;var n=ve(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(qt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function pe(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function me(t,e){if(rt(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=_.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||me(i,e))}function ge(t){return Boolean(t.changedTouches)}function ye(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function be(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function we(t){return!!t&&(t instanceof ee&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(le=()=>(new Date).getTime());var ke=class{constructor(){tt(this,"id",1),tt(this,"styleIDMap",new WeakMap),tt(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 _e(t){var e,r=null;return"getRootNode"in t&&(null===(e=_.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(t))&&(r=_.host(_.getRootNode(t))),r}function Se(t){var e=t.ownerDocument;return!!e&&(_.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=_e(r);)r=e;return r}(t);return _.contains(e,r)}(t))}function Me(t){return"__ln"in t}var Ce,Ie=class{constructor(){tt(this,"length",0),tt(this,"head",null),tt(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Me(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Me(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}},Re=(t,e)=>t+"@"+e,Ae=class{constructor(){tt(this,"frozen",!1),tt(this,"locked",!1),tt(this,"texts",[]),tt(this,"attributes",[]),tt(this,"attributeMap",new WeakMap),tt(this,"generatedAttributes",new WeakMap),tt(this,"removes",[]),tt(this,"mapRemoves",[]),tt(this,"movedMap",{}),tt(this,"addedSet",new Set),tt(this,"movedSet",new Set),tt(this,"droppedSet",new Set),tt(this,"removesSubTreeCache",new Set),tt(this,"mutationCb",void 0),tt(this,"blockClass",void 0),tt(this,"blockSelector",void 0),tt(this,"maskTextClass",void 0),tt(this,"maskTextSelector",void 0),tt(this,"inlineStylesheet",void 0),tt(this,"maskInputOptions",void 0),tt(this,"maskTextFn",void 0),tt(this,"maskInputFn",void 0),tt(this,"maskAllElementAttributes",void 0),tt(this,"maskAttributeFn",void 0),tt(this,"keepIframeSrcFn",void 0),tt(this,"recordCanvas",void 0),tt(this,"canvasMaskingConfigured",void 0),tt(this,"inlineImages",void 0),tt(this,"slimDOMOptions",void 0),tt(this,"dataURLOptions",void 0),tt(this,"doc",void 0),tt(this,"mirror",void 0),tt(this,"iframeManager",void 0),tt(this,"stylesheetManager",void 0),tt(this,"shadowDomManager",void 0),tt(this,"canvasManager",void 0),tt(this,"processedNodeManager",void 0),tt(this,"unattachedDoc",void 0),tt(this,"canvasManagerReleased",!1),tt(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),tt(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=M(),i=A();try{this.processBufferedMutations()}finally{t=M()-r,e=i,x>0||T(t,null!=e?e:C)||t>W.slowestBatchMs&&(W.slowestBatchMs=t)}}})),tt(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new Ie,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=_.parentNode(n);if(s&&Se(n)&&"TEXTAREA"!==s.tagName){var a=rt(s)?this.mirror.getId(_e(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=Yt(n,{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),be(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),we(t)&&!fe(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(_.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)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)xe(this.removesSubTreeCache,s)&&!this.movedSet.has(_.parentNode(s))||n(s);for(var a of this.addedSet)Ee(this.droppedSet,a)||xe(this.removesSubTreeCache,a)?Ee(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(_.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(_.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=_.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=_.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=_.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,a=n[0],o=n[1];"string"!=typeof o&&null!==o||(e[a]=bt({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(a)}))}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={},(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&this.mutationCb(m)})),tt(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),tt(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(_.childNodes(t),(t=>_.textContent(t)||"")).join("");e.attributes.value=mt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kt(t),value:r,maskInputFn:this.maskInputFn})})),tt(this,"processMutation",(t=>{if(!pe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=_.textContent(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Gt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ve(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,s=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,s),o=s?i.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===a){var u=i,l=kt(u);o=mt({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(fe(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===i.tagName&&"src"===a;if(d&&!this.keepIframeSrcFn(o)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Ht(i.tagName,a)){var c,v=Ut(this.doc,gt(i.tagName),gt(a),o,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(o)&&(a="rr_src"),h.attributes[a]=v,null===(c=this.generatedAttributes.get(t.target))||void 0===c||c.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var m of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var g=p.getPropertyValue(m),y=p.getPropertyPriority(m);g!==f.style.getPropertyValue(m)||y!==f.style.getPropertyPriority(m)?h.styleDiff[m]=""===y?g:[g,y]:h._unchangedStyles[m]=[g,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(fe(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=>{var r=this.mirror.getId(e),i=rt(t.target)?this.mirror.getId(_.host(t.target)):this.mirror.getId(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||pe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Te(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||me(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Re(r,i)]?Te(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!rt(t.target)||!it(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),_.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),tt(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(pe(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Re(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);fe(t,this.blockClass,this.blockSelector,!1)||(_.childNodes(t).forEach((t=>this.genAdds(t))),we(t)&&_.childNodes(_.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}};function Te(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),_.childNodes(i).forEach((t=>r.push(t)))}}function xe(t,e,r){return 0!==t.size&&function(t,e,r){var i=_.parentNode(e);return!!i&&t.has(i)}(t,e)}function Ee(t,e){if(0===t.size)return!1;for(var r=_.parentNode(e);r;){if(t.has(r))return!0;r=_.parentNode(r)}return!1}var Oe=function(t,e){return void 0===e&&(e="rrweb"),Ce?function(){try{return t(...arguments)}catch(t){if(Ce&&!0===Ce(t,e))return;throw t}}:t},Fe=[];function De(t){try{if("composedPath"in t){var 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 Le(t,e){var r,i=new Ae;i.init(t);try{r=new(w())(Oe(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),Fe.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Ne(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=De(t);if(a&&!fe(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=he(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[re("scroll",Oe(oe(Oe((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(re("scrollend",Oe(u),r)),()=>l.forEach((t=>t()))}function Pe(t,e){for(var r=Fe.length-1;r>=0;r--){var i=Fe[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Fe.splice(r,1))}}}var Be=["INPUT","TEXTAREA","SELECT"],$e=new WeakMap;function We(t){return function t(e,r){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){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ze(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var je=5e3;function Ue(t,e){var r,i,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:_.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,o=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&o?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){var t;return null===(t=o.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=o.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!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Oe((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})}))):()=>{}}function He(t,e){void 0===e&&(e={});var i,n,u=t.doc.defaultView;if(!u)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var h=[],d=Oe((()=>{if(n){n.destroy(),n.reset();var e=Fe.indexOf(n);-1!==e&&Fe.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),h.forEach((t=>t()))}));try{if(t.recordDOM){var c=Le(t,t.doc);i=c.observer,n=c.buffer}if(h.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,u="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=oe(Oe((t=>{var r=Date.now()-a;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],a=null})),u),d=Oe(oe(Oe((t=>{var e=De(t),r=ge(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=le()),l.push({x:i,y:o,id:n.getId(e),timeOffset:le()-a}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?s.Drag:t instanceof MouseEvent?s.MouseMove:s.TouchMove)})),o,{trailing:!1})),c=[re("mousemove",d,i),re("touchmove",d,i),re("drag",d,i)];return Oe((()=>{c.forEach((t=>t()))}))}(t)),h.push(function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,u=t.blockSelector,l=t.sampling;if(!1===l.mouseInteraction)return()=>{};var h=!0===l.mouseInteraction||void 0===l.mouseInteraction?{}:l.mouseInteraction,d=[],c=null;return Object.keys(a).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==h[t])).forEach((t=>{var l=gt(t),h=(t=>i=>{var l=De(i);if(!fe(l,s,u,!0)){var h=null,d=t;if("pointerType"in i){switch(i.pointerType){case"mouse":h=o.Mouse;break;case"touch":h=o.Touch;break;case"pen":h=o.Pen}h===o.Touch&&(a[t]===a.MouseDown?d="TouchStart":a[t]===a.MouseUp&&(d="TouchEnd"))}else ge(i)&&(h=o.Touch);null!==h?(c=h,(d.startsWith("Touch")&&h===o.Touch||d.startsWith("Mouse")&&h===o.Mouse)&&(h=null)):a[t]===a.Click&&(h=c,c=null);var v=ge(i)?i.changedTouches[0]:i;if(v){var f=n.getId(l),p=v.clientX,m=v.clientY;Oe(e)(r({type:a[d],id:f,x:p,y:m},null!==h&&{pointerType:h}))}}})(t);if(window.PointerEvent)switch(a[t]){case a.MouseDown:case a.MouseUp:l=l.replace("mouse","pointer");break;case a.TouchStart:case a.TouchEnd:return}d.push(re(l,h,i))})),Oe((()=>{d.forEach((t=>t()))}))}(t)),h.push(Ne(t)),h.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return re("resize",Oe(oe(Oe((()=>{var t=de(),e=ce();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:u})),h.push(function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=De(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=_.parentElement(e)),e&&c&&Be.indexOf(c)>=0&&!fe(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,m=kt(e)||"";"radio"===m||"checkbox"===m?p=e.checked:(l[c.toLowerCase()]||l[m])&&(f=mt({element:e,maskInputOptions:l,tagName:c,type:m,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var g=e.name;"radio"===m&&g&&p&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=$e.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){$e.set(t,i);var a=n.getId(t);Oe(e)(r({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>re(t,Oe(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.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=>ue(t[0],t[1],{set(){Oe(c)({target:this,isTrusted:!1})}},!1,p)))),Oe((()=>{f.forEach((t=>t()))}))}(t)),h.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Oe((t=>oe(Oe((s=>{var a=De(s);if(a&&!fe(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[re("play",o(l.Play),a),re("pause",o(l.Pause),a),re("seeked",o(l.Seeked),a),re("volumechange",o(l.VolumeChange),a),re("ratechange",o(l.RateChange),a)];return Oe((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var v=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,je),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(u);h.push(v.reset),h.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]}))),u}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,removes:[{index:o}]}))),u}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=ze(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,(()=>r({id:d,styleId:c,replace:o})),(()=>{var t=ot(e);null!==t&&r({id:d,styleId:c,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,replaceSync:o}))),u}),"host")}));var d={};Ge("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ge("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ge("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ge("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=ze(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...We(e),u];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]})))}return u}),"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=ze(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...We(e),o];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,removes:[{index:c}]})))}return u}),"host")})})),Oe((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:u,mutationQueue:v})),h.push(Ue(t,t.doc)),h.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Oe(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=ze(v,i,s.styleMirror),p=f.id,m=f.styleId;if(p&&-1!==p||m&&-1!==m){var g=We(e.parentRule);o.queueMutation(v,(()=>r({id:p,styleId:m,set:{property:l,value:h,priority:d},index:g})))}return c}),"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Oe(((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=ze(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=We(e.parentRule);o.queueMutation(d,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),Oe((()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:u,mutationQueue:v})),t.collectFonts&&h.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=k(r.fonts,"add",(function(t){return function(r){return setTimeout(Oe((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),Oe((()=>{n.forEach((t=>t()))}))}(t))}for(var f of(h.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=Oe((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;fe(d,i,n,!0)||fe(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}}));return o(),re("selectionchange",o)}(t)),h.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?k(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))h.push(f.observer(f.callback,u,f.options))}catch(t){try{d()}catch(t){}throw t}return d}function qe(t){return void 0!==window[t]}function Ge(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Ve=class{constructor(t){tt(this,"generateIdFn",void 0),tt(this,"iframeRemoteIdToLocalIdMap",new WeakMap),tt(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},Ze=class{constructor(t){tt(this,"iframes",new WeakMap),tt(this,"crossOriginIframeMap",new WeakMap),tt(this,"crossOriginIframeMirror",new Ve(Nt)),tt(this,"crossOriginIframeStyleMirror",void 0),tt(this,"crossOriginIframeRootIdMap",new WeakMap),tt(this,"mirror",void 0),tt(this,"mutationCb",void 0),tt(this,"wrappedEmit",void 0),tt(this,"loadListener",void 0),tt(this,"pageHideListener",void 0),tt(this,"stylesheetManager",void 0),tt(this,"recordCrossOriginIframes",void 0),tt(this,"messageHandler",void 0),tt(this,"nestedIframeListeners",new Map),tt(this,"attachedWindows",new WeakMap),tt(this,"attachedDocuments",new WeakMap),tt(this,"attachedIframes",new Map),tt(this,"loadListenerDisposers",new WeakMap),tt(this,"iframeElementsById",new Map),tt(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ve(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){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>ne(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{ie(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);ne((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}ne((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null===(r=this.loadListener)||void 0===r||r.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case n.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:n.IncrementalSnapshot,data:{source:s.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case n.Meta:case n.Load:case n.DomContentLoaded:return!1;case n.Plugin:return e;case n.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case n.IncrementalSnapshot:switch(e.data.source){case s.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 s.Drag:case s.TouchMove:case s.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case s.ViewportResize:return!1;case s.MediaInteraction:case s.MouseInteraction:case s.Scroll:case s.CanvasMutation:case s.Input:return this.replaceIds(e.data,t,["id"]),e;case s.StyleSheetRule:case s.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case s.Font:return e;case s.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case s.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(ie(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(ie(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{ne((()=>this.mirror.removeNodeFromMap(t)))})),ne((()=>Pe(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&ie(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{ie(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Je=class{constructor(t){tt(this,"shadowDoms",new WeakSet),tt(this,"mutationCb",void 0),tt(this,"scrollCb",void 0),tt(this,"bypassOptions",void 0),tt(this,"mirror",void 0),tt(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 i,n;if(it(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(n=_.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==i?i:e,a=Le(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=Fe.indexOf(u);-1!==t&&Fe.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Ne(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(_.host(t))),this.restoreHandlers.push({doc:s,handler:Ue({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){var r=this;this.restoreHandlers.push({doc:e,handler:k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=_.shadowRoot(this);return s&&Se(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},Qe="skip-frame";function Xe(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tr=0;64>tr;tr++)Ye[Ke.charCodeAt(tr)]=tr;var er=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Ke[r[e]>>2],n+=Ke[(3&r[e])<<4|r[e+1]>>4],n+=Ke[(15&r[e+1])<<2|r[e+2]>>6],n+=Ke[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},rr=new Map,ir=(t,e,r)=>{if(t&&(ar(t,e)||"object"==typeof t)){var i=function(t,e){var r=rr.get(t);return r||rr.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function nr(t,e,r,i){return t instanceof Array?t.map((t=>nr(t,e,r,i))):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:er(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[nr(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[nr(t.data,e,r,i),t.width,t.height]}:ar(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ir(t,e,r)}:t}var sr=(t,e,r,i)=>t.map((t=>nr(t,e,r,i))),ar=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},or=["webgl","webgl2"];function ur(t){return"nodeType"in t}function lr(t,e,i,n){var s=[];try{if(n){var a=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||ur(a)&&fe(a,e,i,!0))return n.call(this,s);ur(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,i);a&&s.push(a)}var o=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!fe(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&or.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function hr(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=k(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(ir(d,s,this),this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,i,n,!0)){var c=sr(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(s){var h=ue(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var dr='(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',cr="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",dr],{type:"text/javascript;charset=utf-8"});function vr(t){var e;try{if(!(e=cr&&(self.URL||self.webkitURL).createObjectURL(cr)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(dr),{name:null==t?void 0:t.name})}}var fr,pr,mr,gr=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){tt(this,"pendingCanvasMutations",new Map),tt(this,"rafStamps",{latestId:0,invokeId:null}),tt(this,"mirror",void 0),tt(this,"mutationCb",void 0),tt(this,"resetObservers",void 0),tt(this,"frozen",!1),tt(this,"locked",!1),tt(this,"rafIdTimestamp",null),tt(this,"rafIdFlush",null),tt(this,"refCount",0),tt(this,"torndown",!1),tt(this,"resetFrameDedup",null),tt(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)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,r,i,n,s){var a=this;if("OffscreenCanvas"in r){var o,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,h=lr(r,i,n,!0),d=new Map;try{o=new vr}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(d.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:u["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,m=t=>{var u,h;c||(p&&f>t-p||(p=t,(u=[],h=t=>{try{t.querySelectorAll("canvas").forEach((t=>{fe(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&h(t.shadowRoot)}))}catch(t){}},h(r.document),u).forEach(function(){var t=e((function*(t){var e=a.mirror.getId(t);if(!d.get(e)&&0!==t.width&&0!==t.height){d.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void d.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,h=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(h*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Qe}if(void 0!==a){if(!Array.isArray(a)||!a.every(Xe))return Qe;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(s.canvasMasking,t,c,v,u,h);if("skip-frame"===f)return void d.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});o.postMessage({id:e,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:h,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){d.set(e,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;h(),cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=lr(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=k(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];return fe(this.canvas,r,i,!0)||setTimeout((()=>{var r=sr(l,e,this,n);t(this.canvas,{type:u["2D"],property:a,args:r})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ue(e.CanvasRenderingContext2D.prototype,a,{set(e){fe(this.canvas,r,i,!0)||t(this.canvas,{type:u["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...hr(e.WebGLRenderingContext.prototype,u.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...hr(e.WebGL2RenderingContext.prototype,u.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,i)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}},yr=class{constructor(t){var e;tt(this,"trackedLinkElements",new WeakSet),tt(this,"pendingDeferredSheets",new Set),tt(this,"mutationCb",void 0),tt(this,"adoptedStyleSheetCb",void 0),tt(this,"maskAllElementAttributes",void 0),tt(this,"maskAttributeFn",void 0),tt(this,"styleMirror",new ke),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=ft(i))}catch(t){}if(!r||!i)return X(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=M(),d=A(),c=!0;try{if(s)return o=!0,X(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(X(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(X(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),T(u=M()-h,null!=(l=d)?l:C)||(z.totalMs+=u,u>z.slowestSliceMs&&(z.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:bt({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=M();try{Z((()=>{try{var e=t.rules||t.cssRules;e&&V(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ut(e,t.href),index:r})))})}))}finally{J(M()-a)}}i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Zt.forEach((t=>t.abort())),Zt.clear()}trackStylesheetInLinkElement(t){}},br=class{constructor(){tt(this,"nodeMap",new WeakMap),tt(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}},wr=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var kr,_r=document.createElement("iframe");document.body.appendChild(_r),Array.from=(null===(kr=_r.contentWindow)||void 0===kr?void 0:kr.Array.from)||Array.from,document.body.removeChild(_r)}}catch(t){console.debug("Unable to override Array.from",t)}var Sr=new pt,Mr=new Set([s.Mutation,s.MediaInteraction,s.StyleSheetRule,s.CanvasMutation,s.Font,s.Log,s.StyleDeclaration,s.AdoptedStyleSheet]);function Cr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Ir(t){var e;void 0===t&&(t={});var i=t,a=i.emit,o=i.checkoutEveryNms,u=i.checkoutEveryNth,l=i.blockClass,h=void 0===l?"rr-block":l,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,m=void 0===p?null:p,g=i.maskTextClass,y=void 0===g?"rr-mask":g,b=i.maskTextSelector,w=void 0===b?null:b,k=i.inlineStylesheet,S=void 0===k||k,M=i.inlineStylesheetBudgetRules,C=i.maskAllInputs,I=i.maskInputOptions,A=i.slimDOMOptions,T=i.maskInputFn,x=i.maskTextFn,E=i.maskAllElementAttributes,O=void 0!==E&&E,F=i.maskAttributeFn,D=i.hooks,L=i.packFn,P=i.sampling,B=void 0===P?{}:P,W=i.dataURLOptions,z=void 0===W?{}:W,j=i.canvasResolutionScale,q=i.canvasMasking,G=i.mousemoveWait,V=i.recordDOM,Z=void 0===V||V,J=i.recordCanvas,Q=void 0!==J&&J,X=i.recordCrossOriginIframes,Y=void 0!==X&&X,tt=i.recordAfter,et=void 0===tt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":tt,rt=i.userTriggeredOnInput,it=void 0!==rt&&rt,nt=i.collectFonts,st=void 0!==nt&&nt,at=i.inlineImages,ot=void 0!==at&&at,ut=i.plugins,lt=i.keepIframeSrcFn,ht=void 0===lt?()=>!1:lt,dt=i.ignoreCSSAttributes,ct=void 0===dt?new Set([]):dt,vt=i.attributeFilter;Ce=i.errorHandler;var ft=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},z),mt=!Y||window.parent===window,gt=!1;if(!mt)try{window.parent.document&&(gt=!1)}catch(t){gt=!0}if(mt&&!a)throw new Error("emit function is required");if(!mt&&!gt)return()=>{};void 0!==G&&void 0===B.mousemove&&(B.mousemove=G),Sr.reset();var yt,bt=!0===C?{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!==I?I:{password:!0},wt=te(void 0!==A&&A);!function(t){void 0===t&&(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)}();var kt,_t,St=0,Mt=new Map,Ct=t=>{for(var e of ut||[])e.eventProcessor&&(t=e.eventProcessor(t));return L&&!gt&&(t=L(t)),t};fr=(t,e)=>{var r,i=t;if(i.timestamp=le(),!(null===(r=Fe[0])||void 0===r?void 0:r.isFrozen())||i.type===n.FullSnapshot||i.type===n.IncrementalSnapshot&&Mr.has(i.data.source)||Fe.forEach((t=>t.unfreeze())),mt)null==a||a(Ct(i),e);else if(gt){var l={type:"rrweb",event:Ct(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(l,"*")}if(i.type===n.FullSnapshot)yt=i,St=0;else if(i.type===n.IncrementalSnapshot){if(i.data.source===s.Mutation&&i.data.isAttachIframe)return;St++,(u&&St>=u||o&&i.timestamp-yt.timestamp>o)&&pr(!0)}};var It=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var a of t.adds){var o=Sr.getNode(a.node.id);o&&"IFRAME"===o.nodeName&&i.add(o)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=xt.getIframeElementById(r);n&&i.has(n)?xt.forgetIframeId(r):(null==kt||kt(r),xt.removeIframeById(r))}})),null==_t||_t(),xt.cleanupDetachedIframes()}fr({type:n.IncrementalSnapshot,data:r({source:s.Mutation},t)})},Rt=t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Scroll},t)}),At=t=>fr({type:n.IncrementalSnapshot,data:r({source:s.CanvasMutation},t)}),Tt=new yr({mutationCb:It,adoptedStyleSheetCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.AdoptedStyleSheet},t)}),maskAllElementAttributes:O,maskAttributeFn:F}),xt=new Ze({mirror:Sr,mutationCb:It,stylesheetManager:Tt,recordCrossOriginIframes:Y,wrappedEmit:fr});for(var Et of ut||[])Et.getMirror&&Et.getMirror({nodeMirror:Sr,crossOriginIframeMirror:xt.crossOriginIframeMirror,crossOriginIframeStyleMirror:xt.crossOriginIframeStyleMirror});var Ot=new br,Ft=null==q?void 0:q.configured;mr=new gr({recordCanvas:Q,mutationCb:At,win:window,blockClass:h,blockSelector:c,mirror:Sr,sampling:B.canvas,dataURLOptions:ft,resolutionScale:j,canvasMasking:q});var Dt=new Je({mutationCb:It,scrollCb:Rt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskInputOptions:bt,dataURLOptions:ft,maskTextFn:x,maskInputFn:T,maskAllElementAttributes:O,maskAttributeFn:F,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,sampling:B,slimDOMOptions:wt,iframeManager:xt,stylesheetManager:Tt,canvasManager:mr,keepIframeSrcFn:ht,processedNodeManager:Ot,attributeFilter:vt},mirror:Sr});pr=function(t){if(void 0===t&&(t=!1),Z){U(M);try{fr({type:n.Meta,data:{href:window.location.href,width:ce(),height:de()}},t),null==e||e.cancel(),e=void 0,Tt.reset(),Dt.init(),Fe.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new pt:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,m=void 0!==p&&p,g=r.recordCanvas,y=void 0!==g&&g,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,R=r.slimDOM,A=r.dataURLOptions,T=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,D=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,P=void 0===N?()=>!1:N,B=r.maxDepth,W=r.inlineStylesheetBudgetRules,z=!0===k?{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===k?{password:!0}:k,j=te(void 0!==R&&R);U(W);try{return Yt(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:z,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:j,dataURLOptions:A,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:D,stylesheetLoadTimeout:L,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{H()}}(document,{mirror:Sr,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskAllInputs:bt,inlineStylesheetBudgetRules:M,maskTextFn:x,maskInputFn:T,maskAllElementAttributes:O,maskAttributeFn:F,slimDOM:wt,dataURLOptions:ft,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,onSerialize(t){ye(t,Sr)&&xt.addIframe(t),be(t,Sr)&&Tt.trackLinkElement(t),we(t)&&Dt.addShadowRoot(_.shadowRoot(t),document)},onIframeLoad(t,e){xt.attachIframe(t,e),Dt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){xt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Tt.attachLinkElement(t,e)},keepIframeSrcFn:ht})}finally{a=N,N=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(fr({type:n.FullSnapshot,data:{node:i,initialOffset:he(window)}},t),Fe.forEach((t=>t.unlock())),mr.onFullSnapshot(),r.length){var s=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&ne((()=>{a=e.beginDeferredLinkInlining(r,Sr.getId(r))}))},l=()=>{if(a){var t=a,e=!0;ne((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!i){var e=0;do{try{a||u(),l()}catch(t){null==a||a.discard(),a=null,K(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=Cr(h):r())}};return n=Cr(h),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);K(c),null==a||a.discard(),a=null}r()}}}}(r,Tt,(()=>{e===s&&(e=void 0)}));e=s}Y&&xt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Tt.adoptStyleSheets(document.adoptedStyleSheets,Sr.getId(document))}finally{H()}var a}};try{var Lt=[];for(var Nt of(Lt.push(re("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Lt.push(re(Nt,R,document));kt=t=>{var e=Mt.get(t);e&&(e.forEach((t=>{ne(t);var e=Lt.indexOf(t);-1!==e&&Lt.splice(e,1)})),Mt.delete(t))},_t=()=>{for(var t of Mt){var e=t[0],r=Sr.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Pt=t=>{var e;return Oe(He)({mutationCb:It,mousemoveCb:(t,e)=>fr({type:n.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.MouseInteraction},t)}),scrollCb:Rt,viewportResizeCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.ViewportResize},t)}),inputCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Input},t)}),mediaInteractionCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.MediaInteraction},t)}),styleSheetRuleCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.StyleSheetRule},t)}),styleDeclarationCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.StyleDeclaration},t)}),canvasMutationCb:At,fontCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Font},t)}),selectionCb(t){fr({type:n.IncrementalSnapshot,data:r({source:s.Selection},t)})},customElementCb(t){fr({type:n.IncrementalSnapshot,data:r({source:s.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:m,maskTextClass:y,maskTextSelector:w,maskInputOptions:bt,inlineStylesheet:S,sampling:B,recordDOM:Z,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,userTriggeredOnInput:it,collectFonts:st,doc:t,maskInputFn:T,maskTextFn:x,maskAllElementAttributes:O,maskAttributeFn:F,keepIframeSrcFn:ht,blockSelector:c,slimDOMOptions:wt,dataURLOptions:ft,mirror:Sr,iframeManager:xt,stylesheetManager:Tt,shadowDomManager:Dt,processedNodeManager:Ot,canvasManager:mr,ignoreCSSAttributes:ct,attributeFilter:vt,plugins:(null==ut||null===(e=ut.filter((t=>t.observer)))||void 0===e?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>fr({type:n.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},D)};xt.addLoadListener((t=>{try{var e=Sr.getId(t),r=Pt(t.contentDocument);if("function"==typeof r&&(Lt.push(r),-1!==e)){var i=Mt.get(e);i||Mt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),xt.addPageHideListener((t=>{var e=Sr.getId(t);null==kt||kt(e),Pe(t)}));var Bt=-1,$t=t=>fr({type:n.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Wt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Sr.getId(s):-1;a!==Bt&&(-1!==Bt&&$t({id:Bt,enter:!1}),Bt=a,-1!==a&&$t({id:a,enter:!0}))},zt=()=>{pr();var t=Pt(document);"function"==typeof t&&Lt.push(t),Lt.push(re("fullscreenchange",Wt)),Lt.push(re("webkitfullscreenchange",Wt)),Lt.push(re("mozfullscreenchange",Wt)),Lt.push(re("MSFullscreenChange",Wt)),wr=!0};return["interactive","complete"].includes(document.readyState)?zt():(Lt.push(re("DOMContentLoaded",(()=>{fr({type:n.DomContentLoaded,data:{}}),"DOMContentLoaded"===et&&zt()}))),Lt.push(re("load",(()=>{fr({type:n.Load,data:{}}),"load"===et&&zt()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Lt.forEach((t=>ne(t))),Ot.destroy(),xt.removeLoadListener(),xt.destroy(),Mt.clear(),Dt.reset(),Sr.reset(),wr=!1,Ce=void 0}}catch(t){console.warn(t)}}function Rr(t){return Rr="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},Rr(t)}function Ar(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Rr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Rr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Rr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Ir.addCustomEvent=(t,e)=>{if(!wr)throw new Error("please add custom event after start recording");fr({type:n.Custom,data:{tag:t,payload:e}})},Ir.freezePage=()=>{Fe.forEach((t=>t.freeze()))},Ir.takeFullSnapshot=t=>{if(!wr)throw new Error("please take full snapshot after start recording");pr(t)},Ir.mirror=Sr,"Mobile".toLowerCase(),"Tablet".toLowerCase();var Tr=class{constructor(t){Ar(this,"fileName",void 0),Ar(this,"functionName",void 0),Ar(this,"lineNumber",void 0),Ar(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},xr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Or=/^(eval@)?(\[native code])?$/,Fr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Tr({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Or)}),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 Tr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Tr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Tr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Tr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(xr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Tr({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Dr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Lr(t){return Array.isArray(t)}function Nr(t){return"object"==typeof t&&null!==t&&!Lr(t)}function Pr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Nr(t[i])&&Pr(t[i],e-1))return!0;return!1}function Br(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Nr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Nr(a)&&Pr(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=Lr(l)?Dr(l.length?l[0]:null):l}return o}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 $r={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 Wr(t,e,r){var i,n=r?Object.assign({},$r,r):$r,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Fr.parse(e.error).map((t=>t.toString())),payload:[Br(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Br("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Br("Uncaught (in promise)",n.stringifyOptions),Br(e.reason,n.stringifyOptions)]),t({level:"error",trace:Fr.parse(r).map((t=>t.toString())),payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=Fr.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>Br(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Br("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[s],i=t(r);i;){if(i.next===d)return void(i.next=h.next);i=t(r=i.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var zr="u">typeof window?window:void 0,jr="u">typeof globalThis?globalThis:zr,Ur=null==jr?void 0:jr.document,Hr=null==jr?void 0:jr.location;null!=jr&&jr.XMLHttpRequest&&new jr.XMLHttpRequest;var qr="undefined"!=typeof globalThis?globalThis:zr;qr&&"undefined"==typeof self&&(qr.self=qr),qr&&"undefined"==typeof File&&(qr.File=function(){});var Gr=null!=zr?zr:{},Vr=function(t){return t.trim()},Zr=Object.prototype,Jr=Zr.hasOwnProperty,Qr=Zr.toString,Xr=Array.isArray||function(t){return"[object Array]"===Qr.call(t)},Kr=t=>"function"==typeof t,Yr=t=>t===Object(t)&&!Xr(t),ti=t=>void 0===t,ei=t=>"[object String]"==Qr.call(t),ri=t=>null===t,ii=t=>ti(t)||ri(t),ni=t=>"[object Number]"==Qr.call(t)&&t==t,si=t=>"[object Boolean]"===Qr.call(t),ai=t=>t instanceof FormData;function oi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ni(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),oi(null!=n?n:r,e,r,i))}class ui{constructor(t){this.C={},this.I=t.I,this.R=oi(t.bucketSize,0,100,t.A),this.O=oi(t.refillRate,0,this.R,t.A),this.N=oi(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}function li(t){return t?t.split("#")[0]:t}var hi,di="NativeGzipValidationError",ci=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(di,"Native gzip produced invalid output: "+t)},vi=function(){var t=e((function*(t,e){18>t.size&&ci("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&ci("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(hi)return hi;hi=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;hi[t]=e>>>0}return hi})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&ci("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&ci("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function fi(){return fi=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield vi(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),fi.apply(this,arguments)}var pi=t=>"u">typeof Document&&t instanceof Document,mi={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},gi=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={q(e){if(zr&&(mi.DEBUG||zr.POSTHOG_DEBUG||r)&&!ti(zr.console)&&zr.console){for(var i=("__rrweb_original__"in zr.console[e]?zr.console[e].__rrweb_original__:zr.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>gi(t+" "+e,r)};return i},yi=gi("[PostHog.js]"),bi=yi.createLogger;function wi(t,e){if(!ii(t))if(Xr(t))t.forEach(e);else if(ai(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Jr.call(t,r)&&e(t[r],r)}function ki(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var _i=["localhost","127.0.0.1"],Si=t=>{var e=null==Ur?void 0:Ur.createElement("a");return ti(e)?null:(e.href=t,e)},Mi=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return wi(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ci=()=>{},Ii=t=>{var e;if(Kr(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Ri(t,e,r){try{if(!(e in t))return Ci;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],s=Ii(r);s;){if(s.next===n)return void(s.next=i.next);s=Ii(r=s.next)}else t[e]=i.next}}catch(t){return Ci}}function Ai(t,e){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Ti(t){var e,r=null==zr||null==(e=zr.location)?void 0:e.href;return ti(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Kr(i))return e;try{var n=i(e);return ei(n)&&n?n:e}catch(t){return yi.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var xi=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Ei=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Oi=[16,15,14,13],Fi=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Di=/[0-9A-Za-z_]/;function Li(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var Ni="[SessionRecording]",Pi="redacted",Bi=1e6;function $i(t){var e;return Math.min(Bi,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Bi)}var Wi={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:Bi,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},zi=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ji=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ui=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Hi=t=>{ii(t)||wi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return zi.includes(e)||Ui.some((t=>e.includes(t)))})(e)&&(t[e]=Pi)}))},qi=["/s/","/e/","/i/"];function Gi(t,e,r,i){if(ii(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return ei(n)&&(n=parseInt(n)),n>r?Ni+" "+i+" body too large to record ("+n+" bytes)":t}function Vi(t,e){if(ii(t))return t;var r=t;return function(t,e){if(ii(t))return!1;if(ei(t)){if(function(t){var e;for(Ei.lastIndex=0;e=Ei.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Oi){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(xi.test(o)&&Li(o))return!0}}}return!1}(t=Vr(t)))return!1;var r=function(t){var e;for(Fi.lastIndex=0;e=Fi.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Di.test(r)&&Di.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=Ni+" "+e+" body "+Pi),wi(ji,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Ni+" "+e+" body "+Pi+" as might contain: "+t)})),r}var Zi=new WeakSet,Ji=bi("[Recorder]"),Qi=t=>"navigation"===t.entryType,Xi=t=>"resource"===t.entryType;function Ki(t,e){return!!e&&(si(e)||e[t])}function Yi(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var tn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function en(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Yi(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(tn))return!1;if(si(r))return!0;if(Xr(r))return n(r);var s=r[e];return si(s)?s:n(s)}function rn(t,e,r,i,n,s){return nn.apply(this,arguments)}function nn(){return nn=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Ji.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Xi(a=t[s])&&a.initiatorType===e&&(ti(i)||a.startTime>=i)&&(ti(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),rn(t,e,r,i,n,s+1))})),nn.apply(this,arguments)}function sn(t){var e=t.body,r=t.options,i=t.url;if(ii(e))return null;var n=Ai(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(ei(e))return e;if(pi(e))return e.textContent;if(ai(e))return Mi(e);if(Yr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var an=t=>!ri(t)&&("navigation"===t.entryType||"resource"===t.entryType);function on(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ti(o)?void 0:Math.round(o),endTime:ti(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(an(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var un=["video/","audio/"];function ln(t){return Yr(t)&&Kr(t.getReader)&&Kr(t.tee)}var hn=500,dn="[SessionReplay] Timeout while trying to read body",cn="[SessionReplay] Failed to read body";function vn(t){return cn+": "+t}function fn(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function pn(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(dn)),hn);try{t.clone().text().then((t=>e(t)),(t=>e(vn(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(cn)}}))}(t);var r=$i(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(fn(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel().catch((()=>{}))}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(dn)),hn);try{o=t.clone()}catch(t){return void a(cn)}var l=o.body;if(ln(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(cn)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(fn(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(vn(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(vn(t))))}catch(t){a(cn)}}))}(t,r)}function mn(){return(mn=e((function*(t){var e=t.r,r=t.options,i=Ai(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):pn(e,r)}))).apply(this,arguments)}function gn(){return(gn=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=un.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Ai(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return ri(i)?pn(e,r):Promise.resolve(i)}))).apply(this,arguments)}var yn=null;function bn(t,i,n){if(!("performance"in i))return()=>{};if(yn)return Ji.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Wi,n):Wi,a=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r||(t=>!!t&&Zi.has(t))(r)),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Qi(t)||Xi(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>on({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Qi(t)||Xi(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>on({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ki("request",r.recordHeaders),n=Ki("response",r.recordHeaders),s=Ri(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},m={},g=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=d.send.bind(d);d.send=t=>(en({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=sn({body:t,options:r,url:o})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",w),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},w=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),en({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=sn({body:d.response,options:r,url:o})),rn(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=on({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",w),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Ji.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ki("request",i.recordHeaders),s=Ki("response",i.recordHeaders),a=Ri(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l;try{u=new Request(e,o)}catch(t){return Ji.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!ln(null==o?void 0:o.body)&&en({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return mn.apply(this,arguments)}({r:u,options:i,url:e}))}catch(t){Ji.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),l=Yi(e)?yield a(u):yield a(e,o),d=r.performance.now();try{var f={};l.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),en({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return gn.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){Ji.error("Failed to record fetch response for network capture",t)}return l}finally{rn(r,"fetch",u.url,h,d).then((e=>{var r,i=on({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),yn=()=>{o(),u(),l(),yn=null}}var wn={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},kn={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},_n="$session_recording_remote_config",Sn="$replay_sample_rate",Mn="$replay_override_sampling",Cn="$replay_override_linked_flag",In="$replay_override_url_trigger",Rn="$replay_override_event_trigger",An="$session_is_sampled",Tn="$session_past_minimum_duration",xn="$session_recording_url_trigger_activated_session",En="$session_recording_event_trigger_activated_session",On="$posthog_sr_group_event_trigger_",Fn="$posthog_sr_group_url_trigger_",Dn="$posthog_sr_group_sampling_",Ln="$debug_first_full_snapshot_timestamp",Nn="$sess_rec_flush_size",Pn="$stored_person_properties",Bn="$sdk_debug_replay_pending_trigger_conditions",$n="$sdk_debug_replay_remote_trigger_matching_config",Wn="disabled",zn="sampled",jn="active",Un="buffering",Hn="paused",qn="rrweb_error",Gn="trigger",Vn=Gn+"_activated",Zn=Gn+"_pending",Jn=Gn+"_"+Wn;function Qn(t,e,r,i,n,s){return 0===e?Jn:(null==t?void 0:t.get_property(r?i+r:n))===s?Vn:Zn}function Xn(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function Kn(t){return t.includes(Vn)?Vn:t.includes(Zn)?Zn:Jn}function Yn(t){var e=new Set(t);switch(e.delete(Jn),e.size){case 0:return Jn;case 1:return Array.from(e)[0];default:return Zn}}class ts{constructor(t){this.j=t}triggerStatus(t){return Kn(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Kn(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class es{constructor(t){this.j=t}triggerStatus(t){return Yn(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Yn(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class rs{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Vn}stop(){}}var is=t=>"sessionRecording"in t;class ns{constructor(t,e){this.B=[],this.H=[],this.U=new Map,this.$=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,r;this.B=(is(t)?Yr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(is(t)?Yr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.U.clear(),this.$.clear(),this.B))if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){yi.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.$.has(e.url))try{this.$.set(e.url,new RegExp(e.url))}catch(t){yi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return Qn(this._instance,this.B.length,this.V,Fn,xn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Ti(this._instance);if(!t)return!1;try{return Xn(t,this.H,this.$)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=Ti(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=Xn(r,this.H,this.$);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=Ti(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=Xn(n,this.H,this.$);a&&!s?t():!a&&s&&e();var o=this.G(i)===Vn,u=Xn(n,this.B,this.U);!o&&u&&r("url",n)}}stop(){this.W=""}}class ss{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=Zn;return ii(this.linkedFlag)&&(t=Jn),this.linkedFlagSeen&&(t=Vn),t}onConfig(t,e){var r;if(this.linkedFlag=(is(t)?Yr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!ii(this.linkedFlag)&&!this.linkedFlagSeen){var i=ei(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=ei(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Yr(r)&&i in r){var a=r[i];s=si(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class as{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(is(t)?Yr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return Qn(this._instance,this.Y.length,this.V,On,En,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Y.length){var i=this.K(r)===Vn,n=this.Y.includes(t);!i&&n&&e("event",t)}}stop(){}}class os{constructor(t,e,r){if(this._instance=t,this.group=e,this.X=new ns(t,e.id),this.tt=new as(t,e.id),this.et=new ss(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.X.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var s=[this.tt,this.X,this.et];this.rt="any"===e.conditions.matchType?new ts(s):new es(s)}else this.rt=new rs}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==Zn?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===Zn)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.X.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Fn+this.group.id:On+this.group.id]:e})}stop(){this.X.stop(),this.tt.stop(),this.et.stop()}}function us(t){if(t.rrwebError)return qn;if(!t.receivedFlags)return Un;if(!t.isRecordingEnabled)return Wn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=!0===t.isSampled,r=new ts([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?zn:r===Vn?jn:r===Zn?Un:!1===t.isSampled?Wn:jn}function ls(t){if(t.rrwebError)return qn;if(!t.receivedFlags)return Un;if(!t.isRecordingEnabled)return Wn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=new es([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Jn,i=si(t.isSampled);return r&&e===Zn?Un:r&&e===Jn||i&&!t.isSampled?Wn:!0===t.isSampled?zn:jn}function hs(){var t=[];return function(e,r){if(Yr(r)||Xr(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function ds(t){var e=JSON.stringify(t,hs());return e?new Blob([e]).size:0}function cs(t){if(ri(t))return 4;if(ti(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(Xr(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=ti(i)||ri(i)?4:cs(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];ti(u)||(a||(s+=1),a=!1,s+=o.length+3+cs(u))}return s;default:return 0}}function vs(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[vs({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),vs({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var fs=Uint8Array,ps=Uint16Array,ms=Uint32Array,gs=new fs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ys=new fs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),bs=new fs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ws=function(t,e){for(var r=new ps(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ms(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ks=ws(gs,2),_s=ks[1];ks[0][28]=258,_s[258]=28;for(var Ss=ws(ys,0)[1],Ms=new ps(32768),Cs=0;32768>Cs;++Cs){var Is=(43690&Cs)>>>1|(21845&Cs)<<1;Ms[Cs]=((65280&(Is=(61680&(Is=(52428&Is)>>>2|(13107&Is)<<2))>>>4|(3855&Is)<<4))>>>8|(255&Is)<<8)>>>1}var Rs=function(t,e,r){for(var i=t.length,n=0,s=new ps(e);i>n;++n)++s[t[n]-1];var a,o=new ps(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new ps(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[Ms[d]>>>u]=l}else for(a=new ps(i),n=0;i>n;++n)a[n]=Ms[o[t[n]-1]++]>>>15-t[n];return a},As=new fs(288);for(Cs=0;144>Cs;++Cs)As[Cs]=8;for(Cs=144;256>Cs;++Cs)As[Cs]=9;for(Cs=256;280>Cs;++Cs)As[Cs]=7;for(Cs=280;288>Cs;++Cs)As[Cs]=8;var Ts=new fs(32);for(Cs=0;32>Cs;++Cs)Ts[Cs]=5;var xs=Rs(As,9,0),Es=Rs(Ts,5,0),Os=function(t){return(t/8>>0)+(7&t&&1)},Fs=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof ps?ps:t instanceof ms?ms:fs)(r-e);return i.set(t.subarray(e,r)),i},Ds=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ls=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Ns=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new fs(0),0];if(1==n){var a=new fs(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new ps(c+1),f=Ps(r[h-1],v,0);if(f>e){i=0;var p=0,m=f-e,g=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=g-(1<<f-v[y]),v[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new fs(v),f]},Ps=function(t,e,r){return-1==t.s?Math.max(Ps(t.l,e,r+1),Ps(t.r,e,r+1)):e[t.s]=r},Bs=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ps(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},$s=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ws=function(t,e,r){var i=r.length,n=Os(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},zs=function(t,e,r,i,n,s,a,o,u,l,h){Ds(e,h++,r),++n[256];for(var d=Ns(n,15),c=d[0],v=d[1],f=Ns(s,15),p=f[0],m=f[1],g=Bs(c),y=g[0],b=g[1],w=Bs(p),k=w[0],_=w[1],S=new ps(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;k.length>M;++M)S[31&k[M]]++;for(var C=Ns(S,7),I=C[0],R=C[1],A=19;A>4&&!I[bs[A-1]];--A);var T,x,E,O,F=l+5<<3,D=$s(n,As)+$s(s,Ts)+a,L=$s(n,c)+$s(s,p)+a+14+3*A+$s(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&L>=F)return Ws(e,h,t.subarray(u,u+l));if(Ds(e,h,1+(D>L)),h+=2,D>L){T=Rs(c,v,0),x=c,E=Rs(p,m,0),O=p;var N=Rs(I,R,0);for(Ds(e,h,b-257),Ds(e,h+5,_-1),Ds(e,h+10,A-4),h+=14,M=0;A>M;++M)Ds(e,h+3*M,I[bs[M]]);h+=3*A;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(M=0;W.length>M;++M)Ds(e,h,N[z=31&W[M]]),h+=I[z],z>15&&(Ds(e,h,W[M]>>>5&127),h+=W[M]>>>12)}}else T=xs,x=As,E=Es,O=Ts;for(M=0;o>M;++M)if(i[M]>255){var z;Ls(e,h,T[257+(z=i[M]>>>18&31)]),h+=x[z+257],z>7&&(Ds(e,h,i[M]>>>23&31),h+=gs[z]);var j=31&i[M];Ls(e,h,E[j]),h+=O[j],j>3&&(Ls(e,h,i[M]>>>5&8191),h+=ys[j])}else Ls(e,h,T[i[M]]),h+=x[i[M]];return Ls(e,h,T[256]),h+x[256]},js=new ms([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Us=function(){for(var t=new ms(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Hs=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Us[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},qs=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new fs(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=Ws(u,l,t.subarray(h,d)):(u[h]=true,l=Ws(u,l,t.subarray(h,a)))}else{for(var c=js[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,m=new ps(32768),g=new ps(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new ms(25e3),_=new ps(288),S=new ps(32),M=0,C=0,I=(h=0,0),R=0,A=0;a>h;++h){var T=w(h),x=32767&h,E=g[T];if(m[x]=E,g[T]=x,h>=R){var O=a-h;if((M>7e3||I>24576)&&O>423){l=zs(t,u,0,k,_,S,C,I,A,h-A,l),I=M=C=0,A=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,L=0,N=f,P=x-E&32767;if(O>2&&T==w(h-P))for(var B=Math.min(v,O)-1,W=Math.min(32767,h),z=Math.min(258,O);W>=P&&--N&&x!=E;){if(t[h+D]==t[h+D-P]){for(var j=0;z>j&&t[h+j]==t[h+j-P];++j);if(j>D){if(D=j,L=P,j>B)break;var U=Math.min(P,j-2),H=0;for(F=0;U>F;++F){var q=h-P+F+32768&32767,G=q-m[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(x=E)-(E=m[x])+32768&32767}if(L){k[I++]=268435456|_s[D]<<18|Ss[L];var V=31&_s[D],Z=31&Ss[L];C+=gs[V]+ys[Z],++_[257+V],++S[Z],R=h+D,++M}else k[I++]=t[h],++_[t[h]]}}l=zs(t,u,true,k,_,S,C,I,A,h-A,l)}return Fs(o,0,i+Os(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},Gs=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Vs=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Gs(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},Zs=function(t){return 10+(t.filename&&t.filename.length+1||0)};function Js(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class Qs{constructor(t,e){var r,i,n,s;void 0===e&&(e={}),this.it={},this.nt=Date.now(),this.ot=-1/0,this.st=()=>{var t=Date.now(),e=t-this.nt;e>0?(this.ut=Math.min(this.ht,this.ut+e/1e3*this.ct),this.nt=t):this.nt=t},this.dt=t=>{if(!this.it[t]){var e,r;this.it[t]=!0;var i=this.vt(t);null==(e=(r=this.ft).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.yt(t.id);return!this.wt.consumeRateLimit(e[0])&&t}));var n,s,a=i-e.attributes.length;a>0&&(null==(n=(s=this.ft).onDroppedAttributeMutations)||n.call(s,a))}var o=this.bt(e);if(0!==o||r===o){if(this.kt)return t;this.st();var u,l,h=cs(t);return h>this.ut?(null==(u=(l=this.ft).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ut-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.ot));this.St=setTimeout((()=>{var t,e;this.St=void 0,this.ot=Date.now(),null==(t=(e=this.ft).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.ft=e,this.wt=new ui({bucketSize:null!==(r=this.ft.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ft.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.dt,A:yi}),this.ht=null!==(n=this.ft.bytesBucketSize)&&void 0!==n?n:0,this.ct=null!==(s=this.ft.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ht)||0>=this.ht,this.ut=this.ht;var a=this.ft.resyncIntervalMs;this.xt=ni(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.it={},this.St&&(clearTimeout(this.St),this.St=void 0),this.ot=Date.now()}stop(){this.wt.stop(),this.reset(),this.ut=this.ht,this.nt=Date.now(),this.ot=-1/0}}mi.DEBUG=!1,mi.LIB_VERSION="1.427.0",mi.LIB_NAME="web";class Xs{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(Nn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct(Nn);return Yr(e=r)&&ei(e.sessionId)&&ni(e.size)&&r.sessionId===t?r.size:0}}function Ks(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<oi(100*e,0,100,yi)}var Ys=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ta=t=>t.toLowerCase(),ea={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Ys(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ys(e,t))))),icontains:(t,e)=>e.map(ta).some((e=>t.map(ta).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ta).every((e=>t.map(ta).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},ra=new Set(["is_not","not_icontains","not_regex"]);function ia(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(ti(n)||ri(n))return ra.has(s);var a=ea[s];return!!a&&!ti(t.value)&&!ri(t.value)&&a(Xr(t.value)?t.value.map(String):[String(t.value)],Xr(n)?n.map(String):[String(n)])}))}var na=bi("[SessionRecording]");function sa(t,e){return e?t:"!"+t}function aa(t,e){return t===e||t!=="!"+e&&null}class oa{constructor(t,e,r,i,n,s,a){this.Tt=null,this.It=ls,this._instance=t,this.X=e,this.tt=r,this.et=i,this.Rt=n,this.At=s,this.Et=a}onRemoteConfig(t){this.Tt=ni(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ts([this.tt,this.X]),this.It=us):(this.Lt=new es([this.tt,this.X]),this.It=ls),this._instance.register_for_session({[$n]:t.triggerMatchType}),this.X.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,((t,e)=>{this.Rt("linked_flag_matched",{flag:t,variant:e}),this.Et()}))}getStatus(t){return this.It({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return ni(r)?r:null}checkUrlTriggers(t,e,r,i){this.X.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.Y.length&&ii(this.Ot))return this.Ot=t((t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){na.error("Could not activate event trigger",t)}})),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.Tt;if(!ni(n))return null==(r=this._instance.persistence)||r.unregister(An),void(null==(i=this._instance.persistence)||i.unregister(Sn));var s=this._instance.get_property(An),a=this._instance.get_property(Sn),o=aa(s,t),u=ni(a)&&a!==n,l=ti(a)&&s===t,h=u||l||!si(o),d=h?Ks(t,n):o;h&&(d?this.Rt("sampled"):na.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[An]:sa(t,d),[Sn]:ri(a)&&s===t?null:n})}ensureSamplingDecision(t){if(ni(this.Tt)){var e=this._instance.get_property(An);si(aa(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(En),null==(e=this._instance.persistence)||e.unregister(xn),null==(r=this._instance.persistence)||r.unregister(An),null==(i=this._instance.persistence)||i.unregister(Sn),null==(n=this._instance.persistence)||n.unregister(Tn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Zn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===Zn)).map((t=>t.label))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.X.stop(),this.et.stop()}}class ua{constructor(t,e,r,i,n){this.Pt=[],this.Dt=new Map,this.Nt=!1,this._instance=t,this.X=e,this.Rt=r,this.Ft=i,this.Et=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[$n]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.X.onConfig(t)):na.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return qn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Wn;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===Vn){var o=s.group.id,u=r.get(o);ti(u)?yi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===Zn&&(i=!0)}return n?zn:i?Un:Wn}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Dt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;ni(i)&&(ri(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.X.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Et(e))}),t)};for(var a of this.Pt)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t((t=>{var r;if(this.Nt)return na.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.jt(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Pn);s.some((e=>!e.properties||0===e.properties.length||ia(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Et(n))}}),e)};for(var s of this.Pt)n(s)}catch(t){na.error("Could not activate event trigger for trigger groups",t)}})),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,s=i.sampleRate,a=Dn+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Yr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=ni(v)&&v!==s,u=c===t&&ni(v)&&v===s&&si(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!si(u),m=p?Ks(t+n,s):u;p&&this.Ft("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:m}),this.Dt.set(n,m),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:m}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(An),null==(e=this._instance.persistence)||e.unregister(Sn),null==(r=this._instance.persistence)||r.unregister(Tn),this.Pt)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(On+o),null==(s=this._instance.persistence)||s.unregister(Fn+o),null==(a=this._instance.persistence)||a.unregister(Dn+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Dt.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Pt)if(e.triggerStatus(t)===Zn)return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap((e=>e.triggerStatusNoSideEffects(t)!==Zn?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear(),this.X.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||ia(r,e,this._instance.get_property(Pn))}qt(t){var e=this;this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear();var r=function(t){var r=new os(e._instance,t,((r,i)=>{e.Rt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Et()}));e.Pt.push(r)};for(var i of t)r(i)}}var la=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ha=1e5,da="https://schema.org",ca=[],va="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),fa="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),pa="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ma="Accommodation AdministrativeArea Country Place State".split(" "),ga={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:fa,publisher:pa},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ca},Offer:{seller:pa},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:pa,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:pa,areaServed:ma,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ca}},ya={},ba=[[fa,ya],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),ga.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ga.Event],[pa,ga.Organization],[ma,ga.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ga.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),ya]],wa="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ka(t,e){return Jr.call(t,e)?t[e]:void 0}function _a(t){var e=typeof t;return ri(t)||"string"===e||"number"===e||"boolean"===e}function Sa(t){return _a(t)||Xr(t)&&t.every(_a)?t:void 0}function Ma(t){if(Jr.call(ga,t))return ga[t];for(var e of ba){var r=e[1];if(e[0].includes(t))return r}return wa.includes(t)?ya:void 0}function Ca(t,e){if(!Yr(t))return null;var r=ka(t,"@type"),i=function(t){return("string"==typeof t?[t]:Xr(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!Ma(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},s=Sa(ka(t,"@id"));for(var a of(ti(s)||(n["@id"]=s),va)){var o=Sa(ka(t,a));ti(o)||(n[a]=o)}for(var u of i){var l=Ma(u),h=function(){var e=ka(t,d),r=l[d];if(!0===r){var i=Sa(e);ti(i)||(n[d]=i)}else if(Xr(e)){var s=e.map((t=>Ca(t,r))).filter(Yr);s.length&&(n[d]=s)}else{var a=Ca(e,r);a&&(n[d]=a)}};for(var d of Object.keys(l))h()}return n}function Ia(t){if(!Yr(t))return null;var e=ka(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=Ca(t);if(i)return r({"@context":da},i);var n=ka(t,"@graph");if(!Xr(n))return null;var s=n.map((t=>Ca(t))).filter(Yr);return s.length?{"@context":da,"@graph":s}:null}function Ra(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Aa(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ta(t){return Ra(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ra)}function xa(t){return ti(t)?void 0:Math.round(t)}function Ea(t){return Yr(t)?t.network_timing:t}var Oa,Fa,Da=943718.4,La="[SessionRecording]",Na=bi(La),Pa=[kn.MouseMove,kn.MouseInteraction,kn.Scroll,kn.ViewportResize,kn.Input,kn.TouchMove,kn.MediaInteraction,kn.Drag],Ba=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function $a(){var t;return null==Gr||null==(t=Gr.__PosthogExtensions__)?void 0:t.rrweb}function Wa(){var t;return null==(t=$a())?void 0:t.record}function za(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,hs())}}function ja(t){return Js(function(t,e){void 0===e&&(e={});var r=Hs(),i=t.length;r.p(t);var n=qs(t,e,Zs(e),8),s=n.length;return Vs(n,e),Gs(n,s-8,r.d()),Gs(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new fs(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new fs(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return Fs(i,0,n)}(za(t))))}function Ua(t){return Ha.apply(this,arguments)}function Ha(){return Ha=e((function*(t){var e=za(t),r=yield function(t,e,r){return fi.apply(this,arguments)}(e,mi.DEBUG,{rethrow:!0});return Js(new Uint8Array(yield r.arrayBuffer()))})),Ha.apply(this,arguments)}var qa="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Ga=!1;function Va(t){return Xr(t)&&0===t.length?Oa=null!=Oa?Oa:ja([]):ja(t)}function Za(t){return Ja.apply(this,arguments)}function Ja(){return(Ja=e((function*(t){return Xr(t)&&0===t.length?Oa||(Fa=null!=Fa?Fa:Ua([]).then((t=>(Oa=t,t))).catch((t=>{throw Oa=void 0,Fa=void 0,t}))):Ua(t)}))).apply(this,arguments)}function Qa(t){return qa&&!Ga&&function(t){return t.type===wn.FullSnapshot||t.type===wn.IncrementalSnapshot&&(t.data.source===kn.Mutation||t.data.source===kn.StyleSheetRule)}(t)}function Xa(t){return{event:t,size:cs(t)}}function Ka(t,e){return r({},t,{data:e,cv:"2024-10"})}function Ya(t,e){return r({},t,{cv:"2024-10",data:r({},t.data,e)})}function to(t){try{if(t.type===wn.FullSnapshot)return Xa(Ka(t,ja(t.data)));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.Mutation)return Xa(Ya(t,{texts:Va(t.data.texts),attributes:Va(t.data.attributes),removes:Va(t.data.removes),adds:Va(t.data.adds)}));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.StyleSheetRule)return Xa(Ya(t,{adds:t.data.adds?ja(t.data.adds):void 0,removes:t.data.removes?ja(t.data.removes):void 0}))}catch(t){Na.error("could not compress event - will use uncompressed event",t)}return{event:t,size:ds(t)}}function eo(){return(eo=e((function*(t){try{if(t.type===wn.FullSnapshot)return Xa(Ka(t,yield Ua(t.data)));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.Mutation){var e=yield Promise.all([Za(t.data.texts),Za(t.data.attributes),Za(t.data.removes),Za(t.data.adds)]);return Xa(Ya(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.StyleSheetRule){var r=yield Promise.all([t.data.adds?Ua(t.data.adds):void 0,t.data.removes?Ua(t.data.removes):void 0]);return Xa(Ya(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===di})(e)&&(Ga=!0),Na.error("could not compress event asynchronously - trying synchronous compression",e),to(t)}return{event:t,size:ds(t)}}))).apply(this,arguments)}function ro(t,e){return t.type===wn.Custom&&t.data.tag===e}function io(t){return ro(t,"sessionIdle")}function no(t){return ro(t,"$session_ending")}function so(t){return ro(t,"$session_starting")}class ao{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error(La+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Ut(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get $t(){return aa(this._instance.get_property(An),this.sessionId)}get Tt(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return ni(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Yt=!1,this.Kt=[],this.Xt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.ae=!1,this.oe=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,s;if(r&&(t!==this.Bt||e!==this.Ie)){var a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(o&&this.Ft("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(a=this.Re)?void 0:a.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ln),this.he=!1,null==(n=$a())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ft("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Xt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Xt;this.Xt="unknown",this.Ee(h)}o&&this.Ft("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(s=this.Vt)||s.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Tn])===this.Bt},this.Pe=()=>{var t,e;if(0===this.De.data.length)return null;var r=null==(t=this.De.data[0])?void 0:t.timestamp,i=null==(e=this.De.data[this.De.data.length-1])?void 0:e.timestamp;return ni(r)&&ni(i)?i-r:null},this.Ne=()=>{var t,e,r=this.Wt;if(!ni(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Fe;return ni(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,s=this.Pe();return!!ri(s)||r>s||(null==(n=this._instance.persistence)||n.register({[Tn]:this.Bt}),!1)},this.qe=()=>{this.status!==Un?(this.ne&&this.ae&&this.je&&!this.oe&&(this.ne=!1),this.Be(),this.He()):this.Ue()},this.$e=()=>{this.qe()},this.ze=()=>{this.Ft("browser offline",{})},this.We=()=>{this.Ft("browser online",{})},this.Ve=()=>{null!=Ur&&Ur.visibilityState&&("visible"===Ur.visibilityState&&(this.je=!0),this.Ft("window "+Ur.visibilityState,{}))},this._instance=t,this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),i=r.windowId;this.Bt=r.sessionId,this.Ie=i,this.et=new ss(this._instance),this.X=new ns(this._instance),this.tt=new as(this._instance),this.De=this.Ue(),this.Ht.sessionTimeoutMs>this.Ut||Na.warn("session_idle_threshold_ms ("+this.Ut+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new Xs(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ze(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return ti(d)&&ti(c)&&ti(v)&&ti(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}Ge(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!ii(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!ti(i)&&i!==n}));0!==i.length&&(this.de=!0,Na.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Qe(){var t;return oi(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,bi("canvas recording resolution scale"),1)}get Je(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:oi(h,0,12,bi("canvas recording fps"),4),quality:oi(d,0,1,bi("canvas recording quality"),.4)}}get Ye(){var t,e=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Ke(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=Ea(this._instance.config.capture_performance),u=Ea(null==i?void 0:i.capturePerformance),l=!!(si(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}Xe(){var t,e,i=[],n=null==(t=Gr.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Ye&&i.push(n());var s=null==(e=Gr.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ke&&Kr(s))if(!_i.includes(Hr.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Kr(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var n,s={payloadSizeLimitBytes:Wi.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Wi.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Wi.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,u=!1!==t.capture_performance&&e.recordPerformance,l=(n=$i(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Gi(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Gi(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=Si(t.name),s=0===e.indexOf("http")?null==(i=Si(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&qi.some((t=>0===a.indexOf(t)))))return t}})((Hi((r=e).requestHeaders),Hi(r.responseHeaders),r),t.api_host,i));var r},d=Kr(t.session_recording.maskNetworkRequestFn);return d&&Kr(t.session_recording.maskCapturedNetworkRequestFn)&&yi.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:r({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Kr(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return ii(n)&&i?(Zi.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!ti(t))return t.requestBody=Vi(t.requestBody,"Request"),t.responseBody=Vi(t.responseBody,"Response"),t}(h(t)),r({},Wi,s,{recordHeaders:a,recordBody:o,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ke,a)))}else Na.info("NetworkCapture not started because we are on localhost.");return i}tr(t){return this._instance.config.disable_capture_url_hashes?li(t):t}er(t,e){void 0===e&&(e=!1);var r=e?li(t):this.tr(t),i=this._instance.config.mask_personal_data_properties?[...la,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");Xr(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}rr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ir(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Kt.length?this.Kt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Na.warn("could not emit queued rrweb event.",e,t),!1}}Ft(t,e){return this.ir(Ba((()=>Wa().addCustomEvent(t,e))))}nr(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Xt}ar(t){if(!this.nr())return!1;try{var e=Wa();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!zr)return;var t=new URL(zr.location.href),e=this.er(t.origin+t.pathname+t.search);this.hr!==e&&(this.hr=e,this.Ft("$url_changed",{href:e}))}catch(t){}}cr(){if(this.Kt.length){var t=[...this.Kt];this.Kt=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}At(){return this.ir(Ba((()=>Wa().takeFullSnapshot())))}get dr(){var t,e,r;if(null!=(t=this.Vt)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return ni(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Xt){var t=this.dr;t&&(this.pr=setInterval((()=>{this.At()}),t))}}Et(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),Na.info("recording paused due to URL blocker"),this.Ft("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.At(),this.sr(),this.vr(),this.Ft("recording resumed",{reason:"left blocked url"}),Na.info("recording resumed"))}br(t,e){var r;if("event"===t&&this.gr(),!this.Yt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Yt=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?xn:En]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Et(),this.He(),this.Rt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Yt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(_n);if(t){var e;try{e=Yr(t)?t:JSON.parse(t)}catch(t){return void Na.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Na.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(_n))}return e}}wr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.zt;if(i){this.isStarted||(this.ne=!1!==this.Xt&&!this.se,this.se=!1,this.ae=this.ne,this.oe=!1),this._e&&(this.kr(),this.Ue());var n=this.Ht.checkAndGetSessionAndWindowId(),s=n.windowId;this.Bt=n.sessionId,this.Ie=s,null==(e=this._instance.persistence)||e.unregister(Ln),null!=i&&i.endpoint&&(this.Zt=null==i?void 0:i.endpoint),this.Vt=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new ua(this._instance,this.X,this.Rt.bind(this),this.Ft.bind(this),this.Et.bind(this)):new oa(this._instance,this.X,this.tt,this.et,this.Rt.bind(this),this.At.bind(this),this.Et.bind(this)),this.Vt.onRemoteConfig(i),null==(r=this.Ot)||r.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.br(t,e))),this.wr(Mn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Mn)})),this.wr(Cn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Cn)})),this.wr(Rn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Rn)})),this.wr(In,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(In)})),this.Vt.makeSamplingDecisions(this.sessionId),this._r(),this.ue||(ki(zr,"beforeunload",this.qe),ki(zr,"pagehide",this.$e),ki(zr,"offline",this.ze),ki(zr,"online",this.We),ki(Ur,"visibilitychange",this.Ve),!this.xe&&Kr(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Kr(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",(()=>{this.Ae(),this.Xt="unknown",this.stop(),this.Me=this.Ht.onSessionId(((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)}))})):Kr(this.Ht.on)||Na.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),ii(this.Se)&&(this.Se=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Ft("$pageview",{href:e})}}catch(t){Na.error("Could not add $pageview to rrweb session",t)}}))),this.status===jn&&this.Rt(t||"recording_initialized"))}else Na.info("remote config must be stored in persistence before recording can start")}Sr(){var t,e,r,i,n,s;null==zr||zr.removeEventListener("beforeunload",this.qe),null==zr||zr.removeEventListener("pagehide",this.$e),null==zr||zr.removeEventListener("offline",this.ze),null==zr||zr.removeEventListener("online",this.We),null==Ur||Ur.removeEventListener("visibilitychange",this.Ve),clearInterval(this.pr),this.Cr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(r=this.xe)||r.call(this),this.xe=void 0,null==(i=this.Ce)||i.call(this),this.Ce=void 0,null==(n=this.Me)||n.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Mr(),this.kr()}kr(){this.ke+=1,this.be=[],this.we=0,this.Tr=void 0,this._e=!1}Mr(){var t,e,r;null==(t=this.Ir)||t.stop(),this.Kt=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Rr(){if(!this.Tr||0===this.we)return!1;if(this._e)return!0;this._e=!0;var t=this.ke;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.ke&&(this._e=!1,this.He(),this.Ue(),this.Sr(),Na.info("stopped"))})).catch((()=>{this._e=!1,this.Sr(),Na.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.He(),this.Ue(),this.Sr(),Na.info("stopped"))}Ee(t){this.Le=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=$a())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.ne=t,this.ae=!1}gr(){this.isStarted||(this.se=!0),this.ne&&(this.ne=!1,this.ae=!1,this.oe&&(this.oe=!1,this.At()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ue(),this.Mr()),this.Ue(),this.Sr(),Na.info("discarded")}Or(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==Wn?(this.Pr(t,i),this.Dr(s)):this.Ue()}Nr(){try{this.Fr()}catch(t){this.ce||(this.ce=!0,Na.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=$a())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||Na.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Pr(t,e){t.type!==wn.FullSnapshot?t.type===wn.IncrementalSnapshot&&(ti(this.me)||this.me===e||this.ye===e||(this.ye=e,Na.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.At())):this.me=e}qr(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter((e=>e!==t))}jr(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Or(t.event,e,r,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?to(t.event):{event:t.event,size:ds(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Be(){[...this.be].forEach((t=>{this.Br(t)}))}Hr(t,r,i,n){var s=this,a={event:t,compressionEnabled:r,targetSessionId:i,targetWindowId:n,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var o=function(){var i=e((function*(){try{if(a.processed)return;var e,i;try{var n=r?Qa(t)?yield function(t){return eo.apply(this,arguments)}(t):to(t):{event:t,size:ds(t)};e=n.event,i=n.size}catch(r){Na.error("could not process queued compression event - will use uncompressed event",r),e=t,i=ds(t)}s.jr(a,e,i)}finally{s.qr(a)}}));return function(){return i.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,l;if(this._instance.sessionManager&&(this.cr(),t&&Yr(t))){if(t.type===wn.Meta){var h=this.er(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(t,e))),!this.X.urlBlocked||(d=t).type===wn.Custom&&"recording paused"===d.data.tag){var d,c,v,f;t.type===wn.FullSnapshot&&(null!=(c=$a())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.he=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(v=this.Ir)||v.reset(),null==(f=this._instance.persistence)||f.register_once({[Ln]:t.timestamp},void 0));var p=t.type===wn.FullSnapshot&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));p&&this.Ur();var m=this.Ir?this.Ir.throttleMutations(t):t;if(m){var g=function(t){var e=t;if(e&&Yr(e)&&6===e.type&&Yr(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),y=function(t){return no(t)?t.data.payload:null}(g),b=function(t){return so(t)?t.data.payload:null}(g),w=function(t){return io(t)?t.data.payload:null}(g);y||b?null!=y&&y.lastActivityTimestamp&&(g.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.$r(g),t.type===wn.FullSnapshot&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var k=null!==(i=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this.Bt,_=null!==(a=null!==(o=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.Ie;if(!0!==this.Xt||function(t){return io(t)||no(t)||so(t)}(g)){g.type===wn.FullSnapshot&&(this.te=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var S=this.Qt;this.Qt=!0,p?this.sr(!0):S||this.sr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||M&&Qa(g))this.Hr(g,M,k,_);else{var C=M?to(g):{event:g,size:ds(g)};this.Or(g,C.event,C.size,k,_)}}else(function(t){return t.type===wn.FullSnapshot||t.type===wn.Meta||t.type===wn.IncrementalSnapshot&&t.data.source!==kn.CanvasMutation})(g)&&this.te++}else!0===this.Xt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.$t,rrwebError:this.ue,urlTriggerMatching:this.X,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Wn}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.At(),this.gr(),this.Rt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[An]:this.sessionId,[Sn]:null}),this.At(),this.gr(),this.Rt("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var t,e=null==zr||null==(t=zr.location)?void 0:t.href;if(!e)return;var r=this.er(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.He()}),2e3))}Vr(){return this.me!==this.De.sessionId&&0!==this.De.data.length&&this.De.data.every((t=>(null==t?void 0:t.type)===wn.Custom&&!no(t)&&!so(t)))}Zr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==Un)return ti(this.Qr)||this._instance.register_for_session({[Bn]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return ti(this.Qr)||this._instance.register_for_session({[Bn]:[]}),void(this.Qr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Qr&&(this.Qr=i,this._instance.register_for_session({[Bn]:e}),Na.info("buffering: "+r))}He(){var t;if(this.Cr(),this.ne)return this.De;if(this.Vr())return this.De.size>Da?this.Ue():this.De;var e=this.De;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Ne(),i=this.status;if(this.Gr(i),i===Un||i===Hn||i===Wn||r)return this.Lr(),this.De;if(this.De!==e)return this.De;if(e.data.length>0){var n,s=this.zr();vs(e).forEach((t=>{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.Jr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:mi.LIB_NAME,$lib_version:mi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}Dr(t){var e,r=2+((null==(e=this.De)?void 0:e.data.length)||0),i=t.$session_id,n=this.De.sessionId!==i;if(n||!0!==this.Xt&&!this.ne&&this.De.size+t.$snapshot_bytes+r>Da){var s=this.Bt;if(this.De=this.He(),this.Bt!==s)return;n&&this.De.data.length>0&&(this.De=this.Ue()),this.De.sessionId=i,this.De.windowId=t.$window_id}this.ne&&(this.oe||this.De.size+t.$snapshot_bytes+r>Da)?this.oe||(this.oe=!0,this.De=this.Ue()):(this.De.size+=t.$snapshot_bytes,this.De.data.push(t.$snapshot_data),this.De.sizes.push(t.$snapshot_bytes),!0===this.Xt||this.ne||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Fe(){var t,e,r=null==(t=this.De)?void 0:t.data[(null==(e=this.De)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Ur(){if(!this.De||0===this.De.data.length)return this.Ue();for(var t=-1,e=this.De.data.length-1;e>=0;e--)if(this.De.data[e].type===wn.Meta){t=e;break}return 0>t?this.Ue():(this.De.data=this.De.data.slice(t),this.De.sizes=this.De.sizes.slice(t),this.De.size=this.De.sizes.reduce(((t,e)=>t+e),0),this.De)}Ue(){return this.De={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.De}Rt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Na.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ft("$recording_started",r({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==Pa.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Yr(t);e||!0===this.Xt||t.timestamp-this.Jt>this.Ut&&(this.Xt=!0,clearInterval(this.pr),this.Ft("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.Ut,bufferLength:this.De.data.length,bufferSize:this.De.size,sessionId:this.Bt,windowId:this.Ie}),this.He());var r=!1;if(e&&(this.Jt=t.timestamp,this.Xt)){var i="unknown"===this.Xt;this.Xt=!1,i||(this.Ft("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Bt!==a,u=this.Ie!==s;if(this.Ie=s,this.Bt=a,o||u){var l=o&&!1!==this.Xt;l&&(this.Xt="unknown"),this.Ee(l)}else if(e&&this.gr(),r){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&d&&this.At(),this.sr(),this.vr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=$a())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.De.data.length,$sdk_debug_replay_internal_buffer_size:this.De.size,$sdk_debug_current_session_duration:this.Fe,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:xa(null==(r=this.Ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:xa(null==(i=this.Ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Ar)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:xa(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:xa(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:xa(null==(o=$a())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=$a())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,$sdk_debug_rrweb_attached:!!this.Gt,$sdk_debug_rrweb_start_attempted:this.le}}_r(){var t;if(!this.Gt){this.le=!0;var e,i,n,s,a={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var u of Object.entries(o||{})){var l=u[0],h=u[1];if(l in a)if("maskInputOptions"===l)a.maskInputOptions=r({password:!0},h);else if("sampling"===l){var d=null!=h?h:{},c={};ti(d.mousemove)||(c.mousemove=d.mousemove),ti(d.mouseInteraction)||(c.mouseInteraction=d.mouseInteraction),a.sampling=c}else a[l]=h}!0===(null==o?void 0:o.captureJsonLd)&&!0!==a.slimDOMOptions&&"all"!==a.slimDOMOptions&&(a.slimDOMOptions=r({},a.slimDOMOptions,{script:!0})),this.Je&&this.Je.enabled&&(a.recordCanvas=!0,a.sampling=r({},a.sampling,{canvas:this.Je.fps}),a.dataURLOptions={type:"image/webp",quality:this.Je.quality},a.canvasResolutionScale=this.Qe,a.canvasMasking={configured:()=>{var t;return Kr(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Kr(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,Na.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ze&&(a.maskAllInputs=null===(e=this.Ze.maskAllInputs)||void 0===e||e,a.maskTextSelector=null!==(i=this.Ze.maskTextSelector)&&void 0!==i?i:void 0,a.blockSelector=null!==(n=this.Ze.blockSelector)&&void 0!==n?n:void 0,a.maskAllElementAttributes=null!==(s=this.Ze.maskAllElementAttributes)&&void 0!==s&&s),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.ve||(this.ve=!0,Na.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Ge();var v=Wa();if(v){this.Ir=null!==(t=this.Ir)&&void 0!==t?t:new Qs(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Na.info(r,{node:e}),this.log(La+" "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.re&&this.log(La+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.At()});var f=this.Xe();if(this.Gt=v(r({emit:t=>{this.onRRwebEmit(t)},plugins:f,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,Na.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},a)),!this.Gt)return this.ue=!0,void Na.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==o?void 0:o.captureJsonLd)&&Ur&&null!=zr&&zr.MutationObserver&&!this.ur&&(this.ur=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=ha,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(Aa(r,e.blockClass,e.blockSelector)||Aa(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var o=function(t){if(!t||t.length>ha)return null;try{var e=JSON.parse(t),r=Xr(e)?e.map(Ia):Ia(e);if(ri(r)||Xr(r)&&(!r.length||r.some(ri)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!o)return void i.delete(e);var u=o[0],l=o[1];if(ri(a))return void i.set(e,l);if(i.get(e)!==l){if(l.length>s)return void(s=0);r.emit(u)&&(i.set(e,l),s-=l.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Ta(t))a(e)};for(var r of t)if("childList"===r.type)Ra(r.target)&&a(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Ra(i)&&a(i)}else"attributes"===r.type&&Ra(r.target)&&a(r.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Ta(t.documentElement).forEach((t=>{e&&i.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Ur,zr.MutationObserver,{blockClass:a.blockClass,blockSelector:a.blockSelector,maskTextClass:a.maskTextClass,maskTextSelector:a.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.Jt=Date.now(),this.Xt=si(this.Xt)?this.Xt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Ft("$session_options",{sessionRecordingOptions:a,activePlugins:f.map((t=>null==t?void 0:t.name))}),this.Ft("$posthog_config",{config:this._instance.config})}else Na.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ft(t,e)}}Gr.__PosthogExtensions__=Gr.__PosthogExtensions__||{},Gr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:Wr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:bn,options:t})},Gr.__PosthogExtensions__.rrweb={record:Ir,version:"v2",wasMaxDepthReached:()=>Kt,resetMaxDepthState(){Kt=!1,Xt=!1},getLastSnapshotCost:()=>D,getMutationCost:()=>r({},W),getDeferredStylesheetStats:()=>r({},z),getDiscardedDurationSamples:()=>I,resetSnapshotCostState(){x=0,E=0,O=0,C=0,I=0,F=S(),D=null,L=null,N=[],P=0,B=0,W={slowestBatchMs:0},z={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Gr.__PosthogExtensions__.initSessionRecording=(t,e)=>new ao(t,e)}();
|
|
1
|
+
!function(){"use strict";function t(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=e.apply(r,i);function o(e){t(a,n,s,o,u,"next",e)}function u(e){t(a,n,s,o,u,"throw",e)}o(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}var i=["type"],n=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}({}),s=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}({}),a=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}({}),o=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),u=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),l=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}({}),h=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 d(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase();var c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},f={};function p(t){if(f[t])return f[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in c?c[t]:void 0,n=Boolean(i&&i.every((t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))}))),s=t in v?v[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))})));if(n&&a)return f[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var p=h[t].prototype;return p?(d(u=navigator.userAgent,"AppleWebKit")&&!d(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),f[t]=p):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var m={};function g(t,e,r){var i,n=t+"."+String(r);if(m[n])return m[n].call(e);var s=p(t),a=null===(i=Object.getOwnPropertyDescriptor(s,r))||void 0===i?void 0:i.get;return a?(m[n]=a,a.call(e)):e[r]}var y={};function b(t,e,r){var i=t+"."+String(r);if(y[i])return y[i].bind(e);var n=p(t)[r];return"function"!=typeof n?e[r]:(y[i]=n,n.bind(e))}function w(){return p("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===s)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var _={childNodes:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),contains:(t,e)=>b("Node",t,"contains")(e),getRootNode:t=>b("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>b("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>b("Element",t,"querySelectorAll")(e),mutationObserver:w,patch:k},S=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function M(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var C=0,I=0;function R(){C+=1}function A(){return C}function T(t,e){return(e!==C||t>6e4)&&(I+=1,!0)}var x=0,E=0,O=0,F=S(),D=null,L=null,N=[],P=0,B=0,W={slowestBatchMs:0},z={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},j=t=>t&&t>0?t:null;function U(t){(x+=1)>1||(F=S(),N=[],P=0,L=j(t),E=M(),O=C)}function H(){return 0===x?D||S():(x-=1)>0?F:(F.durationMs=M()-E,F.deferredStylesheetCount=P,z.deferredCount+=P,L=null,T(F.durationMs,O)?F:D=F)}var q=32;function G(t,e,r){var i=t.length;if(r>=q)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=G(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=G(u,e,r+1))}}}catch(t){}}return i}function V(t){if(0!==x){var e=G(t,null,0);F.cssRuleCount+=e,B>0&&(F.nonDeferrableCssRuleCount+=e)}}function Z(t){B+=1;try{return t()}finally{B-=1}}function J(t){x>0&&(F.stylesheetMs+=t)}function Q(t){if(0===x||null===L)return!1;var e=F.cssRuleCount-F.nonDeferrableCssRuleCount;return e>=L||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),G(e,r,0)}catch(t){return 0}}(t)>L}function X(){z.failedCount+=1}function K(t){t>0&&(z.abandonedCount+=t)}function Y(t){return Y="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},Y(t)}function tt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Y(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Y(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function et(t){return t.nodeType===t.ELEMENT_NODE}function rt(t){var e=t&&"host"in t&&"mode"in t&&_.host(t)||null;return Boolean(e&&"shadowRoot"in e&&_.shadowRoot(e)===t)}function it(t){return"[object ShadowRoot]"==={}.toString.call(t)}function nt(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){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var at=0;function ot(t){var e=0===at,r=e?M():0;at+=1;try{var i=t.rules||t.cssRules;if(!i)return null;V(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),nt(Array.from(i,(t=>ut(t,n))).join(""))}catch(t){return null}finally{at-=1,e&&J(M()-r)}}function ut(t,e){if(ht(t)){var r;try{r=ot(t.styleSheet)||st(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return It(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return dt(t)&&t.selectorText.includes(":")&&(n=lt(n)),e?It(n,e):n}function lt(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ht(t){return"styleSheet"in t}function dt(t){return"selectorText"in t}var ct=/^-?[A-Za-z_][\w-]*$/,vt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ft(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||st(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=It(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&ht(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var 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(dt(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!ct.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?ct.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":vt.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?It(i,n):i,fixColons:"sheet"===r.kind&&dt(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&dt(r)&&r.selectorText.includes(":")&&(s=lt(s)),t.parts.push(t.sheetHref?It(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;V(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!ht(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some((t=>t.sheet===i)))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;V(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=M(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?lt(h):h}else l=nt(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{J(M()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var pt=class{constructor(){tt(this,"idNodeMap",new Map),tt(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.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){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),et(t)){var r=_.shadowRoot(t);r&&this.removeNodeFromMap(r),"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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function mt(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&>(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function gt(t){return t.toLowerCase()}var yt=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 bt(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&yt.has(gt(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var wt="__rrweb_original__";function kt(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?gt(e):null}catch(t){return null}}var _t=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,St=/^(?:[a-z+]+:)?\/\//i,Mt=/^www\..*/i,Ct=/^(data:)([^,]*),(.*)/i;function It(t,e){return(t||"").replace(_t,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(St.test(u)||Mt.test(u))return"url("+l+u+l+")";if(Ct.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var Rt,At,Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",xt=4096,Et=1e5,Ot=10,Ft=new Map,Dt=1,Lt=new RegExp("[^a-z0-9-_:]");function Nt(){return Dt++}var Pt=/^[^ \t\n\r\u000c]+/,Bt=/^[, \t\n\r\u000c]+/,$t=new WeakMap;function Wt(t,e){return e&&""!==e.trim()?zt(t,e):e}function zt(t,e){var r=$t.get(t);if(r||(r=t.createElement("a"),$t.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function jt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Tt:t}(t,e.maxBase64ImageLength):t}function Ut(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,o=null===(a=n.sheet)||void 0===a?void 0:a.href;if(o)return o}var u=Wt(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(Et>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>xt||t.naturalHeight>xt)return e;var n=Ft.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(Ft.size>=Ot){var l=Ft.keys().next().value;void 0!==l&&Ft.delete(l)}return Ft.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),jt(l,s)}if("image"===e)return jt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Wt(t,i);return"image"===e&&h.startsWith("data:")?jt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Bt),e.length>r;){var s=i(Pt);if(","===s.slice(-1))s=Wt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Wt(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?It(i,zt(t)):"object"===e&&"data"===r?Wt(t,i):i:Wt(t,i)}function Ht(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function qt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&qt(_.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&qt(_.parentNode(t),e,r)}function Gt(t,e,r,i){var n;if(et(t)){if(!_.childNodes(n=t).length)return!1}else{if(null===_.parentElement(t))return!1;n=_.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(qt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Vt(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Zt=new Map;function Jt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Qt(t){return null==t?"":t.toLowerCase()}var Xt=!1,Kt=!1;function Yt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,d=e.inlineStylesheet,c=void 0===d||d,v=e.maskInputOptions,f=void 0===v?{}:v,p=e.maskTextFn,m=e.maskInputFn,g=e.maskAllElementAttributes,y=void 0!==g&&g,b=e.maskAttributeFn,w=e.slimDOMOptions,k=e.dataURLOptions,S=void 0===k?{}:k,M=e.inlineImages,C=void 0!==M&&M,I=e.recordCanvas,R=void 0!==I&&I,A=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,O=e.iframeLoadTimeout,D=void 0===O?5e3:O,L=e.onIframeListenerRegistered,B=e.onStylesheetLoad,W=e.stylesheetLoadTimeout,z=void 0===W?5e3:W,j=e.keepIframeSrcFn,U=void 0===j?()=>!1:j,H=e.newlyAddedElement,q=void 0!==H&&H,G=e.depth,V=void 0===G?0:G,J=e.maxDepth,X=void 0===J?50:J,K=e.needsMask,Y=e.preserveWhiteSpace,tt=void 0===Y||Y;if(V>=X)return Kt=!0,Xt||(Xt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+X+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;K||(K=Gt(t,a,o,void 0===K)),x>0&&(F.nodeCount+=1);var nt,st=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,d=e.maskInputFn,c=e.maskAllElementAttributes,v=void 0!==c&&c,f=e.maskAttributeFn,p=e.dataURLOptions,m=void 0===p?{}:p,g=e.inlineImages,y=e.recordCanvas,b=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,k=e.newlyAddedElement,S=void 0!==k&&k,M=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,a=e.maskInputFn,o=e.maskAllElementAttributes,u=void 0!==o&&o,l=e.maskAttributeFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,f=e.recordCanvas,p=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,g=e.newlyAddedElement,y=void 0!==g&&g,b=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),k=function(t){if(t instanceof HTMLFormElement)return"form";var e=gt(t.tagName);return Lt.test(e)?"div":e}(t),S=new Set,M={},C=t.attributes.length,I=0;C>I;I++){var R=t.attributes[I];Ht(k,R.name)||(M[R.name]=Ut(r,k,gt(R.name),R.value,t,c))}if("link"===k&&i&&!w){var A=t.sheet;if(!A){var T=function(t){return t.href}(t);T&&!(A=Jt(r,T))&&T.includes(".css")&&(A=Jt(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;A&&(Q(A)?x>0&&(N.push(t),P+=1):E=ot(A)),E&&(delete M.rel,delete M.href,M._cssText=E)}if("style"===k&&t.sheet&&!(t.innerText||_.textContent(t)||"").trim().length){var O=Z((()=>ot(t.sheet)));O&&(M._cssText=O)}if("input"===k||"textarea"===k||"select"===k){var F=t.value,D=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&F?M.value=mt({element:t,type:kt(t),tagName:k,value:F,maskInputOptions:s,maskInputFn:a}):D&&(M.checked=D)}if("option"===k&&(t.selected&&!s.select?M.selected=!0:delete M.selected),"dialog"===k&&t.open){try{M.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){M.rr_open_mode="modal",M.ph_rr_could_not_detect_modal=!0}S.add("rr_open_mode")}if("canvas"===k&&f&&!(null==p?void 0:p()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((wt in n?n[wt]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),B=r.createElement("canvas");B.width=t.width,B.height=t.height,L!==B.toDataURL(c.type,c.quality)&&(M.rr_dataURL=L)}var W,z,j=!1;if("img"===k&&v){Rt||(Rt=r.createElement("canvas"),At=Rt.getContext("2d"));var U=t,H=U.currentSrc||U.getAttribute("src")||"<unknown-src>",q=U.crossOrigin,G=(e,r)=>j?bt({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,V=()=>{Vt(U,"load",V);try{Rt.width=U.naturalWidth,Rt.height=U.naturalHeight,At.drawImage(U,0,0);var t=Rt.toDataURL(c.type,c.quality);M.rr_dataURL=G("rr_dataURL",t)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===U.crossOrigin&&(q?M.crossOrigin=G("crossOrigin",q):U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V)}if("audio"===k||"video"===k){var J=M;J.rr_mediaState=t.paused?"paused":"played",S.add("rr_mediaState"),J.rr_mediaCurrentTime=t.currentTime,J.rr_mediaPlaybackRate=t.playbackRate,J.rr_mediaMuted=t.muted,J.rr_mediaLoop=t.loop,J.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var X,K,Y,tt=t.getBoundingClientRect(),et=tt.width,rt=tt.height,it=tt.left,nt=tt.top,st=null===(X=r.defaultView)||void 0===X?void 0:X.getComputedStyle(t);M={class:M.class,rr_width:et+"px",rr_height:rt+"px",rr_left:Math.floor(it+((null===(K=r.defaultView)||void 0===K?void 0:K.scrollX)||0))+"px",rr_top:Math.floor(nt+((null===(Y=r.defaultView)||void 0===Y?void 0:Y.scrollY)||0))+"px"},S.add("rr_width"),S.add("rr_height"),S.add("rr_left"),S.add("rr_top"),st&&(M.rr_position=st.position||"static",S.add("rr_position"),st.transform&&"none"!==st.transform&&(M.rr_transform=st.transform,S.add("rr_transform")),st.display&&st.display.startsWith("inline")&&(M.rr_display=st.display,S.add("rr_display")))}if("iframe"!==k||m(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),u||l)for(var at of Object.entries(M)){var ut=at[0],lt=at[1];"string"!=typeof lt&&null!==lt||(M[ut]=bt({element:t,name:ut,value:lt,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:S.has(ut)}))}j=!0;try{customElements.get(k)&&(W=!0)}catch(t){}return{type:h.Element,tagName:k,attributes:M,childNodes:[],isSVG:(z=t,Boolean("svg"===z.tagName||z.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:W}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,maskAllElementAttributes:v,maskAttributeFn:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:S,rootId:M});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,s=_.parentNode(t),a=s&&s.tagName,o=_.textContent(t),u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&o){try{var d;if(t.nextSibling||t.previousSibling);else if(Q(s.sheet));else if(null===(d=s.sheet)||void 0===d?void 0:d.cssRules){var c=ot(s.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(o=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}o=It(o,zt(e.doc))}return l&&(o="SCRIPT_PLACEHOLDER"),!u&&!l&&o&&r&&(o=i?i(o,_.parentElement(t)):o.replace(/[\S]/g,"*")),{type:h.Text,textContent:o||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:M});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:h.Comment,textContent:_.textContent(t)||"",rootId:M};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,keepIframeSrcFn:U,newlyAddedElement:q});if(!st)return console.warn(t,"not serialized"),null;nt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.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,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Qt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Qt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Qt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Qt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Qt(t.attributes.property).match(/^(og|twitter|fb):/)||Qt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Qt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Qt(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(Qt(t.attributes.name))||Qt(t.attributes.property).match(/^article:/)||Qt(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(Qt(t.attributes.name)))return!0}}return!1}(st,w)||!tt&&st.type===h.Text&&!st.isStyle&&!st.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Nt();var at=Object.assign(st,{id:nt});if(i.add(t,at),-2===nt)return null;T&&T(t);var ut=!l;if(at.type===h.Element){ut=ut&&!at.needBlock,delete at.needBlock;var lt=_.shadowRoot(t);lt&&it(lt)&&(at.isShadowHost=!0)}if((at.type===h.Document||at.type===h.Element)&&ut){w.headWhitespace&&at.type===h.Element&&"head"===at.tagName&&(tt=!1);var ht={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:L,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V+1,maxDepth:X};if(at.type===h.Element&&"textarea"===at.tagName&&void 0!==at.attributes.value);else for(var dt of Array.from(_.childNodes(t))){var ct=Yt(dt,ht);ct&&at.childNodes.push(ct)}var vt=null;if(et(t)&&(vt=_.shadowRoot(t)))for(var ft of Array.from(_.childNodes(vt))){var pt=Yt(ft,ht);pt&&(it(vt)&&(pt.isShadow=!0),at.childNodes.push(pt))}}var yt=_.parentNode(t);if(yt&&rt(yt)&&it(yt)&&(at.isShadow=!0),at.type===h.Element&&"iframe"===at.tagName){var _t=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),Vt(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?Vt(t,"load",a):(o=!0,Vt(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),Vt(t,"load",a)}}return t.addEventListener("load",a),()=>{Vt(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var r=Yt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:L,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V+1,maxDepth:X});r&&E(t,r)}}),D);null==L||L(t,_t)}return at.type===h.Element&&"link"===at.tagName&&"stylesheet"===at.attributes.rel&&function(e,u,l){if(!Zt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,v=!1,g=()=>{if(!v){v=!0;try{(()=>{if(B){var e=Yt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:K,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:tt,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:z,keepIframeSrcFn:U,depth:V,maxDepth:X});e&&B(t,e)}})()}finally{Zt.delete(e),d.abort()}}},k=setTimeout(g,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",g,{signal:d.signal,once:!0}),Zt.set(e,d)}}}(t,0,z),at}function te(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 ee=class t{constructor(){tt(this,"parentElement",null),tt(this,"parentNode",null),tt(this,"ownerDocument",void 0),tt(this,"firstChild",null),tt(this,"lastChild",null),tt(this,"previousSibling",null),tt(this,"nextSibling",null),tt(this,"ELEMENT_NODE",1),tt(this,"TEXT_NODE",3),tt(this,"nodeType",void 0),tt(this,"nodeName",void 0),tt(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;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 re(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>ie(r,t,e,i)}function ie(t,e,r,i){ne((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function ne(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var se="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.",ae={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};function oe(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function ue(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>ue(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ae=new Proxy(ae,{get(t,e,r){return"map"===e&&console.error(se),Reflect.get(t,e,r)}}));var le=Date.now;function he(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=_.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(i=_.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function de(){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 ve(t){return t?t.nodeType===t.ELEMENT_NODE?t:_.parentElement(t):null}function fe(t,e,r,i){if(!t)return!1;var n=ve(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(qt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function pe(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function me(t,e){if(rt(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=_.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||me(i,e))}function ge(t){return Boolean(t.changedTouches)}function ye(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function be(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function we(t){return!!t&&(t instanceof ee&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(le=()=>(new Date).getTime());var ke=class{constructor(){tt(this,"id",1),tt(this,"styleIDMap",new WeakMap),tt(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 _e(t){var e,r=null;return"getRootNode"in t&&(null===(e=_.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(t))&&(r=_.host(_.getRootNode(t))),r}function Se(t){var e=t.ownerDocument;return!!e&&(_.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=_e(r);)r=e;return r}(t);return _.contains(e,r)}(t))}function Me(t){return"__ln"in t}var Ce,Ie=class{constructor(){tt(this,"length",0),tt(this,"head",null),tt(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Me(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Me(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}},Re=(t,e)=>t+"@"+e,Ae=class{constructor(){tt(this,"frozen",!1),tt(this,"locked",!1),tt(this,"texts",[]),tt(this,"attributes",[]),tt(this,"attributeMap",new WeakMap),tt(this,"generatedAttributes",new WeakMap),tt(this,"removes",[]),tt(this,"mapRemoves",[]),tt(this,"movedMap",{}),tt(this,"addedSet",new Set),tt(this,"movedSet",new Set),tt(this,"droppedSet",new Set),tt(this,"removesSubTreeCache",new Set),tt(this,"mutationCb",void 0),tt(this,"blockClass",void 0),tt(this,"blockSelector",void 0),tt(this,"maskTextClass",void 0),tt(this,"maskTextSelector",void 0),tt(this,"inlineStylesheet",void 0),tt(this,"maskInputOptions",void 0),tt(this,"maskTextFn",void 0),tt(this,"maskInputFn",void 0),tt(this,"maskAllElementAttributes",void 0),tt(this,"maskAttributeFn",void 0),tt(this,"keepIframeSrcFn",void 0),tt(this,"recordCanvas",void 0),tt(this,"canvasMaskingConfigured",void 0),tt(this,"inlineImages",void 0),tt(this,"slimDOMOptions",void 0),tt(this,"dataURLOptions",void 0),tt(this,"doc",void 0),tt(this,"mirror",void 0),tt(this,"iframeManager",void 0),tt(this,"stylesheetManager",void 0),tt(this,"shadowDomManager",void 0),tt(this,"canvasManager",void 0),tt(this,"processedNodeManager",void 0),tt(this,"unattachedDoc",void 0),tt(this,"canvasManagerReleased",!1),tt(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),tt(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=M(),i=A();try{this.processBufferedMutations()}finally{t=M()-r,e=i,x>0||T(t,null!=e?e:C)||t>W.slowestBatchMs&&(W.slowestBatchMs=t)}}})),tt(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new Ie,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=_.parentNode(n);if(s&&Se(n)&&"TEXTAREA"!==s.tagName){var a=rt(s)?this.mirror.getId(_e(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=Yt(n,{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),be(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),we(t)&&!fe(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(_.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)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)xe(this.removesSubTreeCache,s)&&!this.movedSet.has(_.parentNode(s))||n(s);for(var a of this.addedSet)Ee(this.droppedSet,a)||xe(this.removesSubTreeCache,a)?Ee(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(_.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(_.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=_.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=_.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=_.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,a=n[0],o=n[1];"string"!=typeof o&&null!==o||(e[a]=bt({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(a)}))}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={},(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&this.mutationCb(m)})),tt(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),tt(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(_.childNodes(t),(t=>_.textContent(t)||"")).join("");e.attributes.value=mt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kt(t),value:r,maskInputFn:this.maskInputFn})})),tt(this,"processMutation",(t=>{if(!pe(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=_.textContent(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Gt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ve(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,s=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,s),o=s?i.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===a){var u=i,l=kt(u);o=mt({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(fe(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===i.tagName&&"src"===a;if(d&&!this.keepIframeSrcFn(o)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Ht(i.tagName,a)){var c,v=Ut(this.doc,gt(i.tagName),gt(a),o,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(o)&&(a="rr_src"),h.attributes[a]=v,null===(c=this.generatedAttributes.get(t.target))||void 0===c||c.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var m of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var g=p.getPropertyValue(m),y=p.getPropertyPriority(m);g!==f.style.getPropertyValue(m)||y!==f.style.getPropertyPriority(m)?h.styleDiff[m]=""===y?g:[g,y]:h._unchangedStyles[m]=[g,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(fe(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=>{var r=this.mirror.getId(e),i=rt(t.target)?this.mirror.getId(_.host(t.target)):this.mirror.getId(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||pe(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Te(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||me(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Re(r,i)]?Te(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!rt(t.target)||!it(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),_.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),tt(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(pe(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Re(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);fe(t,this.blockClass,this.blockSelector,!1)||(_.childNodes(t).forEach((t=>this.genAdds(t))),we(t)&&_.childNodes(_.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}};function Te(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),_.childNodes(i).forEach((t=>r.push(t)))}}function xe(t,e,r){return 0!==t.size&&function(t,e,r){var i=_.parentNode(e);return!!i&&t.has(i)}(t,e)}function Ee(t,e){if(0===t.size)return!1;for(var r=_.parentNode(e);r;){if(t.has(r))return!0;r=_.parentNode(r)}return!1}var Oe=function(t,e){return void 0===e&&(e="rrweb"),Ce?function(){try{return t(...arguments)}catch(t){if(Ce&&!0===Ce(t,e))return;throw t}}:t},Fe=[];function De(t){try{if("composedPath"in t){var 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 Le(t,e){var r,i=new Ae;i.init(t);try{r=new(w())(Oe(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),Fe.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Ne(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=De(t);if(a&&!fe(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=he(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[re("scroll",Oe(oe(Oe((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(re("scrollend",Oe(u),r)),()=>l.forEach((t=>t()))}function Pe(t,e){for(var r=Fe.length-1;r>=0;r--){var i=Fe[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Fe.splice(r,1))}}}var Be=["INPUT","TEXTAREA","SELECT"],$e=new WeakMap;function We(t){return function t(e,r){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){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function ze(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}var je=5e3;function Ue(t,e){var r,i,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:_.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,o=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&o?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){var t;return null===(t=o.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=o.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!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Oe((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})}))):()=>{}}function He(t,e){void 0===e&&(e={});var i,n,u=t.doc.defaultView;if(!u)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var h=[],d=Oe((()=>{if(n){n.destroy(),n.reset();var e=Fe.indexOf(n);-1!==e&&Fe.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),h.forEach((t=>t()))}));try{if(t.recordDOM){var c=Le(t,t.doc);i=c.observer,n=c.buffer}if(h.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,u="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=oe(Oe((t=>{var r=Date.now()-a;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],a=null})),u),d=Oe(oe(Oe((t=>{var e=De(t),r=ge(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=le()),l.push({x:i,y:o,id:n.getId(e),timeOffset:le()-a}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?s.Drag:t instanceof MouseEvent?s.MouseMove:s.TouchMove)})),o,{trailing:!1})),c=[re("mousemove",d,i),re("touchmove",d,i),re("drag",d,i)];return Oe((()=>{c.forEach((t=>t()))}))}(t)),h.push(function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,u=t.blockSelector,l=t.sampling;if(!1===l.mouseInteraction)return()=>{};var h=!0===l.mouseInteraction||void 0===l.mouseInteraction?{}:l.mouseInteraction,d=[],c=null;return Object.keys(a).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==h[t])).forEach((t=>{var l=gt(t),h=(t=>i=>{var l=De(i);if(!fe(l,s,u,!0)){var h=null,d=t;if("pointerType"in i){switch(i.pointerType){case"mouse":h=o.Mouse;break;case"touch":h=o.Touch;break;case"pen":h=o.Pen}h===o.Touch&&(a[t]===a.MouseDown?d="TouchStart":a[t]===a.MouseUp&&(d="TouchEnd"))}else ge(i)&&(h=o.Touch);null!==h?(c=h,(d.startsWith("Touch")&&h===o.Touch||d.startsWith("Mouse")&&h===o.Mouse)&&(h=null)):a[t]===a.Click&&(h=c,c=null);var v=ge(i)?i.changedTouches[0]:i;if(v){var f=n.getId(l),p=v.clientX,m=v.clientY;Oe(e)(r({type:a[d],id:f,x:p,y:m},null!==h&&{pointerType:h}))}}})(t);if(window.PointerEvent)switch(a[t]){case a.MouseDown:case a.MouseUp:l=l.replace("mouse","pointer");break;case a.TouchStart:case a.TouchEnd:return}d.push(re(l,h,i))})),Oe((()=>{d.forEach((t=>t()))}))}(t)),h.push(Ne(t)),h.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return re("resize",Oe(oe(Oe((()=>{var t=de(),e=ce();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:u})),h.push(function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=De(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=_.parentElement(e)),e&&c&&Be.indexOf(c)>=0&&!fe(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,m=kt(e)||"";"radio"===m||"checkbox"===m?p=e.checked:(l[c.toLowerCase()]||l[m])&&(f=mt({element:e,maskInputOptions:l,tagName:c,type:m,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var g=e.name;"radio"===m&&g&&p&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=$e.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){$e.set(t,i);var a=n.getId(t);Oe(e)(r({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>re(t,Oe(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.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=>ue(t[0],t[1],{set(){Oe(c)({target:this,isTrusted:!1})}},!1,p)))),Oe((()=>{f.forEach((t=>t()))}))}(t)),h.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Oe((t=>oe(Oe((s=>{var a=De(s);if(a&&!fe(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[re("play",o(l.Play),a),re("pause",o(l.Pause),a),re("seeked",o(l.Seeked),a),re("volumechange",o(l.VolumeChange),a),re("ratechange",o(l.RateChange),a)];return Oe((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var v=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,je),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(u);h.push(v.reset),h.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]}))),u}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,removes:[{index:o}]}))),u}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=ze(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,(()=>r({id:d,styleId:c,replace:o})),(()=>{var t=ot(e);null!==t&&r({id:d,styleId:c,replace:t})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(t){v(!1)}}catch(t){}return u}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=ze(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>r({id:h,styleId:d,replaceSync:o}))),u}),"host")}));var d={};Ge("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ge("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ge("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ge("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=ze(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...We(e),u];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]})))}return u}),"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Oe(((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=ze(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...We(e),o];a.queueMutation(e.parentStyleSheet,(()=>r({id:h,styleId:d,removes:[{index:c}]})))}return u}),"host")})})),Oe((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:u,mutationQueue:v})),h.push(Ue(t,t.doc)),h.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Oe(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=ze(v,i,s.styleMirror),p=f.id,m=f.styleId;if(p&&-1!==p||m&&-1!==m){var g=We(e.parentRule);o.queueMutation(v,(()=>r({id:p,styleId:m,set:{property:l,value:h,priority:d},index:g})))}return c}),"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Oe(((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=ze(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=We(e.parentRule);o.queueMutation(d,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),Oe((()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:u,mutationQueue:v})),t.collectFonts&&h.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=k(r.fonts,"add",(function(t){return function(r){return setTimeout(Oe((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),Oe((()=>{n.forEach((t=>t()))}))}(t))}for(var f of(h.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=Oe((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;fe(d,i,n,!0)||fe(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}}));return o(),re("selectionchange",o)}(t)),h.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?k(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t)),t.plugins))h.push(f.observer(f.callback,u,f.options))}catch(t){try{d()}catch(t){}throw t}return d}function qe(t){return void 0!==window[t]}function Ge(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Ve=class{constructor(t){tt(this,"generateIdFn",void 0),tt(this,"iframeRemoteIdToLocalIdMap",new WeakMap),tt(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},Ze=class{constructor(t){tt(this,"iframes",new WeakMap),tt(this,"crossOriginIframeMap",new WeakMap),tt(this,"crossOriginIframeMirror",new Ve(Nt)),tt(this,"crossOriginIframeStyleMirror",void 0),tt(this,"crossOriginIframeRootIdMap",new WeakMap),tt(this,"mirror",void 0),tt(this,"mutationCb",void 0),tt(this,"wrappedEmit",void 0),tt(this,"loadListener",void 0),tt(this,"pageHideListener",void 0),tt(this,"stylesheetManager",void 0),tt(this,"recordCrossOriginIframes",void 0),tt(this,"messageHandler",void 0),tt(this,"nestedIframeListeners",new Map),tt(this,"attachedWindows",new WeakMap),tt(this,"attachedDocuments",new WeakMap),tt(this,"attachedIframes",new Map),tt(this,"loadListenerDisposers",new WeakMap),tt(this,"iframeElementsById",new Map),tt(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ve(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){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>ne(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{ie(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);ne((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}ne((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null===(r=this.loadListener)||void 0===r||r.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case n.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:n.IncrementalSnapshot,data:{source:s.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case n.Meta:case n.Load:case n.DomContentLoaded:return!1;case n.Plugin:return e;case n.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case n.IncrementalSnapshot:switch(e.data.source){case s.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 s.Drag:case s.TouchMove:case s.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case s.ViewportResize:return!1;case s.MediaInteraction:case s.MouseInteraction:case s.Scroll:case s.CanvasMutation:case s.Input:return this.replaceIds(e.data,t,["id"]),e;case s.StyleSheetRule:case s.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case s.Font:return e;case s.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case s.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(ie(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(ie(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{ne((()=>this.mirror.removeNodeFromMap(t)))})),ne((()=>Pe(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&ie(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{ie(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Je=class{constructor(t){tt(this,"shadowDoms",new WeakSet),tt(this,"mutationCb",void 0),tt(this,"scrollCb",void 0),tt(this,"bypassOptions",void 0),tt(this,"mirror",void 0),tt(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 i,n;if(it(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(n=_.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==i?i:e,a=Le(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=Fe.indexOf(u);-1!==t&&Fe.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Ne(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(_.host(t))),this.restoreHandlers.push({doc:s,handler:Ue({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){var r=this;this.restoreHandlers.push({doc:e,handler:k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=_.shadowRoot(this);return s&&Se(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},Qe="skip-frame";function Xe(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tr=0;64>tr;tr++)Ye[Ke.charCodeAt(tr)]=tr;var er=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Ke[r[e]>>2],n+=Ke[(3&r[e])<<4|r[e+1]>>4],n+=Ke[(15&r[e+1])<<2|r[e+2]>>6],n+=Ke[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},rr=new Map,ir=(t,e,r)=>{if(t&&(ar(t,e)||"object"==typeof t)){var i=function(t,e){var r=rr.get(t);return r||rr.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function nr(t,e,r,i){return t instanceof Array?t.map((t=>nr(t,e,r,i))):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:er(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[nr(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[nr(t.data,e,r,i),t.width,t.height]}:ar(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ir(t,e,r)}:t}var sr=(t,e,r,i)=>t.map((t=>nr(t,e,r,i))),ar=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},or=["webgl","webgl2"];function ur(t){return"nodeType"in t}function lr(t,e,i,n){var s=[];try{if(n){var a=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||ur(a)&&fe(a,e,i,!0))return n.call(this,s);ur(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,i);a&&s.push(a)}var o=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!fe(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&or.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function hr(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=k(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(ir(d,s,this),this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,i,n,!0)){var c=sr(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(s){var h=ue(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var dr='(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',cr="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",dr],{type:"text/javascript;charset=utf-8"});function vr(t){var e;try{if(!(e=cr&&(self.URL||self.webkitURL).createObjectURL(cr)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(dr),{name:null==t?void 0:t.name})}}var fr,pr,mr,gr=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){tt(this,"pendingCanvasMutations",new Map),tt(this,"rafStamps",{latestId:0,invokeId:null}),tt(this,"mirror",void 0),tt(this,"mutationCb",void 0),tt(this,"resetObservers",void 0),tt(this,"frozen",!1),tt(this,"locked",!1),tt(this,"rafIdTimestamp",null),tt(this,"rafIdFlush",null),tt(this,"refCount",0),tt(this,"torndown",!1),tt(this,"resetFrameDedup",null),tt(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)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,r,i,n,s){var a=this;if("OffscreenCanvas"in r){var o,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,h=lr(r,i,n,!0),d=new Map;try{o=new vr}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(d.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:u["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,m=t=>{var u,h;c||(p&&f>t-p||(p=t,(u=[],h=t=>{try{t.querySelectorAll("canvas").forEach((t=>{fe(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&h(t.shadowRoot)}))}catch(t){}},h(r.document),u).forEach(function(){var t=e((function*(t){var e=a.mirror.getId(t);if(!d.get(e)&&0!==t.width&&0!==t.height){d.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void d.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,h=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(h*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Qe}if(void 0!==a){if(!Array.isArray(a)||!a.every(Xe))return Qe;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(s.canvasMasking,t,c,v,u,h);if("skip-frame"===f)return void d.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});o.postMessage({id:e,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:h,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){d.set(e,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;h(),cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=lr(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=k(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];return fe(this.canvas,r,i,!0)||setTimeout((()=>{var r=sr(l,e,this,n);t(this.canvas,{type:u["2D"],property:a,args:r})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ue(e.CanvasRenderingContext2D.prototype,a,{set(e){fe(this.canvas,r,i,!0)||t(this.canvas,{type:u["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...hr(e.WebGLRenderingContext.prototype,u.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...hr(e.WebGL2RenderingContext.prototype,u.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,i)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}},yr=class{constructor(t){var e;tt(this,"trackedLinkElements",new WeakSet),tt(this,"pendingDeferredSheets",new Set),tt(this,"mutationCb",void 0),tt(this,"adoptedStyleSheetCb",void 0),tt(this,"maskAllElementAttributes",void 0),tt(this,"maskAttributeFn",void 0),tt(this,"styleMirror",new ke),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=ft(i))}catch(t){}if(!r||!i)return X(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=M(),d=A(),c=!0;try{if(s)return o=!0,X(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(X(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(X(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),T(u=M()-h,null!=(l=d)?l:C)||(z.totalMs+=u,u>z.slowestSliceMs&&(z.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:bt({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=M();try{Z((()=>{try{var e=t.rules||t.cssRules;e&&V(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ut(e,t.href),index:r})))})}))}finally{J(M()-a)}}i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Zt.forEach((t=>t.abort())),Zt.clear()}trackStylesheetInLinkElement(t){}},br=class{constructor(){tt(this,"nodeMap",new WeakMap),tt(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}},wr=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var kr,_r=document.createElement("iframe");document.body.appendChild(_r),Array.from=(null===(kr=_r.contentWindow)||void 0===kr?void 0:kr.Array.from)||Array.from,document.body.removeChild(_r)}}catch(t){console.debug("Unable to override Array.from",t)}var Sr=new pt,Mr=new Set([s.Mutation,s.MediaInteraction,s.StyleSheetRule,s.CanvasMutation,s.Font,s.Log,s.StyleDeclaration,s.AdoptedStyleSheet]);function Cr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Ir(t){var e;void 0===t&&(t={});var i=t,a=i.emit,o=i.checkoutEveryNms,u=i.checkoutEveryNth,l=i.blockClass,h=void 0===l?"rr-block":l,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,m=void 0===p?null:p,g=i.maskTextClass,y=void 0===g?"rr-mask":g,b=i.maskTextSelector,w=void 0===b?null:b,k=i.inlineStylesheet,S=void 0===k||k,M=i.inlineStylesheetBudgetRules,C=i.maskAllInputs,I=i.maskInputOptions,A=i.slimDOMOptions,T=i.maskInputFn,x=i.maskTextFn,E=i.maskAllElementAttributes,O=void 0!==E&&E,F=i.maskAttributeFn,D=i.hooks,L=i.packFn,P=i.sampling,B=void 0===P?{}:P,W=i.dataURLOptions,z=void 0===W?{}:W,j=i.canvasResolutionScale,q=i.canvasMasking,G=i.mousemoveWait,V=i.recordDOM,Z=void 0===V||V,J=i.recordCanvas,Q=void 0!==J&&J,X=i.recordCrossOriginIframes,Y=void 0!==X&&X,tt=i.recordAfter,et=void 0===tt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":tt,rt=i.userTriggeredOnInput,it=void 0!==rt&&rt,nt=i.collectFonts,st=void 0!==nt&&nt,at=i.inlineImages,ot=void 0!==at&&at,ut=i.plugins,lt=i.keepIframeSrcFn,ht=void 0===lt?()=>!1:lt,dt=i.ignoreCSSAttributes,ct=void 0===dt?new Set([]):dt,vt=i.attributeFilter;Ce=i.errorHandler;var ft=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},z),mt=!Y||window.parent===window,gt=!1;if(!mt)try{window.parent.document&&(gt=!1)}catch(t){gt=!0}if(mt&&!a)throw new Error("emit function is required");if(!mt&&!gt)return()=>{};void 0!==G&&void 0===B.mousemove&&(B.mousemove=G),Sr.reset();var yt,bt=!0===C?{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!==I?I:{password:!0},wt=te(void 0!==A&&A);!function(t){void 0===t&&(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)}();var kt,_t,St=0,Mt=new Map,Ct=t=>{for(var e of ut||[])e.eventProcessor&&(t=e.eventProcessor(t));return L&&!gt&&(t=L(t)),t};fr=(t,e)=>{var r,i=t;if(i.timestamp=le(),!(null===(r=Fe[0])||void 0===r?void 0:r.isFrozen())||i.type===n.FullSnapshot||i.type===n.IncrementalSnapshot&&Mr.has(i.data.source)||Fe.forEach((t=>t.unfreeze())),mt)null==a||a(Ct(i),e);else if(gt){var l={type:"rrweb",event:Ct(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(l,"*")}if(i.type===n.FullSnapshot)yt=i,St=0;else if(i.type===n.IncrementalSnapshot){if(i.data.source===s.Mutation&&i.data.isAttachIframe)return;St++,(u&&St>=u||o&&i.timestamp-yt.timestamp>o)&&pr(!0)}};var It=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var a of t.adds){var o=Sr.getNode(a.node.id);o&&"IFRAME"===o.nodeName&&i.add(o)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=xt.getIframeElementById(r);n&&i.has(n)?xt.forgetIframeId(r):(null==kt||kt(r),xt.removeIframeById(r))}})),null==_t||_t(),xt.cleanupDetachedIframes()}fr({type:n.IncrementalSnapshot,data:r({source:s.Mutation},t)})},Rt=t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Scroll},t)}),At=t=>fr({type:n.IncrementalSnapshot,data:r({source:s.CanvasMutation},t)}),Tt=new yr({mutationCb:It,adoptedStyleSheetCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.AdoptedStyleSheet},t)}),maskAllElementAttributes:O,maskAttributeFn:F}),xt=new Ze({mirror:Sr,mutationCb:It,stylesheetManager:Tt,recordCrossOriginIframes:Y,wrappedEmit:fr});for(var Et of ut||[])Et.getMirror&&Et.getMirror({nodeMirror:Sr,crossOriginIframeMirror:xt.crossOriginIframeMirror,crossOriginIframeStyleMirror:xt.crossOriginIframeStyleMirror});var Ot=new br,Ft=null==q?void 0:q.configured;mr=new gr({recordCanvas:Q,mutationCb:At,win:window,blockClass:h,blockSelector:c,mirror:Sr,sampling:B.canvas,dataURLOptions:ft,resolutionScale:j,canvasMasking:q});var Dt=new Je({mutationCb:It,scrollCb:Rt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskInputOptions:bt,dataURLOptions:ft,maskTextFn:x,maskInputFn:T,maskAllElementAttributes:O,maskAttributeFn:F,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,sampling:B,slimDOMOptions:wt,iframeManager:xt,stylesheetManager:Tt,canvasManager:mr,keepIframeSrcFn:ht,processedNodeManager:Ot,attributeFilter:vt},mirror:Sr});pr=function(t){if(void 0===t&&(t=!1),Z){U(M);try{fr({type:n.Meta,data:{href:window.location.href,width:ce(),height:de()}},t),null==e||e.cancel(),e=void 0,Tt.reset(),Dt.init(),Fe.forEach((t=>t.lock()));var r,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new pt:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,m=void 0!==p&&p,g=r.recordCanvas,y=void 0!==g&&g,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,R=r.slimDOM,A=r.dataURLOptions,T=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,D=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn,P=void 0===N?()=>!1:N,B=r.maxDepth,W=r.inlineStylesheetBudgetRules,z=!0===k?{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===k?{password:!0}:k,j=te(void 0!==R&&R);U(W);try{return Yt(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:z,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:j,dataURLOptions:A,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:D,stylesheetLoadTimeout:L,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{H()}}(document,{mirror:Sr,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskAllInputs:bt,inlineStylesheetBudgetRules:M,maskTextFn:x,maskInputFn:T,maskAllElementAttributes:O,maskAttributeFn:F,slimDOM:wt,dataURLOptions:ft,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,onSerialize(t){ye(t,Sr)&&xt.addIframe(t),be(t,Sr)&&Tt.trackLinkElement(t),we(t)&&Dt.addShadowRoot(_.shadowRoot(t),document)},onIframeLoad(t,e){xt.attachIframe(t,e),Dt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){xt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Tt.attachLinkElement(t,e)},keepIframeSrcFn:ht})}finally{a=N,N=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(fr({type:n.FullSnapshot,data:{node:i,initialOffset:he(window)}},t),Fe.forEach((t=>t.unlock())),mr.onFullSnapshot(),r.length){var s=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&ne((()=>{a=e.beginDeferredLinkInlining(r,Sr.getId(r))}))},l=()=>{if(a){var t=a,e=!0;ne((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!i){var e=0;do{try{a||u(),l()}catch(t){null==a||a.discard(),a=null,K(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=Cr(h):r())}};return n=Cr(h),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);K(c),null==a||a.discard(),a=null}r()}}}}(r,Tt,(()=>{e===s&&(e=void 0)}));e=s}Y&&xt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Tt.adoptStyleSheets(document.adoptedStyleSheets,Sr.getId(document))}finally{H()}var a}};try{var Lt=[];for(var Nt of(Lt.push(re("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Lt.push(re(Nt,R,document));kt=t=>{var e=Mt.get(t);e&&(e.forEach((t=>{ne(t);var e=Lt.indexOf(t);-1!==e&&Lt.splice(e,1)})),Mt.delete(t))},_t=()=>{for(var t of Mt){var e=t[0],r=Sr.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Pt=t=>{var e;return Oe(He)({mutationCb:It,mousemoveCb:(t,e)=>fr({type:n.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.MouseInteraction},t)}),scrollCb:Rt,viewportResizeCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.ViewportResize},t)}),inputCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Input},t)}),mediaInteractionCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.MediaInteraction},t)}),styleSheetRuleCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.StyleSheetRule},t)}),styleDeclarationCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.StyleDeclaration},t)}),canvasMutationCb:At,fontCb:t=>fr({type:n.IncrementalSnapshot,data:r({source:s.Font},t)}),selectionCb(t){fr({type:n.IncrementalSnapshot,data:r({source:s.Selection},t)})},customElementCb(t){fr({type:n.IncrementalSnapshot,data:r({source:s.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:m,maskTextClass:y,maskTextSelector:w,maskInputOptions:bt,inlineStylesheet:S,sampling:B,recordDOM:Z,recordCanvas:Q,canvasMaskingConfigured:Ft,inlineImages:ot,userTriggeredOnInput:it,collectFonts:st,doc:t,maskInputFn:T,maskTextFn:x,maskAllElementAttributes:O,maskAttributeFn:F,keepIframeSrcFn:ht,blockSelector:c,slimDOMOptions:wt,dataURLOptions:ft,mirror:Sr,iframeManager:xt,stylesheetManager:Tt,shadowDomManager:Dt,processedNodeManager:Ot,canvasManager:mr,ignoreCSSAttributes:ct,attributeFilter:vt,plugins:(null==ut||null===(e=ut.filter((t=>t.observer)))||void 0===e?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>fr({type:n.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},D)};xt.addLoadListener((t=>{try{var e=Sr.getId(t),r=Pt(t.contentDocument);if("function"==typeof r&&(Lt.push(r),-1!==e)){var i=Mt.get(e);i||Mt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),xt.addPageHideListener((t=>{var e=Sr.getId(t);null==kt||kt(e),Pe(t)}));var Bt=-1,$t=t=>fr({type:n.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Wt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Sr.getId(s):-1;a!==Bt&&(-1!==Bt&&$t({id:Bt,enter:!1}),Bt=a,-1!==a&&$t({id:a,enter:!0}))},zt=()=>{pr();var t=Pt(document);"function"==typeof t&&Lt.push(t),Lt.push(re("fullscreenchange",Wt)),Lt.push(re("webkitfullscreenchange",Wt)),Lt.push(re("mozfullscreenchange",Wt)),Lt.push(re("MSFullscreenChange",Wt)),wr=!0};return["interactive","complete"].includes(document.readyState)?zt():(Lt.push(re("DOMContentLoaded",(()=>{fr({type:n.DomContentLoaded,data:{}}),"DOMContentLoaded"===et&&zt()}))),Lt.push(re("load",(()=>{fr({type:n.Load,data:{}}),"load"===et&&zt()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Lt.forEach((t=>ne(t))),Ot.destroy(),xt.removeLoadListener(),xt.destroy(),Mt.clear(),Dt.reset(),Sr.reset(),wr=!1,Ce=void 0}}catch(t){console.warn(t)}}function Rr(t){return Rr="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},Rr(t)}function Ar(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Rr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Rr(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Rr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Ir.addCustomEvent=(t,e)=>{if(!wr)throw new Error("please add custom event after start recording");fr({type:n.Custom,data:{tag:t,payload:e}})},Ir.freezePage=()=>{Fe.forEach((t=>t.freeze()))},Ir.takeFullSnapshot=t=>{if(!wr)throw new Error("please take full snapshot after start recording");pr(t)},Ir.mirror=Sr,"Mobile".toLowerCase(),"Tablet".toLowerCase();var Tr=class{constructor(t){Ar(this,"fileName",void 0),Ar(this,"functionName",void 0),Ar(this,"lineNumber",void 0),Ar(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},xr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Or=/^(eval@)?(\[native code])?$/,Fr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Er)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(Er)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Tr({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Or)}),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 Tr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Tr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Tr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Tr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(xr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Tr({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Dr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Lr(t){return Array.isArray(t)}function Nr(t){return"object"==typeof t&&null!==t&&!Lr(t)}function Pr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Nr(t[i])&&Pr(t[i],e-1))return!0;return!1}function Br(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Nr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Nr(a)&&Pr(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=Lr(l)?Dr(l.length?l[0]:null):l}return o}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 $r={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 Wr(t,e,r){var i,n=r?Object.assign({},$r,r):$r,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Fr.parse(e.error).map((t=>t.toString())),payload:[Br(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Br("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Br("Uncaught (in promise)",n.stringifyOptions),Br(e.reason,n.stringifyOptions)]),t({level:"error",trace:Fr.parse(r).map((t=>t.toString())),payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=Fr.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>Br(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Br("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[s],i=t(r);i;){if(i.next===d)return void(i.next=h.next);i=t(r=i.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var zr="u">typeof window?window:void 0,jr="u">typeof globalThis?globalThis:zr,Ur=null==jr?void 0:jr.document,Hr=null==jr?void 0:jr.location;null!=jr&&jr.XMLHttpRequest&&new jr.XMLHttpRequest;var qr="undefined"!=typeof globalThis?globalThis:zr;qr&&"undefined"==typeof self&&(qr.self=qr),qr&&"undefined"==typeof File&&(qr.File=function(){});var Gr=null!=zr?zr:{},Vr=function(t){return t.trim()},Zr=Object.prototype,Jr=Zr.hasOwnProperty,Qr=Zr.toString,Xr=Array.isArray||function(t){return"[object Array]"===Qr.call(t)},Kr=t=>"function"==typeof t,Yr=t=>t===Object(t)&&!Xr(t),ti=t=>void 0===t,ei=t=>"[object String]"==Qr.call(t),ri=t=>null===t,ii=t=>ti(t)||ri(t),ni=t=>"[object Number]"==Qr.call(t)&&t==t,si=t=>"[object Boolean]"===Qr.call(t),ai=t=>t instanceof FormData;function oi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ni(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),oi(null!=n?n:r,e,r,i))}class ui{constructor(t){this.C={},this.I=t.I,this.R=oi(t.bucketSize,0,100,t.A),this.O=oi(t.refillRate,0,this.R,t.A),this.N=oi(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}}function li(t){return t?t.split("#")[0]:t}var hi,di="NativeGzipValidationError",ci=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(di,"Native gzip produced invalid output: "+t)},vi=function(){var t=e((function*(t,e){18>t.size&&ci("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&ci("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(hi)return hi;hi=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;hi[t]=e>>>0}return hi})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&ci("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&ci("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function fi(){return fi=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield vi(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),fi.apply(this,arguments)}var pi=t=>"u">typeof Document&&t instanceof Document,mi={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},gi=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={q(e){if(zr&&(mi.DEBUG||zr.POSTHOG_DEBUG||r)&&!ti(zr.console)&&zr.console){for(var i=("__rrweb_original__"in zr.console[e]?zr.console[e].__rrweb_original__:zr.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>gi(t+" "+e,r)};return i},yi=gi("[PostHog.js]"),bi=yi.createLogger;function wi(t,e){if(!ii(t))if(Xr(t))t.forEach(e);else if(ai(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Jr.call(t,r)&&e(t[r],r)}function ki(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var _i=["localhost","127.0.0.1"],Si=t=>{var e=null==Ur?void 0:Ur.createElement("a");return ti(e)?null:(e.href=t,e)},Mi=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return wi(t,(function(t,e){ti(t)||ti(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ci=()=>{},Ii=t=>{var e;if(Kr(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Ri(t,e,r){try{if(!(e in t))return Ci;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Kr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],s=Ii(r);s;){if(s.next===n)return void(s.next=i.next);s=Ii(r=s.next)}else t[e]=i.next}}catch(t){return Ci}}function Ai(t,e){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Ti(t){var e,r=null==zr||null==(e=zr.location)?void 0:e.href;return ti(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Kr(i))return e;try{var n=i(e);return ei(n)&&n?n:e}catch(t){return yi.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var xi=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Ei=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Oi=[16,15,14,13],Fi=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Di=/[0-9A-Za-z_]/;function Li(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var Ni="[SessionRecording]",Pi="redacted",Bi=1e6;function $i(t){var e;return Math.min(Bi,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Bi)}var Wi={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:Bi,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},zi=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ji=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ui=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Hi=t=>{ii(t)||wi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return zi.includes(e)||Ui.some((t=>e.includes(t)))})(e)&&(t[e]=Pi)}))},qi=["/s/","/e/","/i/"];function Gi(t,e,r,i){if(ii(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return ei(n)&&(n=parseInt(n)),n>r?Ni+" "+i+" body too large to record ("+n+" bytes)":t}function Vi(t,e){if(ii(t))return t;var r=t;return function(t,e){if(ii(t))return!1;if(ei(t)){if(function(t){var e;for(Ei.lastIndex=0;e=Ei.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Oi){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(xi.test(o)&&Li(o))return!0}}}return!1}(t=Vr(t)))return!1;var r=function(t){var e;for(Fi.lastIndex=0;e=Fi.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Di.test(r)&&Di.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=Ni+" "+e+" body "+Pi),wi(ji,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Ni+" "+e+" body "+Pi+" as might contain: "+t)})),r}var Zi=new WeakSet,Ji=bi("[Recorder]"),Qi=t=>"navigation"===t.entryType,Xi=t=>"resource"===t.entryType;function Ki(t,e){return!!e&&(si(e)||e[t])}function Yi(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var tn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function en(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Yi(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(tn))return!1;if(si(r))return!0;if(Xr(r))return n(r);var s=r[e];return si(s)?s:n(s)}function rn(t,e,r,i,n,s){return nn.apply(this,arguments)}function nn(){return nn=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Ji.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Xi(a=t[s])&&a.initiatorType===e&&(ti(i)||a.startTime>=i)&&(ti(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),rn(t,e,r,i,n,s+1))})),nn.apply(this,arguments)}function sn(t){var e=t.body,r=t.options,i=t.url;if(ii(e))return null;var n=Ai(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(ei(e))return e;if(pi(e))return e.textContent;if(ai(e))return Mi(e);if(Yr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var an=t=>!ri(t)&&("navigation"===t.entryType||"resource"===t.entryType);function on(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[r({},e?e.toJSON():{name:l},{startTime:ti(o)?void 0:Math.round(o),endTime:ti(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(an(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var un=["video/","audio/"];function ln(t){return Yr(t)&&Kr(t.getReader)&&Kr(t.tee)}var hn=500,dn="[SessionReplay] Timeout while trying to read body",cn="[SessionReplay] Failed to read body";function vn(t){return cn+": "+t}function fn(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function pn(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(dn)),hn);try{t.clone().text().then((t=>e(t)),(t=>e(vn(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(cn)}}))}(t);var r=$i(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(fn(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel().catch((()=>{}))}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(dn)),hn);try{o=t.clone()}catch(t){return void a(cn)}var l=o.body;if(ln(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(cn)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(fn(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(vn(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(vn(t))))}catch(t){a(cn)}}))}(t,r)}function mn(){return(mn=e((function*(t){var e=t.r,r=t.options,i=Ai(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):pn(e,r)}))).apply(this,arguments)}function gn(){return(gn=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=un.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Ai(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return ri(i)?pn(e,r):Promise.resolve(i)}))).apply(this,arguments)}var yn=null;function bn(t,i,n){if(!("performance"in i))return()=>{};if(yn)return Ji.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Wi,n):Wi,a=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r||(t=>!!t&&Zi.has(t))(r)),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Qi(t)||Xi(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>on({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Qi(t)||Xi(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>on({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ki("request",r.recordHeaders),n=Ki("response",r.recordHeaders),s=Ri(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},m={},g=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=d.send.bind(d);d.send=t=>(en({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=sn({body:t,options:r,url:o})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",w),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},w=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),en({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=sn({body:d.response,options:r,url:o})),rn(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=on({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",w),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Ji.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ki("request",i.recordHeaders),s=Ki("response",i.recordHeaders),a=Ri(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l;try{u=new Request(e,o)}catch(t){return Ji.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!ln(null==o?void 0:o.body)&&en({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return mn.apply(this,arguments)}({r:u,options:i,url:e}))}catch(t){Ji.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),l=Yi(e)?yield a(u):yield a(e,o),d=r.performance.now();try{var f={};l.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),en({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return gn.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){Ji.error("Failed to record fetch response for network capture",t)}return l}finally{rn(r,"fetch",u.url,h,d).then((e=>{var r,i=on({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),yn=()=>{o(),u(),l(),yn=null}}var wn={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},kn={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},_n="$session_recording_remote_config",Sn="$replay_sample_rate",Mn="$replay_override_sampling",Cn="$replay_override_linked_flag",In="$replay_override_url_trigger",Rn="$replay_override_event_trigger",An="$session_is_sampled",Tn="$session_past_minimum_duration",xn="$session_recording_url_trigger_activated_session",En="$session_recording_event_trigger_activated_session",On="$posthog_sr_group_event_trigger_",Fn="$posthog_sr_group_url_trigger_",Dn="$posthog_sr_group_sampling_",Ln="$debug_first_full_snapshot_timestamp",Nn="$sess_rec_flush_size",Pn="$stored_person_properties",Bn="$sdk_debug_replay_pending_trigger_conditions",$n="$sdk_debug_replay_remote_trigger_matching_config",Wn="disabled",zn="sampled",jn="active",Un="buffering",Hn="paused",qn="rrweb_error",Gn="trigger",Vn=Gn+"_activated",Zn=Gn+"_pending",Jn=Gn+"_"+Wn;function Qn(t,e,r,i,n,s){return 0===e?Jn:(null==t?void 0:t.get_property(r?i+r:n))===s?Vn:Zn}function Xn(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}function Kn(t){return t.includes(Vn)?Vn:t.includes(Zn)?Zn:Jn}function Yn(t){var e=new Set(t);switch(e.delete(Jn),e.size){case 0:return Jn;case 1:return Array.from(e)[0];default:return Zn}}class ts{constructor(t){this.j=t}triggerStatus(t){return Kn(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Kn(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class es{constructor(t){this.j=t}triggerStatus(t){return Yn(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return Yn(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class rs{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Vn}stop(){}}var is=t=>"sessionRecording"in t;class ns{constructor(t,e){this.B=[],this.H=[],this.U=new Map,this.$=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,r;this.B=(is(t)?Yr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(is(t)?Yr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.U.clear(),this.$.clear(),this.B))if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){yi.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.$.has(e.url))try{this.$.set(e.url,new RegExp(e.url))}catch(t){yi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return Qn(this._instance,this.B.length,this.V,Fn,xn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Ti(this._instance);if(!t)return!1;try{return Xn(t,this.H,this.$)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=Ti(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=Xn(r,this.H,this.$);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=Ti(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=Xn(n,this.H,this.$);a&&!s?t():!a&&s&&e();var o=this.G(i)===Vn,u=Xn(n,this.B,this.U);!o&&u&&r("url",n)}}stop(){this.W=""}}class ss{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}triggerStatusNoSideEffects(){var t=Zn;return ii(this.linkedFlag)&&(t=Jn),this.linkedFlagSeen&&(t=Vn),t}onConfig(t,e){var r;if(this.linkedFlag=(is(t)?Yr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!ii(this.linkedFlag)&&!this.linkedFlagSeen){var i=ei(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=ei(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Yr(r)&&i in r){var a=r[i];s=si(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class as{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(is(t)?Yr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return Qn(this._instance,this.Y.length,this.V,On,En,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,r){if(0!==this.Y.length){var i=this.K(r)===Vn,n=this.Y.includes(t);!i&&n&&e("event",t)}}stop(){}}class os{constructor(t,e,r){if(this._instance=t,this.group=e,this.X=new ns(t,e.id),this.tt=new as(t,e.id),this.et=new ss(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.X.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var s=[this.tt,this.X,this.et];this.rt="any"===e.conditions.matchType?new ts(s):new es(s)}else this.rt=new rs}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==Zn?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===Zn)).map((t=>t.label))}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.X.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Fn+this.group.id:On+this.group.id]:e})}stop(){this.X.stop(),this.tt.stop(),this.et.stop()}}function us(t){if(t.rrwebError)return qn;if(!t.receivedFlags)return Un;if(!t.isRecordingEnabled)return Wn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=!0===t.isSampled,r=new ts([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?zn:r===Vn?jn:r===Zn?Un:!1===t.isSampled?Wn:jn}function ls(t){if(t.rrwebError)return qn;if(!t.receivedFlags)return Un;if(!t.isRecordingEnabled)return Wn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=new es([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Jn,i=si(t.isSampled);return r&&e===Zn?Un:r&&e===Jn||i&&!t.isSampled?Wn:!0===t.isSampled?zn:jn}function hs(){var t=[];return function(e,r){if(Yr(r)||Xr(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function ds(t){var e=JSON.stringify(t,hs());return e?new Blob([e]).size:0}function cs(t){if(ri(t))return 4;if(ti(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(Xr(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=ti(i)||ri(i)?4:cs(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];ti(u)||(a||(s+=1),a=!1,s+=o.length+3+cs(u))}return s;default:return 0}}function vs(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[vs({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),vs({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var fs=Uint8Array,ps=Uint16Array,ms=Uint32Array,gs=new fs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ys=new fs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),bs=new fs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ws=function(t,e){for(var r=new ps(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ms(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ks=ws(gs,2),_s=ks[1];ks[0][28]=258,_s[258]=28;for(var Ss=ws(ys,0)[1],Ms=new ps(32768),Cs=0;32768>Cs;++Cs){var Is=(43690&Cs)>>>1|(21845&Cs)<<1;Ms[Cs]=((65280&(Is=(61680&(Is=(52428&Is)>>>2|(13107&Is)<<2))>>>4|(3855&Is)<<4))>>>8|(255&Is)<<8)>>>1}var Rs=function(t,e,r){for(var i=t.length,n=0,s=new ps(e);i>n;++n)++s[t[n]-1];var a,o=new ps(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new ps(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[Ms[d]>>>u]=l}else for(a=new ps(i),n=0;i>n;++n)a[n]=Ms[o[t[n]-1]++]>>>15-t[n];return a},As=new fs(288);for(Cs=0;144>Cs;++Cs)As[Cs]=8;for(Cs=144;256>Cs;++Cs)As[Cs]=9;for(Cs=256;280>Cs;++Cs)As[Cs]=7;for(Cs=280;288>Cs;++Cs)As[Cs]=8;var Ts=new fs(32);for(Cs=0;32>Cs;++Cs)Ts[Cs]=5;var xs=Rs(As,9,0),Es=Rs(Ts,5,0),Os=function(t){return(t/8>>0)+(7&t&&1)},Fs=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof ps?ps:t instanceof ms?ms:fs)(r-e);return i.set(t.subarray(e,r)),i},Ds=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ls=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Ns=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new fs(0),0];if(1==n){var a=new fs(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new ps(c+1),f=Ps(r[h-1],v,0);if(f>e){i=0;var p=0,m=f-e,g=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=g-(1<<f-v[y]),v[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new fs(v),f]},Ps=function(t,e,r){return-1==t.s?Math.max(Ps(t.l,e,r+1),Ps(t.r,e,r+1)):e[t.s]=r},Bs=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new ps(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},$s=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ws=function(t,e,r){var i=r.length,n=Os(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},zs=function(t,e,r,i,n,s,a,o,u,l,h){Ds(e,h++,r),++n[256];for(var d=Ns(n,15),c=d[0],v=d[1],f=Ns(s,15),p=f[0],m=f[1],g=Bs(c),y=g[0],b=g[1],w=Bs(p),k=w[0],_=w[1],S=new ps(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;k.length>M;++M)S[31&k[M]]++;for(var C=Ns(S,7),I=C[0],R=C[1],A=19;A>4&&!I[bs[A-1]];--A);var T,x,E,O,F=l+5<<3,D=$s(n,As)+$s(s,Ts)+a,L=$s(n,c)+$s(s,p)+a+14+3*A+$s(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&L>=F)return Ws(e,h,t.subarray(u,u+l));if(Ds(e,h,1+(D>L)),h+=2,D>L){T=Rs(c,v,0),x=c,E=Rs(p,m,0),O=p;var N=Rs(I,R,0);for(Ds(e,h,b-257),Ds(e,h+5,_-1),Ds(e,h+10,A-4),h+=14,M=0;A>M;++M)Ds(e,h+3*M,I[bs[M]]);h+=3*A;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(M=0;W.length>M;++M)Ds(e,h,N[z=31&W[M]]),h+=I[z],z>15&&(Ds(e,h,W[M]>>>5&127),h+=W[M]>>>12)}}else T=xs,x=As,E=Es,O=Ts;for(M=0;o>M;++M)if(i[M]>255){var z;Ls(e,h,T[257+(z=i[M]>>>18&31)]),h+=x[z+257],z>7&&(Ds(e,h,i[M]>>>23&31),h+=gs[z]);var j=31&i[M];Ls(e,h,E[j]),h+=O[j],j>3&&(Ls(e,h,i[M]>>>5&8191),h+=ys[j])}else Ls(e,h,T[i[M]]),h+=x[i[M]];return Ls(e,h,T[256]),h+x[256]},js=new ms([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Us=function(){for(var t=new ms(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Hs=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Us[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},qs=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new fs(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=Ws(u,l,t.subarray(h,d)):(u[h]=true,l=Ws(u,l,t.subarray(h,a)))}else{for(var c=js[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,m=new ps(32768),g=new ps(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new ms(25e3),_=new ps(288),S=new ps(32),M=0,C=0,I=(h=0,0),R=0,A=0;a>h;++h){var T=w(h),x=32767&h,E=g[T];if(m[x]=E,g[T]=x,h>=R){var O=a-h;if((M>7e3||I>24576)&&O>423){l=zs(t,u,0,k,_,S,C,I,A,h-A,l),I=M=C=0,A=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,L=0,N=f,P=x-E&32767;if(O>2&&T==w(h-P))for(var B=Math.min(v,O)-1,W=Math.min(32767,h),z=Math.min(258,O);W>=P&&--N&&x!=E;){if(t[h+D]==t[h+D-P]){for(var j=0;z>j&&t[h+j]==t[h+j-P];++j);if(j>D){if(D=j,L=P,j>B)break;var U=Math.min(P,j-2),H=0;for(F=0;U>F;++F){var q=h-P+F+32768&32767,G=q-m[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(x=E)-(E=m[x])+32768&32767}if(L){k[I++]=268435456|_s[D]<<18|Ss[L];var V=31&_s[D],Z=31&Ss[L];C+=gs[V]+ys[Z],++_[257+V],++S[Z],R=h+D,++M}else k[I++]=t[h],++_[t[h]]}}l=zs(t,u,true,k,_,S,C,I,A,h-A,l)}return Fs(o,0,i+Os(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},Gs=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Vs=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Gs(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},Zs=function(t){return 10+(t.filename&&t.filename.length+1||0)};function Js(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class Qs{constructor(t,e){var r,i,n,s;void 0===e&&(e={}),this.it={},this.nt=Date.now(),this.ot=-1/0,this.st=()=>{var t=Date.now(),e=t-this.nt;e>0?(this.ut=Math.min(this.ht,this.ut+e/1e3*this.ct),this.nt=t):this.nt=t},this.dt=t=>{if(!this.it[t]){var e,r;this.it[t]=!0;var i=this.vt(t);null==(e=(r=this.ft).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.yt(t.id);return!this.wt.consumeRateLimit(e[0])&&t}));var n,s,a=i-e.attributes.length;a>0&&(null==(n=(s=this.ft).onDroppedAttributeMutations)||n.call(s,a))}var o=this.bt(e);if(0!==o||r===o){if(this.kt)return t;this.st();var u,l,h=cs(t);return h>this.ut?(null==(u=(l=this.ft).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ut-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.ot));this.St=setTimeout((()=>{var t,e;this.St=void 0,this.ot=Date.now(),null==(t=(e=this.ft).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.ft=e,this.wt=new ui({bucketSize:null!==(r=this.ft.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ft.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.dt,A:yi}),this.ht=null!==(n=this.ft.bytesBucketSize)&&void 0!==n?n:0,this.ct=null!==(s=this.ft.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ht)||0>=this.ht,this.ut=this.ht;var a=this.ft.resyncIntervalMs;this.xt=ni(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.it={},this.St&&(clearTimeout(this.St),this.St=void 0),this.ot=Date.now()}stop(){this.wt.stop(),this.reset(),this.ut=this.ht,this.nt=Date.now(),this.ot=-1/0}}mi.DEBUG=!1,mi.LIB_VERSION="1.427.2",mi.LIB_NAME="web";class Xs{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(Nn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct(Nn);return Yr(e=r)&&ei(e.sessionId)&&ni(e.size)&&r.sessionId===t?r.size:0}}function Ks(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<oi(100*e,0,100,yi)}var Ys=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},ta=t=>t.toLowerCase(),ea={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Ys(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ys(e,t))))),icontains:(t,e)=>e.map(ta).some((e=>t.map(ta).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ta).every((e=>t.map(ta).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},ra=new Set(["is_not","not_icontains","not_regex"]);function ia(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(ti(n)||ri(n))return ra.has(s);var a=ea[s];return!!a&&!ti(t.value)&&!ri(t.value)&&a(Xr(t.value)?t.value.map(String):[String(t.value)],Xr(n)?n.map(String):[String(n)])}))}var na=bi("[SessionRecording]");function sa(t,e){return e?t:"!"+t}function aa(t,e){return t===e||t!=="!"+e&&null}class oa{constructor(t,e,r,i,n,s,a){this.Tt=null,this.It=ls,this._instance=t,this.X=e,this.tt=r,this.et=i,this.Rt=n,this.At=s,this.Et=a}onRemoteConfig(t){this.Tt=ni(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ts([this.tt,this.X]),this.It=us):(this.Lt=new es([this.tt,this.X]),this.It=ls),this._instance.register_for_session({[$n]:t.triggerMatchType}),this.X.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,((t,e)=>{this.Rt("linked_flag_matched",{flag:t,variant:e}),this.Et()}))}getStatus(t){return this.It({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return ni(r)?r:null}checkUrlTriggers(t,e,r,i){this.X.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.Y.length&&ii(this.Ot))return this.Ot=t((t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){na.error("Could not activate event trigger",t)}})),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.Tt;if(!ni(n))return null==(r=this._instance.persistence)||r.unregister(An),void(null==(i=this._instance.persistence)||i.unregister(Sn));var s=this._instance.get_property(An),a=this._instance.get_property(Sn),o=aa(s,t),u=ni(a)&&a!==n,l=ti(a)&&s===t,h=u||l||!si(o),d=h?Ks(t,n):o;h&&(d?this.Rt("sampled"):na.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[An]:sa(t,d),[Sn]:ri(a)&&s===t?null:n})}ensureSamplingDecision(t){if(ni(this.Tt)){var e=this._instance.get_property(An);si(aa(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(En),null==(e=this._instance.persistence)||e.unregister(xn),null==(r=this._instance.persistence)||r.unregister(An),null==(i=this._instance.persistence)||i.unregister(Sn),null==(n=this._instance.persistence)||n.unregister(Tn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Zn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter((t=>t.status===Zn)).map((t=>t.label))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.X.stop(),this.et.stop()}}class ua{constructor(t,e,r,i,n){this.Pt=[],this.Dt=new Map,this.Nt=!1,this._instance=t,this.X=e,this.Rt=r,this.Ft=i,this.Et=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[$n]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.X.onConfig(t)):na.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return qn;if(t.urlTriggerMatching.urlBlocked)return Hn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Wn;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===Vn){var o=s.group.id,u=r.get(o);ti(u)?yi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===Zn&&(i=!0)}return n?zn:i?Un:Wn}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Dt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;ni(i)&&(ri(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.X.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Et(e))}),t)};for(var a of this.Pt)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t((t=>{var r;if(this.Nt)return na.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.jt(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Pn);s.some((e=>!e.properties||0===e.properties.length||ia(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Et(n))}}),e)};for(var s of this.Pt)n(s)}catch(t){na.error("Could not activate event trigger for trigger groups",t)}})),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,s=i.sampleRate,a=Dn+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Yr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=ni(v)&&v!==s,u=c===t&&ni(v)&&v===s&&si(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!si(u),m=p?Ks(t+n,s):u;p&&this.Ft("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:m}),this.Dt.set(n,m),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:m}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(An),null==(e=this._instance.persistence)||e.unregister(Sn),null==(r=this._instance.persistence)||r.unregister(Tn),this.Pt)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(On+o),null==(s=this._instance.persistence)||s.unregister(Fn+o),null==(a=this._instance.persistence)||a.unregister(Dn+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Dt.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Pt)if(e.triggerStatus(t)===Zn)return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap((e=>e.triggerStatusNoSideEffects(t)!==Zn?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear(),this.X.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||ia(r,e,this._instance.get_property(Pn))}qt(t){var e=this;this.Pt.forEach((t=>t.stop())),this.Pt=[],this.Dt.clear();var r=function(t){var r=new os(e._instance,t,((r,i)=>{e.Rt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Et()}));e.Pt.push(r)};for(var i of t)r(i)}}var la=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ha=1e5,da="https://schema.org",ca=[],va="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),fa="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),pa="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ma="Accommodation AdministrativeArea Country Place State".split(" "),ga={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:fa,publisher:pa},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ca},Offer:{seller:pa},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:pa,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:pa,areaServed:ma,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ca}},ya={},ba=[[fa,ya],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),ga.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ga.Event],[pa,ga.Organization],[ma,ga.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ga.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),ya]],wa="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ka(t,e){return Jr.call(t,e)?t[e]:void 0}function _a(t){var e=typeof t;return ri(t)||"string"===e||"number"===e||"boolean"===e}function Sa(t){return _a(t)||Xr(t)&&t.every(_a)?t:void 0}function Ma(t){if(Jr.call(ga,t))return ga[t];for(var e of ba){var r=e[1];if(e[0].includes(t))return r}return wa.includes(t)?ya:void 0}function Ca(t,e){if(!Yr(t))return null;var r=ka(t,"@type"),i=function(t){return("string"==typeof t?[t]:Xr(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!Ma(t)))}(r).filter((t=>!e||!e.length||e.includes(t)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},s=Sa(ka(t,"@id"));for(var a of(ti(s)||(n["@id"]=s),va)){var o=Sa(ka(t,a));ti(o)||(n[a]=o)}for(var u of i){var l=Ma(u),h=function(){var e=ka(t,d),r=l[d];if(!0===r){var i=Sa(e);ti(i)||(n[d]=i)}else if(Xr(e)){var s=e.map((t=>Ca(t,r))).filter(Yr);s.length&&(n[d]=s)}else{var a=Ca(e,r);a&&(n[d]=a)}};for(var d of Object.keys(l))h()}return n}function Ia(t){if(!Yr(t))return null;var e=ka(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=Ca(t);if(i)return r({"@context":da},i);var n=ka(t,"@graph");if(!Xr(n))return null;var s=n.map((t=>Ca(t))).filter(Yr);return s.length?{"@context":da,"@graph":s}:null}function Ra(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Aa(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ta(t){return Ra(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ra)}function xa(t){return ti(t)?void 0:Math.round(t)}function Ea(t){return Yr(t)?t.network_timing:t}var Oa,Fa,Da=943718.4,La="[SessionRecording]",Na=bi(La),Pa=[kn.MouseMove,kn.MouseInteraction,kn.Scroll,kn.ViewportResize,kn.Input,kn.TouchMove,kn.MediaInteraction,kn.Drag],Ba=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function $a(){var t;return null==Gr||null==(t=Gr.__PosthogExtensions__)?void 0:t.rrweb}function Wa(){var t;return null==(t=$a())?void 0:t.record}function za(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,hs())}}function ja(t){return Js(function(t,e){void 0===e&&(e={});var r=Hs(),i=t.length;r.p(t);var n=qs(t,e,Zs(e),8),s=n.length;return Vs(n,e),Gs(n,s-8,r.d()),Gs(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new fs(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new fs(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return Fs(i,0,n)}(za(t))))}function Ua(t){return Ha.apply(this,arguments)}function Ha(){return Ha=e((function*(t){var e=za(t),r=yield function(t,e,r){return fi.apply(this,arguments)}(e,mi.DEBUG,{rethrow:!0});return Js(new Uint8Array(yield r.arrayBuffer()))})),Ha.apply(this,arguments)}var qa="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Ga=!1;function Va(t){return Xr(t)&&0===t.length?Oa=null!=Oa?Oa:ja([]):ja(t)}function Za(t){return Ja.apply(this,arguments)}function Ja(){return(Ja=e((function*(t){return Xr(t)&&0===t.length?Oa||(Fa=null!=Fa?Fa:Ua([]).then((t=>(Oa=t,t))).catch((t=>{throw Oa=void 0,Fa=void 0,t}))):Ua(t)}))).apply(this,arguments)}function Qa(t){return qa&&!Ga&&function(t){return t.type===wn.FullSnapshot||t.type===wn.IncrementalSnapshot&&(t.data.source===kn.Mutation||t.data.source===kn.StyleSheetRule)}(t)}function Xa(t){return{event:t,size:cs(t)}}function Ka(t,e){return r({},t,{data:e,cv:"2024-10"})}function Ya(t,e){return r({},t,{cv:"2024-10",data:r({},t.data,e)})}function to(t){try{if(t.type===wn.FullSnapshot)return Xa(Ka(t,ja(t.data)));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.Mutation)return Xa(Ya(t,{texts:Va(t.data.texts),attributes:Va(t.data.attributes),removes:Va(t.data.removes),adds:Va(t.data.adds)}));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.StyleSheetRule)return Xa(Ya(t,{adds:t.data.adds?ja(t.data.adds):void 0,removes:t.data.removes?ja(t.data.removes):void 0}))}catch(t){Na.error("could not compress event - will use uncompressed event",t)}return{event:t,size:ds(t)}}function eo(){return(eo=e((function*(t){try{if(t.type===wn.FullSnapshot)return Xa(Ka(t,yield Ua(t.data)));if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.Mutation){var e=yield Promise.all([Za(t.data.texts),Za(t.data.attributes),Za(t.data.removes),Za(t.data.adds)]);return Xa(Ya(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===wn.IncrementalSnapshot&&t.data.source===kn.StyleSheetRule){var r=yield Promise.all([t.data.adds?Ua(t.data.adds):void 0,t.data.removes?Ua(t.data.removes):void 0]);return Xa(Ya(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===di})(e)&&(Ga=!0),Na.error("could not compress event asynchronously - trying synchronous compression",e),to(t)}return{event:t,size:ds(t)}}))).apply(this,arguments)}function ro(t,e){return t.type===wn.Custom&&t.data.tag===e}function io(t){return ro(t,"sessionIdle")}function no(t){return ro(t,"$session_ending")}function so(t){return ro(t,"$session_starting")}class ao{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error(La+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Ut(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get $t(){return aa(this._instance.get_property(An),this.sessionId)}get Tt(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return ni(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Yt=!1,this.Kt=[],this.Xt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.ae=!1,this.oe=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,s;if(r&&(t!==this.Bt||e!==this.Ie)){var a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(o&&this.Ft("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(a=this.Re)?void 0:a.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ln),this.he=!1,null==(n=$a())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ft("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Xt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Xt;this.Xt="unknown",this.Ee(h)}o&&this.Ft("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(s=this.Vt)||s.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Tn])===this.Bt},this.Pe=()=>{var t,e;if(0===this.De.data.length)return null;var r=null==(t=this.De.data[0])?void 0:t.timestamp,i=null==(e=this.De.data[this.De.data.length-1])?void 0:e.timestamp;return ni(r)&&ni(i)?i-r:null},this.Ne=()=>{var t,e,r=this.Wt;if(!ni(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Fe;return ni(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,s=this.Pe();return!!ri(s)||r>s||(null==(n=this._instance.persistence)||n.register({[Tn]:this.Bt}),!1)},this.qe=()=>{this.status!==Un?(this.ne&&this.ae&&this.je&&!this.oe&&(this.ne=!1),this.Be(),this.He()):this.Ue()},this.$e=()=>{this.qe()},this.ze=()=>{this.Ft("browser offline",{})},this.We=()=>{this.Ft("browser online",{})},this.Ve=()=>{null!=Ur&&Ur.visibilityState&&("visible"===Ur.visibilityState&&(this.je=!0),this.Ft("window "+Ur.visibilityState,{}))},this._instance=t,this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),i=r.windowId;this.Bt=r.sessionId,this.Ie=i,this.et=new ss(this._instance),this.X=new ns(this._instance),this.tt=new as(this._instance),this.De=this.Ue(),this.Ht.sessionTimeoutMs>this.Ut||Na.warn("session_idle_threshold_ms ("+this.Ut+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new Xs(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ze(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return ti(d)&&ti(c)&&ti(v)&&ti(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}Ge(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!ii(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!ti(i)&&i!==n}));0!==i.length&&(this.de=!0,Na.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get Qe(){var t;return oi(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,bi("canvas recording resolution scale"),1)}get Je(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:oi(h,0,12,bi("canvas recording fps"),4),quality:oi(d,0,1,bi("canvas recording quality"),.4)}}get Ye(){var t,e=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Ke(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=Ea(this._instance.config.capture_performance),u=Ea(null==i?void 0:i.capturePerformance),l=!!(si(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}Xe(){var t,e,i=[],n=null==(t=Gr.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Ye&&i.push(n());var s=null==(e=Gr.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ke&&Kr(s))if(!_i.includes(Hr.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Kr(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var n,s={payloadSizeLimitBytes:Wi.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Wi.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Wi.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,u=!1!==t.capture_performance&&e.recordPerformance,l=(n=$i(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Gi(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Gi(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=Si(t.name),s=0===e.indexOf("http")?null==(i=Si(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&qi.some((t=>0===a.indexOf(t)))))return t}})((Hi((r=e).requestHeaders),Hi(r.responseHeaders),r),t.api_host,i));var r},d=Kr(t.session_recording.maskNetworkRequestFn);return d&&Kr(t.session_recording.maskCapturedNetworkRequestFn)&&yi.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:r({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Kr(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return ii(n)&&i?(Zi.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!ti(t))return t.requestBody=Vi(t.requestBody,"Request"),t.responseBody=Vi(t.responseBody,"Response"),t}(h(t)),r({},Wi,s,{recordHeaders:a,recordBody:o,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ke,a)))}else Na.info("NetworkCapture not started because we are on localhost.");return i}tr(t){return this._instance.config.disable_capture_url_hashes?li(t):t}er(t,e){void 0===e&&(e=!1);var r=e?li(t):this.tr(t),i=this._instance.config.mask_personal_data_properties?[...la,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");Xr(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}rr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ir(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Kt.length?this.Kt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Na.warn("could not emit queued rrweb event.",e,t),!1}}Ft(t,e){return this.ir(Ba((()=>Wa().addCustomEvent(t,e))))}nr(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Xt}ar(t){if(!this.nr())return!1;try{var e=Wa();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!zr)return;var t=new URL(zr.location.href),e=this.er(t.origin+t.pathname+t.search);this.hr!==e&&(this.hr=e,this.Ft("$url_changed",{href:e}))}catch(t){}}cr(){if(this.Kt.length){var t=[...this.Kt];this.Kt=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}At(){return this.ir(Ba((()=>Wa().takeFullSnapshot())))}get dr(){var t,e,r;if(null!=(t=this.Vt)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return ni(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Xt){var t=this.dr;t&&(this.pr=setInterval((()=>{this.At()}),t))}}Et(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),Na.info("recording paused due to URL blocker"),this.Ft("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.At(),this.sr(),this.vr(),this.Ft("recording resumed",{reason:"left blocked url"}),Na.info("recording resumed"))}br(t,e){var r;if("event"===t&&this.gr(),!this.Yt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Yt=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?xn:En]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Et(),this.He(),this.Rt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Yt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(_n);if(t){var e;try{e=Yr(t)?t:JSON.parse(t)}catch(t){return void Na.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Na.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(_n))}return e}}wr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.zt;if(i){this.isStarted||(this.ne=!1!==this.Xt&&!this.se,this.se=!1,this.ae=this.ne,this.oe=!1),this._e&&(this.kr(),this.Ue());var n=this.Ht.checkAndGetSessionAndWindowId(),s=n.windowId;this.Bt=n.sessionId,this.Ie=s,null==(e=this._instance.persistence)||e.unregister(Ln),null!=i&&i.endpoint&&(this.Zt=null==i?void 0:i.endpoint),this.Vt=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new ua(this._instance,this.X,this.Rt.bind(this),this.Ft.bind(this),this.Et.bind(this)):new oa(this._instance,this.X,this.tt,this.et,this.Rt.bind(this),this.At.bind(this),this.Et.bind(this)),this.Vt.onRemoteConfig(i),null==(r=this.Ot)||r.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.br(t,e))),this.wr(Mn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Mn)})),this.wr(Cn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Cn)})),this.wr(Rn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Rn)})),this.wr(In,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(In)})),this.Vt.makeSamplingDecisions(this.sessionId),this._r(),this.ue||(ki(zr,"beforeunload",this.qe),ki(zr,"pagehide",this.$e),ki(zr,"offline",this.ze),ki(zr,"online",this.We),ki(Ur,"visibilitychange",this.Ve),!this.xe&&Kr(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Kr(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",(()=>{this.Ae(),this.Xt="unknown",this.stop(),this.Me=this.Ht.onSessionId(((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)}))})):Kr(this.Ht.on)||Na.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),ii(this.Se)&&(this.Se=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Ft("$pageview",{href:e})}}catch(t){Na.error("Could not add $pageview to rrweb session",t)}}))),this.status===jn&&this.Rt(t||"recording_initialized"))}else Na.info("remote config must be stored in persistence before recording can start")}Sr(){var t,e,r,i,n,s;null==zr||zr.removeEventListener("beforeunload",this.qe),null==zr||zr.removeEventListener("pagehide",this.$e),null==zr||zr.removeEventListener("offline",this.ze),null==zr||zr.removeEventListener("online",this.We),null==Ur||Ur.removeEventListener("visibilitychange",this.Ve),clearInterval(this.pr),this.Cr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(r=this.xe)||r.call(this),this.xe=void 0,null==(i=this.Ce)||i.call(this),this.Ce=void 0,null==(n=this.Me)||n.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Mr(),this.kr()}kr(){this.ke+=1,this.be=[],this.we=0,this.Tr=void 0,this._e=!1}Mr(){var t,e,r;null==(t=this.Ir)||t.stop(),this.Kt=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Rr(){if(!this.Tr||0===this.we)return!1;if(this._e)return!0;this._e=!0;var t=this.ke;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.ke&&(this._e=!1,this.He(),this.Ue(),this.Sr(),Na.info("stopped"))})).catch((()=>{this._e=!1,this.Sr(),Na.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.He(),this.Ue(),this.Sr(),Na.info("stopped"))}Ee(t){this.Le=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=$a())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.ne=t,this.ae=!1}gr(){this.isStarted||(this.se=!0),this.ne&&(this.ne=!1,this.ae=!1,this.oe&&(this.oe=!1,this.At()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ue(),this.Mr()),this.Ue(),this.Sr(),Na.info("discarded")}Or(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==Wn?(this.Pr(t,i),this.Dr(s)):this.Ue()}Nr(){try{this.Fr()}catch(t){this.ce||(this.ce=!0,Na.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=$a())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||Na.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Pr(t,e){t.type!==wn.FullSnapshot?t.type===wn.IncrementalSnapshot&&(ti(this.me)||this.me===e||this.ye===e||(this.ye=e,Na.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.At())):this.me=e}qr(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter((e=>e!==t))}jr(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Or(t.event,e,r,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?to(t.event):{event:t.event,size:ds(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Be(){[...this.be].forEach((t=>{this.Br(t)}))}Hr(t,r,i,n){var s=this,a={event:t,compressionEnabled:r,targetSessionId:i,targetWindowId:n,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var o=function(){var i=e((function*(){try{if(a.processed)return;var e,i;try{var n=r?Qa(t)?yield function(t){return eo.apply(this,arguments)}(t):to(t):{event:t,size:ds(t)};e=n.event,i=n.size}catch(r){Na.error("could not process queued compression event - will use uncompressed event",r),e=t,i=ds(t)}s.jr(a,e,i)}finally{s.qr(a)}}));return function(){return i.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,l;if(this._instance.sessionManager&&(this.cr(),t&&Yr(t))){if(t.type===wn.Meta){var h=this.er(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(t,e))),!this.X.urlBlocked||(d=t).type===wn.Custom&&"recording paused"===d.data.tag){var d,c,v,f;t.type===wn.FullSnapshot&&(null!=(c=$a())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.he=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(v=this.Ir)||v.reset(),null==(f=this._instance.persistence)||f.register_once({[Ln]:t.timestamp},void 0));var p=t.type===wn.FullSnapshot&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));p&&this.Ur();var m=this.Ir?this.Ir.throttleMutations(t):t;if(m){var g=function(t){var e=t;if(e&&Yr(e)&&6===e.type&&Yr(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),y=function(t){return no(t)?t.data.payload:null}(g),b=function(t){return so(t)?t.data.payload:null}(g),w=function(t){return io(t)?t.data.payload:null}(g);y||b?null!=y&&y.lastActivityTimestamp&&(g.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.$r(g),t.type===wn.FullSnapshot&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var k=null!==(i=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this.Bt,_=null!==(a=null!==(o=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.Ie;if(!0!==this.Xt||function(t){return io(t)||no(t)||so(t)}(g)){g.type===wn.FullSnapshot&&(this.te=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var S=this.Qt;this.Qt=!0,p?this.sr(!0):S||this.sr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||M&&Qa(g))this.Hr(g,M,k,_);else{var C=M?to(g):{event:g,size:ds(g)};this.Or(g,C.event,C.size,k,_)}}else(function(t){return t.type===wn.FullSnapshot||t.type===wn.Meta||t.type===wn.IncrementalSnapshot&&t.data.source!==kn.CanvasMutation})(g)&&this.te++}else!0===this.Xt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.$t,rrwebError:this.ue,urlTriggerMatching:this.X,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):Wn}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.At(),this.gr(),this.Rt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[An]:this.sessionId,[Sn]:null}),this.At(),this.gr(),this.Rt("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var t,e=null==zr||null==(t=zr.location)?void 0:t.href;if(!e)return;var r=this.er(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.He()}),2e3))}Vr(){return this.me!==this.De.sessionId&&0!==this.De.data.length&&this.De.data.every((t=>(null==t?void 0:t.type)===wn.Custom&&!no(t)&&!so(t)))}Zr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==Un)return ti(this.Qr)||this._instance.register_for_session({[Bn]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return ti(this.Qr)||this._instance.register_for_session({[Bn]:[]}),void(this.Qr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Qr&&(this.Qr=i,this._instance.register_for_session({[Bn]:e}),Na.info("buffering: "+r))}He(){var t;if(this.Cr(),this.ne)return this.De;if(this.Vr())return this.De.size>Da?this.Ue():this.De;var e=this.De;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Ne(),i=this.status;if(this.Gr(i),i===Un||i===Hn||i===Wn||r)return this.Lr(),this.De;if(this.De!==e)return this.De;if(e.data.length>0){var n,s=this.zr();vs(e).forEach((t=>{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.Jr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:mi.LIB_NAME,$lib_version:mi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}Dr(t){var e,r=2+((null==(e=this.De)?void 0:e.data.length)||0),i=t.$session_id,n=this.De.sessionId!==i;if(n||!0!==this.Xt&&!this.ne&&this.De.size+t.$snapshot_bytes+r>Da){var s=this.Bt;if(this.De=this.He(),this.Bt!==s)return;n&&this.De.data.length>0&&(this.De=this.Ue()),this.De.sessionId=i,this.De.windowId=t.$window_id}this.ne&&(this.oe||this.De.size+t.$snapshot_bytes+r>Da)?this.oe||(this.oe=!0,this.De=this.Ue()):(this.De.size+=t.$snapshot_bytes,this.De.data.push(t.$snapshot_data),this.De.sizes.push(t.$snapshot_bytes),!0===this.Xt||this.ne||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Fe(){var t,e,r=null==(t=this.De)?void 0:t.data[(null==(e=this.De)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Ur(){if(!this.De||0===this.De.data.length)return this.Ue();for(var t=-1,e=this.De.data.length-1;e>=0;e--)if(this.De.data[e].type===wn.Meta){t=e;break}return 0>t?this.Ue():(this.De.data=this.De.data.slice(t),this.De.sizes=this.De.sizes.slice(t),this.De.size=this.De.sizes.reduce(((t,e)=>t+e),0),this.De)}Ue(){return this.De={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.De}Rt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Na.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Ft("$recording_started",r({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==Pa.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Yr(t);e||!0===this.Xt||t.timestamp-this.Jt>this.Ut&&(this.Xt=!0,clearInterval(this.pr),this.Ft("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.Ut,bufferLength:this.De.data.length,bufferSize:this.De.size,sessionId:this.Bt,windowId:this.Ie}),this.He());var r=!1;if(e&&(this.Jt=t.timestamp,this.Xt)){var i="unknown"===this.Xt;this.Xt=!1,i||(this.Ft("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Bt!==a,u=this.Ie!==s;if(this.Ie=s,this.Bt=a,o||u){var l=o&&!1!==this.Xt;l&&(this.Xt="unknown"),this.Ee(l)}else if(e&&this.gr(),r){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&d&&this.At(),this.sr(),this.vr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=$a())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.De.data.length,$sdk_debug_replay_internal_buffer_size:this.De.size,$sdk_debug_current_session_duration:this.Fe,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:xa(null==(r=this.Ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:xa(null==(i=this.Ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Ar)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:xa(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:xa(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:xa(null==(o=$a())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=$a())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,$sdk_debug_rrweb_attached:!!this.Gt,$sdk_debug_rrweb_start_attempted:this.le}}_r(){var t;if(!this.Gt){this.le=!0;var e,i,n,s,a={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var u of Object.entries(o||{})){var l=u[0],h=u[1];if(l in a)if("maskInputOptions"===l)a.maskInputOptions=r({password:!0},h);else if("sampling"===l){var d=null!=h?h:{},c={};ti(d.mousemove)||(c.mousemove=d.mousemove),ti(d.mouseInteraction)||(c.mouseInteraction=d.mouseInteraction),a.sampling=c}else a[l]=h}!0===(null==o?void 0:o.captureJsonLd)&&!0!==a.slimDOMOptions&&"all"!==a.slimDOMOptions&&(a.slimDOMOptions=r({},a.slimDOMOptions,{script:!0})),this.Je&&this.Je.enabled&&(a.recordCanvas=!0,a.sampling=r({},a.sampling,{canvas:this.Je.fps}),a.dataURLOptions={type:"image/webp",quality:this.Je.quality},a.canvasResolutionScale=this.Qe,a.canvasMasking={configured:()=>{var t;return Kr(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Kr(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,Na.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ze&&(a.maskAllInputs=null===(e=this.Ze.maskAllInputs)||void 0===e||e,a.maskTextSelector=null!==(i=this.Ze.maskTextSelector)&&void 0!==i?i:void 0,a.blockSelector=null!==(n=this.Ze.blockSelector)&&void 0!==n?n:void 0,a.maskAllElementAttributes=null!==(s=this.Ze.maskAllElementAttributes)&&void 0!==s&&s),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.ve||(this.ve=!0,Na.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Ge();var v=Wa();if(v){this.Ir=null!==(t=this.Ir)&&void 0!==t?t:new Qs(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Na.info(r,{node:e}),this.log(La+" "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.re&&this.log(La+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.At()});var f=this.Xe();if(this.Gt=v(r({emit:t=>{this.onRRwebEmit(t)},plugins:f,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,Na.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},a)),!this.Gt)return this.ue=!0,void Na.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==o?void 0:o.captureJsonLd)&&Ur&&null!=zr&&zr.MutationObserver&&!this.ur&&(this.ur=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=ha,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var r=t;r;){if(Aa(r,e.blockClass,e.blockSelector)||Aa(r,e.maskTextClass,e.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(e,r))return;var o=function(t){if(!t||t.length>ha)return null;try{var e=JSON.parse(t),r=Xr(e)?e.map(Ia):Ia(e);if(ri(r)||Xr(r)&&(!r.length||r.some(ri)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(t){return null}}(e.text);if(!o)return void i.delete(e);var u=o[0],l=o[1];if(ri(a))return void i.set(e,l);if(i.get(e)!==l){if(l.length>s)return void(s=0);r.emit(u)&&(i.set(e,l),s-=l.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Ta(t))a(e)};for(var r of t)if("childList"===r.type)Ra(r.target)&&a(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Ra(i)&&a(i)}else"attributes"===r.type&&Ra(r.target)&&a(r.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Ta(t.documentElement).forEach((t=>{e&&i.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Ur,zr.MutationObserver,{blockClass:a.blockClass,blockSelector:a.blockSelector,maskTextClass:a.maskTextClass,maskTextSelector:a.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.Jt=Date.now(),this.Xt=si(this.Xt)?this.Xt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Ft("$session_options",{sessionRecordingOptions:a,activePlugins:f.map((t=>null==t?void 0:t.name))}),this.Ft("$posthog_config",{config:this._instance.config})}else Na.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ft(t,e)}}Gr.__PosthogExtensions__=Gr.__PosthogExtensions__||{},Gr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:Wr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:bn,options:t})},Gr.__PosthogExtensions__.rrweb={record:Ir,version:"v2",wasMaxDepthReached:()=>Kt,resetMaxDepthState(){Kt=!1,Xt=!1},getLastSnapshotCost:()=>D,getMutationCost:()=>r({},W),getDeferredStylesheetStats:()=>r({},z),getDiscardedDurationSamples:()=>I,resetSnapshotCostState(){x=0,E=0,O=0,C=0,I=0,F=S(),D=null,L=null,N=[],P=0,B=0,W={slowestBatchMs:0},z={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Gr.__PosthogExtensions__.initSessionRecording=(t,e)=>new ao(t,e)}();
|
|
2
2
|
//# sourceMappingURL=posthog-recorder.js.map
|