posthog-js 1.426.3 → 1.427.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js +1 -1
  14. package/dist/customizations.d.ts +4 -1
  15. package/dist/customizations.full.js +1 -1
  16. package/dist/customizations.js +1 -1
  17. package/dist/dead-clicks-autocapture.js +1 -1
  18. package/dist/default-extensions.js +1 -1
  19. package/dist/default-extensions.js.map +1 -1
  20. package/dist/exception-autocapture.js +1 -1
  21. package/dist/exception-autocapture.js.map +1 -1
  22. package/dist/extension-bundles.js +1 -1
  23. package/dist/extension-bundles.js.map +1 -1
  24. package/dist/lazy-recorder.js +1 -1
  25. package/dist/lazy-recorder.js.map +1 -1
  26. package/dist/main.d.ts +4 -1
  27. package/dist/main.js +1 -1
  28. package/dist/main.js.map +1 -1
  29. package/dist/module.d.ts +4 -1
  30. package/dist/module.full.d.ts +4 -1
  31. package/dist/module.full.js +1 -1
  32. package/dist/module.full.js.map +1 -1
  33. package/dist/module.full.no-external.d.ts +4 -1
  34. package/dist/module.full.no-external.js +1 -1
  35. package/dist/module.full.no-external.js.map +1 -1
  36. package/dist/module.js +1 -1
  37. package/dist/module.js.map +1 -1
  38. package/dist/module.mjs +1 -1
  39. package/dist/module.mjs.map +1 -1
  40. package/dist/module.no-external.d.ts +4 -1
  41. package/dist/module.no-external.js +1 -1
  42. package/dist/module.no-external.js.map +1 -1
  43. package/dist/module.slim.js +1 -1
  44. package/dist/module.slim.js.map +1 -1
  45. package/dist/module.slim.no-external.d.ts +4 -1
  46. package/dist/module.slim.no-external.js +1 -1
  47. package/dist/module.slim.no-external.js.map +1 -1
  48. package/dist/posthog-recorder.d.ts +35 -11
  49. package/dist/posthog-recorder.js +1 -1
  50. package/dist/posthog-recorder.js.map +1 -1
  51. package/dist/product-tours.js +1 -1
  52. package/dist/recorder-v2.js +1 -1
  53. package/dist/recorder-v2.js.map +1 -1
  54. package/dist/recorder.d.ts +35 -11
  55. package/dist/recorder.js +1 -1
  56. package/dist/recorder.js.map +1 -1
  57. package/dist/rrweb-plugin-console-record.d.ts +9 -1
  58. package/dist/rrweb-plugin-console-record.js +1 -1
  59. package/dist/rrweb-plugin-console-record.js.map +1 -1
  60. package/dist/rrweb-types.d.ts +9 -1
  61. package/dist/rrweb-types.js +1 -1
  62. package/dist/rrweb-types.js.map +1 -1
  63. package/dist/rrweb.d.ts +35 -10
  64. package/dist/rrweb.js +1 -1
  65. package/dist/rrweb.js.map +1 -1
  66. package/dist/src/posthog-featureflags.d.ts +4 -1
  67. package/dist/surveys-preview.js +1 -1
  68. package/dist/surveys.js +1 -1
  69. package/lib/package.json +1 -1
  70. package/lib/src/posthog-core.js +20 -13
  71. package/lib/src/posthog-core.js.map +1 -1
  72. package/lib/src/posthog-featureflags.d.ts +4 -1
  73. package/lib/src/posthog-featureflags.js +41 -3
  74. package/lib/src/posthog-featureflags.js.map +1 -1
  75. package/package.json +6 -6
