posthog-js 1.453.1 → 1.453.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.
@@ -1,2 +1,2 @@
1
- !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n,i){return(n=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function i(t){for(var i=1;arguments.length>i;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function r(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function s(t){return function(){var e=this,n=arguments;return new Promise(function(i,s){var o=t.apply(e,n);function a(t){r(o,i,s,a,l,"next",t)}function l(t){r(o,i,s,a,l,"throw",t)}a(void 0)})}}const o=["type"];var a=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),l=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),u=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),c=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),h=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),d=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),f=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function v(t,e){return-1!==t.indexOf(e)}Date,Date;var p={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},g={};function y(t){if(g[t])return g[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in p?p[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in m?m[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&o)return g[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(v(u=navigator.userAgent,"AppleWebKit")&&!v(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),g[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var b=Object.create(null);function w(t,e,n){var i;const r=b[t],s=r[n];if(s)return s.call(e);const o=y(t),a=null===(i=Object.getOwnPropertyDescriptor(o,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}b.Node=Object.create(null),b.ShadowRoot=Object.create(null),b.MutationObserver=Object.create(null),b.Element=Object.create(null);var k,S={};function _(t,e,n){const i=`${t}.${String(n)}`;if(S[i])return S[i].bind(e);const r=y(t)[n];return"function"!=typeof r?e[n]:(S[i]=r,r.bind(e))}function C(){return y("MutationObserver").constructor}function M(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},s=n(function(...t){return r.next.apply(this,t)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],o=n(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=n(i)}}}catch(t){return()=>{}}}var I={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),previousSibling:t=>w("Node",t,"previousSibling"),nextSibling:t=>w("Node",t,"nextSibling"),lastChild:t=>w("Node",t,"lastChild"),isConnected(t){if(void 0===k){var e;const t=null===(e=Object.getOwnPropertyDescriptor(y("Node"),"isConnected"))||void 0===e?void 0:e.get;k=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==k?void 0:k.call(t)},contains:(t,e)=>_("Node",t,"contains")(e),getRootNode:t=>_("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>_("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>_("Element",t,"querySelectorAll")(e),mutationObserver:C,patch:M},R=new WeakMap;function A(t){let e=Object.getPrototypeOf(t);for(;e;){const t=R.get(e);if(t)return t;e=Object.getPrototypeOf(e)}}var x=new WeakMap,T=new WeakSet,O=new WeakSet,E=!1;function F(t){return/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)}function L(t){return!!t.includes("var(")&&(!!/["'\\]|\/\*|url\(/i.test(t)||t.replace(/\{[^{};]*(?:;\s*)?\}/g,"{}").replace(/(^|[;{])\s*(?:--[\w-]+|color|background-color|width|height|min-width|max-width|min-height|max-height|font-size|font-weight|line-height|opacity|z-index|top|right|bottom|left)\s*:[^;{}]*/gi,"$1").includes("var("))}function D(t){try{for(;t;)x.delete(t),t=t.parentRule}catch(t){z()}}function N(t,e){try{if(D(t),E||O.has(t)||"string"!=typeof e||!L(e))return;if("cssRules"in t&&t.cssRules.length>0){var n;let e=t.parentStyleSheet;for(;null==e?void 0:e.ownerRule;)e=e.ownerRule.parentStyleSheet;if("LINK"===(null==e||null===(n=e.ownerNode)||void 0===n?void 0:n.nodeName))return}const i=t.cssText;if(F(i)){x.set(t,{text:e,cssText:i,realm:A(t)});let n=t.parentRule;for(;n;)T.add(n),n=n.parentRule}}catch(t){}}function P(t,e){try{if(E||"string"!=typeof e||!L(e))return;const n=Array.from(t.cssRules);if(!n.some(t=>F(t.cssText)))return;const i=function(t){const e=[];let n=0,i=0,r=0,s=0,o="",a=!1,l=!1;for(let u=0;t.length>u;u++){const c=t[u];if(a)"*"===c&&"/"===t[u+1]&&(a=!1,u++);else if("\\"!==c)if(o)c===o&&(o="");else if("/"!==c||"*"!==t[u+1]){if(!l){const e=t.startsWith("\x3c!--",u)?4:t.startsWith("--\x3e",u)?3:0;if(e){u+=e-1,n=u+1;continue}}-1===" \t\n\r\f".indexOf(c)&&(l=!0),'"'!==c&&"'"!==c?("("===c?r++:")"===c?r--:"["===c?s++:"]"===c&&s--,r||s||("{"===c?i++:"}"===c&&i--,("}"===c&&0===i||";"===c&&0===i)&&(e.push(t.slice(n,u+1).trim()),n=u+1,l=!1))):o=c}else a=!0,u++;else l=!0,u++}return i||r||s||o||a?[]:e}(e);if(i.length!==n.length)return;n.forEach((t,e)=>N(t,i[e]))}catch(t){}}function j(t){var e;const n=x.get(t);if(n){if(!1!==(null===(e=n.realm)||void 0===e?void 0:e.active)&&n.cssText===t.cssText)return n.text;x.delete(t)}}function W(t){D(t);try{let e=t;for(;e;)O.add(e),e=e.parentRule}catch(t){z()}}function B(){x=new WeakMap,T=new WeakSet}function z(){B(),E=!0}function U(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var q=0,H=0;function G(){q+=1}function V(){return q}function Z(t,e){return(e!==q||t>6e4)&&(H+=1,!0)}var J=0,Q=0,X=0,K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Y=null,tt=null,et=[],nt=0,it=0,rt={slowestBatchMs:0},st={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ot(t){var e;(J+=1)>1||(K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},et=[],nt=0,tt=(e=t)&&e>0?e:null,Q=U(),X=q)}function at(){return 0===J?Y||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(J-=1)>0?K:(K.durationMs=U()-Q,K.deferredStylesheetCount=nt,st.deferredCount+=nt,tt=null,Z(K.durationMs,X)?K:Y=K)}function lt(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const s=t[r];try{const t=s.cssRules;if(t&&t.length)i+=lt(t,e,n+1);else if(e&&s.styleSheet){const t=s.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=lt(r,e,n+1))}}}catch(t){}}return i}function ut(t){if(0===J)return;const e=lt(t,null,0);K.cssRuleCount+=e,it>0&&(K.nonDeferrableCssRuleCount+=e)}function ct(t){it+=1;try{return t()}finally{it-=1}}function ht(t){J>0&&(K.stylesheetMs+=t)}function dt(t){if(0===J||null===tt)return!1;const e=K.cssRuleCount-K.nonDeferrableCssRuleCount;return e>=tt||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),lt(e,n,0)}catch(t){return 0}}(t)>tt}function ft(){const t=et;return et=[],t}function vt(){st.failedCount+=1}function pt(t){t>0&&(st.abandonedCount+=t)}function mt(t){return mt="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},mt(t)}function gt(t,e,n){return(e=function(t){var e=function(t){if("object"!=mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(t){return t.nodeType===t.ELEMENT_NODE}function bt(t){const e=t&&"host"in t&&"mode"in t&&I.host(t)||null;return Boolean(e&&"shadowRoot"in e&&I.shadowRoot(e)===t)}function wt(t){return"[object ShadowRoot]"==={}.toString.call(t)}function kt(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function St(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var _t=0;function Ct(t){const e=0===_t,n=e?U():0;_t+=1;try{const e=t.rules||t.cssRules;if(!e)return null;ut(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),kt(Array.from(e,t=>Mt(t,n)).join(""))}catch(t){return null}finally{_t-=1,e&&ht(U()-n)}}function Mt(t,e){if(Rt(t)){let e;try{e=Ct(t.styleSheet)||St(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return Ut(e,t.styleSheet.href)}catch(t){}return e}{var i;let n=j(t);if(void 0===n&&function(t){return T.has(t)}(t)){const e=Ot(t);null!==e&&(n=e+Array.from(t.cssRules,t=>Mt(t,null)).join("")+"}")}return null!==(i=n)&&void 0!==i||(n=t.cssText),At(t)&&t.selectorText.includes(":")&&(n=It(n)),e?Ut(n,e):n}}function It(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Rt(t){return"styleSheet"in t}function At(t){return"selectorText"in t}var xt=/^-?[A-Za-z_][\w-]*$/,Tt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Ot(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(At(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!xt.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let 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]?xt.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":Tt.test(e.name)?`@layer ${e.name} {`:null:null}var Et=class{constructor(){gt(this,"idNodeMap",new Map),gt(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),yt(t)){const e=I.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ft({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:s}){let o=r||"";const a=i&&Lt(i);return(e[n.toLowerCase()]||a&&e[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function Lt(t){return t.toLowerCase()}var $t=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 Dt({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:s=!1}){return n?i?s&&$t.has(Lt(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var Nt="__rrweb_original__";function Pt(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Lt(e):null}catch(t){return null}}var jt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Wt=/^(?:[a-z+]+:)?\/\//i,Bt=/^www\..*/i,zt=/^(data:)([^,]*),(.*)/i;function Ut(t,e){return(t||"").replace(jt,(t,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return t;if(Wt.test(a)||Bt.test(a))return`url(${l}${a}${l})`;if(zt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),h=e.split("#")[0].split("/"),d=u.split("/");h.pop();for(const t of d)"."!==t&&(".."===t?h.pop():h.push(t));return`url(${l}${h.join("/")}${c}${l})`})}var qt=new Map;function Ht(t){return"http://www.w3.org/1999/xhtml"===t.namespaceURI?t.localName:void 0}function Gt(t,e,n,r=void 0){if(!n||"select"!==Ht(t))return e;const s=null==r?void 0:r.input.get(t);if(s)return s;let o;try{o="unmasked"!==n(t)}catch(t){o=!0}const a=i(i({},e),{},{select:o});return null==r||r.input.set(t,a),a}function Vt(t,e,n,i){if(!n)return!1;let r=I.parentNode(t);const s=[];let o=!1;for(;r;){const t=null==i?void 0:i.content.get(r);if(void 0!==t){o=t;break}if(s.push(r),yt(r)&&"selectedcontent"===Ht(r)){let t=I.parentElement(r);for(;t;){const r=t.localName;if("option"===r)break;if("select"===r){"select"===Ht(t)&&Gt(t,e,n,i).select&&(o=!0);break}t=I.parentElement(t)}if(o)break}r=bt(r)?I.host(r):I.parentNode(r)}for(const t of s)null==i||i.content.set(t,o);return o}var Zt,Jt,Qt=1,Xt=new RegExp("[^a-z0-9-_:]");function Kt(){return Qt++}var Yt=!1,te=/^[^ \t\n\r\u000c]+/,ee=/^[, \t\n\r\u000c]+/,ne=new WeakMap;function ie(t,e){return e&&""!==e.trim()?re(t,e):e}function re(t,e){let n=ne.get(t);if(n||(n=t.createElement("a"),ne.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function se(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function oe(t,e,n,i,r,s){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=ie(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=qt.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const s=r.getContext("2d");if(!s)return e;s.drawImage(t,0,0);const o=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>o.length?o:e;if(qt.size>=10){const t=qt.keys().next().value;void 0!==t&&qt.delete(t)}return qt.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,s.type,s.quality)),se(t,s)}if("image"===e)return se(n,s)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=ie(t,i);return"image"===e&&n.startsWith("data:")?se(n,s):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(ee),e.length>n;){let s=i(te);if(","===s.slice(-1))s=ie(t,s.substring(0,s.length-1)),r.push(s);else{let i="";s=ie(t,s);let o=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((s+i).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,r.push((s+i).trim());break}"("===t&&(o=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?Ut(i,re(t)):"object"===e&&"data"===n?ie(t,i):i:ie(t,i)}function ae(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===Lt(e)}function le(t){return"string"==typeof t&&Lt(t).split(/\s+/).includes("stylesheet")}function ue(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else if(ce(t,e,!1))return!0;if(n)return t.matches(n)}catch(t){}return!1}function ce(t,e,n){if(!t||!e)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&ce(I.parentNode(t),e,n);const i=e.global||e.sticky?new RegExp(e):e;for(let e=t.classList.length;e--;)if(i.test(t.classList[e]))return!0;return!!n&&ce(I.parentNode(t),e,n)}function he(t,e,n,i){let r;if(yt(t)){if(r=t,!I.childNodes(r).length)return!1}else{if(null===I.parentElement(t))return!1;r=I.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(ce(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function de(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var fe=new Map;function ve(t={}){fe.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),fe.delete(n))})}function pe(t){try{return t.sheet}catch(t){return null}}function me(t,e,n,i,r){const s=new AbortController,o=()=>{var e;(null===(e=fe.get(t))||void 0===e?void 0:e.controller)===s&&fe.delete(t),s.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{o()}}};t.addEventListener("load",l,{signal:s.signal,once:!0}),t.addEventListener("error",o,{signal:s.signal,once:!0});const u=Date.now()+6e4;let c;const h=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?h(e+1):o():o()},r)};s.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),h(0),fe.set(t,{controller:s,changedLinkBaseline:r})}var ge=[100,200,400,800,1600,3200,6400,12800,25600];function ye(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function be(t){return null==t?"":t.toLowerCase()}var we=!1,ke=!1;function Se(t,e,n=void 0){const{doc:i,mirror:r,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m=!1,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b={},inlineImages:w=!1,recordCanvas:k=!1,canvasMaskingConfigured:S,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M=5e3,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:O=!1,depth:E=0,maxDepth:L=50}=e;let{needsMask:D}=e,{preserveWhiteSpace:N=!0}=e;if(p&&!n&&(n={input:new WeakMap,content:new WeakMap,owner:new WeakMap}),p&&Vt(t,h,p,n))return null;if(E>=L)return ke=!0,we||(we=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${L}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;D||(D=he(t,a,l,void 0===D)),J>0&&(K.nodeCount+=1);const P=function(t,e,n){const{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:h,selectMaskingFn:d,maskAllElementAttributes:v=!1,maskAttributeFn:p,dataURLOptions:m={},inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:k=!1}=e,S=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:S};case t.ELEMENT_NODE:return function(t,e,n){const{doc:i,blockClass:r,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,selectMaskingFn:u,maskAllElementAttributes:c=!1,maskAttributeFn:h,dataURLOptions:d={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1,rootId:b}=e,w=ue(t,r,s),k=u&&Ht(t),S="select"===k||"option"===k||"selectedcontent"===k?k:function(t){if(t instanceof HTMLFormElement)return"form";const e=Lt(t.tagName);return Xt.test(e)?"div":e}(t);let _=a;if(u&&!w&&("select"===S||"option"===S)){const e="option"===S?function(t,e){let n=I.parentElement(t);const i=[];for(;n&&"select"!==Ht(n);){const t=null==e?void 0:e.owner.get(n);if(void 0!==t){n=t;break}i.push(n),n=I.parentElement(n)}for(const t of i)null==e||e.owner.set(t,n);return n}(t,n):t;e&&(_=Gt(e,a,u,n))}const C=new Set;let M={};const R=t.attributes.length;for(let e=0;R>e;e++){const n=t.attributes[e];ae(S,n.name)||(M[n.name]=oe(i,S,Lt(n.name),n.value,t,d))}if("link"===S&&"string"==typeof M.href){var A;const e=null===(A=pe(t))||void 0===A?void 0:A.href;e&&(M.href=e)}if("link"===S&&o&&!w&&le(M.rel)){let e=t.sheet;if(!e){const n=function(t){return t.href}(t);n&&(e=ye(i,n),!e&&n.includes(".css"))&&(e=ye(i,window.location.origin+"/"+n.replace(window.location.href,"")))}let n=null;e&&(dt(e)?J>0&&(et.push(t),nt+=1):n=Ct(e)),n&&(delete M.rel,delete M.href,M._cssText=n)}var x;if("style"===S&&t.sheet&&!(t.innerText||I.textContent(t)||"").trim().length){const e=ct(()=>Ct(t.sheet));e&&(M._cssText=e)}if("input"===S||"textarea"===S||"select"===S){var T;const e="select"===S?t.selectedOptions:void 0,n=e?(null===(T=Array.from(e).find(e=>{let n=e;for(;n&&n!==t;){if(ue(n,r,s))return!1;n=I.parentElement(n)}return!0}))||void 0===T?void 0:T.value)||"":t.value,i=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&(e||n)?M.value=n?Ft({element:t,type:Pt(t),tagName:S,value:n,maskInputOptions:_,maskInputFn:l}):"":i&&(M.checked=i)}if("select"===S&&(u||_.select&&!l)&&(M.rr_maskedSelect=!!_.select||null,C.add("rr_maskedSelect")),"option"===S&&(t.selected&&!_.select?M.selected=!0:delete M.selected),"dialog"===S&&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}C.add("rr_open_mode")}if("canvas"===S&&p&&!(null==m?void 0:m()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,s=Nt in r?r[Nt]:r;let o;try{o=s.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(o.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){const e=t.toDataURL(d.type,d.quality),n=i.createElement("canvas");n.width=t.width,n.height=t.height,e!==n.toDataURL(d.type,d.quality)&&(M.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(x=t)?void 0:x.name)?Yt||(Yt=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",x)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",x)}let O,E=!1;if("img"===S&&v){Zt||(Zt=i.createElement("canvas"),Jt=Zt.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,s=(e,n)=>E?Dt({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:h}):n,o=()=>{de(e,"load",o);try{Zt.width=e.naturalWidth,Zt.height=e.naturalHeight,Jt.drawImage(e,0,0);const t=Zt.toDataURL(d.type,d.quality);M.rr_dataURL=s("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?M.crossOrigin=s("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}if("audio"===S||"video"===S){const e=M;e.rr_mediaState=t.paused?"paused":"played",C.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(y||function(t){return"function"!=typeof t.checkVisibility||t.checkVisibility({contentVisibilityAuto:!0})}(t)&&(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var F,L,D;const{width:e,height:n,left:r,top:s}=t.getBoundingClientRect(),o=null===(F=i.defaultView)||void 0===F?void 0:F.getComputedStyle(t);M={class:M.class,rr_width:`${e}px`,rr_height:`${n}px`,rr_left:`${Math.floor(r+((null===(L=i.defaultView)||void 0===L?void 0:L.scrollX)||0))}px`,rr_top:`${Math.floor(s+((null===(D=i.defaultView)||void 0===D?void 0:D.scrollY)||0))}px`},C.add("rr_width"),C.add("rr_height"),C.add("rr_left"),C.add("rr_top"),o&&(M.rr_position=o.position||"static",C.add("rr_position"),o.transform&&"none"!==o.transform&&(M.rr_transform=o.transform,C.add("rr_transform")),o.display&&o.display.startsWith("inline")&&(M.rr_display=o.display,C.add("rr_display")))}if("iframe"!==S||g(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),c||h)for(const[e,n]of Object.entries(M))"string"!=typeof n&&null!==n||(M[e]=Dt({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:h,isGenerated:C.has(e)}));E=!0;try{customElements.get(S)&&(O=!0)}catch(t){}return{type:f.Element,tagName:S,attributes:M,childNodes:[],isSVG:(N=t,Boolean("svg"===N.tagName||N.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:O};var N}(t,{doc:i,blockClass:s,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,selectMaskingFn:d,maskAllElementAttributes:v,maskAttributeFn:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:k,rootId:S},n);case t.TEXT_NODE:case t.CDATA_SECTION_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,s=I.parentNode(t),o=s&&s.tagName;let a=I.textContent(t);const l="STYLE"===o||void 0,u="string"==typeof o&&"SCRIPT"===o.toUpperCase();if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(dt(s.sheet));else if(null===(c=s.sheet)||void 0===c?void 0:c.cssRules){const t=Ct(s.sheet);t&&!F(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=Ut(a,re(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,I.parentElement(t)):a.replace(/[\S]/g,"*")),{type:f.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:i,needsMask:a,maskTextFn:c,rootId:S});case t.COMMENT_NODE:return{type:f.Comment,textContent:I.textContent(t)||"",rootId:S};default:return!1}}(t,{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:T,newlyAddedElement:O},n);if(!P)return console.warn(t,"not serialized"),null;let j;j=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(be(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===be(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(be(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&be(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(be(t.attributes.property).match(/^(og|twitter|fb):/)||be(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===be(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(be(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(be(t.attributes.name))||be(t.attributes.property).match(/^article:/)||be(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(be(t.attributes.name)))return!0}}return!1}(P,y)||!N&&P.type===f.Text&&!P.isStyle&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Kt();const W=Object.assign(P,{id:j});if(r.add(t,W),-2===j)return null;_&&_(t);let B=!u;if(W.type===f.Element){B=B&&!W.needBlock,delete W.needBlock;const e=I.shadowRoot(t);e&&wt(e)&&(W.isShadowHost=!0)}if((W.type===f.Document||W.type===f.Element)&&B){y.headWhitespace&&W.type===f.Element&&"head"===W.tagName&&(N=!1);const e={doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E+1,maxDepth:L};if(W.type===f.Element&&"textarea"===W.tagName&&void 0!==W.attributes.value);else for(const i of Array.from(I.childNodes(t))){const t=Se(i,e,n);t&&W.childNodes.push(t)}let O=null;if(yt(t)&&(O=I.shadowRoot(t)))for(const t of Array.from(I.childNodes(O))){const i=Se(t,e,n);i&&(wt(O)&&(i.isShadow=!0),W.childNodes.push(i))}}const z=I.parentNode(t);if(z&&bt(z)&&wt(z)&&(W.isShadow=!0),W.type===f.Element&&"iframe"===W.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let s;try{s=r.document.readyState}catch(t){return i}const o=()=>e();if("complete"!==s){let i=!1,r=null;const s=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),de(t,"load",a),t.addEventListener("load",o),e())},a=()=>s();return r=setTimeout(s,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?de(t,"load",o):(i=!0,de(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(n),de(t,"load",o)}}return t.addEventListener("load",o),()=>{de(t,"load",o)}}(t,()=>{const e=t.contentDocument;if(e&&C){const n=Se(e,{doc:e,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E+1,maxDepth:L});n&&C(t,n)}},M);null==R||R(t,e)}var U,q,H;return W.type===f.Element&&"link"===W.tagName&&le(W.attributes.rel)&&(q=()=>{if(A){const e=r.getMeta(t),n=Se(t,{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E,maxDepth:L});n&&A(t,n,e)}},H=x,fe.has(U=t)||pe(U)||me(U,q,()=>Boolean(pe(U)),[H])),W}function _e(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 Ce=class t{constructor(...t){gt(this,"parentElement",null),gt(this,"parentNode",null),gt(this,"ownerDocument",void 0),gt(this,"firstChild",null),gt(this,"lastChild",null),gt(this,"previousSibling",null),gt(this,"nextSibling",null),gt(this,"ELEMENT_NODE",1),gt(this,"TEXT_NODE",3),gt(this,"nodeType",void 0),gt(this,"nodeName",void 0),gt(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Me(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Ie(n,t,e,i)}function Ie(t,e,n,i){Re(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Re(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Ae(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var xe="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.",Te={map:{},getId(){return console.warn(xe),-1},getNode(){return console.warn(xe),null},removeNodeFromMap(){console.warn(xe)},has(){return console.warn(xe),!1},reset(){console.warn(xe)}};function Oe(t,e,n={}){let i=null,r=0;return function(...s){const o=Date.now();r||!1!==n.leading||(r=o);const a=e-(o-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=o,t.apply(l,s)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,s)},a))}}function Ee(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),s=r?t[r]:void 0;"function"==typeof s&&(e=s)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}function Fe(t,e,n,i,r=window){const s=r.Object.getOwnPropertyDescriptor(t,e),o=()=>Fe(t,e,s||{},!0);if(i)return r.Object.defineProperty(t,e,n),o;const a=Ee(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),o}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Te=new Proxy(Te,{get(t,e,n){return"map"===e&&console.warn(xe),Reflect.get(t,e,n)}}));var Le=Date.now;function $e(t){var e,n,i,r;const 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=I.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(n=s.body)||void 0===n?void 0:n.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=I.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollTop)||0}}function De(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ne(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Pe(t){return t?t.nodeType===t.ELEMENT_NODE?t:I.parentElement(t):null}function je(t,e,n,i){if(!t)return!1;const r=Pe(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(ce(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function We(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),je(t,i||e,n,!0))return!0;const r="getRootNode"in t?I.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?I.host(r):null}return!1}function Be(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ze(t,e){if(bt(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=I.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ze(i,e))}function Ue(t){return Boolean(t.changedTouches)}function qe(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function He(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ge(t){return!!t&&(t instanceof Ce&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(I.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Le=()=>(new Date).getTime());var Ve=class{constructor(){gt(this,"id",1),gt(this,"styleIDMap",new WeakMap),gt(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ze(t){var e;let n=null;return"getRootNode"in t&&(null===(e=I.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&I.host(I.getRootNode(t))&&(n=I.host(I.getRootNode(t))),n}function Je(t){const e=t.ownerDocument;if(!e)return!1;if(I.contains(e,t))return!0;const n=I.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Ze(n);)n=e;return n}(t);return I.contains(e,n)}(t)}var Qe,Xe=new WeakMap,Ke=(t,e)=>`${t}@${e}`,Ye=class{constructor(){gt(this,"frozen",!1),gt(this,"locked",!1),gt(this,"takePendingRecords",void 0),gt(this,"texts",new Map),gt(this,"attributes",new Map),gt(this,"generatedAttributes",new WeakMap),gt(this,"selectedAttributeChanges",new Set),gt(this,"removes",[]),gt(this,"mapRemoves",new Set),gt(this,"movedMap",{}),gt(this,"addedSet",new Set),gt(this,"movedSet",new Set),gt(this,"droppedSet",new Set),gt(this,"removesSubTreeCache",new Set),gt(this,"mutationCb",void 0),gt(this,"blockClass",void 0),gt(this,"blockSelector",void 0),gt(this,"maskTextClass",void 0),gt(this,"maskTextSelector",void 0),gt(this,"inlineStylesheet",void 0),gt(this,"maskInputOptions",void 0),gt(this,"maskTextFn",void 0),gt(this,"maskInputFn",void 0),gt(this,"selectMaskingFn",void 0),gt(this,"maskAllElementAttributes",void 0),gt(this,"maskAttributeFn",void 0),gt(this,"keepIframeSrcFn",void 0),gt(this,"recordCanvas",void 0),gt(this,"canvasMaskingConfigured",void 0),gt(this,"inlineImages",void 0),gt(this,"slimDOMOptions",void 0),gt(this,"dataURLOptions",void 0),gt(this,"doc",void 0),gt(this,"mirror",void 0),gt(this,"iframeManager",void 0),gt(this,"stylesheetManager",void 0),gt(this,"shadowDomManager",void 0),gt(this,"canvasManager",void 0),gt(this,"processedNodeManager",void 0),gt(this,"unattachedDoc",void 0),gt(this,"canvasManagerReleased",!1),gt(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),gt(this,"emit",()=>{if(this.frozen||this.locked)return;const t=U(),e=V();try{this.processBufferedMutations()}finally{n=U()-t,i=e,J>0||Z(n,null!=i?i:q)||n>rt.slowestBatchMs&&(rt.slowestBatchMs=n)}var n,i}),gt(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=this.selectMaskingFn?{input:new WeakMap,content:new WeakMap,owner:new WeakMap}:void 0,r=t=>{let e=t,n=-2;for(;-2===n;)e=e&&I.nextSibling(e),n=e&&this.mirror.getId(e);return n};let s;const o=i=>{var o;const a=I.parentNode(i);if(!a||!Je(i)||"TEXTAREA"===a.tagName)return!0;if(this.isBlockedAtEmission(a,n))return!0;if(this.selectMaskingFn&&Vt(i,this.maskInputOptions,this.selectMaskingFn,n))return!0;const l=bt(a)?this.mirror.getId(Ze(i)):this.mirror.getId(a),u=r(i);if(-1===l||-1===u)return!1;null!==(o=s)&&void 0!==o||(s=this.buildSerializationOptions());const c=Se(i,s,n);return c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)en(this.removesSubTreeCache,t)&&!this.movedSet.has(I.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=nn(this.droppedSet,t),n=en(this.removesSubTreeCache,t),i=this.movedSet.has(t)||nn(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const a=new Set;let l=null;const u=this.addedSet.values();let c=u.next();for(;this.addedSet.size;){let t=null;if(null!==l)for(t=I.previousSibling(l);t&&-2===this.mirror.getId(t);)t=I.previousSibling(t);if(t&&this.addedSet.has(t))l=t;else{for(this.addedSet.has(c.value)||(c=u.next()),l=c.value;;){const t=I.parentNode(l),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host(t):t;if(!e||!this.addedSet.has(e))break;l=e}const t=I.parentNode(l);if(t&&this.addedSet.has(I.lastChild(t)))l=I.lastChild(t);else if(t)for(;;){let t=I.nextSibling(l);for(;t&&-2===this.mirror.getId(t);)t=I.nextSibling(t);if(!t||!this.addedSet.has(t))break;l=t}}this.addedSet.delete(l);const e=I.parentNode(l),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host(e):e;n&&a.has(n)?a.add(l):o(l)||a.add(l)}a.size>0&&console.warn(`[rrweb] dropped ${a.size} node(s) with unresolved parent at emit`);const h={texts:Array.from(this.texts,([t,e])=>({node:t,value:e})).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const e=t.node,n=I.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:Array.from(this.attributes.values()).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=Dt({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}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},d=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of h.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===Lt(n.nodeName)&&le(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&d.push(n)}this.texts.clear(),this.attributes.clear(),this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={};const f=this.selectedAttributeChanges;this.selectedAttributeChanges=new Set,(h.texts.length||h.attributes.length||h.removes.length||h.adds.length)&&this.mutationCb(h);for(const t of f){var v;null===(v=Xe.get(t.ownerDocument))||void 0===v||v.forEach(e=>e(t))}for(const t of d)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:Se(t,i(i({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}),gt(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),gt(this,"genTextAreaValueMutation",t=>{let e=this.attributes.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t,e));const n=Array.from(I.childNodes(t),t=>I.textContent(t)||"").join("");e.attributes.value=Ft({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pt(t),value:n,maskInputFn:this.maskInputFn})}),gt(this,"processMutation",t=>{if(!Be(t.target,this.mirror,this.slimDOMOptions)){if(this.selectMaskingFn){var e;const n=null===(e=Pe(t.target))||void 0===e?void 0:e.closest("select");n&&this.selectedAttributeChanges.add(n)}switch(t.type){case"characterData":{const e=I.textContent(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.set(t.target,he(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Pe(t.target)):e.replace(/[\S]/g,"*"):e);break}case"attributes":{var n;const e=t.target,r=!this.selectMaskingFn||"http://www.w3.org/1999/xhtml"!==e.namespaceURI||"select"!==e.localName&&"option"!==e.localName?Lt(e.tagName):e.localName,s=t.attributeName,o=null!==(n=t.attributeNamespace)&&void 0!==n?n:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(e,s,o),l=o?e.getAttributeNS(o,s):t.target.getAttribute(s);if("option"===r&&"selected"===a&&(this.selectMaskingFn||this.maskInputOptions.select)){let n=I.parentElement(e);if("OPTGROUP"===(null==n?void 0:n.tagName)&&(n=I.parentElement(n)),this.selectMaskingFn||!this.maskInputFn||"SELECT"!==(null==n?void 0:n.tagName)||!n.multiple)return void(l!==t.oldValue&&"SELECT"===(null==n?void 0:n.tagName)&&this.selectedAttributeChanges.add(n))}if("value"===a){const t=e,n=Pt(t);l=Ft({element:t,maskInputOptions:Gt(t,this.maskInputOptions,this.selectMaskingFn),tagName:this.selectMaskingFn&&"select"===r?"select":e.tagName,type:n,value:l,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributes.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&e.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!ae(r,a)){var i;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t.target,u));const n=oe(this.doc,r,Lt(a),l,e,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=n,null===(i=this.generatedAttributes.get(t.target))||void 0===i||i.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span"),i=e.style;t.oldValue&&(n.style.cssText=t.oldValue);for(const t of Array.from(i)){const e=i.getPropertyValue(t),r=i.getPropertyPriority(t);e!==n.style.getPropertyValue(t)||r!==n.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?e:[e,r]:u._unchangedStyles[t]=[e,r]}for(const t of Array.from(n.style))""===i.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";let n=this.generatedAttributes.get(t.target);n||(n=new Set,this.generatedAttributes.set(t.target,n)),n.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{Je(t)||this.shadowDomManager.removeShadowRootsIn(t)}),je(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=bt(t.target)?this.mirror.getId(I.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||Be(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(tn(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ze(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ke(n,i)]?tn(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!bt(t.target)||!wt(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),I.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}}),gt(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(Be(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ke(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!je(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=I.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(Ge(t)){const e=I.childNodes(I.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","selectMaskingFn","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()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){this.selectedAttributeChanges.clear();for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t,e){return We(t,this.blockClass,this.blockSelector)||!!this.selectMaskingFn&&!!t&&Vt(t,this.maskInputOptions,this.selectMaskingFn,e)}recordReinsertion(t){var e;const n=I.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,selectMaskingFn:this.selectMaskingFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{qe(t,this.mirror)&&this.iframeManager.addIframe(t),He(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ge(t)&&!je(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(I.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,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function tn(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=I.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function en(t,e,n){return 0!==t.size&&function(t,e){const n=I.parentNode(e);return!!n&&t.has(n)}(t,e)}function nn(t,e){if(0===t.size)return!1;let n=I.parentNode(e);for(;n;){if(t.has(n))return!0;n=I.parentNode(n)}return!1}function rn(t){Qe=t}function sn(){Qe=void 0}var on=(t,e="rrweb")=>Qe?(...n)=>{try{return t(...n)}catch(t){if(Qe&&!0===Qe(t,e))return;throw t}}:t,an=[];function ln(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function un(t,e){const n=new Ye;let i;n.init(t);try{i=new(C())(on(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),an.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function cn({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){const o=new Map,a=s=>{const a=ln(s);if(!a||je(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=$e(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const h=`${u},${c}`;o.get(l)!==h&&(o.set(l,h),t({id:l,x:u,y:c}))},l=on(a),u=new WeakMap,c=[Me("scroll",on(t=>{const e=t.target;if(!e)return;let n=u.get(e);n||(n=Oe(l,s.scroll||100),u.set(e,n)),n(t)}),e)];return"onscrollend"in e&&c.push(Me("scrollend",on(a),e)),()=>c.forEach(t=>t())}function hn(t,e){for(let n=an.length-1;n>=0;n--){const i=an[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),an.splice(n,1))}}var dn=["INPUT","TEXTAREA","SELECT"],fn=new WeakMap,vn=new WeakMap;function pn(t){return function t(e,n){if(Sn("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Sn("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Sn("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Sn("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function mn(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}var gn=Symbol.for("rrweb.adoptedStyleSheets.rejected"),yn=new WeakMap;function bn({mirror:t,stylesheetManager:e},n){var i,r;let s=null;s=t.getId("#document"===n.nodeName?n:I.host(n));const o="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets"),l=null!=a?a:(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(o.prototype,"adoptedStyleSheets"):void 0;if(null===s||-1===s||!o||!1===(null==a?void 0:a.configurable)||!(null==l?void 0:l.get)||!(null==l?void 0:l.set))return()=>{};const u={stylesheetManager:e,previousDescriptor:a,get:void 0},c={configurable:!0,enumerable:l.enumerable,get(){var t;return null===(t=l.get)||void 0===t?void 0:t.call(this)},set(t){let e;try{var n;e=null===(n=l.set)||void 0===n?void 0:n.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return gn;throw t}if(e===gn)return e;if(u.stylesheetManager&&null!==s&&-1!==s)try{u.stylesheetManager.adoptStyleSheets(t,s)}catch(t){}return e}};try{Object.defineProperty(n,"adoptedStyleSheets",c)}catch(t){return()=>{}}return u.get=c.get,yn.set(c.set,u),on(()=>{u.stylesheetManager=void 0;const t=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets");if(!(null==t?void 0:t.configurable)||t.get!==c.get||t.set!==c.set)return;let e=a;for(;null==e?void 0:e.set;){const t=yn.get(e.set);if(!t||t.stylesheetManager||t.get!==e.get)break;e=t.previousDescriptor}e?Object.defineProperty(n,"adoptedStyleSheets",e):delete n.adoptedStyleSheets})}var wn=new Set;function kn(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let r,s;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),s(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),o(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),h(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),d(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],a=on(()=>{try{if(s)try{s.destroy(),s.reset()}finally{const t=an.indexOf(s);-1!==t&&an.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect()}finally{Ae(o)}}),h=(t,e)=>{const n=on(()=>{try{return e()}catch(e){throw wn.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&h("mutation",()=>{const e=un(t,t.doc);r=e.observer,s=e.buffer}),h("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,s="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const u=Oe(on(e=>{const n=Date.now()-o;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],o=null}),s),c=on(Oe(on(t=>{const e=ln(t),{clientX:n,clientY:r}=Ue(t)?t.changedTouches[0]:t;o||(o=Le()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Le()-o}),u("drag"===t.type?l.Drag:"touchmove"===t.type?l.TouchMove:l.MouseMove)}),r,{trailing:!1})),h=[Me("mousemove",c,n),Me("touchmove",c,n),Me("drag",c,n)];return on(()=>{h.forEach(t=>t())})}(t)),h("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[];let h=null;return Object.keys(u).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t]).forEach(o=>{let a=Lt(o);const d=(e=>o=>{const a=ln(o);if(je(a,r,s,!0))return;let l=null,d=e;if("pointerType"in o){switch(o.pointerType){case"mouse":l=c.Mouse;break;case"touch":l=c.Touch;break;case"pen":l=c.Pen}l===c.Touch&&(u[e]===u.MouseDown?d="TouchStart":u[e]===u.MouseUp&&(d="TouchEnd"))}else Ue(o)&&(l=c.Touch);null!==l?(h=l,(d.startsWith("Touch")&&l===c.Touch||d.startsWith("Mouse")&&l===c.Mouse)&&(l=null)):u[e]===u.Click&&(l=h,h=null);const f=Ue(o)?o.changedTouches[0]:o;if(!f)return;const v=n.getId(a),{clientX:p,clientY:m}=f;on(t)(i({type:u[d],id:v,x:p,y:m},null!==l&&{pointerType:l}))})(o);if(window.PointerEvent)switch(u[o]){case u.MouseDown:case u.MouseUp:a=a.replace("mouse","pointer");break;case u.TouchStart:case u.TouchEnd:return}l.push(Me(a,d,e))}),on(()=>{l.forEach(t=>t())})}(t)),h("scroll",()=>cn(t)),h("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Me("resize",on(Oe(on(()=>{const e=De(),r=Ne();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),h("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:u,selectMaskingFn:c,sampling:h,userTriggeredOnInput:d}){let v=!0;const p=new Map;let m=!1;function g(t){return"SELECT"===t.tagName||!!c&&"select"===t.localName&&"http://www.w3.org/1999/xhtml"===t.namespaceURI}function y(t){const n=e.defaultView;if(t&&n&&!(t instanceof n.HTMLElement))return null;if(c&&"option"===(null==t?void 0:t.localName)&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){let e=I.parentElement(t);for(;e&&("select"!==e.localName||"http://www.w3.org/1999/xhtml"!==e.namespaceURI);)e=I.parentElement(e);return e}return t&&"OPTION"===t.tagName&&(t=I.parentElement(t))&&"OPTGROUP"===t.tagName&&(t=I.parentElement(t)),t}function b(t){k(y(ln(t)),t.isTrusted)}function w(t){return Array.from(t.selectedOptions).filter(t=>!je(t,r,s,!0))}function k(t,h,p=!1,m=!1){var y;const b=t&&(g(t)?"SELECT":t.tagName);var k;if(c&&"SELECT"===b&&((null===(k=an[0])||void 0===k?void 0:k.isFrozen())&&an.forEach(t=>t.unfreeze()),!v))return;if(!t||!b||0>dn.indexOf(b)||je(t,r,s,!0))return;if(t.classList.contains(o)||a&&t.matches(a))return;const _=Pt(t)||"",M=Gt(t,l,c);if(c&&(!v||je(t,r,s,!0)))return;const I=M[b.toLowerCase()]||M[_];let R="SELECT"===b?w(t):void 0;if(R&&(0>=n.getId(t)||R.some(t=>0>=n.getId(t)))){var A;if(null===(A=an[0])||void 0===A?void 0:A.isFrozen()){if(an.forEach(t=>t.unfreeze()),!v)return;R=w(t)}if(!p)return void S(t,h,m);if(0>=n.getId(t)||!I&&R.some(t=>0>=n.getId(t)))return}let x,T=R?(null===(y=R[0])||void 0===y?void 0:y.value)||"":t.value,O=!1;"radio"===_||"checkbox"===_?O=t.checked:I?T=Ft({element:t,maskInputOptions:M,tagName:b,type:_,value:T,maskInputFn:u}):R&&(x=R.map(t=>n.getId(t)));const E={text:T,isChecked:O};x&&(E.selectedOptionIds=x),c&&R&&function(t,e,n){if("SELECT"!==t.nodeName)return;const r=e.getMeta(t),s=!!n||null;(null==r?void 0:r.type)!==f.Element||!0!==r.attributes.rr_maskedSelect&&null!==r.attributes.rr_maskedSelect||r.attributes.rr_maskedSelect===s||e.add(t,i(i({},r),{},{attributes:i(i({},r.attributes),{},{rr_maskedSelect:s})}))}(t,n,!!I),d&&(E.userTriggered=h),C(t,E,m);const F=t.name;"radio"===_&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(e=>{if(e!==t){const t=e.value;C(e,d?{text:t,isChecked:!O,userTriggered:!1}:{text:t,isChecked:!O})}})}function S(t,e,n=!1){var i;const r=p.get(t);p.set(t,{userTriggered:e||(null==r?void 0:r.userTriggered)||!1,fromMutation:n&&(null===(i=null==r?void 0:r.fromMutation)||void 0===i||i)}),m||(m=!0,A(_))}function _(){m=!1;const t=Array.from(p);p.clear(),Ae(t.map(([t,{userTriggered:e,fromMutation:n}])=>()=>{v&&on(k)(t,e,!0,n)}))}function C(e,r,s=!1){var o,a,l;const u=g(e)?vn:fn,c=u.get(e);if(!c||c.text!==r.text||c.isChecked!==r.isChecked||(null===(o=c.selectedOptionIds)||void 0===o?void 0:o.length)!==(null===(a=r.selectedOptionIds)||void 0===a?void 0:a.length)||(null===(l=r.selectedOptionIds)||void 0===l?void 0:l.some((t,e)=>{var n;return t!==(null===(n=c.selectedOptionIds)||void 0===n?void 0:n[e])}))){u.set(e,r);const o=n.getId(e);on(t)(i(i({},r),{},{id:o}),s)}}const M=("last"===h.input?["change"]:["input","change"]).map(t=>Me(t,on(b),e)),R=e.defaultView;if(!R)return()=>{M.forEach(t=>t())};const A=Ee(R),x=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value");return x&&x.set&&M.push(...[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]].map(t=>Fe(t[0],t[1],{set(){if(!v)return;const t=on(y)(this);t&&(g(t)?S(t,!1):on(k)(t,!1))}},!1,R))),M.unshift(function(t,e){const n=Xe.get(t)||new Set;return Xe.set(t,n),n.add(e),()=>{n.delete(e),n.size||Xe.get(t)!==n||Xe.delete(t)}}(e,on(t=>{n.getId(t)>0&&Je(t)&&!We(t,r,s)&&k(t,!1,!1,!!c)}))),on(()=>{Ae([_]),v=!1,p.clear(),Ae(M)})}(t)),h("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:s}){const o=on(s=>Oe(on(r=>{const o=ln(r);if(!o||je(o,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=o;t({type:s,id:i.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),r.media||500)),a=[Me("play",o(d.Play),s),Me("pause",o(d.Pause),s),Me("seeked",o(d.Seeked),s),Me("volumechange",o(d.VolumeChange),s),Me("ratechange",o(d.RateChange),s)];return on(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},s=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),s(t)):r(n)},queuePendingMutation(o,a,l){if(!i)return()=>{};let u=e.get(o);u||(u=[],e.set(o,u));const c={emit:a,ready:!1};u.push(c);let h,d=!1,f=!1;const v=()=>{d||f||(d=!0,void 0!==h&&n.delete(h),c.ready=!0,c.emit=void 0,s(o))};try{h=t.setTimeout(v,5e3),d||f?t.clearTimeout(h):n.add(h)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==h&&(t.clearTimeout(h),n.delete(h)),d?e&&r(l):(c.ready=!0,e||(c.emit=void 0),s(o)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),h("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);N(s.cssRules[l],a),n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const o=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);try{const i=null==l?void 0:l.then;if(s.ownerNode||!l||"function"!=typeof i)return l;const o=n.onCssomSheetMutation(s),{id:u,styleId:c}=mn(s,e,n.styleMirror),h=u&&-1!==u||c&&-1!==c?r.queuePendingMutation(s,()=>t({id:u,styleId:c,replace:a}),()=>{const e=Ct(s);null!==e&&t({id:u,styleId:c,replace:e})}):void 0;try{i.call(l,()=>{n.isCurrentCssomMutation(s,o)&&P(s,a),null==h||h(!0)},()=>null==h?void 0:h(!1))}catch(t){null==h||h(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);P(s,a),n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};_n("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(_n("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),_n("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),_n("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,s])=>{c[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[i].insertRule,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);N(s.cssRules[l],a),n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=mn(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...pn(s),l];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);D(s),n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=mn(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...pn(s),a];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),on(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),h("adoptedStyleSheet",()=>bn(t,t.doc)),h("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:s}){const o=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:on((r,o,a)=>{var l;const[u,c,h]=a,d=r.apply(o,a);if(D(o.parentRule),n.has(u))return d;const f=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=mn(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=pn(o.parentRule);s.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:h},index:e}))}return d},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:on((r,o,a)=>{var l;const[u]=a,c=r.apply(o,a);if(D(o.parentRule),n.has(u))return c;const h=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(h);const{id:d,styleId:f}=mn(h,e,i.styleMirror);if(d&&-1!==d||f&&-1!==f){const e=pn(o.parentRule);s.queueMutation(h,()=>t({id:d,styleId:f,remove:{property:u},index:e}))}return c},"host")}),on(()=>{r.CSSStyleDeclaration.prototype.setProperty=o,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&h("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,n){const i=new s(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const o=M(e.fonts,"add",function(e){return function(n){return setTimeout(on(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=s}),i.push(o),on(()=>{i.forEach(t=>t())})}(t))}h("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=t;let o=!0;const a=on(()=>{const t=e.getSelection();if(!t||o&&(null==t?void 0:t.isCollapsed))return;o=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:s,startOffset:o,endContainer:l,endOffset:u}=t.getRangeAt(e);je(s,i,r,!0)||je(l,i,r,!0)||a.push({start:n.getId(s),startOffset:o,end:n.getId(l),endOffset:u})}s({ranges:a})});return a(),Me("selectionchange",a)}(t)),h("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?M(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)h(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function Sn(t){return void 0!==window[t]}function _n(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function Cn(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var Mn,In,Rn=class{constructor(t){gt(this,"generateIdFn",void 0),gt(this,"iframeRemoteIdToLocalIdMap",new WeakMap),gt(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t);let o=r.get(e);return void 0===o&&(o=this.generateIdFn(),r.set(e,o),s.set(o,e)),o}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},An=class{constructor(t){gt(this,"iframes",new WeakMap),gt(this,"crossOriginIframeMap",new WeakMap),gt(this,"crossOriginIframeMirror",new Rn(Kt)),gt(this,"crossOriginIframeStyleMirror",void 0),gt(this,"crossOriginIframeRootIdMap",new WeakMap),gt(this,"mirror",void 0),gt(this,"mutationCb",void 0),gt(this,"wrappedEmit",void 0),gt(this,"loadListener",void 0),gt(this,"pageHideListener",void 0),gt(this,"stylesheetManager",void 0),gt(this,"recordCrossOriginIframes",void 0),gt(this,"messageHandler",void 0),gt(this,"nestedIframeListeners",new Map),gt(this,"attachedWindows",new WeakMap),gt(this,"attachedDocuments",new WeakMap),gt(this,"attachedIframes",new Map),gt(this,"loadListenerDisposers",new WeakMap),gt(this,"iframeElementsById",new Map),gt(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Re(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Ie(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Re(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Re(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout,!0===e.data.nonInteractive)}transformCrossOriginEvent(t,e){switch(e.type){case a.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:a.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case a.Meta:case a.Load:case a.DomContentLoaded:return!1;case a.Plugin:return e;case a.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case a.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:return this.replaceIds(e.data,t,["id"]),e;case l.Input:return this.replaceIds(e.data,t,["id","selectedOptionIds"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case l.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Ie(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Ie(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Re(()=>this.mirror.removeNodeFromMap(t))}),Re(()=>hn(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Ie(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Ie(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},xn=new Map,Tn=new WeakMap;function On(t){t.dispose(),xn.get(t.win)===t&&xn.delete(t.win)}function En(){(null==In?void 0:In.valid)&&(In.valid=!1,(null==Mn?void 0:Mn.stopped)?z():B())}var Fn=class{constructor(t,e){gt(this,"win",void 0),gt(this,"owned",new Map),gt(this,"pending",new Set),gt(this,"stopped",!1),gt(this,"ready",!1),this.win=t;try{const i=In;if(e&&(null==i?void 0:i.valid)&&i.stopCompleted&&!i.next&&["interactive","complete"].includes(t.document.readyState)){i.next=this;for(const e of i.retained)try{var n;e.win.CSSRule.prototype!==e.prototype||e.win!==t&&!(null===(n=e.win.frameElement)||void 0===n?void 0:n.isConnected)||(this.acquire(e.win),e.win!==t&&this.pending.add(e.win))}catch(t){}}else{if(En(),i){for(const t of i.retained)0===t.owners&&On(t);i.retained.clear()}B(),O=new WeakSet,E=!1}Mn=this,e&&this.acquire(t)}catch(t){throw this.stop(),t}}acquire(t){if(!t.CSSRule)return z(),()=>{};const e=this.owned.get(t);if(e)return e;let n=xn.get(t);if(!n){const e=function(t){const e={active:!0};return R.set(t,e),()=>{e.active=!1,R.get(t)===e&&R.delete(t)}}(t.CSSRule.prototype);let r;try{r=function(t){const e=[],n=(t,n)=>{const r="appendRule"===n||"deleteRule"===n||"insertRule"===n,s=Object.getOwnPropertyDescriptor(t,n);if(!s)return void(("style"===n||r)&&z());const o="style"===n||"styleMap"===n||"media"===n;if(!s.configurable||o&&!s.get||r&&"function"!=typeof s.value)return void z();const a=i({},s);if(r&&(a.value=new Proxy(s.value,{apply(t,e,n){const i=t.apply(e,n);return W(e),i}})),s.get&&o){const t=s.get;a.get=function(){const e=t.call(this);return W(this),e}}if(s.set){const t=s.set;a.set=function(e){const n=t.call(this,e);return W(this),n}}try{Object.defineProperty(t,n,a),e.push(()=>{const e=Object.getOwnPropertyDescriptor(t,n);(null==e?void 0:e.get)===a.get&&(null==e?void 0:e.set)===a.set&&(null==e?void 0:e.value)===a.value&&Object.defineProperty(t,n,s)})}catch(t){z()}};try{var r,s,o;const i=t;for(const e of[t.CSSStyleRule,t.CSSKeyframeRule,t.CSSPageRule,t.CSSFontFaceRule,i.CSSNestedDeclarations,i.CSSMarginRule,i.CSSPositionTryRule])e&&(n(e.prototype,"style"),n(e.prototype,"styleMap"));for(const e of[t.CSSMediaRule,t.CSSImportRule])e&&n(e.prototype,"media");t.CSSStyleRule&&n(t.CSSStyleRule.prototype,"selectorText"),t.CSSKeyframeRule&&n(t.CSSKeyframeRule.prototype,"keyText"),t.CSSKeyframesRule&&(n(t.CSSKeyframesRule.prototype,"name"),n(t.CSSKeyframesRule.prototype,"appendRule"),n(t.CSSKeyframesRule.prototype,"deleteRule"));const a=t.CSSGroupingRule?[t.CSSGroupingRule]:[t.CSSMediaRule,t.CSSConditionRule,t.CSSSupportsRule];for(const t of a)t&&(n(t.prototype,"insertRule"),n(t.prototype,"deleteRule"));const l=null===(r=t.CSSStyleRule)||void 0===r?void 0:r.prototype;for(const t of["insertRule","deleteRule"])l&&{}.hasOwnProperty.call(l,t)&&n(l,t);const u=null===(s=t.CSSRule)||void 0===s?void 0:s.prototype;return u&&(null===(o=Object.getOwnPropertyDescriptor(u,"cssText"))||void 0===o?void 0:o.set)&&n(u,"cssText"),()=>Ae(e)}catch(t){throw Ae(e),z(),t}}(t)}catch(t){throw e(),t}n={win:t,prototype:t.CSSRule.prototype,owners:0,dispose:()=>Ae([e,r])},xn.set(t,n)}const r=n;r.owners++;const s=()=>{this.owned.get(t)===s&&(this.owned.delete(t),this.pending.delete(t),r.owners--,0===r.owners&&((null==In?void 0:In.valid)&&In.previous===this&&In.stopStarted?In.retained.add(r):On(r)))};return this.owned.set(t,s),s}observe(t){return this.prune(),this.pending.delete(t),t===this.win?()=>{}:this.acquire(t)}prune(){for(const n of this.pending){var t;try{var e;const t=xn.get(n);if((null===(e=n.frameElement)||void 0===e?void 0:e.isConnected)&&n.CSSRule.prototype===(null==t?void 0:t.prototype))continue}catch(t){}null===(t=this.owned.get(n))||void 0===t||t()}}beforeStop(){(null==In?void 0:In.previous)===this&&In.valid&&!In.stopStarted?In.stopStarted=!0:En()}stop(){if(!this.stopped){for(const t of[...this.owned.values()])t();this.stopped=!0,(null==In?void 0:In.valid)&&In.previous===this?In.stopCompleted=!0:Mn===this&&(z(),Mn=void 0)}}},Ln=class{constructor(t){gt(this,"shadowDoms",new Map),gt(this,"mutationCb",void 0),gt(this,"scrollCb",void 0),gt(this,"bypassOptions",void 0),gt(this,"mirror",void 0),gt(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,r;if(!wt(t))return;if(this.shadowDoms.has(t))return;const s=null!==(n=null===(r=I.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==n?n:e,o={doc:s,handlers:[]};this.shadowDoms.set(t,o);const{observer:a,buffer:l}=un(i(i({},this.bypassOptions),{},{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{a.disconnect(),l.destroy(),l.releaseCanvasManager();const t=an.indexOf(l);-1!==t&&an.splice(t,1)}),o.handlers.push(cn(i(i({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(I.host(t))),o.handlers.push(bn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=I.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),I.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach($n)}observeAttachShadow(t){Re(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:M(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),s=I.shadowRoot(this);return s&&Je(this)&&n.addShadowRoot(s,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>$n(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach($n))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?$n(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function $n(t){try{t()}catch(t){}}var Dn="skip-frame";function Nn(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Pn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wn=0;64>Wn;Wn++)jn[Pn.charCodeAt(Wn)]=Wn;var Bn=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Pn[n[e]>>2],r+=Pn[(3&n[e])<<4|n[e+1]>>4],r+=Pn[(15&n[e+1])<<2|n[e+2]>>6],r+=Pn[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},zn=!1,Un=new Map,qn=(t,e,n)=>{if(!t||!Vn(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Un.get(t);return n||(n=new Map,Un.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Hn(t,e,n,i){if(t instanceof Array)return t.map(t=>Hn(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Bn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Hn(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?zn||(zn=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Hn(t.data,e,n,i),t.width,t.height]}:Vn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:qn(t,e,n)}:t}var Gn=(t,e,n,i)=>t.map(t=>Hn(t,e,n,i)),Vn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Zn=["webgl","webgl2"];function Jn(t){return"nodeType"in t}function Qn(t,e,n,r){const s=[];try{if(r){const r=function(t,e,n){const r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return M(r.prototype,"configure",function(r){return function(s){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||Jn(o)&&je(o,e,n,!0))return r.call(this,s);Jn(o)&&!("__context"in o)&&(o.__context="webgpu");const a=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&s?i(i({},s),{},{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,n);r&&s.push(r)}const o=M(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(i,...s){const o=function(t){return"experimental-webgl"===t?"webgl":t}(i);if(!je(this,e,n,!0)&&("__context"in this||(this.__context=o),r&&Zn.includes(o)))if(s[0]&&"object"==typeof s[0]){const t=s[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[i,...s])}});s.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function Xn(t,e,n,i,r,s,o){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=M(t,u,function(t){return function(...a){const l=t.apply(this,a);if(qn(l,s,this),this.canvas&&"tagName"in this.canvas&&!je(this.canvas,i,r,!0)){let t;try{t=Gn(a,s,this,o)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(s){const o=Fe(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!je(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(o)}return a}var Kn='(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\tlet webpProbeStarted = false;\n\tlet noWebpEncoder = false;\n\tfunction probeWebpEncoder() {\n\t\twebpProbeStarted = true;\n\t\tnew OffscreenCanvas(1, 1).convertToBlob({ type: "image/webp" }).then((blob) => {\n\t\t\tnoWebpEncoder = blob.type !== "image/webp";\n\t\t}).catch(() => void 0);\n\t}\n\tfunction isOpaque(pixels) {\n\t\tfor (let i = 3; i < pixels.length; i += 4) if (pixels[i] !== 255) return false;\n\t\treturn true;\n\t}\n\tfunction encodeOptions(options, pixels) {\n\t\tif (options.type !== "image/webp") return options;\n\t\tif (!webpProbeStarted) probeWebpEncoder();\n\t\treturn noWebpEncoder && isOpaque(pixels) ? {\n\t\t\t...options,\n\t\t\ttype: "image/jpeg"\n\t\t} : options;\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 pixels = ctx.getImageData(0, 0, width, height).data;\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, pixels);\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(encodeOptions(dataURLOptions, pixels));\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Yn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Kn],{type:"text/javascript;charset=utf-8"});function ti(t){let e;try{if(e=Yn&&(self.URL||self.webkitURL).createObjectURL(Yn),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Kn),{name:null==t?void 0:t.name})}}var ei="A page CSP that omits blob: from worker-src or script-src blocks it";function ni(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var ii=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){gt(this,"pendingCanvasMutations",new Map),gt(this,"rafStamps",{latestId:0,invokeId:null}),gt(this,"mirror",void 0),gt(this,"mutationCb",void 0),gt(this,"resetObservers",void 0),gt(this,"frozen",!1),gt(this,"locked",!1),gt(this,"rafIdTimestamp",null),gt(this,"rafIdFlush",null),gt(this,"refCount",0),gt(this,"torndown",!1),gt(this,"resetFrameDedup",null),gt(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:s,dataURLOptions:o,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(n,i,r,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:o,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void ni("disabled because this browser does not support OffscreenCanvas");const a="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,l=Qn(e,n,i,!0),u=new Map;let c;try{c=new ti}catch(t){return ni(`disabled because the encode worker did not start. ${ei}`,t),void l()}let d=!1;c.onerror=t=>{var e;d=!0,ni(`stopped because the encode worker failed. ${ei}`,t),cancelAnimationFrame(m),null===(e=c.terminate)||void 0===e||e.call(c),this.resetFrameDedup=null},this.resetFrameDedup=()=>{c.postMessage({resetFrameDedup:!0})},c.onmessage=t=>{const{id:e}=t.data;if(u.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:s}=t.data;this.mutationCb({id:e,type:h["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,s]}],displayWidth:r,displayHeight:s})};let f=!1,v=!1;const p=1e3/t;let m,g=0;const y=t=>{var l;d||(g&&p>t-g||(g=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{je(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((l=s(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!u.get(e)&&0!==t.width&&0!==t.height){u.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void u.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=t.clientWidth||t.width,o=t.clientHeight||t.height,l=Math.max(1,Math.round(s*a)),h=Math.max(1,Math.round(o*a)),d=function(t,e,n,i,r,s){if(!t||"function"!=typeof t.regionsFn)return;let o;try{o=t.regionsFn(e)}catch(t){return Dn}if(void 0===o)return;if(!Array.isArray(o)||!o.every(Nn))return Dn;const a=n/r,l=i/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,l,h,s,o);if("skip-frame"===d)return f||(f=!0,ni("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void u.set(e,!1);const v=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:h});c.postMessage({id:e,bitmap:v,width:l,height:h,displayWidth:s,displayHeight:o,dataURLOptions:r.dataURLOptions,maskRegions:d},[v])}catch(t){v||(v=!0,ni("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),m=requestAnimationFrame(y))};m=requestAnimationFrame(y),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Qn(t,e,n,!1),s=function(t,e,n,i,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const o=M(e.CanvasRenderingContext2D.prototype,a,function(s){return function(...o){return je(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Gn(o,e,this,r)}catch(t){return}t(this.canvas,{type:h["2D"],property:a,args:n})},0),s.apply(this,o)}});s.push(o)}catch(r){const o=Fe(e.CanvasRenderingContext2D.prototype,a,{set(e){je(this.canvas,n,i,!0)||t(this.canvas,{type:h["2D"],property:a,args:[e],setter:!0})}});s.push(o)}return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),o=function(t,e,n,i,r){const s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Xn(e.WebGLRenderingContext.prototype,h.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&s.push(...Xn(e.WebGL2RenderingContext.prototype,h.WebGL2,t,n,i,e,r)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;s.length>i;i++)e.includes(n=s[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,o)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function ri(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var si,oi,ai,li=class{constructor(t){var e,n,i;gt(this,"trackedLinkElements",new WeakSet),gt(this,"pendingDeferredSheets",new Set),gt(this,"cssomRevisions",new WeakMap),gt(this,"stopped",!1),gt(this,"changedLinkJobs",new Map),gt(this,"linksInlinedSinceSnapshot",new WeakSet),gt(this,"mutationCb",void 0),gt(this,"adoptedStyleSheetCb",void 0),gt(this,"maskAllElementAttributes",void 0),gt(this,"maskAttributeFn",void 0),gt(this,"blockClass",void 0),gt(this,"blockSelector",void 0),gt(this,"styleMirror",new Ve),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return We(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:ri({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let s=null,o=null;try{o=t.sheet,o&&(s=function(t){const e=[];let n=!1,i=null;const r=new Map;function s(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);o(e[e.length-1],r.importRule,t)}function o(t,e,n){try{let r;try{r=n||St(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=Ut(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var n;const i=t.rules[t.index];if("sheet"===t.kind&&Rt(i)){const n=r.get(i);return null===n?(t.parts.push(i.cssText),void(t.index+=1)):n?void e.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(function(t,n){try{if(void 0!==j(t))return!1;const i=Ot(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?Ut(i,r):i,fixColons:"sheet"===n.kind&&At(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t))return;let s=null!==(n=j(i))&&void 0!==n?n:i.cssText;"sheet"===t.kind&&At(i)&&i.selectorText.includes(":")&&(s=It(s)),t.parts.push(t.sheetHref?Ut(s,t.sheetHref):s),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;ut(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const s=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!Rt(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;ut(t);let s=i.href;!s&&i.ownerNode&&(s=i.ownerNode.baseURI);const o=Array.from(t);r.set(e,{sheet:i,rules:o,sheetHref:s}),n.push({sheet:i,rules:o,index:0})}catch(t){}}}(s,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=U();let o=t>0?t:1;try{for(;!n&&o>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?It(n):n}else e=kt(t.parts.join(""))}catch(t){}s(e);continue}o-=1;try{a(t)}catch(t){s(null)}}}catch(t){n=!0,i=null}finally{ht(U()-r)}return n},text(){return n?i:null},remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}(o))}catch(t){}var a;if(!s||!o)return vt(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=s;let u=!1;const c={sheet:o,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let h=!1;return{advance:e=>{if(h)return!0;const i=U(),s=V();let a=!0;try{if(u)return h=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():vt(),!0;if(!l.advance(e))return a=!1,!1;h=!0;const i=l.text();if(!t.isConnected)return!0;let s=null;try{s=t.sheet}catch(t){}return s!==o?(vt(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(vt(),null===(d=n.onUninlinable)||void 0===d||d.call(n),!0);var d}finally{a&&this.pendingDeferredSheets.delete(c),Z(f=U()-i,null!=(v=s)?v:q)||(st.totalMs+=f,f>st.slowestSliceMs&&(st.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){var e;if(!t)return;const n=(null!==(e=this.cssomRevisions.get(t))&&void 0!==e?e:0)+1;this.cssomRevisions.set(t,n);for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate());return n}isCurrentCssomMutation(t,e){return!this.stopped&&this.cssomRevisions.get(t)===e}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=pe(t),i=fe.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},s=()=>{const e=pe(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};s()?e():me(t,e,s,ge,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let s=!1;const o=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,ri(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){s=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!o)return;let a=null;const l=()=>{o.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>o.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!o.advance(200)&&(l(),!s||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):vt(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=Cn(c))};a=Cn(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),pt(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,r={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:i(i({},r),{},{_cssText:Dt({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=U();try{ct(()=>{try{const t=e.rules||e.cssRules;t&&ut(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:Mt(t,e.href),index:n}))})})}finally{ht(U()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),ve()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,ve({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},ui=class{constructor(){gt(this,"nodeMap",new WeakMap),gt(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},ci=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var hi;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(hi=t.contentWindow)||void 0===hi?void 0:hi.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var di=new Et,fi=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function vi(t={}){let e,n=!1,r=!1;const{emit:s,checkoutEveryNms:o,checkoutEveryNth:u,blockClass:c="rr-block",blockSelector:h=null,ignoreClass:d="rr-ignore",ignoreSelector:f=null,maskTextClass:v="rr-mask",maskTextSelector:p=null,inlineStylesheet:m=!0,inlineStylesheetBudgetRules:g,maskAllInputs:y,maskInputOptions:b,slimDOMOptions:w,maskInputFn:k,selectMaskingFn:S,maskTextFn:_,maskAllElementAttributes:C=!1,maskAttributeFn:M,hooks:R,packFn:A,sampling:x={},dataURLOptions:T={},canvasResolutionScale:O,canvasMasking:E,mousemoveWait:F,recordDOM:L=!0,recordCanvas:D=!1,recordCrossOriginIframes:N=!1,recordAfter:P=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:j=!1,collectFonts:W=!1,inlineImages:B=!1,plugins:z,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:q=new Set([]),attributeFilter:H,errorHandler:V}=t;rn(V);const Z=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},T),J=!N||window.parent===window;let Q=!1;if(!J)try{window.parent.document&&(Q=!1)}catch(t){Q=!0}if(J&&!s)throw new Error("emit function is required");if(!J&&!Q)return()=>{};void 0!==F&&void 0===x.mousemove&&(x.mousemove=F),di.reset(),ve();const X=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==b?b:{password:!0},K=_e(void 0!==w&&w);let Y;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let tt=0;const et=new Map;let nt,it;const rt=t=>{for(const e of z||[])e.eventProcessor&&(t=e.eventProcessor(t));return A&&!Q&&(t=A(t)),t};si=(t,e,n)=>{var i;const r=t;if(r.timestamp=Le(),!(null===(i=an[0])||void 0===i?void 0:i.isFrozen())||r.type===a.FullSnapshot||r.type===a.IncrementalSnapshot&&fi.has(r.data.source)||an.forEach(t=>t.unfreeze()),J)n?null==s||s(rt(r),e,!0):null==s||s(rt(r),e);else if(Q){const t={type:"rrweb",event:rt(r),origin:window.location.origin,isCheckout:e};n&&(t.nonInteractive=!0),window.parent.postMessage(t,"*")}if(r.type===a.FullSnapshot)Y=r,tt=0;else if(r.type===a.IncrementalSnapshot){if(r.data.source===l.Mutation&&r.data.isAttachIframe)return;tt++,(u&&tt>=u||o&&r.timestamp-Y.timestamp>o)&&oi(!0)}};const st=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=di.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=vt.getIframeElementById(t);i&&n.has(i)?vt.forgetIframeId(t):(null==nt||nt(t),vt.removeIframeById(t))}),null==it||it(),vt.cleanupDetachedIframes()}si({type:a.IncrementalSnapshot,data:i({source:l.Mutation},t)})},lt=t=>si({type:a.IncrementalSnapshot,data:i({source:l.Scroll},t)}),ut=t=>si({type:a.IncrementalSnapshot,data:i({source:l.CanvasMutation},t)}),ct=new li({mutationCb:st,adoptedStyleSheetCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:C,maskAttributeFn:M,blockClass:c,blockSelector:h});let ht=!1;const dt=()=>{if(!ht){ht=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;ct.flushChangedLinkInlining(50-n)}finally{ht=!1}}},vt=new An({mirror:di,mutationCb:st,stylesheetManager:ct,recordCrossOriginIframes:N,wrappedEmit:si});for(const t of z||[])t.getMirror&&t.getMirror({nodeMirror:di,crossOriginIframeMirror:vt.crossOriginIframeMirror,crossOriginIframeStyleMirror:vt.crossOriginIframeStyleMirror});const mt=new ui,gt=null==E?void 0:E.configured;ai=new ii({recordCanvas:D,mutationCb:ut,win:window,blockClass:c,blockSelector:h,mirror:di,sampling:x.canvas,dataURLOptions:Z,resolutionScale:O,canvasMasking:E});const yt=new Ln({mutationCb:st,scrollCb:lt,bypassOptions:{blockClass:c,blockSelector:h,maskTextClass:v,maskTextSelector:p,inlineStylesheet:m,maskInputOptions:X,dataURLOptions:Z,maskTextFn:_,maskInputFn:k,selectMaskingFn:S,maskAllElementAttributes:C,maskAttributeFn:M,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,sampling:x,slimDOMOptions:K,iframeManager:vt,stylesheetManager:ct,canvasManager:ai,keepIframeSrcFn:U,processedNodeManager:mt,attributeFilter:H},mirror:di});oi=(t=!1)=>{if(L){ot(g);try{if(si({type:a.Meta,data:{href:window.location.href,width:Ne(),height:De()}},t),n)return;null==e||e.cancel(),e=void 0,ct.reset(),yt.init(),an.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new Et,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOM:g=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:C,stylesheetLoadTimeout:M,keepIframeSrcFn:I=()=>!1,maxDepth:R,inlineStylesheetBudgetRules:A}=e||{},x=!0===h?{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,hidden:!0}:!1===h?{password:!0}:h,T=_e(g);ot(A);try{return Se(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:d,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:T,dataURLOptions:y,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:C,stylesheetLoadTimeout:M,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:R})}finally{at()}}(document,{mirror:di,blockClass:c,blockSelector:h,maskTextClass:v,maskTextSelector:p,inlineStylesheet:m,maskAllInputs:X,inlineStylesheetBudgetRules:g,maskTextFn:_,maskInputFn:k,selectMaskingFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOM:K,dataURLOptions:Z,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,onSerialize(t){qe(t,di)&&vt.addIframe(t),He(t,di)&&ct.trackLinkElement(t),Ge(t)&&yt.addShadowRoot(I.shadowRoot(t),document)},onIframeLoad(t,e){vt.attachIframe(t,e),yt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){vt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){ct.attachLinkElement(t,e,n)},keepIframeSrcFn:U})}finally{r=ft()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(vn=new WeakMap,si({type:a.FullSnapshot,data:{node:i,initialOffset:$e(window)}},t),n)return;if(an.forEach(t=>t.unlock()),ai.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,s=0,o=null;const a=()=>null!==o||t.length>s,l=()=>{const n=t[s];t[s]=null,s+=1,n&&Re(()=>{o=e.beginDeferredLinkInlining(n,di.getId(n))})},u=()=>{if(!o)return;const t=o;let e=!0;Re(()=>{e=t.advance(200)}),e&&(o=null)},c=()=>{o||l(),u()},h=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==o||o.discard(),o=null,pt(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=Cn(h):n())};return r=Cn(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){o||l();const t=o;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),o=null,c+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==o?1:0);for(let n=s;t.length>n;n++)null!==t[n]&&(e+=1);pt(e),null==o||o.discard(),o=null}return n(),e}}}(r,ct,()=>{e===t&&(e=void 0)});e=t}N&&vt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,di.getId(document))}finally{at()}}};const bt=[];let wt;try{wt=new Fn(window,L),bt.push(Me("pagehide",()=>{try{dt()}catch(t){}e=void 0},window));for(const t of["visibilitychange","freeze","resume"])bt.push(Me(t,G,document));nt=t=>{const e=et.get(t);e&&(e.forEach(t=>{Re(t);const e=bt.indexOf(t);-1!==e&&bt.splice(e,1)}),et.delete(t))},it=()=>{null==wt||wt.prune();for(const[t]of et){const e=di.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==nt||nt(t)}catch(e){null==nt||nt(t)}else null==nt||nt(t)}};const t=t=>{var e;return on(kn)({mutationCb:st,mousemoveCb:(t,e)=>si({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.MouseInteraction},t)}),scrollCb:lt,viewportResizeCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.ViewportResize},t)}),inputCb:(t,e)=>si({type:a.IncrementalSnapshot,data:i({source:l.Input},t)},void 0,e),mediaInteractionCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.StyleDeclaration},t)}),canvasMutationCb:ut,fontCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.Font},t)}),selectionCb(t){si({type:a.IncrementalSnapshot,data:i({source:l.Selection},t)})},customElementCb(t){si({type:a.IncrementalSnapshot,data:i({source:l.CustomElement},t)})},blockClass:c,ignoreClass:d,ignoreSelector:f,maskTextClass:v,maskTextSelector:p,maskInputOptions:X,inlineStylesheet:m,sampling:x,recordDOM:L,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,userTriggeredOnInput:j,collectFonts:W,doc:t,maskInputFn:k,selectMaskingFn:S,maskTextFn:_,maskAllElementAttributes:C,maskAttributeFn:M,keepIframeSrcFn:U,blockSelector:h,slimDOMOptions:K,dataURLOptions:Z,mirror:di,iframeManager:vt,stylesheetManager:ct,shadowDomManager:yt,processedNodeManager:mt,canvasManager:ai,ignoreCSSAttributes:q,attributeFilter:H,plugins:(null==z||null===(e=z.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>si({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)},s=e=>{const n=e.defaultView?null==wt?void 0:wt.observe(e.defaultView):void 0;try{const i=t(e);return()=>Ae([()=>null==i?void 0:i(),()=>null==n?void 0:n()])}catch(t){throw null==n||n(),t}},o=new WeakMap,u=new WeakMap;vt.addLoadListener(t=>{null==wt||wt.prune();try{const e=t.contentDocument,n=di.getId(t);if(!e)return;const i=u.get(t);if(i){u.delete(t),Re(i);const e=bt.indexOf(i);-1!==e&&bt.splice(e,1)}const r=o.get(e);if(-1!==n&&r){if(r())return;null==nt||nt(n)}const a=s(e);if("function"==typeof a){let i=!1;const r=Me("rrweb-check-iframe-observers",()=>{i=!0},e);-1!==n&&o.set(e,()=>{i=!1;const t=e.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),e.dispatchEvent(t),i});const s=()=>{o.delete(e),r(),a()};if(bt.push(s),-1!==n){let t=et.get(n);t||(t=new Set,et.set(n,t)),t.add(s)}else u.set(t,s)}}catch(t){console.warn(t)}}),vt.addPageHideListener(t=>{const e=di.getId(t);null==nt||nt(e),hn(t)});let g=-1;const y=t=>si({type:a.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),b=()=>{var t,e,n,i;const r=document,s=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,o=s?di.getId(s):-1;o!==g&&(-1!==g&&y({id:g,enter:!1}),g=o,-1!==o&&y({id:o,enter:!0}))},w=()=>{if(n||r)return;if(r=!0,oi(),n)return;const t=s(document);n?"function"==typeof t&&Ae([t]):("function"==typeof t&&bt.push(t),bt.push(Me("fullscreenchange",b)),bt.push(Me("webkitfullscreenchange",b)),bt.push(Me("mozfullscreenchange",b)),bt.push(Me("MSFullscreenChange",b)),ci=!0,wt&&(wt.ready=!0))};["interactive","complete"].includes(document.readyState)?w():(bt.push(Me("DOMContentLoaded",()=>{si({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===P&&setTimeout(w,0)})),bt.push(Me("load",()=>{si({type:a.Load,data:{}}),"load"===P&&w()},window)));const I=()=>{if(null==wt||wt.beforeStop(),!n){n=!0;try{dt()}catch(t){}e=void 0,ct.stop(),Ae(bt),mt.destroy(),vt.removeLoadListener(),vt.destroy(),et.clear(),yt.reset(),di.reset(),ci=!1,sn(),null==wt||wt.stop()}};return wt&&function(t,e){Tn.set(t,e)}(I,wt),I}catch(t){n=!0,Ae(bt),null==wt||wt.stop(),console.warn(t)}}vi.withStyleRuleSourceHandoff=function(t,e){const n=Tn.get(t);if(!n||n.stopped||Mn!==n||In)return En(),void e(()=>{});const i={previous:n,next:void 0,valid:!0,stopStarted:!1,stopCompleted:!1,retained:new Set};In=i;try{e(()=>{In===i&&En()})}finally{var r;(null===(r=i.next)||void 0===r?void 0:r.ready)||En();for(const t of i.retained)0===t.owners&&On(t);i.retained.clear(),In===i&&(In=void 0)}},vi.addCustomEvent=(t,e)=>{if(!ci)throw new Error("please add custom event after start recording");si({type:a.Custom,data:{tag:t,payload:e}})},vi.freezePage=()=>{an.forEach(t=>t.freeze())},vi.takeFullSnapshot=t=>{if(!ci)throw new Error("please take full snapshot after start recording");oi(t)},vi.isRecording=()=>ci,vi.supportsSelectMasking=!0,vi.mirror=di,Date,Date;var pi=Object.create(null);function mi(t){return mi="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},mi(t)}function gi(t,e,n){return(e=function(t){var e=function(t){if("object"!=mi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}pi.Node=Object.create(null),pi.ShadowRoot=Object.create(null),pi.MutationObserver=Object.create(null),pi.Element=Object.create(null);var yi=class{constructor(t){gi(this,"fileName",void 0),gi(this,"functionName",void 0),gi(this,"lineNumber",void 0),gi(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},bi=/(^|@)\S+:\d+/,wi=/^\s*at .*(\S+:\d+|\(native\))/m,ki=/^(eval@)?(\[native code])?$/,Si={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(wi)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(wi)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new yi({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(ki)},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 yi({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new yi({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new yi({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new yi({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(bi)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new yi({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function _i(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ci(t){return Array.isArray(t)}function Mi(t){return"object"==typeof t&&null!==t&&!Ci(t)}function Ii(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Mi(t[i])&&Ii(t[i],e-1))return!0;return!1}function Ri(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Mi(s=e)&&Object.keys(s).length>n.numOfKeysLimit||"function"==typeof s||Mi(s)&&Ii(s,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var s;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ci(i)?_i(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Ai={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 xi(t,e,n){const i=n?Object.assign({},Ai,n):Ai,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?e[r]:r;let o=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Si.parse(e.error).map(t=>t.toString()),payload:[Ri(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Ri(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Ri("Uncaught (in promise)",i.stringifyOptions),Ri(e.reason,i.stringifyOptions)]),t({level:"error",trace:Si.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(s,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,s){try{if(!(s in r))return()=>{};const u=r[s],c={next:u},h=(r=>(...s)=>{if(r.apply(e,s),l&&!("assert"===n&&s[0]||a)){a=!0;try{const e=Si.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?s.slice(1):s).map(t=>Ri(t,i.stringifyOptions));o++,i.lengthThreshold>o?t({level:n,trace:e,payload:r}):o===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Ri("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...s])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[s]=h,()=>{if(r[s]===h)return void(r[s]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[s],n=t(e);for(;n;){if(n.next===h)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}const Ti="u">typeof window?window:void 0,Oi="u">typeof globalThis?globalThis:Ti,Ei=null==Oi?void 0:Oi.document,Fi=null==Oi?void 0:Oi.location;null!=Oi&&Oi.XMLHttpRequest&&new Oi.XMLHttpRequest;const Li="undefined"!=typeof globalThis?globalThis:Ti;Li&&"undefined"==typeof self&&(Li.self=Li),Li&&"undefined"==typeof File&&(Li.File=function(){});const $i=null!=Ti?Ti:{},Di=Object.prototype,Ni=Di.hasOwnProperty,Pi=Di.toString,ji=Array.isArray||function(t){return"[object Array]"===Pi.call(t)},Wi=t=>"function"==typeof t,Bi=t=>t===Object(t)&&!ji(t),zi=t=>void 0===t,Ui=t=>"[object String]"==Pi.call(t),qi=t=>null===t,Hi=t=>zi(t)||qi(t),Gi=t=>"[object Number]"==Pi.call(t)&&t==t,Vi=t=>"[object Boolean]"===Pi.call(t),Zi=t=>t instanceof FormData;function Ji(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Gi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):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: "+n+", fallback: "+r),Ji(null!=r?r:n,e,n,i))}var Qi=class{constructor(t){this.C={},this.I=t.I,this.A=Ji(t.bucketSize,0,100,t.R),this.O=Ji(t.refillRate,0,this.A,t.R),this.$=Ji(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};function Xi(t){return t?t.split("#")[0]:t}const Ki="NativeGzipValidationError";let Yi;const tr=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Ki,`Native gzip produced invalid output: ${t}`)};let er=0,nr=!1;const ir=(rr=s(function*(t,e){18>t.size&&tr("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&tr("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&tr("invalid-size"),(nr||3>er)&&(r.getUint32(0,!0)!==(t=>{const e=(()=>{if(Yi)return Yi;Yi=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;Yi[t]=e>>>0}return Yi})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&(nr=!0,tr("invalid-crc")),er++)}),function(t,e){return rr.apply(this,arguments)});var rr;function sr(){return sr=s(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=s(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),a=new Response(n.readable).blob(),[l]=yield Promise.all([a,o]);return yield ir(l,e),l}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),sr.apply(this,arguments)}const or="0.12.1",ar={DEBUG:!1,LIB_VERSION:or,LIB_NAME:"browser-common",JS_SDK_VERSION:or},lr=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ar.DEBUG||r.POSTHOG_DEBUG||e)&&!zi(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>lr(`${t} ${e}`,n)};return n},ur=lr("[PostHog.js]"),cr=(t,e)=>ur.createLogger(t,e);function hr(t,e){if(!Hi(t))if(ji(t))t.forEach(e);else if(Zi(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Ni.call(t,n)&&e(t[n],n)}function dr(t,e,n,i){const{capture:r=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:s})}const fr=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return zi(n)?null:(n.href=t,n)},vr=["localhost","127.0.0.1"],pr=()=>{},mr=t=>{var e;if(Wi(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function gr(t,e,n){try{if(!(e in t))return pr;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return Wi(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],s=mr(n);for(;s;){if(s.next===r)return void(s.next=i.next);n=s.next,s=mr(n)}}}catch(t){return pr}}function yr(t,e){var n;const 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),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}function br(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return zi(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!Wi(i))return e;try{const t=i(e);return Ui(t)&&t?t:e}catch(t){return ur.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}const wr="$stored_person_properties",kr=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}))$"),Sr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,_r=[16,15,14,13],Cr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Mr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ir=/[0-9A-Za-z_]/;function Rr(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}const Ar=1e6;function xr(t){var e;return Math.min(Ar,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ar)}const Tr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ar,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Or=["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"],Er=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Fr=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Lr=t=>{Hi(t)||hr(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Or.includes(e)||Fr.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},$r=["/s/","/e/","/i/"];function Dr(t,e,n,i){if(Hi(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ui(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function Nr(t,e){if(Hi(t))return t;let n=t;return function(t,e=!0){if(Hi(t))return!1;if(Ui(t)){if(t=t.trim(),e?kr.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Sr.lastIndex=0;e=Sr.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of _r){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(kr.test(e)&&Rr(e))return!0}}}return!1}(t))return!1;if(e?Cr.test(t):function(t){let e;for(Mr.lastIndex=0;e=Mr.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&Ir.test(t)&&Ir.test(n)))return!0}return!1}(t))return!1}return!0}(n,!1)||(n="[SessionRecording] "+e+" body redacted"),hr(Er,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const Pr=new WeakSet,jr=cr("[Recorder]"),Wr=t=>"navigation"===t.entryType,Br=t=>"resource"===t.entryType,zr=()=>{};function Ur(t,e){var n;return Wr(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function qr(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Ur(t,n)||Br(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Ur(t,e))}(t):[]}function Hr(t,e){return!!e&&(Vi(e)||e[t])}function Gr(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Vr=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Zr({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Gr(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Vr))return!1;if(Vi(e))return!0;if(ji(e))return r(e);const s=e[t];return Vi(s)?s:r(s)}function Jr(t,e,n,i,r){return Qr.apply(this,arguments)}function Qr(){return Qr=s(function*(t,e,n,i,r,s=0){if(s>10)return jr.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const o=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Br(t)&&t.initiatorType===e&&(zi(i)||t.startTime>=i)&&(zi(r)||r>=t.startTime));return o||(yield new Promise(t=>setTimeout(t,50*s)),Jr(t,e,n,i,r,s+1))}),Qr.apply(this,arguments)}function Xr({body:t,options:e,url:n}){if(Hi(t))return null;const{hostname:i,isHostDenied:r}=yr(n,e);if(r)return i+" is in deny list";if(Ui(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(Zi(t))return function(t,e="&"){let n,i;const r=[];return hr(t,function(t,e){zi(t)||zi(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)}(t);if(Bi(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Kr=t=>!qi(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Yr(t,{entry:e,method:n,status:r,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}){a=e?e.startTime:a,l=e?e.responseEnd:l;const h=Math.floor(Date.now()-t.performance.now()),d=Math.floor(h+(a||0)),f=[i(i({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:u}),{},{startTime:zi(a)?void 0:Math.round(a),endTime:zi(l)?void 0:Math.round(l),timeOrigin:h,timestamp:d,method:n,initiatorType:c||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Kr(e))for(const t of e.serverTiming||[])f.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return f}const ts=["video/","audio/"];function es(t){return Bi(t)&&Wi(t.getReader)&&Wi(t.tee)}const ns="[SessionReplay] Timeout while trying to read body",is="[SessionReplay] Failed to read body";function rs(t){return`${is}: ${t}`}function ss(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function os(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(ns),500);try{t.clone().text().then(t=>e(t),t=>e(rs(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(is)}})}(t);const n=xr(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const s=parseInt(r,10);return Number.isFinite(s)&&s>e}catch(t){return!1}}(t,n)?Promise.resolve(ss(n)):function(t,e){return new Promise(n=>{let i,r=!1;function s(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function o(t){r||(r=!0,clearTimeout(a),s(),n(t))}const a=setTimeout(()=>o(ns),500);let l;try{l=t.clone()}catch(t){return void o(is)}const u=l.body;if(!es(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>o(t),t=>o(rs(t)))}catch(t){o(is)}return}try{i=u.getReader()}catch(t){return void o(is)}const c=[];let h=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)s();else if(n)o((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,h)));else{if(i){if(h+i.byteLength>e)return void o(ss(e));h+=i.byteLength,c.push(i)}t()}},t=>o(rs(t)))}()})}(t,n)}function as(t){return ls.apply(this,arguments)}function ls(){return(ls=s(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=yr(n,e);return r?Promise.resolve(i+" is in deny list"):os(t,e)})).apply(this,arguments)}function us(t){return cs.apply(this,arguments)}function cs(){return(cs=s(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),s=ts.some(t=>null==r?void 0:r.startsWith(t));if(r&&s)return`Content-Type ${r} is not supported`;const{hostname:o,isHostDenied:a}=yr(n,e);return a?o+" is in deny list":null}({r:t,options:e,url:n});return qi(i)?os(t,e):Promise.resolve(i)})).apply(this,arguments)}let hs=null;function ds(t,e,n){if(!("performance"in e))return()=>{};if(hs)return jr.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},Tr,n):Tr;let o=!0,a=!1;const l=e=>{if(!o)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let i;try{i=r.maskRequestFn(t)}catch(t){return a||(a=!0,jr.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!i||(t=>!!t&&Pr.has(t))(i)),i&&n.push(i)}),n.length>0&&t(i(i({},e),{},{requests:n}))},u=function(t,e,n){try{t({requests:qr(e,n).flatMap(t=>Yr(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){jr.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!ji(r))return;const s=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!s.length)return;const o=new i(i=>{t({requests:i.getEntries().filter(t=>Wr(t)||Br(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Yr(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return o.observe({entryTypes:s}),()=>{o.disconnect()}}(l,e,r),c=r.recordHeaders||r.recordBody;if(!u&&!c)return o=!1,zr;let h=()=>{},d=()=>{};return c&&(h=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),s=gr(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l=!0,u,c){const h=this;try{const s=new Request(a),l={};let u,c;const d={},f=h.setRequestHeader.bind(h);h.setRequestHeader=(t,e)=>(d[t]=e,f(t,e)),i&&(l.requestHeaders=d);const v=h.send.bind(h);h.send=t=>(Zr({type:"request",headers:d,url:a,recordBody:n.recordBody})&&(l.requestBody=Xr({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{h.removeEventListener("readystatechange",m),h.removeEventListener("error",p),h.removeEventListener("abort",p),h.removeEventListener("timeout",p)},m=()=>{if(h.readyState!==h.DONE)return;p(),c=e.performance.now();const i={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),Zr({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Xr({body:h.response,options:n,url:a})),Jr(e,"xmlhttprequest",s.url,u,c).then(n=>{t({requests:Yr(e,{entry:n,method:o,status:null==h?void 0:h.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};h.addEventListener("readystatechange",m),h.addEventListener("error",p),h.addEventListener("abort",p),h.addEventListener("timeout",p)}catch(t){jr.error("Failed to instrument XHR for network capture",t)}s.call(h,o,a.toString(),l,u,c)});return()=>{s()}}(l,e,r),d=!0===r.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),o=gr(e,"fetch",o=>function(a,l){let u;try{u=new Request(a,l)}catch(t){jr.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(a,l))}catch(t){return new Promise((e,n)=>n(t))}}const c={};let h,d;const f=s(function*(){try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!es(null==l?void 0:l.body)&&Zr({type:"request",headers:t,url:a,recordBody:n.recordBody})&&(c.requestBody=yield as({r:u,options:n,url:a}))}catch(t){jr.error("Failed to record fetch request for network capture",t)}})(),v=(p=s(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(c.responseHeaders=e),Zr({type:"response",headers:e,url:a,recordBody:n.recordBody})&&(c.responseBody=yield us({r:t,options:n,url:a}))}catch(t){jr.error("Failed to record fetch response for network capture",t)}}),function(t){return p.apply(this,arguments)});var p;try{h=e.performance.now()}catch(t){}let m;try{m=Gr(a)?o(u):o(a,l)}catch(t){m=new Promise((e,n)=>n(t))}const g=Promise.resolve(m).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t}));return s(function*(){let n;try{yield f;const t=yield g;if("rejected"===t.status)throw t.error;return n=t.response,yield v(n),n}finally{(i=n,Jr(e,"fetch",u.url,h,d).then(n=>{t({requests:Yr(e,{entry:n,method:u.method,status:null==i?void 0:i.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(l,e,r):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),o=gr(e,"fetch",o=>function(){var a=s(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return jr.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let h,d;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!es(null==a?void 0:a.body)&&Zr({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield as({r:l,options:n,url:s}))}catch(t){jr.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Gr(s)?yield o(l):yield o(s,a),d=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),Zr({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield us({r:u,options:n,url:s}))}catch(t){jr.error("Failed to record fetch response for network capture",t)}return u}finally{Jr(e,"fetch",l.url,h,d).then(n=>{t({requests:Yr(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{o()}}(l,e,r)),hs=()=>{o=!1,null==u||u(),h(),d(),hs=null},hs}const fs="$replay_override_sampling",vs="$replay_override_linked_flag",ps="$replay_override_url_trigger",ms="$replay_override_event_trigger",gs="$session_is_sampled",ys="$session_recording_url_trigger_activated_session",bs="$session_recording_event_trigger_activated_session",ws="$posthog_sr_group_event_trigger_",ks="$posthog_sr_group_url_trigger_",Ss="$sess_rec_flush_size",_s="$sdk_debug_replay_event_trigger_status",Cs="$sdk_debug_replay_linked_flag_trigger_status",Ms="$sdk_debug_replay_matched_recording_trigger_groups",Is="$sdk_debug_replay_pending_trigger_conditions",Rs="$sdk_debug_replay_remote_trigger_matching_config",As="$sdk_debug_replay_trigger_groups_count",xs="$sdk_debug_replay_url_trigger_status",Ts="$sdk_debug_rrweb_attached",Os="$sdk_debug_rrweb_start_attempted",Es="$session_recording_start_reason",Fs="disabled",Ls="sampled",$s="active",Ds="buffering",Ns="paused",Ps="rrweb_error",js="trigger_activated",Ws="trigger_pending",Bs="trigger_disabled";function zs(t,e,n,i,r,s){return 0===e?Bs:(null==t?void 0:t.get_property(n?i+n:r))===s?js:Ws}function Us(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function qs(t){return t.includes("trigger_activated")?js:t.includes("trigger_pending")?Ws:Bs}function Hs(t){const e=new Set(t);switch(e.delete(Bs),e.size){case 0:return Bs;case 1:return Array.from(e)[0];default:return Ws}}var Gs=class{constructor(t){this.j=t}triggerStatus(t){return qs(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return qs(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Vs=class{constructor(t){this.j=t}triggerStatus(t){return Hs(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Hs(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Zs=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return js}stop(){}};const Js=t=>"sessionRecording"in t;var Qs=class{constructor(t,e){this._instance=t,this.B=[],this.U=[],this.W=new Map,this.H=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(Js(t)?Bi(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.U=(Js(t)?Bi(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.W.clear(),this.H.clear();for(const t of this.B)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){ur.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.U)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){ur.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return zs(this._instance,this.B.length,this.V,ks,ys,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[xs]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=br(this._instance);if(!t)return!1;try{return Us(t,this.U,this.H)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=br(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=Us(n,this.U,this.H);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=br(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const s=this.urlBlocked,o=Us(r,this.U,this.H);o&&!s?t():!o&&s&&e();const a=this.J(i)===js,l=Us(r,this.B,this.W);!a&&l&&n("url",r)}stop(){this.G=""}},Xs=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Cs]:t}),t}triggerStatusNoSideEffects(){let t=Ws;return Hi(this.linkedFlag)&&(t=Bs),this.linkedFlagSeen&&(t=js),t}onConfig(t,e){var n;if(this.linkedFlag=(Js(t)?Bi(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Hi(this.linkedFlag)&&!this.linkedFlagSeen){const t=Ui(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ui(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let s=!1;if(Bi(r)&&t in r){const e=r[t];s=Vi(e)?!0===e:n?e===n:!!e}const o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},Ks=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Js(t)?Bi(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return zs(this._instance,this.K.length,this.V,ws,bs,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[_s]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===js,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Ys=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new Qs(t,e.id),this.et=new Ks(t,e.id),this.nt=new Xs(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new Gs(r):new Vs(r)}else this.it=new Zs}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Ws).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?ks+this.group.id:ws+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function to(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=!0===t.isSampled,n=new Gs([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ls:"trigger_activated"===n?$s:"trigger_pending"===n?Ds:!1===t.isSampled?Fs:$s}function eo(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=new Vs([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==Bs,i=Vi(t.isSampled);return n&&"trigger_pending"===e?Ds:n&&"trigger_disabled"===e||i&&!t.isSampled?Fs:!0===t.isSampled?Ls:$s}function no(){const t=[];return function(e,n){if(Bi(n)||ji(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function io(t){try{const e=JSON.stringify(t,no());return e?new Blob([e]).size:0}catch(t){return-1}}function ro(t){if(qi(t))return 4;if(zi(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(ji(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=zi(i)||qi(i)?4:ro(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];zi(r)||(i||(n+=1),i=!1,n+=t.length+3+ro(r))}return n}default:return 0}}function so(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[so({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),so({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var oo=Uint8Array,ao=Uint16Array,lo=Uint32Array,uo=new oo([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]),co=new oo([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]),ho=new oo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fo=function(t,e){for(var n=new ao(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new lo(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},vo=fo(uo,2),po=vo[1];vo[0][28]=258,po[258]=28;for(var mo=fo(co,0)[1],go=new ao(32768),yo=0;32768>yo;++yo){var bo=(43690&yo)>>>1|(21845&yo)<<1;go[yo]=((65280&(bo=(61680&(bo=(52428&bo)>>>2|(13107&bo)<<2))>>>4|(3855&bo)<<4))>>>8|(255&bo)<<8)>>>1}var wo=function(t,e,n){for(var i=t.length,r=0,s=new ao(e);i>r;++r)++s[t[r]-1];var o,a=new ao(e);for(r=0;e>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new ao(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],h=a[t[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[go[h]>>>l]=u}else for(o=new ao(i),r=0;i>r;++r)o[r]=go[a[t[r]-1]++]>>>15-t[r];return o},ko=new oo(288);for(yo=0;144>yo;++yo)ko[yo]=8;for(yo=144;256>yo;++yo)ko[yo]=9;for(yo=256;280>yo;++yo)ko[yo]=7;for(yo=280;288>yo;++yo)ko[yo]=8;var So=new oo(32);for(yo=0;32>yo;++yo)So[yo]=5;var _o=wo(ko,9,0),Co=wo(So,5,0),Mo=function(t){return(t/8|0)+(7&t&&1)},Io=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof ao?ao:t instanceof lo?lo:oo)(n-e);return i.set(t.subarray(e,n)),i},Ro=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Ao=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},xo=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,s=n.slice();if(!r)return[new oo(0),0];if(1==r){var o=new oo(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[h].f>n[u].f?u++:h++],l=n[u!=c&&n[h].f>n[u].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;r>i;++i)s[i].s>d&&(d=s[i].s);var f=new ao(d+1),v=To(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new oo(f),v]},To=function(t,e,n){return-1==t.s?Math.max(To(t.l,e,n+1),To(t.r,e,n+1)):e[t.s]=n},Oo=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ao(++e),i=0,r=t[0],s=1,o=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,i),e]},Eo=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},Fo=function(t,e,n){var i=n.length,r=Mo(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;i>s;++s)t[r+s+4]=n[s];return 8*(r+4+i)},Lo=function(t,e,n,i,r,s,o,a,l,u,c){Ro(e,c++,n),++r[256];for(var h=xo(r,15),d=h[0],f=h[1],v=xo(s,15),p=v[0],m=v[1],g=Oo(d),y=g[0],b=g[1],w=Oo(p),k=w[0],S=w[1],_=new ao(19),C=0;y.length>C;++C)_[31&y[C]]++;for(C=0;k.length>C;++C)_[31&k[C]]++;for(var M=xo(_,7),I=M[0],R=M[1],A=19;A>4&&!I[ho[A-1]];--A);var x,T,O,E,F=u+5<<3,L=Eo(r,ko)+Eo(s,So)+o,D=Eo(r,d)+Eo(s,p)+o+14+3*A+Eo(_,I)+(2*_[16]+3*_[17]+7*_[18]);if(L>=F&&D>=F)return Fo(e,c,t.subarray(l,l+u));if(Ro(e,c,1+(L>D)),c+=2,L>D){x=wo(d,f,0),T=d,O=wo(p,m,0),E=p;var N=wo(I,R,0);for(Ro(e,c,b-257),Ro(e,c+5,S-1),Ro(e,c+10,A-4),c+=14,C=0;A>C;++C)Ro(e,c+3*C,I[ho[C]]);c+=3*A;for(var P=[y,k],j=0;2>j;++j){var W=P[j];for(C=0;W.length>C;++C)Ro(e,c,N[B=31&W[C]]),c+=I[B],B>15&&(Ro(e,c,W[C]>>>5&127),c+=W[C]>>>12)}}else x=_o,T=ko,O=Co,E=So;for(C=0;a>C;++C)if(i[C]>255){var B;Ao(e,c,x[257+(B=i[C]>>>18&31)]),c+=T[B+257],B>7&&(Ro(e,c,i[C]>>>23&31),c+=uo[B]);var z=31&i[C];Ao(e,c,O[z]),c+=E[z],z>3&&(Ao(e,c,i[C]>>>5&8191),c+=co[z])}else Ao(e,c,x[i[C]]),c+=T[i[C]];return Ao(e,c,x[256]),c+T[256]},$o=new lo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Do=new oo(0),No=function(){for(var t=new lo(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Po=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function jo(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=No[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,s,o,a,l,u,c=(a=10+((r=e).filename&&r.filename.length+1||0),l=8,function(t,e,n,i,r,s){var o=t.length,a=new oo(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>h?u=Fo(l,u,t.subarray(c,h)):(l[c]=s,u=Fo(l,u,t.subarray(c,o)))}else{for(var d=$o[e-1],f=d>>>13,v=8191&d,p=(1<<n)-1,m=new ao(32768),g=new ao(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new lo(25e3),S=new ao(288),_=new ao(32),C=0,M=0,I=(c=0,0),R=0,A=0;o>c;++c){var x=w(c),T=32767&c,O=g[x];if(m[T]=O,g[x]=T,c>=R){var E=o-c;if((C>7e3||I>24576)&&E>423){u=Lo(t,l,0,k,S,_,M,I,A,c-A,u),I=C=M=0,A=c;for(var F=0;286>F;++F)S[F]=0;for(F=0;30>F;++F)_[F]=0}var L=2,D=0,N=v,P=T-O&32767;if(E>2&&x==w(c-P))for(var j=Math.min(f,E)-1,W=Math.min(32767,c),B=Math.min(258,E);W>=P&&--N&&T!=O;){if(t[c+L]==t[c+L-P]){for(var z=0;B>z&&t[c+z]==t[c+z-P];++z);if(z>L){if(L=z,D=P,z>j)break;var U=Math.min(P,z-2),q=0;for(F=0;U>F;++F){var H=c-P+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,O=H)}}}P+=(T=O)-(O=m[T])+32768&32767}if(D){k[I++]=268435456|po[L]<<18|mo[D];var V=31&po[L],Z=31&mo[D];M+=uo[V]+co[Z],++S[257+V],++_[Z],R=c+L,++C}else k[I++]=t[c],++S[t[c]]}}u=Lo(t,l,s,k,S,_,M,I,A,c-A,u),s||(u=Fo(l,u,Do))}return Io(a,0,i+Mo(u)+r)}(s=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l,!u)),h=c.length;return function(t,e){var n=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&&Po(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(c,e),Po(c,h-8,n.d()),Po(c,h-4,i),c}function Wo(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var Bo=class{constructor(t,e={}){var n,i,r,s;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,s,o,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=t.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const s=this.wt(e);if(0===s&&n!==s)return;if(this.St)return t;this.ct();const o=ro(t);var a,l;return o>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,o),void this._t()):(this.dt-=o,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new Qi({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:ur}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(s=this.rt.bytesRefillRate)&&void 0!==s?s:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const o=this.rt.resyncIntervalMs;this.Ct=Gi(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}};let zo=null;const Uo={Ot(){if(!qi(zo))return zo;if(zo=!0,zi(Ti))zo=!1;else try{const t="__support__";Uo.$t(t,"xyz"),'"xyz"'!==Uo.Lt(t)&&(zo=!1),Uo.Ft(t)}catch(t){zo=!1}return zo},Dt(t){ur.error("sessionStorage error: ",t)},Lt(t){try{return null==Ti?void 0:Ti.sessionStorage.getItem(t)}catch(t){Uo.Dt(t)}return null},Pt(t){try{return JSON.parse(Uo.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==Ti||Ti.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Uo.Dt(t)}return!1},Ft(t){try{null==Ti||Ti.sessionStorage.removeItem(t)}catch(t){Uo.Dt(t)}}};ar.DEBUG=!1,ar.LIB_VERSION="1.453.1",ar.LIB_NAME="web";var qo=ar,Ho=class{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.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(Ss,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(Ss);return Bi(n=e)&&Ui(n.sessionId)&&Gi(n.size)&&e.sessionId===t?e.size:0;var n}};function Go(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<Ji(100*e,0,100,ur)}const Vo=(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}},Zo=t=>t.toLowerCase(),Jo={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=>Vo(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Vo(e,t))),icontains:(t,e)=>e.map(Zo).some(e=>t.map(Zo).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Zo).every(e=>t.map(Zo).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Qo=new Set(["is_not","not_icontains","not_regex"]);function Xo(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],s=t.operator||"exact";if(zi(r)||qi(r))return Qo.has(s);const o=Jo[s];return!!o&&!zi(t.value)&&!qi(t.value)&&o(ji(t.value)?t.value.map(String):[String(t.value)],ji(r)?r.map(String):[String(r)])})}const Ko=cr("[SessionRecording]");function Yo(t,e){return e?t:"x"+t}function ta(t,e){return t===e||t!=="x"+e&&null}var ea=class{constructor(t,e,n,i,r,s,o){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=s,this.zt=o,this.Ut=null,this.Wt=eo}onRemoteConfig(t){this.Ut=Gi(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ht=new Gs([this.et,this.tt]),this.Wt=to):(this.Ht=new Vs([this.et,this.tt]),this.Wt=eo),this._instance.register_for_session({[Rs]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Wt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Gi(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&Hi(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Ko.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ut;var i,r;if(!Gi(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const s=this._instance.get_property(gs),o=this._instance.get_property("$replay_sample_rate"),a=ta(s,t),l=Gi(o)&&o!==n,u=zi(o)&&s===t,c=l||u||!Vi(a),h=c?Go(t,n):a;c&&(h?this.jt("sampled"):Ko.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Yo(t,h),$replay_sample_rate:qi(o)&&s===t?null:n})}ensureSamplingDecision(t){if(!Gi(this.Ut))return;const e=this._instance.get_property(gs);Vi(ta(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ht)||void 0===e?void 0:e.triggerStatus(t))===Ws}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Ws).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},na=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[Rs]:"v2_trigger_groups",[As]:t.triggerGroups.length}),this.tt.onConfig(t)):Ko.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return Fs;let i=!1,r=!1;for(const s of e){const e=s.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=s.group.id,e=n.get(t);zi(e)?ur.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?Ls:i?Ds:Fs}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Gi(t)&&(qi(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Ko.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),s=this._instance.get_property(wr);r.some(e=>!e.properties||0===e.properties.length||Xo(e.properties,t.properties,s))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Ko.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,s=i.sampleRate,o="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(o);let l=null,u=!1,c=!1,h=!1;if(Bi(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Gi(n)&&n!==s,l=e===t&&Gi(n)&&n===s&&Vi(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,h=a===t;const d=u||c||h||!Vi(l),f=d?Go(t+r,s):l;d&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:s,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[o]:{sessionId:t,sampleRate:s,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,s;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(s=this._instance.persistence)||void 0===s||s.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,s="trigger_activated"===n.triggerStatus(t),o=!0===this.Zt.get(r);s&&e.push({id:r,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[Ms]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Xo(n,e,this._instance.get_property(wr))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new Ys(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const ia=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ra=1e5,sa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,oa=[],aa=()=>!1,la="@type @id 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(" "),ua="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ca="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(" "),ha="Accommodation AdministrativeArea Country Place State".split(" "),da={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:ua,publisher:ca},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:oa},Offer:{seller:ca},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:ca,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ca,areaServed:ha,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:oa}},fa=[["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(" "),da.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),da.Event],[ca,da.Organization],[ha,da.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),da.Product]];function va(t,e){return Ni.call(t,e)?t[e]:void 0}function pa(t){const e=typeof t;return qi(t)||"string"===e||"number"===e||"boolean"===e}function ma(t,e){return e&&function(t){return Ui(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function ga(t,e){return ji(t)&&t.every(pa)?t.map(t=>ma(t,e)).filter(t=>!zi(t)):pa(t)?ma(t,e):void 0}function ya(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function ba(t){if(Ni.call(da,t))return da[t];for(const[e,n]of fa)if(e.includes(t))return n}function wa(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function ka(t,e,n,i){if(ji(t)){const r=t.map(t=>ka(t,e,n,i)).filter(t=>!zi(t));return r.length?r:void 0}return Sa(t,e,n,i)||void 0}function Sa(t,e,n,i){if(!Bi(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=va(t,"@type"),s=function(t){const e=new Set,n="string"==typeof t?[t]:ji(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&sa.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),o=s.filter(t=>!!ba(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of la){const o="@type"===i?s.length?"string"==typeof r?s[0]:s:void 0:"@id"===i?ya(va(t,i),e):ga(va(t,i),n.maskUrl);zi(o)||wa(a,i,o)}for(const i of o){const r=ba(i);for(const i of Object.keys(r)){const s=va(t,i),o=r[i];if(!0===o){const t=ga(s,n.maskUrl);zi(t)||wa(a,i,t)}else{const t=ka(s,e,n,o);zi(t)||wa(a,i,t)}}}const l=ka(va(t,"@graph"),e,n);return zi(l)||wa(a,"@graph",l),Object.keys(a).length?a:null}function _a(t,e,n){if(!Bi(t))return null;const r=va(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;const s=Sa(t,e,n);return s?i({"@context":"https://schema.org"},s):null}function Ca(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function Ma(t,e,n){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!!n&&t.matches(n)}catch(t){return!1}}function Ia(t,e,n){for(let i=t;i;){if(Ma(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function Ra(t){return Ca(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ca)}function Aa(t){return Bi(t)?t.network_timing:t}const xa=cr("[SessionRecording]"),Ta=[1,2,3,4,5,6,7,12],Oa=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ea(){var t;return null==$i||null===(t=$i.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Fa(){var t;return null===(t=Ea())||void 0===t?void 0:t.record}function La(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,no())}}function $a(t){return Wo(jo(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new oo(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},s=0;e>s;++s){if(i+5>n.length){var o=new oo(i+8+(e-s<<1));o.set(n),n=o}var a=t.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return Io(n,0,i)}(La(t))),!0)}function Da(t){return Na.apply(this,arguments)}function Na(){return Na=s(function*(t){const e=yield function(t){return sr.apply(this,arguments)}(La(t),qo.DEBUG,{rethrow:!0});return Wo(new Uint8Array(yield e.arrayBuffer()),!0)}),Na.apply(this,arguments)}let Pa,ja;const Wa="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Ba=!1;function za(t){var e;return ji(t)&&0===t.length?(Pa=null!==(e=Pa)&&void 0!==e?e:$a([]),Pa):$a(t)}function Ua(t){return qa.apply(this,arguments)}function qa(){return(qa=s(function*(t){var e;return ji(t)&&0===t.length?Pa||(ja=null!==(e=ja)&&void 0!==e?e:Da([]).then(t=>(Pa=t,t)).catch(t=>{throw Pa=void 0,ja=void 0,t}),ja):Da(t)})).apply(this,arguments)}function Ha(t){return Wa&&!Ba&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Ga(t){return{event:t,size:ro(t)}}function Va(t,e){return i(i({},t),{},{data:e,cv:"2024-10"})}function Za(t,e){return i(i({},t),{},{cv:"2024-10",data:i(i({},t.data),e)})}function Ja(t){try{if(2===t.type)return Ga(Va(t,$a(t.data)));if(3===t.type&&0===t.data.source)return Ga(Za(t,{texts:za(t.data.texts),attributes:za(t.data.attributes),removes:za(t.data.removes),adds:za(t.data.adds)}));if(3===t.type&&8===t.data.source)return Ga(Za(t,{adds:t.data.adds?$a(t.data.adds):void 0,removes:t.data.removes?$a(t.data.removes):void 0}))}catch(t){xa.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:io(t)}}function Qa(){return(Qa=s(function*(t){try{if(2===t.type)return Ga(Va(t,yield Da(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Ua(t.data.texts),Ua(t.data.attributes),Ua(t.data.removes),Ua(t.data.adds)]);return Ga(Za(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Da(t.data.adds):void 0,t.data.removes?Da(t.data.removes):void 0]);return Ga(Za(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Ki})(e)&&(Ba=!0),xa.warn("could not compress event asynchronously - trying synchronous compression",e),Ja(t)}return{event:t,size:io(t)}})).apply(this,arguments)}function Xa(t,e){return 5===t.type&&t.data.tag===e}function Ka(t){return Xa(t,"sessionIdle")}function Ya(t){return Xa(t,"$session_ending")}function tl(t){return Xa(t,"$session_starting")}var el=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return ta(this._instance.get_property(gs),this.sessionId)}get Ut(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Gi(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.supportsSelectMasking=!0,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=void 0,this.ue=!1,this.ce=Date.now(),this.de=!1,this.he=[],this.fe="unknown",this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=0,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=!1,this.Ae=!1,this.Re=!1,this.Ee=void 0,this.Oe=void 0,this.$e=!1,this.Le=[],this.Fe=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Gt=void 0,this.qe=void 0,this.je=void 0,this.Be=void 0,this.ze=(t,e,n)=>{var i,r,s,o;if(!n)return;if(t===this.Xt&&e===this.Ue)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Ue;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce,flushed_size:null===(c=this.We)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Ea())||void 0===r||null===(s=r.resetMaxDepthState)||void 0===s||s.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.He(),!(!1===this.fe&&this.isStarted||this.Xt===t&&this.Ue===e)){const e=this.Xt!==t&&!1!==this.fe;this.fe="unknown",this.Ge(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce}),null===(o=this.oe)||void 0===o||o.makeSamplingDecisions(t)},this.Ve=!1,this.Qe=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Gi(n)&&Gi(i)?i-n:null},this.Je=()=>{var t,e;const n=this.re;if(!Gi(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Ye;return Gi(t)&&t>=0&&n>t}if(this.Qe())return!1;const i=this.Ze();return!!qi(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ke=()=>{"buffering"!==this.status?(this.be&&this.we&&this.Xe&&(this.tn(void 0),this.ke&&(this.ke=!1,this.Bt())),this.en(),this.nn(!0)):this.rn()},this.sn=()=>{this.Ke()},this.an=()=>{this.Vt("browser offline",{})},this.ln=()=>{this.Vt("browser online",{})},this.un=()=>{(null==Ei?void 0:Ei.visibilityState)&&("visible"===Ei.visibilityState&&(this.Xe=!0),this.Vt("window "+Ei.visibilityState,{}))},this.Xe=null==e||e;const{sessionId:n,windowId:i,sessionStartTimestamp:r}=this.te.checkAndGetSessionAndWindowId();this.Xt=n,this.Ue=i,this._sessionStartTimestamp=r,this.nt=new Xs(this._instance),this.tt=new Qs(this._instance),this.et=new Ks(this._instance),this.Rt=this.rn(),this.cn=function(t){return"ph_replay_pending_buffer_"+JSON.stringify([t.persistence_name||t.token,t.token])}(this._instance.config),this.te.sessionTimeoutMs>this.ee||xa.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.We=new Ho(this._instance)}setDocumentWasEverVisible(t){t&&(this.Xe=!0)}get dn(){var t,e,n,i,r,s,o,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},h=null!==(s=null==c?void 0:c.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,d=null!==(o=null==c?void 0:c.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return zi(h)&&zi(d)&&zi(f)&&zi(v)?void 0:{maskAllInputs:null==h||h,maskTextSelector:d,blockSelector:f,maskAllElementAttributes:v}}hn(){var t;if(this.Me)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(Hi(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!zi(i)&&i!==r});0!==i.length&&(this.Me=!0,xa.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==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get fn(){var t;return Ji(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,cr("canvas recording resolution scale"),1)}get vn(){var t,e,n,i,r,s,o;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let h=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof h){const t=parseFloat(h);h=isNaN(t)?.4:t}return{enabled:u,fps:Ji(c,0,12,cr("canvas recording fps"),4),quality:Ji(h,0,1,cr("canvas recording quality"),.4)}}get pn(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get mn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},s=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),o=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=Aa(this._instance.config.capture_performance),l=Aa(null==i?void 0:i.capturePerformance),u=!!(Vi(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}gn(){var t,e;const n=[],r=null===(t=$i.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.pn&&n.push(r());const s=null===(e=$i.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.mn&&Wi(s))if(!vr.includes(Fi.hostname)||this._forceAllowLocalhostNetworkCapture){const t=Wi(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(i(i({},((t,e,n)=>{const r={payloadSizeLimitBytes:Tr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Tr.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Tr.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,a=!1!==t.capture_performance&&e.recordPerformance,l=(t=>{const e=xr(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=Dr(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=Dr(t.responseBody,t.responseHeaders,e,"Response")),t)})(r),u=e=>{return l(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=fr(t.name);let s=0===e.indexOf("http")?null===(i=fr(e))||void 0===i?void 0:i.pathname:e;"/"===s&&(s="");const o=null==r?void 0:r.pathname.replace(s||"","");return r&&o&&$r.some(t=>0===o.indexOf(t))?void 0:t})((Lr((i=e).requestHeaders),Lr(i.responseHeaders),i),t.api_host,n));var i},c=Wi(t.session_recording.maskNetworkRequestFn);return c&&Wi(t.session_recording.maskCapturedNetworkRequestFn)?ur.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):c&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return i(i({},e),{},{name:null==n?void 0:n.url})}),r.maskRequestFn=Wi(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=u(e);if(!r)return;const s=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,o=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return Hi(o)&&s?(Pr.add(s),s):null!=o?o:void 0}:t=>function(t){if(!zi(t))return t.requestBody=Nr(t.requestBody,"Request"),t.responseBody=Nr(t.responseBody,"Response"),t}(u(t)),i(i(i({},Tr),r),{},{recordHeaders:s,recordBody:o,recordPerformance:a,recordInitialRequests:a,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.mn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else xa.info("NetworkCapture not started because we are on localhost.");return n}yn(t){return this._instance.config.disable_capture_url_hashes?Xi(t):t}bn(t,e=!1){const n=e?Xi(t):this.yn(t),i=this._instance.config.mask_personal_data_properties?[...ia,...this._instance.config.custom_personal_data_properties||[]]:[];return this.wn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),s=r[1],o=r[0],a=(s||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=o;return null!=s&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}wn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}kn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):xa.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.kn(Oa(()=>Fa().addCustomEvent(t,e)))}Sn(){var t;return this.ue&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.fe}_n(t){if(!this.Sn())return!1;try{const e=Fa();return!!e&&(e.addCustomEvent("$json_ld",t),this.Sn())}catch(t){return!1}}xn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.Cn)||void 0===e?void 0:e.scan(t)})}Mn(){try{if(this._instance.config.capture_pageview||!Ti)return;const t=new URL(Ti.location.href),e=this.bn(t.origin+t.pathname+t.search);this.Tn!==e&&(this.Tn=e,this.Vt("$url_changed",{href:e}))}catch(t){}}In(){if(this.he.length){const t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.kn(t)})}}Bt(){return this.kn(Oa(()=>Fa().takeFullSnapshot()))}get An(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Gi(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rn(){if(this.En&&clearInterval(this.En),!0===this.fe)return;const t=this.An;t&&(this.En=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.On(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rn()}$n(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this.Cn)||void 0===t||t.scan(),clearInterval(this.En),xa.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Ln(){var t;this.tt.urlBlocked&&(null===(t=this.Cn)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.xn(),this.Rn(),this.Vt("recording resumed",{reason:"left blocked url"}),xa.info("recording resumed"))}Fn(t,e){var n;if("event"===t&&this.On(),!this.de&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.de=!0;try{var i,r;const n="url"===t?ys:bs;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.nn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.de=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=Bi(t)?t:JSON.parse(t)}catch(t){return void xa.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ve){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void xa.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Dn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(t){var e,n;const i=this.ie;if(!i)return void xa.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.fe&&!this.Se;this.tn(t?"no_interaction_since_recording_started":void 0),this.Se=!1,this.we=t,this.ke=!1}this.Pe&&(this.Pn(),this.rn());const{sessionId:r,windowId:s,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=r,this.Ue=s,this._sessionStartTimestamp=o,this.Nn(),null===(e=this._instance.persistence)||void 0===e||e.unregister("$debug_first_full_snapshot_timestamp"),(null==i?void 0:i.endpoint)&&(this.se=null==i?void 0:i.endpoint),this.oe=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new na(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new ea(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(i),null===(n=this.Gt)||void 0===n||n.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Fn(t,e)),this.Dn(fs,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(fs)}),this.Dn(vs,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(vs)}),this.Dn(ms,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(ms)}),this.Dn(ps,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(ps)}),this.oe.makeSamplingDecisions(this.sessionId),this.qn(),this._e||(dr(Ti,"beforeunload",this.Ke),dr(Ti,"pagehide",this.sn),dr(Ti,"offline",this.an),dr(Ti,"online",this.ln),dr(Ei,"visibilitychange",this.un),!this.qe&&Wi(this.te.onSessionId)&&(this.qe=this.te.onSessionId(this.ze)),!this.je&&Wi(this.te.on)?this.je=this.te.on("forcedIdleReset",()=>{this.He(),this.fe="unknown",this.stop(),this.Be=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.Be)||void 0===i||i.call(this),this.Be=void 0,this.ze(t,e,n)})}):Wi(this.te.on)||xa.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Hi(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.bn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){xa.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}jn(t=!1){var e,n,i,r,s,o;null==Ti||Ti.removeEventListener("beforeunload",this.Ke),null==Ti||Ti.removeEventListener("pagehide",this.sn),null==Ti||Ti.removeEventListener("offline",this.an),null==Ti||Ti.removeEventListener("online",this.ln),null==Ei||Ei.removeEventListener("visibilitychange",this.un),clearInterval(this.En),this.Bn(),null===(e=this.Ne)||void 0===e||e.call(this),this.Ne=void 0,null===(n=this.Gt)||void 0===n||n.call(this),this.Gt=void 0,null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,null===(r=this.je)||void 0===r||r.call(this),this.je=void 0,null===(s=this.Be)||void 0===s||s.call(this),this.Be=void 0,null===(o=this.oe)||void 0===o||o.stop(),this.zn(t),this.Pn()}Pn(){this.De+=1,this.Le=[],this.Fe=0,this.Un=void 0,this.Pe=!1}zn(t=!1){var e,n,i;t||null===(i=this.le)||void 0===i||i.cancel(),null===(e=this.Wn)||void 0===e||e.stop(),this.he=[],null===(n=this.Cn)||void 0===n||n.stop(),this.Cn=void 0,this.ue=!1;try{var r;null===(r=this.ae)||void 0===r||r.call(this)}catch(t){xa.warn("could not stop rrweb",t)}this.ae=void 0}Hn(){if(!this.Un||0===this.Fe)return!1;if(this.Pe)return!0;this.Pe=!0,this.Gn=void 0;const t=this.De;return this.Bn(),this.zn(),this.Un.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.nn(),this.rn(),this.Vn(),this.jn(),xa.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vn(),this.jn(),xa.info("stopped")}),!0}stop(t=!1){if(this.zn(t),this.Ve)this.en();else if(this.Hn())return;this.nn(),this.rn(),this.Vn(),this.jn(t),xa.info("stopped")}Vn(){this.tn(void 0,{preserveLogDedup:this.Ve}),this.we=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.en(),this.nn())}Ge(t){const e=this.le,n=this.Ve;let i;this.Ve=!0,this.ce=Date.now();const r={cancelled:!1,cancel(){r.cancelled=!0,null==e||e.cancel(),null==i||i()}};this.le=r;const s=()=>{var t,e;this.stop(!0),r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()?r.cancel():(this.Qn=void 0,this.ye=0,this.pe=0,this.me=0,this.ge=0,null===(t=Ea())||void 0===t||null===(e=t.resetSnapshotCostState)||void 0===e||e.call(t),this.start("session_id_changed"),(r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())&&(r.cancel(),this.discard({discardProducerEvents:!0})))};try{var o;const t=null===(o=Fa())||void 0===o?void 0:o.withStyleRuleSourceHandoff;t&&this.ae?t(this.ae,t=>{i=t,s()}):s()}finally{this.le=e,this.Ve=n}r.cancelled||(this.tn(t?"no_interaction_since_session_rotated":void 0),this.we=!1)}tn(t,{preserveLogDedup:e=!1}={}){if(this.be=!zi(t),this.Gn=t,zi(t))return void(e||(this.Zn=void 0));if(this.Ve)return;const n=`${this.sessionId}:${t}`;n!==this.Zn&&(this.Zn=n,xa.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}On(){this.isStarted||(this.Se=!0),this.be&&(this.tn(void 0),this.we=!1,this.ke&&(this.ke=!1,this.Bt()),this.Jn())}discard({discardProducerEvents:t=!1}={}){t&&(this.Yn||this._instance.config.session_recording.selectMaskingFn)&&Uo.Ft(this.cn),this.be=!0,t&&(this.rn(),this.zn()),this.rn(),this.jn(),this.rn(),this.Vn(),xa.info("discarded")}Kn(t,e,n,i,r){if(-1===n)return this.ye+=1,void xa.warn("could not stringify event - dropping it to keep the rest of the recording");const s={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Xn(t,i),this.ti(s)):this.rn()}ei(){try{this.ni()}catch(t){this.Ce||(this.Ce=!0,xa.error("could not track full snapshot cost",t))}}ni(){var t,e;const n=null===(t=Ea())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Qn&&(this.Qn=n,500>n.durationMs||xa.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Xn(t,e){2!==t.type?3===t.type&&(zi(this.Ee)||this.Ee===e||this.Oe===e||(this.Oe=e,xa.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Ee=e}ii(t){t.counted&&t.generation===this.De&&(this.Fe=Math.max(0,this.Fe-1)),t.counted=!1,this.Le=this.Le.filter(e=>e!==t)}ri(t,e,n){t.processed||t.generation!==this.De||(t.processed=!0,this.Kn(t.event,e,n,t.targetSessionId,t.targetWindowId))}oi(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Ja(t.event))}catch(t){xa.warn("could not process queued compression event - will use uncompressed event",t)}zi(e)&&(e=io(t.event));try{this.ri(t,n,e)}catch(t){xa.warn("could not capture queued compression event",t)}}finally{this.ii(t)}}en(){[...this.Le].forEach(t=>{try{this.oi(t)}catch(t){xa.warn("could not drain queued compression event",t)}})}si(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.De,processed:!1,counted:!0};this.Le.push(o),this.Fe+=1;const a=(l=s(function*(){try{if(o.processed)return;let n,i;try{const r=e?Ha(t)?yield function(t){return Qa.apply(this,arguments)}(t):Ja(t):{event:t,size:io(t)};n=r.event,i=r.size}catch(e){xa.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=io(t)}r.ri(o,n,i)}finally{r.ii(o)}}),function(){return l.apply(this,arguments)});var l;this.Un=this.Un?this.Un.catch(()=>{}).then(a):a()}onRRwebEmit(t,e){var n,i,r,s,o,a,l,u,c,h,d,f;if(!this._instance.sessionManager)return;if(this.In(),!t||!Bi(t))return;if(4===t.type){const e=this.bn(t.data.href);if(this.Tn=e,!e)return;t.data.href=e}else this.Mn();if(null===(n=this.oe)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.$n(),()=>this.Ln(),(t,e)=>this.Fn(t,e)),this.tt.urlBlocked&&(5!==(h=t).type||"recording paused"!==h.data.tag))return;2===t.type&&(this.ei(),Promise.resolve().then(()=>this.ei()),this.Rn(),null===(d=this.Wn)||void 0===d||d.reset(),null===(f=this._instance.persistence)||void 0===f||f.register_once({$debug_first_full_snapshot_timestamp:t.timestamp},void 0));const v=2===t.type&&(null===(i=this.oe)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));v&&this.ai();const p=this.Wn?this.Wn.throttleMutations(t):t;if(!p)return void(!0===this.fe&&this.ve++);const m=function(t){const e=t;if(e&&Bi(e)&&6===e.type&&Bi(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]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(p),g=function(t){return Ya(t)?t.data.payload:null}(m),y=function(t){return tl(t)?t.data.payload:null}(m),b=function(t){return Ka(t)?t.data.payload:null}(m);g||y?(null==g?void 0:g.lastActivityTimestamp)&&(m.timestamp=g.lastActivityTimestamp):(null==b?void 0:b.sessionId)||this.li(m,e);const w=null!==(r=null!==(s=null!==(o=null==g?void 0:g.currentSessionId)&&void 0!==o?o:null==y?void 0:y.nextSessionId)&&void 0!==s?s:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Xt,k=null!==(a=null!==(l=null!==(u=null==g?void 0:g.currentWindowId)&&void 0!==u?u:null==y?void 0:y.nextWindowId)&&void 0!==l?l:null==b?void 0:b.windowId)&&void 0!==a?a:this.Ue;if(!0===this.fe&&!function(t){return Ka(t)||Ya(t)||tl(t)}(m))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(m)&&this.ve++);2===m.type&&(this.ve=0),b&&(m.timestamp=b.lastActivityTimestamp+b.threshold);const S=this.ue;this.ue=!0,v?this.xn(!0):S||this.xn();const _=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===m.type&&"$json_ld"===m.data.tag){let t;try{t=Ti?this.bn(Ti.location.href):void 0}catch(t){}m.data.href=t}if(this.Fe>0||_&&Ha(m))return void this.si(m,_,w,k);const{event:C,size:M}=_?Ja(m):{event:m,size:io(m)};this.Kn(m,C,M,w,k)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this._e,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):Fs}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.On(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.On(),this.jt("sampling_overridden")}overrideTrigger(t){this.Fn(t),this.On()}ui(){try{var t;const e=null==Ti||null===(t=Ti.location)||void 0===t?void 0:t.href;if(!e)return;const n=this.bn(e);if(!n)return;return new URL(n).hostname||void 0}catch(t){return}}Bn(){this.ci&&(clearTimeout(this.ci),this.ci=void 0)}Jn(){this.ci||(this.ci=setTimeout(()=>{this.nn()},2e3))}di(){return this.Ee!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Ya(t)&&!tl(t))}hi(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}fi(t){if("buffering"!==t)return zi(this.pi)||this._instance.register_for_session({[Is]:[]}),void(this.pi=void 0);const e=this.hi();if(0===e.length)return zi(this.pi)||this._instance.register_for_session({[Is]:[]}),void(this.pi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.pi&&(this.pi=i,this._instance.register_for_session({[Is]:e}),xa.info(`buffering: ${n}`))}mi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.gi)&&Uo.Ot()}yi(){this.Yn||this._instance.config.session_recording.selectMaskingFn||0!==this.Rt.data.length&&this.Rt.size!==this.bi&&943718.4>=this.Rt.size&&this.mi()&&(this.bi=this.Rt.size,Uo.$t(this.cn,this.Rt))}Nn(){if(this.$e||!this.mi())return;this.$e=!0;const t=Uo.Pt(this.cn);Uo.Ft(this.cn),!this._instance.config.session_recording.selectMaskingFn&&Bi(t)&&ji(t.data)&&0!==t.data.length&&ji(t.sizes)&&t.sizes.length===t.data.length&&Gi(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Ue&&(this.Rt.data.length>0||(this.Rt=t))}nn(t=!1){var e;if(this.Bn(),this.be)return this.Rt;if(this.di())return this.Rt.size>943718.4?this.rn():(t&&this.yi(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const r=this.Je(),s=this.status;if(this.fi(s),"buffering"===s||"paused"===s||"disabled"===s||r)return!t||"active"!==s&&"sampled"!==s||this.yi(),this.Jn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.ui();so(n).forEach(e=>{try{var n;null===(n=this.We)||void 0===n||n.trackSize(e.sessionId,e.size),this.wi(i(i(i(i({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:qo.LIB_NAME,$lib_version:qo.LIB_VERSION,$snapshot_host:t},this.pe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutations_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ge}:{}),this.ye>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ye}:{}))}catch(t){xa.warn("could not capture snapshot chunk - skipping it",t)}}),zi(this.bi)||(Uo.Ft(this.cn),this.bi=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.rn()}ti(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.fe&&!this.be&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.nn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.rn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.be&&(this.ke||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ke=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.fe||this.be||this.Jn())}wi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ye(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.rn();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.rn():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}rn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Ue},this.Rt}jt(t,e){this._instance.register_for_session({[Es]:t}),xa.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",i({reason:t},e))}ki(t,e){var n;return!e&&3===t.type&&-1!==Ta.indexOf(null===(n=t.data)||void 0===n?void 0:n.source)}li(t,e){const n=this.ki(t,e);n||!0===this.fe||t.timestamp-this.ce>this.ee&&(this.fe=!0,clearInterval(this.En),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ce,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Ue}),this.nn());const{windowId:i,sessionId:r}=this.te.checkAndGetSessionAndWindowId(!n,t.timestamp);let s=!1;if(n&&(this.ce=t.timestamp,this.fe)){const e="unknown"===this.fe;this.fe=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}const o=this.Xt!==r,a=this.Ue!==i;if(this.Ue=i,this.Xt=r,o||a){const t=o&&!1!==this.fe;t&&(this.fe="unknown"),this.Ge(t)}else if(n&&this.On(),s){var l;const t=["sampled","active"].includes(this.status)||(null===(l=this.oe)||void 0===l?void 0:l.hasPendingTriggers(this.sessionId));this.ve>0&&t&&this.Bt(),this.xn(),this.Rn()}}He(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Gn,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.We)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this._e,[Ts]:this.Si,[Os]:this.xe}}get Si(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Fa())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}qn(){var t;if(this.ae)return;this.xe=!0;const e={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,selectMaskingFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},n=this._instance.config.session_recording;for(const[t,r]of Object.entries(n||{}))if(t in e)if("maskInputOptions"===t)e.maskInputOptions=i({password:!0},r);else if("sampling"===t){const t=null!=r?r:{},n={};zi(t.mousemove)||(n.mousemove=t.mousemove),zi(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),e.sampling=n}else e[t]=r;var r,s,o,a;!0===(null==n?void 0:n.captureJsonLd)&&!0!==e.slimDOMOptions&&"all"!==e.slimDOMOptions&&(e.slimDOMOptions=i(i({},e.slimDOMOptions),{},{script:!0})),this.vn&&this.vn.enabled&&(e.recordCanvas=!0,e.sampling=i(i({},e.sampling),{},{canvas:this.vn.fps}),e.dataURLOptions={type:"image/webp",quality:this.vn.quality},e.canvasResolutionScale=this.fn,e.canvasMasking={configured:()=>{var t;return Wi(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(Wi(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,xa.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.dn&&(e.maskAllInputs=null===(r=this.dn.maskAllInputs)||void 0===r||r,e.maskTextSelector=null!==(s=this.dn.maskTextSelector)&&void 0!==s?s:void 0,e.blockSelector=null!==(o=this.dn.blockSelector)&&void 0!==o?o:void 0,e.maskAllElementAttributes=null!==(a=this.dn.maskAllElementAttributes)&&void 0!==a&&a),e.maskAllElementAttributes&&e.maskAttributeFn&&(e.maskAttributeFn=void 0,this.Te||(this.Te=!0,xa.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.hn();const l=Fa();if(!l)return void xa.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");if(e.selectMaskingFn&&!0!==l.supportsSelectMasking)return void xa.error("Session recording has not started: the recorder does not support selectMaskingFn.");this.Wn=null!==(t=this.Wn)&&void 0!==t?t:new Bo(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;xa.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.pe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.An,onDroppedOversizedMutation:t=>{0===this.me&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.me+=1,this.ge+=t},requestFullSnapshot:()=>this.Bt()});const u=e.selectMaskingFn;this.Yn=u,u&&(e.selectMaskingFn=t=>{try{return u(t)}catch(t){throw this.Re||(this.Re=!0,xa.warn("selectMaskingFn threw; affected selects are recorded as masked.",t)),t}});const c=this.gn(),h=this.le;if(this.ae=l(i(i({emit:(t,e,n)=>{(null==h?void 0:h.cancelled)||(h&&this.le===h&&(this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())?h.cancel():this.onRRwebEmit(t,n))},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ae||(this.Ae=!0,xa.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},e),{},{recordAfter:"DOMContentLoaded"})),!this.ae)return this._e=!0,void xa.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._e=!1,!0===(null==n?void 0:n.captureJsonLd)&&Ei&&(null==Ti?void 0:Ti.MutationObserver)&&!this.Cn&&(this.Cn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let s=ra;const o=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?aa:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ia(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ia(t,e.blockClass,e.blockSelector)||Ia(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=aa,n){if(!t||t.length>ra)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},s=ji(i)?i.map(t=>_a(t,e,r)):_a(i,e,r);if(r.exceeded||qi(s)||ji(s)&&(!s.length||s.some(qi)))return null;const o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(qi(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>s)return void(s=0);n.emit(u)&&(i.set(e,c),s-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!s||!1===r())return;const e=t=>{for(const e of Ra(t))a(e)};for(const n of t)if("childList"===n.type)Ca(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&Ca(t)&&a(t)}else"attributes"===n.type&&Ca(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){s&&!1!==r()&&Ra(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Ei,Ti.MutationObserver,{maskUrl:t=>this.bn(t),attributeFilter:e.attributeFilter,blockClass:e.blockClass,blockSelector:e.blockSelector,isRecordedElement:t=>l.mirror.getId(t)>0,maskAllElementAttributes:e.maskAllElementAttributes,maskAttributeFn:e.maskAttributeFn,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.Sn()},emit:t=>this._n(t)}),this.tt.isCurrentUrlBlocked()&&this.Cn.scan()),this.ce=Date.now(),this.fe=Vi(this.fe)?this.fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:e,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};$i.__PosthogExtensions__=$i.__PosthogExtensions__||{},$i.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:xi,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ds,options:t})},$i.__PosthogExtensions__.rrweb={record:vi,version:"v2",wasMaxDepthReached:()=>ke,resetMaxDepthState(){ke=!1,we=!1},getLastSnapshotCost:()=>Y,getMutationCost:()=>i({},rt),getDeferredStylesheetStats:()=>i({},st),getDiscardedDurationSamples:()=>H,getObserverInitFailures:()=>wn.size?Array.from(wn):void 0,resetSnapshotCostState(){J=0,Q=0,X=0,q=0,H=0,K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Y=null,tt=null,et=[],nt=0,it=0,rt={slowestBatchMs:0},st={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},$i.__PosthogExtensions__.initSessionRecording=(t,e)=>new el(t,e),$i.__PosthogExtensions__.initSessionRecording.supportsSelectMasking=!0}();
1
+ !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n,i){return(n=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function i(t){for(var i=1;arguments.length>i;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function r(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function s(t){return function(){var e=this,n=arguments;return new Promise(function(i,s){var o=t.apply(e,n);function a(t){r(o,i,s,a,l,"next",t)}function l(t){r(o,i,s,a,l,"throw",t)}a(void 0)})}}const o=["type"];var a=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),l=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),u=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),c=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),h=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),d=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),f=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function v(t,e){return-1!==t.indexOf(e)}Date,Date;var p={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},g={};function y(t){if(g[t])return g[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in p?p[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in m?m[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&o)return g[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(v(u=navigator.userAgent,"AppleWebKit")&&!v(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),g[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var b=Object.create(null);function w(t,e,n){var i;const r=b[t],s=r[n];if(s)return s.call(e);const o=y(t),a=null===(i=Object.getOwnPropertyDescriptor(o,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}b.Node=Object.create(null),b.ShadowRoot=Object.create(null),b.MutationObserver=Object.create(null),b.Element=Object.create(null);var k,S={};function _(t,e,n){const i=`${t}.${String(n)}`;if(S[i])return S[i].bind(e);const r=y(t)[n];return"function"!=typeof r?e[n]:(S[i]=r,r.bind(e))}function C(){return y("MutationObserver").constructor}function M(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},s=n(function(...t){return r.next.apply(this,t)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],o=n(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=n(i)}}}catch(t){return()=>{}}}var I={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),previousSibling:t=>w("Node",t,"previousSibling"),nextSibling:t=>w("Node",t,"nextSibling"),lastChild:t=>w("Node",t,"lastChild"),isConnected(t){if(void 0===k){var e;const t=null===(e=Object.getOwnPropertyDescriptor(y("Node"),"isConnected"))||void 0===e?void 0:e.get;k=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==k?void 0:k.call(t)},contains:(t,e)=>_("Node",t,"contains")(e),getRootNode:t=>_("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>_("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>_("Element",t,"querySelectorAll")(e),mutationObserver:C,patch:M},R=new WeakMap;function A(t){let e=Object.getPrototypeOf(t);for(;e;){const t=R.get(e);if(t)return t;e=Object.getPrototypeOf(e)}}var x=new WeakMap,T=new WeakSet,O=new WeakSet,E=!1;function F(t){return/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)}function L(t){return!!t.includes("var(")&&(!!/["'\\]|\/\*|url\(/i.test(t)||t.replace(/\{[^{};]*(?:;\s*)?\}/g,"{}").replace(/(^|[;{])\s*(?:--[\w-]+|color|background-color|width|height|min-width|max-width|min-height|max-height|font-size|font-weight|line-height|opacity|z-index|top|right|bottom|left)\s*:[^;{}]*/gi,"$1").includes("var("))}function D(t){try{for(;t;)x.delete(t),t=t.parentRule}catch(t){z()}}function N(t,e){try{if(D(t),E||O.has(t)||"string"!=typeof e||!L(e))return;if("cssRules"in t&&t.cssRules.length>0){var n;let e=t.parentStyleSheet;for(;null==e?void 0:e.ownerRule;)e=e.ownerRule.parentStyleSheet;if("LINK"===(null==e||null===(n=e.ownerNode)||void 0===n?void 0:n.nodeName))return}const i=t.cssText;if(F(i)){x.set(t,{text:e,cssText:i,realm:A(t)});let n=t.parentRule;for(;n;)T.add(n),n=n.parentRule}}catch(t){}}function P(t,e){try{if(E||"string"!=typeof e||!L(e))return;const n=Array.from(t.cssRules);if(!n.some(t=>F(t.cssText)))return;const i=function(t){const e=[];let n=0,i=0,r=0,s=0,o="",a=!1,l=!1;for(let u=0;t.length>u;u++){const c=t[u];if(a)"*"===c&&"/"===t[u+1]&&(a=!1,u++);else if("\\"!==c)if(o)c===o&&(o="");else if("/"!==c||"*"!==t[u+1]){if(!l){const e=t.startsWith("\x3c!--",u)?4:t.startsWith("--\x3e",u)?3:0;if(e){u+=e-1,n=u+1;continue}}-1===" \t\n\r\f".indexOf(c)&&(l=!0),'"'!==c&&"'"!==c?("("===c?r++:")"===c?r--:"["===c?s++:"]"===c&&s--,r||s||("{"===c?i++:"}"===c&&i--,("}"===c&&0===i||";"===c&&0===i)&&(e.push(t.slice(n,u+1).trim()),n=u+1,l=!1))):o=c}else a=!0,u++;else l=!0,u++}return i||r||s||o||a?[]:e}(e);if(i.length!==n.length)return;n.forEach((t,e)=>N(t,i[e]))}catch(t){}}function j(t){var e;const n=x.get(t);if(n){if(!1!==(null===(e=n.realm)||void 0===e?void 0:e.active)&&n.cssText===t.cssText)return n.text;x.delete(t)}}function W(t){D(t);try{let e=t;for(;e;)O.add(e),e=e.parentRule}catch(t){z()}}function B(){x=new WeakMap,T=new WeakSet}function z(){B(),E=!0}function U(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var q=0,H=0;function G(){q+=1}function V(){return q}function Z(t,e){return(e!==q||t>6e4)&&(H+=1,!0)}var J=0,Q=0,X=0,K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Y=null,tt=null,et=[],nt=0,it=0,rt={slowestBatchMs:0},st={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ot(t){var e;(J+=1)>1||(K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},et=[],nt=0,tt=(e=t)&&e>0?e:null,Q=U(),X=q)}function at(){return 0===J?Y||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(J-=1)>0?K:(K.durationMs=U()-Q,K.deferredStylesheetCount=nt,st.deferredCount+=nt,tt=null,Z(K.durationMs,X)?K:Y=K)}function lt(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const s=t[r];try{const t=s.cssRules;if(t&&t.length)i+=lt(t,e,n+1);else if(e&&s.styleSheet){const t=s.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=lt(r,e,n+1))}}}catch(t){}}return i}function ut(t){if(0===J)return;const e=lt(t,null,0);K.cssRuleCount+=e,it>0&&(K.nonDeferrableCssRuleCount+=e)}function ct(t){it+=1;try{return t()}finally{it-=1}}function ht(t){J>0&&(K.stylesheetMs+=t)}function dt(t){if(0===J||null===tt)return!1;const e=K.cssRuleCount-K.nonDeferrableCssRuleCount;return e>=tt||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),lt(e,n,0)}catch(t){return 0}}(t)>tt}function ft(){const t=et;return et=[],t}function vt(){st.failedCount+=1}function pt(t){t>0&&(st.abandonedCount+=t)}function mt(t){return mt="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},mt(t)}function gt(t,e,n){return(e=function(t){var e=function(t){if("object"!=mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(t){return t.nodeType===t.ELEMENT_NODE}function bt(t){const e=t&&"host"in t&&"mode"in t&&I.host(t)||null;return Boolean(e&&"shadowRoot"in e&&I.shadowRoot(e)===t)}function wt(t){return"[object ShadowRoot]"==={}.toString.call(t)}function kt(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function St(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var _t=0;function Ct(t){const e=0===_t,n=e?U():0;_t+=1;try{const e=t.rules||t.cssRules;if(!e)return null;ut(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),kt(Array.from(e,t=>Mt(t,n)).join(""))}catch(t){return null}finally{_t-=1,e&&ht(U()-n)}}function Mt(t,e){if(Rt(t)){let e;try{e=Ct(t.styleSheet)||St(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return Ut(e,t.styleSheet.href)}catch(t){}return e}{var i;let n=j(t);if(void 0===n&&function(t){return T.has(t)}(t)){const e=Ot(t);null!==e&&(n=e+Array.from(t.cssRules,t=>Mt(t,null)).join("")+"}")}return null!==(i=n)&&void 0!==i||(n=t.cssText),At(t)&&t.selectorText.includes(":")&&(n=It(n)),e?Ut(n,e):n}}function It(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Rt(t){return"styleSheet"in t}function At(t){return"selectorText"in t}var xt=/^-?[A-Za-z_][\w-]*$/,Tt=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Ot(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(At(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!xt.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let 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]?xt.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":Tt.test(e.name)?`@layer ${e.name} {`:null:null}var Et=class{constructor(){gt(this,"idNodeMap",new Map),gt(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),yt(t)){const e=I.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ft({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:s}){let o=r||"";const a=i&&Lt(i);return(e[n.toLowerCase()]||a&&e[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function Lt(t){return t.toLowerCase()}var $t=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 Dt({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:s=!1}){return n?i?s&&$t.has(Lt(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var Nt="__rrweb_original__";function Pt(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Lt(e):null}catch(t){return null}}var jt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Wt=/^(?:[a-z+]+:)?\/\//i,Bt=/^www\..*/i,zt=/^(data:)([^,]*),(.*)/i;function Ut(t,e){return(t||"").replace(jt,(t,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return t;if(Wt.test(a)||Bt.test(a))return`url(${l}${a}${l})`;if(zt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),h=e.split("#")[0].split("/"),d=u.split("/");h.pop();for(const t of d)"."!==t&&(".."===t?h.pop():h.push(t));return`url(${l}${h.join("/")}${c}${l})`})}var qt=new Map;function Ht(t){return"http://www.w3.org/1999/xhtml"===t.namespaceURI?t.localName:void 0}function Gt(t,e,n,r=void 0){if(!n||"select"!==Ht(t))return e;const s=null==r?void 0:r.input.get(t);if(s)return s;let o;try{o="unmasked"!==n(t)}catch(t){o=!0}const a=i(i({},e),{},{select:o});return null==r||r.input.set(t,a),a}function Vt(t,e,n,i){if(!n)return!1;let r=I.parentNode(t);const s=[];let o=!1;for(;r;){const t=null==i?void 0:i.content.get(r);if(void 0!==t){o=t;break}if(s.push(r),yt(r)&&"selectedcontent"===Ht(r)){let t=I.parentElement(r);for(;t;){const r=t.localName;if("option"===r)break;if("select"===r){"select"===Ht(t)&&Gt(t,e,n,i).select&&(o=!0);break}t=I.parentElement(t)}if(o)break}r=bt(r)?I.host(r):I.parentNode(r)}for(const t of s)null==i||i.content.set(t,o);return o}var Zt,Jt,Qt=1,Xt=new RegExp("[^a-z0-9-_:]");function Kt(){return Qt++}var Yt=!1,te=/^[^ \t\n\r\u000c]+/,ee=/^[, \t\n\r\u000c]+/,ne=new WeakMap;function ie(t,e){return e&&""!==e.trim()?re(t,e):e}function re(t,e){let n=ne.get(t);if(n||(n=t.createElement("a"),ne.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function se(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function oe(t,e,n,i,r,s){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=ie(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=qt.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const s=r.getContext("2d");if(!s)return e;s.drawImage(t,0,0);const o=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>o.length?o:e;if(qt.size>=10){const t=qt.keys().next().value;void 0!==t&&qt.delete(t)}return qt.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,s.type,s.quality)),se(t,s)}if("image"===e)return se(n,s)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=ie(t,i);return"image"===e&&n.startsWith("data:")?se(n,s):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(ee),e.length>n;){let s=i(te);if(","===s.slice(-1))s=ie(t,s.substring(0,s.length-1)),r.push(s);else{let i="";s=ie(t,s);let o=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((s+i).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,r.push((s+i).trim());break}"("===t&&(o=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?Ut(i,re(t)):"object"===e&&"data"===n?ie(t,i):i:ie(t,i)}function ae(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===Lt(e)}function le(t){return"string"==typeof t&&Lt(t).split(/\s+/).includes("stylesheet")}function ue(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else if(ce(t,e,!1))return!0;if(n)return t.matches(n)}catch(t){}return!1}function ce(t,e,n){if(!t||!e)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&ce(I.parentNode(t),e,n);const i=e.global||e.sticky?new RegExp(e):e;for(let e=t.classList.length;e--;)if(i.test(t.classList[e]))return!0;return!!n&&ce(I.parentNode(t),e,n)}function he(t,e,n,i){let r;if(yt(t)){if(r=t,!I.childNodes(r).length)return!1}else{if(null===I.parentElement(t))return!1;r=I.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(ce(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function de(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var fe=new Map;function ve(t={}){fe.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),fe.delete(n))})}function pe(t){try{return t.sheet}catch(t){return null}}function me(t,e,n,i,r){const s=new AbortController,o=()=>{var e;(null===(e=fe.get(t))||void 0===e?void 0:e.controller)===s&&fe.delete(t),s.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{o()}}};t.addEventListener("load",l,{signal:s.signal,once:!0}),t.addEventListener("error",o,{signal:s.signal,once:!0});const u=Date.now()+6e4;let c;const h=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?h(e+1):o():o()},r)};s.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),h(0),fe.set(t,{controller:s,changedLinkBaseline:r})}var ge=[100,200,400,800,1600,3200,6400,12800,25600];function ye(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function be(t){return null==t?"":t.toLowerCase()}var we=!1,ke=!1;function Se(t,e,n=void 0){const{doc:i,mirror:r,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m=!1,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b={},inlineImages:w=!1,recordCanvas:k=!1,canvasMaskingConfigured:S,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M=5e3,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:O=!1,depth:E=0,maxDepth:L=50}=e;let{needsMask:D}=e,{preserveWhiteSpace:N=!0}=e;if(p&&!n&&(n={input:new WeakMap,content:new WeakMap,owner:new WeakMap}),p&&Vt(t,h,p,n))return null;if(E>=L)return ke=!0,we||(we=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${L}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;D||(D=he(t,a,l,void 0===D)),J>0&&(K.nodeCount+=1);const P=function(t,e,n){const{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:h,selectMaskingFn:d,maskAllElementAttributes:v=!1,maskAttributeFn:p,dataURLOptions:m={},inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:k=!1}=e,S=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:S};case t.ELEMENT_NODE:return function(t,e,n){const{doc:i,blockClass:r,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,selectMaskingFn:u,maskAllElementAttributes:c=!1,maskAttributeFn:h,dataURLOptions:d={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1,rootId:b}=e,w=ue(t,r,s),k=u&&Ht(t),S="select"===k||"option"===k||"selectedcontent"===k?k:function(t){if(t instanceof HTMLFormElement)return"form";const e=Lt(t.tagName);return Xt.test(e)?"div":e}(t);let _=a;if(u&&!w&&("select"===S||"option"===S)){const e="option"===S?function(t,e){let n=I.parentElement(t);const i=[];for(;n&&"select"!==Ht(n);){const t=null==e?void 0:e.owner.get(n);if(void 0!==t){n=t;break}i.push(n),n=I.parentElement(n)}for(const t of i)null==e||e.owner.set(t,n);return n}(t,n):t;e&&(_=Gt(e,a,u,n))}const C=new Set;let M={};const R=t.attributes.length;for(let e=0;R>e;e++){const n=t.attributes[e];ae(S,n.name)||(M[n.name]=oe(i,S,Lt(n.name),n.value,t,d))}if("link"===S&&"string"==typeof M.href){var A;const e=null===(A=pe(t))||void 0===A?void 0:A.href;e&&(M.href=e)}if("link"===S&&o&&!w&&le(M.rel)){let e=t.sheet;if(!e){const n=function(t){return t.href}(t);n&&(e=ye(i,n),!e&&n.includes(".css"))&&(e=ye(i,window.location.origin+"/"+n.replace(window.location.href,"")))}let n=null;e&&(dt(e)?J>0&&(et.push(t),nt+=1):n=Ct(e)),n&&(delete M.rel,delete M.href,M._cssText=n)}var x;if("style"===S&&t.sheet&&!(t.innerText||I.textContent(t)||"").trim().length){const e=ct(()=>Ct(t.sheet));e&&(M._cssText=e)}if("input"===S||"textarea"===S||"select"===S){var T;const e="select"===S?t.selectedOptions:void 0,n=e?(null===(T=Array.from(e).find(e=>{let n=e;for(;n&&n!==t;){if(ue(n,r,s))return!1;n=I.parentElement(n)}return!0}))||void 0===T?void 0:T.value)||"":t.value,i=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&(e||n)?M.value=n?Ft({element:t,type:Pt(t),tagName:S,value:n,maskInputOptions:_,maskInputFn:l}):"":i&&(M.checked=i)}if("select"===S&&(u||_.select&&!l)&&(M.rr_maskedSelect=!!_.select||null,C.add("rr_maskedSelect")),"option"===S&&(t.selected&&!_.select?M.selected=!0:delete M.selected),"dialog"===S&&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}C.add("rr_open_mode")}if("canvas"===S&&p&&!(null==m?void 0:m()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,s=Nt in r?r[Nt]:r;let o;try{o=s.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(o.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){const e=t.toDataURL(d.type,d.quality),n=i.createElement("canvas");n.width=t.width,n.height=t.height,e!==n.toDataURL(d.type,d.quality)&&(M.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(x=t)?void 0:x.name)?Yt||(Yt=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",x)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",x)}let O,E=!1;if("img"===S&&v){Zt||(Zt=i.createElement("canvas"),Jt=Zt.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,s=(e,n)=>E?Dt({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:h}):n,o=()=>{de(e,"load",o);try{Zt.width=e.naturalWidth,Zt.height=e.naturalHeight,Jt.drawImage(e,0,0);const t=Zt.toDataURL(d.type,d.quality);M.rr_dataURL=s("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?M.crossOrigin=s("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}if("audio"===S||"video"===S){const e=M;e.rr_mediaState=t.paused?"paused":"played",C.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(y||function(t){return"function"!=typeof t.checkVisibility||t.checkVisibility({contentVisibilityAuto:!0})}(t)&&(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var F,L,D;const{width:e,height:n,left:r,top:s}=t.getBoundingClientRect(),o=null===(F=i.defaultView)||void 0===F?void 0:F.getComputedStyle(t);M={class:M.class,rr_width:`${e}px`,rr_height:`${n}px`,rr_left:`${Math.floor(r+((null===(L=i.defaultView)||void 0===L?void 0:L.scrollX)||0))}px`,rr_top:`${Math.floor(s+((null===(D=i.defaultView)||void 0===D?void 0:D.scrollY)||0))}px`},C.add("rr_width"),C.add("rr_height"),C.add("rr_left"),C.add("rr_top"),o&&(M.rr_position=o.position||"static",C.add("rr_position"),o.transform&&"none"!==o.transform&&(M.rr_transform=o.transform,C.add("rr_transform")),o.display&&o.display.startsWith("inline")&&(M.rr_display=o.display,C.add("rr_display")))}if("iframe"!==S||g(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),c||h)for(const[e,n]of Object.entries(M))"string"!=typeof n&&null!==n||(M[e]=Dt({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:h,isGenerated:C.has(e)}));E=!0;try{customElements.get(S)&&(O=!0)}catch(t){}return{type:f.Element,tagName:S,attributes:M,childNodes:[],isSVG:(N=t,Boolean("svg"===N.tagName||N.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:O};var N}(t,{doc:i,blockClass:s,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,selectMaskingFn:d,maskAllElementAttributes:v,maskAttributeFn:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:k,rootId:S},n);case t.TEXT_NODE:case t.CDATA_SECTION_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,s=I.parentNode(t),o=s&&s.tagName;let a=I.textContent(t);const l="STYLE"===o||void 0,u="string"==typeof o&&"SCRIPT"===o.toUpperCase();if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(dt(s.sheet));else if(null===(c=s.sheet)||void 0===c?void 0:c.cssRules){const t=Ct(s.sheet);t&&!F(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=Ut(a,re(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,I.parentElement(t)):a.replace(/[\S]/g,"*")),{type:f.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:i,needsMask:a,maskTextFn:c,rootId:S});case t.COMMENT_NODE:return{type:f.Comment,textContent:I.textContent(t)||"",rootId:S};default:return!1}}(t,{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:T,newlyAddedElement:O},n);if(!P)return console.warn(t,"not serialized"),null;let j;j=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(be(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===be(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(be(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&be(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(be(t.attributes.property).match(/^(og|twitter|fb):/)||be(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===be(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(be(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(be(t.attributes.name))||be(t.attributes.property).match(/^article:/)||be(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(be(t.attributes.name)))return!0}}return!1}(P,y)||!N&&P.type===f.Text&&!P.isStyle&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Kt();const W=Object.assign(P,{id:j});if(r.add(t,W),-2===j)return null;_&&_(t);let B=!u;if(W.type===f.Element){B=B&&!W.needBlock,delete W.needBlock;const e=I.shadowRoot(t);e&&wt(e)&&(W.isShadowHost=!0)}if((W.type===f.Document||W.type===f.Element)&&B){y.headWhitespace&&W.type===f.Element&&"head"===W.tagName&&(N=!1);const e={doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E+1,maxDepth:L};if(W.type===f.Element&&"textarea"===W.tagName&&void 0!==W.attributes.value);else for(const i of Array.from(I.childNodes(t))){const t=Se(i,e,n);t&&W.childNodes.push(t)}let O=null;if(yt(t)&&(O=I.shadowRoot(t)))for(const t of Array.from(I.childNodes(O))){const i=Se(t,e,n);i&&(wt(O)&&(i.isShadow=!0),W.childNodes.push(i))}}const z=I.parentNode(t);if(z&&bt(z)&&wt(z)&&(W.isShadow=!0),W.type===f.Element&&"iframe"===W.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let s;try{s=r.document.readyState}catch(t){return i}const o=()=>e();if("complete"!==s){let i=!1,r=null;const s=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),de(t,"load",a),t.addEventListener("load",o),e())},a=()=>s();return r=setTimeout(s,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?de(t,"load",o):(i=!0,de(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(n),de(t,"load",o)}}return t.addEventListener("load",o),()=>{de(t,"load",o)}}(t,()=>{const e=t.contentDocument;if(e&&C){const n=Se(e,{doc:e,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onIframeListenerRegistered:R,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E+1,maxDepth:L});n&&C(t,n)}},M);null==R||R(t,e)}var U,q,H;return W.type===f.Element&&"link"===W.tagName&&le(W.attributes.rel)&&(q=()=>{if(A){const e=r.getMeta(t),n=Se(t,{doc:i,mirror:r,blockClass:s,blockSelector:o,needsMask:D,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:d,maskInputFn:v,selectMaskingFn:p,maskAllElementAttributes:m,maskAttributeFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:N,onSerialize:_,onIframeLoad:C,iframeLoadTimeout:M,onStylesheetLoad:A,stylesheetLoadTimeout:x,keepIframeSrcFn:T,depth:E,maxDepth:L});n&&A(t,n,e)}},H=x,fe.has(U=t)||pe(U)||me(U,q,()=>Boolean(pe(U)),[H])),W}function _e(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 Ce=class t{constructor(...t){gt(this,"parentElement",null),gt(this,"parentNode",null),gt(this,"ownerDocument",void 0),gt(this,"firstChild",null),gt(this,"lastChild",null),gt(this,"previousSibling",null),gt(this,"nextSibling",null),gt(this,"ELEMENT_NODE",1),gt(this,"TEXT_NODE",3),gt(this,"nodeType",void 0),gt(this,"nodeName",void 0),gt(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Me(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Ie(n,t,e,i)}function Ie(t,e,n,i){Re(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Re(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Ae(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var xe="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.",Te={map:{},getId(){return console.warn(xe),-1},getNode(){return console.warn(xe),null},removeNodeFromMap(){console.warn(xe)},has(){return console.warn(xe),!1},reset(){console.warn(xe)}};function Oe(t,e,n={}){let i=null,r=0;return function(...s){const o=Date.now();r||!1!==n.leading||(r=o);const a=e-(o-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=o,t.apply(l,s)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,s)},a))}}function Ee(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),s=r?t[r]:void 0;"function"==typeof s&&(e=s)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}function Fe(t,e,n,i,r=window){const s=r.Object.getOwnPropertyDescriptor(t,e),o=()=>Fe(t,e,s||{},!0);if(i)return r.Object.defineProperty(t,e,n),o;const a=Ee(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),o}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Te=new Proxy(Te,{get(t,e,n){return"map"===e&&console.warn(xe),Reflect.get(t,e,n)}}));var Le=Date.now;function $e(t){var e,n,i,r;const 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=I.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(n=s.body)||void 0===n?void 0:n.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=I.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollTop)||0}}function De(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ne(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Pe(t){return t?t.nodeType===t.ELEMENT_NODE?t:I.parentElement(t):null}function je(t,e,n,i){if(!t)return!1;const r=Pe(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(ce(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function We(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),je(t,i||e,n,!0))return!0;const r="getRootNode"in t?I.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?I.host(r):null}return!1}function Be(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function ze(t,e){if(bt(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=I.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ze(i,e))}function Ue(t){return Boolean(t.changedTouches)}function qe(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function He(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ge(t){return!!t&&(t instanceof Ce&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(I.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Le=()=>(new Date).getTime());var Ve=class{constructor(){gt(this,"id",1),gt(this,"styleIDMap",new WeakMap),gt(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ze(t){var e;let n=null;return"getRootNode"in t&&(null===(e=I.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&I.host(I.getRootNode(t))&&(n=I.host(I.getRootNode(t))),n}function Je(t){const e=t.ownerDocument;if(!e)return!1;if(I.contains(e,t))return!0;const n=I.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Ze(n);)n=e;return n}(t);return I.contains(e,n)}(t)}var Qe,Xe=new WeakMap,Ke=(t,e)=>`${t}@${e}`,Ye=class{constructor(){gt(this,"frozen",!1),gt(this,"locked",!1),gt(this,"takePendingRecords",void 0),gt(this,"texts",new Map),gt(this,"attributes",new Map),gt(this,"generatedAttributes",new WeakMap),gt(this,"selectedAttributeChanges",new Set),gt(this,"removes",[]),gt(this,"mapRemoves",new Set),gt(this,"movedMap",{}),gt(this,"addedSet",new Set),gt(this,"movedSet",new Set),gt(this,"droppedSet",new Set),gt(this,"removesSubTreeCache",new Set),gt(this,"mutationCb",void 0),gt(this,"blockClass",void 0),gt(this,"blockSelector",void 0),gt(this,"maskTextClass",void 0),gt(this,"maskTextSelector",void 0),gt(this,"inlineStylesheet",void 0),gt(this,"maskInputOptions",void 0),gt(this,"maskTextFn",void 0),gt(this,"maskInputFn",void 0),gt(this,"selectMaskingFn",void 0),gt(this,"maskAllElementAttributes",void 0),gt(this,"maskAttributeFn",void 0),gt(this,"keepIframeSrcFn",void 0),gt(this,"recordCanvas",void 0),gt(this,"canvasMaskingConfigured",void 0),gt(this,"inlineImages",void 0),gt(this,"slimDOMOptions",void 0),gt(this,"dataURLOptions",void 0),gt(this,"doc",void 0),gt(this,"mirror",void 0),gt(this,"iframeManager",void 0),gt(this,"stylesheetManager",void 0),gt(this,"shadowDomManager",void 0),gt(this,"canvasManager",void 0),gt(this,"processedNodeManager",void 0),gt(this,"unattachedDoc",void 0),gt(this,"canvasManagerReleased",!1),gt(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),gt(this,"emit",()=>{if(this.frozen||this.locked)return;const t=U(),e=V();try{this.processBufferedMutations()}finally{n=U()-t,i=e,J>0||Z(n,null!=i?i:q)||n>rt.slowestBatchMs&&(rt.slowestBatchMs=n)}var n,i}),gt(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=this.selectMaskingFn?{input:new WeakMap,content:new WeakMap,owner:new WeakMap}:void 0,r=t=>{let e=t,n=-2;for(;-2===n;)e=e&&I.nextSibling(e),n=e&&this.mirror.getId(e);return n};let s;const o=i=>{var o;const a=I.parentNode(i);if(!a||!Je(i)||"TEXTAREA"===a.tagName)return!0;if(this.isBlockedAtEmission(a,n))return!0;if(this.selectMaskingFn&&Vt(i,this.maskInputOptions,this.selectMaskingFn,n))return!0;const l=bt(a)?this.mirror.getId(Ze(i)):this.mirror.getId(a),u=r(i);if(-1===l||-1===u)return!1;null!==(o=s)&&void 0!==o||(s=this.buildSerializationOptions());const c=Se(i,s,n);return c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)en(this.removesSubTreeCache,t)&&!this.movedSet.has(I.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=nn(this.droppedSet,t),n=en(this.removesSubTreeCache,t),i=this.movedSet.has(t)||nn(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const a=new Set;let l=null;const u=this.addedSet.values();let c=u.next();for(;this.addedSet.size;){let t=null;if(null!==l)for(t=I.previousSibling(l);t&&-2===this.mirror.getId(t);)t=I.previousSibling(t);if(t&&this.addedSet.has(t))l=t;else{for(this.addedSet.has(c.value)||(c=u.next()),l=c.value;;){const t=I.parentNode(l),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host(t):t;if(!e||!this.addedSet.has(e))break;l=e}const t=I.parentNode(l);if(t&&this.addedSet.has(I.lastChild(t)))l=I.lastChild(t);else if(t)for(;;){let t=I.nextSibling(l);for(;t&&-2===this.mirror.getId(t);)t=I.nextSibling(t);if(!t||!this.addedSet.has(t))break;l=t}}this.addedSet.delete(l);const e=I.parentNode(l),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host(e):e;n&&a.has(n)?a.add(l):o(l)||a.add(l)}a.size>0&&console.warn(`[rrweb] dropped ${a.size} node(s) with unresolved parent at emit`);const h={texts:Array.from(this.texts,([t,e])=>({node:t,value:e})).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const e=t.node,n=I.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:Array.from(this.attributes.values()).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=Dt({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}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},d=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of h.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===Lt(n.nodeName)&&le(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&d.push(n)}this.texts.clear(),this.attributes.clear(),this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={};const f=this.selectedAttributeChanges;this.selectedAttributeChanges=new Set,(h.texts.length||h.attributes.length||h.removes.length||h.adds.length)&&this.mutationCb(h);for(const t of f){var v;null===(v=Xe.get(t.ownerDocument))||void 0===v||v.forEach(e=>e(t))}for(const t of d)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:Se(t,i(i({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}),gt(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),gt(this,"genTextAreaValueMutation",t=>{let e=this.attributes.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t,e));const n=Array.from(I.childNodes(t),t=>I.textContent(t)||"").join("");e.attributes.value=Ft({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pt(t),value:n,maskInputFn:this.maskInputFn})}),gt(this,"processMutation",t=>{if(!Be(t.target,this.mirror,this.slimDOMOptions)){if(this.selectMaskingFn){var e;const n=null===(e=Pe(t.target))||void 0===e?void 0:e.closest("select");n&&this.selectedAttributeChanges.add(n)}switch(t.type){case"characterData":{const e=I.textContent(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.set(t.target,he(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Pe(t.target)):e.replace(/[\S]/g,"*"):e);break}case"attributes":{var n;const e=t.target,r=!this.selectMaskingFn||"http://www.w3.org/1999/xhtml"!==e.namespaceURI||"select"!==e.localName&&"option"!==e.localName?Lt(e.tagName):e.localName,s=t.attributeName,o=null!==(n=t.attributeNamespace)&&void 0!==n?n:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(e,s,o),l=o?e.getAttributeNS(o,s):t.target.getAttribute(s);if("option"===r&&"selected"===a&&(this.selectMaskingFn||this.maskInputOptions.select)){let n=I.parentElement(e);if("OPTGROUP"===(null==n?void 0:n.tagName)&&(n=I.parentElement(n)),this.selectMaskingFn||!this.maskInputFn||"SELECT"!==(null==n?void 0:n.tagName)||!n.multiple)return void(l!==t.oldValue&&"SELECT"===(null==n?void 0:n.tagName)&&this.selectedAttributeChanges.add(n))}if("value"===a){const t=e,n=Pt(t);l=Ft({element:t,maskInputOptions:Gt(t,this.maskInputOptions,this.selectMaskingFn),tagName:this.selectMaskingFn&&"select"===r?"select":e.tagName,type:n,value:l,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributes.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&e.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!ae(r,a)){var i;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t.target,u));const n=oe(this.doc,r,Lt(a),l,e,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=n,null===(i=this.generatedAttributes.get(t.target))||void 0===i||i.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span"),i=e.style;t.oldValue&&(n.style.cssText=t.oldValue);for(const t of Array.from(i)){const e=i.getPropertyValue(t),r=i.getPropertyPriority(t);e!==n.style.getPropertyValue(t)||r!==n.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?e:[e,r]:u._unchangedStyles[t]=[e,r]}for(const t of Array.from(n.style))""===i.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";let n=this.generatedAttributes.get(t.target);n||(n=new Set,this.generatedAttributes.set(t.target,n)),n.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{Je(t)||this.shadowDomManager.removeShadowRootsIn(t)}),je(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=bt(t.target)?this.mirror.getId(I.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||Be(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(tn(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||ze(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ke(n,i)]?tn(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!bt(t.target)||!wt(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),I.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}}),gt(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(Be(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ke(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!je(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=I.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(Ge(t)){const e=I.childNodes(I.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","selectMaskingFn","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()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){this.selectedAttributeChanges.clear();for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t,e){return We(t,this.blockClass,this.blockSelector)||!!this.selectMaskingFn&&!!t&&Vt(t,this.maskInputOptions,this.selectMaskingFn,e)}recordReinsertion(t){var e;const n=I.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,selectMaskingFn:this.selectMaskingFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{qe(t,this.mirror)&&this.iframeManager.addIframe(t),He(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ge(t)&&!je(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(I.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,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function tn(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=I.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function en(t,e,n){return 0!==t.size&&function(t,e){const n=I.parentNode(e);return!!n&&t.has(n)}(t,e)}function nn(t,e){if(0===t.size)return!1;let n=I.parentNode(e);for(;n;){if(t.has(n))return!0;n=I.parentNode(n)}return!1}function rn(t){Qe=t}function sn(){Qe=void 0}var on=(t,e="rrweb")=>Qe?(...n)=>{try{return t(...n)}catch(t){if(Qe&&!0===Qe(t,e))return;throw t}}:t,an=[];function ln(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function un(t,e){const n=new Ye;let i;n.init(t);try{i=new(C())(on(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),an.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function cn({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){const o=new Map,a=s=>{const a=ln(s);if(!a||je(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=$e(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const h=`${u},${c}`;o.get(l)!==h&&(o.set(l,h),t({id:l,x:u,y:c}))},l=on(a),u=new WeakMap,c=[Me("scroll",on(t=>{const e=t.target;if(!e)return;let n=u.get(e);n||(n=Oe(l,s.scroll||100),u.set(e,n)),n(t)}),e)];return"onscrollend"in e&&c.push(Me("scrollend",on(a),e)),()=>c.forEach(t=>t())}function hn(t,e){for(let n=an.length-1;n>=0;n--){const i=an[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),an.splice(n,1))}}var dn=["INPUT","TEXTAREA","SELECT"],fn=new WeakMap,vn=new WeakMap;function pn(t){return function t(e,n){if(Sn("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Sn("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Sn("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Sn("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function mn(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}var gn=Symbol.for("rrweb.adoptedStyleSheets.rejected"),yn=new WeakMap;function bn({mirror:t,stylesheetManager:e},n){var i,r;let s=null;s=t.getId("#document"===n.nodeName?n:I.host(n));const o="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets"),l=null!=a?a:(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(o.prototype,"adoptedStyleSheets"):void 0;if(null===s||-1===s||!o||!1===(null==a?void 0:a.configurable)||!(null==l?void 0:l.get)||!(null==l?void 0:l.set))return()=>{};const u={stylesheetManager:e,previousDescriptor:a,get:void 0},c={configurable:!0,enumerable:l.enumerable,get(){var t;return null===(t=l.get)||void 0===t?void 0:t.call(this)},set(t){let e;try{var n;e=null===(n=l.set)||void 0===n?void 0:n.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return gn;throw t}if(e===gn)return e;if(u.stylesheetManager&&null!==s&&-1!==s)try{u.stylesheetManager.adoptStyleSheets(t,s)}catch(t){}return e}};try{Object.defineProperty(n,"adoptedStyleSheets",c)}catch(t){return()=>{}}return u.get=c.get,yn.set(c.set,u),on(()=>{u.stylesheetManager=void 0;const t=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets");if(!(null==t?void 0:t.configurable)||t.get!==c.get||t.set!==c.set)return;let e=a;for(;null==e?void 0:e.set;){const t=yn.get(e.set);if(!t||t.stylesheetManager||t.get!==e.get)break;e=t.previousDescriptor}e?Object.defineProperty(n,"adoptedStyleSheets",e):delete n.adoptedStyleSheets})}var wn=new Set;function kn(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let r,s;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),s(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),o(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),h(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),d(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],a=on(()=>{try{if(s)try{s.destroy(),s.reset()}finally{const t=an.indexOf(s);-1!==t&&an.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect()}finally{Ae(o)}}),h=(t,e)=>{const n=on(()=>{try{return e()}catch(e){throw wn.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&h("mutation",()=>{const e=un(t,t.doc);r=e.observer,s=e.buffer}),h("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,s="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const u=Oe(on(e=>{const n=Date.now()-o;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],o=null}),s),c=on(Oe(on(t=>{const e=ln(t),{clientX:n,clientY:r}=Ue(t)?t.changedTouches[0]:t;o||(o=Le()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Le()-o}),u("drag"===t.type?l.Drag:"touchmove"===t.type?l.TouchMove:l.MouseMove)}),r,{trailing:!1})),h=[Me("mousemove",c,n),Me("touchmove",c,n),Me("drag",c,n)];return on(()=>{h.forEach(t=>t())})}(t)),h("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[];let h=null;return Object.keys(u).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t]).forEach(o=>{let a=Lt(o);const d=(e=>o=>{const a=ln(o);if(je(a,r,s,!0))return;let l=null,d=e;if("pointerType"in o){switch(o.pointerType){case"mouse":l=c.Mouse;break;case"touch":l=c.Touch;break;case"pen":l=c.Pen}l===c.Touch&&(u[e]===u.MouseDown?d="TouchStart":u[e]===u.MouseUp&&(d="TouchEnd"))}else Ue(o)&&(l=c.Touch);null!==l?(h=l,(d.startsWith("Touch")&&l===c.Touch||d.startsWith("Mouse")&&l===c.Mouse)&&(l=null)):u[e]===u.Click&&(l=h,h=null);const f=Ue(o)?o.changedTouches[0]:o;if(!f)return;const v=n.getId(a),{clientX:p,clientY:m}=f;on(t)(i({type:u[d],id:v,x:p,y:m},null!==l&&{pointerType:l}))})(o);if(window.PointerEvent)switch(u[o]){case u.MouseDown:case u.MouseUp:a=a.replace("mouse","pointer");break;case u.TouchStart:case u.TouchEnd:return}l.push(Me(a,d,e))}),on(()=>{l.forEach(t=>t())})}(t)),h("scroll",()=>cn(t)),h("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Me("resize",on(Oe(on(()=>{const e=De(),r=Ne();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),h("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:u,selectMaskingFn:c,sampling:h,userTriggeredOnInput:d}){let v=!0;const p=new Map;let m=!1;function g(t){return"SELECT"===t.tagName||!!c&&"select"===t.localName&&"http://www.w3.org/1999/xhtml"===t.namespaceURI}function y(t){const n=e.defaultView;if(t&&n&&!(t instanceof n.HTMLElement))return null;if(c&&"option"===(null==t?void 0:t.localName)&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){let e=I.parentElement(t);for(;e&&("select"!==e.localName||"http://www.w3.org/1999/xhtml"!==e.namespaceURI);)e=I.parentElement(e);return e}return t&&"OPTION"===t.tagName&&(t=I.parentElement(t))&&"OPTGROUP"===t.tagName&&(t=I.parentElement(t)),t}function b(t){k(y(ln(t)),t.isTrusted)}function w(t){return Array.from(t.selectedOptions).filter(t=>!je(t,r,s,!0))}function k(t,h,p=!1,m=!1){var y;const b=t&&(g(t)?"SELECT":t.tagName);var k;if(c&&"SELECT"===b&&((null===(k=an[0])||void 0===k?void 0:k.isFrozen())&&an.forEach(t=>t.unfreeze()),!v))return;if(!t||!b||0>dn.indexOf(b)||je(t,r,s,!0))return;if(t.classList.contains(o)||a&&t.matches(a))return;const _=Pt(t)||"",M=Gt(t,l,c);if(c&&(!v||je(t,r,s,!0)))return;const I=M[b.toLowerCase()]||M[_];let R="SELECT"===b?w(t):void 0;if(R&&(0>=n.getId(t)||R.some(t=>0>=n.getId(t)))){var A;if(null===(A=an[0])||void 0===A?void 0:A.isFrozen()){if(an.forEach(t=>t.unfreeze()),!v)return;R=w(t)}if(!p)return void S(t,h,m);if(0>=n.getId(t)||!I&&R.some(t=>0>=n.getId(t)))return}let x,T=R?(null===(y=R[0])||void 0===y?void 0:y.value)||"":t.value,O=!1;"radio"===_||"checkbox"===_?O=t.checked:I?T=Ft({element:t,maskInputOptions:M,tagName:b,type:_,value:T,maskInputFn:u}):R&&(x=R.map(t=>n.getId(t)));const E={text:T,isChecked:O};x&&(E.selectedOptionIds=x),c&&R&&function(t,e,n){if("SELECT"!==t.nodeName)return;const r=e.getMeta(t),s=!!n||null;(null==r?void 0:r.type)!==f.Element||!0!==r.attributes.rr_maskedSelect&&null!==r.attributes.rr_maskedSelect||r.attributes.rr_maskedSelect===s||e.add(t,i(i({},r),{},{attributes:i(i({},r.attributes),{},{rr_maskedSelect:s})}))}(t,n,!!I),d&&(E.userTriggered=h),C(t,E,m);const F=t.name;"radio"===_&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(e=>{if(e!==t){const t=e.value;C(e,d?{text:t,isChecked:!O,userTriggered:!1}:{text:t,isChecked:!O})}})}function S(t,e,n=!1){var i;const r=p.get(t);p.set(t,{userTriggered:e||(null==r?void 0:r.userTriggered)||!1,fromMutation:n&&(null===(i=null==r?void 0:r.fromMutation)||void 0===i||i)}),m||(m=!0,A(_))}function _(){m=!1;const t=Array.from(p);p.clear(),Ae(t.map(([t,{userTriggered:e,fromMutation:n}])=>()=>{v&&on(k)(t,e,!0,n)}))}function C(e,r,s=!1){var o,a,l;const u=g(e)?vn:fn,c=u.get(e);if(!c||c.text!==r.text||c.isChecked!==r.isChecked||(null===(o=c.selectedOptionIds)||void 0===o?void 0:o.length)!==(null===(a=r.selectedOptionIds)||void 0===a?void 0:a.length)||(null===(l=r.selectedOptionIds)||void 0===l?void 0:l.some((t,e)=>{var n;return t!==(null===(n=c.selectedOptionIds)||void 0===n?void 0:n[e])}))){u.set(e,r);const o=n.getId(e);on(t)(i(i({},r),{},{id:o}),s)}}const M=("last"===h.input?["change"]:["input","change"]).map(t=>Me(t,on(b),e)),R=e.defaultView;if(!R)return()=>{M.forEach(t=>t())};const A=Ee(R),x=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value");return x&&x.set&&M.push(...[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]].map(t=>Fe(t[0],t[1],{set(){if(!v)return;const t=on(y)(this);t&&(g(t)?S(t,!1):on(k)(t,!1))}},!1,R))),M.unshift(function(t,e){const n=Xe.get(t)||new Set;return Xe.set(t,n),n.add(e),()=>{n.delete(e),n.size||Xe.get(t)!==n||Xe.delete(t)}}(e,on(t=>{n.getId(t)>0&&Je(t)&&!We(t,r,s)&&k(t,!1,!1,!!c)}))),on(()=>{Ae([_]),v=!1,p.clear(),Ae(M)})}(t)),h("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:s}){const o=on(s=>Oe(on(r=>{const o=ln(r);if(!o||je(o,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=o;t({type:s,id:i.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),r.media||500)),a=[Me("play",o(d.Play),s),Me("pause",o(d.Pause),s),Me("seeked",o(d.Seeked),s),Me("volumechange",o(d.VolumeChange),s),Me("ratechange",o(d.RateChange),s)];return on(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},s=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),s(t)):r(n)},queuePendingMutation(o,a,l){if(!i)return()=>{};let u=e.get(o);u||(u=[],e.set(o,u));const c={emit:a,ready:!1};u.push(c);let h,d=!1,f=!1;const v=()=>{d||f||(d=!0,void 0!==h&&n.delete(h),c.ready=!0,c.emit=void 0,s(o))};try{h=t.setTimeout(v,5e3),d||f?t.clearTimeout(h):n.add(h)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==h&&(t.clearTimeout(h),n.delete(h)),d?e&&r(l):(c.ready=!0,e||(c.emit=void 0),s(o)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),h("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);N(s.cssRules[l],a),n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const o=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);try{const i=null==l?void 0:l.then;if(s.ownerNode||!l||"function"!=typeof i)return l;const o=n.onCssomSheetMutation(s),{id:u,styleId:c}=mn(s,e,n.styleMirror),h=u&&-1!==u||c&&-1!==c?r.queuePendingMutation(s,()=>t({id:u,styleId:c,replace:a}),()=>{const e=Ct(s);null!==e&&t({id:u,styleId:c,replace:e})}):void 0;try{i.call(l,()=>{n.isCurrentCssomMutation(s,o)&&P(s,a),null==h||h(!0)},()=>null==h?void 0:h(!1))}catch(t){null==h||h(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);P(s,a),n.onCssomSheetMutation(s);const{id:u,styleId:c}=mn(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};_n("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(_n("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),_n("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),_n("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,s])=>{c[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[i].insertRule,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);N(s.cssRules[l],a),n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=mn(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...pn(s),l];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:on((i,s,o)=>{const[a]=o,l=i.apply(s,o);D(s),n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=mn(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...pn(s),a];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),on(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),h("adoptedStyleSheet",()=>bn(t,t.doc)),h("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:s}){const o=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:on((r,o,a)=>{var l;const[u,c,h]=a,d=r.apply(o,a);if(D(o.parentRule),n.has(u))return d;const f=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=mn(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=pn(o.parentRule);s.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:h},index:e}))}return d},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:on((r,o,a)=>{var l;const[u]=a,c=r.apply(o,a);if(D(o.parentRule),n.has(u))return c;const h=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(h);const{id:d,styleId:f}=mn(h,e,i.styleMirror);if(d&&-1!==d||f&&-1!==f){const e=pn(o.parentRule);s.queueMutation(h,()=>t({id:d,styleId:f,remove:{property:u},index:e}))}return c},"host")}),on(()=>{r.CSSStyleDeclaration.prototype.setProperty=o,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&h("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,n){const i=new s(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const o=M(e.fonts,"add",function(e){return function(n){return setTimeout(on(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=s}),i.push(o),on(()=>{i.forEach(t=>t())})}(t))}h("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=t;let o=!0;const a=on(()=>{const t=e.getSelection();if(!t||o&&(null==t?void 0:t.isCollapsed))return;o=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:s,startOffset:o,endContainer:l,endOffset:u}=t.getRangeAt(e);je(s,i,r,!0)||je(l,i,r,!0)||a.push({start:n.getId(s),startOffset:o,end:n.getId(l),endOffset:u})}s({ranges:a})});return a(),Me("selectionchange",a)}(t)),h("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?M(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)h(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{a()}catch(t){}throw t}return a}function Sn(t){return void 0!==window[t]}function _n(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function Cn(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var Mn,In,Rn=class{constructor(t){gt(this,"generateIdFn",void 0),gt(this,"iframeRemoteIdToLocalIdMap",new WeakMap),gt(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t);let o=r.get(e);return void 0===o&&(o=this.generateIdFn(),r.set(e,o),s.set(o,e)),o}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},An=class{constructor(t){gt(this,"iframes",new WeakMap),gt(this,"crossOriginIframeMap",new WeakMap),gt(this,"crossOriginIframeMirror",new Rn(Kt)),gt(this,"crossOriginIframeStyleMirror",void 0),gt(this,"crossOriginIframeRootIdMap",new WeakMap),gt(this,"mirror",void 0),gt(this,"mutationCb",void 0),gt(this,"wrappedEmit",void 0),gt(this,"loadListener",void 0),gt(this,"pageHideListener",void 0),gt(this,"stylesheetManager",void 0),gt(this,"recordCrossOriginIframes",void 0),gt(this,"messageHandler",void 0),gt(this,"nestedIframeListeners",new Map),gt(this,"attachedWindows",new WeakMap),gt(this,"attachedDocuments",new WeakMap),gt(this,"attachedIframes",new Map),gt(this,"loadListenerDisposers",new WeakMap),gt(this,"iframeElementsById",new Map),gt(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Re(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Ie(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Re(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Re(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout,!0===e.data.nonInteractive)}transformCrossOriginEvent(t,e){switch(e.type){case a.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:a.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case a.Meta:case a.Load:case a.DomContentLoaded:return!1;case a.Plugin:return e;case a.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case a.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:return this.replaceIds(e.data,t,["id"]),e;case l.Input:return this.replaceIds(e.data,t,["id","selectedOptionIds"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case l.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Ie(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Ie(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Re(()=>this.mirror.removeNodeFromMap(t))}),Re(()=>hn(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Ie(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Ie(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},xn=new Map,Tn=new WeakMap;function On(t){t.dispose(),xn.get(t.win)===t&&xn.delete(t.win)}function En(){(null==In?void 0:In.valid)&&(In.valid=!1,(null==Mn?void 0:Mn.stopped)?z():B())}var Fn=class{constructor(t,e){gt(this,"win",void 0),gt(this,"owned",new Map),gt(this,"pending",new Set),gt(this,"stopped",!1),gt(this,"ready",!1),this.win=t;try{const i=In;if(e&&(null==i?void 0:i.valid)&&i.stopCompleted&&!i.next&&["interactive","complete"].includes(t.document.readyState)){i.next=this;for(const e of i.retained)try{var n;e.win.CSSRule.prototype!==e.prototype||e.win!==t&&!(null===(n=e.win.frameElement)||void 0===n?void 0:n.isConnected)||(this.acquire(e.win),e.win!==t&&this.pending.add(e.win))}catch(t){}}else{if(En(),i){for(const t of i.retained)0===t.owners&&On(t);i.retained.clear()}B(),O=new WeakSet,E=!1}Mn=this,e&&this.acquire(t)}catch(t){throw this.stop(),t}}acquire(t){if(!t.CSSRule)return z(),()=>{};const e=this.owned.get(t);if(e)return e;let n=xn.get(t);if(!n){const e=function(t){const e={active:!0};return R.set(t,e),()=>{e.active=!1,R.get(t)===e&&R.delete(t)}}(t.CSSRule.prototype);let r;try{r=function(t){const e=[],n=(t,n)=>{const r="appendRule"===n||"deleteRule"===n||"insertRule"===n,s=Object.getOwnPropertyDescriptor(t,n);if(!s)return void(("style"===n||r)&&z());const o="style"===n||"styleMap"===n||"media"===n;if(!s.configurable||o&&!s.get||r&&"function"!=typeof s.value)return void z();const a=i({},s);if(r&&(a.value=new Proxy(s.value,{apply(t,e,n){const i=t.apply(e,n);return W(e),i}})),s.get&&o){const t=s.get;a.get=function(){const e=t.call(this);return W(this),e}}if(s.set){const t=s.set;a.set=function(e){const n=t.call(this,e);return W(this),n}}try{Object.defineProperty(t,n,a),e.push(()=>{const e=Object.getOwnPropertyDescriptor(t,n);(null==e?void 0:e.get)===a.get&&(null==e?void 0:e.set)===a.set&&(null==e?void 0:e.value)===a.value&&Object.defineProperty(t,n,s)})}catch(t){z()}};try{var r,s,o;const i=t;for(const e of[t.CSSStyleRule,t.CSSKeyframeRule,t.CSSPageRule,t.CSSFontFaceRule,i.CSSNestedDeclarations,i.CSSMarginRule,i.CSSPositionTryRule])e&&(n(e.prototype,"style"),n(e.prototype,"styleMap"));for(const e of[t.CSSMediaRule,t.CSSImportRule])e&&n(e.prototype,"media");t.CSSStyleRule&&n(t.CSSStyleRule.prototype,"selectorText"),t.CSSKeyframeRule&&n(t.CSSKeyframeRule.prototype,"keyText"),t.CSSKeyframesRule&&(n(t.CSSKeyframesRule.prototype,"name"),n(t.CSSKeyframesRule.prototype,"appendRule"),n(t.CSSKeyframesRule.prototype,"deleteRule"));const a=t.CSSGroupingRule?[t.CSSGroupingRule]:[t.CSSMediaRule,t.CSSConditionRule,t.CSSSupportsRule];for(const t of a)t&&(n(t.prototype,"insertRule"),n(t.prototype,"deleteRule"));const l=null===(r=t.CSSStyleRule)||void 0===r?void 0:r.prototype;for(const t of["insertRule","deleteRule"])l&&{}.hasOwnProperty.call(l,t)&&n(l,t);const u=null===(s=t.CSSRule)||void 0===s?void 0:s.prototype;return u&&(null===(o=Object.getOwnPropertyDescriptor(u,"cssText"))||void 0===o?void 0:o.set)&&n(u,"cssText"),()=>Ae(e)}catch(t){throw Ae(e),z(),t}}(t)}catch(t){throw e(),t}n={win:t,prototype:t.CSSRule.prototype,owners:0,dispose:()=>Ae([e,r])},xn.set(t,n)}const r=n;r.owners++;const s=()=>{this.owned.get(t)===s&&(this.owned.delete(t),this.pending.delete(t),r.owners--,0===r.owners&&((null==In?void 0:In.valid)&&In.previous===this&&In.stopStarted?In.retained.add(r):On(r)))};return this.owned.set(t,s),s}observe(t){return this.prune(),this.pending.delete(t),t===this.win?()=>{}:this.acquire(t)}prune(){for(const n of this.pending){var t;try{var e;const t=xn.get(n);if((null===(e=n.frameElement)||void 0===e?void 0:e.isConnected)&&n.CSSRule.prototype===(null==t?void 0:t.prototype))continue}catch(t){}null===(t=this.owned.get(n))||void 0===t||t()}}beforeStop(){(null==In?void 0:In.previous)===this&&In.valid&&!In.stopStarted?In.stopStarted=!0:En()}stop(){if(!this.stopped){for(const t of[...this.owned.values()])t();this.stopped=!0,(null==In?void 0:In.valid)&&In.previous===this?In.stopCompleted=!0:Mn===this&&(z(),Mn=void 0)}}},Ln=class{constructor(t){gt(this,"shadowDoms",new Map),gt(this,"mutationCb",void 0),gt(this,"scrollCb",void 0),gt(this,"bypassOptions",void 0),gt(this,"mirror",void 0),gt(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,r;if(!wt(t))return;if(this.shadowDoms.has(t))return;const s=null!==(n=null===(r=I.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==n?n:e,o={doc:s,handlers:[]};this.shadowDoms.set(t,o);const{observer:a,buffer:l}=un(i(i({},this.bypassOptions),{},{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{a.disconnect(),l.destroy(),l.releaseCanvasManager();const t=an.indexOf(l);-1!==t&&an.splice(t,1)}),o.handlers.push(cn(i(i({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(I.host(t))),o.handlers.push(bn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=I.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),I.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach($n)}observeAttachShadow(t){Re(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:M(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),s=I.shadowRoot(this);return s&&Je(this)&&n.addShadowRoot(s,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>$n(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach($n))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?$n(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function $n(t){try{t()}catch(t){}}var Dn="skip-frame";function Nn(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Pn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wn=0;64>Wn;Wn++)jn[Pn.charCodeAt(Wn)]=Wn;var Bn=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Pn[n[e]>>2],r+=Pn[(3&n[e])<<4|n[e+1]>>4],r+=Pn[(15&n[e+1])<<2|n[e+2]>>6],r+=Pn[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},zn=!1,Un=new Map,qn=(t,e,n)=>{if(!t||!Vn(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Un.get(t);return n||(n=new Map,Un.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Hn(t,e,n,i){if(t instanceof Array)return t.map(t=>Hn(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Bn(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Hn(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?zn||(zn=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Hn(t.data,e,n,i),t.width,t.height]}:Vn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:qn(t,e,n)}:t}var Gn=(t,e,n,i)=>t.map(t=>Hn(t,e,n,i)),Vn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Zn=["webgl","webgl2"];function Jn(t){return"nodeType"in t}function Qn(t,e,n,r){const s=[];try{if(r){const r=function(t,e,n){const r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return M(r.prototype,"configure",function(r){return function(s){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||Jn(o)&&je(o,e,n,!0))return r.call(this,s);Jn(o)&&!("__context"in o)&&(o.__context="webgpu");const a=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&s?i(i({},s),{},{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,n);r&&s.push(r)}const o=M(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(i,...s){const o=function(t){return"experimental-webgl"===t?"webgl":t}(i);if(!je(this,e,n,!0)&&("__context"in this||(this.__context=o),r&&Zn.includes(o)))if(s[0]&&"object"==typeof s[0]){const t=s[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[i,...s])}});s.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function Xn(t,e,n,i,r,s,o){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=M(t,u,function(t){return function(...a){const l=t.apply(this,a);if(qn(l,s,this),this.canvas&&"tagName"in this.canvas&&!je(this.canvas,i,r,!0)){let t;try{t=Gn(a,s,this,o)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(s){const o=Fe(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!je(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(o)}return a}var Kn='(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\tlet webpProbeStarted = false;\n\tlet noWebpEncoder = false;\n\tfunction probeWebpEncoder() {\n\t\twebpProbeStarted = true;\n\t\tnew OffscreenCanvas(1, 1).convertToBlob({ type: "image/webp" }).then((blob) => {\n\t\t\tnoWebpEncoder = blob.type !== "image/webp";\n\t\t}).catch(() => void 0);\n\t}\n\tfunction isOpaque(pixels) {\n\t\tfor (let i = 3; i < pixels.length; i += 4) if (pixels[i] !== 255) return false;\n\t\treturn true;\n\t}\n\tfunction encodeOptions(options, pixels) {\n\t\tif (options.type !== "image/webp") return options;\n\t\tif (!webpProbeStarted) probeWebpEncoder();\n\t\treturn noWebpEncoder && isOpaque(pixels) ? {\n\t\t\t...options,\n\t\t\ttype: "image/jpeg"\n\t\t} : options;\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 pixels = ctx.getImageData(0, 0, width, height).data;\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, pixels);\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(encodeOptions(dataURLOptions, pixels));\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Yn="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Kn],{type:"text/javascript;charset=utf-8"});function ti(t){let e;try{if(e=Yn&&(self.URL||self.webkitURL).createObjectURL(Yn),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Kn),{name:null==t?void 0:t.name})}}var ei="A page CSP that omits blob: from worker-src or script-src blocks it";function ni(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var ii=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){gt(this,"pendingCanvasMutations",new Map),gt(this,"rafStamps",{latestId:0,invokeId:null}),gt(this,"mirror",void 0),gt(this,"mutationCb",void 0),gt(this,"resetObservers",void 0),gt(this,"frozen",!1),gt(this,"locked",!1),gt(this,"rafIdTimestamp",null),gt(this,"rafIdFlush",null),gt(this,"refCount",0),gt(this,"torndown",!1),gt(this,"resetFrameDedup",null),gt(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:s,dataURLOptions:o,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(n,i,r,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:o,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void ni("disabled because this browser does not support OffscreenCanvas");const a="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,l=Qn(e,n,i,!0),u=new Map;let c;try{c=new ti}catch(t){return ni(`disabled because the encode worker did not start. ${ei}`,t),void l()}let d=!1;c.onerror=t=>{var e;d=!0,ni(`stopped because the encode worker failed. ${ei}`,t),cancelAnimationFrame(m),null===(e=c.terminate)||void 0===e||e.call(c),this.resetFrameDedup=null},this.resetFrameDedup=()=>{c.postMessage({resetFrameDedup:!0})},c.onmessage=t=>{const{id:e}=t.data;if(u.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:s}=t.data;this.mutationCb({id:e,type:h["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,s]}],displayWidth:r,displayHeight:s})};let f=!1,v=!1;const p=1e3/t;let m,g=0;const y=t=>{var l;d||(g&&p>t-g||(g=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{je(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((l=s(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!u.get(e)&&0!==t.width&&0!==t.height){u.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void u.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=t.clientWidth||t.width,o=t.clientHeight||t.height,l=Math.max(1,Math.round(s*a)),h=Math.max(1,Math.round(o*a)),d=function(t,e,n,i,r,s){if(!t||"function"!=typeof t.regionsFn)return;let o;try{o=t.regionsFn(e)}catch(t){return Dn}if(void 0===o)return;if(!Array.isArray(o)||!o.every(Nn))return Dn;const a=n/r,l=i/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,l,h,s,o);if("skip-frame"===d)return f||(f=!0,ni("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void u.set(e,!1);const v=yield createImageBitmap(t,1>a?{resizeWidth:l,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:l,resizeHeight:h});c.postMessage({id:e,bitmap:v,width:l,height:h,displayWidth:s,displayHeight:o,dataURLOptions:r.dataURLOptions,maskRegions:d},[v])}catch(t){v||(v=!0,ni("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),u.set(e,!1)}}}),function(t){return l.apply(this,arguments)}))),m=requestAnimationFrame(y))};m=requestAnimationFrame(y),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(m),null===(t=c.terminate)||void 0===t||t.call(c),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Qn(t,e,n,!1),s=function(t,e,n,i,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const o=M(e.CanvasRenderingContext2D.prototype,a,function(s){return function(...o){return je(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Gn(o,e,this,r)}catch(t){return}t(this.canvas,{type:h["2D"],property:a,args:n})},0),s.apply(this,o)}});s.push(o)}catch(r){const o=Fe(e.CanvasRenderingContext2D.prototype,a,{set(e){je(this.canvas,n,i,!0)||t(this.canvas,{type:h["2D"],property:a,args:[e],setter:!0})}});s.push(o)}return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),o=function(t,e,n,i,r){const s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Xn(e.WebGLRenderingContext.prototype,h.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&s.push(...Xn(e.WebGL2RenderingContext.prototype,h.WebGL2,t,n,i,e,r)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;s.length>i;i++)e.includes(n=s[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,o)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function ri(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var si,oi,ai,li=class{constructor(t){var e,n,i;gt(this,"trackedLinkElements",new WeakSet),gt(this,"pendingDeferredSheets",new Set),gt(this,"cssomRevisions",new WeakMap),gt(this,"stopped",!1),gt(this,"changedLinkJobs",new Map),gt(this,"linksInlinedSinceSnapshot",new WeakSet),gt(this,"mutationCb",void 0),gt(this,"adoptedStyleSheetCb",void 0),gt(this,"maskAllElementAttributes",void 0),gt(this,"maskAttributeFn",void 0),gt(this,"blockClass",void 0),gt(this,"blockSelector",void 0),gt(this,"styleMirror",new Ve),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return We(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:ri({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let s=null,o=null;try{o=t.sheet,o&&(s=function(t){const e=[];let n=!1,i=null;const r=new Map;function s(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);o(e[e.length-1],r.importRule,t)}function o(t,e,n){try{let r;try{r=n||St(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=Ut(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var n;const i=t.rules[t.index];if("sheet"===t.kind&&Rt(i)){const n=r.get(i);return null===n?(t.parts.push(i.cssText),void(t.index+=1)):n?void e.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(function(t,n){try{if(void 0!==j(t))return!1;const i=Ot(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?Ut(i,r):i,fixColons:"sheet"===n.kind&&At(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t))return;let s=null!==(n=j(i))&&void 0!==n?n:i.cssText;"sheet"===t.kind&&At(i)&&i.selectorText.includes(":")&&(s=It(s)),t.parts.push(t.sheetHref?Ut(s,t.sheetHref):s),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;ut(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const s=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!Rt(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;ut(t);let s=i.href;!s&&i.ownerNode&&(s=i.ownerNode.baseURI);const o=Array.from(t);r.set(e,{sheet:i,rules:o,sheetHref:s}),n.push({sheet:i,rules:o,index:0})}catch(t){}}}(s,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=U();let o=t>0?t:1;try{for(;!n&&o>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?It(n):n}else e=kt(t.parts.join(""))}catch(t){}s(e);continue}o-=1;try{a(t)}catch(t){s(null)}}}catch(t){n=!0,i=null}finally{ht(U()-r)}return n},text(){return n?i:null},remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}(o))}catch(t){}var a;if(!s||!o)return vt(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=s;let u=!1;const c={sheet:o,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let h=!1;return{advance:e=>{if(h)return!0;const i=U(),s=V();let a=!0;try{if(u)return h=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():vt(),!0;if(!l.advance(e))return a=!1,!1;h=!0;const i=l.text();if(!t.isConnected)return!0;let s=null;try{s=t.sheet}catch(t){}return s!==o?(vt(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(vt(),null===(d=n.onUninlinable)||void 0===d||d.call(n),!0);var d}finally{a&&this.pendingDeferredSheets.delete(c),Z(f=U()-i,null!=(v=s)?v:q)||(st.totalMs+=f,f>st.slowestSliceMs&&(st.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){var e;if(!t)return;const n=(null!==(e=this.cssomRevisions.get(t))&&void 0!==e?e:0)+1;this.cssomRevisions.set(t,n);for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate());return n}isCurrentCssomMutation(t,e){return!this.stopped&&this.cssomRevisions.get(t)===e}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=pe(t),i=fe.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},s=()=>{const e=pe(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};s()?e():me(t,e,s,ge,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let s=!1;const o=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,ri(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){s=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!o)return;let a=null;const l=()=>{o.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>o.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!o.advance(200)&&(l(),!s||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):vt(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=Cn(c))};a=Cn(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),pt(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,r={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:i(i({},r),{},{_cssText:Dt({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=U();try{ct(()=>{try{const t=e.rules||e.cssRules;t&&ut(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:Mt(t,e.href),index:n}))})})}finally{ht(U()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),ve()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,ve({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},ui=class{constructor(){gt(this,"nodeMap",new WeakMap),gt(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},ci=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var hi;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(hi=t.contentWindow)||void 0===hi?void 0:hi.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var di=new Et,fi=new Set([l.Mutation,l.MediaInteraction,l.StyleSheetRule,l.CanvasMutation,l.Font,l.Log,l.StyleDeclaration,l.AdoptedStyleSheet]);function vi(t={}){let e,n=!1,r=!1;const{emit:s,checkoutEveryNms:o,checkoutEveryNth:u,blockClass:c="rr-block",blockSelector:h=null,ignoreClass:d="rr-ignore",ignoreSelector:f=null,maskTextClass:v="rr-mask",maskTextSelector:p=null,inlineStylesheet:m=!0,inlineStylesheetBudgetRules:g,maskAllInputs:y,maskInputOptions:b,slimDOMOptions:w,maskInputFn:k,selectMaskingFn:S,maskTextFn:_,maskAllElementAttributes:C=!1,maskAttributeFn:M,hooks:R,packFn:A,sampling:x={},dataURLOptions:T={},canvasResolutionScale:O,canvasMasking:E,mousemoveWait:F,recordDOM:L=!0,recordCanvas:D=!1,recordCrossOriginIframes:N=!1,recordAfter:P=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:j=!1,collectFonts:W=!1,inlineImages:B=!1,plugins:z,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:q=new Set([]),attributeFilter:H,errorHandler:V}=t;rn(V);const Z=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},T),J=!N||window.parent===window;let Q=!1;if(!J)try{window.parent.document&&(Q=!1)}catch(t){Q=!0}if(J&&!s)throw new Error("emit function is required");if(!J&&!Q)return()=>{};void 0!==F&&void 0===x.mousemove&&(x.mousemove=F),di.reset(),ve();const X=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==b?b:{password:!0},K=_e(void 0!==w&&w);let Y;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let tt=0;const et=new Map;let nt,it;const rt=t=>{for(const e of z||[])e.eventProcessor&&(t=e.eventProcessor(t));return A&&!Q&&(t=A(t)),t};si=(t,e,n)=>{var i;const r=t;if(r.timestamp=Le(),!(null===(i=an[0])||void 0===i?void 0:i.isFrozen())||r.type===a.FullSnapshot||r.type===a.IncrementalSnapshot&&fi.has(r.data.source)||an.forEach(t=>t.unfreeze()),J)n?null==s||s(rt(r),e,!0):null==s||s(rt(r),e);else if(Q){const t={type:"rrweb",event:rt(r),origin:window.location.origin,isCheckout:e};n&&(t.nonInteractive=!0),window.parent.postMessage(t,"*")}if(r.type===a.FullSnapshot)Y=r,tt=0;else if(r.type===a.IncrementalSnapshot){if(r.data.source===l.Mutation&&r.data.isAttachIframe)return;tt++,(u&&tt>=u||o&&r.timestamp-Y.timestamp>o)&&oi(!0)}};const st=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=di.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=vt.getIframeElementById(t);i&&n.has(i)?vt.forgetIframeId(t):(null==nt||nt(t),vt.removeIframeById(t))}),null==it||it(),vt.cleanupDetachedIframes()}si({type:a.IncrementalSnapshot,data:i({source:l.Mutation},t)})},lt=t=>si({type:a.IncrementalSnapshot,data:i({source:l.Scroll},t)}),ut=t=>si({type:a.IncrementalSnapshot,data:i({source:l.CanvasMutation},t)}),ct=new li({mutationCb:st,adoptedStyleSheetCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.AdoptedStyleSheet},t)}),maskAllElementAttributes:C,maskAttributeFn:M,blockClass:c,blockSelector:h});let ht=!1;const dt=()=>{if(!ht){ht=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;ct.flushChangedLinkInlining(50-n)}finally{ht=!1}}},vt=new An({mirror:di,mutationCb:st,stylesheetManager:ct,recordCrossOriginIframes:N,wrappedEmit:si});for(const t of z||[])t.getMirror&&t.getMirror({nodeMirror:di,crossOriginIframeMirror:vt.crossOriginIframeMirror,crossOriginIframeStyleMirror:vt.crossOriginIframeStyleMirror});const mt=new ui,gt=null==E?void 0:E.configured;ai=new ii({recordCanvas:D,mutationCb:ut,win:window,blockClass:c,blockSelector:h,mirror:di,sampling:x.canvas,dataURLOptions:Z,resolutionScale:O,canvasMasking:E});const yt=new Ln({mutationCb:st,scrollCb:lt,bypassOptions:{blockClass:c,blockSelector:h,maskTextClass:v,maskTextSelector:p,inlineStylesheet:m,maskInputOptions:X,dataURLOptions:Z,maskTextFn:_,maskInputFn:k,selectMaskingFn:S,maskAllElementAttributes:C,maskAttributeFn:M,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,sampling:x,slimDOMOptions:K,iframeManager:vt,stylesheetManager:ct,canvasManager:ai,keepIframeSrcFn:U,processedNodeManager:mt,attributeFilter:H},mirror:di});oi=(t=!1)=>{if(L){ot(g);try{if(si({type:a.Meta,data:{href:window.location.href,width:Ne(),height:De()}},t),n)return;null==e||e.cancel(),e=void 0,ct.reset(),yt.init(),an.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new Et,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOM:g=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:C,stylesheetLoadTimeout:M,keepIframeSrcFn:I=()=>!1,maxDepth:R,inlineStylesheetBudgetRules:A}=e||{},x=!0===h?{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,hidden:!0}:!1===h?{password:!0}:h,T=_e(g);ot(A);try{return Se(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:d,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:T,dataURLOptions:y,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:C,stylesheetLoadTimeout:M,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:R})}finally{at()}}(document,{mirror:di,blockClass:c,blockSelector:h,maskTextClass:v,maskTextSelector:p,inlineStylesheet:m,maskAllInputs:X,inlineStylesheetBudgetRules:g,maskTextFn:_,maskInputFn:k,selectMaskingFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOM:K,dataURLOptions:Z,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,onSerialize(t){qe(t,di)&&vt.addIframe(t),He(t,di)&&ct.trackLinkElement(t),Ge(t)&&yt.addShadowRoot(I.shadowRoot(t),document)},onIframeLoad(t,e){vt.attachIframe(t,e),yt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){vt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){ct.attachLinkElement(t,e,n)},keepIframeSrcFn:U})}finally{r=ft()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(vn=new WeakMap,si({type:a.FullSnapshot,data:{node:i,initialOffset:$e(window)}},t),n)return;if(an.forEach(t=>t.unlock()),ai.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,s=0,o=null;const a=()=>null!==o||t.length>s,l=()=>{const n=t[s];t[s]=null,s+=1,n&&Re(()=>{o=e.beginDeferredLinkInlining(n,di.getId(n))})},u=()=>{if(!o)return;const t=o;let e=!0;Re(()=>{e=t.advance(200)}),e&&(o=null)},c=()=>{o||l(),u()},h=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==o||o.discard(),o=null,pt(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=Cn(h):n())};return r=Cn(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){o||l();const t=o;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),o=null,c+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==o?1:0);for(let n=s;t.length>n;n++)null!==t[n]&&(e+=1);pt(e),null==o||o.discard(),o=null}return n(),e}}}(r,ct,()=>{e===t&&(e=void 0)});e=t}N&&vt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,di.getId(document))}finally{at()}}};const bt=[];let wt;try{wt=new Fn(window,L),bt.push(Me("pagehide",()=>{try{dt()}catch(t){}e=void 0},window));for(const t of["visibilitychange","freeze","resume"])bt.push(Me(t,G,document));nt=t=>{const e=et.get(t);e&&(e.forEach(t=>{Re(t);const e=bt.indexOf(t);-1!==e&&bt.splice(e,1)}),et.delete(t))},it=()=>{null==wt||wt.prune();for(const[t]of et){const e=di.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==nt||nt(t)}catch(e){null==nt||nt(t)}else null==nt||nt(t)}};const t=t=>{var e;return on(kn)({mutationCb:st,mousemoveCb:(t,e)=>si({type:a.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.MouseInteraction},t)}),scrollCb:lt,viewportResizeCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.ViewportResize},t)}),inputCb:(t,e)=>si({type:a.IncrementalSnapshot,data:i({source:l.Input},t)},void 0,e),mediaInteractionCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.StyleDeclaration},t)}),canvasMutationCb:ut,fontCb:t=>si({type:a.IncrementalSnapshot,data:i({source:l.Font},t)}),selectionCb(t){si({type:a.IncrementalSnapshot,data:i({source:l.Selection},t)})},customElementCb(t){si({type:a.IncrementalSnapshot,data:i({source:l.CustomElement},t)})},blockClass:c,ignoreClass:d,ignoreSelector:f,maskTextClass:v,maskTextSelector:p,maskInputOptions:X,inlineStylesheet:m,sampling:x,recordDOM:L,recordCanvas:D,canvasMaskingConfigured:gt,inlineImages:B,userTriggeredOnInput:j,collectFonts:W,doc:t,maskInputFn:k,selectMaskingFn:S,maskTextFn:_,maskAllElementAttributes:C,maskAttributeFn:M,keepIframeSrcFn:U,blockSelector:h,slimDOMOptions:K,dataURLOptions:Z,mirror:di,iframeManager:vt,stylesheetManager:ct,shadowDomManager:yt,processedNodeManager:mt,canvasManager:ai,ignoreCSSAttributes:q,attributeFilter:H,plugins:(null==z||null===(e=z.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>si({type:a.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)},s=e=>{const n=e.defaultView?null==wt?void 0:wt.observe(e.defaultView):void 0;try{const i=t(e);return()=>Ae([()=>null==i?void 0:i(),()=>null==n?void 0:n()])}catch(t){throw null==n||n(),t}},o=new WeakMap,u=new WeakMap;vt.addLoadListener(t=>{null==wt||wt.prune();try{const e=t.contentDocument,n=di.getId(t);if(!e)return;const i=u.get(t);if(i){u.delete(t),Re(i);const e=bt.indexOf(i);-1!==e&&bt.splice(e,1)}const r=o.get(e);if(-1!==n&&r){if(r())return;null==nt||nt(n)}const a=s(e);if("function"==typeof a){let i=!1;const r=Me("rrweb-check-iframe-observers",()=>{i=!0},e);-1!==n&&o.set(e,()=>{i=!1;const t=e.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),e.dispatchEvent(t),i});const s=()=>{o.delete(e),r(),a()};if(bt.push(s),-1!==n){let t=et.get(n);t||(t=new Set,et.set(n,t)),t.add(s)}else u.set(t,s)}}catch(t){console.warn(t)}}),vt.addPageHideListener(t=>{const e=di.getId(t);null==nt||nt(e),hn(t)});let g=-1;const y=t=>si({type:a.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),b=()=>{var t,e,n,i;const r=document,s=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,o=s?di.getId(s):-1;o!==g&&(-1!==g&&y({id:g,enter:!1}),g=o,-1!==o&&y({id:o,enter:!0}))},w=()=>{if(n||r)return;if(r=!0,oi(),n)return;const t=s(document);n?"function"==typeof t&&Ae([t]):("function"==typeof t&&bt.push(t),bt.push(Me("fullscreenchange",b)),bt.push(Me("webkitfullscreenchange",b)),bt.push(Me("mozfullscreenchange",b)),bt.push(Me("MSFullscreenChange",b)),ci=!0,wt&&(wt.ready=!0))};["interactive","complete"].includes(document.readyState)?w():(bt.push(Me("DOMContentLoaded",()=>{si({type:a.DomContentLoaded,data:{}}),"DOMContentLoaded"===P&&setTimeout(w,0)})),bt.push(Me("load",()=>{si({type:a.Load,data:{}}),"load"===P&&w()},window)));const I=()=>{if(null==wt||wt.beforeStop(),!n){n=!0;try{dt()}catch(t){}e=void 0,ct.stop(),Ae(bt),mt.destroy(),vt.removeLoadListener(),vt.destroy(),et.clear(),yt.reset(),di.reset(),ci=!1,sn(),null==wt||wt.stop()}};return wt&&function(t,e){Tn.set(t,e)}(I,wt),I}catch(t){n=!0,Ae(bt),null==wt||wt.stop(),console.warn(t)}}vi.withStyleRuleSourceHandoff=function(t,e){const n=Tn.get(t);if(!n||n.stopped||Mn!==n||In)return En(),void e(()=>{});const i={previous:n,next:void 0,valid:!0,stopStarted:!1,stopCompleted:!1,retained:new Set};In=i;try{e(()=>{In===i&&En()})}finally{var r;(null===(r=i.next)||void 0===r?void 0:r.ready)||En();for(const t of i.retained)0===t.owners&&On(t);i.retained.clear(),In===i&&(In=void 0)}},vi.addCustomEvent=(t,e)=>{if(!ci)throw new Error("please add custom event after start recording");si({type:a.Custom,data:{tag:t,payload:e}})},vi.freezePage=()=>{an.forEach(t=>t.freeze())},vi.takeFullSnapshot=t=>{if(!ci)throw new Error("please take full snapshot after start recording");oi(t)},vi.isRecording=()=>ci,vi.supportsSelectMasking=!0,vi.mirror=di,Date,Date;var pi=Object.create(null);function mi(t){return mi="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},mi(t)}function gi(t,e,n){return(e=function(t){var e=function(t){if("object"!=mi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}pi.Node=Object.create(null),pi.ShadowRoot=Object.create(null),pi.MutationObserver=Object.create(null),pi.Element=Object.create(null);var yi=class{constructor(t){gi(this,"fileName",void 0),gi(this,"functionName",void 0),gi(this,"lineNumber",void 0),gi(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},bi=/(^|@)\S+:\d+/,wi=/^\s*at .*(\S+:\d+|\(native\))/m,ki=/^(eval@)?(\[native code])?$/,Si={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(wi)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(wi)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new yi({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(ki)},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 yi({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new yi({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new yi({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new yi({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(bi)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new yi({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function _i(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ci(t){return Array.isArray(t)}function Mi(t){return"object"==typeof t&&null!==t&&!Ci(t)}function Ii(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Mi(t[i])&&Ii(t[i],e-1))return!0;return!1}function Ri(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Mi(s=e)&&Object.keys(s).length>n.numOfKeysLimit||"function"==typeof s||Mi(s)&&Ii(s,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var s;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ci(i)?_i(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Ai={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 xi(t,e,n){const i=n?Object.assign({},Ai,n):Ai,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?e[r]:r;let o=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Si.parse(e.error).map(t=>t.toString()),payload:[Ri(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Ri(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Ri("Uncaught (in promise)",i.stringifyOptions),Ri(e.reason,i.stringifyOptions)]),t({level:"error",trace:Si.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(s,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,s){try{if(!(s in r))return()=>{};const u=r[s],c={next:u},h=(r=>(...s)=>{if(r.apply(e,s),l&&!("assert"===n&&s[0]||a)){a=!0;try{const e=Si.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?s.slice(1):s).map(t=>Ri(t,i.stringifyOptions));o++,i.lengthThreshold>o?t({level:n,trace:e,payload:r}):o===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Ri("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...s])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[s]=h,()=>{if(r[s]===h)return void(r[s]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[s],n=t(e);for(;n;){if(n.next===h)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}const Ti="u">typeof window?window:void 0,Oi="u">typeof globalThis?globalThis:Ti,Ei=null==Oi?void 0:Oi.document,Fi=null==Oi?void 0:Oi.location;null!=Oi&&Oi.XMLHttpRequest&&new Oi.XMLHttpRequest;const Li="undefined"!=typeof globalThis?globalThis:Ti;Li&&"undefined"==typeof self&&(Li.self=Li),Li&&"undefined"==typeof File&&(Li.File=function(){});const $i=null!=Ti?Ti:{},Di=Object.prototype,Ni=Di.hasOwnProperty,Pi=Di.toString,ji=Array.isArray||function(t){return"[object Array]"===Pi.call(t)},Wi=t=>"function"==typeof t,Bi=t=>t===Object(t)&&!ji(t),zi=t=>void 0===t,Ui=t=>"[object String]"==Pi.call(t),qi=t=>null===t,Hi=t=>zi(t)||qi(t),Gi=t=>"[object Number]"==Pi.call(t)&&t==t,Vi=t=>"[object Boolean]"===Pi.call(t),Zi=t=>t instanceof FormData;function Ji(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Gi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):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: "+n+", fallback: "+r),Ji(null!=r?r:n,e,n,i))}var Qi=class{constructor(t){this.C={},this.I=t.I,this.A=Ji(t.bucketSize,0,100,t.R),this.O=Ji(t.refillRate,0,this.A,t.R),this.$=Ji(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};function Xi(t){return t?t.split("#")[0]:t}const Ki="NativeGzipValidationError";let Yi;const tr=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Ki,`Native gzip produced invalid output: ${t}`)};let er=0,nr=!1;const ir=(rr=s(function*(t,e){18>t.size&&tr("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&tr("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&tr("invalid-size"),(nr||3>er)&&(r.getUint32(0,!0)!==(t=>{const e=(()=>{if(Yi)return Yi;Yi=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;Yi[t]=e>>>0}return Yi})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&(nr=!0,tr("invalid-crc")),er++)}),function(t,e){return rr.apply(this,arguments)});var rr;function sr(){return sr=s(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=s(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),a=new Response(n.readable).blob(),[l]=yield Promise.all([a,o]);return yield ir(l,e),l}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),sr.apply(this,arguments)}const or="0.12.2",ar={DEBUG:!1,LIB_VERSION:or,LIB_NAME:"browser-common",JS_SDK_VERSION:or},lr=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ar.DEBUG||r.POSTHOG_DEBUG||e)&&!zi(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>lr(`${t} ${e}`,n)};return n},ur=lr("[PostHog.js]"),cr=(t,e)=>ur.createLogger(t,e);function hr(t,e){if(!Hi(t))if(ji(t))t.forEach(e);else if(Zi(t))t.forEach((t,n)=>e(t,n));else for(const n in t)Ni.call(t,n)&&e(t[n],n)}function dr(t,e,n,i){const{capture:r=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:s})}const fr=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return zi(n)?null:(n.href=t,n)},vr=["localhost","127.0.0.1"],pr=()=>{},mr=t=>{var e;if(Wi(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function gr(t,e,n){try{if(!(e in t))return pr;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return Wi(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],s=mr(n);for(;s;){if(s.next===r)return void(s.next=i.next);n=s.next,s=mr(n)}}}catch(t){return pr}}function yr(t,e){var n;const 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),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}function br(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return zi(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!Wi(i))return e;try{const t=i(e);return Ui(t)&&t?t:e}catch(t){return ur.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}const wr="$stored_person_properties",kr=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}))$"),Sr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,_r=[16,15,14,13],Cr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Mr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ir=/[0-9A-Za-z_]/;function Rr(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}const Ar=1e6;function xr(t){var e;return Math.min(Ar,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ar)}const Tr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ar,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Or=["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"],Er=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Fr=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Lr=t=>{Hi(t)||hr(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Or.includes(e)||Fr.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},$r=["/s/","/e/","/i/"];function Dr(t,e,n,i){if(Hi(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ui(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function Nr(t,e){if(Hi(t))return t;let n=t;return function(t,e=!0){if(Hi(t))return!1;if(Ui(t)){if(t=t.trim(),e?kr.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Sr.lastIndex=0;e=Sr.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of _r){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(kr.test(e)&&Rr(e))return!0}}}return!1}(t))return!1;if(e?Cr.test(t):function(t){let e;for(Mr.lastIndex=0;e=Mr.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&Ir.test(t)&&Ir.test(n)))return!0}return!1}(t))return!1}return!0}(n,!1)||(n="[SessionRecording] "+e+" body redacted"),hr(Er,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const Pr=new WeakSet,jr=cr("[Recorder]"),Wr=t=>"navigation"===t.entryType,Br=t=>"resource"===t.entryType,zr=()=>{};function Ur(t,e){var n;return Wr(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function qr(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Ur(t,n)||Br(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Ur(t,e))}(t):[]}function Hr(t,e){return!!e&&(Vi(e)||e[t])}function Gr(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Vr=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Zr({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Gr(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Vr))return!1;if(Vi(e))return!0;if(ji(e))return r(e);const s=e[t];return Vi(s)?s:r(s)}function Jr(t,e,n,i,r){return Qr.apply(this,arguments)}function Qr(){return Qr=s(function*(t,e,n,i,r,s=0){if(s>10)return jr.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const o=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Br(t)&&t.initiatorType===e&&(zi(i)||t.startTime>=i)&&(zi(r)||r>=t.startTime));return o||(yield new Promise(t=>setTimeout(t,50*s)),Jr(t,e,n,i,r,s+1))}),Qr.apply(this,arguments)}function Xr({body:t,options:e,url:n}){if(Hi(t))return null;const{hostname:i,isHostDenied:r}=yr(n,e);if(r)return i+" is in deny list";if(Ui(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(Zi(t))return function(t,e="&"){let n,i;const r=[];return hr(t,function(t,e){zi(t)||zi(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)}(t);if(Bi(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Kr=t=>!qi(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Yr(t,{entry:e,method:n,status:r,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}){a=e?e.startTime:a,l=e?e.responseEnd:l;const h=Math.floor(Date.now()-t.performance.now()),d=Math.floor(h+(a||0)),f=[i(i({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:u}),{},{startTime:zi(a)?void 0:Math.round(a),endTime:zi(l)?void 0:Math.round(l),timeOrigin:h,timestamp:d,method:n,initiatorType:c||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Kr(e))for(const t of e.serverTiming||[])f.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return f}const ts=["video/","audio/"];function es(t){return Bi(t)&&Wi(t.getReader)&&Wi(t.tee)}const ns="[SessionReplay] Timeout while trying to read body",is="[SessionReplay] Failed to read body";function rs(t){return`${is}: ${t}`}function ss(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function os(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(ns),500);try{t.clone().text().then(t=>e(t),t=>e(rs(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(is)}})}(t);const n=xr(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const s=parseInt(r,10);return Number.isFinite(s)&&s>e}catch(t){return!1}}(t,n)?Promise.resolve(ss(n)):function(t,e){return new Promise(n=>{let i,r=!1;function s(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function o(t){r||(r=!0,clearTimeout(a),s(),n(t))}const a=setTimeout(()=>o(ns),500);let l;try{l=t.clone()}catch(t){return void o(is)}const u=l.body;if(!es(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>o(t),t=>o(rs(t)))}catch(t){o(is)}return}try{i=u.getReader()}catch(t){return void o(is)}const c=[];let h=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)s();else if(n)o((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,h)));else{if(i){if(h+i.byteLength>e)return void o(ss(e));h+=i.byteLength,c.push(i)}t()}},t=>o(rs(t)))}()})}(t,n)}function as(t){return ls.apply(this,arguments)}function ls(){return(ls=s(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=yr(n,e);return r?Promise.resolve(i+" is in deny list"):os(t,e)})).apply(this,arguments)}function us(t){return cs.apply(this,arguments)}function cs(){return(cs=s(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),s=ts.some(t=>null==r?void 0:r.startsWith(t));if(r&&s)return`Content-Type ${r} is not supported`;const{hostname:o,isHostDenied:a}=yr(n,e);return a?o+" is in deny list":null}({r:t,options:e,url:n});return qi(i)?os(t,e):Promise.resolve(i)})).apply(this,arguments)}let hs=null;function ds(t,e,n){if(!("performance"in e))return()=>{};if(hs)return jr.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},Tr,n):Tr;let o=!0,a=!1;const l=e=>{if(!o)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let i;try{i=r.maskRequestFn(t)}catch(t){return a||(a=!0,jr.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!i||(t=>!!t&&Pr.has(t))(i)),i&&n.push(i)}),n.length>0&&t(i(i({},e),{},{requests:n}))},u=function(t,e,n){try{t({requests:qr(e,n).flatMap(t=>Yr(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){jr.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!ji(r))return;const s=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!s.length)return;const o=new i(i=>{t({requests:i.getEntries().filter(t=>Wr(t)||Br(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Yr(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return o.observe({entryTypes:s}),()=>{o.disconnect()}}(l,e,r),c=r.recordHeaders||r.recordBody;if(!u&&!c)return o=!1,zr;let h=()=>{},d=()=>{};return c&&(h=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),s=gr(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l=!0,u,c){const h=this;try{const s=new Request(a),l={};let u,c;const d={},f=h.setRequestHeader.bind(h);h.setRequestHeader=(t,e)=>(d[t]=e,f(t,e)),i&&(l.requestHeaders=d);const v=h.send.bind(h);h.send=t=>(Zr({type:"request",headers:d,url:a,recordBody:n.recordBody})&&(l.requestBody=Xr({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{h.removeEventListener("readystatechange",m),h.removeEventListener("error",p),h.removeEventListener("abort",p),h.removeEventListener("timeout",p)},m=()=>{if(h.readyState!==h.DONE)return;p(),c=e.performance.now();const i={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),Zr({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Xr({body:h.response,options:n,url:a})),Jr(e,"xmlhttprequest",s.url,u,c).then(n=>{t({requests:Yr(e,{entry:n,method:o,status:null==h?void 0:h.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};h.addEventListener("readystatechange",m),h.addEventListener("error",p),h.addEventListener("abort",p),h.addEventListener("timeout",p)}catch(t){jr.error("Failed to instrument XHR for network capture",t)}s.call(h,o,a.toString(),l,u,c)});return()=>{s()}}(l,e,r),d=!0===r.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),o=gr(e,"fetch",o=>function(a,l){let u;try{u=new Request(a,l)}catch(t){jr.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(a,l))}catch(t){return new Promise((e,n)=>n(t))}}const c={};let h,d;const f=s(function*(){try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!es(null==l?void 0:l.body)&&Zr({type:"request",headers:t,url:a,recordBody:n.recordBody})&&(c.requestBody=yield as({r:u,options:n,url:a}))}catch(t){jr.error("Failed to record fetch request for network capture",t)}})(),v=(p=s(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(c.responseHeaders=e),Zr({type:"response",headers:e,url:a,recordBody:n.recordBody})&&(c.responseBody=yield us({r:t,options:n,url:a}))}catch(t){jr.error("Failed to record fetch response for network capture",t)}}),function(t){return p.apply(this,arguments)});var p;try{h=e.performance.now()}catch(t){}let m;try{m=Gr(a)?o(u):o(a,l)}catch(t){m=new Promise((e,n)=>n(t))}const g=Promise.resolve(m).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t}));return s(function*(){let n;try{yield f;const t=yield g;if("rejected"===t.status)throw t.error;return n=t.response,yield v(n),n}finally{(i=n,Jr(e,"fetch",u.url,h,d).then(n=>{t({requests:Yr(e,{entry:n,method:u.method,status:null==i?void 0:i.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(l,e,r):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Hr("request",n.recordHeaders),r=Hr("response",n.recordHeaders),o=gr(e,"fetch",o=>function(){var a=s(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return jr.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let h,d;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!es(null==a?void 0:a.body)&&Zr({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield as({r:l,options:n,url:s}))}catch(t){jr.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Gr(s)?yield o(l):yield o(s,a),d=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),Zr({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield us({r:u,options:n,url:s}))}catch(t){jr.error("Failed to record fetch response for network capture",t)}return u}finally{Jr(e,"fetch",l.url,h,d).then(n=>{t({requests:Yr(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{o()}}(l,e,r)),hs=()=>{o=!1,null==u||u(),h(),d(),hs=null},hs}const fs="$replay_override_sampling",vs="$replay_override_linked_flag",ps="$replay_override_url_trigger",ms="$replay_override_event_trigger",gs="$session_is_sampled",ys="$session_recording_url_trigger_activated_session",bs="$session_recording_event_trigger_activated_session",ws="$posthog_sr_group_event_trigger_",ks="$posthog_sr_group_url_trigger_",Ss="$sess_rec_flush_size",_s="$sdk_debug_replay_event_trigger_status",Cs="$sdk_debug_replay_linked_flag_trigger_status",Ms="$sdk_debug_replay_matched_recording_trigger_groups",Is="$sdk_debug_replay_pending_trigger_conditions",Rs="$sdk_debug_replay_remote_trigger_matching_config",As="$sdk_debug_replay_trigger_groups_count",xs="$sdk_debug_replay_url_trigger_status",Ts="$sdk_debug_rrweb_attached",Os="$sdk_debug_rrweb_start_attempted",Es="$session_recording_start_reason",Fs="disabled",Ls="sampled",$s="active",Ds="buffering",Ns="paused",Ps="rrweb_error",js="trigger_activated",Ws="trigger_pending",Bs="trigger_disabled";function zs(t,e,n,i,r,s){return 0===e?Bs:(null==t?void 0:t.get_property(n?i+n:r))===s?js:Ws}function Us(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function qs(t){return t.includes("trigger_activated")?js:t.includes("trigger_pending")?Ws:Bs}function Hs(t){const e=new Set(t);switch(e.delete(Bs),e.size){case 0:return Bs;case 1:return Array.from(e)[0];default:return Ws}}var Gs=class{constructor(t){this.j=t}triggerStatus(t){return qs(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return qs(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Vs=class{constructor(t){this.j=t}triggerStatus(t){return Hs(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Hs(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Zs=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return js}stop(){}};const Js=t=>"sessionRecording"in t;var Qs=class{constructor(t,e){this._instance=t,this.B=[],this.U=[],this.W=new Map,this.H=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(Js(t)?Bi(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.U=(Js(t)?Bi(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.W.clear(),this.H.clear();for(const t of this.B)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){ur.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.U)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){ur.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return zs(this._instance,this.B.length,this.V,ks,ys,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[xs]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=br(this._instance);if(!t)return!1;try{return Us(t,this.U,this.H)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=br(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=Us(n,this.U,this.H);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=br(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const s=this.urlBlocked,o=Us(r,this.U,this.H);o&&!s?t():!o&&s&&e();const a=this.J(i)===js,l=Us(r,this.B,this.W);!a&&l&&n("url",r)}stop(){this.G=""}},Xs=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Cs]:t}),t}triggerStatusNoSideEffects(){let t=Ws;return Hi(this.linkedFlag)&&(t=Bs),this.linkedFlagSeen&&(t=js),t}onConfig(t,e){var n;if(this.linkedFlag=(Js(t)?Bi(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Hi(this.linkedFlag)&&!this.linkedFlagSeen){const t=Ui(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ui(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let s=!1;if(Bi(r)&&t in r){const e=r[t];s=Vi(e)?!0===e:n?e===n:!!e}const o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},Ks=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Js(t)?Bi(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return zs(this._instance,this.K.length,this.V,ws,bs,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[_s]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===js,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Ys=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new Qs(t,e.id),this.et=new Ks(t,e.id),this.nt=new Xs(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new Gs(r):new Vs(r)}else this.it=new Zs}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Ws).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?ks+this.group.id:ws+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function to(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=!0===t.isSampled,n=new Gs([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ls:"trigger_activated"===n?$s:"trigger_pending"===n?Ds:!1===t.isSampled?Fs:$s}function eo(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=new Vs([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==Bs,i=Vi(t.isSampled);return n&&"trigger_pending"===e?Ds:n&&"trigger_disabled"===e||i&&!t.isSampled?Fs:!0===t.isSampled?Ls:$s}function no(){const t=[];return function(e,n){if(Bi(n)||ji(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function io(t){try{const e=JSON.stringify(t,no());return e?new Blob([e]).size:0}catch(t){return-1}}function ro(t){if(qi(t))return 4;if(zi(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(ji(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=zi(i)||qi(i)?4:ro(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];zi(r)||(i||(n+=1),i=!1,n+=t.length+3+ro(r))}return n}default:return 0}}function so(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[so({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),so({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var oo=Uint8Array,ao=Uint16Array,lo=Uint32Array,uo=new oo([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]),co=new oo([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]),ho=new oo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fo=function(t,e){for(var n=new ao(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new lo(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},vo=fo(uo,2),po=vo[1];vo[0][28]=258,po[258]=28;for(var mo=fo(co,0)[1],go=new ao(32768),yo=0;32768>yo;++yo){var bo=(43690&yo)>>>1|(21845&yo)<<1;go[yo]=((65280&(bo=(61680&(bo=(52428&bo)>>>2|(13107&bo)<<2))>>>4|(3855&bo)<<4))>>>8|(255&bo)<<8)>>>1}var wo=function(t,e,n){for(var i=t.length,r=0,s=new ao(e);i>r;++r)++s[t[r]-1];var o,a=new ao(e);for(r=0;e>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new ao(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],h=a[t[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[go[h]>>>l]=u}else for(o=new ao(i),r=0;i>r;++r)o[r]=go[a[t[r]-1]++]>>>15-t[r];return o},ko=new oo(288);for(yo=0;144>yo;++yo)ko[yo]=8;for(yo=144;256>yo;++yo)ko[yo]=9;for(yo=256;280>yo;++yo)ko[yo]=7;for(yo=280;288>yo;++yo)ko[yo]=8;var So=new oo(32);for(yo=0;32>yo;++yo)So[yo]=5;var _o=wo(ko,9,0),Co=wo(So,5,0),Mo=function(t){return(t/8|0)+(7&t&&1)},Io=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof ao?ao:t instanceof lo?lo:oo)(n-e);return i.set(t.subarray(e,n)),i},Ro=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Ao=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},xo=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,s=n.slice();if(!r)return[new oo(0),0];if(1==r){var o=new oo(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[h].f>n[u].f?u++:h++],l=n[u!=c&&n[h].f>n[u].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;r>i;++i)s[i].s>d&&(d=s[i].s);var f=new ao(d+1),v=To(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new oo(f),v]},To=function(t,e,n){return-1==t.s?Math.max(To(t.l,e,n+1),To(t.r,e,n+1)):e[t.s]=n},Oo=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ao(++e),i=0,r=t[0],s=1,o=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,i),e]},Eo=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},Fo=function(t,e,n){var i=n.length,r=Mo(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;i>s;++s)t[r+s+4]=n[s];return 8*(r+4+i)},Lo=function(t,e,n,i,r,s,o,a,l,u,c){Ro(e,c++,n),++r[256];for(var h=xo(r,15),d=h[0],f=h[1],v=xo(s,15),p=v[0],m=v[1],g=Oo(d),y=g[0],b=g[1],w=Oo(p),k=w[0],S=w[1],_=new ao(19),C=0;y.length>C;++C)_[31&y[C]]++;for(C=0;k.length>C;++C)_[31&k[C]]++;for(var M=xo(_,7),I=M[0],R=M[1],A=19;A>4&&!I[ho[A-1]];--A);var x,T,O,E,F=u+5<<3,L=Eo(r,ko)+Eo(s,So)+o,D=Eo(r,d)+Eo(s,p)+o+14+3*A+Eo(_,I)+(2*_[16]+3*_[17]+7*_[18]);if(L>=F&&D>=F)return Fo(e,c,t.subarray(l,l+u));if(Ro(e,c,1+(L>D)),c+=2,L>D){x=wo(d,f,0),T=d,O=wo(p,m,0),E=p;var N=wo(I,R,0);for(Ro(e,c,b-257),Ro(e,c+5,S-1),Ro(e,c+10,A-4),c+=14,C=0;A>C;++C)Ro(e,c+3*C,I[ho[C]]);c+=3*A;for(var P=[y,k],j=0;2>j;++j){var W=P[j];for(C=0;W.length>C;++C)Ro(e,c,N[B=31&W[C]]),c+=I[B],B>15&&(Ro(e,c,W[C]>>>5&127),c+=W[C]>>>12)}}else x=_o,T=ko,O=Co,E=So;for(C=0;a>C;++C)if(i[C]>255){var B;Ao(e,c,x[257+(B=i[C]>>>18&31)]),c+=T[B+257],B>7&&(Ro(e,c,i[C]>>>23&31),c+=uo[B]);var z=31&i[C];Ao(e,c,O[z]),c+=E[z],z>3&&(Ao(e,c,i[C]>>>5&8191),c+=co[z])}else Ao(e,c,x[i[C]]),c+=T[i[C]];return Ao(e,c,x[256]),c+T[256]},$o=new lo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Do=new oo(0),No=function(){for(var t=new lo(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Po=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function jo(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=No[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,s,o,a,l,u,c=(a=10+((r=e).filename&&r.filename.length+1||0),l=8,function(t,e,n,i,r,s){var o=t.length,a=new oo(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>h?u=Fo(l,u,t.subarray(c,h)):(l[c]=s,u=Fo(l,u,t.subarray(c,o)))}else{for(var d=$o[e-1],f=d>>>13,v=8191&d,p=(1<<n)-1,m=new ao(32768),g=new ao(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new lo(25e3),S=new ao(288),_=new ao(32),C=0,M=0,I=(c=0,0),R=0,A=0;o>c;++c){var x=w(c),T=32767&c,O=g[x];if(m[T]=O,g[x]=T,c>=R){var E=o-c;if((C>7e3||I>24576)&&E>423){u=Lo(t,l,0,k,S,_,M,I,A,c-A,u),I=C=M=0,A=c;for(var F=0;286>F;++F)S[F]=0;for(F=0;30>F;++F)_[F]=0}var L=2,D=0,N=v,P=T-O&32767;if(E>2&&x==w(c-P))for(var j=Math.min(f,E)-1,W=Math.min(32767,c),B=Math.min(258,E);W>=P&&--N&&T!=O;){if(t[c+L]==t[c+L-P]){for(var z=0;B>z&&t[c+z]==t[c+z-P];++z);if(z>L){if(L=z,D=P,z>j)break;var U=Math.min(P,z-2),q=0;for(F=0;U>F;++F){var H=c-P+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,O=H)}}}P+=(T=O)-(O=m[T])+32768&32767}if(D){k[I++]=268435456|po[L]<<18|mo[D];var V=31&po[L],Z=31&mo[D];M+=uo[V]+co[Z],++S[257+V],++_[Z],R=c+L,++C}else k[I++]=t[c],++S[t[c]]}}u=Lo(t,l,s,k,S,_,M,I,A,c-A,u),s||(u=Fo(l,u,Do))}return Io(a,0,i+Mo(u)+r)}(s=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l,!u)),h=c.length;return function(t,e){var n=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&&Po(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(c,e),Po(c,h-8,n.d()),Po(c,h-4,i),c}function Wo(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var Bo=class{constructor(t,e={}){var n,i,r,s;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,s,o,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=t.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const s=this.wt(e);if(0===s&&n!==s)return;if(this.St)return t;this.ct();const o=ro(t);var a,l;return o>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,o),void this._t()):(this.dt-=o,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new Qi({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:ur}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(s=this.rt.bytesRefillRate)&&void 0!==s?s:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const o=this.rt.resyncIntervalMs;this.Ct=Gi(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}};let zo=null;const Uo={Ot(){if(!qi(zo))return zo;if(zo=!0,zi(Ti))zo=!1;else try{const t="__support__";Uo.$t(t,"xyz"),'"xyz"'!==Uo.Lt(t)&&(zo=!1),Uo.Ft(t)}catch(t){zo=!1}return zo},Dt(t){ur.error("sessionStorage error: ",t)},Lt(t){try{return null==Ti?void 0:Ti.sessionStorage.getItem(t)}catch(t){Uo.Dt(t)}return null},Pt(t){try{return JSON.parse(Uo.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==Ti||Ti.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Uo.Dt(t)}return!1},Ft(t){try{null==Ti||Ti.sessionStorage.removeItem(t)}catch(t){Uo.Dt(t)}}};ar.DEBUG=!1,ar.LIB_VERSION="1.453.2",ar.LIB_NAME="web";var qo=ar,Ho=class{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.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(Ss,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(Ss);return Bi(n=e)&&Ui(n.sessionId)&&Gi(n.size)&&e.sessionId===t?e.size:0;var n}};function Go(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<Ji(100*e,0,100,ur)}const Vo=(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}},Zo=t=>t.toLowerCase(),Jo={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=>Vo(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Vo(e,t))),icontains:(t,e)=>e.map(Zo).some(e=>t.map(Zo).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Zo).every(e=>t.map(Zo).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Qo=new Set(["is_not","not_icontains","not_regex"]);function Xo(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],s=t.operator||"exact";if(zi(r)||qi(r))return Qo.has(s);const o=Jo[s];return!!o&&!zi(t.value)&&!qi(t.value)&&o(ji(t.value)?t.value.map(String):[String(t.value)],ji(r)?r.map(String):[String(r)])})}const Ko=cr("[SessionRecording]");function Yo(t,e){return e?t:"x"+t}function ta(t,e){return t===e||t!=="x"+e&&null}var ea=class{constructor(t,e,n,i,r,s,o){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=s,this.zt=o,this.Ut=null,this.Wt=eo}onRemoteConfig(t){this.Ut=Gi(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ht=new Gs([this.et,this.tt]),this.Wt=to):(this.Ht=new Vs([this.et,this.tt]),this.Wt=eo),this._instance.register_for_session({[Rs]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Wt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Gi(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&Hi(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Ko.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ut;var i,r;if(!Gi(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const s=this._instance.get_property(gs),o=this._instance.get_property("$replay_sample_rate"),a=ta(s,t),l=Gi(o)&&o!==n,u=zi(o)&&s===t,c=l||u||!Vi(a),h=c?Go(t,n):a;c&&(h?this.jt("sampled"):Ko.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Yo(t,h),$replay_sample_rate:qi(o)&&s===t?null:n})}ensureSamplingDecision(t){if(!Gi(this.Ut))return;const e=this._instance.get_property(gs);Vi(ta(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ht)||void 0===e?void 0:e.triggerStatus(t))===Ws}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Ws).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},na=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[Rs]:"v2_trigger_groups",[As]:t.triggerGroups.length}),this.tt.onConfig(t)):Ko.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ps;if(!t.receivedFlags)return Ds;if(!t.isRecordingEnabled)return Fs;if(t.urlTriggerMatching.urlBlocked)return Ns;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return Fs;let i=!1,r=!1;for(const s of e){const e=s.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=s.group.id,e=n.get(t);zi(e)?ur.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?Ls:i?Ds:Fs}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Gi(t)&&(qi(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Ko.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),s=this._instance.get_property(wr);r.some(e=>!e.properties||0===e.properties.length||Xo(e.properties,t.properties,s))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Ko.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,s=i.sampleRate,o="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(o);let l=null,u=!1,c=!1,h=!1;if(Bi(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Gi(n)&&n!==s,l=e===t&&Gi(n)&&n===s&&Vi(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,h=a===t;const d=u||c||h||!Vi(l),f=d?Go(t+r,s):l;d&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:s,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[o]:{sessionId:t,sampleRate:s,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,s;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(s=this._instance.persistence)||void 0===s||s.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,s="trigger_activated"===n.triggerStatus(t),o=!0===this.Zt.get(r);s&&e.push({id:r,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[Ms]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Xo(n,e,this._instance.get_property(wr))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new Ys(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const ia=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ra=1e5,sa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,oa=[],aa=()=>!1,la="@type @id 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(" "),ua="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ca="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(" "),ha="Accommodation AdministrativeArea Country Place State".split(" "),da={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:ua,publisher:ca},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:oa},Offer:{seller:ca},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:ca,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ca,areaServed:ha,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:oa}},fa=[["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(" "),da.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),da.Event],[ca,da.Organization],[ha,da.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),da.Product]];function va(t,e){return Ni.call(t,e)?t[e]:void 0}function pa(t){const e=typeof t;return qi(t)||"string"===e||"number"===e||"boolean"===e}function ma(t,e){return e&&function(t){return Ui(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function ga(t,e){return ji(t)&&t.every(pa)?t.map(t=>ma(t,e)).filter(t=>!zi(t)):pa(t)?ma(t,e):void 0}function ya(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function ba(t){if(Ni.call(da,t))return da[t];for(const[e,n]of fa)if(e.includes(t))return n}function wa(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function ka(t,e,n,i){if(ji(t)){const r=t.map(t=>ka(t,e,n,i)).filter(t=>!zi(t));return r.length?r:void 0}return Sa(t,e,n,i)||void 0}function Sa(t,e,n,i){if(!Bi(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=va(t,"@type"),s=function(t){const e=new Set,n="string"==typeof t?[t]:ji(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&sa.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),o=s.filter(t=>!!ba(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of la){const o="@type"===i?s.length?"string"==typeof r?s[0]:s:void 0:"@id"===i?ya(va(t,i),e):ga(va(t,i),n.maskUrl);zi(o)||wa(a,i,o)}for(const i of o){const r=ba(i);for(const i of Object.keys(r)){const s=va(t,i),o=r[i];if(!0===o){const t=ga(s,n.maskUrl);zi(t)||wa(a,i,t)}else{const t=ka(s,e,n,o);zi(t)||wa(a,i,t)}}}const l=ka(va(t,"@graph"),e,n);return zi(l)||wa(a,"@graph",l),Object.keys(a).length?a:null}function _a(t,e,n){if(!Bi(t))return null;const r=va(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;const s=Sa(t,e,n);return s?i({"@context":"https://schema.org"},s):null}function Ca(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function Ma(t,e,n){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!!n&&t.matches(n)}catch(t){return!1}}function Ia(t,e,n){for(let i=t;i;){if(Ma(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function Ra(t){return Ca(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ca)}function Aa(t){return Bi(t)?t.network_timing:t}const xa=cr("[SessionRecording]"),Ta=[1,2,3,4,5,6,7,12],Oa=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ea(){var t;return null==$i||null===(t=$i.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Fa(){var t;return null===(t=Ea())||void 0===t?void 0:t.record}function La(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,no())}}function $a(t){return Wo(jo(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new oo(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},s=0;e>s;++s){if(i+5>n.length){var o=new oo(i+8+(e-s<<1));o.set(n),n=o}var a=t.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return Io(n,0,i)}(La(t))),!0)}function Da(t){return Na.apply(this,arguments)}function Na(){return Na=s(function*(t){const e=yield function(t){return sr.apply(this,arguments)}(La(t),qo.DEBUG,{rethrow:!0});return Wo(new Uint8Array(yield e.arrayBuffer()),!0)}),Na.apply(this,arguments)}let Pa,ja;const Wa="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Ba=!1;function za(t){var e;return ji(t)&&0===t.length?(Pa=null!==(e=Pa)&&void 0!==e?e:$a([]),Pa):$a(t)}function Ua(t){return qa.apply(this,arguments)}function qa(){return(qa=s(function*(t){var e;return ji(t)&&0===t.length?Pa||(ja=null!==(e=ja)&&void 0!==e?e:Da([]).then(t=>(Pa=t,t)).catch(t=>{throw Pa=void 0,ja=void 0,t}),ja):Da(t)})).apply(this,arguments)}function Ha(t){return Wa&&!Ba&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Ga(t){return{event:t,size:ro(t)}}function Va(t,e){return i(i({},t),{},{data:e,cv:"2024-10"})}function Za(t,e){return i(i({},t),{},{cv:"2024-10",data:i(i({},t.data),e)})}function Ja(t){try{if(2===t.type)return Ga(Va(t,$a(t.data)));if(3===t.type&&0===t.data.source)return Ga(Za(t,{texts:za(t.data.texts),attributes:za(t.data.attributes),removes:za(t.data.removes),adds:za(t.data.adds)}));if(3===t.type&&8===t.data.source)return Ga(Za(t,{adds:t.data.adds?$a(t.data.adds):void 0,removes:t.data.removes?$a(t.data.removes):void 0}))}catch(t){xa.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:io(t)}}function Qa(){return(Qa=s(function*(t){try{if(2===t.type)return Ga(Va(t,yield Da(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Ua(t.data.texts),Ua(t.data.attributes),Ua(t.data.removes),Ua(t.data.adds)]);return Ga(Za(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Da(t.data.adds):void 0,t.data.removes?Da(t.data.removes):void 0]);return Ga(Za(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Ki})(e)&&(Ba=!0),xa.warn("could not compress event asynchronously - trying synchronous compression",e),Ja(t)}return{event:t,size:io(t)}})).apply(this,arguments)}function Xa(t,e){return 5===t.type&&t.data.tag===e}function Ka(t){return Xa(t,"sessionIdle")}function Ya(t){return Xa(t,"$session_ending")}function tl(t){return Xa(t,"$session_starting")}var el=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return ta(this._instance.get_property(gs),this.sessionId)}get Ut(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Gi(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.supportsSelectMasking=!0,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=void 0,this.ue=!1,this.ce=Date.now(),this.de=!1,this.he=[],this.fe="unknown",this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=0,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=!1,this.Ae=!1,this.Re=!1,this.Ee=void 0,this.Oe=void 0,this.$e=!1,this.Le=[],this.Fe=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Gt=void 0,this.qe=void 0,this.je=void 0,this.Be=void 0,this.ze=(t,e,n)=>{var i,r,s,o;if(!n)return;if(t===this.Xt&&e===this.Ue)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Ue;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce,flushed_size:null===(c=this.We)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Ea())||void 0===r||null===(s=r.resetMaxDepthState)||void 0===s||s.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.He(),!(!1===this.fe&&this.isStarted||this.Xt===t&&this.Ue===e)){const e=this.Xt!==t&&!1!==this.fe;this.fe="unknown",this.Ge(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce}),null===(o=this.oe)||void 0===o||o.makeSamplingDecisions(t)},this.Ve=!1,this.Qe=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Gi(n)&&Gi(i)?i-n:null},this.Je=()=>{var t,e;const n=this.re;if(!Gi(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Ye;return Gi(t)&&t>=0&&n>t}if(this.Qe())return!1;const i=this.Ze();return!!qi(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ke=()=>{"buffering"!==this.status?(this.be&&this.we&&this.Xe&&(this.tn(void 0),this.ke&&(this.ke=!1,this.Bt())),this.en(),this.nn(!0)):this.rn()},this.sn=()=>{this.Ke()},this.an=()=>{this.Vt("browser offline",{})},this.ln=()=>{this.Vt("browser online",{})},this.un=()=>{(null==Ei?void 0:Ei.visibilityState)&&("visible"===Ei.visibilityState&&(this.Xe=!0),this.Vt("window "+Ei.visibilityState,{}))},this.Xe=null==e||e;const{sessionId:n,windowId:i,sessionStartTimestamp:r}=this.te.checkAndGetSessionAndWindowId();this.Xt=n,this.Ue=i,this._sessionStartTimestamp=r,this.nt=new Xs(this._instance),this.tt=new Qs(this._instance),this.et=new Ks(this._instance),this.Rt=this.rn(),this.cn=function(t){return"ph_replay_pending_buffer_"+JSON.stringify([t.persistence_name||t.token,t.token])}(this._instance.config),this.te.sessionTimeoutMs>this.ee||xa.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.We=new Ho(this._instance)}setDocumentWasEverVisible(t){t&&(this.Xe=!0)}get dn(){var t,e,n,i,r,s,o,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},h=null!==(s=null==c?void 0:c.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,d=null!==(o=null==c?void 0:c.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return zi(h)&&zi(d)&&zi(f)&&zi(v)?void 0:{maskAllInputs:null==h||h,maskTextSelector:d,blockSelector:f,maskAllElementAttributes:v}}hn(){var t;if(this.Me)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(Hi(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!zi(i)&&i!==r});0!==i.length&&(this.Me=!0,xa.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==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get fn(){var t;return Ji(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,cr("canvas recording resolution scale"),1)}get vn(){var t,e,n,i,r,s,o;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let h=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof h){const t=parseFloat(h);h=isNaN(t)?.4:t}return{enabled:u,fps:Ji(c,0,12,cr("canvas recording fps"),4),quality:Ji(h,0,1,cr("canvas recording quality"),.4)}}get pn(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get mn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},s=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),o=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=Aa(this._instance.config.capture_performance),l=Aa(null==i?void 0:i.capturePerformance),u=!!(Vi(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}gn(){var t,e;const n=[],r=null===(t=$i.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.pn&&n.push(r());const s=null===(e=$i.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.mn&&Wi(s))if(!vr.includes(Fi.hostname)||this._forceAllowLocalhostNetworkCapture){const t=Wi(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(i(i({},((t,e,n)=>{const r={payloadSizeLimitBytes:Tr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Tr.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Tr.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,a=!1!==t.capture_performance&&e.recordPerformance,l=(t=>{const e=xr(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=Dr(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=Dr(t.responseBody,t.responseHeaders,e,"Response")),t)})(r),u=e=>{return l(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=fr(t.name);let s=0===e.indexOf("http")?null===(i=fr(e))||void 0===i?void 0:i.pathname:e;"/"===s&&(s="");const o=null==r?void 0:r.pathname.replace(s||"","");return r&&o&&$r.some(t=>0===o.indexOf(t))?void 0:t})((Lr((i=e).requestHeaders),Lr(i.responseHeaders),i),t.api_host,n));var i},c=Wi(t.session_recording.maskNetworkRequestFn);return c&&Wi(t.session_recording.maskCapturedNetworkRequestFn)?ur.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):c&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return i(i({},e),{},{name:null==n?void 0:n.url})}),r.maskRequestFn=Wi(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=u(e);if(!r)return;const s=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,o=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return Hi(o)&&s?(Pr.add(s),s):null!=o?o:void 0}:t=>function(t){if(!zi(t))return t.requestBody=Nr(t.requestBody,"Request"),t.responseBody=Nr(t.responseBody,"Response"),t}(u(t)),i(i(i({},Tr),r),{},{recordHeaders:s,recordBody:o,recordPerformance:a,recordInitialRequests:a,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.mn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else xa.info("NetworkCapture not started because we are on localhost.");return n}yn(t){return this._instance.config.disable_capture_url_hashes?Xi(t):t}bn(t,e=!1){const n=e?Xi(t):this.yn(t),i=this._instance.config.mask_personal_data_properties?[...ia,...this._instance.config.custom_personal_data_properties||[]]:[];return this.wn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),s=r[1],o=r[0],a=(s||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=o;return null!=s&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}wn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}kn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):xa.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.kn(Oa(()=>Fa().addCustomEvent(t,e)))}Sn(){var t;return this.ue&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.fe}_n(t){if(!this.Sn())return!1;try{const e=Fa();return!!e&&(e.addCustomEvent("$json_ld",t),this.Sn())}catch(t){return!1}}xn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.Cn)||void 0===e?void 0:e.scan(t)})}Mn(){try{if(this._instance.config.capture_pageview||!Ti)return;const t=new URL(Ti.location.href),e=this.bn(t.origin+t.pathname+t.search);this.Tn!==e&&(this.Tn=e,this.Vt("$url_changed",{href:e}))}catch(t){}}In(){if(this.he.length){const t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.kn(t)})}}Bt(){return this.kn(Oa(()=>Fa().takeFullSnapshot()))}get An(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Gi(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rn(){if(this.En&&clearInterval(this.En),!0===this.fe)return;const t=this.An;t&&(this.En=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.On(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rn()}$n(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this.Cn)||void 0===t||t.scan(),clearInterval(this.En),xa.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Ln(){var t;this.tt.urlBlocked&&(null===(t=this.Cn)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.xn(),this.Rn(),this.Vt("recording resumed",{reason:"left blocked url"}),xa.info("recording resumed"))}Fn(t,e){var n;if("event"===t&&this.On(),!this.de&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.de=!0;try{var i,r;const n="url"===t?ys:bs;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.nn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.de=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=Bi(t)?t:JSON.parse(t)}catch(t){return void xa.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ve){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void xa.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Dn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(t){var e,n;const i=this.ie;if(!i)return void xa.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.fe&&!this.Se;this.tn(t?"no_interaction_since_recording_started":void 0),this.Se=!1,this.we=t,this.ke=!1}this.Pe&&(this.Pn(),this.rn());const{sessionId:r,windowId:s,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=r,this.Ue=s,this._sessionStartTimestamp=o,this.Nn(),null===(e=this._instance.persistence)||void 0===e||e.unregister("$debug_first_full_snapshot_timestamp"),(null==i?void 0:i.endpoint)&&(this.se=null==i?void 0:i.endpoint),this.oe=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new na(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new ea(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(i),null===(n=this.Gt)||void 0===n||n.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Fn(t,e)),this.Dn(fs,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(fs)}),this.Dn(vs,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(vs)}),this.Dn(ms,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(ms)}),this.Dn(ps,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(ps)}),this.oe.makeSamplingDecisions(this.sessionId),this.qn(),this._e||(dr(Ti,"beforeunload",this.Ke),dr(Ti,"pagehide",this.sn),dr(Ti,"offline",this.an),dr(Ti,"online",this.ln),dr(Ei,"visibilitychange",this.un),!this.qe&&Wi(this.te.onSessionId)&&(this.qe=this.te.onSessionId(this.ze)),!this.je&&Wi(this.te.on)?this.je=this.te.on("forcedIdleReset",()=>{this.He(),this.fe="unknown",this.stop(),this.Be=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.Be)||void 0===i||i.call(this),this.Be=void 0,this.ze(t,e,n)})}):Wi(this.te.on)||xa.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Hi(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.bn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){xa.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}jn(t=!1){var e,n,i,r,s,o;null==Ti||Ti.removeEventListener("beforeunload",this.Ke),null==Ti||Ti.removeEventListener("pagehide",this.sn),null==Ti||Ti.removeEventListener("offline",this.an),null==Ti||Ti.removeEventListener("online",this.ln),null==Ei||Ei.removeEventListener("visibilitychange",this.un),clearInterval(this.En),this.Bn(),null===(e=this.Ne)||void 0===e||e.call(this),this.Ne=void 0,null===(n=this.Gt)||void 0===n||n.call(this),this.Gt=void 0,null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,null===(r=this.je)||void 0===r||r.call(this),this.je=void 0,null===(s=this.Be)||void 0===s||s.call(this),this.Be=void 0,null===(o=this.oe)||void 0===o||o.stop(),this.zn(t),this.Pn()}Pn(){this.De+=1,this.Le=[],this.Fe=0,this.Un=void 0,this.Pe=!1}zn(t=!1){var e,n,i;t||null===(i=this.le)||void 0===i||i.cancel(),null===(e=this.Wn)||void 0===e||e.stop(),this.he=[],null===(n=this.Cn)||void 0===n||n.stop(),this.Cn=void 0,this.ue=!1;try{var r;null===(r=this.ae)||void 0===r||r.call(this)}catch(t){xa.warn("could not stop rrweb",t)}this.ae=void 0}Hn(){if(!this.Un||0===this.Fe)return!1;if(this.Pe)return!0;this.Pe=!0,this.Gn=void 0;const t=this.De;return this.Bn(),this.zn(),this.Un.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.nn(),this.rn(),this.Vn(),this.jn(),xa.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vn(),this.jn(),xa.info("stopped")}),!0}stop(t=!1){if(this.zn(t),this.Ve)this.en();else if(this.Hn())return;this.nn(),this.rn(),this.Vn(),this.jn(t),xa.info("stopped")}Vn(){this.tn(void 0,{preserveLogDedup:this.Ve}),this.we=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.en(),this.nn())}Ge(t){const e=this.le,n=this.Ve;let i;this.Ve=!0,this.ce=Date.now();const r={cancelled:!1,cancel(){r.cancelled=!0,null==e||e.cancel(),null==i||i()}};this.le=r;const s=()=>{var t,e;this.stop(!0),r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()?r.cancel():(this.Qn=void 0,this.ye=0,this.pe=0,this.me=0,this.ge=0,null===(t=Ea())||void 0===t||null===(e=t.resetSnapshotCostState)||void 0===e||e.call(t),this.start("session_id_changed"),(r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())&&(r.cancel(),this.discard({discardProducerEvents:!0})))};try{var o;const t=null===(o=Fa())||void 0===o?void 0:o.withStyleRuleSourceHandoff;t&&this.ae?t(this.ae,t=>{i=t,s()}):s()}finally{this.le=e,this.Ve=n}r.cancelled||(this.tn(t?"no_interaction_since_session_rotated":void 0),this.we=!1)}tn(t,{preserveLogDedup:e=!1}={}){if(this.be=!zi(t),this.Gn=t,zi(t))return void(e||(this.Zn=void 0));if(this.Ve)return;const n=`${this.sessionId}:${t}`;n!==this.Zn&&(this.Zn=n,xa.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}On(){this.isStarted||(this.Se=!0),this.be&&(this.tn(void 0),this.we=!1,this.ke&&(this.ke=!1,this.Bt()),this.Jn())}discard({discardProducerEvents:t=!1}={}){t&&(this.Yn||this._instance.config.session_recording.selectMaskingFn)&&Uo.Ft(this.cn),this.be=!0,t&&(this.rn(),this.zn()),this.rn(),this.jn(),this.rn(),this.Vn(),xa.info("discarded")}Kn(t,e,n,i,r){if(-1===n)return this.ye+=1,void xa.warn("could not stringify event - dropping it to keep the rest of the recording");const s={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Xn(t,i),this.ti(s)):this.rn()}ei(){try{this.ni()}catch(t){this.Ce||(this.Ce=!0,xa.error("could not track full snapshot cost",t))}}ni(){var t,e;const n=null===(t=Ea())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Qn&&(this.Qn=n,500>n.durationMs||xa.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Xn(t,e){2!==t.type?3===t.type&&(zi(this.Ee)||this.Ee===e||this.Oe===e||(this.Oe=e,xa.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Ee=e}ii(t){t.counted&&t.generation===this.De&&(this.Fe=Math.max(0,this.Fe-1)),t.counted=!1,this.Le=this.Le.filter(e=>e!==t)}ri(t,e,n){t.processed||t.generation!==this.De||(t.processed=!0,this.Kn(t.event,e,n,t.targetSessionId,t.targetWindowId))}oi(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Ja(t.event))}catch(t){xa.warn("could not process queued compression event - will use uncompressed event",t)}zi(e)&&(e=io(t.event));try{this.ri(t,n,e)}catch(t){xa.warn("could not capture queued compression event",t)}}finally{this.ii(t)}}en(){[...this.Le].forEach(t=>{try{this.oi(t)}catch(t){xa.warn("could not drain queued compression event",t)}})}si(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.De,processed:!1,counted:!0};this.Le.push(o),this.Fe+=1;const a=(l=s(function*(){try{if(o.processed)return;let n,i;try{const r=e?Ha(t)?yield function(t){return Qa.apply(this,arguments)}(t):Ja(t):{event:t,size:io(t)};n=r.event,i=r.size}catch(e){xa.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=io(t)}r.ri(o,n,i)}finally{r.ii(o)}}),function(){return l.apply(this,arguments)});var l;this.Un=this.Un?this.Un.catch(()=>{}).then(a):a()}onRRwebEmit(t,e){var n,i,r,s,o,a,l,u,c,h,d,f;if(!this._instance.sessionManager)return;if(this.In(),!t||!Bi(t))return;if(4===t.type){const e=this.bn(t.data.href);if(this.Tn=e,!e)return;t.data.href=e}else this.Mn();if(null===(n=this.oe)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.$n(),()=>this.Ln(),(t,e)=>this.Fn(t,e)),this.tt.urlBlocked&&(5!==(h=t).type||"recording paused"!==h.data.tag))return;2===t.type&&(this.ei(),Promise.resolve().then(()=>this.ei()),this.Rn(),null===(d=this.Wn)||void 0===d||d.reset(),null===(f=this._instance.persistence)||void 0===f||f.register_once({$debug_first_full_snapshot_timestamp:t.timestamp},void 0));const v=2===t.type&&(null===(i=this.oe)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));v&&this.ai();const p=this.Wn?this.Wn.throttleMutations(t):t;if(!p)return void(!0===this.fe&&this.ve++);const m=function(t){const e=t;if(e&&Bi(e)&&6===e.type&&Bi(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]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(p),g=function(t){return Ya(t)?t.data.payload:null}(m),y=function(t){return tl(t)?t.data.payload:null}(m),b=function(t){return Ka(t)?t.data.payload:null}(m);g||y?(null==g?void 0:g.lastActivityTimestamp)&&(m.timestamp=g.lastActivityTimestamp):(null==b?void 0:b.sessionId)||this.li(m,e);const w=null!==(r=null!==(s=null!==(o=null==g?void 0:g.currentSessionId)&&void 0!==o?o:null==y?void 0:y.nextSessionId)&&void 0!==s?s:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Xt,k=null!==(a=null!==(l=null!==(u=null==g?void 0:g.currentWindowId)&&void 0!==u?u:null==y?void 0:y.nextWindowId)&&void 0!==l?l:null==b?void 0:b.windowId)&&void 0!==a?a:this.Ue;if(!0===this.fe&&!function(t){return Ka(t)||Ya(t)||tl(t)}(m))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(m)&&this.ve++);2===m.type&&(this.ve=0),b&&(m.timestamp=b.lastActivityTimestamp+b.threshold);const S=this.ue;this.ue=!0,v?this.xn(!0):S||this.xn();const _=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===m.type&&"$json_ld"===m.data.tag){let t;try{t=Ti?this.bn(Ti.location.href):void 0}catch(t){}m.data.href=t}if(this.Fe>0||_&&Ha(m))return void this.si(m,_,w,k);const{event:C,size:M}=_?Ja(m):{event:m,size:io(m)};this.Kn(m,C,M,w,k)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this._e,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):Fs}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.On(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.On(),this.jt("sampling_overridden")}overrideTrigger(t){this.Fn(t),this.On()}ui(){try{var t;const e=null==Ti||null===(t=Ti.location)||void 0===t?void 0:t.href;if(!e)return;const n=this.bn(e);if(!n)return;return new URL(n).hostname||void 0}catch(t){return}}Bn(){this.ci&&(clearTimeout(this.ci),this.ci=void 0)}Jn(){this.ci||(this.ci=setTimeout(()=>{this.nn()},2e3))}di(){return this.Ee!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Ya(t)&&!tl(t))}hi(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}fi(t){if("buffering"!==t)return zi(this.pi)||this._instance.register_for_session({[Is]:[]}),void(this.pi=void 0);const e=this.hi();if(0===e.length)return zi(this.pi)||this._instance.register_for_session({[Is]:[]}),void(this.pi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.pi&&(this.pi=i,this._instance.register_for_session({[Is]:e}),xa.info(`buffering: ${n}`))}mi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.gi)&&Uo.Ot()}yi(){this.Yn||this._instance.config.session_recording.selectMaskingFn||0!==this.Rt.data.length&&this.Rt.size!==this.bi&&943718.4>=this.Rt.size&&this.mi()&&(this.bi=this.Rt.size,Uo.$t(this.cn,this.Rt))}Nn(){if(this.$e||!this.mi())return;this.$e=!0;const t=Uo.Pt(this.cn);Uo.Ft(this.cn),!this._instance.config.session_recording.selectMaskingFn&&Bi(t)&&ji(t.data)&&0!==t.data.length&&ji(t.sizes)&&t.sizes.length===t.data.length&&Gi(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Ue&&(this.Rt.data.length>0||(this.Rt=t))}nn(t=!1){var e;if(this.Bn(),this.be)return this.Rt;if(this.di())return this.Rt.size>943718.4?this.rn():(t&&this.yi(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const r=this.Je(),s=this.status;if(this.fi(s),"buffering"===s||"paused"===s||"disabled"===s||r)return!t||"active"!==s&&"sampled"!==s||this.yi(),this.Jn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.ui();so(n).forEach(e=>{try{var n;null===(n=this.We)||void 0===n||n.trackSize(e.sessionId,e.size),this.wi(i(i(i(i({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:qo.LIB_NAME,$lib_version:qo.LIB_VERSION,$snapshot_host:t},this.pe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutations_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ge}:{}),this.ye>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ye}:{}))}catch(t){xa.warn("could not capture snapshot chunk - skipping it",t)}}),zi(this.bi)||(Uo.Ft(this.cn),this.bi=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.rn()}ti(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.fe&&!this.be&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.nn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.rn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.be&&(this.ke||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ke=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.fe||this.be||this.Jn())}wi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ye(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.rn();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.rn():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}rn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Ue},this.Rt}jt(t,e){this._instance.register_for_session({[Es]:t}),xa.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",i({reason:t},e))}ki(t,e){var n;return!e&&3===t.type&&-1!==Ta.indexOf(null===(n=t.data)||void 0===n?void 0:n.source)}li(t,e){const n=this.ki(t,e);n||!0===this.fe||t.timestamp-this.ce>this.ee&&(this.fe=!0,clearInterval(this.En),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ce,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Ue}),this.nn());const{windowId:i,sessionId:r}=this.te.checkAndGetSessionAndWindowId(!n,t.timestamp);let s=!1;if(n&&(this.ce=t.timestamp,this.fe)){const e="unknown"===this.fe;this.fe=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}const o=this.Xt!==r,a=this.Ue!==i;if(this.Ue=i,this.Xt=r,o||a){const t=o&&!1!==this.fe;t&&(this.fe="unknown"),this.Ge(t)}else if(n&&this.On(),s){var l;const t=["sampled","active"].includes(this.status)||(null===(l=this.oe)||void 0===l?void 0:l.hasPendingTriggers(this.sessionId));this.ve>0&&t&&this.Bt(),this.xn(),this.Rn()}}He(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Gn,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.We)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this._e,[Ts]:this.Si,[Os]:this.xe}}get Si(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Fa())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}qn(){var t;if(this.ae)return;this.xe=!0;const e={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,selectMaskingFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},n=this._instance.config.session_recording;for(const[t,r]of Object.entries(n||{}))if(t in e)if("maskInputOptions"===t)e.maskInputOptions=i({password:!0},r);else if("sampling"===t){const t=null!=r?r:{},n={};zi(t.mousemove)||(n.mousemove=t.mousemove),zi(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),e.sampling=n}else e[t]=r;var r,s,o,a;!0===(null==n?void 0:n.captureJsonLd)&&!0!==e.slimDOMOptions&&"all"!==e.slimDOMOptions&&(e.slimDOMOptions=i(i({},e.slimDOMOptions),{},{script:!0})),this.vn&&this.vn.enabled&&(e.recordCanvas=!0,e.sampling=i(i({},e.sampling),{},{canvas:this.vn.fps}),e.dataURLOptions={type:"image/webp",quality:this.vn.quality},e.canvasResolutionScale=this.fn,e.canvasMasking={configured:()=>{var t;return Wi(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(Wi(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Ie||(this.Ie=!0,xa.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.dn&&(e.maskAllInputs=null===(r=this.dn.maskAllInputs)||void 0===r||r,e.maskTextSelector=null!==(s=this.dn.maskTextSelector)&&void 0!==s?s:void 0,e.blockSelector=null!==(o=this.dn.blockSelector)&&void 0!==o?o:void 0,e.maskAllElementAttributes=null!==(a=this.dn.maskAllElementAttributes)&&void 0!==a&&a),e.maskAllElementAttributes&&e.maskAttributeFn&&(e.maskAttributeFn=void 0,this.Te||(this.Te=!0,xa.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.hn();const l=Fa();if(!l)return void xa.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");if(e.selectMaskingFn&&!0!==l.supportsSelectMasking)return void xa.error("Session recording has not started: the recorder does not support selectMaskingFn.");this.Wn=null!==(t=this.Wn)&&void 0!==t?t:new Bo(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;xa.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.pe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.An,onDroppedOversizedMutation:t=>{0===this.me&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.me+=1,this.ge+=t},requestFullSnapshot:()=>this.Bt()});const u=e.selectMaskingFn;this.Yn=u,u&&(e.selectMaskingFn=t=>{try{return u(t)}catch(t){throw this.Re||(this.Re=!0,xa.warn("selectMaskingFn threw; affected selects are recorded as masked.",t)),t}});const c=this.gn(),h=this.le;if(this.ae=l(i(i({emit:(t,e,n)=>{(null==h?void 0:h.cancelled)||(h&&this.le===h&&(this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())?h.cancel():this.onRRwebEmit(t,n))},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ae||(this.Ae=!0,xa.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},e),{},{recordAfter:"DOMContentLoaded"})),!this.ae)return this._e=!0,void xa.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._e=!1,!0===(null==n?void 0:n.captureJsonLd)&&Ei&&(null==Ti?void 0:Ti.MutationObserver)&&!this.Cn&&(this.Cn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let s=ra;const o=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?aa:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ia(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ia(t,e.blockClass,e.blockSelector)||Ia(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=aa,n){if(!t||t.length>ra)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},s=ji(i)?i.map(t=>_a(t,e,r)):_a(i,e,r);if(r.exceeded||qi(s)||ji(s)&&(!s.length||s.some(qi)))return null;const o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(qi(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>s)return void(s=0);n.emit(u)&&(i.set(e,c),s-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!s||!1===r())return;const e=t=>{for(const e of Ra(t))a(e)};for(const n of t)if("childList"===n.type)Ca(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&Ca(t)&&a(t)}else"attributes"===n.type&&Ca(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){s&&!1!==r()&&Ra(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Ei,Ti.MutationObserver,{maskUrl:t=>this.bn(t),attributeFilter:e.attributeFilter,blockClass:e.blockClass,blockSelector:e.blockSelector,isRecordedElement:t=>l.mirror.getId(t)>0,maskAllElementAttributes:e.maskAllElementAttributes,maskAttributeFn:e.maskAttributeFn,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.Sn()},emit:t=>this._n(t)}),this.tt.isCurrentUrlBlocked()&&this.Cn.scan()),this.ce=Date.now(),this.fe=Vi(this.fe)?this.fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:e,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};$i.__PosthogExtensions__=$i.__PosthogExtensions__||{},$i.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:xi,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ds,options:t})},$i.__PosthogExtensions__.rrweb={record:vi,version:"v2",wasMaxDepthReached:()=>ke,resetMaxDepthState(){ke=!1,we=!1},getLastSnapshotCost:()=>Y,getMutationCost:()=>i({},rt),getDeferredStylesheetStats:()=>i({},st),getDiscardedDurationSamples:()=>H,getObserverInitFailures:()=>wn.size?Array.from(wn):void 0,resetSnapshotCostState(){J=0,Q=0,X=0,q=0,H=0,K={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Y=null,tt=null,et=[],nt=0,it=0,rt={slowestBatchMs:0},st={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},$i.__PosthogExtensions__.initSessionRecording=(t,e)=>new el(t,e),$i.__PosthogExtensions__.initSessionRecording.supportsSelectMasking=!0}();
2
2
  //# sourceMappingURL=posthog-recorder.js.map