posthog-js 1.174.2 → 1.174.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -15
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +2 -16
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +2 -16
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +2 -2
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +2 -2
- package/dist/array.no-external.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.full.d.ts +1 -0
- package/dist/module.full.js +2 -16
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +1 -0
- package/dist/module.full.no-external.js +2 -16
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +1 -0
- package/dist/module.no-external.js +2 -2
- package/dist/module.no-external.js.map +1 -1
- package/dist/recorder-v2.js +1 -15
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -15
- package/dist/recorder.js.map +1 -1
- package/dist/src/entrypoints/recorder.d.ts +2 -2
- package/dist/src/sessionid.d.ts +1 -0
- package/lib/package.json +6 -5
- package/lib/src/entrypoints/recorder.d.ts +2 -2
- package/lib/src/entrypoints/recorder.js +6 -5
- package/lib/src/entrypoints/recorder.js.map +1 -1
- package/lib/src/sessionid.d.ts +1 -0
- package/lib/src/sessionid.js +1 -0
- package/lib/src/sessionid.js.map +1 -1
- package/package.json +6 -5
package/dist/recorder.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
!function(e){"use strict";var t,n="2.0.0-alpha.13";function r(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function o(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n).map(i).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}!function(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"}(t||(t={}));class a{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-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){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function l(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:s,maskInputFn:i}=e,a=s||"";const l=o&&c(o);return(n[r.toLowerCase()]||l&&n[l])&&(a=i?i(a,t):"*".repeat(a.length)),a}function c(e){return e.toLowerCase()}const d="__rrweb_original__";function u(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?c(t):null}function h(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let p=1;const g=new RegExp("[^a-z0-9-_:]"),m=-2;function f(){return p++}let y,I;const C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,b=/^(?:[a-z+]+:)?\/\//i,S=/^www\..*/i,v=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(C,((e,n,r,o,s,i)=>{const a=r||s||i,l=n||o||"";if(!a)return e;if(b.test(a)||S.test(a))return`url(${l}${a}${l})`;if(v.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),d=a.split("/");c.pop();for(const e of d)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const w=/^[^ \t\n\r\u000c]+/,k=/^[, \t\n\r\u000c]+/;function M(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function T(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function N(){const e=document.createElement("a");return e.href="",e.href}function R(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?M(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(k),!(n>=t.length);){let s=r(w);if(","===s.slice(-1))s=M(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=M(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?A(r,N()):"object"===t&&"data"===n?M(e,r):r:M(e,r):r}function E(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t||"video"===e&&"src"===t&&n&&n.startsWith("blob:http")}function O(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&O(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&O(e.parentNode,t,n)}function x(e,t,n,r){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(O(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function L(e,n){const{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:h,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:f,maskInputFn:C,dataURLOptions:b={},inlineImages:S,recordCanvas:v,keepIframeSrcFn:w,newlyAddedElement:k=!1}=n,M=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:t.Document,childNodes:[],compatMode:e.compatMode}:{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return function(e,n){const{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:h={},maskInputFn:p,dataURLOptions:m={},inlineImages:f,recordCanvas:C,keepIframeSrcFn:b,newlyAddedElement:S=!1,rootId:v}=n,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,o,i),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=c(e.tagName);return g.test(t)?"div":t}(e);let M={};const O=e.attributes.length;for(let t=0;t<O;t++){const n=e.attributes[t];E(k,n.name,n.value)||(M[n.name]=R(r,k,c(n.name),n.value))}if("link"===k&&a){const t=e.href;let n=Array.from(r.styleSheets).find((e=>e.href===t));if(!n&&t.includes(".css")){const e=window.location.origin+"/"+t.replace(window.location.href,"");n=Array.from(r.styleSheets).find((t=>t.href===e))}let o=null;n&&(o=s(n)),o&&(delete M.rel,delete M.href,M._cssText=A(o,n.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=s(e.sheet);t&&(M._cssText=A(t,N()))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&t?M.value=l({element:e,type:u(e),tagName:k,value:t,maskInputOptions:h,maskInputFn:p}):n&&(M.checked=n)}"option"===k&&(e.selected&&!h.select?M.selected=!0:delete M.selected);if("canvas"===k&&C)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s=d in o?o[d]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(M.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!("__context"in e)){const t=e.toDataURL(m.type,m.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(m.type,m.quality)&&(M.rr_dataURL=t)}if("img"===k&&f){y||(y=r.createElement("canvas"),I=y.getContext("2d"));const t=e,n=t.crossOrigin;t.crossOrigin="anonymous";const o=()=>{t.removeEventListener("load",o);try{y.width=t.naturalWidth,y.height=t.naturalHeight,I.drawImage(t,0,0),M.rr_dataURL=y.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}n?M.crossOrigin=n:t.removeAttribute("crossorigin")};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===k||"video"===k){const t=M;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}S||(e.scrollLeft&&(M.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(M.rr_scrollTop=e.scrollTop));if(w){const{width:t,height:n}=e.getBoundingClientRect();M={class:M.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||b(M.src)||(e.contentDocument||(M.rr_src=M.src),delete M.src);let x;try{customElements.get(k)&&(x=!0)}catch(e){}return{type:t.Element,tagName:k,attributes:M,childNodes:[],isSVG:T(e)||void 0,needBlock:w,rootId:v,isCustom:x}}(e,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:p,maskInputOptions:m,maskInputFn:C,dataURLOptions:b,inlineImages:S,recordCanvas:v,keepIframeSrcFn:w,newlyAddedElement:k,rootId:M});case e.TEXT_NODE:return function(e,n){var r;const{needsMask:o,maskTextFn:i,rootId:a}=n,l=e.parentNode&&e.parentNode.tagName;let c=e.textContent;const d="STYLE"===l||void 0,u="SCRIPT"===l||void 0;if(d&&c){try{e.nextSibling||e.previousSibling||(null===(r=e.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(c=s(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}c=A(c,N())}u&&(c="SCRIPT_PLACEHOLDER");!d&&!u&&c&&o&&(c=i?i(c,e.parentElement):c.replace(/[\S]/g,"*"));return{type:t.Text,textContent:c||"",isStyle:d,rootId:a}}(e,{needsMask:h,maskTextFn:f,rootId:M});case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||"",rootId:M};default:return!1}}function F(e){return null==e?"":e.toLowerCase()}function D(e,n){const{doc:s,mirror:i,blockClass:a,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:u=!1,inlineStylesheet:p=!0,maskInputOptions:g={},maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:b={},inlineImages:S=!1,recordCanvas:v=!1,onSerialize:A,onIframeLoad:w,iframeLoadTimeout:k=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:N=(()=>!1),newlyAddedElement:R=!1}=n;let{needsMask:E}=n,{preserveWhiteSpace:O=!0}=n;if(!E&&e.childNodes){E=x(e,c,d,void 0===E)}const B=L(e,{doc:s,mirror:i,blockClass:a,blockSelector:l,needsMask:E,inlineStylesheet:p,maskInputOptions:g,maskTextFn:y,maskInputFn:I,dataURLOptions:b,inlineImages:S,recordCanvas:v,keepIframeSrcFn:N,newlyAddedElement:R});if(!B)return console.warn(e,"not serialized"),null;let W;W=i.hasNode(e)?i.getId(e):!function(e,n){if(n.comment&&e.type===t.Comment)return!0;if(e.type===t.Element){if(n.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===h(e.attributes.href)))return!0;if(n.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(F(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===F(e.attributes.name)||"icon"===F(e.attributes.rel)||"apple-touch-icon"===F(e.attributes.rel)||"shortcut icon"===F(e.attributes.rel))))return!0;if("meta"===e.tagName){if(n.headMetaDescKeywords&&F(e.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(F(e.attributes.property).match(/^(og|twitter|fb):/)||F(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===F(e.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===F(e.attributes.name)||"googlebot"===F(e.attributes.name)||"bingbot"===F(e.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===F(e.attributes.name)||"generator"===F(e.attributes.name)||"framework"===F(e.attributes.name)||"publisher"===F(e.attributes.name)||"progid"===F(e.attributes.name)||F(e.attributes.property).match(/^article:/)||F(e.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===F(e.attributes.name)||"yandex-verification"===F(e.attributes.name)||"csrf-token"===F(e.attributes.name)||"p:domain_verify"===F(e.attributes.name)||"verify-v1"===F(e.attributes.name)||"verification"===F(e.attributes.name)||"shopify-checkout-api-token"===F(e.attributes.name)))return!0}}return!1}(B,C)&&(O||B.type!==t.Text||B.isStyle||B.textContent.replace(/^\s+|\s+$/gm,"").length)?f():m;const V=Object.assign(B,{id:W});if(i.add(e,V),W===m)return null;A&&A(e);let G=!u;if(V.type===t.Element){G=G&&!V.needBlock,delete V.needBlock;const t=e.shadowRoot;t&&o(t)&&(V.isShadowHost=!0)}if((V.type===t.Document||V.type===t.Element)&&G){C.headWhitespace&&V.type===t.Element&&"head"===V.tagName&&(O=!1);const n={doc:s,mirror:i,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:d,skipChild:u,inlineStylesheet:p,maskInputOptions:g,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:O,onSerialize:A,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:N};if(V.type===t.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(const t of Array.from(e.childNodes)){const e=D(t,n);e&&V.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const t of Array.from(e.shadowRoot.childNodes)){const r=D(t,n);r&&(o(e.shadowRoot)&&(r.isShadow=!0),V.childNodes.push(r))}}return e.parentNode&&r(e.parentNode)&&o(e.parentNode)&&(V.isShadow=!0),V.type===t.Element&&"iframe"===V.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&w){const n=D(t,{doc:t,mirror:i,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:O,onSerialize:A,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:N});n&&w(e,n)}}),k),V.type===t.Element&&"link"===V.tagName&&"string"==typeof V.attributes.rel&&("stylesheet"===V.attributes.rel||"preload"===V.attributes.rel&&"string"==typeof V.attributes.href&&"css"===h(V.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(e,(()=>{if(M){const t=D(e,{doc:s,mirror:i,blockClass:a,blockSelector:l,needsMask:E,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:y,maskInputFn:I,slimDOMOptions:C,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:O,onSerialize:A,onIframeLoad:w,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:N});t&&M(e,t)}}),T),V}function B(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const W="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.";let V={map:{},getId:()=>(console.error(W),-1),getNode:()=>(console.error(W),null),removeNodeFromMap(){console.error(W)},has:()=>(console.error(W),!1),reset(){console.error(W)}};function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),d=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(d,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(d,i)}),c))}}function Z(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>Z(e,t,s||{},!0)}function U(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(V=new Proxy(V,{get:(e,t,n)=>("map"===t&&console.error(W),Reflect.get(e,t,n))}));let K=Date.now;function _(e){var t,n,r,o,s,i;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?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===(s=null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.parentElement)||void 0===s?void 0:s.scrollTop)||(null===(i=null==a?void 0:a.body)||void 0===i?void 0:i.scrollTop)||0}}function H(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function P(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Y(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function q(e,t,n,r){if(!e)return!1;const o=Y(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(O(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function j(e,t){return t.getId(e)===m}function J(e,t){if(r(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||J(e.parentNode,t))}function z(e){return Boolean(e.changedTouches)}function Q(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function X(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function $(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(K=()=>(new Date).getTime());class ee{constructor(){this.id=1,this.styleIDMap=new WeakMap,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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 te(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ne(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=te(n);)n=t;return n}(e);return t.contains(n)}function re(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||ne(e))}var oe=(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))(oe||{}),se=(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))(se||{}),ie=(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))(ie||{}),ae=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ae||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{});function ce(e){return"__ln"in e}class de{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ce(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ce(e.nextSibling)&&e.nextSibling.__ln.previous){const 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){const 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--)}}const ue=(e,t)=>`${e}@${t}`;class he{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new de,o=e=>{let t=e,n=m;for(;n===m;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},s=s=>{if(!s.parentNode||!re(s)||"TEXTAREA"===s.parentNode.tagName)return;const i=r(s.parentNode)?this.mirror.getId(te(s)):this.mirror.getId(s.parentNode),a=o(s);if(-1===i||-1===a)return n.addNode(s);const l=D(s,{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,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Q(e,this.mirror)&&this.iframeManager.addIframe(e),X(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),$(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:i,nextId:a,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)ge(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||s(e);for(const e of this.addedSet)fe(this.droppedSet,e)||ge(this.removes,e,this.mirror)?fe(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=o(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===o(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),s(e.value)}const a={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{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=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!j(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;q(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:x(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Y(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=u(t);r=l({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!E(t.tagName,n,r)&&(o.attributes[n]=R(this.doc,c(t.tagName),c(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===s?r:[r,s]:o._unchangedStyles[e]=[r,s]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(q(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=>{const n=this.mirror.getId(t),s=r(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);q(e.target,this.blockClass,this.blockSelector,!1)||j(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(pe(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||J(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ue(n,s)]?pe(this.movedSet,t):this.removes.push({parentId:s,id:n,isShadow:!(!r(e.target)||!o(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(j(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ue(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);q(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),$(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function pe(e,t){e.delete(t),t.childNodes.forEach((t=>pe(e,t)))}function ge(e,t,n){return 0!==e.length&&me(e,t,n)}function me(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some((e=>e.id===o))||me(e,r,n)}function fe(e,t){return 0!==e.size&&ye(e,t)}function ye(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||ye(e,n))}let Ie;function Ce(e){Ie=e}function be(){Ie=void 0}const Se=e=>{if(!Ie)return e;return function(){try{return e(...arguments)}catch(e){if(Ie&&!0===Ie(e))return;throw e}}},ve=[];function Ae(e){try{if("composedPath"in e){const 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 we(e,t){var n,r;const o=new he;ve.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(Se(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function ke(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,sampling:i}=e;if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,l=[];let d=null;return Object.keys(ie).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let i=c(e);const a=(e=>n=>{const i=Ae(n);if(q(i,o,s,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=ae.Mouse;break;case"touch":a=ae.Touch;break;case"pen":a=ae.Pen}a===ae.Touch?ie[e]===ie.MouseDown?l="TouchStart":ie[e]===ie.MouseUp&&(l="TouchEnd"):ae.Pen}else z(n)&&(a=ae.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===ae.Touch||l.startsWith("Mouse")&&a===ae.Mouse)&&(a=null)):ie[e]===ie.Click&&(a=d,d=null);const c=z(n)?n.changedTouches[0]:n;if(!c)return;const u=r.getId(i),{clientX:h,clientY:p}=c;Se(t)(Object.assign({type:ie[l],id:u,x:h,y:p},null!==a&&{pointerType:a}))})(e);if(window.PointerEvent)switch(ie[e]){case ie.MouseDown:case ie.MouseUp:i=i.replace("mouse","pointer");break;case ie.TouchStart:case ie.TouchEnd:return}l.push(B(i,a,n))})),Se((()=>{l.forEach((e=>e()))}))}function Me(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,sampling:i}=e;return B("scroll",Se(G(Se((e=>{const i=Ae(e);if(!i||q(i,o,s,!0))return;const a=r.getId(i);if(i===n&&n.defaultView){const e=_(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})})),i.scroll||100)),n)}const Te=["INPUT","TEXTAREA","SELECT"],Ne=new WeakMap;function Re(e){return function(e,t){if(Le("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Le("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Le("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Le("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ee(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Oe(e,t){let{mirror:n,stylesheetManager:r}=e;var o,s,i;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null===(o=t.defaultView)||void 0===o?void 0:o.Document:null===(i=null===(s=t.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var t;const n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),Se((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p,customElementCb:g}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),i(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),d(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),u(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),g(...arguments)}}(e,t),e.recordDOM&&(r=we(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const s="number"==typeof n.mousemove?n.mousemove:50,i="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=G(Se((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),i),d=Se(G(Se((e=>{const t=Ae(e),{clientX:n,clientY:r}=z(e)?e.changedTouches[0]:e;a||(a=K()),l.push({x:n,y:r,id:o.getId(t),timeOffset:K()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?se.Drag:e instanceof MouseEvent?se.MouseMove:se.TouchMove)})),s,{trailing:!1})),u=[B("mousemove",d,r),B("touchmove",d,r),B("drag",d,r)];return Se((()=>{u.forEach((e=>e()))}))}(e),s=ke(e),i=Me(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,s=-1;return B("resize",Se(G(Se((()=>{const e=H(),t=P();o===e&&s===t||(n({width:Number(t),height:Number(e)}),o=e,s=t)})),200)),r)}(e,{win:n}),c=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:d,sampling:h,userTriggeredOnInput:p}=e;function g(e){let t=Ae(e);const r=e.isTrusted,h=t&&t.tagName;if(t&&"OPTION"===h&&(t=t.parentElement),!t||!h||Te.indexOf(h)<0||q(t,o,s,!0))return;if(t.classList.contains(i)||a&&t.matches(a))return;let g=t.value,f=!1;const y=u(t)||"";"radio"===y||"checkbox"===y?f=t.checked:(c[h.toLowerCase()]||c[y])&&(g=l({element:t,maskInputOptions:c,tagName:h,type:y,value:g,maskInputFn:d})),m(t,p?{text:g,isChecked:f,userTriggered:r}:{text:g,isChecked:f});const I=t.name;"radio"===y&&I&&f&&n.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach((e=>{if(e!==t){const t=e.value;m(e,p?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function m(e,n){const o=Ne.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ne.set(e,n);const o=r.getId(e);Se(t)(Object.assign(Object.assign({},n),{id:o}))}}const f=("last"===h.input?["change"]:["input","change"]).map((e=>B(e,Se(g),n))),y=n.defaultView;if(!y)return()=>{f.forEach((e=>e()))};const I=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,"value"),C=[[y.HTMLInputElement.prototype,"value"],[y.HTMLInputElement.prototype,"checked"],[y.HTMLSelectElement.prototype,"value"],[y.HTMLTextAreaElement.prototype,"value"],[y.HTMLSelectElement.prototype,"selectedIndex"],[y.HTMLOptionElement.prototype,"selected"]];return I&&I.set&&f.push(...C.map((e=>Z(e[0],e[1],{set(){Se(g)({target:this,isTrusted:!1})}},!1,y)))),Se((()=>{f.forEach((e=>e()))}))}(e),d=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:s,doc:i}=e;const a=Se((e=>G(Se((s=>{const i=Ae(s);if(!i||q(i,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d,loop:u}=i;t({type:e,id:o.getId(i),currentTime:a,volume:l,muted:c,playbackRate:d,loop:u})})),s.media||500))),l=[B("play",a(0),i),B("pause",a(1),i),B("seeked",a(2),i),B("volumechange",a(3),i),B("ratechange",a(4),i)];return Se((()=>{l.forEach((e=>e()))}))}(e);let h=()=>{},p=()=>{},g=()=>{},m=()=>{};e.recordDOM&&(h=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Se(((e,t,s)=>{const[i,a]=s,{id:l,styleId:c}=Ee(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:i,index:a}]}),e.apply(t,s)}))});const a=s.CSSStyleSheet.prototype.deleteRule;let l,c;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Se(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Ee(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:i}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Se(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Ee(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:i}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(c=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Se(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Ee(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:i}),e.apply(t,s)}))}));const d={};Fe("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Fe("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Fe("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Fe("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));const u={};return Object.entries(d).forEach((e=>{let[t,s]=e;u[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(u[t].insertRule,{apply:Se(((e,t,s)=>{const[i,a]=s,{id:l,styleId:c}=Ee(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:i,index:[...Re(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(u[t].deleteRule,{apply:Se(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Ee(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...Re(t),i]}]}),e.apply(t,s)}))})})),Se((()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=a,l&&(s.CSSStyleSheet.prototype.replace=l),c&&(s.CSSStyleSheet.prototype.replaceSync=c),Object.entries(d).forEach((e=>{let[t,n]=e;n.prototype.insertRule=u[t].insertRule,n.prototype.deleteRule=u[t].deleteRule}))}))}(e,{win:n}),p=Oe(e,e.doc),g=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:s}=e,{win:i}=t;const a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Se(((e,t,i)=>{var l;const[c,d,u]=i;if(o.has(c))return a.apply(t,[c,d,u]);const{id:h,styleId:p}=Ee(null===(l=t.parentRule)||void 0===l?void 0:l.parentStyleSheet,r,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:d,priority:u},index:Re(t.parentRule)}),e.apply(t,i)}))});const l=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Se(((e,t,i)=>{var a;const[c]=i;if(o.has(c))return l.apply(t,[c]);const{id:d,styleId:u}=Ee(null===(a=t.parentRule)||void 0===a?void 0:a.parentStyleSheet,r,s.styleMirror);return(d&&-1!==d||u&&-1!==u)&&n({id:d,styleId:u,remove:{property:c},index:Re(t.parentRule)}),e.apply(t,i)}))}),Se((()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(m=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){const r=new i(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=U(n.fonts,"add",(function(e){return function(n){return setTimeout(Se((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=i})),o.push(a),Se((()=>{o.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=e;let i=!0;const a=Se((()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:d}=s;q(i,r,o,!0)||q(c,r,o,!0)||a.push({start:n.getId(i),startOffset:l,end:n.getId(c),endOffset:d})}s({ranges:a})}));return a(),B("selectionchange",a)}(e),y=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?U(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,n,t.options));return Se((()=>{ve.forEach((e=>e.reset())),null==r||r.disconnect(),o(),s(),i(),a(),c(),d(),h(),p(),g(),m(),f(),y(),I.forEach((e=>e()))}))}function Le(e){return void 0!==window[e]}function Fe(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class De{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Be{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new De(f),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new De(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.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){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case oe.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:oe.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case oe.Meta:case oe.Load:case oe.DomContentLoaded:return!1;case oe.Plugin:return t;case oe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case oe.IncrementalSnapshot:switch(t.data.source){case se.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 se.Drag:case se.TouchMove:case se.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(t.data,e,["id"]),t;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case se.Font:return t;case se.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case se.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,n){e.type===t.Document||e.rootId||(e.rootId=n),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,n)}))}}class We{constructor(e){this.shadowDoms=new WeakSet,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){if(!o(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=we(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Me(Object.assign(Object.assign({},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(e.host)),this.restoreHandlers.push(Oe({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){const n=this;this.restoreHandlers.push(U(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&re(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function Ve(e,t,n,r){return new(n||(n=Promise))((function(t,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function i(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,i)}a((r=r.apply(e,[])).next())}))}for(var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ze="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ue=0;Ue<64;Ue++)Ze[Ge.charCodeAt(Ue)]=Ue;const Ke=new Map;const _e=(e,t,n)=>{if(!e||!Ye(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ke.get(e);return n||(n=new Map,Ke.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function He(e,t,n){if(e instanceof Array)return e.map((e=>He(e,t,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){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Ge[n[t]>>2],o+=Ge[(3&n[t])<<4|n[t+1]>>4],o+=Ge[(15&n[t+1])<<2|n[t+2]>>6],o+=Ge[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]}}if(Ye(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:_e(e,t,n)}}return e}const Pe=(e,t,n)=>e.map((e=>He(e,t,n))),Ye=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function qe(e,t,n,r){const o=[];try{const s=U(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;a<s;a++)i[a-1]=arguments[a];if(!q(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function je(e,t,n,r,o,s,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=U(e,s,(function(e){return function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];const d=e.apply(this,l);if(_e(d,i,this),"tagName"in this.canvas&&!q(this.canvas,r,o,!0)){const e=Pe(l,i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return d}}));a.push(l)}catch(r){const o=Z(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}function Je(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),s=o.indexOf("\n",10)+1,i=o.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var ze,Qe,Xe,$e,et=(ze="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Qe=null,Xe=!1,function(e){return $e=$e||Je(ze,Qe,Xe),new Worker($e,e)});class tt{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,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)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:i})}initCanvasFPSObserver(e,t,n,r,o){const s=qe(t,n,r,!0),i=new Map,a=new et;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:le["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{q(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((e=>Ve(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(0===e.width||0===e.height)return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,s=e.clientHeight||e.height,l=yield createImageBitmap(e,{resizeWidth:r,resizeHeight:s});a.postMessage({id:n,bitmap:l,width:r,height:s,dataURLOptions:o.dataURLOptions},[l])}))))),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=qe(e,t,n,!1),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=U(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return q(this.canvas,n,r,!0)||setTimeout((()=>{const n=Pe(a,t,this);e(this.canvas,{type:le["2D"],property:i,args:n})}),0),o.apply(this,a)}}));o.push(s)}catch(n){const r=Z(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:le["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r,o){const s=[];return s.push(...je(t.WebGLRenderingContext.prototype,le.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...je(t.WebGL2RenderingContext.prototype,le.WebGL2,e,n,r,0,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class nt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ee,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:i(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class rt{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function ot(e){return Object.assign(Object.assign({},e),{timestamp:K()})}let st,it,at,lt=!1;const ct=new a;function dt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:d=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:f,hooks:y,packFn:I,sampling:C={},dataURLOptions:b={},mousemoveWait:S,recordDOM:v=!0,recordCanvas:A=!1,recordCrossOriginIframes:w=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:M=!1,collectFonts:T=!1,inlineImages:N=!1,plugins:R,keepIframeSrcFn:E=(()=>!1),ignoreCSSAttributes:O=new Set([]),errorHandler:x}=e;Ce(x);const L=!w||window.parent===window;let F=!1;if(!L)try{window.parent.document&&(F=!1)}catch(e){F=!0}if(L&&!t)throw new Error("emit function is required");void 0!==S&&void 0===C.mousemove&&(C.mousemove=S),ct.reset();const W=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},V=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let G;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let Z=0;const U=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return I&&!F&&(e=I(e)),e};st=(e,o)=>{var s;if(!(null===(s=ve[0])||void 0===s?void 0:s.isFrozen())||e.type===oe.FullSnapshot||e.type===oe.IncrementalSnapshot&&e.data.source===se.Mutation||ve.forEach((e=>e.unfreeze())),L)null==t||t(U(e),o);else if(F){const t={type:"rrweb",event:U(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===oe.FullSnapshot)G=e,Z=0;else if(e.type===oe.IncrementalSnapshot){if(e.data.source===se.Mutation&&e.data.isAttachIframe)return;Z++;const t=r&&Z>=r,o=n&&e.timestamp-G.timestamp>n;(t||o)&&it(!0)}};const K=e=>{st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.Mutation},e)}))},Y=e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.Scroll},e)})),q=e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.CanvasMutation},e)})),j=new nt({mutationCb:K,adoptedStyleSheetCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.AdoptedStyleSheet},e)}))}),J=new Be({mirror:ct,mutationCb:K,stylesheetManager:j,recordCrossOriginIframes:w,wrappedEmit:st});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:ct,crossOriginIframeMirror:J.crossOriginIframeMirror,crossOriginIframeStyleMirror:J.crossOriginIframeStyleMirror});const z=new rt;at=new tt({recordCanvas:A,mutationCb:q,win:window,blockClass:o,blockSelector:s,mirror:ct,sampling:C.canvas,dataURLOptions:b});const ee=new We({mutationCb:K,scrollCb:Y,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:d,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:b,maskTextFn:f,maskInputFn:m,recordCanvas:A,inlineImages:N,sampling:C,slimDOMOptions:V,iframeManager:J,stylesheetManager:j,canvasManager:at,keepIframeSrcFn:E,processedNodeManager:z},mirror:ct});it=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!v)return;st(ot({type:oe.Meta,data:{href:window.location.href,width:P(),height:H()}}),e),j.reset(),ee.init(),ve.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new a,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:d=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:p,slimDOM:g=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=(()=>!1)}=t||{};return D(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:l,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:m,inlineImages:c,recordCanvas:d,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v,newlyAddedElement:!1})}(document,{mirror:ct,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:d,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,slimDOM:V,dataURLOptions:b,recordCanvas:A,inlineImages:N,onSerialize:e=>{Q(e,ct)&&J.addIframe(e),X(e,ct)&&j.trackLinkElement(e),$(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{J.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{j.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!t)return console.warn("Failed to snapshot the document");st(ot({type:oe.FullSnapshot,data:{node:t,initialOffset:_(window)}}),e),ve.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&j.adoptStyleSheets(document.adoptedStyleSheets,ct.getId(document))};try{const e=[],t=e=>{var t;return Se(xe)({mutationCb:K,mousemoveCb:(e,t)=>st(ot({type:oe.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.MouseInteraction},e)})),scrollCb:Y,viewportResizeCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.ViewportResize},e)})),inputCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.Input},e)})),mediaInteractionCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.MediaInteraction},e)})),styleSheetRuleCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.StyleSheetRule},e)})),styleDeclarationCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.StyleDeclaration},e)})),canvasMutationCb:q,fontCb:e=>st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.Font},e)})),selectionCb:e=>{st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.Selection},e)}))},customElementCb:e=>{st(ot({type:oe.IncrementalSnapshot,data:Object.assign({source:se.CustomElement},e)}))},blockClass:o,ignoreClass:i,ignoreSelector:l,maskTextClass:c,maskTextSelector:d,maskInputOptions:W,inlineStylesheet:u,sampling:C,recordDOM:v,recordCanvas:A,inlineImages:N,userTriggeredOnInput:M,collectFonts:T,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:E,blockSelector:s,slimDOMOptions:V,dataURLOptions:b,mirror:ct,iframeManager:J,stylesheetManager:j,shadowDomManager:ee,processedNodeManager:z,canvasManager:at,ignoreCSSAttributes:O,plugins:(null===(t=null==R?void 0:R.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>st(ot({type:oe.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};J.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{it(),e.push(t(document)),lt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(B("DOMContentLoaded",(()=>{st(ot({type:oe.DomContentLoaded,data:{}})),"DOMContentLoaded"===k&&n()}))),e.push(B("load",(()=>{st(ot({type:oe.Load,data:{}})),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),z.destroy(),lt=!1,be()}}catch(e){console.warn(e)}}dt.addCustomEvent=(e,t)=>{if(!lt)throw new Error("please add custom event after start recording");st(ot({type:oe.Custom,data:{tag:e,payload:t}}))},dt.freezePage=()=>{ve.forEach((e=>e.freeze()))},dt.takeFullSnapshot=e=>{if(!lt)throw new Error("please take full snapshot after start recording");it(e)},dt.mirror=ct;class ut{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const ht=/(^|@)\S+:\d+/,pt=/^\s*at .*(\S+:\d+|\(native\))/m,gt=/^(eval@)?(\[native code])?$/,mt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(pt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const 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:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(pt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),s=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new ut({functionName:s,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(gt)}),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 ut({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new ut({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}}),this)},parseOpera:function(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:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new ut({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new ut({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(ht)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ut({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function ft(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function yt(e){return"[object Object]"===Object.prototype.toString.call(e)}function It(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(yt(e[r])&&It(e[r],t-1))return!0;return!1}function Ct(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(yt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(yt(e)&&It(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=ft(r.length?r[0]:null):e[n]=r}return e}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}))}const bt={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 St(e,t,n){const r=n?Object.assign({},bt,n):bt,o=r.logger;if(!o)return()=>{};let s;s="string"==typeof o?t[o]:o;let i=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,s=mt.parse(o).map((e=>e.toString())),i=[Ct(n,r.stringifyOptions)];e({level:"error",trace:s,payload:i})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[Ct(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[Ct("Uncaught (in promise)",r.stringifyOptions),Ct(t.reason,r.stringifyOptions)]);const s=mt.parse(n).map((e=>e.toString()));e({level:"error",trace:s,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(s,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?U(t,n,(t=>function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=mt.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>Ct(e,r.stringifyOptions)));i++,i<r.lengthThreshold?e({level:n,trace:t,payload:o}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Ct("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const vt=e=>({name:"rrweb/console@1",observer:St,options:e}),At=Array.isArray,wt=Object.prototype,kt=wt.hasOwnProperty,Mt=wt.toString,Tt=At||function(e){return"[object Array]"===Mt.call(e)},Nt=function(e){return"function"==typeof e},Rt=function(e){return e===Object(e)&&!Tt(e)},Et=function(e){return void 0===e},Ot=function(e){return"[object String]"==Mt.call(e)},xt=function(e){return null===e},Lt=function(e){return Et(e)||xt(e)},Ft=function(e){return"[object Boolean]"===Mt.call(e)},Dt=e=>e instanceof Document,Bt=e=>e instanceof FormData,Wt="undefined"!=typeof window?window:void 0,Vt="undefined"!=typeof globalThis?globalThis:Wt,Gt=Array.prototype.forEach,Zt=null==Vt?void 0:Vt.navigator;null==Vt||Vt.document,null==Vt||Vt.location,null==Vt||Vt.fetch,null!=Vt&&Vt.XMLHttpRequest&&"withCredentials"in new Vt.XMLHttpRequest&&Vt.XMLHttpRequest,null==Vt||Vt.AbortController,null==Zt||Zt.userAgent;const Ut=null!=Wt?Wt:{},Kt="[PostHog.js]",_t={_log:function(e){if(Wt&&Ut.POSTHOG_DEBUG&&!Et(Wt.console)&&Wt.console){const o="__rrweb_original__"in Wt.console[e]?Wt.console[e].__rrweb_original__:Wt.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(Kt,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_t._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_t._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];_t._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(Kt,...t)},uninitializedWarning:e=>{_t.error(`You must initialize PostHog before calling ${e}`)}},Ht={};function Pt(e,t,n){if(!Lt(e)){if(Tt(e))return function(e,t,n){if(Tt(e))if(Gt&&e.forEach===Gt)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===Ht)return}(e,t,n);if(Bt(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===Ht)return}else for(const r in e)if(kt.call(e,r)&&t.call(n,e[r],r)===Ht)return}}const Yt=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return Pt(e,(function(e,r){Et(e)||Et(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},qt={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]};function jt(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return Nt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Jt(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const zt=e=>"navigation"===e.entryType,Qt=e=>"resource"===e.entryType;function Xt(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function $t(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>zt(e)||Qt(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>sn({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>zt(e)||Qt(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>sn({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function en(e,t){return!!t&&(Ft(t)||t[e])}function tn(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(Ft(n))return!0;if(Tt(n))return o(n);const s=n[t];return Ft(s)?s:o(s)}async function nn(e,t,n,r,o){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(s>10)return _t.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const i=Xt(e.performance.getEntriesByName(n),(e=>Qt(e)&&e.initiatorType===t&&(Et(r)||e.startTime>=r)&&(Et(o)||e.startTime<=o)));return i||(await new Promise((e=>setTimeout(e,50*s))),nn(e,t,n,r,o,s+1))}function rn(e){let{body:t,options:n,url:r}=e;if(Lt(t))return null;const{hostname:o,isHostDenied:s}=Jt(r,n);if(s)return o+" is in deny list";if(Ot(t))return t;if(Dt(t))return t.textContent;if(Bt(t))return Yt(t);if(Rt(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const on=e=>!xt(e)&&("navigation"===e.entryType||"resource"===e.entryType);function sn(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:s,start:i,end:a,url:l,initiatorType:c}=e;i=t?t.startTime:i,a=t?t.responseEnd:a;const d=Math.floor(Date.now()-performance.now()),u=Math.floor(d+(i||0)),h=[{...t?t.toJSON():{name:l},startTime:Et(i)?void 0:Math.round(i),endTime:Et(a)?void 0:Math.round(a),timeOrigin:d,timestamp:u,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s}];if(on(t))for(const e of t.serverTiming||[])h.push({timeOrigin:d,timestamp:u,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const an=["video/","audio/"];function ln(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function cn(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const s=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),i=an.some((e=>null==s?void 0:s.startsWith(e)));if(s&&i)return`Content-Type ${s} is not supported`;const{hostname:a,isHostDenied:l}=Jt(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return xt(o)?ln(t):Promise.resolve(o)}function dn(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=en("request",n.recordHeaders),o=en("response",n.recordHeaders),s=jt(t,"fetch",(s=>async function(i,a){const l=new Request(i,a);let c;const d={};let u,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(d.requestHeaders=e),tn({type:"request",headers:e,url:i,recordBody:n.recordBody})&&(d.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:s}=Jt(r,n);return s?Promise.resolve(o+" is in deny list"):ln(t)}({r:l,options:n,url:i})),u=t.performance.now(),c=await s(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(d.responseHeaders=a),tn({type:"response",headers:a,url:i,recordBody:n.recordBody})&&(d.responseBody=await cn({r:c,options:n,url:i})),c}finally{nn(t,"fetch",l.url,u,h).then((t=>{var n;const r=sn({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:d,start:u,end:h,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{s()}}let un=null;function hn(e,t,n){if(!("performance"in t))return()=>{};if(un)return _t.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},qt,n):qt,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},s=$t(o,t,r);let i=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(i=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=en("request",n.recordHeaders),o=en("response",n.recordHeaders),s=jt(t.XMLHttpRequest.prototype,"open",(s=>function(i,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0;const u=this,h=new Request(a),p={};let g,m;const f={},y=u.setRequestHeader.bind(u);u.setRequestHeader=(e,t)=>(f[e]=t,y(e,t)),r&&(p.requestHeaders=f);const I=u.send.bind(u);u.send=e=>(tn({type:"request",headers:f,url:a,recordBody:n.recordBody})&&(p.requestBody=rn({body:e,options:n,url:a})),g=t.performance.now(),I(e)),u.addEventListener("readystatechange",(()=>{if(u.readyState!==u.DONE)return;m=t.performance.now();const r={};u.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(p.responseHeaders=r),tn({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(p.responseBody=rn({body:u.response,options:n,url:a})),nn(t,"xmlhttprequest",h.url,g,m).then((t=>{const n=sn({entry:t,method:h.method,status:null==u?void 0:u.status,networkRequest:p,start:g,end:m,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),s.call(u,i,a,l,c,d)}));return()=>{s()}}(o,t,r),a=dn(o,t,r)),un=()=>{s(),i(),a()},un}const pn="rrweb/network@1",gn=e=>({name:pn,observer:hn,options:e});Ut.__PosthogExtensions__=Ut.__PosthogExtensions__||{},Ut.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:vt,getRecordNetworkPlugin:gn},Ut.__PosthogExtensions__.rrweb={record:dt,version:"v2",rrwebVersion:n},Ut.rrweb={record:dt,version:"v2",rrwebVersion:n},Ut.rrwebConsoleRecord={getRecordConsolePlugin:vt},Ut.getRecordNetworkPlugin=gn,e.NETWORK_PLUGIN_NAME=pn,e.default=dt,e.findLast=Xt,e.getRecordNetworkPlugin=gn,Object.defineProperty(e,"__esModule",{value:!0})}({});
|
|
1
|
+
!function(e){"use strict";var t,n=Object.defineProperty,r=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),o=Object.defineProperty,s=(e,t,n)=>((e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),i=(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))(i||{});function a(e){return e.nodeType===e.ELEMENT_NODE}function l(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function c(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function d(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,u).join("")).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):null}catch(e){return null}var t}function u(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=d(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}function h(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let p=class{constructor(){s(this,"idNodeMap",new Map),s(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function m(e){let{element:t,maskInputOptions:n,tagName:r,type:o,value:s,maskInputFn:i}=e,a=s||"";const l=o&&g(o);return(n[r.toLowerCase()]||l&&n[l])&&(a=i?i(a,t):"*".repeat(a.length)),a}function g(e){return e.toLowerCase()}const f="__rrweb_original__";function y(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?g(t):null}function I(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let C=1;const b=new RegExp("[^a-z0-9-_:]"),S=-2;function v(){return C++}let w,M;const k=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,N=/^www\..*/i,T=/^(data:)([^,]*),(.*)/i;function E(e,t){return(e||"").replace(k,((e,n,r,o,s,i)=>{const a=r||s||i,l=n||o||"";if(!a)return e;if(A.test(a)||N.test(a))return`url(${l}${a}${l})`;if(T.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),d=a.split("/");c.pop();for(const e of d)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`}))}const O=/^[^ \t\n\r\u000c]+/,R=/^[, \t\n\r\u000c]+/;const L=new WeakMap;function x(e,t){return t&&""!==t.trim()?F(e,t):t}function D(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function F(e,t){let n=L.get(e);if(n||(n=e.createElement("a"),L.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function G(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?x(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(R),!(n>=t.length);){let s=r(O);if(","===s.slice(-1))s=x(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=x(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?E(r,F(e)):"object"===t&&"data"===n?x(e,r):r:x(e,r):r}function B(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function W(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&W(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&W(e.parentNode,t,n)}function Z(e,t,n,r){let o;if(a(e)){if(o=e,!o.childNodes.length)return!1}else{if(null===e.parentElement)return!1;o=e.parentElement}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(W(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function Y(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:u,maskInputFn:p,dataURLOptions:I={},inlineImages:C,recordCanvas:S,keepIframeSrcFn:v,newlyAddedElement:k=!1}=t,A=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:i.Document,childNodes:[],compatMode:e.compatMode}:{type:i.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:A};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:p,keepIframeSrcFn:I,newlyAddedElement:C=!1,rootId:S}=t,v=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),k=function(e){if(e instanceof HTMLFormElement)return"form";const t=g(e.tagName);return b.test(t)?"div":t}(e);let A={};const N=e.attributes.length;for(let t=0;t<N;t++){const r=e.attributes[t];B(k,r.name,r.value)||(A[r.name]=G(n,k,g(r.name),r.value))}if("link"===k&&s){const t=e.href;let r=h(n,t);if(!r&&t.includes(".css")){r=h(n,window.location.origin+"/"+t.replace(window.location.href,""))}let o=null;r&&(o=d(r)),o&&(delete A.rel,delete A.href,A._cssText=E(o,r.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=d(e.sheet);t&&(A._cssText=E(t,F(n)))}if("input"===k||"textarea"===k||"select"===k){const t=e.value,n=e.checked;"radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&t?A.value=m({element:e,type:y(e),tagName:k,value:t,maskInputOptions:a,maskInputFn:l}):n&&(A.checked=n)}"option"===k&&(e.selected&&!a.select?A.selected=!0:delete A.selected);if("canvas"===k&&p)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s=f in o?o[f]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(A.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(A.rr_dataURL=t)}if("img"===k&&u){w||(w=n.createElement("canvas"),M=w.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,s=()=>{t.removeEventListener("load",s);try{w.width=t.naturalWidth,w.height=t.naturalHeight,M.drawImage(t,0,0),A.rr_dataURL=w.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?A.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s)}if("audio"===k||"video"===k){const t=A;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}C||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop));if(v){const{width:t,height:n}=e.getBoundingClientRect();A={class:A.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||I(A.src)||(e.contentDocument||(A.rr_src=A.src),delete A.src);let T;try{customElements.get(k)&&(T=!0)}catch(e){}return{type:i.Element,tagName:k,attributes:A,childNodes:[],isSVG:D(e)||void 0,needBlock:v,rootId:S,isCustom:T}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:c,maskInputFn:p,dataURLOptions:I,inlineImages:C,recordCanvas:S,keepIframeSrcFn:v,newlyAddedElement:k,rootId:A});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:r,maskTextFn:o,rootId:s}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(n=e.parentNode.sheet)?void 0:n.cssRules)&&(l=d(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}l=E(l,F(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&r&&(l=o?o(l,e.parentElement):l.replace(/[\S]/g,"*"));return{type:i.Text,textContent:l||"",isStyle:c,rootId:s}}(e,{doc:n,needsMask:a,maskTextFn:u,rootId:A});case e.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:A};case e.COMMENT_NODE:return{type:i.Comment,textContent:e.textContent||"",rootId:A};default:return!1}}function V(e){return null==e?"":e.toLowerCase()}function H(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:d,maskTextSelector:u,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C={},inlineImages:b=!1,recordCanvas:w=!1,onSerialize:M,onIframeLoad:k,iframeLoadTimeout:A=5e3,onStylesheetLoad:N,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:E=(()=>!1),newlyAddedElement:O=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:L=!0}=t;if(!R){R=Z(e,d,u,void 0===R)}const x=Y(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:R,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:f,dataURLOptions:C,inlineImages:b,recordCanvas:w,keepIframeSrcFn:E,newlyAddedElement:O});if(!x)return console.warn(e,"not serialized"),null;let D;D=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===i.Comment)return!0;if(e.type===i.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===I(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(V(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===V(e.attributes.name)||"icon"===V(e.attributes.rel)||"apple-touch-icon"===V(e.attributes.rel)||"shortcut icon"===V(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&V(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(V(e.attributes.property).match(/^(og|twitter|fb):/)||V(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===V(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===V(e.attributes.name)||"googlebot"===V(e.attributes.name)||"bingbot"===V(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===V(e.attributes.name)||"generator"===V(e.attributes.name)||"framework"===V(e.attributes.name)||"publisher"===V(e.attributes.name)||"progid"===V(e.attributes.name)||V(e.attributes.property).match(/^article:/)||V(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===V(e.attributes.name)||"yandex-verification"===V(e.attributes.name)||"csrf-token"===V(e.attributes.name)||"p:domain_verify"===V(e.attributes.name)||"verify-v1"===V(e.attributes.name)||"verification"===V(e.attributes.name)||"shopify-checkout-api-token"===V(e.attributes.name)))return!0}}return!1}(x,y)&&(L||x.type!==i.Text||x.isStyle||x.textContent.replace(/^\s+|\s+$/gm,"").length)?v():S;const F=Object.assign(x,{id:D});if(r.add(e,F),D===S)return null;M&&M(e);let G=!h;if(F.type===i.Element){G=G&&!F.needBlock,delete F.needBlock;const t=e.shadowRoot;t&&c(t)&&(F.isShadowHost=!0)}if((F.type===i.Document||F.type===i.Element)&&G){y.headWhitespace&&F.type===i.Element&&"head"===F.tagName&&(L=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:R,maskTextClass:d,maskTextSelector:u,skipChild:h,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:b,recordCanvas:w,preserveWhiteSpace:L,onSerialize:M,onIframeLoad:k,iframeLoadTimeout:A,onStylesheetLoad:N,stylesheetLoadTimeout:T,keepIframeSrcFn:E};if(F.type===i.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else for(const n of Array.from(e.childNodes)){const e=H(n,t);e&&F.childNodes.push(e)}if(a(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=H(n,t);r&&(c(e.shadowRoot)&&(r.isShadow=!0),F.childNodes.push(r))}}return e.parentNode&&l(e.parentNode)&&c(e.parentNode)&&(F.isShadow=!0),F.type===i.Element&&"iframe"===F.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=H(t,{doc:t,mirror:r,blockClass:o,blockSelector:s,needsMask:R,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:b,recordCanvas:w,preserveWhiteSpace:L,onSerialize:M,onIframeLoad:k,iframeLoadTimeout:A,onStylesheetLoad:N,stylesheetLoadTimeout:T,keepIframeSrcFn:E});n&&k(e,n)}}),A),F.type===i.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===I(F.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(e,(()=>{if(N){const t=H(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,needsMask:R,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:b,recordCanvas:w,preserveWhiteSpace:L,onSerialize:M,onIframeLoad:k,iframeLoadTimeout:A,onStylesheetLoad:N,stylesheetLoadTimeout:T,keepIframeSrcFn:E});t&&N(e,t)}}),T),F}function X(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const _="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.";let z={map:{},getId:()=>(console.error(_),-1),getNode:()=>(console.error(_),null),removeNodeFromMap(){console.error(_)},has:()=>(console.error(_),!1),reset(){console.error(_)}};function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),d=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(d,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(d,i)}),c))}}function J(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>J(e,t,s||{},!0)}function U(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(z=new Proxy(z,{get:(e,t,n)=>("map"===t&&console.error(_),Reflect.get(e,t,n))}));let K=Date.now;function j(e){var t,n,r,o,s,i;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.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==(s=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:s.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function Q(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function q(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function ee(e,t,n,r){if(!e)return!1;const o=$(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(W(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function te(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===S}function ne(e,t){if(l(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ne(e.parentNode,t))}function re(e){return Boolean(e.changedTouches)}function oe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function se(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ie(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(K=()=>(new Date).getTime());let ae=class{constructor(){r(this,"id",1),r(this,"styleIDMap",new WeakMap),r(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 le(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ce(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=le(n);)n=t;return n}(e);return t.contains(n)}function de(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||ce(e))}var ue=(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))(ue||{}),he=(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))(he||{}),pe=(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))(pe||{}),me=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(me||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),fe=(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))(fe||{});function ye(e){return"__ln"in e}class Ie{constructor(){r(this,"length",0),r(this,"head",null),r(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ye(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ye(e.nextSibling)&&e.nextSibling.__ln.previous){const 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){const 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--)}}const Ce=(e,t)=>`${e}@${t}`;class be{constructor(){r(this,"frozen",!1),r(this,"locked",!1),r(this,"texts",[]),r(this,"attributes",[]),r(this,"attributeMap",new WeakMap),r(this,"removes",[]),r(this,"mapRemoves",[]),r(this,"movedMap",{}),r(this,"addedSet",new Set),r(this,"movedSet",new Set),r(this,"droppedSet",new Set),r(this,"mutationCb"),r(this,"blockClass"),r(this,"blockSelector"),r(this,"maskTextClass"),r(this,"maskTextSelector"),r(this,"inlineStylesheet"),r(this,"maskInputOptions"),r(this,"maskTextFn"),r(this,"maskInputFn"),r(this,"keepIframeSrcFn"),r(this,"recordCanvas"),r(this,"inlineImages"),r(this,"slimDOMOptions"),r(this,"dataURLOptions"),r(this,"doc"),r(this,"mirror"),r(this,"iframeManager"),r(this,"stylesheetManager"),r(this,"shadowDomManager"),r(this,"canvasManager"),r(this,"processedNodeManager"),r(this,"unattachedDoc"),r(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),r(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Ie,r=e=>{let t=e,n=S;for(;n===S;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!de(o)||"TEXTAREA"===o.parentNode.tagName)return;const s=l(o.parentNode)?this.mirror.getId(le(o)):this.mirror.getId(o.parentNode),i=r(o);if(-1===s||-1===i)return n.addNode(o);const a=H(o,{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,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{oe(e,this.mirror)&&this.iframeManager.addIframe(e),se(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ie(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:s,nextId:i,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)ve(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)we(this.droppedSet,e)||ve(this.removes,e,this.mirror)?we(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let s=null;for(;n.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),o(e.value)}const i={texts:this.texts.map((e=>{const t=e.node;return t.parentNode&&"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{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=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))})),r(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")})),r(this,"processMutation",(e=>{if(!te(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=e.target.textContent;ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Z(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=y(t);r=m({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(ee(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!B(t.tagName,n)&&(o.attributes[n]=G(this.doc,g(t.tagName),g(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===s?r:[r,s]:o._unchangedStyles[e]=[r,s]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(ee(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=>{const n=this.mirror.getId(t),r=l(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ee(e.target,this.blockClass,this.blockSelector,!1)||te(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Se(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ne(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ce(n,r)]?Se(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!l(e.target)||!c(e.target))||void 0})),this.mapRemoves.push(t))}))}})),r(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(te(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ce(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ee(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),ie(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function Se(e,t){e.delete(t),t.childNodes.forEach((t=>Se(e,t)))}function ve(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some((e=>e.id===t)))return!0;r=r.parentNode}return!1}(e,t,n)}function we(e,t){return 0!==e.size&&Me(e,t)}function Me(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Me(e,n))}let ke;const Ae=e=>{if(!ke)return e;return function(){try{return e(...arguments)}catch(e){if(ke&&!0===ke(e))return;throw e}}},Ne=[];function Te(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ee(e,t){var n,r;const o=new be;Ne.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null==(r=null==(n=null==window?void 0:window.Zone)?void 0:n.__symbol__)?void 0:r.call(n,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(Ae(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Oe(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,sampling:i}=e;if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,l=[];let c=null;return Object.keys(pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((e=>{let i=g(e);const a=(e=>n=>{const i=Te(n);if(ee(i,o,s,!0))return;let a=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=me.Mouse;break;case"touch":a=me.Touch;break;case"pen":a=me.Pen}a===me.Touch?pe[e]===pe.MouseDown?l="TouchStart":pe[e]===pe.MouseUp&&(l="TouchEnd"):me.Pen}else re(n)&&(a=me.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===me.Touch||l.startsWith("Mouse")&&a===me.Mouse)&&(a=null)):pe[e]===pe.Click&&(a=c,c=null);const d=re(n)?n.changedTouches[0]:n;if(!d)return;const u=r.getId(i),{clientX:h,clientY:p}=d;Ae(t)({type:pe[l],id:u,x:h,y:p,...null!==a&&{pointerType:a}})})(e);if(window.PointerEvent)switch(pe[e]){case pe.MouseDown:case pe.MouseUp:i=i.replace("mouse","pointer");break;case pe.TouchStart:case pe.TouchEnd:return}l.push(X(i,a,n))})),Ae((()=>{l.forEach((e=>e()))}))}function Re(e){let{scrollCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,sampling:i}=e;return X("scroll",Ae(P(Ae((e=>{const i=Te(e);if(!i||ee(i,o,s,!0))return;const a=r.getId(i);if(i===n&&n.defaultView){const e=j(n.defaultView);t({id:a,x:e.left,y:e.top})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})})),i.scroll||100)),n)}const Le=["INPUT","TEXTAREA","SELECT"],xe=new WeakMap;function De(e){return function(e,t){if(We("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||We("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||We("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||We("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Fe(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ge(e,t){let{mirror:n,stylesheetManager:r}=e;var o,s,i;let a=null;a="#document"===t.nodeName?n.getId(t):n.getId(t.host);const l="#document"===t.nodeName?null==(o=t.defaultView)?void 0:o.Document:null==(i=null==(s=t.ownerDocument)?void 0:s.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t;const n=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{r.adoptStyleSheets(e,a)}catch(e){}return n}}),Ae((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Be(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p,customElementCb:m}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),n(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),r(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),o(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),i(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),d(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),u(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),m(...arguments)}}(e,t),e.recordDOM&&(r=Ee(e,e.doc));const o=function(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:o}=e;if(!1===n.mousemove)return()=>{};const s="number"==typeof n.mousemove?n.mousemove:50,i="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,l=[];const c=P(Ae((e=>{const n=Date.now()-a;t(l.map((e=>(e.timeOffset-=n,e))),e),l=[],a=null})),i),d=Ae(P(Ae((e=>{const t=Te(e),{clientX:n,clientY:r}=re(e)?e.changedTouches[0]:e;a||(a=K()),l.push({x:n,y:r,id:o.getId(t),timeOffset:K()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?he.Drag:e instanceof MouseEvent?he.MouseMove:he.TouchMove)})),s,{trailing:!1})),u=[X("mousemove",d,r),X("touchmove",d,r),X("drag",d,r)];return Ae((()=>{u.forEach((e=>e()))}))}(e),s=Oe(e),i=Re(e),a=function(e,t){let{viewportResizeCb:n}=e,{win:r}=t,o=-1,s=-1;return X("resize",Ae(P(Ae((()=>{const e=Q(),t=q();o===e&&s===t||(n({width:Number(t),height:Number(e)}),o=e,s=t)})),200)),r)}(e,{win:n}),l=function(e){let{inputCb:t,doc:n,mirror:r,blockClass:o,blockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:u}=e;function h(e){let t=Te(e);const r=e.isTrusted,d=t&&t.tagName;if(t&&"OPTION"===d&&(t=t.parentElement),!t||!d||Le.indexOf(d)<0||ee(t,o,s,!0))return;if(t.classList.contains(i)||a&&t.matches(a))return;let h=t.value,g=!1;const f=y(t)||"";"radio"===f||"checkbox"===f?g=t.checked:(l[d.toLowerCase()]||l[f])&&(h=m({element:t,maskInputOptions:l,tagName:d,type:f,value:h,maskInputFn:c})),p(t,u?{text:h,isChecked:g,userTriggered:r}:{text:h,isChecked:g});const I=t.name;"radio"===f&&I&&g&&n.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach((e=>{if(e!==t){const t=e.value;p(e,u?{text:t,isChecked:!g,userTriggered:!1}:{text:t,isChecked:!g})}}))}function p(e,n){const o=xe.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){xe.set(e,n);const o=r.getId(e);Ae(t)({...n,id:o})}}const g=("last"===d.input?["change"]:["input","change"]).map((e=>X(e,Ae(h),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};const I=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),C=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return I&&I.set&&g.push(...C.map((e=>J(e[0],e[1],{set(){Ae(h)({target:this,isTrusted:!1})}},!1,f)))),Ae((()=>{g.forEach((e=>e()))}))}(e),c=function(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,mirror:o,sampling:s,doc:i}=e;const a=Ae((e=>P(Ae((s=>{const i=Te(s);if(!i||ee(i,n,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d,loop:u}=i;t({type:e,id:o.getId(i),currentTime:a,volume:l,muted:c,playbackRate:d,loop:u})})),s.media||500))),l=[X("play",a(fe.Play),i),X("pause",a(fe.Pause),i),X("seeked",a(fe.Seeked),i),X("volumechange",a(fe.VolumeChange),i),X("ratechange",a(fe.RateChange),i)];return Ae((()=>{l.forEach((e=>e()))}))}(e);let d=()=>{},u=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(d=function(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:o}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Ae(((e,t,s)=>{const[i,a]=s,{id:l,styleId:c}=Fe(t,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:i,index:a}]}),e.apply(t,s)}))});const a=s.CSSStyleSheet.prototype.deleteRule;let l,c;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ae(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Fe(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:i}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ae(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Fe(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replace:i}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(c=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Ae(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Fe(t,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,replaceSync:i}),e.apply(t,s)}))}));const d={};Ze("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ze("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ze("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ze("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));const u={};return Object.entries(d).forEach((e=>{let[t,s]=e;u[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(u[t].insertRule,{apply:Ae(((e,t,s)=>{const[i,a]=s,{id:l,styleId:c}=Fe(t.parentStyleSheet,r,o.styleMirror);return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,adds:[{rule:i,index:[...De(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(u[t].deleteRule,{apply:Ae(((e,t,s)=>{const[i]=s,{id:a,styleId:l}=Fe(t.parentStyleSheet,r,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&n({id:a,styleId:l,removes:[{index:[...De(t),i]}]}),e.apply(t,s)}))})})),Ae((()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=a,l&&(s.CSSStyleSheet.prototype.replace=l),c&&(s.CSSStyleSheet.prototype.replaceSync=c),Object.entries(d).forEach((e=>{let[t,n]=e;n.prototype.insertRule=u[t].insertRule,n.prototype.deleteRule=u[t].deleteRule}))}))}(e,{win:n}),u=Ge(e,e.doc),h=function(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:o,stylesheetManager:s}=e,{win:i}=t;const a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ae(((e,t,i)=>{var l;const[c,d,u]=i;if(o.has(c))return a.apply(t,[c,d,u]);const{id:h,styleId:p}=Fe(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:d,priority:u},index:De(t.parentRule)}),e.apply(t,i)}))});const l=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ae(((e,t,i)=>{var a;const[c]=i;if(o.has(c))return l.apply(t,[c]);const{id:d,styleId:u}=Fe(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,s.styleMirror);return(d&&-1!==d||u&&-1!==u)&&n({id:d,styleId:u,remove:{property:c},index:De(t.parentRule)}),e.apply(t,i)}))}),Ae((()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(p=function(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const o=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){const r=new i(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=U(n.fonts,"add",(function(e){return function(n){return setTimeout(Ae((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return o.push((()=>{r.FontFace=i})),o.push(a),Ae((()=>{o.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=e;let i=!0;const a=Ae((()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:d}=s;ee(i,r,o,!0)||ee(c,r,o,!0)||a.push({start:n.getId(i),startOffset:l,end:n.getId(c),endOffset:d})}s({ranges:a})}));return a(),X("selectionchange",a)}(e),f=function(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;return r&&r.customElements?U(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn(`Custom element callback failed for ${t}`)}return e.apply(this,[t,r,o])}})):()=>{}}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,n,t.options));return Ae((()=>{Ne.forEach((e=>e.reset())),null==r||r.disconnect(),o(),s(),i(),a(),l(),c(),d(),u(),h(),p(),g(),f(),I.forEach((e=>e()))}))}function We(e){return void 0!==window[e]}function Ze(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ye{constructor(e){r(this,"iframeIdToRemoteIdMap",new WeakMap),r(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ve{constructor(e){r(this,"iframes",new WeakMap),r(this,"crossOriginIframeMap",new WeakMap),r(this,"crossOriginIframeMirror",new Ye(v)),r(this,"crossOriginIframeStyleMirror"),r(this,"crossOriginIframeRootIdMap",new WeakMap),r(this,"mirror"),r(this,"mutationCb"),r(this,"wrappedEmit"),r(this,"loadListener"),r(this,"stylesheetManager"),r(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ye(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),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){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ue.IncrementalSnapshot,data:{source:he.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return t;case ue.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ue.IncrementalSnapshot:switch(t.data.source){case he.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),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 he.Drag:case he.TouchMove:case he.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case he.ViewportResize:return!1;case he.MediaInteraction:case he.MouseInteraction:case he.Scroll:case he.CanvasMutation:case he.Input:return this.replaceIds(t.data,e,["id"]),t;case he.StyleSheetRule:case he.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case he.Font:return t;case he.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case he.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===i.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class He{constructor(e){r(this,"shadowDoms",new WeakSet),r(this,"mutationCb"),r(this,"scrollCb"),r(this,"bypassOptions"),r(this,"mirror"),r(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){if(!c(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Ee({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Re({...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(e.host)),this.restoreHandlers.push(Ge({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){const n=this;this.restoreHandlers.push(U(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&de(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ze=0;ze<64;ze++)_e[Xe.charCodeAt(ze)]=ze;const Pe=new Map;const Je=(e,t,n)=>{if(!e||!je(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Pe.get(e);return n||(n=new Map,Pe.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ue(e,t,n){if(e instanceof Array)return e.map((e=>Ue(e,t,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){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Xe[n[t]>>2],o+=Xe[(3&n[t])<<4|n[t+1]>>4],o+=Xe[(15&n[t+1])<<2|n[t+2]>>6],o+=Xe[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}}if(je(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Je(e,t,n)}}return e}const Ke=(e,t,n)=>e.map((e=>Ue(e,t,n))),je=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Qe(e,t,n,r){const o=[];try{const s=U(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;a<s;a++)i[a-1]=arguments[a];if(!ee(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function qe(e,t,n,r,o,s){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=U(e,l,(function(e){return function(){for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];const d=e.apply(this,a);if(Je(d,s,this),"tagName"in this.canvas&&!ee(this.canvas,r,o,!0)){const e=Ke(a,s,this),r={type:t,property:l,args:e};n(this.canvas,r)}return d}}));i.push(a)}catch{const r=J(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(r)}return i}const $e="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",et="undefined"!=typeof window&&window.Blob&&new Blob([(tt=$e,Uint8Array.from(atob(tt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var tt;function nt(e){let t;try{if(t=et&&(window.URL||window.webkitURL).createObjectURL(et),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch(t){return new Worker("data:text/javascript;base64,"+$e,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class rt{constructor(e){r(this,"pendingCanvasMutations",new Map),r(this,"rafStamps",{latestId:0,invokeId:null}),r(this,"mirror"),r(this,"mutationCb"),r(this,"resetObservers"),r(this,"frozen",!1),r(this,"locked",!1),r(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)}));const{sampling:t="all",win:n,blockClass:o,blockSelector:s,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,o,s),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,s,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const s=Qe(t,n,r,!0),i=new Map,a=new nt;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[],o=t=>{t.querySelectorAll("canvas").forEach((t=>{ee(t,n,r,!0)||e.push(t)})),t.querySelectorAll("*").forEach((e=>{e.shadowRoot&&o(e.shadowRoot)}))};return o(t.document),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(i.get(n))return;if(0===e.width||0===e.height)return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=e.clientWidth||e.width,s=e.clientHeight||e.height,l=await createImageBitmap(e,{resizeWidth:r,resizeHeight:s});a.postMessage({id:n,bitmap:l,width:r,height:s,dataURLOptions:o.dataURLOptions},[l])}))),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Qe(e,t,n,!1),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=U(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return ee(this.canvas,n,r,!0)||setTimeout((()=>{const n=Ke(a,t,this);e(this.canvas,{type:ge["2D"],property:i,args:n})}),0),o.apply(this,a)}}));o.push(s)}catch{const n=J(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:ge["2D"],property:i,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r){const o=[];return o.push(...qe(t.WebGLRenderingContext.prototype,ge.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...qe(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class ot{constructor(e){r(this,"trackedLinkElements",new WeakSet),r(this,"mutationCb"),r(this,"adoptedStyleSheetCb"),r(this,"styleMirror",new ae),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,t)=>({rule:u(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class st{constructor(){r(this,"nodeMap",new WeakMap),r(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).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(){}}let it,at,lt,ct=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(t=e.contentWindow)?void 0:t.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const dt=new p;function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:m,maskInputFn:g,maskTextFn:f,hooks:y,packFn:I,sampling:C={},dataURLOptions:b={},mousemoveWait:S,recordDOM:v=!0,recordCanvas:w=!1,recordCrossOriginIframes:M=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:N=!1,inlineImages:T=!1,plugins:E,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:L}=e;ke=L;const x=!M||window.parent===window;let D=!1;if(!x)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(x&&!t)throw new Error("emit function is required");if(!x&&!D)return()=>{};void 0!==S&&void 0===C.mousemove&&(C.mousemove=S),dt.reset();const F=!0===u?{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!==h?h:{password:!0},G=!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===m,headMetaDescKeywords:"all"===m,headTitleMutations:"all"===m}:m||{};let B;!function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();let W=0;const Z=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return I&&!D&&(e=I(e)),e};it=(e,o)=>{var s;const i=e;if(i.timestamp=K(),!(null==(s=Ne[0])?void 0:s.isFrozen())||i.type===ue.FullSnapshot||i.type===ue.IncrementalSnapshot&&i.data.source===he.Mutation||Ne.forEach((e=>e.unfreeze())),x)null==t||t(Z(i),o);else if(D){const e={type:"rrweb",event:Z(i),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(i.type===ue.FullSnapshot)B=i,W=0;else if(i.type===ue.IncrementalSnapshot){if(i.data.source===he.Mutation&&i.data.isAttachIframe)return;W++;const e=r&&W>=r,t=n&&i.timestamp-B.timestamp>n;(e||t)&&at(!0)}};const Y=e=>{it({type:ue.IncrementalSnapshot,data:{source:he.Mutation,...e}})},V=e=>it({type:ue.IncrementalSnapshot,data:{source:he.Scroll,...e}}),_=e=>it({type:ue.IncrementalSnapshot,data:{source:he.CanvasMutation,...e}}),z=new ot({mutationCb:Y,adoptedStyleSheetCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.AdoptedStyleSheet,...e}})}),P=new Ve({mirror:dt,mutationCb:Y,stylesheetManager:z,recordCrossOriginIframes:M,wrappedEmit:it});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:dt,crossOriginIframeMirror:P.crossOriginIframeMirror,crossOriginIframeStyleMirror:P.crossOriginIframeStyleMirror});const J=new st;lt=new rt({recordCanvas:w,mutationCb:_,win:window,blockClass:o,blockSelector:s,mirror:dt,sampling:C.canvas,dataURLOptions:b});const U=new He({mutationCb:Y,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:F,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:w,inlineImages:T,sampling:C,slimDOMOptions:G,iframeManager:P,stylesheetManager:z,canvasManager:lt,keepIframeSrcFn:O,processedNodeManager:J},mirror:dt});at=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!v)return;it({type:ue.Meta,data:{href:window.location.href,width:q(),height:Q()}},e),z.reset(),U.init(),Ne.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new p,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:u,maskInputFn:h,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=(()=>!1)}=t||{};return H(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:u,maskInputFn:h,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,dataURLOptions:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:I,iframeLoadTimeout:C,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v,newlyAddedElement:!1})}(document,{mirror:dt,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:F,maskTextFn:f,maskInputFn:g,slimDOM:G,dataURLOptions:b,recordCanvas:w,inlineImages:T,onSerialize:e=>{oe(e,dt)&&P.addIframe(e),se(e,dt)&&z.trackLinkElement(e),ie(e)&&U.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{P.attachIframe(e,t),U.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");it({type:ue.FullSnapshot,data:{node:t,initialOffset:j(window)}},e),Ne.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,dt.getId(document))};try{const e=[],t=e=>{var t;return Ae(Be)({mutationCb:Y,mousemoveCb:(e,t)=>it({type:ue.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.MouseInteraction,...e}}),scrollCb:V,viewportResizeCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.ViewportResize,...e}}),inputCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.Input,...e}}),mediaInteractionCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.MediaInteraction,...e}}),styleSheetRuleCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.StyleSheetRule,...e}}),styleDeclarationCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.StyleDeclaration,...e}}),canvasMutationCb:_,fontCb:e=>it({type:ue.IncrementalSnapshot,data:{source:he.Font,...e}}),selectionCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:he.Selection,...e}})},customElementCb:e=>{it({type:ue.IncrementalSnapshot,data:{source:he.CustomElement,...e}})},blockClass:o,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:d,sampling:C,recordDOM:v,recordCanvas:w,inlineImages:T,userTriggeredOnInput:A,collectFonts:N,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:O,blockSelector:s,slimDOMOptions:G,dataURLOptions:b,mirror:dt,iframeManager:P,stylesheetManager:z,shadowDomManager:U,processedNodeManager:J,canvasManager:lt,ignoreCSSAttributes:R,plugins:(null==(t=null==E?void 0:E.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>it({type:ue.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},y)};P.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{at(),e.push(t(document)),ct=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(X("DOMContentLoaded",(()=>{it({type:ue.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&n()}))),e.push(X("load",(()=>{it({type:ue.Load,data:{}}),"load"===k&&n()}),window))),()=>{e.forEach((e=>e())),J.destroy(),ct=!1,ke=void 0}}catch(e){console.warn(e)}}var ht,pt;ut.addCustomEvent=(e,t)=>{if(!ct)throw new Error("please add custom event after start recording");it({type:ue.Custom,data:{tag:e,payload:t}})},ut.freezePage=()=>{Ne.forEach((e=>e.freeze()))},ut.takeFullSnapshot=e=>{if(!ct)throw new Error("please take full snapshot after start recording");at(e)},ut.mirror=dt,(pt=ht||(ht={}))[pt.NotStarted=0]="NotStarted",pt[pt.Running=1]="Running",pt[pt.Stopped=2]="Stopped";const mt="2.0.0-alpha.16";var gt,ft=Object.defineProperty,yt=(e,t,n)=>(((e,t,n)=>{t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),It=Object.defineProperty,Ct=(e,t,n)=>(((e,t,n)=>{t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),bt=Object.defineProperty,St=(e,t,n)=>(((e,t,n)=>{t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class vt{constructor(){St(this,"idNodeMap",new Map),St(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-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){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&wt(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&wt(e.parentNode,t,n)}const Mt="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.";let kt={map:{},getId:()=>(console.error(Mt),-1),getNode:()=>(console.error(Mt),null),removeNodeFromMap(){console.error(Mt)},has:()=>(console.error(Mt),!1),reset(){console.error(Mt)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(kt=new Proxy(kt,{get:(e,t,n)=>("map"===t&&console.error(Mt),Reflect.get(e,t,n))}));let At=Date.now;function Nt(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}/[1-9][0-9]{12}/.test(Date.now().toString())||(At=()=>(new Date).getTime());function Tt(e){var t,n;let r=null;return(null==(n=null==(t=e.getRootNode)?void 0:t.call(e))?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function Et(e){let t,n=e;for(;t=Tt(n);)n=t;return n}function Ot(e){const t=e.ownerDocument;if(!t)return!1;const n=Et(e);return t.contains(n)}const Rt=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ct(this,"id",1),Ct(this,"styleIDMap",new WeakMap),Ct(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){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return kt},closestElementOfNode:Nt,getBaseDimension:function e(t,n){var r,o;const s=null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.frameElement;if(!s||s===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=s.getBoundingClientRect(),a=e(s,n),l=i.height/s.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:Et,getShadowHost:Tt,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,o,s,i;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null==(n=null==(t=null==a?void 0:a.body)?void 0:t.parentElement)?void 0:n.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==(s=null==(o=null==a?void 0:a.body)?void 0:o.parentElement)?void 0:s.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return Boolean(null==e?void 0:e.shadowRoot)},hookSetter:function e(t,n,r,o){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const i=s.Object.getOwnPropertyDescriptor(t,n);return s.Object.defineProperty(t,n,o?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,n,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Ot(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const o=Nt(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(wt(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return At},on:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=r.indexOf(s);r.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else r.push(n(o,null))}return r},shadowHostInDom:Ot,throttle:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];const l=Date.now();o||!1!==n.leading||(o=l);const c=t-(l-o),d=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(d,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(d,i)}),c))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dt=0;Dt<64;Dt++)xt[Lt.charCodeAt(Dt)]=Dt;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpCiAgICAgICAgcmV0dXJuIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgIHJldHVybiBiYXNlNjQ7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gIiI7CiAgICB9CiAgfQogIGNvbnN0IHdvcmtlciA9IHNlbGY7CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGlmICgiT2Zmc2NyZWVuQ2FudmFzIiBpbiBnbG9iYWxUaGlzKSB7CiAgICAgIGNvbnN0IHsgaWQsIGJpdG1hcCwgd2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMgfSA9IGUuZGF0YTsKICAgICAgY29uc3QgdHJhbnNwYXJlbnRCYXNlNjQgPSBnZXRUcmFuc3BhcmVudEJsb2JGb3IoCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGRhdGFVUkxPcHRpb25zCiAgICAgICk7CiAgICAgIGNvbnN0IG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7CiAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCIyZCIpOwogICAgICBjdHguZHJhd0ltYWdlKGJpdG1hcCwgMCwgMCk7CiAgICAgIGJpdG1hcC5jbG9zZSgpOwogICAgICBjb25zdCBibG9iID0gYXdhaXQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOwogICAgICBjb25zdCB0eXBlID0gYmxvYi50eXBlOwogICAgICBjb25zdCBhcnJheUJ1ZmZlciA9IGF3YWl0IGJsb2IuYXJyYXlCdWZmZXIoKTsKICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsKICAgICAgaWYgKCFsYXN0QmxvYk1hcC5oYXMoaWQpICYmIGF3YWl0IHRyYW5zcGFyZW50QmFzZTY0ID09PSBiYXNlNjQpIHsKICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpCiAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UoewogICAgICAgIGlkLAogICAgICAgIHR5cGUsCiAgICAgICAgYmFzZTY0LAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodAogICAgICB9KTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBlLmRhdGEuaWQgfSk7CiAgICB9CiAgfTsKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1CWjFyN1JKRC5qcy5tYXAK")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(gt=e.contentWindow)?void 0:gt.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft;new vt,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Ft||(Ft={}));class Gt{constructor(e){yt(this,"fileName"),yt(this,"functionName"),yt(this,"lineNumber"),yt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Bt=/(^|@)\S+:\d+/,Wt=/^\s*at .*(\S+:\d+|\(native\))/m,Zt=/^(eval@)?(\[native code])?$/,Yt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Wt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const 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:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Wt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),s=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Gt({functionName:s,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Zt)}),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 Gt({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Gt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}}),this)},parseOpera:function(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:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Gt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Gt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Bt)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Gt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Vt(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Ht(e){return"[object Object]"===Object.prototype.toString.call(e)}function Xt(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Ht(e[r])&&Xt(e[r],t-1))return!0;return!1}function _t(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ht(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ht(e)&&Xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Vt(r.length?r[0]:null):e[n]=r}return e}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}))}const zt={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 Pt(e,t,n){const r=n?Object.assign({},zt,n):zt,o=r.logger;if(!o)return()=>{};let s;s="string"==typeof o?t[o]:o;let i=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,s=Yt.parse(o).map((e=>e.toString())),i=[_t(n,r.stringifyOptions)];e({level:"error",trace:s,payload:i})};t.addEventListener("error",n),l.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[_t(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[_t("Uncaught (in promise)",r.stringifyOptions),_t(t.reason,r.stringifyOptions)]);const s=Yt.parse(n).map((e=>e.toString()));e({level:"error",trace:s,payload:o})};t.addEventListener("unhandledrejection",o),l.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)l.push(c(s,e));return()=>{l.forEach((e=>e()))};function c(t,n){var o=this;return t[n]?Rt.patch(t,n,(t=>function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];if(t.apply(o,l),!a){a=!0;try{const t=Yt.parse(new Error).map((e=>e.toString())).splice(1),o=l.map((e=>_t(e,r.stringifyOptions)));i++,i<r.lengthThreshold?e({level:n,trace:t,payload:o}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[_t("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}const Jt=e=>({name:"rrweb/console@1",observer:Pt,options:e}),Ut=Array.isArray,Kt=Object.prototype,jt=Kt.hasOwnProperty,Qt=Kt.toString,qt=Ut||function(e){return"[object Array]"===Qt.call(e)},$t=function(e){return"function"==typeof e},en=function(e){return e===Object(e)&&!qt(e)},tn=function(e){return void 0===e},nn=function(e){return"[object String]"==Qt.call(e)},rn=function(e){return null===e},on=function(e){return tn(e)||rn(e)},sn=function(e){return"[object Boolean]"===Qt.call(e)},an=e=>e instanceof Document,ln=e=>e instanceof FormData,cn="undefined"!=typeof window?window:void 0,dn="undefined"!=typeof globalThis?globalThis:cn,un=Array.prototype.forEach,hn=null==dn?void 0:dn.navigator;null==dn||dn.document,null==dn||dn.location,null==dn||dn.fetch,null!=dn&&dn.XMLHttpRequest&&"withCredentials"in new dn.XMLHttpRequest&&dn.XMLHttpRequest,null==dn||dn.AbortController,null==hn||hn.userAgent;const pn=null!=cn?cn:{},mn="[PostHog.js]",gn={_log:function(e){if(cn&&pn.POSTHOG_DEBUG&&!tn(cn.console)&&cn.console){const o="__rrweb_original__"in cn.console[e]?cn.console[e].__rrweb_original__:cn.console[e];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o(mn,...n)}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];gn._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];gn._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];gn._log("error",...t)},critical:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(mn,...t)},uninitializedWarning:e=>{gn.error(`You must initialize PostHog before calling ${e}`)}},fn={};function yn(e,t,n){if(!on(e)){if(qt(e))return function(e,t,n){if(qt(e))if(un&&e.forEach===un)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(let r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===fn)return}(e,t,n);if(ln(e)){for(const r of e.entries())if(t.call(n,r[1],r[0])===fn)return}else for(const r in e)if(jt.call(e,r)&&t.call(n,e[r],r)===fn)return}}const In=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const o=[];return yn(e,(function(e,r){tn(e)||tn(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},Cn={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]};function bn(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return $t(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Sn(e,t){var n;const r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch{return null}}(e),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;for(const e of t.payloadHostDenyList)if(r.endsWith(e))return{hostname:r,isHostDenied:!0};return o}const vn=e=>"navigation"===e.entryType,wn=e=>"resource"===e.entryType;function Mn(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function kn(e,t,n){if(n.recordInitialRequests){const r=t.performance.getEntries().filter((e=>vn(e)||wn(e)&&n.initiatorTypes.includes(e.initiatorType)));e({requests:r.flatMap((e=>Rn({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}const r=new t.PerformanceObserver((t=>{const r=t.getEntries().filter((e=>vn(e)||wn(e)&&n.initiatorTypes.includes(e.initiatorType)&&(e=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:r.flatMap((e=>Rn({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>n.performanceEntryTypeToObserve.includes(e)));return r.observe({entryTypes:o}),()=>{r.disconnect()}}function An(e,t){return!!t&&(sn(t)||t[e])}function Nn(e){let{type:t,recordBody:n,headers:r}=e;function o(e){const t=Object.keys(r).find((e=>"content-type"===e.toLowerCase())),n=t&&r[t];return e.some((e=>null==n?void 0:n.includes(e)))}if(!n)return!1;if(sn(n))return!0;if(qt(n))return o(n);const s=n[t];return sn(s)?s:o(s)}async function Tn(e,t,n,r,o){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(s>10)return gn.warn("Failed to get performance entry for request",{url:n,initiatorType:t}),null;const i=Mn(e.performance.getEntriesByName(n),(e=>wn(e)&&e.initiatorType===t&&(tn(r)||e.startTime>=r)&&(tn(o)||e.startTime<=o)));return i||(await new Promise((e=>setTimeout(e,50*s))),Tn(e,t,n,r,o,s+1))}function En(e){let{body:t,options:n,url:r}=e;if(on(t))return null;const{hostname:o,isHostDenied:s}=Sn(r,n);if(s)return o+" is in deny list";if(nn(t))return t;if(an(t))return t.textContent;if(ln(t))return In(t);if(en(t))try{return JSON.stringify(t)}catch{return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const On=e=>!rn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Rn(e){let{entry:t,method:n,status:r,networkRequest:o,isInitial:s,start:i,end:a,url:l,initiatorType:c}=e;i=t?t.startTime:i,a=t?t.responseEnd:a;const d=Math.floor(Date.now()-performance.now()),u=Math.floor(d+(i||0)),h=[{...t?t.toJSON():{name:l},startTime:tn(i)?void 0:Math.round(i),endTime:tn(a)?void 0:Math.round(a),timeOrigin:d,timestamp:u,method:n,initiatorType:t?t.initiatorType:c,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s}];if(On(t))for(const e of t.serverTiming||[])h.push({timeOrigin:d,timestamp:u,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const Ln=["video/","audio/"];function xn(e){return new Promise(((t,n)=>{const r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}catch{clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}async function Dn(e){let{r:t,options:n,url:r}=e;const o=function(e){var t;let{r:n,options:r,url:o}=e;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const s=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),i=Ln.some((e=>null==s?void 0:s.startsWith(e)));if(s&&i)return`Content-Type ${s} is not supported`;const{hostname:a,isHostDenied:l}=Sn(o,r);return l?a+" is in deny list":null}({r:t,options:n,url:r});return rn(o)?xn(t):Promise.resolve(o)}function Fn(e,t,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const r=An("request",n.recordHeaders),o=An("response",n.recordHeaders),s=bn(t,"fetch",(s=>async function(i,a){const l=new Request(i,a);let c;const d={};let u,h;try{const e={};l.headers.forEach(((t,n)=>{e[n]=t})),r&&(d.requestHeaders=e),Nn({type:"request",headers:e,url:i,recordBody:n.recordBody})&&(d.requestBody=await async function(e){let{r:t,options:n,url:r}=e;const{hostname:o,isHostDenied:s}=Sn(r,n);return s?Promise.resolve(o+" is in deny list"):xn(t)}({r:l,options:n,url:i})),u=t.performance.now(),c=await s(l),h=t.performance.now();const a={};return c.headers.forEach(((e,t)=>{a[t]=e})),o&&(d.responseHeaders=a),Nn({type:"response",headers:a,url:i,recordBody:n.recordBody})&&(d.responseBody=await Dn({r:c,options:n,url:i})),c}finally{Tn(t,"fetch",l.url,u,h).then((t=>{var n;const r=Rn({entry:t,method:l.method,status:null===(n=c)||void 0===n?void 0:n.status,networkRequest:d,start:u,end:h,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((()=>{}))}}));return()=>{s()}}let Gn=null;function Bn(e,t,n){if(!("performance"in t))return()=>{};if(Gn)return gn.warn("Network observer already initialised, doing nothing"),()=>{};const r=n?Object.assign({},Cn,n):Cn,o=t=>{const n=[];t.requests.forEach((e=>{const t=r.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e({...t,requests:n})},s=kn(o,t,r);let i=()=>{},a=()=>{};return(r.recordHeaders||r.recordBody)&&(i=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const r=An("request",n.recordHeaders),o=An("response",n.recordHeaders),s=bn(t.XMLHttpRequest.prototype,"open",(s=>function(i,a){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0;const u=this,h=new Request(a),p={};let m,g;const f={},y=u.setRequestHeader.bind(u);u.setRequestHeader=(e,t)=>(f[e]=t,y(e,t)),r&&(p.requestHeaders=f);const I=u.send.bind(u);u.send=e=>(Nn({type:"request",headers:f,url:a,recordBody:n.recordBody})&&(p.requestBody=En({body:e,options:n,url:a})),m=t.performance.now(),I(e)),u.addEventListener("readystatechange",(()=>{if(u.readyState!==u.DONE)return;g=t.performance.now();const r={};u.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(p.responseHeaders=r),Nn({type:"response",headers:r,url:a,recordBody:n.recordBody})&&(p.responseBody=En({body:u.response,options:n,url:a})),Tn(t,"xmlhttprequest",h.url,m,g).then((t=>{const n=Rn({entry:t,method:h.method,status:null==u?void 0:u.status,networkRequest:p,start:m,end:g,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((()=>{}))})),s.call(u,i,a,l,c,d)}));return()=>{s()}}(o,t,r),a=Fn(o,t,r)),Gn=()=>{s(),i(),a()},Gn}const Wn="rrweb/network@1",Zn=e=>({name:Wn,observer:Bn,options:e});pn.__PosthogExtensions__=pn.__PosthogExtensions__||{},pn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Jt,getRecordNetworkPlugin:Zn},pn.__PosthogExtensions__.rrweb={record:ut,version:"v2",rrwebVersion:mt},pn.rrweb={record:ut,version:"v2",rrwebVersion:mt},pn.rrwebConsoleRecord={getRecordConsolePlugin:Jt},pn.getRecordNetworkPlugin=Zn,e.NETWORK_PLUGIN_NAME=Wn,e.default=ut,e.findLast=Mn,e.getRecordNetworkPlugin=Zn,Object.defineProperty(e,"__esModule",{value:!0})}({});
|
|
16
2
|
//# sourceMappingURL=recorder.js.map
|