package/dist/recorder.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],a=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(s||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),l=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(l||{}),c=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(c||{}),h=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(h||{}),d=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(d||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{});function v(e,t){return-1!==e.indexOf(t)}var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function g(e){if(y[e])return y[e];var t=function(e){var t,r,n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in p?p[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),a=e in m?m[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&o)return y[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u,l=!1;try{document.body.appendChild(s);var c=s.contentWindow;if(!c)return t.prototype;var h=c[e].prototype;return h?(v(u=navigator.userAgent,"AppleWebKit")&&!v(u,"Chrome")&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),l=!0),y[e]=h):r}catch(e){return r}finally{!l&&s.parentNode&&document.body.removeChild(s)}}var w={};function b(e,t,r){var n,i=e+"."+String(r);if(w[i])return w[i].call(t);var a=g(e),o=null==(n=Object.getOwnPropertyDescriptor(a,r))?void 0:n.get;return o?(w[i]=o,o.call(t)):t[r]}var k={};function S(e,t,r){var n=e+"."+String(r);if(k[n])return k[n].bind(t);var i=g(e)[r];return"function"!=typeof i?t[r]:(k[n]=i,i.bind(t))}function M(){return g("MutationObserver").constructor}function I(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i={next:n},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n},__rrweb_layer__:{enumerable:!1,value:i}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},n=e[t],o=r(n);o;){if(o.next===a)return void(o.next=i.next);o=r(n=o.next)}else e[t]=i.next}}catch(e){return()=>{}}}var C={childNodes:e=>b("Node",e,"childNodes"),parentNode:e=>b("Node",e,"parentNode"),parentElement:e=>b("Node",e,"parentElement"),textContent:e=>b("Node",e,"textContent"),contains:(e,t)=>S("Node",e,"contains")(t),getRootNode:e=>S("Node",e,"getRootNode")(),host:e=>e&&"host"in e?b("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?b("Element",e,"shadowRoot"):null,querySelector:(e,t)=>S("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>S("Element",e,"querySelectorAll")(t),mutationObserver:M,patch:I},A=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function x(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var R=0,T=6e4;function O(){R+=1}function F(){return R}function E(e,t){return t!==R||e>T}var L=0,N=0,_=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},z=e=>e&&e>0?e:null;function G(e){(L+=1)>1||(D=A(),j=[],B=0,P=z(e),N=x(),_=R)}function Z(){return 0===L?W||A():(L-=1)>0?D:(D.durationMs=x()-N,D.deferredStylesheetCount=B,U.deferredCount+=B,P=null,E(D.durationMs,_)?D:W=D)}var V=32;function J(e,t,r){var n=e.length;if(r>=V)return n;for(var i=0;e.length>i;i++){var a=e[i];try{var o=a.cssRules;if(o&&o.length)n+=J(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(n+=J(u,t,r+1))}}}catch(e){}}return n}function X(e){if(0!==L){var t=J(e,null,0);D.cssRuleCount+=t,H>0&&(D.nonDeferrableCssRuleCount+=t)}}function Y(e){H+=1;try{return e()}finally{H-=1}}function K(e){L>0&&(D.stylesheetMs+=e)}function Q(e){if(0===L||null===P)return!1;var t=D.cssRuleCount-D.nonDeferrableCssRuleCount;return t>=P||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),J(t,r,0)}catch(e){return 0}}(e)>P}function ee(){U.failedCount+=1}function te(e){e>0&&(U.abandonedCount+=e)}function re(e){return e.nodeType===e.ELEMENT_NODE}function ne(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function ie(e){return"[object ShadowRoot]"==={}.toString.call(e)}function ae(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function oe(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var se=0;function ue(e){var t=0===se,r=t?x():0;se+=1;try{var n=e.rules||e.cssRules;if(!n)return null;X(n);var i=e.href;return!i&&e.ownerNode&&(i=e.ownerNode.baseURI),ae(Array.from(n,(e=>le(e,i))).join(""))}catch(e){return null}finally{se-=1,t&&K(x()-r)}}function le(e,t){var r;if(he(e)){var n;try{n=ue(e.styleSheet)||oe(e)}catch(t){n=e.cssText}try{if(n&&(null==(r=e.styleSheet)?void 0:r.href))return xe(n,e.styleSheet.href)}catch(e){}return n}var i=e.cssText;return de(e)&&e.selectorText.includes(":")&&(i=ce(i)),t?xe(i,t):i}function ce(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function he(e){return"styleSheet"in e}function de(e){return"selectorText"in e}var fe=/^-?[A-Za-z_][\w-]*$/,ve=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function pe(e){var t=[],r=!1,n=null,i=new Map;function a(e){var i=t.pop();if("group"===i.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!i.importRule)return r=!0,void(n=e);o(t[t.length-1],i.importRule,e)}function o(e,t,r){var n;try{var i;try{i=r||oe(t)}catch(e){i=t.cssText}try{i&&(null==(n=t.styleSheet)?void 0:n.href)&&(i=xe(i,t.styleSheet.href))}catch(e){}i&&e.parts.push(i),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&he(r)){var n=i.get(r);return null===n?(e.parts.push(r.cssText),void(e.index+=1)):n?void t.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var n=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(de(e)){if("number"==typeof r.type&&1!==r.type)return null;var n=r.style?r.style.cssText:"";return e.selectorText+" {"+(n?" "+n:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!fe.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var i="";try{i=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?fe.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":ve.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===n)return!1;var i=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:i,index:0,parts:[],prelude:i?xe(n,i):n,fixColons:"sheet"===r.kind&&de(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&de(r)&&r.selectorText.includes(":")&&(a=ce(a)),e.parts.push(e.sheetHref?xe(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;X(r);var n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:n,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],n=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!he(t)||i.has(t))return 0;var n=null;try{n=t.styleSheet}catch(e){return i.set(t,null),0}if(!n||r.some((e=>e.sheet===n)))return 0;try{var a=n.rules||n.cssRules;if(!a)return 0;X(a);var o=n.href;!o&&n.ownerNode&&(o=n.ownerNode.baseURI);var s=Array.from(a);i.set(t,{sheet:n,rules:s,sheetHref:o}),r.push({sheet:n,rules:s,index:0})}catch(e){}};r.length>0;)n()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var i=x(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var c=u.prelude+u.parts.join("")+"}";l=u.fixColons?ce(c):c}else l=ae(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,n=null}finally{K(x()-i)}return r},text:()=>r?n:null,remainingRules(){if(r)return 0;var e=0;for(var n of t)e+=n.rules.length-n.index;return e}}}class me{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),re(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ye(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,i=e.type,a=e.maskInputFn,o=e.value||"",s=i&&ge(i);return(r[n.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function ge(e){return e.toLowerCase()}var we=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 be(e){var t=e.element,r=e.name,n=e.value,i=e.maskAttributeFn,a=e.isGenerated;return n?e.maskAllElementAttributes?void 0!==a&&a&&we.has(ge(r))?n:"*".repeat(n.length):i?i(r,n,t):n:n}var ke="__rrweb_original__";function Se(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ge(t):null}catch(e){return null}}var Me=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ie=/^(?:[a-z+]+:)?\/\//i,Ce=/^www\..*/i,Ae=/^(data:)([^,]*),(.*)/i;function xe(e,t){return(e||"").replace(Me,((e,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return e;if(Ie.test(u)||Ce.test(u))return"url("+l+u+l+")";if(Ae.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),h=u.split("/");for(var d of(c.pop(),h))"."!==d&&(".."===d?c.pop():c.push(d));return"url("+l+c.join("/")+l+")"}))}var Re,Te,Oe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Fe=4096,Ee=1e5,Le=10,Ne=new Map,_e=1,De=new RegExp("[^a-z0-9-_:]"),We=-2;function Pe(){return _e++}var je=/^[^ \t\n\r\u000c]+/,Be=/^[, \t\n\r\u000c]+/,He=new WeakMap;function qe(e,t){return t&&""!==t.trim()?Ue(e,t):t}function Ue(e,t){var r=He.get(e);if(r||(r=e.createElement("a"),He.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ze(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?Oe:e}(e,t.maxBase64ImageLength):e}function Ge(e,t,r,n,i,a){var o;if(!n)return n;if("src"===r||"href"===r&&("use"!==t||"#"!==n[0])){if("link"===t&&i){var s=null==(o=i.sheet)?void 0:o.href;if(s)return s}var u=qe(e,n);if(u.startsWith("data:")){if("img"===t&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,n){if(Ee>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Fe||e.naturalHeight>Fe)return t;var i=Ne.get(t);if(i&&i.type===r&&i.quality===n)return i.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=n?n:.4),u=t.length>s.length?s:t;if(Ne.size>=Le){var l=Ne.keys().next().value;void 0!==l&&Ne.delete(l)}return Ne.set(t,{type:r,quality:n,result:u}),u}catch(e){return t}}(i,u,a.type,a.quality)),ze(l,a)}if("image"===t)return ze(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=qe(e,n);return"image"===t&&c.startsWith("data:")?ze(c,a):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Be),t.length>r;){var a=n(je);if(","===a.slice(-1))a=qe(e,a.substring(0,a.length-1)),i.push(a);else{var o="";a=qe(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?xe(n,Ue(e)):"object"===t&&"data"===r?qe(e,n):n:qe(e,n)}function Ze(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ve(C.parentNode(e),t,r);for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;return!!r&&Ve(C.parentNode(e),t,r)}function $e(e,t,r,n){var i;if(re(e)){if(!C.childNodes(i=e).length)return!1}else{if(null===C.parentElement(e))return!1;i=C.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Ve(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Je(e,t,r){var n=e.removeEventListener;"function"==typeof n&&n.call(e,t,r)}var Xe=new Map;function Ye(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function Ke(e){return null==e?"":e.toLowerCase()}var Qe=50,et=!1,tt=!1;function rt(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,c=t.inlineStylesheet,h=void 0===c||c,d=t.maskInputOptions,v=void 0===d?{}:d,p=t.maskTextFn,m=t.maskInputFn,y=t.maskAllElementAttributes,g=void 0!==y&&y,w=t.maskAttributeFn,b=t.slimDOMOptions,k=t.dataURLOptions,S=void 0===k?{}:k,M=t.inlineImages,I=void 0!==M&&M,A=t.recordCanvas,x=void 0!==A&&A,R=t.canvasMaskingConfigured,T=t.onSerialize,O=t.onIframeLoad,F=t.iframeLoadTimeout,E=void 0===F?5e3:F,N=t.onIframeListenerRegistered,_=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,P=void 0===W?5e3:W,H=t.keepIframeSrcFn,q=void 0===H?()=>!1:H,U=t.newlyAddedElement,z=void 0!==U&&U,G=t.depth,Z=void 0===G?0:G,V=t.maxDepth,J=void 0===V?Qe:V,X=t.needsMask,K=t.preserveWhiteSpace,ee=void 0===K||K;if(Z>=J)return tt=!0,et||(et=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+J+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;X||(X=$e(e,o,s,void 0===X)),L>0&&(D.nodeCount+=1);var te,ae=function(e,t){var r=t.doc,n=t.blockClass,i=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,c=t.maskInputFn,h=t.maskAllElementAttributes,d=void 0!==h&&h,v=t.maskAttributeFn,p=t.dataURLOptions,m=void 0===p?{}:p,y=t.inlineImages,g=t.recordCanvas,w=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,k=t.newlyAddedElement,S=void 0!==k&&k,M=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return function(e,t){for(var r,n,i,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,c=t.maskAllElementAttributes,h=void 0!==c&&c,d=t.maskAttributeFn,v=t.dataURLOptions,p=void 0===v?{}:v,m=t.inlineImages,y=t.recordCanvas,g=t.canvasMaskingConfigured,w=t.keepIframeSrcFn,b=t.newlyAddedElement,k=void 0!==b&&b,S=t.rootId,M=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=ge(e.tagName);return De.test(t)?"div":t}(e),A=new Set,x={},R=e.attributes.length,T=0;R>T;T++){var O=e.attributes[T];Ze(I,O.name)||(x[O.name]=Ge(a,I,ge(O.name),O.value,e,p))}if("link"===I&&o&&!M){var F=e.sheet;if(!F){var E=function(e){return e.href}(e);E&&!(F=Ye(a,E))&&E.includes(".css")&&(F=Ye(a,window.location.origin+"/"+E.replace(window.location.href,"")))}var N=null;F&&(Q(F)?L>0&&(j.push(e),B+=1):N=ue(F)),N&&(delete x.rel,delete x.href,x._cssText=N)}if("style"===I&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var _=Y((()=>ue(e.sheet)));_&&(x._cssText=_)}if("input"===I||"textarea"===I||"select"===I){var D=e.value,W=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=ye({element:e,type:Se(e),tagName:I,value:D,maskInputOptions:u,maskInputFn:l}):W&&(x.checked=W)}if("option"===I&&(e.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===I&&e.open){try{x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}A.add("rr_open_mode")}if("canvas"===I&&y&&!(null==g?void 0:g()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var n=0;e.height>n;n+=50){var i=t.getImageData;if(new Uint32Array((ke in i?i[ke]:i).call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var P=e.toDataURL(p.type,p.quality),H=a.createElement("canvas");H.width=e.width,H.height=e.height,P!==H.toDataURL(p.type,p.quality)&&(x.rr_dataURL=P)}var q,U,z=!1;if("img"===I&&m){Re||(Re=a.createElement("canvas"),Te=Re.getContext("2d"));var G=e,Z=G.currentSrc||G.getAttribute("src")||"<unknown-src>",V=G.crossOrigin,J=(t,r)=>z?be({element:e,name:t,value:r,maskAllElementAttributes:h,maskAttributeFn:d}):r,X=()=>{Je(G,"load",X);try{Re.width=G.naturalWidth,Re.height=G.naturalHeight,Te.drawImage(G,0,0);var e=Re.toDataURL(p.type,p.quality);x.rr_dataURL=J("rr_dataURL",e)}catch(e){if("anonymous"!==G.crossOrigin)return G.crossOrigin="anonymous",void(G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X));console.warn("Cannot inline img src="+Z+"! Error: "+e)}"anonymous"===G.crossOrigin&&(V?x.crossOrigin=J("crossOrigin",V):G.removeAttribute("crossorigin"))};G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X)}if("audio"===I||"video"===I){var K=x;K.rr_mediaState=e.paused?"paused":"played",A.add("rr_mediaState"),K.rr_mediaCurrentTime=e.currentTime,K.rr_mediaPlaybackRate=e.playbackRate,K.rr_mediaMuted=e.muted,K.rr_mediaLoop=e.loop,K.rr_mediaVolume=e.volume}if(k||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop)),M){var ee=e.getBoundingClientRect(),te=ee.width,re=ee.height,ne=ee.left,ie=ee.top,ae=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);x={class:x.class,rr_width:te+"px",rr_height:re+"px",rr_left:Math.floor(ne+((null==(n=a.defaultView)?void 0:n.scrollX)||0))+"px",rr_top:Math.floor(ie+((null==(i=a.defaultView)?void 0:i.scrollY)||0))+"px"},A.add("rr_width"),A.add("rr_height"),A.add("rr_left"),A.add("rr_top"),ae&&(x.rr_position=ae.position||"static",A.add("rr_position"),ae.transform&&"none"!==ae.transform&&(x.rr_transform=ae.transform,A.add("rr_transform")),ae.display&&ae.display.startsWith("inline")&&(x.rr_display=ae.display,A.add("rr_display")))}if("iframe"!==I||w(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src),h||d)for(var oe of Object.entries(x)){var se=oe[0],le=oe[1];"string"!=typeof le&&null!==le||(x[se]=be({element:e,name:se,value:le,maskAllElementAttributes:h,maskAttributeFn:d,isGenerated:A.has(se)}))}z=!0;try{customElements.get(I)&&(q=!0)}catch(e){}return{type:f.Element,tagName:I,attributes:x,childNodes:[],isSVG:(U=e,Boolean("svg"===U.tagName||U.ownerSVGElement)||void 0),needBlock:M,rootId:S,isCustom:q}}(e,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:u,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:m,inlineImages:y,recordCanvas:g,canvasMaskingConfigured:w,keepIframeSrcFn:b,newlyAddedElement:S,rootId:M});case e.TEXT_NODE:return function(e,t){var r,n=t.needsMask,i=t.maskTextFn,a=t.rootId,o=C.parentNode(e),s=o&&o.tagName,u=C.textContent(e),l="STYLE"===s||void 0,c="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(Q(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var h=ue(o.sheet);h&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(h)&&(u=h)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=xe(u,Ue(t.doc))}return c&&(u="SCRIPT_PLACEHOLDER"),!l&&!c&&u&&n&&(u=i?i(u,C.parentElement(e)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:M});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:M};default:return!1}}(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,keepIframeSrcFn:q,newlyAddedElement:z});if(!ae)return console.warn(e,"not serialized"),null;te=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,n;try{n=new URL(e,window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ke(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ke(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ke(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ke(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ke(e.attributes.property).match(/^(og|twitter|fb):/)||Ke(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ke(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ke(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Ke(e.attributes.name))||Ke(e.attributes.property).match(/^article:/)||Ke(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Ke(e.attributes.name)))return!0}}return!1}(ae,b)||!ee&&ae.type===f.Text&&!ae.isStyle&&!ae.textContent.replace(/^\s+|\s+$/gm,"").length?We:Pe();var oe=Object.assign(ae,{id:te});if(n.add(e,oe),te===We)return null;T&&T(e);var se=!l;if(oe.type===f.Element){se=se&&!oe.needBlock,delete oe.needBlock;var le=C.shadowRoot(e);le&&ie(le)&&(oe.isShadowHost=!0)}if((oe.type===f.Document||oe.type===f.Element)&&se){b.headWhitespace&&oe.type===f.Element&&"head"===oe.tagName&&(ee=!1);var ce={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J};if(oe.type===f.Element&&"textarea"===oe.tagName&&void 0!==oe.attributes.value);else for(var he of Array.from(C.childNodes(e))){var de=rt(he,ce);de&&oe.childNodes.push(de)}var fe=null;if(re(e)&&(fe=C.shadowRoot(e)))for(var ve of Array.from(C.childNodes(fe))){var pe=rt(ve,ce);pe&&(ie(fe)&&(pe.isShadow=!0),oe.childNodes.push(pe))}}var me=C.parentNode(e);if(me&&ne(me)&&ie(me)&&(oe.isShadow=!0),oe.type===f.Element&&"iframe"===oe.tagName){var we=function(e,t,r){var n,i=()=>{},a=e.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(e){return i}var o=()=>t();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Je(e,"load",c),e.addEventListener("load",o),t())},c=()=>l();return u=setTimeout(l,r),e.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?Je(e,"load",o):(s=!0,Je(e,"load",c))}}var h,d="about:blank";try{h=a.location.href}catch(e){return i}if(h!==d||e.src===d||""===e.src){var f=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(f),Je(e,"load",o)}}return e.addEventListener("load",o),()=>{Je(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&O){var r=rt(t,{doc:t,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J});r&&O(e,r)}}),E);null==N||N(e,we)}return oe.type===f.Element&&"link"===oe.tagName&&"stylesheet"===oe.attributes.rel&&function(t,u,l){if(!Xe.has(t)){var c;try{c=t.sheet}catch(e){return}if(!c){var d=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(_){var t=rt(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z,maxDepth:J});t&&_(e,t)}})()}finally{Xe.delete(t),d.abort()}}},k=setTimeout(y,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),t.addEventListener("load",y,{signal:d.signal,once:!0}),Xe.set(t,d)}}}(e,0,P),oe}function nt(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class it{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof it))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function at(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>ot(r,e,t,n)}function ot(e,t,r,n){st((()=>{var i=e.removeEventListener;"function"==typeof i&&(void 0!==n?i.call(e,t,r,n):i.call(e,t,r))}))}function st(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var ut="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.",lt={map:{},getId(){return console.error(ut),-1},getNode(){return console.error(ut),null},removeNodeFromMap(){console.error(ut)},has(){return console.error(ut),!1},reset(){console.error(ut)}};function ct(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;0>=l||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,o)}),l))}}function ht(e,t,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>ht(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(lt=new Proxy(lt,{get(e,t,r){return"map"===t&&console.error(ut),Reflect.get(e,t,r)}}));var dt=Date.now;function ft(e){var t,r,n,i,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=C.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(n=C.parentElement(a.body))?void 0:n.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function vt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mt(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function yt(e,t,r,n){if(!e)return!1;var i=mt(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Ve(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function gt(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===We}function wt(e,t){if(ne(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=C.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||wt(n,t))}function bt(e){return Boolean(e.changedTouches)}function kt(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function St(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mt(e){return!!e&&(e instanceof it&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dt=()=>(new Date).getTime());class It{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ct(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function At(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ct(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function xt(e){return"__ln"in e}class Rt{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xt(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&xt(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Tt,Ot=(e,t)=>e+"@"+t;class Ft{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"generatedAttributes",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"canvasMaskingConfigured"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=x(),n=F();try{this.processBufferedMutations()}finally{e=x()-r,t=n,L>0||E(e,null!=t?t:R)||e>q.slowestBatchMs&&(q.slowestBatchMs=e)}}})),o(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Rt,n=e=>{for(var t=e,r=We;r===We;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var a=C.parentNode(i);if(a&&At(i)&&"TEXTAREA"!==a.tagName){var o=ne(a)?this.mirror.getId(Ct(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=rt(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:e=>{kt(e,this.mirror)&&this.iframeManager.addIframe(e),St(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mt(e)&&!yt(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Lt(this.removesSubTreeCache,a)&&!this.movedSet.has(C.parentNode(a))||i(a);for(var o of this.addedSet)Nt(this.droppedSet,o)||Lt(this.removesSubTreeCache,o)?Nt(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(C.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var h=r.tail;h;){var d=h;if(h=h.previous,d){var f=this.mirror.getId(C.parentNode(d.value));if(-1===n(d.value))continue;if(-1!==f){u=d;break}var v=C.parentNode(d.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(v);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.style.length>n.length&&(n+i).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=be({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&this.mutationCb(m)})),o(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),o(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=ye({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Se(e),value:r,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(e=>{var t;if(!gt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=C.textContent(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:$e(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,mt(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n,i=e.target,a=e.attributeName,o=null!==(n=e.attributeNamespace)&&void 0!==n?n:null,s=function(e,t,r){if(!r)return t;var n=e.getAttributeNodeNS(r,t);if(n)return n.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var i=e.lookupPrefix(r);return i?i+":"+t:t}(i,a,o),u=o?i.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=i,c=Se(l);u=ye({element:l,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:c,value:u,maskInputFn:this.maskInputFn})}if(yt(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var h=this.attributeMap.get(e.target),d="IFRAME"===i.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,h)),"type"===s&&"INPUT"===i.tagName&&"password"===(e.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Ze(i.tagName,s)){var f=Ge(this.doc,ge(i.tagName),ge(s),u,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),h.attributes[s]=f,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var v=this.unattachedDoc.createElement("span"),p=i.style;for(var m of(e.oldValue&&(v.style.cssText=e.oldValue),Array.from(p))){var y=p.getPropertyValue(m),g=p.getPropertyPriority(m);y!==v.style.getPropertyValue(m)||g!==v.style.getPropertyPriority(m)?h.styleDiff[m]=""===g?y:[y,g]:h._unchangedStyles[m]=[y,g]}for(var w of Array.from(v.style))""===p.getPropertyValue(w)&&(h.styleDiff[w]=!1)}else if("open"===s&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(e.target);b||this.generatedAttributes.set(e.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(yt(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=ne(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||gt(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Et(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||wt(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ot(r,n)]?Et(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!ne(e.target)||!ie(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),o(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(gt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ot(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yt(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Mt(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Et(e,t){for(var r=[t];r.length;){var n=r.pop();e.delete(n),C.childNodes(n).forEach((e=>r.push(e)))}}function Lt(e,t,r){return 0!==e.size&&function(e,t,r){var n=C.parentNode(t);return!!n&&e.has(n)}(e,t)}function Nt(e,t){if(0===e.size)return!1;for(var r=C.parentNode(t);r;){if(e.has(r))return!0;r=C.parentNode(r)}return!1}var _t=function(e,t){return void 0===t&&(t="rrweb"),Tt?function(){try{return e(...arguments)}catch(e){if(Tt&&!0===Tt(e,t))return;throw e}}:e},Dt=[];function Wt(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Pt(e,t){var r,n=new Ft;n.init(e);try{r=new(M())(_t(n.processMutations.bind(n)));var i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(i.attributeFilter=e.attributeFilter),r.observe(t,i),Dt.push(n),{observer:r,buffer:n}}catch(e){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(e){}throw e}}function jt(e){var t=e.scrollCb,r=e.doc,n=e.mirror,i=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=Wt(e);if(o&&!yt(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var h=ft(r.defaultView);u=h.left,l=h.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(c)!==d&&(s.set(c,d),t({id:c,x:u,y:l}))}},l=[at("scroll",_t(ct(_t((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(at("scrollend",_t(u),r)),()=>l.forEach((e=>e()))}function Bt(e,t){for(var r=Dt.length-1;r>=0;r--){var n=Dt[r];if(n){var i=n.bufferBelongsToIframe(e);!i&&t&&t.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),Dt.splice(r,1))}}}var Ht=["INPUT","TEXTAREA","SELECT"],qt=new WeakMap;function Ut(e){return function e(t,r){if($t("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||$t("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||$t("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||$t("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(i)}return r}(e,[])}function zt(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}var Gt=5e3;function Zt(e,t){var r,n,i,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:C.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),_t((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Vt(e,t){void 0===t&&(t={});var n,i,a=e.doc.defaultView;if(!a)return()=>{};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,c=e.styleDeclarationCb,h=e.canvasMutationCb,d=e.fontCb,f=e.selectionCb,v=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),h(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),f(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t);var o,s,h,f,v,p,m,y,g=[],w=_t((()=>{if(i){i.destroy(),i.reset();var t=Dt.indexOf(i);-1!==t&&Dt.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==n||n.disconnect(),g.forEach((e=>e()))}));try{if(e.recordDOM){var b=Pt(e,e.doc);n=b.observer,i=b.buffer}if(g.push(function(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,i=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=ct(_t((e=>{var r=Date.now()-a;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],a=null})),s),h=_t(ct(_t((e=>{var t=Wt(e),r=bt(e)?e.changedTouches[0]:e,n=r.clientX,o=r.clientY;a||(a=dt()),l.push({x:n,y:o,id:i.getId(t),timeOffset:dt()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),d=[at("mousemove",h,n),at("touchmove",h,n),at("drag",h,n)];return _t((()=>{d.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mouseInteractionCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,h=[],d=null;return Object.keys(l).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=ge(e),u=(e=>n=>{var s=Wt(n);if(!yt(s,a,o,!0)){var u=null,h=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(l[e]===l.MouseDown?h="TouchStart":l[e]===l.MouseUp&&(h="TouchEnd"))}else bt(n)&&(u=c.Touch);null!==u?(d=u,(h.startsWith("Touch")&&u===c.Touch||h.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):l[e]===l.Click&&(u=d,d=null);var f=bt(n)?n.changedTouches[0]:n;if(f){var v=i.getId(s),p=f.clientX,m=f.clientY;_t(t)(r({type:l[h],id:v,x:p,y:m},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(l[e]){case l.MouseDown:case l.MouseUp:s=s.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}h.push(at(s,u,n))})),_t((()=>{h.forEach((e=>e()))}))}(e)),g.push(jt(e)),g.push(function(e,t){var r=e.viewportResizeCb,n=t.win,i=-1,a=-1;return at("resize",_t(ct(_t((()=>{var e=vt(),t=pt();i===e&&a===t||(r({width:Number(t),height:Number(e)}),i=e,a=t)})),200)),n)}(e,{win:a})),g.push(function(e){var t=e.inputCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.ignoreClass,u=e.ignoreSelector,l=e.maskInputOptions,c=e.maskInputFn,h=e.userTriggeredOnInput;function d(e){var t=Wt(e),r=e.isTrusted,i=n.defaultView;if(!t||!i||t instanceof i.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=C.parentElement(t)),t&&d&&Ht.indexOf(d)>=0&&!yt(t,a,o,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var v=t.value,p=!1,m=Se(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(l[d.toLowerCase()]||l[m])&&(v=ye({element:t,maskInputOptions:l,tagName:d,type:m,value:v,maskInputFn:c})),f(t,h?{text:v,isChecked:p,userTriggered:r}:{text:v,isChecked:p});var y=t.name;"radio"===m&&y&&p&&n.querySelectorAll('input[type="radio"][name="'+y+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function f(e,n){var a=qt.get(e);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){qt.set(e,n);var o=i.getId(e);_t(t)(r({},n,{id:o}))}}var v=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>at(e,_t(d),n))),p=n.defaultView;if(!p)return()=>{v.forEach((e=>e()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&v.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>ht(e[0],e[1],{set(){_t(d)({target:this,isTrusted:!1})}},!1,p)))),_t((()=>{v.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,i=e.mirror,a=e.sampling,o=e.doc,s=_t((e=>ct(_t((a=>{var o=Wt(a);if(o&&!yt(o,r,n,!0)){var s=o.currentTime,u=o.volume,l=o.muted,c=o.playbackRate,h=o.loop;t({type:e,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:h})}})),a.media||500))),u=[at("play",s(d.Play),o),at("pause",s(d.Pause),o),at("seeked",s(d.Seeked),o),at("volumechange",s(d.VolumeChange),o),at("ratechange",s(d.RateChange),o)];return _t((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var k=function(e){var t=new Map,r=new Set,n=!0,i=e=>{if(n)try{e()}catch(e){}},a=e=>{var r,n=t.get(e);if(n){for(;null==(r=n[0])?void 0:r.ready;){var a=n.shift();(null==a?void 0:a.emit)&&i(a.emit)}0===n.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var n=t.get(e);n?(n.push({emit:r,ready:!0}),a(e)):i(r)}else i(r)},queuePendingMutation(o,s,u){if(!n)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var c={emit:s,ready:!1};l.push(c);var h,d=!1,f=!1,v=()=>{d||f||(d=!0,void 0!==h&&r.delete(h),c.ready=!0,c.emit=void 0,a(o))};try{h=e.setTimeout(v,Gt),d||f?e.clearTimeout(h):r.add(h)}catch(e){v()}return t=>{!f&&n&&(f=!0,void 0!==h&&(e.clearTimeout(h),r.delete(h)),d?t&&i(u):(c.ready=!0,t||(c.emit=void 0),a(o)))}},reset(){n=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(a);g.push(k.reset),g.push(function(e,t){var r=e.styleSheetRuleCb,n=e.mirror,i=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;i.onCssomSheetMutation(t);var c=zt(t,n,i.styleMirror),h=c.id,d=c.styleId;if(!(h&&-1!==h||d&&-1!==d))return u;var f=o.queuePendingMutation(t,(()=>r({id:h,styleId:d,replace:s})),(()=>{var e=ue(t);null!==e&&r({id:h,styleId:d,replace:e})}));try{l.call(u,(()=>f(!0)),(()=>f(!1)))}catch(e){f(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,replaceSync:s}))),u}),"host")}));var h={};Jt("CSSGroupingRule")?h.CSSGroupingRule=a.CSSGroupingRule:(Jt("CSSMediaRule")&&(h.CSSMediaRule=a.CSSMediaRule),Jt("CSSConditionRule")&&(h.CSSConditionRule=a.CSSConditionRule),Jt("CSSSupportsRule")&&(h.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,removes:[{index:d}]})))}return u}),"host")})})),_t((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=c,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:a,mutationQueue:k})),g.push(Zt(e,e.doc)),g.push(function(e,t){var r=e.styleDeclarationCb,n=e.mirror,i=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:_t(((e,t,o)=>{var u,l=o[0],c=o[1],h=o[2],d=e.apply(t,o);if(i.has(l))return d;var f=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(f);var v=zt(f,n,a.styleMirror),p=v.id,m=v.styleId;if(p&&-1!==p||m&&-1!==m){var y=Ut(t.parentRule);s.queueMutation(f,(()=>r({id:p,styleId:m,set:{property:l,value:c,priority:h},index:y})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:_t(((e,t,o)=>{var u,l=o[0],c=e.apply(t,o);if(i.has(l))return c;var h=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(h);var d=zt(h,n,a.styleMirror),f=d.id,v=d.styleId;if(f&&-1!==f||v&&-1!==v){var p=Ut(t.parentRule);s.queueMutation(h,(()=>r({id:f,styleId:v,remove:{property:l},index:p})))}return c}),"host")}),_t((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:a,mutationQueue:k})),e.collectFonts&&g.push(function(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,r){var n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=I(r.fonts,"add",(function(e){return function(r){return setTimeout(_t((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),_t((()=>{i.forEach((e=>e()))}))}(e))}for(var S of(g.push((s=(o=e).doc,h=o.mirror,f=o.blockClass,v=o.blockSelector,p=o.selectionCb,m=!0,(y=_t((()=>{var e=s.getSelection();if(!(!e||m&&(null==e?void 0:e.isCollapsed))){m=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,n=0;r>n;n++){var i=e.getRangeAt(n),a=i.startContainer,o=i.startOffset,u=i.endContainer,l=i.endOffset;yt(a,f,v,!0)||yt(u,f,v,!0)||t.push({start:h.getId(a),startOffset:o,end:h.getId(u),endOffset:l})}p({ranges:t})}})))(),at("selectionchange",y))),g.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?I(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,n,i])}})):()=>{}}(e)),e.plugins))g.push(S.observer(S.callback,a,S.options))}catch(e){try{w()}catch(e){}throw e}return w}function $t(e){return void 0!==window[e]}function Jt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Xt{constructor(e){o(this,"iframeRemoteIdToLocalIdMap",new WeakMap),o(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){if(0>t)return t;var i=r||this.getRemoteIdToLocalIdMap(e),a=n||this.getLocalIdToRemoteIdMap(e),o=i.get(t);return void 0===o&&(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),n=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n;return"number"!=typeof t||0>t?t:null!==(n=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==n?n:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class Yt{constructor(e){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new Xt(Pe)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var n=this.mirror.getId(e);-1!==n&&this.iframeElementsById.set(n,e)}getIframeElementById(e){var t,r,n;return null!==(t=null!==(r=null==(n=this.attachedIframes.get(e))?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>st(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{ot(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,n=this.trackIframeContent(e,t);if(e.contentDocument){var i=this.attachedDocuments.get(e);i||this.attachedDocuments.set(e,i=new Set),i.add(e.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);st((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}st((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var n of r)if(n.win===t)return;var i=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",i),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:i})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case s.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:s.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case s.Meta:case s.Load:case s.DomContentLoaded:return!1;case s.Plugin:return t;case s.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case s.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(t[i]=Array.isArray(t[i])?e.getIds(r,t[i]):e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var n=r.contentWindow,i=this.attachedWindows.get(r);i&&(i.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(ot(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)&&(ot(n,"message",this.nestedIframeListeners.get(n)),this.nestedIframeListeners.delete(n)),n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{st((()=>this.mirror.removeNodeFromMap(e)))})),st((()=>Bt(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&ot(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{ot(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),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}}class Kt{constructor(e){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var n,i;if(ie(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var a=null!==(n=null==(i=C.host(e))?void 0:i.ownerDocument)&&void 0!==n?n:t,o=Pt(r({},this.bypassOptions,{doc:a,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),s=o.observer,u=o.buffer;this.restoreHandlers.push({doc:a,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var e=Dt.indexOf(u);-1!==e&&Dt.splice(e,1)}}),this.restoreHandlers.push({doc:a,handler:jt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push({doc:a,handler:Zt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:I(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),a=C.shadowRoot(this);return a&&At(this)&&r.addShadowRoot(a,t),i}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var Qt="skip-frame";function er(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,n=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&r>=0&&n>=0}for(var tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nr=0;64>nr;nr++)rr[tr.charCodeAt(nr)]=nr;var ir=new Map,ar=(e,t,r)=>{if(e&&(ur(e,t)||"object"==typeof e)){var n=function(e,t){var r=ir.get(e);return r||ir.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function or(e,t,r,n){if(e instanceof Array)return e.map((e=>or(e,t,r,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var i=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;n>t;t+=3)i+=tr[r[t]>>2],i+=tr[(3&r[t])<<4|r[t+1]>>4],i+=tr[(15&r[t+1])<<2|r[t+2]>>6],i+=tr[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[or(e.buffer,t,r,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(n.type,n.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[or(e.data,t,r,n),e.width,e.height]}:ur(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ar(e,t,r)}:e}var sr=(e,t,r,n)=>e.map((e=>or(e,t,r,n))),ur=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},lr=["webgl","webgl2"];function cr(e){return"nodeType"in e}function hr(e,t,n,i){var a=[];try{if(i){var o=function(e,t,n){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return I(i.prototype,"configure",(function(i){return function(a){var o=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!o||cr(o)&&yt(o,t,n,!0))return i.call(this,a);cr(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(e,t,n);o&&a.push(o)}var s=I(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!yt(this,t,n,!0)&&("__context"in this||(this.__context=a),i&&lr.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...s])}}));a.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}function dr(e,t,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=I(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var h=e.apply(this,l);if(ar(h,a,this),this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)){var d=sr(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return h}}));s.push(l)}catch(a){var c=ht(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var fr,vr,pr,mr='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',yr="undefined"!=typeof self&&self.Blob&&new Blob([mr],{type:"text/javascript;charset=utf-8"});function gr(e){var t;try{if(!(t=yr&&(self.URL||self.webkitURL).createObjectURL(yr)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(mr),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wr{constructor(e){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"resetFrameDedup",null),o(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,n=e.win,i=e.blockClass,a=e.blockSelector,s=e.recordCanvas,u=e.dataURLOptions,l=e.resolutionScale,c=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===r&&this.initCanvasMutationObserver(n,i,a,u),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,n,i,a,{dataURLOptions:u,resolutionScale:l,canvasMasking:c})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.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}initCanvasFPSObserver(e,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s,u="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,l=hr(r,n,i,!0),c=new Map;try{s=new gr}catch(e){return}var d=!1;s.onerror=()=>{var e;d=!0,cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=e=>{var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var r=e.data,n=r.displayWidth,i=r.displayHeight;this.mutationCb({id:t,type:h["2D"],commands:[{property:"clearRect",args:[0,0,n,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,n,i]}],displayWidth:n,displayHeight:i})}};var f,v=1e3/e,p=0,m=e=>{var l,h;d||(p&&v>e-p||(p=e,(l=[],h=e=>{try{e.querySelectorAll("canvas").forEach((e=>{yt(e,n,i,!0)||l.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&h(e.shadowRoot)}))}catch(e){}},h(r.document),l).forEach(function(){var e=t((function*(e){var t,r,n=o.mirror.getId(e);if(!c.get(n)&&0!==e.width&&0!==e.height){c.set(n,!0);try{if(["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);if(null==(t=null==i?void 0:i.isContextLost)?void 0:t.call(i))return void c.set(n,!1);!1===(null==(r=null==i?void 0:i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,h=e.clientHeight||e.height,d=Math.max(1,Math.round(l*u)),f=Math.max(1,Math.round(h*u)),v=function(e,t,r,n,i,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return Qt}if(void 0!==o){if(!Array.isArray(o)||!o.every(er))return Qt;var s=r/i,u=n/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(a.canvasMasking,e,d,f,l,h);if(v===Qt)return void c.set(n,!1);var p=yield createImageBitmap(e,1>u?{resizeWidth:d,resizeHeight:f,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:f});s.postMessage({id:n,bitmap:p,width:d,height:f,displayWidth:l,displayHeight:h,dataURLOptions:a.dataURLOptions,maskRegions:v},[p])}catch(e){c.set(n,!1)}}}));return function(t){return e.apply(this,arguments)}}())),f=requestAnimationFrame(m))};f=requestAnimationFrame(m),this.resetObservers=()=>{var e;l(),cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=hr(e,t,r,!1),a=function(e,t,r,n,i){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=I(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return yt(this.canvas,r,n,!0)||setTimeout((()=>{var r=sr(u,t,this,i);e(this.canvas,{type:h["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(i){var u=ht(t.CanvasRenderingContext2D.prototype,o,{set(t){yt(this.canvas,r,n,!0)||e(this.canvas,{type:h["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n),o=function(e,t,r,n,i){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...dr(t.WebGLRenderingContext.prototype,h.WebGL,e,r,n,t,i)),void 0!==t.WebGL2RenderingContext&&a.push(...dr(t.WebGL2RenderingContext.prototype,h.WebGL2,e,r,n,t,i)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i)));this.mutationCb({id:t,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class br{constructor(e){var t;o(this,"trackedLinkElements",new WeakSet),o(this,"pendingDeferredSheets",new Set),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"styleMirror",new It),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,n=null;try{(n=e.sheet)&&(r=pe(n))}catch(e){}if(!r||!n)return ee(),null;var i=r,a=!1,o={sheet:n,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,c=x(),h=F(),d=!0;try{if(a)return s=!0,ee(),!0;if(!i.advance(r))return d=!1,!1;s=!0;var f=i.text();if(!e.isConnected)return!0;var v=null;try{v=e.sheet}catch(e){}return v!==n?(ee(),!0):f?(this.emitCssTextMutation(e,t,f),!0):(ee(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),E(u=x()-c,null!=(l=h)?l:R)||(U.totalMs+=u,u>U.slowestSliceMs&&(U.slowestSliceMs=u))}},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:be({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=x();try{Y((()=>{try{var t=e.rules||e.cssRules;t&&X(t)}catch(e){}i.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:le(t,e.href),index:r})))})}))}finally{K(x()-o)}}n.styleIds.push(t)};for(var o of e)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Xe.forEach((e=>e.abort())),Xe.clear()}trackStylesheetInLinkElement(e){}}class kr{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Sr=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Mr=document.createElement("iframe");document.body.appendChild(Mr),Array.from=(null==(n=Mr.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Mr)}}catch(e){console.debug("Unable to override Array.from",e)}var Ir=new me,Cr=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ar(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var n=setTimeout(e,250);return{cancel:()=>clearTimeout(n)}}function xr(e){var t;void 0===e&&(e={});var n=e,i=n.emit,a=n.checkoutEveryNms,o=n.checkoutEveryNth,l=n.blockClass,c=void 0===l?"rr-block":l,h=n.blockSelector,d=void 0===h?null:h,f=n.ignoreClass,v=void 0===f?"rr-ignore":f,p=n.ignoreSelector,m=void 0===p?null:p,y=n.maskTextClass,g=void 0===y?"rr-mask":y,w=n.maskTextSelector,b=void 0===w?null:w,k=n.inlineStylesheet,S=void 0===k||k,M=n.inlineStylesheetBudgetRules,I=n.maskAllInputs,A=n.maskInputOptions,x=n.slimDOMOptions,R=n.maskInputFn,T=n.maskTextFn,F=n.maskAllElementAttributes,E=void 0!==F&&F,L=n.maskAttributeFn,N=n.hooks,_=n.packFn,D=n.sampling,W=void 0===D?{}:D,P=n.dataURLOptions,B=void 0===P?{}:P,H=n.canvasResolutionScale,q=n.canvasMasking,U=n.mousemoveWait,z=n.recordDOM,V=void 0===z||z,J=n.recordCanvas,X=void 0!==J&&J,Y=n.recordCrossOriginIframes,K=void 0!==Y&&Y,Q=n.recordAfter,ee=void 0===Q?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":Q,re=n.userTriggeredOnInput,ne=void 0!==re&&re,ie=n.collectFonts,ae=void 0!==ie&&ie,oe=n.inlineImages,se=void 0!==oe&&oe,ue=n.plugins,le=n.keepIframeSrcFn,ce=void 0===le?()=>!1:le,he=n.ignoreCSSAttributes,de=void 0===he?new Set([]):he,fe=n.attributeFilter;Tt=n.errorHandler;var ve=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},B),pe=!K||window.parent===window,ye=!1;if(!pe)try{window.parent.document&&(ye=!1)}catch(e){ye=!0}if(pe&&!i)throw new Error("emit function is required");if(!pe&&!ye)return()=>{};void 0!==U&&void 0===W.mousemove&&(W.mousemove=U),Ir.reset();var ge,we=!0===I?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==A?A:{password:!0},be=nt(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var ke,Se,Me=0,Ie=new Map,Ce=e=>{for(var t of ue||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!ye&&(e=_(e)),e};fr=(e,t)=>{var r,n=e;if(n.timestamp=dt(),!(null==(r=Dt[0])?void 0:r.isFrozen())||n.type===s.FullSnapshot||n.type===s.IncrementalSnapshot&&Cr.has(n.data.source)||Dt.forEach((e=>e.unfreeze())),pe)null==i||i(Ce(n),t);else if(ye){var l={type:"rrweb",event:Ce(n),origin:window.location.origin,isCheckout:t};window.parent.postMessage(l,"*")}if(n.type===s.FullSnapshot)ge=n,Me=0;else if(n.type===s.IncrementalSnapshot){if(n.data.source===u.Mutation&&n.data.isAttachIframe)return;Me++,(o&&Me>=o||a&&n.timestamp-ge.timestamp>a)&&vr(!0)}};var Ae=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,n=new Set;if(e.adds.length>0)for(var i of e.adds){var a=Ir.getNode(i.node.id);a&&"IFRAME"===a.nodeName&&n.add(a)}e.removes.forEach((e=>{var r=e.id;if(!t||!t.has(r)){var i=Oe.getIframeElementById(r);i&&n.has(i)?Oe.forgetIframeId(r):(null==ke||ke(r),Oe.removeIframeById(r))}})),null==Se||Se(),Oe.cleanupDetachedIframes()}fr({type:s.IncrementalSnapshot,data:r({source:u.Mutation},e)})},xe=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Scroll},e)}),Re=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),Te=new br({mutationCb:Ae,adoptedStyleSheetCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)}),maskAllElementAttributes:E,maskAttributeFn:L}),Oe=new Yt({mirror:Ir,mutationCb:Ae,stylesheetManager:Te,recordCrossOriginIframes:K,wrappedEmit:fr});for(var Fe of ue||[])Fe.getMirror&&Fe.getMirror({nodeMirror:Ir,crossOriginIframeMirror:Oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Oe.crossOriginIframeStyleMirror});var Ee=new kr,Le=null==q?void 0:q.configured;pr=new wr({recordCanvas:X,mutationCb:Re,win:window,blockClass:c,blockSelector:d,mirror:Ir,sampling:W.canvas,dataURLOptions:ve,resolutionScale:H,canvasMasking:q});var Ne=new Kt({mutationCb:Ae,scrollCb:xe,bypassOptions:{blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskInputOptions:we,dataURLOptions:ve,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,sampling:W,slimDOMOptions:be,iframeManager:Oe,stylesheetManager:Te,canvasManager:pr,keepIframeSrcFn:ce,processedNodeManager:Ee,attributeFilter:fe},mirror:Ir});vr=function(e){if(void 0===e&&(e=!1),V){G(M);try{fr({type:s.Meta,data:{href:window.location.href,width:pt(),height:vt()}},e),null==t||t.cancel(),t=void 0,Te.reset(),Ne.init(),Dt.forEach((e=>e.lock()));var r,n=null;try{n=function(e,t){var r=t||{},n=r.mirror,i=void 0===n?new me:n,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,c=void 0===l?"rr-mask":l,h=r.maskTextSelector,d=void 0===h?null:h,f=r.inlineStylesheet,v=void 0===f||f,p=r.inlineImages,m=void 0!==p&&p,y=r.recordCanvas,g=void 0!==y&&y,w=r.canvasMaskingConfigured,b=r.maskAllInputs,k=void 0!==b&&b,S=r.maskTextFn,M=r.maskInputFn,I=r.maskAllElementAttributes,C=void 0!==I&&I,A=r.maskAttributeFn,x=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,O=r.onSerialize,F=r.onIframeLoad,E=r.iframeLoadTimeout,L=r.onIframeListenerRegistered,N=r.onStylesheetLoad,_=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,W=void 0===D?()=>!1:D,P=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,H=nt(void 0!==x&&x);G(j);try{return rt(e,{doc:e,mirror:i,blockClass:o,blockSelector:u,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:B,maskTextFn:S,maskInputFn:M,maskAllElementAttributes:C,maskAttributeFn:A,slimDOMOptions:H,dataURLOptions:R,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:E,onIframeListenerRegistered:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:P})}finally{Z()}}(document,{mirror:Ir,blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskAllInputs:we,inlineStylesheetBudgetRules:M,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,slimDOM:be,dataURLOptions:ve,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,onSerialize(e){kt(e,Ir)&&Oe.addIframe(e),St(e,Ir)&&Te.trackLinkElement(e),Mt(e)&&Ne.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){Oe.attachIframe(e,t),Ne.observeAttachShadow(e)},onIframeListenerRegistered(e,t){Oe.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){Te.attachLinkElement(e,t)},keepIframeSrcFn:ce})}finally{a=j,j=[],r=a}if(!n)return console.warn("Failed to snapshot the document");if(fr({type:s.FullSnapshot,data:{node:n,initialOffset:ft(window)}},e),Dt.forEach((e=>e.unlock())),pr.onFullSnapshot(),r.length){var i=function(e,t,r){var n=!1,i=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&st((()=>{o=t.beginDeferredLinkInlining(r,Ir.getId(r))}))},l=()=>{if(o){var e=o,t=!0;st((()=>{t=e.advance(200)})),t&&(o=null)}},c=e=>{if(i=null,!n){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,te(1)}t+=1}while(!n&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));n||(s()?i=Ar(c):r())}};return i=Ar(c),{cancel(){n=!0,null==o||o.discard(),o=null,null==i||i.cancel(),i=null},flush(){if(!n){n=!0,null==i||i.cancel(),i=null;for(var t=0,c=0;s()&&50>t;){o||u();var h=o;if(h)if(Math.floor(h.remainingRules()/200)+1>50-t)h.discard(),o=null,c+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,c+=1}t+=1}}if(s()||c>0){for(var d=c+(null!==o?1:0),f=a;e.length>f;f++)null!==e[f]&&(d+=1);te(d),null==o||o.discard(),o=null}r()}}}}(r,Te,(()=>{t===i&&(t=void 0)}));t=i}K&&Oe.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Te.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))}finally{Z()}var a}};try{var _e=[];for(var De of(_e.push(at("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))_e.push(at(De,O,document));ke=e=>{var t=Ie.get(e);t&&(t.forEach((e=>{st(e);var t=_e.indexOf(e);-1!==t&&_e.splice(t,1)})),Ie.delete(e))},Se=()=>{for(var e of Ie){var t=e[0],r=Ir.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ke||ke(t)}catch(e){null==ke||ke(t)}else null==ke||ke(t)}};var We=e=>{var t;return _t(Vt)({mutationCb:Ae,mousemoveCb:(e,t)=>fr({type:s.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:xe,viewportResizeCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:Re,fontCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:c,ignoreClass:v,ignoreSelector:m,maskTextClass:g,maskTextSelector:b,maskInputOptions:we,inlineStylesheet:S,sampling:W,recordDOM:V,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,userTriggeredOnInput:ne,collectFonts:ae,doc:e,maskInputFn:R,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:L,keepIframeSrcFn:ce,blockSelector:d,slimDOMOptions:be,dataURLOptions:ve,mirror:Ir,iframeManager:Oe,stylesheetManager:Te,shadowDomManager:Ne,processedNodeManager:Ee,canvasManager:pr,ignoreCSSAttributes:de,attributeFilter:fe,plugins:(null==(t=null==ue?void 0:ue.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>fr({type:s.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},N)};Oe.addLoadListener((e=>{try{var t=Ir.getId(e),r=We(e.contentDocument);if("function"==typeof r&&(_e.push(r),-1!==t)){var n=Ie.get(t);n||Ie.set(t,n=new Set),n.add(r)}}catch(e){console.warn(e)}})),Oe.addPageHideListener((e=>{var t=Ir.getId(e);null==ke||ke(t),Bt(e)}));var Pe=-1,je=e=>fr({type:s.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Be=()=>{var e,t,r,n,i=document,a=null!==(e=null!==(t=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==t?t:i.msFullscreenElement)&&void 0!==e?e:null,o=a?Ir.getId(a):-1;o!==Pe&&(-1!==Pe&&je({id:Pe,enter:!1}),Pe=o,-1!==o&&je({id:o,enter:!0}))},He=()=>{vr();var e=We(document);"function"==typeof e&&_e.push(e),_e.push(at("fullscreenchange",Be)),_e.push(at("webkitfullscreenchange",Be)),_e.push(at("mozfullscreenchange",Be)),_e.push(at("MSFullscreenChange",Be)),Sr=!0};return["interactive","complete"].includes(document.readyState)?He():(_e.push(at("DOMContentLoaded",(()=>{fr({type:s.DomContentLoaded,data:{}}),"DOMContentLoaded"===ee&&He()}))),_e.push(at("load",(()=>{fr({type:s.Load,data:{}}),"load"===ee&&He()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,_e.forEach((e=>st(e))),Ee.destroy(),Oe.removeLoadListener(),Oe.destroy(),Ie.clear(),Ne.reset(),Ir.reset(),Sr=!1,Tt=void 0}}catch(e){console.warn(e)}}xr.addCustomEvent=(e,t)=>{if(!Sr)throw new Error("please add custom event after start recording");fr({type:s.Custom,data:{tag:e,payload:t}})},xr.freezePage=()=>{Dt.forEach((e=>e.freeze()))},xr.takeFullSnapshot=e=>{if(!Sr)throw new Error("please take full snapshot after start recording");vr(e)},xr.mirror=Ir;var Rr=Object.defineProperty,Tr=(e,t,r)=>((e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Or{constructor(e){Tr(this,"fileName"),Tr(this,"functionName"),Tr(this,"lineNumber"),Tr(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Fr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Lr=/^(eval@)?(\[native code])?$/,Nr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Er)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Er)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Or({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Lr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Or({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Or({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Fr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Or({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Dr(e){return Array.isArray(e)}function Wr(e){return"object"==typeof e&&null!==e&&!Dr(e)}function Pr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Wr(e[n])&&Pr(e[n],t-1))return!0;return!1}function jr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Wr(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Wr(o)&&Pr(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=Dr(l)?_r(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Br={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 Hr(e,t,r){var n,i=r?Object.assign({},Br,r):Br,a=i.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=Nr.parse(t.error).map((e=>e.toString())),a=[jr(r,i.stringifyOptions)];e({level:"error",trace:n,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[jr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[jr("Uncaught (in promise)",i.stringifyOptions),jr(t.reason,i.stringifyOptions)]);var a=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var h of i.level)u.push(d(n,h));return()=>{u.forEach((e=>e()))};function d(t,r){var n=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],c={next:l},h=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Nr.parse(new Error).map((e=>e.toString())).splice(1),h=("assert"===r?u.slice(1):u).map((e=>jr(e,i.stringifyOptions)));o++,i.lengthThreshold>o?e({level:r,trace:c,payload:h}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[jr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return c.next.apply(this,t)}));return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:c}})),t[a]=h,()=>{if(t[a]!==h)for(var e=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},r=t[a],n=e(r);n;){if(n.next===h)return void(n.next=c.next);n=e(r=n.next)}else t[a]=c.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var qr=e=>({name:"rrweb/console@1",observer:Hr,options:e}),Ur=Object.prototype,zr=Ur.hasOwnProperty,Gr=Ur.toString,Zr=Array.isArray||function(e){return"[object Array]"===Gr.call(e)},Vr=e=>"function"==typeof e,$r=e=>e===Object(e)&&!Zr(e),Jr=e=>void 0===e,Xr=e=>"[object String]"==Gr.call(e),Yr=e=>null===e,Kr=e=>Jr(e)||Yr(e),Qr=e=>"[object Boolean]"===Gr.call(e),en=e=>e instanceof FormData,tn="u">typeof window?window:void 0,rn="u">typeof globalThis?globalThis:tn;null!=rn&&rn.XMLHttpRequest&&new rn.XMLHttpRequest;var nn=e=>"u">typeof Document&&e instanceof Document,an=function(e,t){var r=(void 0===t?{}:t).debugEnabled,n={q(t){if(tn&&(tn.POSTHOG_DEBUG||r)&&!Jr(tn.console)&&tn.console){for(var n=("__rrweb_original__"in tn.console[t]?tn.console[t].__rrweb_original__:tn.console[t]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>an(e+" "+t,r)};return n},on=an("[PostHog.js]").createLogger,sn=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return function(e,t){if(!Kr(e))if(Zr(e))e.forEach(t);else if(en(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)zr.call(e,r)&&t(e[r],r)}(e,(function(e,t){Jr(e)||Jr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)},un=()=>{},ln=e=>{var t;if(Vr(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function cn(e,t,r){try{if(!(t in e))return un;var n={next:e[t]},i=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return Vr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=i,()=>{if(e[t]!==i)for(var r=e[t],a=ln(r);a;){if(a.next===i)return void(a.next=n.next);a=ln(r=a.next)}else e[t]=n.next}}catch(e){return un}}function hn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of t.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var dn=1e6,fn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:dn,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},vn=new WeakSet,pn=on("[Recorder]"),mn=e=>"navigation"===e.entryType,yn=e=>"resource"===e.entryType;function gn(e,t){return!!t&&(Qr(t)||t[e])}function wn(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var bn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function kn(e){var t=e.type,r=e.recordBody,n=e.headers;function i(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!wn(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(i(bn))return!1;if(Qr(r))return!0;if(Zr(r))return i(r);var a=r[t];return Qr(a)?a:i(a)}function Sn(e,t,r,n,i,a){return Mn.apply(this,arguments)}function Mn(){return Mn=t((function*(e,t,r,n,i,a){if(void 0===a&&(a=0),a>10)return pn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(yn(o=e[a])&&o.initiatorType===t&&(Jr(n)||o.startTime>=n)&&(Jr(i)||i>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Sn(e,t,r,n,i,a+1))})),Mn.apply(this,arguments)}function In(e){var t=e.body,r=e.options,n=e.url;if(Kr(t))return null;var i=hn(n,r);if(i.isHostDenied)return i.hostname+" is in deny list";if(Xr(t))return t;if(nn(t))return t.textContent;if(en(t))return sn(t);if($r(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Cn=e=>!Yr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function An(e){var t=e.entry,n=e.method,i=e.status,a=e.networkRequest,o=e.isInitial,s=e.start,u=e.end,l=e.url,c=e.initiatorType;s=t?t.startTime:s,u=t?t.responseEnd:u;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(s||0)),f=[r({},t?t.toJSON():{name:l},{startTime:Jr(s)?void 0:Math.round(s),endTime:Jr(u)?void 0:Math.round(u),timeOrigin:h,timestamp:d,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(Cn(t))for(var v of t.serverTiming||[])f.push({timeOrigin:h,timestamp:d,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var xn=["video/","audio/"];function Rn(e){return $r(e)&&Vr(e.getReader)&&Vr(e.tee)}var Tn=500,On="[SessionReplay] Timeout while trying to read body",Fn="[SessionReplay] Failed to read body";function En(e){return Fn+": "+e}function Ln(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Nn(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(On)),Tn);try{e.clone().text().then((e=>t(e)),(e=>t(En(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Fn)}}))}(e);var r=function(e){var t;return Math.min(dn,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:dn)}(t);return function(e,t){try{var r,n=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>t}catch(e){return!1}}(e,r)?Promise.resolve(Ln(r)):function(e,t){return new Promise((r=>{var n,i=!1;function a(){try{var e;null==(e=n)||e.cancel().catch((()=>{}))}catch(e){}}function o(e){i||(i=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(On)),Tn);try{s=e.clone()}catch(e){return void o(Fn)}var l=s.body;if(Rn(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(e){return void o(Fn)}var c=[],h=0;!function e(){n.read().then((r=>{var n=r.done,s=r.value;if(i)a();else if(n)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),n=0;for(var i of e)r.set(i,n),n+=i.byteLength;return r}(c,h)));else{if(s){if(h+s.byteLength>t)return void o(Ln(t));h+=s.byteLength,c.push(s)}e()}}),(e=>o(En(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(En(e))))}catch(e){o(Fn)}}))}(e,r)}function _n(){return(_n=t((function*(e){var t=e.r,r=e.options,n=hn(e.url,r);return n.isHostDenied?Promise.resolve(n.hostname+" is in deny list"):Nn(t,r)}))).apply(this,arguments)}function Dn(){return(Dn=t((function*(e){var t=e.r,r=e.options,n=function(e){var t,r=e.r,n=e.options,i=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=xn.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=hn(i,n);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return Yr(n)?Nn(t,r):Promise.resolve(n)}))).apply(this,arguments)}var Wn=null;function Pn(e,n,i){if(!("performance"in n))return()=>{};if(Wn)return pn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},fn,i):fn,o=t=>{var n=[],i=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!i){var r=a.maskRequestFn(e);t||(i=!r||(e=>!!e&&vn.has(e))(r)),r&&n.push(r)}})),n.length>0&&e(r({},t,{requests:n}))},s=function(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=gn("request",r.recordHeaders),i=gn("response",r.recordHeaders),a=cn(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var h=this;try{var d,f,v=new Request(s),p={},m={},y=h.setRequestHeader.bind(h);h.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=h.send.bind(h);h.send=e=>(kn({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=In({body:e,options:r,url:s})),d=t.performance.now(),g(e));var w=()=>{h.removeEventListener("readystatechange",b),h.removeEventListener("error",w),h.removeEventListener("abort",w),h.removeEventListener("timeout",w)},b=()=>{if(h.readyState===h.DONE){w(),f=t.performance.now();var n={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),kn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=In({body:h.response,options:r,url:s})),Sn(t,"xmlhttprequest",v.url,d,f).then((t=>{var r=An({entry:t,method:o,status:null==h?void 0:h.status,networkRequest:p,start:d,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};h.addEventListener("readystatechange",b),h.addEventListener("error",w),h.addEventListener("abort",w),h.addEventListener("timeout",w)}catch(e){pn.error("Failed to instrument XHR for network capture",e)}a.call(h,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=gn("request",n.recordHeaders),a=gn("response",n.recordHeaders),o=cn(r,"fetch",(o=>function(){var s=t((function*(t,s){var u,l;try{u=new Request(t,s)}catch(e){return pn.error("Failed to instrument fetch for network capture",e),o(t,s)}var c,h,d={};try{try{var f={};u.headers.forEach(((e,t)=>{f[t]=e})),i&&(d.requestHeaders=f),!Rn(null==s?void 0:s.body)&&kn({type:"request",headers:f,url:t,recordBody:n.recordBody})&&(d.requestBody=yield function(e){return _n.apply(this,arguments)}({r:u,options:n,url:t}))}catch(e){pn.error("Failed to record fetch request for network capture",e)}c=r.performance.now(),l=wn(t)?yield o(u):yield o(t,s),h=r.performance.now();try{var v={};l.headers.forEach(((e,t)=>{v[t]=e})),a&&(d.responseHeaders=v),kn({type:"response",headers:v,url:t,recordBody:n.recordBody})&&(d.responseBody=yield function(e){return Dn.apply(this,arguments)}({r:l,options:n,url:t}))}catch(e){pn.error("Failed to record fetch response for network capture",e)}return l}finally{Sn(r,"fetch",u.url,c,h).then((t=>{var r,n=An({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:c,end:h,url:u.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),Wn=()=>{s(),u(),l(),Wn=null}}var jn=e=>({name:"rrweb/network@1",observer:Pn,options:e}),Bn="undefined"!=typeof globalThis?globalThis:tn;Bn&&"undefined"==typeof self&&(Bn.self=Bn),Bn&&"undefined"==typeof File&&(Bn.File=function(){});var Hn=null!=tn?tn:{};Hn.__PosthogExtensions__=Hn.__PosthogExtensions__||{},Hn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:qr,getRecordNetworkPlugin:jn},Hn.__PosthogExtensions__.rrweb={record:xr,version:"v2",wasMaxDepthReached:()=>tt,resetMaxDepthState(){tt=!1,et=!1},getLastSnapshotCost:()=>W,getMutationCost:()=>r({},q),resetSnapshotCostState(){L=0,N=0,_=0,R=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Hn.rrweb={record:xr,version:"v2"},Hn.rrwebConsoleRecord={getRecordConsolePlugin:qr},Hn.getRecordNetworkPlugin=jn}();
1
+ !function(){"use strict";function t(t,e,r,n,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=e.apply(r,n);function s(e){t(o,i,a,s,u,"next",e)}function u(e){t(o,i,a,s,u,"throw",e)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r.apply(null,arguments)}var n=["type"],i=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}({}),a=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}({}),o=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}({}),s=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),u=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),l=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),c=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function d(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase();var h={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},f={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},v={};function m(t){if(v[t])return v[t];var e=function(t){var e,r,n=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return n&&globalThis[n]?globalThis[n]:void 0}(t)||globalThis[t],r=e.prototype,n=t in h?h[t]:void 0,i=Boolean(n&&n.every((t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))}))),a=t in f?f[t]:void 0,o=Boolean(a&&a.every((t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))})));if(i&&o)return v[t]=e.prototype,e.prototype;var s=document.createElement("iframe");s.style.display="none";var u,l=!1;try{document.body.appendChild(s);var c=s.contentWindow;if(!c)return e.prototype;var m=c[t].prototype;return m?(d(u=navigator.userAgent,"AppleWebKit")&&!d(u,"Chrome")&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",t),l=!0),v[t]=m):r}catch(t){return r}finally{!l&&s.parentNode&&document.body.removeChild(s)}}var p={};function y(t,e,r){var n,i=t+"."+String(r);if(p[i])return p[i].call(e);var a=m(t),o=null===(n=Object.getOwnPropertyDescriptor(a,r))||void 0===n?void 0:n.get;return o?(p[i]=o,o.call(e)):e[r]}var g={};function b(t,e,r){var n=t+"."+String(r);if(g[n])return g[n].bind(e);var i=m(t)[r];return"function"!=typeof i?e[r]:(g[n]=i,i.bind(e))}function w(){return m("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i={next:n},a=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n},__rrweb_layer__:{enumerable:!1,value:i}})),t[e]=a,()=>{if(t[e]!==a)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},n=t[e],o=r(n);o;){if(o.next===a)return void(o.next=i.next);o=r(n=o.next)}else t[e]=i.next}}catch(t){return()=>{}}}var S={childNodes:t=>y("Node",t,"childNodes"),parentNode:t=>y("Node",t,"parentNode"),parentElement:t=>y("Node",t,"parentElement"),textContent:t=>y("Node",t,"textContent"),contains:(t,e)=>b("Node",t,"contains")(e),getRootNode:t=>b("Node",t,"getRootNode")(),host:t=>t&&"host"in t?y("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?y("Element",t,"shadowRoot"):null,querySelector:(t,e)=>b("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>b("Element",t,"querySelectorAll")(e),mutationObserver:w,patch:k},M=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function I(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var C=0;function A(){C+=1}function x(){return C}function R(t,e){return e!==C||t>6e4}var T=0,O=0,E=0,F=M(),L=null,_=null,N=[],D=0,W=0,P={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},B=t=>t&&t>0?t:null;function H(t){(T+=1)>1||(F=M(),N=[],D=0,_=B(t),O=I(),E=C)}function U(){return 0===T?L||M():(T-=1)>0?F:(F.durationMs=I()-O,F.deferredStylesheetCount=D,j.deferredCount+=D,_=null,R(F.durationMs,E)?F:L=F)}var q=32;function z(t,e,r){var n=t.length;if(r>=q)return n;for(var i=0;t.length>i;i++){var a=t[i];try{var o=a.cssRules;if(o&&o.length)n+=z(o,e,r+1);else if(e&&a.styleSheet){var s=a.styleSheet;if(!e.has(s)){e.add(s);var u=s.rules||s.cssRules;u&&(n+=z(u,e,r+1))}}}catch(t){}}return n}function G(t){if(0!==T){var e=z(t,null,0);F.cssRuleCount+=e,W>0&&(F.nonDeferrableCssRuleCount+=e)}}function Z(t){W+=1;try{return t()}finally{W-=1}}function V(t){T>0&&(F.stylesheetMs+=t)}function J(t){if(0===T||null===_)return!1;var e=F.cssRuleCount-F.nonDeferrableCssRuleCount;return e>=_||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),z(e,r,0)}catch(t){return 0}}(t)>_}function X(){j.failedCount+=1}function Y(t){t>0&&(j.abandonedCount+=t)}function K(t){return K="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},K(t)}function Q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==K(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t){return t.nodeType===t.ELEMENT_NODE}function et(t){var e=t&&"host"in t&&"mode"in t&&S.host(t)||null;return Boolean(e&&"shadowRoot"in e&&S.shadowRoot(e)===t)}function rt(t){return"[object ShadowRoot]"==={}.toString.call(t)}function nt(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function it(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var at=0;function ot(t){var e=0===at,r=e?I():0;at+=1;try{var n=t.rules||t.cssRules;if(!n)return null;G(n);var i=t.href;return!i&&t.ownerNode&&(i=t.ownerNode.baseURI),nt(Array.from(n,(t=>st(t,i))).join(""))}catch(t){return null}finally{at-=1,e&&V(I()-r)}}function st(t,e){if(lt(t)){var r;try{r=ot(t.styleSheet)||it(t)}catch(e){r=t.cssText}try{var n;if(r&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return Ct(r,t.styleSheet.href)}catch(t){}return r}var i=t.cssText;return ct(t)&&t.selectorText.includes(":")&&(i=ut(i)),e?Ct(i,e):i}function ut(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function lt(t){return"styleSheet"in t}function ct(t){return"selectorText"in t}var dt=/^-?[A-Za-z_][\w-]*$/,ht=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ft(t){var e=[],r=!1,n=null,i=new Map;function a(t){var i=e.pop();if("group"===i.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void a(null)}var s=e[e.length-1];return s.parts.push(t),void(s.index+=1)}if(!i.importRule)return r=!0,void(n=t);o(e[e.length-1],i.importRule,t)}function o(t,e,r){try{var n;try{n=r||it(e)}catch(t){n=e.cssText}try{var i;n&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(n=Ct(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){a(null)}}function s(t){var r=t.rules[t.index];if("sheet"===t.kind&&lt(r)){var n=i.get(r);return null===n?(t.parts.push(r.cssText),void(t.index+=1)):n?void e.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:r}):void o(t,r,null)}if(!function(t,r){try{var n=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(ct(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!dt.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var n="";try{var i;n=(null===(i=t.constructor)||void 0===i?void 0:i.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?dt.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":ht.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===n)return!1;var i=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:i,index:0,parts:[],prelude:i?Ct(n,i):n,fixColons:"sheet"===r.kind&&ct(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var a=r.cssText;"sheet"===t.kind&&ct(r)&&r.selectorText.includes(":")&&(a=ut(a)),t.parts.push(t.sheetHref?Ct(a,t.sheetHref):a),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;G(r);var n=t.href;!n&&t.ownerNode&&(n=t.ownerNode.baseURI);var a=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:a,sheetHref:n,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],n=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!lt(e)||i.has(e))return 0;var n=null;try{n=e.styleSheet}catch(t){return i.set(e,null),0}if(!n||r.some((t=>t.sheet===n)))return 0;try{var a=n.rules||n.cssRules;if(!a)return 0;G(a);var o=n.href;!o&&n.ownerNode&&(o=n.ownerNode.baseURI);var s=Array.from(a);i.set(e,{sheet:n,rules:s,sheetHref:o}),r.push({sheet:n,rules:s,index:0})}catch(t){}};r.length>0;)n()}(a,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var i=I(),o=t>0?t:1;try{for(;!r&&o>0;){var u=e[e.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(t){a(null)}}else{var l=null;try{if("group"===u.kind){var c=u.prelude+u.parts.join("")+"}";l=u.fixColons?ut(c):c}else l=nt(u.parts.join(""))}catch(t){}a(l)}}}catch(t){r=!0,n=null}finally{V(I()-i)}return r},text:()=>r?n:null,remainingRules(){if(r)return 0;var t=0;for(var n of e)t+=n.rules.length-n.index;return t}}}var vt=class{constructor(){Q(this,"idNodeMap",new Map),Q(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),tt(t)){var r=S.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function mt(t){var e=t.element,r=t.maskInputOptions,n=t.tagName,i=t.type,a=t.maskInputFn,o=t.value||"",s=i&&pt(i);return(r[n.toLowerCase()]||s&&r[s])&&(o=a?a(o,e):"*".repeat(o.length)),o}function pt(t){return t.toLowerCase()}var yt=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function gt(t){var e=t.element,r=t.name,n=t.value,i=t.maskAttributeFn,a=t.isGenerated;return n?t.maskAllElementAttributes?void 0!==a&&a&&yt.has(pt(r))?n:"*".repeat(n.length):i?i(r,n,e):n:n}var bt="__rrweb_original__";function wt(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?pt(e):null}catch(t){return null}}var kt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,St=/^(?:[a-z+]+:)?\/\//i,Mt=/^www\..*/i,It=/^(data:)([^,]*),(.*)/i;function Ct(t,e){return(t||"").replace(kt,((t,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return t;if(St.test(u)||Mt.test(u))return"url("+l+u+l+")";if(It.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=e).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=e.split("/"),d=u.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+l+c.join("/")+l+")"}))}var At,xt,Rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Tt=4096,Ot=1e5,Et=10,Ft=new Map,Lt=1,_t=new RegExp("[^a-z0-9-_:]");function Nt(){return Lt++}var Dt=/^[^ \t\n\r\u000c]+/,Wt=/^[, \t\n\r\u000c]+/,Pt=new WeakMap;function jt(t,e){return e&&""!==e.trim()?Bt(t,e):e}function Bt(t,e){var r=Pt.get(t);if(r||(r=t.createElement("a"),Pt.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Ht(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Rt:t}(t,e.maxBase64ImageLength):t}function Ut(t,e,r,n,i,a){if(!n)return n;if("src"===r||"href"===r&&("use"!==e||"#"!==n[0])){if("link"===e&&i){var o,s=null===(o=i.sheet)||void 0===o?void 0:o.href;if(s)return s}var u=jt(t,n);if(u.startsWith("data:")){if("img"===e&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(t,e,r,n){if(Ot>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Tt||t.naturalHeight>Tt)return e;var i=Ft.get(e);if(i&&i.type===r&&i.quality===n)return i.result;try{var a=document.createElement("canvas");a.width=t.naturalWidth,a.height=t.naturalHeight;var o=a.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var s=a.toDataURL(r||"image/webp",null!=n?n:.4),u=e.length>s.length?s:e;if(Ft.size>=Et){var l=Ft.keys().next().value;void 0!==l&&Ft.delete(l)}return Ft.set(e,{type:r,quality:n,result:u}),u}catch(t){return e}}(i,u,a.type,a.quality)),Ht(l,a)}if("image"===e)return Ht(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=jt(t,n);return"image"===e&&c.startsWith("data:")?Ht(c,a):c}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Wt),e.length>r;){var a=n(Dt);if(","===a.slice(-1))a=jt(t,a.substring(0,a.length-1)),i.push(a);else{var o="";a=jt(t,a);for(var s=!1;;){var u=e.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Ct(n,Bt(t)):"object"===e&&"data"===r?jt(t,n):n:jt(t,n)}function qt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function zt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&zt(S.parentNode(t),e,r);for(var n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!r&&zt(S.parentNode(t),e,r)}function Gt(t,e,r,n){var i;if(tt(t)){if(!S.childNodes(i=t).length)return!1}else{if(null===S.parentElement(t))return!1;i=S.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(zt(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function Zt(t,e,r){var n=t.removeEventListener;"function"==typeof n&&n.call(t,e,r)}var Vt=new Map;function $t(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Jt(t){return null==t?"":t.toLowerCase()}var Xt=!1,Yt=!1;function Kt(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,a=e.blockSelector,o=e.maskTextClass,s=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,d=e.inlineStylesheet,h=void 0===d||d,f=e.maskInputOptions,v=void 0===f?{}:f,m=e.maskTextFn,p=e.maskInputFn,y=e.maskAllElementAttributes,g=void 0!==y&&y,b=e.maskAttributeFn,w=e.slimDOMOptions,k=e.dataURLOptions,M=void 0===k?{}:k,I=e.inlineImages,C=void 0!==I&&I,A=e.recordCanvas,x=void 0!==A&&A,R=e.canvasMaskingConfigured,O=e.onSerialize,E=e.onIframeLoad,L=e.iframeLoadTimeout,_=void 0===L?5e3:L,W=e.onIframeListenerRegistered,P=e.onStylesheetLoad,j=e.stylesheetLoadTimeout,B=void 0===j?5e3:j,H=e.keepIframeSrcFn,U=void 0===H?()=>!1:H,q=e.newlyAddedElement,z=void 0!==q&&q,G=e.depth,V=void 0===G?0:G,X=e.maxDepth,Y=void 0===X?50:X,K=e.needsMask,Q=e.preserveWhiteSpace,nt=void 0===Q||Q;if(V>=Y)return Yt=!0,Xt||(Xt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+Y+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;K||(K=Gt(t,o,s,void 0===K)),T>0&&(F.nodeCount+=1);var it,at=function(t,e){var r=e.doc,n=e.blockClass,i=e.blockSelector,a=e.needsMask,o=e.inlineStylesheet,s=e.maskInputOptions,u=void 0===s?{}:s,l=e.maskTextFn,d=e.maskInputFn,h=e.maskAllElementAttributes,f=void 0!==h&&h,v=e.maskAttributeFn,m=e.dataURLOptions,p=void 0===m?{}:m,y=e.inlineImages,g=e.recordCanvas,b=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,k=e.newlyAddedElement,M=void 0!==k&&k,I=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:c.Document,childNodes:[],compatMode:t.compatMode}:{type:c.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:I};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,n=e.inlineStylesheet,i=e.maskInputOptions,a=void 0===i?{}:i,o=e.maskInputFn,s=e.maskAllElementAttributes,u=void 0!==s&&s,l=e.maskAttributeFn,d=e.dataURLOptions,h=void 0===d?{}:d,f=e.inlineImages,v=e.recordCanvas,m=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,y=e.newlyAddedElement,g=void 0!==y&&y,b=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),k=function(t){if(t instanceof HTMLFormElement)return"form";var e=pt(t.tagName);return _t.test(e)?"div":e}(t),M=new Set,I={},C=t.attributes.length,A=0;C>A;A++){var x=t.attributes[A];qt(k,x.name)||(I[x.name]=Ut(r,k,pt(x.name),x.value,t,h))}if("link"===k&&n&&!w){var R=t.sheet;if(!R){var O=function(t){return t.href}(t);O&&!(R=$t(r,O))&&O.includes(".css")&&(R=$t(r,window.location.origin+"/"+O.replace(window.location.href,"")))}var E=null;R&&(J(R)?T>0&&(N.push(t),D+=1):E=ot(R)),E&&(delete I.rel,delete I.href,I._cssText=E)}if("style"===k&&t.sheet&&!(t.innerText||S.textContent(t)||"").trim().length){var F=Z((()=>ot(t.sheet)));F&&(I._cssText=F)}if("input"===k||"textarea"===k||"select"===k){var L=t.value,_=t.checked;"radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&L?I.value=mt({element:t,type:wt(t),tagName:k,value:L,maskInputOptions:a,maskInputFn:o}):_&&(I.checked=_)}if("option"===k&&(t.selected&&!a.select?I.selected=!0:delete I.selected),"dialog"===k&&t.open){try{I.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){I.rr_open_mode="modal",I.ph_rr_could_not_detect_modal=!0}M.add("rr_open_mode")}if("canvas"===k&&v&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var n=0;t.height>n;n+=50){var i=e.getImageData;if(new Uint32Array((bt in i?i[bt]:i).call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(I.rr_dataURL=t.toDataURL(h.type,h.quality));else if(!("__context"in t)){var W=t.toDataURL(h.type,h.quality),P=r.createElement("canvas");P.width=t.width,P.height=t.height,W!==P.toDataURL(h.type,h.quality)&&(I.rr_dataURL=W)}var j,B,H=!1;if("img"===k&&f){At||(At=r.createElement("canvas"),xt=At.getContext("2d"));var U=t,q=U.currentSrc||U.getAttribute("src")||"<unknown-src>",z=U.crossOrigin,G=(e,r)=>H?gt({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,V=()=>{Zt(U,"load",V);try{At.width=U.naturalWidth,At.height=U.naturalHeight,xt.drawImage(U,0,0);var t=At.toDataURL(h.type,h.quality);I.rr_dataURL=G("rr_dataURL",t)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===U.crossOrigin&&(z?I.crossOrigin=G("crossOrigin",z):U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?V():U.addEventListener("load",V)}if("audio"===k||"video"===k){var X=I;X.rr_mediaState=t.paused?"paused":"played",M.add("rr_mediaState"),X.rr_mediaCurrentTime=t.currentTime,X.rr_mediaPlaybackRate=t.playbackRate,X.rr_mediaMuted=t.muted,X.rr_mediaLoop=t.loop,X.rr_mediaVolume=t.volume}if(g||(t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop)),w){var Y,K,Q,tt=t.getBoundingClientRect(),et=tt.width,rt=tt.height,nt=tt.left,it=tt.top,at=null===(Y=r.defaultView)||void 0===Y?void 0:Y.getComputedStyle(t);I={class:I.class,rr_width:et+"px",rr_height:rt+"px",rr_left:Math.floor(nt+((null===(K=r.defaultView)||void 0===K?void 0:K.scrollX)||0))+"px",rr_top:Math.floor(it+((null===(Q=r.defaultView)||void 0===Q?void 0:Q.scrollY)||0))+"px"},M.add("rr_width"),M.add("rr_height"),M.add("rr_left"),M.add("rr_top"),at&&(I.rr_position=at.position||"static",M.add("rr_position"),at.transform&&"none"!==at.transform&&(I.rr_transform=at.transform,M.add("rr_transform")),at.display&&at.display.startsWith("inline")&&(I.rr_display=at.display,M.add("rr_display")))}if("iframe"!==k||p(I.src)||(t.contentDocument||(I.rr_src=I.src),delete I.src),u||l)for(var st of Object.entries(I)){var ut=st[0],lt=st[1];"string"!=typeof lt&&null!==lt||(I[ut]=gt({element:t,name:ut,value:lt,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:M.has(ut)}))}H=!0;try{customElements.get(k)&&(j=!0)}catch(t){}return{type:c.Element,tagName:k,attributes:I,childNodes:[],isSVG:(B=t,Boolean("svg"===B.tagName||B.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:j}}(t,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:u,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:p,inlineImages:y,recordCanvas:g,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:M,rootId:I});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,n=e.maskTextFn,i=e.rootId,a=S.parentNode(t),o=a&&a.tagName,s=S.textContent(t),u="STYLE"===o||void 0,l="SCRIPT"===o||void 0;if(u&&s){try{var d;if(t.nextSibling||t.previousSibling);else if(J(a.sheet));else if(null===(d=a.sheet)||void 0===d?void 0:d.cssRules){var h=ot(a.sheet);h&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(h)&&(s=h)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}s=Ct(s,Bt(e.doc))}return l&&(s="SCRIPT_PLACEHOLDER"),!u&&!l&&s&&r&&(s=n?n(s,S.parentElement(t)):s.replace(/[\S]/g,"*")),{type:c.Text,textContent:s||"",isStyle:u,rootId:i}}(t,{doc:r,needsMask:a,maskTextFn:l,rootId:I});case t.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:I};case t.COMMENT_NODE:return{type:c.Comment,textContent:S.textContent(t)||"",rootId:I};default:return!1}}(t,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:K,inlineStylesheet:h,maskInputOptions:v,maskTextFn:m,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:b,dataURLOptions:M,inlineImages:C,recordCanvas:x,canvasMaskingConfigured:R,keepIframeSrcFn:U,newlyAddedElement:z});if(!at)return console.warn(t,"not serialized"),null;it=n.hasNode(t)?n.getId(t):function(t,e){if(e.comment&&t.type===c.Comment)return!0;if(t.type===c.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,n;try{n=new URL(t,window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Jt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Jt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Jt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Jt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Jt(t.attributes.property).match(/^(og|twitter|fb):/)||Jt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Jt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Jt(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(Jt(t.attributes.name))||Jt(t.attributes.property).match(/^article:/)||Jt(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(Jt(t.attributes.name)))return!0}}return!1}(at,w)||!nt&&at.type===c.Text&&!at.isStyle&&!at.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Nt();var st=Object.assign(at,{id:it});if(n.add(t,st),-2===it)return null;O&&O(t);var ut=!l;if(st.type===c.Element){ut=ut&&!st.needBlock,delete st.needBlock;var lt=S.shadowRoot(t);lt&&rt(lt)&&(st.isShadowHost=!0)}if((st.type===c.Document||st.type===c.Element)&&ut){w.headWhitespace&&st.type===c.Element&&"head"===st.tagName&&(nt=!1);var ct={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:K,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:h,maskInputOptions:v,maskTextFn:m,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:M,inlineImages:C,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:nt,onSerialize:O,onIframeLoad:E,iframeLoadTimeout:_,onIframeListenerRegistered:W,onStylesheetLoad:P,stylesheetLoadTimeout:B,keepIframeSrcFn:U,depth:V+1,maxDepth:Y};if(st.type===c.Element&&"textarea"===st.tagName&&void 0!==st.attributes.value);else for(var dt of Array.from(S.childNodes(t))){var ht=Kt(dt,ct);ht&&st.childNodes.push(ht)}var ft=null;if(tt(t)&&(ft=S.shadowRoot(t)))for(var vt of Array.from(S.childNodes(ft))){var yt=Kt(vt,ct);yt&&(rt(ft)&&(yt.isShadow=!0),st.childNodes.push(yt))}}var kt=S.parentNode(t);if(kt&&et(kt)&&rt(kt)&&(st.isShadow=!0),st.type===c.Element&&"iframe"===st.tagName){var St=function(t,e,r){var n,i=()=>{},a=t.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(t){return i}var o=()=>e();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Zt(t,"load",c),t.addEventListener("load",o),e())},c=()=>l();return u=setTimeout(l,r),t.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?Zt(t,"load",o):(s=!0,Zt(t,"load",c))}}var d,h="about:blank";try{d=a.location.href}catch(t){return i}if(d!==h||t.src===h||""===t.src){var f=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(f),Zt(t,"load",o)}}return t.addEventListener("load",o),()=>{Zt(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var r=Kt(e,{doc:e,mirror:n,blockClass:i,blockSelector:a,needsMask:K,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:m,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:M,inlineImages:C,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:nt,onSerialize:O,onIframeLoad:E,iframeLoadTimeout:_,onIframeListenerRegistered:W,onStylesheetLoad:P,stylesheetLoadTimeout:B,keepIframeSrcFn:U,depth:V+1,maxDepth:Y});r&&E(t,r)}}),_);null==W||W(t,St)}return st.type===c.Element&&"link"===st.tagName&&"stylesheet"===st.attributes.rel&&function(e,u,l){if(!Vt.has(e)){var c;try{c=e.sheet}catch(t){return}if(!c){var d=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(P){var e=Kt(t,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:K,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:m,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:M,inlineImages:C,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:nt,onSerialize:O,onIframeLoad:E,iframeLoadTimeout:_,onStylesheetLoad:P,stylesheetLoadTimeout:B,keepIframeSrcFn:U,depth:V,maxDepth:Y});e&&P(t,e)}})()}finally{Vt.delete(e),d.abort()}}},k=setTimeout(y,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",y,{signal:d.signal,once:!0}),Vt.set(e,d)}}}(t,0,B),st}function Qt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var te=class t{constructor(){Q(this,"parentElement",null),Q(this,"parentNode",null),Q(this,"ownerDocument",void 0),Q(this,"firstChild",null),Q(this,"lastChild",null),Q(this,"previousSibling",null),Q(this,"nextSibling",null),Q(this,"ELEMENT_NODE",1),Q(this,"TEXT_NODE",3),Q(this,"nodeType",void 0),Q(this,"nodeName",void 0),Q(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function ee(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>re(r,t,e,n)}function re(t,e,r,n){ne((()=>{var i=t.removeEventListener;"function"==typeof i&&(void 0!==n?i.call(t,e,r,n):i.call(t,e,r))}))}function ne(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var ie="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ae={map:{},getId(){return console.error(ie),-1},getNode(){return console.error(ie),null},removeNodeFromMap(){console.error(ie)},has(){return console.error(ie),!1},reset(){console.error(ie)}};function oe(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=e-(u-i),c=this;0>=l||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(c,o)}),l))}}function se(t,e,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(t){return}a.set.call(this,t)}}}),()=>se(t,e,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ae=new Proxy(ae,{get(t,e,r){return"map"===e&&console.error(ie),Reflect.get(t,e,r)}}));var ue=Date.now;function le(t){var e,r,n,i,a=t.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null===(e=S.parentElement(a.body))||void 0===e?void 0:e.scrollLeft)||(null==a||null===(r=a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null===(n=S.parentElement(a.body))||void 0===n?void 0:n.scrollTop)||(null==a||null===(i=a.body)||void 0===i?void 0:i.scrollTop)||0}}function ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function de(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function he(t){return t?t.nodeType===t.ELEMENT_NODE?t:S.parentElement(t):null}function fe(t,e,r,n){if(!t)return!1;var i=he(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(zt(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function ve(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function me(t,e){if(et(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=S.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||me(n,e))}function pe(t){return Boolean(t.changedTouches)}function ye(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ge(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function be(t){return!!t&&(t instanceof te&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(S.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ue=()=>(new Date).getTime());var we=class{constructor(){Q(this,"id",1),Q(this,"styleIDMap",new WeakMap),Q(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function ke(t){var e,r=null;return"getRootNode"in t&&(null===(e=S.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&S.host(S.getRootNode(t))&&(r=S.host(S.getRootNode(t))),r}function Se(t){var e=t.ownerDocument;return!!e&&(S.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=ke(r);)r=e;return r}(t);return S.contains(e,r)}(t))}function Me(t){return"__ln"in t}var Ie,Ce=class{constructor(){Q(this,"length",0),Q(this,"head",null),Q(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Me(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Me(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Ae=(t,e)=>t+"@"+e,xe=class{constructor(){Q(this,"frozen",!1),Q(this,"locked",!1),Q(this,"texts",[]),Q(this,"attributes",[]),Q(this,"attributeMap",new WeakMap),Q(this,"generatedAttributes",new WeakMap),Q(this,"removes",[]),Q(this,"mapRemoves",[]),Q(this,"movedMap",{}),Q(this,"addedSet",new Set),Q(this,"movedSet",new Set),Q(this,"droppedSet",new Set),Q(this,"removesSubTreeCache",new Set),Q(this,"mutationCb",void 0),Q(this,"blockClass",void 0),Q(this,"blockSelector",void 0),Q(this,"maskTextClass",void 0),Q(this,"maskTextSelector",void 0),Q(this,"inlineStylesheet",void 0),Q(this,"maskInputOptions",void 0),Q(this,"maskTextFn",void 0),Q(this,"maskInputFn",void 0),Q(this,"maskAllElementAttributes",void 0),Q(this,"maskAttributeFn",void 0),Q(this,"keepIframeSrcFn",void 0),Q(this,"recordCanvas",void 0),Q(this,"canvasMaskingConfigured",void 0),Q(this,"inlineImages",void 0),Q(this,"slimDOMOptions",void 0),Q(this,"dataURLOptions",void 0),Q(this,"doc",void 0),Q(this,"mirror",void 0),Q(this,"iframeManager",void 0),Q(this,"stylesheetManager",void 0),Q(this,"shadowDomManager",void 0),Q(this,"canvasManager",void 0),Q(this,"processedNodeManager",void 0),Q(this,"unattachedDoc",void 0),Q(this,"canvasManagerReleased",!1),Q(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Q(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,r=I(),n=x();try{this.processBufferedMutations()}finally{t=I()-r,e=n,T>0||R(t,null!=e?e:C)||t>P.slowestBatchMs&&(P.slowestBatchMs=t)}}})),Q(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new Ce,n=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var a=S.parentNode(i);if(a&&Se(i)&&"TEXTAREA"!==a.tagName){var o=et(a)?this.mirror.getId(ke(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=Kt(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ye(t,this.mirror)&&this.iframeManager.addIframe(t),ge(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),be(t)&&!fe(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(S.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:s,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Te(this.removesSubTreeCache,a)&&!this.movedSet.has(S.parentNode(a))||i(a);for(var o of this.addedSet)Oe(this.droppedSet,o)||Te(this.removesSubTreeCache,o)?Oe(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(S.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var f=this.mirror.getId(S.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==f){u=h;break}var v=S.parentNode(h.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=S.host(v);if(-1!==this.mirror.getId(m)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var p={texts:this.texts.map((t=>{var e=t.node,r=S.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+n).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var i of Object.entries(e)){var a,o=i[0],s=i[1];"string"!=typeof s&&null!==s||(e[o]=gt({element:t.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(a=this.generatedAttributes.get(t.node))||void 0===a?void 0:a.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(p.texts.length||p.attributes.length||p.removes.length||p.adds.length)&&this.mutationCb(p)})),Q(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Q(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(S.childNodes(t),(t=>S.textContent(t)||"")).join("");e.attributes.value=mt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:wt(t),value:r,maskInputFn:this.maskInputFn})})),Q(this,"processMutation",(t=>{if(!ve(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=S.textContent(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Gt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,he(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,n=t.target,i=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=function(t,e,r){if(!r)return e;var n=t.getAttributeNodeNS(r,e);if(n)return n.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var i=t.lookupPrefix(r);return i?i+":"+e:e}(n,i,a),s=a?n.getAttributeNS(a,i):t.target.getAttribute(i);if("value"===o){var u=n,l=wt(u);s=mt({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:l,value:s,maskInputFn:this.maskInputFn})}if(fe(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;var c=this.attributeMap.get(t.target),d="IFRAME"===n.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(s)&&n.contentDocument)return;if(c||(this.attributes.push(c={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,c)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!qt(n.tagName,o)){var h,f=Ut(this.doc,pt(n.tagName),pt(o),s,n,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(s)&&(o="rr_src"),c.attributes[o]=f,null===(h=this.generatedAttributes.get(t.target))||void 0===h||h.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var v=this.unattachedDoc.createElement("span"),m=n.style;for(var p of(t.oldValue&&(v.style.cssText=t.oldValue),Array.from(m))){var y=m.getPropertyValue(p),g=m.getPropertyPriority(p);y!==v.style.getPropertyValue(p)||g!==v.style.getPropertyPriority(p)?c.styleDiff[p]=""===g?y:[y,g]:c._unchangedStyles[p]=[y,g]}for(var b of Array.from(v.style))""===m.getPropertyValue(b)&&(c.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){c.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(fe(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),n=et(t.target)?this.mirror.getId(S.host(t.target)):this.mirror.getId(t.target);fe(t.target,this.blockClass,this.blockSelector,!1)||ve(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Re(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||me(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ae(r,n)]?Re(this.movedSet,e):(this.removes.push({parentId:n,id:r,isShadow:!(!et(t.target)||!rt(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var n=r.pop();e.has(n)||(e.add(n),S.childNodes(n).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Q(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(ve(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Ae(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);fe(t,this.blockClass,this.blockSelector,!1)||(S.childNodes(t).forEach((t=>this.genAdds(t))),be(t)&&S.childNodes(S.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}};function Re(t,e){for(var r=[e];r.length;){var n=r.pop();t.delete(n),S.childNodes(n).forEach((t=>r.push(t)))}}function Te(t,e,r){return 0!==t.size&&function(t,e,r){var n=S.parentNode(e);return!!n&&t.has(n)}(t,e)}function Oe(t,e){if(0===t.size)return!1;for(var r=S.parentNode(e);r;){if(t.has(r))return!0;r=S.parentNode(r)}return!1}var Ee=function(t,e){return void 0===e&&(e="rrweb"),Ie?function(){try{return t(...arguments)}catch(t){if(Ie&&!0===Ie(t,e))return;throw t}}:t},Fe=[];function Le(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function _e(t,e){var r,n=new xe;n.init(t);try{r=new(w())(Ee(n.processMutations.bind(n)));var i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(i.attributeFilter=t.attributeFilter),r.observe(e,i),Fe.push(n),{observer:r,buffer:n}}catch(t){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ne(t){var e=t.scrollCb,r=t.doc,n=t.mirror,i=t.blockClass,a=t.blockSelector,o=t.sampling,s=new Map,u=t=>{var o=Le(t);if(o&&!fe(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var d=le(r.defaultView);u=d.left,l=d.top}else u=o.scrollLeft,l=o.scrollTop;var h=u+","+l;s.get(c)!==h&&(s.set(c,h),e({id:c,x:u,y:l}))}},l=[ee("scroll",Ee(oe(Ee((t=>u(t))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(ee("scrollend",Ee(u),r)),()=>l.forEach((t=>t()))}function De(t,e){for(var r=Fe.length-1;r>=0;r--){var n=Fe[r];if(n){var i=n.bufferBelongsToIframe(t);!i&&e&&e.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),Fe.splice(r,1))}}}var We=["INPUT","TEXTAREA","SELECT"],Pe=new WeakMap;function je(t){return function t(e,r){if(ze("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ze("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ze("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ze("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(n),t(e.parentRule,r)}if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(i)}return r}(t,[])}function Be(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}var He=5e3;function Ue(t,e){var r,n,i,a=t.stylesheetManager;i=t.mirror.getId("#document"===e.nodeName?e:S.host(e));var o="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.ShadowRoot,s=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&o&&s?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null===(t=s.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=s.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==i&&-1!==i)try{a.adoptStyleSheets(t,i)}catch(t){}return e}}),Ee((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))):()=>{}}function qe(t,e){void 0===e&&(e={});var n,i,u=t.doc.defaultView;if(!u)return()=>{};!function(t,e){var r=t.mutationCb,n=t.mousemoveCb,i=t.mouseInteractionCb,a=t.scrollCb,o=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,c=t.styleDeclarationCb,d=t.canvasMutationCb,h=t.fontCb,f=t.selectionCb,v=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),a(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),s(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),c(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),f(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),v(...arguments)}}(t,e);var c=[],d=Ee((()=>{if(i){i.destroy(),i.reset();var e=Fe.indexOf(i);-1!==e&&Fe.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==n||n.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var h=_e(t,t.doc);n=h.observer,i=h.buffer}if(c.push(function(t){var e=t.mousemoveCb,r=t.sampling,n=t.doc,i=t.mirror;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,u="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=oe(Ee((t=>{var r=Date.now()-o;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],o=null})),u),d=Ee(oe(Ee((t=>{var e=Le(t),r=pe(t)?t.changedTouches[0]:t,n=r.clientX,s=r.clientY;o||(o=ue()),l.push({x:n,y:s,id:i.getId(e),timeOffset:ue()-o}),c("undefined"!=typeof DragEvent&&t instanceof DragEvent?a.Drag:t instanceof MouseEvent?a.MouseMove:a.TouchMove)})),s,{trailing:!1})),h=[ee("mousemove",d,n),ee("touchmove",d,n),ee("drag",d,n)];return Ee((()=>{h.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,n=t.doc,i=t.mirror,a=t.blockClass,u=t.blockSelector,l=t.sampling;if(!1===l.mouseInteraction)return()=>{};var c=!0===l.mouseInteraction||void 0===l.mouseInteraction?{}:l.mouseInteraction,d=[],h=null;return Object.keys(o).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==c[t])).forEach((t=>{var l=pt(t),c=(t=>n=>{var l=Le(n);if(!fe(l,a,u,!0)){var c=null,d=t;if("pointerType"in n){switch(n.pointerType){case"mouse":c=s.Mouse;break;case"touch":c=s.Touch;break;case"pen":c=s.Pen}c===s.Touch&&(o[t]===o.MouseDown?d="TouchStart":o[t]===o.MouseUp&&(d="TouchEnd"))}else pe(n)&&(c=s.Touch);null!==c?(h=c,(d.startsWith("Touch")&&c===s.Touch||d.startsWith("Mouse")&&c===s.Mouse)&&(c=null)):o[t]===o.Click&&(c=h,h=null);var f=pe(n)?n.changedTouches[0]:n;if(f){var v=i.getId(l),m=f.clientX,p=f.clientY;Ee(e)(r({type:o[d],id:v,x:m,y:p},null!==c&&{pointerType:c}))}}})(t);if(window.PointerEvent)switch(o[t]){case o.MouseDown:case o.MouseUp:l=l.replace("mouse","pointer");break;case o.TouchStart:case o.TouchEnd:return}d.push(ee(l,c,n))})),Ee((()=>{d.forEach((t=>t()))}))}(t)),c.push(Ne(t)),c.push(function(t,e){var r=t.viewportResizeCb,n=e.win,i=-1,a=-1;return ee("resize",Ee(oe(Ee((()=>{var t=ce(),e=de();i===t&&a===e||(r({width:Number(e),height:Number(t)}),i=t,a=e)})),200)),n)}(t,{win:u})),c.push(function(t){var e=t.inputCb,n=t.doc,i=t.mirror,a=t.blockClass,o=t.blockSelector,s=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,c=t.maskInputFn,d=t.userTriggeredOnInput;function h(t){var e=Le(t),r=t.isTrusted,i=n.defaultView;if(!e||!i||e instanceof i.HTMLElement){var h=e&&e.tagName;if(e&&"OPTION"===h&&(e=S.parentElement(e)),e&&h&&We.indexOf(h)>=0&&!fe(e,a,o,!0)&&!(e.classList.contains(s)||u&&e.matches(u))){var v=e.value,m=!1,p=wt(e)||"";"radio"===p||"checkbox"===p?m=e.checked:(l[h.toLowerCase()]||l[p])&&(v=mt({element:e,maskInputOptions:l,tagName:h,type:p,value:v,maskInputFn:c})),f(e,d?{text:v,isChecked:m,userTriggered:r}:{text:v,isChecked:m});var y=e.name;"radio"===p&&y&&m&&n.querySelectorAll('input[type="radio"][name="'+y+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!m,userTriggered:!1}:{text:r,isChecked:!m})}}))}}}function f(t,n){var a=Pe.get(t);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){Pe.set(t,n);var o=i.getId(t);Ee(e)(r({},n,{id:o}))}}var v=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>ee(t,Ee(h),n))),m=n.defaultView;if(!m)return()=>{v.forEach((t=>t()))};var p=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return p&&p.set&&v.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((t=>se(t[0],t[1],{set(){Ee(h)({target:this,isTrusted:!1})}},!1,m)))),Ee((()=>{v.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,n=t.blockSelector,i=t.mirror,a=t.sampling,o=t.doc,s=Ee((t=>oe(Ee((a=>{var o=Le(a);if(o&&!fe(o,r,n,!0)){var s=o.currentTime,u=o.volume,l=o.muted,c=o.playbackRate,d=o.loop;e({type:t,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:d})}})),a.media||500))),u=[ee("play",s(l.Play),o),ee("pause",s(l.Pause),o),ee("seeked",s(l.Seeked),o),ee("volumechange",s(l.VolumeChange),o),ee("ratechange",s(l.RateChange),o)];return Ee((()=>{u.forEach((t=>t()))}))}(t)),t.recordDOM){var f=function(t){var e=new Map,r=new Set,n=!0,i=t=>{if(n)try{t()}catch(t){}},a=t=>{var r,n=e.get(t);if(n){for(;null===(r=n[0])||void 0===r?void 0:r.ready;){var a=n.shift();(null==a?void 0:a.emit)&&i(a.emit)}0===n.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var n=e.get(t);n?(n.push({emit:r,ready:!0}),a(t)):i(r)}else i(r)},queuePendingMutation(o,s,u){if(!n)return()=>{};var l=e.get(o);l||e.set(o,l=[]);var c={emit:s,ready:!1};l.push(c);var d,h=!1,f=!1,v=()=>{h||f||(h=!0,void 0!==d&&r.delete(d),c.ready=!0,c.emit=void 0,a(o))};try{d=t.setTimeout(v,He),h||f?t.clearTimeout(d):r.add(d)}catch(t){v()}return e=>{!f&&n&&(f=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),h?e&&i(u):(c.ready=!0,e||(c.emit=void 0),a(o)))}},reset(){n=!1,r.forEach((e=>t.clearTimeout(e))),r.clear(),e.clear()}}}(u);c.push(f.reset),c.push(function(t,e){var r=t.styleSheetRuleCb,n=t.mirror,i=t.stylesheetManager,a=e.win,o=e.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);i.onCssomSheetMutation(e);var l=Be(e,n,i.styleMirror),c=l.id,d=l.styleId;return(c&&-1!==c||d&&-1!==d)&&o.queueMutation(e,(()=>r({id:c,styleId:d,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);i.onCssomSheetMutation(e);var l=Be(e,n,i.styleMirror),c=l.id,d=l.styleId;return(c&&-1!==c||d&&-1!==d)&&o.queueMutation(e,(()=>r({id:c,styleId:d,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(t){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;i.onCssomSheetMutation(e);var c=Be(e,n,i.styleMirror),d=c.id,h=c.styleId;if(!(d&&-1!==d||h&&-1!==h))return u;var f=o.queuePendingMutation(e,(()=>r({id:d,styleId:h,replace:s})),(()=>{var t=ot(e);null!==t&&r({id:d,styleId:h,replace:t})}));try{l.call(u,(()=>f(!0)),(()=>f(!1)))}catch(t){f(!1)}}catch(t){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);i.onCssomSheetMutation(e);var l=Be(e,n,i.styleMirror),c=l.id,d=l.styleId;return(c&&-1!==c||d&&-1!==d)&&o.queueMutation(e,(()=>r({id:c,styleId:d,replaceSync:s}))),u}),"host")}));var d={};Ge("CSSGroupingRule")?d.CSSGroupingRule=a.CSSGroupingRule:(Ge("CSSMediaRule")&&(d.CSSMediaRule=a.CSSMediaRule),Ge("CSSConditionRule")&&(d.CSSConditionRule=a.CSSConditionRule),Ge("CSSSupportsRule")&&(d.CSSSupportsRule=a.CSSSupportsRule));var h={};return Object.entries(d).forEach((t=>{var e=t[0],a=t[1];h[e]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(h[e].insertRule,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);i.onCssomSheetMutation(e.parentStyleSheet);var l=Be(e.parentStyleSheet,n,i.styleMirror),c=l.id,d=l.styleId;if(e.parentStyleSheet&&(c&&-1!==c||d&&-1!==d)){var h=[...je(e),u];o.queueMutation(e.parentStyleSheet,(()=>r({id:c,styleId:d,adds:[{rule:s,index:h}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(h[e].deleteRule,{apply:Ee(((t,e,a)=>{var s=a[0],u=t.apply(e,a);i.onCssomSheetMutation(e.parentStyleSheet);var l=Be(e.parentStyleSheet,n,i.styleMirror),c=l.id,d=l.styleId;if(e.parentStyleSheet&&(c&&-1!==c||d&&-1!==d)){var h=[...je(e),s];o.queueMutation(e.parentStyleSheet,(()=>r({id:c,styleId:d,removes:[{index:h}]})))}return u}),"host")})})),Ee((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=c,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=h[e].insertRule,r.prototype.deleteRule=h[e].deleteRule}))}))}(t,{win:u,mutationQueue:f})),c.push(Ue(t,t.doc)),c.push(function(t,e){var r=t.styleDeclarationCb,n=t.mirror,i=t.ignoreCSSAttributes,a=t.stylesheetManager,o=e.win,s=e.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Ee(((t,e,o)=>{var u,l=o[0],c=o[1],d=o[2],h=t.apply(e,o);if(i.has(l))return h;var f=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(f);var v=Be(f,n,a.styleMirror),m=v.id,p=v.styleId;if(m&&-1!==m||p&&-1!==p){var y=je(e.parentRule);s.queueMutation(f,(()=>r({id:m,styleId:p,set:{property:l,value:c,priority:d},index:y})))}return h}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ee(((t,e,o)=>{var u,l=o[0],c=t.apply(e,o);if(i.has(l))return c;var d=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;a.onCssomSheetMutation(d);var h=Be(d,n,a.styleMirror),f=h.id,v=h.styleId;if(f&&-1!==f||v&&-1!==v){var m=je(e.parentRule);s.queueMutation(d,(()=>r({id:f,styleId:v,remove:{property:l},index:m})))}return c}),"host")}),Ee((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:u,mutationQueue:f})),t.collectFonts&&c.push(function(t){var e=t.fontCb,r=t.doc,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,r){var n=new o(t,e,r);return a.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var s=k(r.fonts,"add",(function(t){return function(r){return setTimeout(Ee((()=>{var t=a.get(r);t&&(e(t),a.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),Ee((()=>{i.forEach((t=>t()))}))}(t))}for(var v of(c.push(function(t){var e=t.doc,r=t.mirror,n=t.blockClass,i=t.blockSelector,a=t.selectionCb,o=!0,s=Ee((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,l=0;u>l;l++){var c=t.getRangeAt(l),d=c.startContainer,h=c.startOffset,f=c.endContainer,v=c.endOffset;fe(d,n,i,!0)||fe(f,n,i,!0)||s.push({start:r.getId(d),startOffset:h,end:r.getId(f),endOffset:v})}a({ranges:s})}}));return s(),ee("selectionchange",s)}(t)),c.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?k(r.customElements,"define",(function(t){return function(r,n,i){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,n,i])}})):()=>{}}(t)),t.plugins))c.push(v.observer(v.callback,u,v.options))}catch(t){try{d()}catch(t){}throw t}return d}function ze(t){return void 0!==window[t]}function Ge(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Ze=class{constructor(t){Q(this,"generateIdFn",void 0),Q(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Q(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){if(0>e)return e;var i=r||this.getRemoteIdToLocalIdMap(t),a=n||this.getLocalIdToRemoteIdMap(t),o=i.get(e);return void 0===o&&(o=this.generateIdFn(),i.set(e,o),a.set(o,e)),o}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),n=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n;return"number"!=typeof e||0>e?e:null!==(n=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==n?n:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},Ve=class{constructor(t){Q(this,"iframes",new WeakMap),Q(this,"crossOriginIframeMap",new WeakMap),Q(this,"crossOriginIframeMirror",new Ze(Nt)),Q(this,"crossOriginIframeStyleMirror",void 0),Q(this,"crossOriginIframeRootIdMap",new WeakMap),Q(this,"mirror",void 0),Q(this,"mutationCb",void 0),Q(this,"wrappedEmit",void 0),Q(this,"loadListener",void 0),Q(this,"pageHideListener",void 0),Q(this,"stylesheetManager",void 0),Q(this,"recordCrossOriginIframes",void 0),Q(this,"messageHandler",void 0),Q(this,"nestedIframeListeners",new Map),Q(this,"attachedWindows",new WeakMap),Q(this,"attachedDocuments",new WeakMap),Q(this,"attachedIframes",new Map),Q(this,"loadListenerDisposers",new WeakMap),Q(this,"iframeElementsById",new Map),Q(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var n=this.mirror.getId(t);-1!==n&&this.iframeElementsById.set(n,t)}getIframeElementById(t){var e,r,n;return null!==(e=null!==(r=null===(n=this.attachedIframes.get(t))||void 0===n?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>ne(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{re(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,n=this.trackIframeContent(t,e);if(t.contentDocument){var i=this.attachedDocuments.get(t);i||this.attachedDocuments.set(t,i=new Set),i.add(t.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=t.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);ne((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(a)}))}ne((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var n of r)if(n.win===e)return;var 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),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:i})}})),null===(r=this.loadListener)||void 0===r||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case i.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:i.IncrementalSnapshot,data:{source:a.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case i.Meta:case i.Load:case i.DomContentLoaded:return!1;case i.Plugin:return e;case i.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case i.IncrementalSnapshot:switch(e.data.source){case a.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case a.Drag:case a.TouchMove:case a.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case a.ViewportResize:return!1;case a.MediaInteraction:case a.MouseInteraction:case a.Scroll:case a.CanvasMutation:case a.Input:return this.replaceIds(e.data,t,["id"]),e;case a.StyleSheetRule:case a.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case a.Font:return e;case a.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case a.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,r,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(e[i]=Array.isArray(e[i])?t.getIds(r,e[i]):t.getId(r,e[i]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===c.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var n=r.contentWindow,i=this.attachedWindows.get(r);i&&(i.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(re(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)&&(re(n,"message",this.nestedIframeListeners.get(n)),this.nestedIframeListeners.delete(n)),n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((t=>{ne((()=>this.mirror.removeNodeFromMap(t)))})),ne((()=>De(r,a))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&re(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{re(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},$e=class{constructor(t){Q(this,"shadowDoms",new WeakSet),Q(this,"mutationCb",void 0),Q(this,"scrollCb",void 0),Q(this,"bypassOptions",void 0),Q(this,"mirror",void 0),Q(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(rt(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var a=null!==(n=null===(i=S.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,o=_e(r({},this.bypassOptions,{doc:a,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),s=o.observer,u=o.buffer;this.restoreHandlers.push({doc:a,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var t=Fe.indexOf(u);-1!==t&&Fe.splice(t,1)}}),this.restoreHandlers.push({doc:a,handler:Ne(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(S.host(t))),this.restoreHandlers.push({doc:a,handler:Ue({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:k(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),a=S.shadowRoot(this);return a&&Se(this)&&r.addShadowRoot(a,e),i}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},Je="skip-frame";function Xe(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,n=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(n)&&r>=0&&n>=0}for(var Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ke="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qe=0;64>Qe;Qe++)Ke[Ye.charCodeAt(Qe)]=Qe;var tr=function(t){var e,r=new Uint8Array(t),n=r.length,i="";for(e=0;n>e;e+=3)i+=Ye[r[e]>>2],i+=Ye[(3&r[e])<<4|r[e+1]>>4],i+=Ye[(15&r[e+1])<<2|r[e+2]>>6],i+=Ye[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i},er=new Map,rr=(t,e,r)=>{if(t&&(ar(t,e)||"object"==typeof t)){var n=function(t,e){var r=er.get(t);return r||er.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function nr(t,e,r,n){return t instanceof Array?t.map((t=>nr(t,e,r,n))):null===t?t:t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:tr(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[nr(t.buffer,e,r,n),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(n.type,n.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[nr(t.data,e,r,n),t.width,t.height]}:ar(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:rr(t,e,r)}:t}var ir=(t,e,r,n)=>t.map((t=>nr(t,e,r,n))),ar=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},or=["webgl","webgl2"];function sr(t){return"nodeType"in t}function ur(t,e,n,i){var a=[];try{if(i){var o=function(t,e,n){var i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return k(i.prototype,"configure",(function(i){return function(a){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||sr(o)&&fe(o,e,n,!0))return i.call(this,a);sr(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(t,e,n);o&&a.push(o)}var s=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var a=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!fe(this,e,n,!0)&&("__context"in this||(this.__context=a),i&&or.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...s])}}));a.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((t=>t()))}}function lr(t,e,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=k(t,u,(function(t){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var d=t.apply(this,l);if(rr(d,a,this),this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,n,i,!0)){var h=ir(l,a,this,o);r(this.canvas,{type:e,property:u,args:h})}return d}}));s.push(l)}catch(a){var c=se(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!fe(this.canvas,n,i,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var cr='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',dr="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",cr],{type:"text/javascript;charset=utf-8"});function hr(t){var e;try{if(!(e=dr&&(self.URL||self.webkitURL).createObjectURL(dr)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(cr),{name:null==t?void 0:t.name})}}var fr,vr,mr,pr=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){Q(this,"pendingCanvasMutations",new Map),Q(this,"rafStamps",{latestId:0,invokeId:null}),Q(this,"mirror",void 0),Q(this,"mutationCb",void 0),Q(this,"resetObservers",void 0),Q(this,"frozen",!1),Q(this,"locked",!1),Q(this,"rafIdTimestamp",null),Q(this,"rafIdFlush",null),Q(this,"refCount",0),Q(this,"torndown",!1),Q(this,"resetFrameDedup",null),Q(this,"processMutation",((t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,n=t.win,i=t.blockClass,a=t.blockSelector,o=t.recordCanvas,s=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(n,i,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,n,i,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s,l="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,c=ur(r,n,i,!0),d=new Map;try{s=new hr}catch(t){return}var h=!1;s.onerror=()=>{var t;h=!0,cancelAnimationFrame(f),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=t=>{var e=t.data.id;if(d.set(e,!1),"base64"in t.data){var r=t.data,n=r.displayWidth,i=r.displayHeight;this.mutationCb({id:e,type:u["2D"],commands:[{property:"clearRect",args:[0,0,n,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,n,i]}],displayWidth:n,displayHeight:i})}};var f,v=1e3/t,m=0,p=t=>{var u,c;h||(m&&v>t-m||(m=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{fe(t,n,i,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e=o.mirror.getId(t);if(!d.get(e)&&0!==t.width&&0!==t.height){d.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,n,i=t.getContext(t.__context);if(null==i||null===(r=i.isContextLost)||void 0===r?void 0:r.call(i))return void d.set(e,!1);!1===(null==i||null===(n=i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,c=t.clientHeight||t.height,h=Math.max(1,Math.round(u*l)),f=Math.max(1,Math.round(c*l)),v=function(t,e,r,n,i,a){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return Je}if(void 0!==o){if(!Array.isArray(o)||!o.every(Xe))return Je;var s=r/i,u=n/a;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*s),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*s)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(a.canvasMasking,t,h,f,u,c);if("skip-frame"===v)return void d.set(e,!1);var m=yield createImageBitmap(t,1>l?{resizeWidth:h,resizeHeight:f,resizeQuality:"medium"}:{resizeWidth:h,resizeHeight:f});s.postMessage({id:e,bitmap:m,width:h,height:f,displayWidth:u,displayHeight:c,dataURLOptions:a.dataURLOptions,maskRegions:v},[m])}catch(t){d.set(e,!1)}}}));return function(e){return t.apply(this,arguments)}}())),f=requestAnimationFrame(p))};f=requestAnimationFrame(p),this.resetObservers=()=>{var t;c(),cancelAnimationFrame(f),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=ur(t,e,r,!1),a=function(t,e,r,n,i){var a=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=k(e.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];return fe(this.canvas,r,n,!0)||setTimeout((()=>{var r=ir(l,e,this,i);t(this.canvas,{type:u["2D"],property:o,args:r})}),0),a.apply(this,l)}}));a.push(s)}catch(i){var l=se(e.CanvasRenderingContext2D.prototype,o,{set(e){fe(this.canvas,r,n,!0)||t(this.canvas,{type:u["2D"],property:o,args:[e],setter:!0})}});a.push(l)}};for(var l of o)s(l);return()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,n),o=function(t,e,r,n,i){var a=[];return void 0!==e.WebGLRenderingContext&&a.push(...lr(e.WebGLRenderingContext.prototype,u.WebGL,t,r,n,e,i)),void 0!==e.WebGL2RenderingContext&&a.push(...lr(e.WebGL2RenderingContext.prototype,u.WebGL2,t,r,n,e,i)),()=>{a.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,n)));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}},yr=class{constructor(t){var e;Q(this,"trackedLinkElements",new WeakSet),Q(this,"pendingDeferredSheets",new Set),Q(this,"mutationCb",void 0),Q(this,"adoptedStyleSheetCb",void 0),Q(this,"maskAllElementAttributes",void 0),Q(this,"maskAttributeFn",void 0),Q(this,"styleMirror",new we),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,n=null;try{(n=t.sheet)&&(r=ft(n))}catch(t){}if(!r||!n)return X(),null;var i=r,a=!1,o={sheet:n,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,c=I(),d=x(),h=!0;try{if(a)return s=!0,X(),!0;if(!i.advance(r))return h=!1,!1;s=!0;var f=i.text();if(!t.isConnected)return!0;var v=null;try{v=t.sheet}catch(t){}return v!==n?(X(),!0):f?(this.emitCssTextMutation(t,e,f),!0):(X(),!0)}finally{h&&this.pendingDeferredSheets.delete(o),R(u=I()-c,null!=(l=d)?l:C)||(j.totalMs+=u,u>j.slowestSliceMs&&(j.slowestSliceMs=u))}},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:gt({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var n={id:e,styleIds:[]},i=[],a=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var a=r.styleMirror.add(t);e=a;var o=I();try{Z((()=>{try{var e=t.rules||t.cssRules;e&&G(e)}catch(t){}i.push({styleId:a,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:st(e,t.href),index:r})))})}))}finally{V(I()-o)}}n.styleIds.push(e)};for(var o of t)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Vt.forEach((t=>t.abort())),Vt.clear()}trackStylesheetInLinkElement(t){}},gr=class{constructor(){Q(this,"nodeMap",new WeakMap),Q(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},br=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var wr,kr=document.createElement("iframe");document.body.appendChild(kr),Array.from=(null===(wr=kr.contentWindow)||void 0===wr?void 0:wr.Array.from)||Array.from,document.body.removeChild(kr)}}catch(t){console.debug("Unable to override Array.from",t)}var Sr=new vt,Mr=new Set([a.Mutation,a.MediaInteraction,a.StyleSheetRule,a.CanvasMutation,a.Font,a.Log,a.StyleDeclaration,a.AdoptedStyleSheet]);function Ir(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}function Cr(t){var e;void 0===t&&(t={});var n=t,o=n.emit,s=n.checkoutEveryNms,u=n.checkoutEveryNth,l=n.blockClass,c=void 0===l?"rr-block":l,d=n.blockSelector,h=void 0===d?null:d,f=n.ignoreClass,v=void 0===f?"rr-ignore":f,m=n.ignoreSelector,p=void 0===m?null:m,y=n.maskTextClass,g=void 0===y?"rr-mask":y,b=n.maskTextSelector,w=void 0===b?null:b,k=n.inlineStylesheet,M=void 0===k||k,I=n.inlineStylesheetBudgetRules,C=n.maskAllInputs,x=n.maskInputOptions,R=n.slimDOMOptions,T=n.maskInputFn,O=n.maskTextFn,E=n.maskAllElementAttributes,F=void 0!==E&&E,L=n.maskAttributeFn,_=n.hooks,D=n.packFn,W=n.sampling,P=void 0===W?{}:W,j=n.dataURLOptions,B=void 0===j?{}:j,q=n.canvasResolutionScale,z=n.canvasMasking,G=n.mousemoveWait,Z=n.recordDOM,V=void 0===Z||Z,J=n.recordCanvas,X=void 0!==J&&J,K=n.recordCrossOriginIframes,Q=void 0!==K&&K,tt=n.recordAfter,et=void 0===tt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":tt,rt=n.userTriggeredOnInput,nt=void 0!==rt&&rt,it=n.collectFonts,at=void 0!==it&&it,ot=n.inlineImages,st=void 0!==ot&&ot,ut=n.plugins,lt=n.keepIframeSrcFn,ct=void 0===lt?()=>!1:lt,dt=n.ignoreCSSAttributes,ht=void 0===dt?new Set([]):dt,ft=n.attributeFilter;Ie=n.errorHandler;var mt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},B),pt=!Q||window.parent===window,yt=!1;if(!pt)try{window.parent.document&&(yt=!1)}catch(t){yt=!0}if(pt&&!o)throw new Error("emit function is required");if(!pt&&!yt)return()=>{};void 0!==G&&void 0===P.mousemove&&(P.mousemove=G),Sr.reset();var gt,bt=!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==x?x:{password:!0},wt=Qt(void 0!==R&&R);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var kt,St,Mt=0,It=new Map,Ct=t=>{for(var e of ut||[])e.eventProcessor&&(t=e.eventProcessor(t));return D&&!yt&&(t=D(t)),t};fr=(t,e)=>{var r,n=t;if(n.timestamp=ue(),!(null===(r=Fe[0])||void 0===r?void 0:r.isFrozen())||n.type===i.FullSnapshot||n.type===i.IncrementalSnapshot&&Mr.has(n.data.source)||Fe.forEach((t=>t.unfreeze())),pt)null==o||o(Ct(n),e);else if(yt){var l={type:"rrweb",event:Ct(n),origin:window.location.origin,isCheckout:e};window.parent.postMessage(l,"*")}if(n.type===i.FullSnapshot)gt=n,Mt=0;else if(n.type===i.IncrementalSnapshot){if(n.data.source===a.Mutation&&n.data.isAttachIframe)return;Mt++,(u&&Mt>=u||s&&n.timestamp-gt.timestamp>s)&&vr(!0)}};var At=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,n=new Set;if(t.adds.length>0)for(var o of t.adds){var s=Sr.getNode(o.node.id);s&&"IFRAME"===s.nodeName&&n.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var i=Ot.getIframeElementById(r);i&&n.has(i)?Ot.forgetIframeId(r):(null==kt||kt(r),Ot.removeIframeById(r))}})),null==St||St(),Ot.cleanupDetachedIframes()}fr({type:i.IncrementalSnapshot,data:r({source:a.Mutation},t)})},xt=t=>fr({type:i.IncrementalSnapshot,data:r({source:a.Scroll},t)}),Rt=t=>fr({type:i.IncrementalSnapshot,data:r({source:a.CanvasMutation},t)}),Tt=new yr({mutationCb:At,adoptedStyleSheetCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.AdoptedStyleSheet},t)}),maskAllElementAttributes:F,maskAttributeFn:L}),Ot=new Ve({mirror:Sr,mutationCb:At,stylesheetManager:Tt,recordCrossOriginIframes:Q,wrappedEmit:fr});for(var Et of ut||[])Et.getMirror&&Et.getMirror({nodeMirror:Sr,crossOriginIframeMirror:Ot.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ot.crossOriginIframeStyleMirror});var Ft=new gr,Lt=null==z?void 0:z.configured;mr=new pr({recordCanvas:X,mutationCb:Rt,win:window,blockClass:c,blockSelector:h,mirror:Sr,sampling:P.canvas,dataURLOptions:mt,resolutionScale:q,canvasMasking:z});var _t=new $e({mutationCb:At,scrollCb:xt,bypassOptions:{blockClass:c,blockSelector:h,maskTextClass:g,maskTextSelector:w,inlineStylesheet:M,maskInputOptions:bt,dataURLOptions:mt,maskTextFn:O,maskInputFn:T,maskAllElementAttributes:F,maskAttributeFn:L,recordCanvas:X,canvasMaskingConfigured:Lt,inlineImages:st,sampling:P,slimDOMOptions:wt,iframeManager:Ot,stylesheetManager:Tt,canvasManager:mr,keepIframeSrcFn:ct,processedNodeManager:Ft,attributeFilter:ft},mirror:Sr});vr=function(t){if(void 0===t&&(t=!1),V){H(I);try{fr({type:i.Meta,data:{href:window.location.href,width:de(),height:ce()}},t),null==e||e.cancel(),e=void 0,Tt.reset(),_t.init(),Fe.forEach((t=>t.lock()));var r,n=null;try{n=function(t,e){var r=e||{},n=r.mirror,i=void 0===n?new vt:n,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,c=void 0===l?"rr-mask":l,d=r.maskTextSelector,h=void 0===d?null:d,f=r.inlineStylesheet,v=void 0===f||f,m=r.inlineImages,p=void 0!==m&&m,y=r.recordCanvas,g=void 0!==y&&y,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,S=r.maskTextFn,M=r.maskInputFn,I=r.maskAllElementAttributes,C=void 0!==I&&I,A=r.maskAttributeFn,x=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,O=r.onSerialize,E=r.onIframeLoad,F=r.iframeLoadTimeout,L=r.onIframeListenerRegistered,_=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,W=void 0===D?()=>!1:D,P=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,q=Qt(void 0!==x&&x);H(j);try{return Kt(t,{doc:t,mirror:i,blockClass:o,blockSelector:u,maskTextClass:c,maskTextSelector:h,skipChild:!1,inlineStylesheet:v,maskInputOptions:B,maskTextFn:S,maskInputFn:M,maskAllElementAttributes:C,maskAttributeFn:A,slimDOMOptions:q,dataURLOptions:R,inlineImages:p,recordCanvas:g,canvasMaskingConfigured:b,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:E,iframeLoadTimeout:F,onIframeListenerRegistered:L,onStylesheetLoad:_,stylesheetLoadTimeout:N,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:P})}finally{U()}}(document,{mirror:Sr,blockClass:c,blockSelector:h,maskTextClass:g,maskTextSelector:w,inlineStylesheet:M,maskAllInputs:bt,inlineStylesheetBudgetRules:I,maskTextFn:O,maskInputFn:T,maskAllElementAttributes:F,maskAttributeFn:L,slimDOM:wt,dataURLOptions:mt,recordCanvas:X,canvasMaskingConfigured:Lt,inlineImages:st,onSerialize(t){ye(t,Sr)&&Ot.addIframe(t),ge(t,Sr)&&Tt.trackLinkElement(t),be(t)&&_t.addShadowRoot(S.shadowRoot(t),document)},onIframeLoad(t,e){Ot.attachIframe(t,e),_t.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Ot.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Tt.attachLinkElement(t,e)},keepIframeSrcFn:ct})}finally{o=N,N=[],r=o}if(!n)return console.warn("Failed to snapshot the document");if(fr({type:i.FullSnapshot,data:{node:n,initialOffset:le(window)}},t),Fe.forEach((t=>t.unlock())),mr.onFullSnapshot(),r.length){var a=function(t,e,r){var n=!1,i=null,a=0,o=null,s=()=>null!==o||t.length>a,u=()=>{var r=t[a];t[a]=null,a+=1,r&&ne((()=>{o=e.beginDeferredLinkInlining(r,Sr.getId(r))}))},l=()=>{if(o){var t=o,e=!0;ne((()=>{e=t.advance(200)})),e&&(o=null)}},c=t=>{if(i=null,!n){var e=0;do{try{o||u(),l()}catch(t){null==o||o.discard(),o=null,Y(1)}e+=1}while(!n&&s()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));n||(s()?i=Ir(c):r())}};return i=Ir(c),{cancel(){n=!0,null==o||o.discard(),o=null,null==i||i.cancel(),i=null},flush(){if(!n){n=!0,null==i||i.cancel(),i=null;for(var e=0,c=0;s()&&50>e;){o||u();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,c+=1;else{try{l()}catch(t){null==o||o.discard(),o=null,c+=1}e+=1}}if(s()||c>0){for(var h=c+(null!==o?1:0),f=a;t.length>f;f++)null!==t[f]&&(h+=1);Y(h),null==o||o.discard(),o=null}r()}}}}(r,Tt,(()=>{e===a&&(e=void 0)}));e=a}Q&&Ot.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Tt.adoptStyleSheets(document.adoptedStyleSheets,Sr.getId(document))}finally{U()}var o}};try{var Nt=[];for(var Dt of(Nt.push(ee("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Nt.push(ee(Dt,A,document));kt=t=>{var e=It.get(t);e&&(e.forEach((t=>{ne(t);var e=Nt.indexOf(t);-1!==e&&Nt.splice(e,1)})),It.delete(t))},St=()=>{for(var t of It){var e=t[0],r=Sr.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Wt=t=>{var e;return Ee(qe)({mutationCb:At,mousemoveCb:(t,e)=>fr({type:i.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.MouseInteraction},t)}),scrollCb:xt,viewportResizeCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.ViewportResize},t)}),inputCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.Input},t)}),mediaInteractionCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.MediaInteraction},t)}),styleSheetRuleCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.StyleSheetRule},t)}),styleDeclarationCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.StyleDeclaration},t)}),canvasMutationCb:Rt,fontCb:t=>fr({type:i.IncrementalSnapshot,data:r({source:a.Font},t)}),selectionCb(t){fr({type:i.IncrementalSnapshot,data:r({source:a.Selection},t)})},customElementCb(t){fr({type:i.IncrementalSnapshot,data:r({source:a.CustomElement},t)})},blockClass:c,ignoreClass:v,ignoreSelector:p,maskTextClass:g,maskTextSelector:w,maskInputOptions:bt,inlineStylesheet:M,sampling:P,recordDOM:V,recordCanvas:X,canvasMaskingConfigured:Lt,inlineImages:st,userTriggeredOnInput:nt,collectFonts:at,doc:t,maskInputFn:T,maskTextFn:O,maskAllElementAttributes:F,maskAttributeFn:L,keepIframeSrcFn:ct,blockSelector:h,slimDOMOptions:wt,dataURLOptions:mt,mirror:Sr,iframeManager:Ot,stylesheetManager:Tt,shadowDomManager:_t,processedNodeManager:Ft,canvasManager:mr,ignoreCSSAttributes:ht,attributeFilter:ft,plugins:(null==ut||null===(e=ut.filter((t=>t.observer)))||void 0===e?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>fr({type:i.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},_)};Ot.addLoadListener((t=>{try{var e=Sr.getId(t),r=Wt(t.contentDocument);if("function"==typeof r&&(Nt.push(r),-1!==e)){var n=It.get(e);n||It.set(e,n=new Set),n.add(r)}}catch(t){console.warn(t)}})),Ot.addPageHideListener((t=>{var e=Sr.getId(t);null==kt||kt(e),De(t)}));var Pt=-1,jt=t=>fr({type:i.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Bt=()=>{var t,e,r,n,i=document,a=null!==(t=null!==(e=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==e?e:i.msFullscreenElement)&&void 0!==t?t:null,o=a?Sr.getId(a):-1;o!==Pt&&(-1!==Pt&&jt({id:Pt,enter:!1}),Pt=o,-1!==o&&jt({id:o,enter:!0}))},Ht=()=>{vr();var t=Wt(document);"function"==typeof t&&Nt.push(t),Nt.push(ee("fullscreenchange",Bt)),Nt.push(ee("webkitfullscreenchange",Bt)),Nt.push(ee("mozfullscreenchange",Bt)),Nt.push(ee("MSFullscreenChange",Bt)),br=!0};return["interactive","complete"].includes(document.readyState)?Ht():(Nt.push(ee("DOMContentLoaded",(()=>{fr({type:i.DomContentLoaded,data:{}}),"DOMContentLoaded"===et&&Ht()}))),Nt.push(ee("load",(()=>{fr({type:i.Load,data:{}}),"load"===et&&Ht()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Nt.forEach((t=>ne(t))),Ft.destroy(),Ot.removeLoadListener(),Ot.destroy(),It.clear(),_t.reset(),Sr.reset(),br=!1,Ie=void 0}}catch(t){console.warn(t)}}function Ar(t){return Ar="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},Ar(t)}function xr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Ar(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ar(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Cr.addCustomEvent=(t,e)=>{if(!br)throw new Error("please add custom event after start recording");fr({type:i.Custom,data:{tag:t,payload:e}})},Cr.freezePage=()=>{Fe.forEach((t=>t.freeze()))},Cr.takeFullSnapshot=t=>{if(!br)throw new Error("please take full snapshot after start recording");vr(t)},Cr.mirror=Sr,"Mobile".toLowerCase(),"Tablet".toLowerCase();var Rr=class{constructor(t){xr(this,"fileName",void 0),xr(this,"functionName",void 0),xr(this,"lineNumber",void 0),xr(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},Tr=/(^|@)\S+:\d+/,Or=/^\s*at .*(\S+:\d+|\(native\))/m,Er=/^(eval@)?(\[native code])?$/,Fr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Or)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(Or)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop());return new Rr({functionName:n.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Er)}),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 Rr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Rr({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=e.exec(r[i]);o&&n.push(new Rr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=e.exec(r[i]);o&&n.push(new Rr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Rr({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Lr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function _r(t){return Array.isArray(t)}function Nr(t){return"object"==typeof t&&null!==t&&!_r(t)}function Dr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Nr(t[n])&&Dr(t[n],e-1))return!0;return!1}function Wr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Nr(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Nr(o)&&Dr(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var u in e){var l=e[u];s[u]=_r(l)?Lr(l.length?l[0]:null):l}return s}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 Pr={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 jr(t,e,r){var n,i=r?Object.assign({},Pr,r):Pr,a=i.logger;if(!a)return()=>{};n="string"==typeof a?e[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Fr.parse(e.error).map((t=>t.toString())),payload:[Wr(r,i.stringifyOptions)]})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var c=e=>{var r,n;e.reason instanceof Error?n=[Wr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[Wr("Uncaught (in promise)",i.stringifyOptions),Wr(e.reason,i.stringifyOptions)]),t({level:"error",trace:Fr.parse(r).map((t=>t.toString())),payload:n})};e.addEventListener("unhandledrejection",c),u.push((()=>{e.removeEventListener("unhandledrejection",c)}))}for(var d of i.level)u.push(h(n,d));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?function(e,a,u){try{if(!(a in e))return()=>{};var l=e[a],c={next:l},d=(e=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(e.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Fr.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>Wr(t,i.stringifyOptions)));o++,i.lengthThreshold>o?t({level:r,trace:c,payload:d}):o===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Wr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{s=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return c.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:c}})),e[a]=d,()=>{if(e[a]!==d)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[a],n=t(r);n;){if(n.next===d)return void(n.next=c.next);n=t(r=n.next)}else e[a]=c.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Br=t=>({name:"rrweb/console@1",observer:jr,options:t}),Hr=Object.prototype,Ur=Hr.hasOwnProperty,qr=Hr.toString,zr=Array.isArray||function(t){return"[object Array]"===qr.call(t)},Gr=t=>"function"==typeof t,Zr=t=>t===Object(t)&&!zr(t),Vr=t=>void 0===t,$r=t=>"[object String]"==qr.call(t),Jr=t=>null===t,Xr=t=>Vr(t)||Jr(t),Yr=t=>"[object Boolean]"===qr.call(t),Kr=t=>t instanceof FormData,Qr="u">typeof window?window:void 0,tn="u">typeof globalThis?globalThis:Qr;null!=tn&&tn.XMLHttpRequest&&new tn.XMLHttpRequest;var en=t=>"u">typeof Document&&t instanceof Document,rn=function(t,e){var r=(void 0===e?{}:e).debugEnabled,n={q(e){if(Qr&&(Qr.POSTHOG_DEBUG||r)&&!Vr(Qr.console)&&Qr.console){for(var n=("__rrweb_original__"in Qr.console[e]?Qr.console[e].__rrweb_original__:Qr.console[e]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(t,...a)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];console.error(t,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>rn(t+" "+e,r)};return n},nn=rn("[PostHog.js]").createLogger,an=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return function(t,e){if(!Xr(t))if(zr(t))t.forEach(e);else if(Kr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Ur.call(t,r)&&e(t[r],r)}(t,(function(t,e){Vr(t)||Vr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},on=()=>{},sn=t=>{var e;if(Gr(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function un(t,e,r){try{if(!(e in t))return on;var n={next:t[e]},i=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return Gr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),t[e]=i,()=>{if(t[e]!==i)for(var r=t[e],a=sn(r);a;){if(a.next===i)return void(a.next=n.next);a=sn(r=a.next)}else t[e]=n.next}}catch(t){return on}}function ln(t,e){var r,n=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of e.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var cn=1e6,dn={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:cn,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},hn=new WeakSet,fn=nn("[Recorder]"),vn=t=>"navigation"===t.entryType,mn=t=>"resource"===t.entryType;function pn(t,e){return!!e&&(Yr(e)||e[t])}function yn(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var gn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function bn(t){var e=t.type,r=t.recordBody,n=t.headers;function i(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!yn(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(i(gn))return!1;if(Yr(r))return!0;if(zr(r))return i(r);var a=r[e];return Yr(a)?a:i(a)}function wn(t,e,r,n,i,a){return kn.apply(this,arguments)}function kn(){return kn=e((function*(t,e,r,n,i,a){if(void 0===a&&(a=0),a>10)return fn.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var a=t.length-1;a>=0;a-=1)if(mn(o=t[a])&&o.initiatorType===e&&(Vr(n)||o.startTime>=n)&&(Vr(i)||i>=o.startTime))return t[a];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*a))),wn(t,e,r,n,i,a+1))})),kn.apply(this,arguments)}function Sn(t){var e=t.body,r=t.options,n=t.url;if(Xr(e))return null;var i=ln(n,r);if(i.isHostDenied)return i.hostname+" is in deny list";if($r(e))return e;if(en(e))return e.textContent;if(Kr(e))return an(e);if(Zr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Mn=t=>!Jr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function In(t){var e=t.entry,n=t.method,i=t.status,a=t.networkRequest,o=t.isInitial,s=t.start,u=t.end,l=t.url,c=t.initiatorType;s=e?e.startTime:s,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(s||0)),f=[r({},e?e.toJSON():{name:l},{startTime:Vr(s)?void 0:Math.round(s),endTime:Vr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:h,method:n,initiatorType:c||(e?e.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(Mn(e))for(var v of e.serverTiming||[])f.push({timeOrigin:d,timestamp:h,startTime:Math.round(e.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var Cn=["video/","audio/"];function An(t){return Zr(t)&&Gr(t.getReader)&&Gr(t.tee)}var xn=500,Rn="[SessionReplay] Timeout while trying to read body",Tn="[SessionReplay] Failed to read body";function On(t){return Tn+": "+t}function En(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Fn(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Rn)),xn);try{t.clone().text().then((t=>e(t)),(t=>e(On(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Tn)}}))}(t);var r=function(t){var e;return Math.min(cn,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:cn)}(e);return function(t,e){try{var r,n=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>e}catch(t){return!1}}(t,r)?Promise.resolve(En(r)):function(t,e){return new Promise((r=>{var n,i=!1;function a(){try{var t;null==(t=n)||t.cancel().catch((()=>{}))}catch(t){}}function o(t){i||(i=!0,clearTimeout(u),a(),r(t))}var s,u=setTimeout((()=>o(Rn)),xn);try{s=t.clone()}catch(t){return void o(Tn)}var l=s.body;if(An(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(t){return void o(Tn)}var c=[],d=0;!function t(){n.read().then((r=>{var n=r.done,s=r.value;if(i)a();else if(n)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),n=0;for(var i of t)r.set(i,n),n+=i.byteLength;return r}(c,d)));else{if(s){if(d+s.byteLength>e)return void o(En(e));d+=s.byteLength,c.push(s)}t()}}),(t=>o(On(t))))}()}else try{s.text().then((t=>o(t)),(t=>o(On(t))))}catch(t){o(Tn)}}))}(t,r)}function Ln(){return(Ln=e((function*(t){var e=t.r,r=t.options,n=ln(t.url,r);return n.isHostDenied?Promise.resolve(n.hostname+" is in deny list"):Fn(e,r)}))).apply(this,arguments)}function _n(){return(_n=e((function*(t){var e=t.r,r=t.options,n=function(t){var e,r=t.r,n=t.options,i=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Cn.some((t=>null==a?void 0:a.startsWith(t)));if(a&&o)return"Content-Type "+a+" is not supported";var s=ln(i,n);return s.isHostDenied?s.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Jr(n)?Fn(e,r):Promise.resolve(n)}))).apply(this,arguments)}var Nn=null;function Dn(t,n,i){if(!("performance"in n))return()=>{};if(Nn)return fn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},dn,i):dn,o=e=>{var n=[],i=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!i){var r=a.maskRequestFn(t);e||(i=!r||(t=>!!t&&hn.has(t))(r)),r&&n.push(r)}})),n.length>0&&t(r({},e,{requests:n}))},s=function(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>vn(t)||mn(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>In({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>vn(t)||mn(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>In({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=pn("request",r.recordHeaders),i=pn("response",r.recordHeaders),a=un(e.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var d=this;try{var h,f,v=new Request(s),m={},p={},y=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(p[t]=e,y(t,e)),n&&(m.requestHeaders=p);var g=d.send.bind(d);d.send=t=>(bn({type:"request",headers:p,url:s,recordBody:r.recordBody})&&(m.requestBody=Sn({body:t,options:r,url:s})),h=e.performance.now(),g(t));var b=()=>{d.removeEventListener("readystatechange",w),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},w=()=>{if(d.readyState===d.DONE){b(),f=e.performance.now();var n={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),bn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(m.responseBody=Sn({body:d.response,options:r,url:s})),wn(e,"xmlhttprequest",v.url,h,f).then((e=>{var r=In({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:m,start:h,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",w),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){fn.error("Failed to instrument XHR for network capture",t)}a.call(d,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(t,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=pn("request",n.recordHeaders),a=pn("response",n.recordHeaders),o=un(r,"fetch",(o=>function(){var s=e((function*(e,s){var u,l;try{u=new Request(e,s)}catch(t){return fn.error("Failed to instrument fetch for network capture",t),o(e,s)}var c,d,h={};try{try{var f={};u.headers.forEach(((t,e)=>{f[e]=t})),i&&(h.requestHeaders=f),!An(null==s?void 0:s.body)&&bn({type:"request",headers:f,url:e,recordBody:n.recordBody})&&(h.requestBody=yield function(t){return Ln.apply(this,arguments)}({r:u,options:n,url:e}))}catch(t){fn.error("Failed to record fetch request for network capture",t)}c=r.performance.now(),l=yn(e)?yield o(u):yield o(e,s),d=r.performance.now();try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),a&&(h.responseHeaders=v),bn({type:"response",headers:v,url:e,recordBody:n.recordBody})&&(h.responseBody=yield function(t){return _n.apply(this,arguments)}({r:l,options:n,url:e}))}catch(t){fn.error("Failed to record fetch response for network capture",t)}return l}finally{wn(r,"fetch",u.url,c,d).then((e=>{var r,n=In({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:h,start:c,end:d,url:u.url,initiatorType:"fetch"});t({requests:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),Nn=()=>{s(),u(),l(),Nn=null}}var Wn=t=>({name:"rrweb/network@1",observer:Dn,options:t}),Pn="undefined"!=typeof globalThis?globalThis:Qr;Pn&&"undefined"==typeof self&&(Pn.self=Pn),Pn&&"undefined"==typeof File&&(Pn.File=function(){});var jn=null!=Qr?Qr:{};jn.__PosthogExtensions__=jn.__PosthogExtensions__||{},jn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Br,getRecordNetworkPlugin:Wn},jn.__PosthogExtensions__.rrweb={record:Cr,version:"v2",wasMaxDepthReached:()=>Yt,resetMaxDepthState(){Yt=!1,Xt=!1},getLastSnapshotCost:()=>L,getMutationCost:()=>r({},P),resetSnapshotCostState(){T=0,O=0,E=0,C=0,F=M(),L=null,_=null,N=[],D=0,W=0,P={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},jn.rrweb={record:Cr,version:"v2"},jn.rrwebConsoleRecord={getRecordConsolePlugin:Br},jn.getRecordNetworkPlugin=Wn}();
2
2
  //# sourceMappingURL=recorder.js.map