@launchdarkly/browser-telemetry 0.0.3 → 0.0.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@launchdarkly/browser-telemetry",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "commonjs"
5
5
  }
@@ -2,13 +2,13 @@ import { BrowserTelemetry } from '../../api/BrowserTelemetry';
2
2
  import { Collector } from '../../api/Collector';
3
3
  import { ContinuousCapture } from './SessionReplayOptions';
4
4
  export default class ContinuousReplay implements Collector {
5
- private readonly options;
6
5
  private telemetry?;
7
6
  private buffer;
8
7
  private stopper?;
9
8
  private visibilityHandler;
10
9
  private timerHandle;
11
10
  private index;
11
+ private readonly sessionId;
12
12
  constructor(options: ContinuousCapture);
13
13
  register(telemetry: BrowserTelemetry): void;
14
14
  unregister(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ContinuousReplay.d.ts","sourceRoot":"","sources":["../../../../src/collectors/rrweb/ContinuousReplay.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,SAAS;IAS5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IARpC,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAa;IAC7B,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,KAAK,CAAa;gBAEG,OAAO,EAAE,iBAAiB;IAqBvD,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;IAOlB,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;CAKvB"}
1
+ {"version":3,"file":"ContinuousReplay.d.ts","sourceRoot":"","sources":["../../../../src/collectors/rrweb/ContinuousReplay.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,SAAS;IACxD,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAa;IAC7B,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;gBAE5B,OAAO,EAAE,iBAAiB;IAyBtC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;IAOlB,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;CAKvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SessionReplay.d.ts","sourceRoot":"","sources":["../../../../src/collectors/rrweb/SessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,OAAO,EAAqC,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAUjG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E,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAGtD"}
@@ -1,4 +1,4 @@
1
- class e{constructor(){window.addEventListener("click",(e=>{var t;const r=function(e){try{return e.target}catch(e){return}}(e);r&&(null===(t=this.destination)||void 0===t||t.addBreadcrumb({type:"click",target:{id:r.id}}))}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class t{constructor(){window.addEventListener("error",(e=>{var t;null===(t=this.destination)||void 0===t||t.captureErrorEvent(e)}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class r{constructor(r){this.pendingEvents=[],this.breadcrumbs=[],this.inspectorInstances=[],this.collectors=[],this.collectors.push(new t),this.collectors.push(...r.collectors),this.maxPendingEvents=r.maxPendingEvents,this.maxBreadcrumbs=r.breadcrumbs.maxBreadcrumbs,r.breadcrumbs.click&&this.collectors.push(new e),this.collectors.forEach((e=>e.register(this)));const n=[];!function(e,t,r){e.breadcrumbs.evaluations&&t.push({type:"flag-used",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t,n){r.handleFlagUsed(e,t,n)}}),e.breadcrumbs.flagChange&&t.push({type:"flag-detail-changed",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t){r.handleFlagDetailChanged(e,t)}})}(r,n,this),this.inspectorInstances.push(...n)}register(e){this.client=e}inspectors(){return this.inspectorInstances}capture(e,t){var r;void 0===this.client&&(this.pendingEvents.push(e),this.pendingEvents.length>this.maxPendingEvents&&this.pendingEvents.shift()),null===(r=this.client)||void 0===r||r.track(`$ld:telemetry:${t}`,e)}captureError(e){this.capture({message:e.message,name:e.name,stack:e.stack,breadcrumbs:[...this.breadcrumbs]},"error"),this.dispatchError(e)}captureErrorEvent(e){this.captureError(e.error)}captureSession(e){this.capture(Object.assign(Object.assign({},e),{breadcrumbs:[...this.breadcrumbs]}),"sessionCapture")}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}close(){this.collectors.forEach((e=>e.unregister()))}handleFlagUsed(e,t,r){this.addBreadcrumb({type:"flag-evaluated",flagKey:e,value:t.value,timestamp:(new Date).getTime()}),this.dispatchFlagUsed(e,t,r)}handleFlagDetailChanged(e,t){this.addBreadcrumb({type:"flag-detail-changed",flagKey:e,detail:t}),this.dispatchFlagDetailChanged(e,t)}dispatchError(e){this.collectors.forEach((t=>{var r;null===(r=t.handleErrorEvent)||void 0===r||r.call(t,e.name,e.message)}))}dispatchFlagUsed(e,t,r){this.collectors.forEach((n=>{var o;null===(o=n.handleFlagUsed)||void 0===o||o.call(n,e,t,r)}))}dispatchFlagDetailChanged(e,t){this.collectors.forEach((r=>{var n;null===(n=r.handleFlagDetailChanged)||void 0===n||n.call(r,e,t)}))}}var n;function o(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function i(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(a).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function a(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=i(e.styleSheet)||t}catch(e){}return t}!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"}(n||(n={}));var l=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function c(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=s?s(i):"*".repeat(i.length)),i}var d="__rrweb_original__";var u,h,p=1,g=new RegExp("[^a-z0-9-_:]"),m=-2;function I(){return p++}var C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,f=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,y=/^(data:)([^,]*),(.*)/i;function b(e,t){return(e||"").replace(C,(function(e,r,n,o,s,i){var a,l=n||s||i,c=r||o||"";if(!l)return e;if(!f.test(l))return"url(".concat(c).concat(l).concat(c,")");if(y.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var d=t.split("/"),u=l.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(c).concat(d.join("/")).concat(c,")")}))}var v=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function A(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function k(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function w(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?A(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(S),!(r>=t.length);){var s=n(v);if(","===s.slice(-1))s=A(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=A(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){o.push((s+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,o.push((s+i).trim());break}"("===l&&(a=!0)}i+=l,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?b(n,w()):"object"===t&&"data"===r&&n?A(e,n):n:A(e,n)}function T(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&T(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&T(e.parentNode,t,r)}function E(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(T(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function R(e,t){var r=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,l=t.maskTextClass,p=t.maskTextSelector,m=t.inlineStylesheet,I=t.maskInputOptions,C=void 0===I?{}:I,f=t.maskTextFn,y=t.maskInputFn,v=t.dataURLOptions,S=void 0===v?{}:v,A=t.inlineImages,T=t.recordCanvas,R=t.keepIframeSrcFn,N=t.newlyAddedElement,O=void 0!==N&&N,F=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:n.Document,childNodes:[],compatMode:e.compatMode}:{type:n.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:n.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:F};case e.ELEMENT_NODE:return function(e,t){for(var r=t.doc,o=t.blockClass,s=t.blockSelector,a=t.inlineStylesheet,l=t.maskInputOptions,p=void 0===l?{}:l,m=t.maskInputFn,I=t.dataURLOptions,C=void 0===I?{}:I,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,S=t.newlyAddedElement,A=void 0!==S&&S,T=t.rootId,E=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(e,o,s),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}(e),N={},O=e.attributes.length,F=0;F<O;F++){var x=e.attributes[F];N[x.name]=M(r,R,x.name,x.value)}if("link"===R&&a){var L=Array.from(r.styleSheets).find((function(t){return t.href===e.href})),D=null;L&&(D=i(L)),D&&(delete N.rel,delete N.href,N._cssText=b(D,L.href))}if("style"===R&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=i(e.sheet))&&(N._cssText=b(D,w()))}if("input"===R||"textarea"===R||"select"===R){var B=e.value,W=e.checked;"radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&B?N.value=c({type:N.type,tagName:R,value:B,maskInputOptions:p,maskInputFn:m}):W&&(N.checked=W)}"option"===R&&(e.selected&&!p.select?N.selected=!0:delete N.selected);if("canvas"===R&&y)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,s=d in o?o[d]:o;if(new Uint32Array(s.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(N.rr_dataURL=e.toDataURL(C.type,C.quality));else if(!("__context"in e)){var Z=e.toDataURL(C.type,C.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,Z!==G.toDataURL(C.type,C.quality)&&(N.rr_dataURL=Z)}if("img"===R&&f){u||(u=r.createElement("canvas"),h=u.getContext("2d"));var V=e,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{u.width=V.naturalWidth,u.height=V.naturalHeight,h.drawImage(V,0,0),N.rr_dataURL=u.toDataURL(C.type,C.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?N.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==R&&"video"!==R||(N.rr_mediaState=e.paused?"paused":"played",N.rr_mediaCurrentTime=e.currentTime);A||(e.scrollLeft&&(N.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(N.rr_scrollTop=e.scrollTop));if(E){var Y=e.getBoundingClientRect(),_=Y.width,P=Y.height;N={class:N.class,rr_width:"".concat(_,"px"),rr_height:"".concat(P,"px")}}"iframe"!==R||v(N.src)||(e.contentDocument||(N.rr_src=N.src),delete N.src);return{type:n.Element,tagName:R,attributes:N,childNodes:[],isSVG:k(e)||void 0,needBlock:E,rootId:T}}(e,{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:m,maskInputOptions:C,maskInputFn:y,dataURLOptions:S,inlineImages:A,recordCanvas:T,keepIframeSrcFn:R,newlyAddedElement:O,rootId:F});case e.TEXT_NODE:return function(e,t){var r,o=t.maskTextClass,s=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,l=e.parentNode&&e.parentNode.tagName,c=e.textContent,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=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=b(c,w())}var h;u&&(c="SCRIPT_PLACEHOLDER");!d&&!u&&c&&E(e,o,s)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:n.Text,textContent:c||"",isStyle:d,rootId:a}}(e,{maskTextClass:l,maskTextSelector:p,maskTextFn:f,rootId:F});case e.CDATA_SECTION_NODE:return{type:n.CDATA,textContent:"",rootId:F};case e.COMMENT_NODE:return{type:n.Comment,textContent:e.textContent||"",rootId:F};default:return!1}}function N(e){return void 0===e?"":e.toLowerCase()}function O(e,t){var r,i=t.doc,a=t.mirror,l=t.blockClass,c=t.blockSelector,d=t.maskTextClass,u=t.maskTextSelector,h=t.skipChild,p=void 0!==h&&h,g=t.inlineStylesheet,C=void 0===g||g,f=t.maskInputOptions,y=void 0===f?{}:f,b=t.maskTextFn,v=t.maskInputFn,S=t.slimDOMOptions,A=t.dataURLOptions,k=void 0===A?{}:A,w=t.inlineImages,M=void 0!==w&&w,T=t.recordCanvas,E=void 0!==T&&T,F=t.onSerialize,x=t.onIframeLoad,L=t.iframeLoadTimeout,D=void 0===L?5e3:L,B=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,Z=void 0===W?5e3:W,G=t.keepIframeSrcFn,V=void 0===G?function(){return!1}:G,U=t.newlyAddedElement,K=void 0!==U&&U,Y=t.preserveWhiteSpace,_=void 0===Y||Y,P=R(e,{doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,dataURLOptions:k,inlineImages:M,recordCanvas:E,keepIframeSrcFn:V,newlyAddedElement:K});if(!P)return console.warn(e,"not serialized"),null;r=a.hasNode(e)?a.getId(e):!function(e,t){if(t.comment&&e.type===n.Comment)return!0;if(e.type===n.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return!0}}return!1}(P,S)&&(_||P.type!==n.Text||P.isStyle||P.textContent.replace(/^\s+|\s+$/gm,"").length)?I():m;var z=Object.assign(P,{id:r});if(a.add(e,z),r===m)return null;F&&F(e);var H=!p;if(z.type===n.Element){H=H&&!z.needBlock,delete z.needBlock;var J=e.shadowRoot;J&&s(J)&&(z.isShadowHost=!0)}if((z.type===n.Document||z.type===n.Element)&&H){S.headWhitespace&&z.type===n.Element&&"head"===z.tagName&&(_=!1);for(var Q={doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:p,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V},X=0,j=Array.from(e.childNodes);X<j.length;X++){(ee=O(j[X],Q))&&z.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var q=0,$=Array.from(e.shadowRoot.childNodes);q<$.length;q++){var ee;(ee=O($[q],Q))&&(s(e.shadowRoot)&&(ee.isShadow=!0),z.childNodes.push(ee))}}return e.parentNode&&o(e.parentNode)&&s(e.parentNode)&&(z.isShadow=!0),z.type===n.Element&&"iframe"===z.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,s=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((function(){s||(t(),s=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&x){var r=O(t,{doc:t,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});r&&x(e,r)}}),D),z.type===n.Element&&"link"===z.tagName&&"stylesheet"===z.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}(e,(function(){if(B){var t=O(e,{doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:b,maskInputFn:v,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});t&&B(e,t)}}),Z),z}function F(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const x="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 L={map:{},getId:()=>(console.error(x),-1),getNode:()=>(console.error(x),null),removeNodeFromMap(){console.error(x)},has:()=>(console.error(x),!1),reset(){console.error(x)}};function D(e,t,r={}){let n=null,o=0;return function(...s){const i=Date.now();o||!1!==r.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=i,e.apply(l,s)):n||!1===r.trailing||(n=setTimeout((()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(l,s)}),a))}}function B(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>B(e,t,s||{},!0)}function W(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch(e){return()=>{}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function G(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t,r,n){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(T(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function U(e,t){return t.getId(e)===m}function K(e,t){if(o(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Y(e){return Boolean(e.changedTouches)}function _(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function P(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function z(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(L=new Proxy(L,{get:(e,t,r)=>("map"===t&&console.error(x),Reflect.get(e,t,r))}));class H{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 r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var J=(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))(J||{}),Q=(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))(Q||{}),X=(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))(X||{}),j=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(j||{});function q(e){return"__ln"in e}class ${constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)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&&q(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&q(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=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.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const ee=(e,t)=>`${e}@${t}`;class te{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],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 $,r=e=>{let t=e,r=m;for(;r===m;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{var s,i,a,l;let c=null;(null===(i=null===(s=n.getRootNode)||void 0===s?void 0:s.call(n))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(c=n.getRootNode().host);let d=c;for(;(null===(l=null===(a=null==d?void 0:d.getRootNode)||void 0===a?void 0:a.call(d))||void 0===l?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(n)||d&&this.doc.contains(d));if(!n.parentNode||u)return;const h=o(n.parentNode)?this.mirror.getId(c):this.mirror.getId(n.parentNode),p=r(n);if(-1===h||-1===p)return t.addNode(n);const g=O(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{_(e,this.mirror)&&this.iframeManager.addIframe(e),P(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),z(n)&&this.shadowDomManager.addShadowRoot(n.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:h,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))ne(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||n(e);for(const e of Array.from(this.addedSet.values()))se(this.droppedSet,e)||ne(this.removes,e,this.mirror)?se(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let s=null;for(;t.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)for(let n=t.length-1;n>=0;n--){const o=t.get(n);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===r(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),n(e.value)}const i={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).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.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!U(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;V(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:E(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=c({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),V(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;e.attributeName="rr_src"}if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==n.attributes.style&&null!==n.attributes.style||(n.attributes.style={});const o=n.attributes.style;for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);n===r.style.getPropertyValue(e)&&s===r.style.getPropertyPriority(e)||(o[e]=""===s?n:[n,s])}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else n.attributes[e.attributeName]=M(this.doc,t.tagName,e.attributeName,r);break}case"childList":if(V(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=o(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);V(e.target,this.blockClass,this.blockSelector,!1)||U(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(re(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ee(r,n)]?re(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!o(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(U(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[ee(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);V(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 re(e,t){e.delete(t),t.childNodes.forEach((t=>re(e,t)))}function ne(e,t,r){return 0!==e.length&&oe(e,t,r)}function oe(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return!!e.some((e=>e.id===o))||oe(e,n,r)}function se(e,t){return 0!==e.size&&ie(e,t)}function ie(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||ie(e,r))}const ae=[],le="undefined"!=typeof CSSGroupingRule,ce="undefined"!=typeof CSSMediaRule,de="undefined"!=typeof CSSSupportsRule,ue="undefined"!=typeof CSSConditionRule;function he(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];return e.target}catch(t){return e.target}}function pe(e,t){var r,n;const o=new te;ae.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function ge({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(X).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((s=>{const i=s.toLowerCase(),l=(t=>s=>{const i=he(s);if(V(i,n,o,!0))return;const a=Y(s)?s.changedTouches[0]:s;if(!a)return;const l=r.getId(i),{clientX:c,clientY:d}=a;e({type:X[t],id:l,x:c,y:d})})(s);a.push(F(i,l,t))})),()=>{a.forEach((e=>e()))}}function me({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){return F("scroll",D((s=>{const i=he(s);if(!i||V(i,n,o,!0))return;const a=r.getId(i);if(i===t){const r=t.scrollingElement||t.documentElement;e({id:a,x:r.scrollLeft,y:r.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),s.scroll||100),t)}function Ie(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const Ce=["INPUT","TEXTAREA","SELECT"],fe=new WeakMap;function ye(e){return function(e,t){if(le&&e.parentRule instanceof CSSGroupingRule||ce&&e.parentRule instanceof CSSMediaRule||de&&e.parentRule instanceof CSSSupportsRule||ue&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function be(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function ve({mirror:e,stylesheetManager:t},r){var n,o,s;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(s=null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=l.set)||void 0===r?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function Se(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const n=pe(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=D((t=>{const r=Date.now()-i;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],i=null}),s),c=D((e=>{const t=he(e),{clientX:r,clientY:o}=Y(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:r,y:o,id:n.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Q.Drag:e instanceof MouseEvent?Q.MouseMove:Q.TouchMove)}),o,{trailing:!1}),d=[F("mousemove",c,r),F("touchmove",c,r),F("drag",c,r)];return()=>{d.forEach((e=>e()))}}(e),s=ge(e),i=me(e),a=function({viewportResizeCb:e}){let t=-1,r=-1;return F("resize",D((()=>{const n=Z(),o=G();t===n&&r===o||(e({width:Number(o),height:Number(n)}),t=n,r=o)}),200),window)}(e),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:d}){function u(e){let r=he(e);const l=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),!r||!r.tagName||Ce.indexOf(r.tagName)<0||V(r,n,o,!0))return;const u=r.type;if(r.classList.contains(s))return;let p=r.value,g=!1;"radio"===u||"checkbox"===u?g=r.checked:(i[r.tagName.toLowerCase()]||i[u])&&(p=c({maskInputOptions:i,tagName:r.tagName,type:u,value:p,maskInputFn:a})),h(r,Ie({text:p,isChecked:g,userTriggered:l},d));const m=r.name;"radio"===u&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==r&&h(e,Ie({text:e.value,isChecked:!g,userTriggered:!1},d))}))}function h(t,n){const o=fe.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){fe.set(t,n);const o=r.getId(t);e(Object.assign(Object.assign({},n),{id:o}))}}const p=("last"===l.input?["change"]:["input","change"]).map((e=>F(e,u,t))),g=t.defaultView;if(!g)return()=>{p.forEach((e=>e()))};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),I=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...I.map((e=>B(e[0],e[1],{set(){u({target:this})}},!1,g)))),()=>{p.forEach((e=>e()))}}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){const s=s=>D((o=>{const i=he(o);if(!i||V(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d}=i;e({type:s,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:d})}),o.media||500),i=[F("play",s(0)),F("pause",s(1)),F("seeked",s(2)),F("volumechange",s(3)),F("ratechange",s(4))];return()=>{i.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(n,s){const{id:i,styleId:a}=be(this,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:n,index:s}]}),o.apply(this,[n,s])};const s=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=function(n){const{id:o,styleId:i}=be(this,t,r.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:n}]}),s.apply(this,[n])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(n){const{id:o,styleId:s}=be(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:n}),i.apply(this,[n])}),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(n){const{id:o,styleId:s}=be(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:n}),a.apply(this,[n])});const l={};le?l.CSSGroupingRule=n.CSSGroupingRule:(ce&&(l.CSSMediaRule=n.CSSMediaRule),ue&&(l.CSSConditionRule=n.CSSConditionRule),de&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach((([n,o])=>{c[n]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=be(this.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...ye(this),s||0]}]}),c[n].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=be(this.parentStyleSheet,t,r.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...ye(this),o]}]}),c[n].deleteRule.apply(this,[o])}})),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=s,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}}(e,{win:r}),h=ve(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var l;if(r.has(o))return s.apply(this,[o,i,a]);const{id:c,styleId:d}=be(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||d&&-1!==d)&&e({id:c,styleId:d,set:{property:o,value:i,priority:a},index:ye(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(r.has(o))return i.apply(this,[o]);const{id:a,styleId:l}=be(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:o},index:ye(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:r}),g=e.collectFonts?function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,r){const n=new s(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=W(t.fonts,"add",(function(t){return function(r){return setTimeout((()=>{const t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=s})),n.push(i),()=>{n.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{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;V(i,n,o,!0)||V(c,n,o,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:d})}s({ranges:a})};return a(),F("selectionchange",a)}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,r,t.options));return()=>{ae.forEach((e=>e.reset())),n.disconnect(),o(),s(),i(),a(),l(),d(),u(),h(),p(),g(),m(),I.forEach((e=>e()))}}class Ae{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),s=n||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 r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}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 ke{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ae(I),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ae(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 r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||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){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var r;switch(t.type){case J.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:J.IncrementalSnapshot,data:{source:Q.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case J.Meta:case J.Load:case J.DomContentLoaded:return!1;case J.Plugin:return t;case J.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case J.IncrementalSnapshot:switch(t.data.source){case Q.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),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 Q.Drag:case Q.TouchMove:case Q.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Q.ViewportResize:return!1;case Q.MediaInteraction:case Q.MouseInteraction:case Q.Scroll:case Q.CanvasMutation:case Q.Input:return this.replaceIds(t.data,e,["id"]),t;case Q.StyleSheetRule:case Q.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Q.Font:return t;case Q.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Q.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,r,n){for(const o of n)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class we{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(W(Element.prototype,"attachShadow",(function(e){return function(r){const n=e.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),pe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),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)),ve({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(W(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){const o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
1
+ class e{constructor(){window.addEventListener("click",(e=>{var t;const r=function(e){try{return e.target}catch(e){return}}(e);r&&(null===(t=this.destination)||void 0===t||t.addBreadcrumb({type:"click",target:{id:r.id}}))}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class t{constructor(){window.addEventListener("error",(e=>{var t;null===(t=this.destination)||void 0===t||t.captureErrorEvent(e)}),!0)}register(e){this.destination=e}unregister(){this.destination=void 0}}class r{constructor(r){this.pendingEvents=[],this.breadcrumbs=[],this.inspectorInstances=[],this.collectors=[],this.collectors.push(new t),this.collectors.push(...r.collectors),this.maxPendingEvents=r.maxPendingEvents,this.maxBreadcrumbs=r.breadcrumbs.maxBreadcrumbs,r.breadcrumbs.click&&this.collectors.push(new e),this.collectors.forEach((e=>e.register(this)));const n=[];!function(e,t,r){e.breadcrumbs.evaluations&&t.push({type:"flag-used",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t,n){r.handleFlagUsed(e,t,n)}}),e.breadcrumbs.flagChange&&t.push({type:"flag-detail-changed",name:"launchdarkly-browser-telemetry-flag-used",synchronous:!0,method(e,t){r.handleFlagDetailChanged(e,t)}})}(r,n,this),this.inspectorInstances.push(...n)}register(e){this.client=e}inspectors(){return this.inspectorInstances}capture(e,t){var r;void 0===this.client&&(this.pendingEvents.push(e),this.pendingEvents.length>this.maxPendingEvents&&this.pendingEvents.shift()),null===(r=this.client)||void 0===r||r.track(`$ld:telemetry:${t}`,e)}captureError(e){this.capture({message:e.message,name:e.name,stack:e.stack,breadcrumbs:[...this.breadcrumbs]},"error"),this.dispatchError(e)}captureErrorEvent(e){this.captureError(e.error)}captureSession(e){this.capture(Object.assign(Object.assign({},e),{breadcrumbs:[...this.breadcrumbs]}),"sessionCapture")}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}close(){this.collectors.forEach((e=>e.unregister()))}handleFlagUsed(e,t,r){this.addBreadcrumb({type:"flag-evaluated",flagKey:e,value:t.value,timestamp:(new Date).getTime()}),this.dispatchFlagUsed(e,t,r)}handleFlagDetailChanged(e,t){this.addBreadcrumb({type:"flag-detail-changed",flagKey:e,detail:t}),this.dispatchFlagDetailChanged(e,t)}dispatchError(e){this.collectors.forEach((t=>{var r;null===(r=t.handleErrorEvent)||void 0===r||r.call(t,e.name,e.message)}))}dispatchFlagUsed(e,t,r){this.collectors.forEach((n=>{var o;null===(o=n.handleFlagUsed)||void 0===o||o.call(n,e,t,r)}))}dispatchFlagDetailChanged(e,t){this.collectors.forEach((r=>{var n;null===(n=r.handleFlagDetailChanged)||void 0===n||n.call(r,e,t)}))}}var n;function o(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function i(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(a).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function a(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=i(e.styleSheet)||t}catch(e){}return t}!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"}(n||(n={}));var l=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function c(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=s?s(i):"*".repeat(i.length)),i}var d="__rrweb_original__";var u,h,p=1,g=new RegExp("[^a-z0-9-_:]"),m=-2;function I(){return p++}var C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,f=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,y=/^(data:)([^,]*),(.*)/i;function v(e,t){return(e||"").replace(C,(function(e,r,n,o,s,i){var a,l=n||s||i,c=r||o||"";if(!l)return e;if(!f.test(l))return"url(".concat(c).concat(l).concat(c,")");if(y.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var d=t.split("/"),u=l.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(c).concat(d.join("/")).concat(c,")")}))}var b=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function A(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function k(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function w(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?A(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(S),!(r>=t.length);){var s=n(b);if(","===s.slice(-1))s=A(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=A(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){o.push((s+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,o.push((s+i).trim());break}"("===l&&(a=!0)}i+=l,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?v(n,w()):"object"===t&&"data"===r&&n?A(e,n):n:A(e,n)}function T(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&T(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&T(e.parentNode,t,r)}function E(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(T(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function N(e,t){var r=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,l=t.maskTextClass,p=t.maskTextSelector,m=t.inlineStylesheet,I=t.maskInputOptions,C=void 0===I?{}:I,f=t.maskTextFn,y=t.maskInputFn,b=t.dataURLOptions,S=void 0===b?{}:b,A=t.inlineImages,T=t.recordCanvas,N=t.keepIframeSrcFn,R=t.newlyAddedElement,O=void 0!==R&&R,F=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:n.Document,childNodes:[],compatMode:e.compatMode}:{type:n.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:n.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:F};case e.ELEMENT_NODE:return function(e,t){for(var r=t.doc,o=t.blockClass,s=t.blockSelector,a=t.inlineStylesheet,l=t.maskInputOptions,p=void 0===l?{}:l,m=t.maskInputFn,I=t.dataURLOptions,C=void 0===I?{}:I,f=t.inlineImages,y=t.recordCanvas,b=t.keepIframeSrcFn,S=t.newlyAddedElement,A=void 0!==S&&S,T=t.rootId,E=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(e,o,s),N=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}(e),R={},O=e.attributes.length,F=0;F<O;F++){var x=e.attributes[F];R[x.name]=M(r,N,x.name,x.value)}if("link"===N&&a){var L=Array.from(r.styleSheets).find((function(t){return t.href===e.href})),D=null;L&&(D=i(L)),D&&(delete R.rel,delete R.href,R._cssText=v(D,L.href))}if("style"===N&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=i(e.sheet))&&(R._cssText=v(D,w()))}if("input"===N||"textarea"===N||"select"===N){var B=e.value,W=e.checked;"radio"!==R.type&&"checkbox"!==R.type&&"submit"!==R.type&&"button"!==R.type&&B?R.value=c({type:R.type,tagName:N,value:B,maskInputOptions:p,maskInputFn:m}):W&&(R.checked=W)}"option"===N&&(e.selected&&!p.select?R.selected=!0:delete R.selected);if("canvas"===N&&y)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,s=d in o?o[d]:o;if(new Uint32Array(s.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(R.rr_dataURL=e.toDataURL(C.type,C.quality));else if(!("__context"in e)){var Z=e.toDataURL(C.type,C.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,Z!==G.toDataURL(C.type,C.quality)&&(R.rr_dataURL=Z)}if("img"===N&&f){u||(u=r.createElement("canvas"),h=u.getContext("2d"));var V=e,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{u.width=V.naturalWidth,u.height=V.naturalHeight,h.drawImage(V,0,0),R.rr_dataURL=u.toDataURL(C.type,C.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?R.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==N&&"video"!==N||(R.rr_mediaState=e.paused?"paused":"played",R.rr_mediaCurrentTime=e.currentTime);A||(e.scrollLeft&&(R.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(R.rr_scrollTop=e.scrollTop));if(E){var Y=e.getBoundingClientRect(),_=Y.width,P=Y.height;R={class:R.class,rr_width:"".concat(_,"px"),rr_height:"".concat(P,"px")}}"iframe"!==N||b(R.src)||(e.contentDocument||(R.rr_src=R.src),delete R.src);return{type:n.Element,tagName:N,attributes:R,childNodes:[],isSVG:k(e)||void 0,needBlock:E,rootId:T}}(e,{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:m,maskInputOptions:C,maskInputFn:y,dataURLOptions:S,inlineImages:A,recordCanvas:T,keepIframeSrcFn:N,newlyAddedElement:O,rootId:F});case e.TEXT_NODE:return function(e,t){var r,o=t.maskTextClass,s=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,l=e.parentNode&&e.parentNode.tagName,c=e.textContent,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=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=v(c,w())}var h;u&&(c="SCRIPT_PLACEHOLDER");!d&&!u&&c&&E(e,o,s)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:n.Text,textContent:c||"",isStyle:d,rootId:a}}(e,{maskTextClass:l,maskTextSelector:p,maskTextFn:f,rootId:F});case e.CDATA_SECTION_NODE:return{type:n.CDATA,textContent:"",rootId:F};case e.COMMENT_NODE:return{type:n.Comment,textContent:e.textContent||"",rootId:F};default:return!1}}function R(e){return void 0===e?"":e.toLowerCase()}function O(e,t){var r,i=t.doc,a=t.mirror,l=t.blockClass,c=t.blockSelector,d=t.maskTextClass,u=t.maskTextSelector,h=t.skipChild,p=void 0!==h&&h,g=t.inlineStylesheet,C=void 0===g||g,f=t.maskInputOptions,y=void 0===f?{}:f,v=t.maskTextFn,b=t.maskInputFn,S=t.slimDOMOptions,A=t.dataURLOptions,k=void 0===A?{}:A,w=t.inlineImages,M=void 0!==w&&w,T=t.recordCanvas,E=void 0!==T&&T,F=t.onSerialize,x=t.onIframeLoad,L=t.iframeLoadTimeout,D=void 0===L?5e3:L,B=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,Z=void 0===W?5e3:W,G=t.keepIframeSrcFn,V=void 0===G?function(){return!1}:G,U=t.newlyAddedElement,K=void 0!==U&&U,Y=t.preserveWhiteSpace,_=void 0===Y||Y,P=N(e,{doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,inlineStylesheet:C,maskInputOptions:y,maskTextFn:v,maskInputFn:b,dataURLOptions:k,inlineImages:M,recordCanvas:E,keepIframeSrcFn:V,newlyAddedElement:K});if(!P)return console.warn(e,"not serialized"),null;r=a.hasNode(e)?a.getId(e):!function(e,t){if(t.comment&&e.type===n.Comment)return!0;if(e.type===n.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===R(e.attributes.name)||"icon"===R(e.attributes.rel)||"apple-touch-icon"===R(e.attributes.rel)||"shortcut icon"===R(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===R(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===R(e.attributes.name)||"googlebot"===R(e.attributes.name)||"bingbot"===R(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===R(e.attributes.name)||"generator"===R(e.attributes.name)||"framework"===R(e.attributes.name)||"publisher"===R(e.attributes.name)||"progid"===R(e.attributes.name)||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===R(e.attributes.name)||"yandex-verification"===R(e.attributes.name)||"csrf-token"===R(e.attributes.name)||"p:domain_verify"===R(e.attributes.name)||"verify-v1"===R(e.attributes.name)||"verification"===R(e.attributes.name)||"shopify-checkout-api-token"===R(e.attributes.name)))return!0}}return!1}(P,S)&&(_||P.type!==n.Text||P.isStyle||P.textContent.replace(/^\s+|\s+$/gm,"").length)?I():m;var z=Object.assign(P,{id:r});if(a.add(e,z),r===m)return null;F&&F(e);var J=!p;if(z.type===n.Element){J=J&&!z.needBlock,delete z.needBlock;var Q=e.shadowRoot;Q&&s(Q)&&(z.isShadowHost=!0)}if((z.type===n.Document||z.type===n.Element)&&J){S.headWhitespace&&z.type===n.Element&&"head"===z.tagName&&(_=!1);for(var H={doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:p,inlineStylesheet:C,maskInputOptions:y,maskTextFn:v,maskInputFn:b,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V},X=0,j=Array.from(e.childNodes);X<j.length;X++){(ee=O(j[X],H))&&z.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var q=0,$=Array.from(e.shadowRoot.childNodes);q<$.length;q++){var ee;(ee=O($[q],H))&&(s(e.shadowRoot)&&(ee.isShadow=!0),z.childNodes.push(ee))}}return e.parentNode&&o(e.parentNode)&&s(e.parentNode)&&(z.isShadow=!0),z.type===n.Element&&"iframe"===z.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,s=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((function(){s||(t(),s=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&x){var r=O(t,{doc:t,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:v,maskInputFn:b,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});r&&x(e,r)}}),D),z.type===n.Element&&"link"===z.tagName&&"stylesheet"===z.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}(e,(function(){if(B){var t=O(e,{doc:i,mirror:a,blockClass:l,blockSelector:c,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:C,maskInputOptions:y,maskTextFn:v,maskInputFn:b,slimDOMOptions:S,dataURLOptions:k,inlineImages:M,recordCanvas:E,preserveWhiteSpace:_,onSerialize:F,onIframeLoad:x,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:Z,keepIframeSrcFn:V});t&&B(e,t)}}),Z),z}function F(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const x="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 L={map:{},getId:()=>(console.error(x),-1),getNode:()=>(console.error(x),null),removeNodeFromMap(){console.error(x)},has:()=>(console.error(x),!1),reset(){console.error(x)}};function D(e,t,r={}){let n=null,o=0;return function(...s){const i=Date.now();o||!1!==r.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=i,e.apply(l,s)):n||!1===r.trailing||(n=setTimeout((()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(l,s)}),a))}}function B(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>B(e,t,s||{},!0)}function W(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch(e){return()=>{}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function G(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t,r,n){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(T(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function U(e,t){return t.getId(e)===m}function K(e,t){if(o(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Y(e){return Boolean(e.changedTouches)}function _(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function P(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function z(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(L=new Proxy(L,{get:(e,t,r)=>("map"===t&&console.error(x),Reflect.get(e,t,r))}));class J{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 r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var Q=(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))(Q||{}),H=(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))(H||{}),X=(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))(X||{}),j=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(j||{});function q(e){return"__ln"in e}class ${constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)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&&q(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&q(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=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.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const ee=(e,t)=>`${e}@${t}`;class te{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],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 $,r=e=>{let t=e,r=m;for(;r===m;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{var s,i,a,l;let c=null;(null===(i=null===(s=n.getRootNode)||void 0===s?void 0:s.call(n))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(c=n.getRootNode().host);let d=c;for(;(null===(l=null===(a=null==d?void 0:d.getRootNode)||void 0===a?void 0:a.call(d))||void 0===l?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(n)||d&&this.doc.contains(d));if(!n.parentNode||u)return;const h=o(n.parentNode)?this.mirror.getId(c):this.mirror.getId(n.parentNode),p=r(n);if(-1===h||-1===p)return t.addNode(n);const g=O(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{_(e,this.mirror)&&this.iframeManager.addIframe(e),P(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),z(n)&&this.shadowDomManager.addShadowRoot(n.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:h,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))ne(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||n(e);for(const e of Array.from(this.addedSet.values()))se(this.droppedSet,e)||ne(this.removes,e,this.mirror)?se(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let s=null;for(;t.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)for(let n=t.length-1;n>=0;n--){const o=t.get(n);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===r(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),n(e.value)}const i={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).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.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!U(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;V(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:E(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=c({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),V(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;e.attributeName="rr_src"}if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==n.attributes.style&&null!==n.attributes.style||(n.attributes.style={});const o=n.attributes.style;for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);n===r.style.getPropertyValue(e)&&s===r.style.getPropertyPriority(e)||(o[e]=""===s?n:[n,s])}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else n.attributes[e.attributeName]=M(this.doc,t.tagName,e.attributeName,r);break}case"childList":if(V(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=o(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);V(e.target,this.blockClass,this.blockSelector,!1)||U(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(re(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ee(r,n)]?re(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!o(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(U(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[ee(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);V(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 re(e,t){e.delete(t),t.childNodes.forEach((t=>re(e,t)))}function ne(e,t,r){return 0!==e.length&&oe(e,t,r)}function oe(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return!!e.some((e=>e.id===o))||oe(e,n,r)}function se(e,t){return 0!==e.size&&ie(e,t)}function ie(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||ie(e,r))}const ae=[],le="undefined"!=typeof CSSGroupingRule,ce="undefined"!=typeof CSSMediaRule,de="undefined"!=typeof CSSSupportsRule,ue="undefined"!=typeof CSSConditionRule;function he(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];return e.target}catch(t){return e.target}}function pe(e,t){var r,n;const o=new te;ae.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function ge({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(X).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e])).forEach((s=>{const i=s.toLowerCase(),l=(t=>s=>{const i=he(s);if(V(i,n,o,!0))return;const a=Y(s)?s.changedTouches[0]:s;if(!a)return;const l=r.getId(i),{clientX:c,clientY:d}=a;e({type:X[t],id:l,x:c,y:d})})(s);a.push(F(i,l,t))})),()=>{a.forEach((e=>e()))}}function me({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){return F("scroll",D((s=>{const i=he(s);if(!i||V(i,n,o,!0))return;const a=r.getId(i);if(i===t){const r=t.scrollingElement||t.documentElement;e({id:a,x:r.scrollLeft,y:r.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),s.scroll||100),t)}function Ie(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const Ce=["INPUT","TEXTAREA","SELECT"],fe=new WeakMap;function ye(e){return function(e,t){if(le&&e.parentRule instanceof CSSGroupingRule||ce&&e.parentRule instanceof CSSMediaRule||de&&e.parentRule instanceof CSSSupportsRule||ue&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function ve(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function be({mirror:e,stylesheetManager:t},r){var n,o,s;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(s=null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=l.set)||void 0===r?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function Se(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const n=pe(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=D((t=>{const r=Date.now()-i;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],i=null}),s),c=D((e=>{const t=he(e),{clientX:r,clientY:o}=Y(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:r,y:o,id:n.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?H.Drag:e instanceof MouseEvent?H.MouseMove:H.TouchMove)}),o,{trailing:!1}),d=[F("mousemove",c,r),F("touchmove",c,r),F("drag",c,r)];return()=>{d.forEach((e=>e()))}}(e),s=ge(e),i=me(e),a=function({viewportResizeCb:e}){let t=-1,r=-1;return F("resize",D((()=>{const n=Z(),o=G();t===n&&r===o||(e({width:Number(o),height:Number(n)}),t=n,r=o)}),200),window)}(e),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:d}){function u(e){let r=he(e);const l=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),!r||!r.tagName||Ce.indexOf(r.tagName)<0||V(r,n,o,!0))return;const u=r.type;if(r.classList.contains(s))return;let p=r.value,g=!1;"radio"===u||"checkbox"===u?g=r.checked:(i[r.tagName.toLowerCase()]||i[u])&&(p=c({maskInputOptions:i,tagName:r.tagName,type:u,value:p,maskInputFn:a})),h(r,Ie({text:p,isChecked:g,userTriggered:l},d));const m=r.name;"radio"===u&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==r&&h(e,Ie({text:e.value,isChecked:!g,userTriggered:!1},d))}))}function h(t,n){const o=fe.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){fe.set(t,n);const o=r.getId(t);e(Object.assign(Object.assign({},n),{id:o}))}}const p=("last"===l.input?["change"]:["input","change"]).map((e=>F(e,u,t))),g=t.defaultView;if(!g)return()=>{p.forEach((e=>e()))};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),I=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...I.map((e=>B(e[0],e[1],{set(){u({target:this})}},!1,g)))),()=>{p.forEach((e=>e()))}}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){const s=s=>D((o=>{const i=he(o);if(!i||V(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d}=i;e({type:s,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:d})}),o.media||500),i=[F("play",s(0)),F("pause",s(1)),F("seeked",s(2)),F("volumechange",s(3)),F("ratechange",s(4))];return()=>{i.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(n,s){const{id:i,styleId:a}=ve(this,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:n,index:s}]}),o.apply(this,[n,s])};const s=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=function(n){const{id:o,styleId:i}=ve(this,t,r.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:n}]}),s.apply(this,[n])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(n){const{id:o,styleId:s}=ve(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:n}),i.apply(this,[n])}),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(n){const{id:o,styleId:s}=ve(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:n}),a.apply(this,[n])});const l={};le?l.CSSGroupingRule=n.CSSGroupingRule:(ce&&(l.CSSMediaRule=n.CSSMediaRule),ue&&(l.CSSConditionRule=n.CSSConditionRule),de&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach((([n,o])=>{c[n]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=ve(this.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...ye(this),s||0]}]}),c[n].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=ve(this.parentStyleSheet,t,r.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...ye(this),o]}]}),c[n].deleteRule.apply(this,[o])}})),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=s,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}}(e,{win:r}),h=be(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var l;if(r.has(o))return s.apply(this,[o,i,a]);const{id:c,styleId:d}=ve(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||d&&-1!==d)&&e({id:c,styleId:d,set:{property:o,value:i,priority:a},index:ye(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(r.has(o))return i.apply(this,[o]);const{id:a,styleId:l}=ve(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:o},index:ye(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:r}),g=e.collectFonts?function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,r){const n=new s(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=W(t.fonts,"add",(function(t){return function(r){return setTimeout((()=>{const t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=s})),n.push(i),()=>{n.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{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;V(i,n,o,!0)||V(c,n,o,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:d})}s({ranges:a})};return a(),F("selectionchange",a)}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,r,t.options));return()=>{ae.forEach((e=>e.reset())),n.disconnect(),o(),s(),i(),a(),l(),d(),u(),h(),p(),g(),m(),I.forEach((e=>e()))}}class Ae{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),s=n||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 r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}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 ke{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ae(I),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ae(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 r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||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){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Q.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Q.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return t;case Q.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Q.IncrementalSnapshot:switch(t.data.source){case H.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),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 H.Drag:case H.TouchMove:case H.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(t.data,e,["id"]),t;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case H.Font:return t;case H.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case H.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,r,n){for(const o of n)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class we{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(W(Element.prototype,"attachShadow",(function(e){return function(r){const n=e.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),pe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),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)),be({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(W(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){const o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Me(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}l((n=n.apply(e,t||[])).next())}))}for(var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ee="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Re=0;Re<64;Re++)Ee[Te.charCodeAt(Re)]=Re;const Ne=new Map;const Oe=(e,t,r)=>{if(!e||!Le(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Ne.get(e);return r||(r=new Map,Ne.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function Fe(e,t,r){if(e instanceof Array)return e.map((e=>Fe(e,t,r)));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,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=Te[r[t]>>2],o+=Te[(3&r[t])<<4|r[t+1]>>4],o+=Te[(15&r[t+1])<<2|r[t+2]>>6],o+=Te[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Fe(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Fe(e.data,t,r),e.width,e.height]}}if(Le(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Oe(e,t,r)}}return e}const xe=(e,t,r)=>[...e].map((e=>Fe(e,t,r))),Le=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function De(e,t,r){const n=[];try{const o=W(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n,...o){return V(this,t,r,!0)||"__context"in this||(this.__context=n),e.apply(this,[n,...o])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Be(e,t,r,n,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=W(e,s,(function(e){return function(...a){const l=e.apply(this,a);if(Oe(l,i,this),!V(this.canvas,n,o,!0)){const e=xe([...a],i,this),n={type:t,property:s,args:e};r(this.canvas,n)}return l}}));a.push(l)}catch(n){const o=B(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var We=null;try{var Ze="undefined"!=typeof module&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||require("worker_threads");We=Ze.Worker}catch(e){}function Ge(e,t,r){var n=void 0===t?null:t,o=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),s=o.indexOf("\n",10)+1,i=o.substring(s)+(n?"//# sourceMappingURL="+n:"");return function(e){return new We(i,Object.assign({},e,{eval:!0}))}}function Ve(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),s=o.indexOf("\n",10)+1,i=o.substring(s)+(n?"//# sourceMappingURL="+n:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var Ue="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ke,Ye,_e,Pe=(Ke="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sI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zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ye=null,_e=!1,Ue?Ge(Ke,Ye,_e):function(e,t,r){var n;return function(o){return n=n||Ve(e,t,r),new Worker(n,o)}}(Ke,Ye,_e));class ze{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:r,blockClass:n,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:i})}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,r,n,o){const s=De(t,r,n),i=new Map,a=new Pe;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:s}=e.data;this.mutationCb({id:t,type:j["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{V(t,r,n,!0)||e.push(t)})),e})().forEach((e=>Me(this,void 0,void 0,(function*(){var t;const r=this.mirror.getId(e);if(i.get(r))return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==r||r.clear(r.COLOR_BUFFER_BIT))}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))))),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=De(e,t,r),o=function(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=W(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(...s){return V(this.canvas,r,n,!0)||setTimeout((()=>{const r=xe([...s],t,this);e(this.canvas,{type:j["2D"],property:i,args:r})}),0),o.apply(this,s)}}));o.push(s)}catch(r){const n=B(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:j["2D"],property:i,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,n,o){const s=[];return s.push(...Be(t.WebGLRenderingContext.prototype,j.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Be(t.WebGL2RenderingContext.prototype,j.WebGL2,e,r,n,0,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),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 r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class He{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new H,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 r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const r=Array.from(t.rules||CSSRule);n.push({styleId:e,rules:r.map(((e,t)=>({rule:a(e),index:t})))})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Je(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Qe,Xe,je,qe=!1;const $e=new l;function et(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:I,packFn:C,sampling:f={},dataURLOptions:y={},mousemoveWait:b,recordCanvas:v=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:w=!1,plugins:M,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:E=new Set([])}=e,R=!S||window.parent===window;let N=!1;if(!R)try{window.parent.document,N=!1}catch(e){N=!0}if(R&&!t)throw new Error("emit function is required");void 0!==b&&void 0===f.mousemove&&(f.mousemove=b),$e.reset();const x=!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},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let D;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const W=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return C&&(e=C(e)),e};Qe=(e,o)=>{var s;if(!(null===(s=ae[0])||void 0===s?void 0:s.isFrozen())||e.type===J.FullSnapshot||e.type===J.IncrementalSnapshot&&e.data.source===Q.Mutation||ae.forEach((e=>e.unfreeze())),R)null==t||t(W(e),o);else if(N){const t={type:"rrweb",event:W(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===J.FullSnapshot)D=e,B=0;else if(e.type===J.IncrementalSnapshot){if(e.data.source===Q.Mutation&&e.data.isAttachIframe)return;B++;const t=n&&B>=n,o=r&&e.timestamp-D.timestamp>r;(t||o)&&Xe(!0)}};const V=e=>{Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.Mutation},e)}))},U=e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.Scroll},e)})),K=e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.CanvasMutation},e)})),Y=new He({mutationCb:V,adoptedStyleSheetCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.AdoptedStyleSheet},e)}))}),H=new ke({mirror:$e,mutationCb:V,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:Qe});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:$e,crossOriginIframeMirror:H.crossOriginIframeMirror,crossOriginIframeStyleMirror:H.crossOriginIframeStyleMirror});je=new ze({recordCanvas:v,mutationCb:K,win:window,blockClass:o,blockSelector:s,mirror:$e,sampling:f.canvas,dataURLOptions:y});const X=new we({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:x,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:v,inlineImages:w,sampling:f,slimDOMOptions:L,iframeManager:H,stylesheetManager:Y,canvasManager:je,keepIframeSrcFn:T},mirror:$e});Xe=(e=!1)=>{var t,r,n,i,u,h;Qe(Je({type:J.Meta,data:{href:window.location.href,width:G(),height:Z()}}),e),Y.reset(),ae.forEach((e=>e.lock()));const p=function(e,t){var r=t||{},n=r.mirror,o=void 0===n?new l:n,s=r.blockClass,i=void 0===s?"rr-block":s,a=r.blockSelector,c=void 0===a?null:a,d=r.maskTextClass,u=void 0===d?"rr-mask":d,h=r.maskTextSelector,p=void 0===h?null:h,g=r.inlineStylesheet,m=void 0===g||g,I=r.inlineImages,C=void 0!==I&&I,f=r.recordCanvas,y=void 0!==f&&f,b=r.maskAllInputs,v=void 0!==b&&b,S=r.maskTextFn,A=r.maskInputFn,k=r.slimDOM,w=void 0!==k&&k,M=r.dataURLOptions,T=r.preserveWhiteSpace,E=r.onSerialize,R=r.onIframeLoad,N=r.iframeLoadTimeout,F=r.onStylesheetLoad,x=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn;return O(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===v?{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===v?{password:!0}:v,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:C,recordCanvas:y,preserveWhiteSpace:T,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:N,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:$e,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:x,maskTextFn:m,slimDOM:L,dataURLOptions:y,recordCanvas:v,inlineImages:w,onSerialize:e=>{_(e,$e)&&H.addIframe(e),P(e,$e)&&Y.trackLinkElement(e),z(e)&&X.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{H.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");Qe(Je({type:J.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),ae.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,$e.getId(document))};try{const e=[];e.push(F("DOMContentLoaded",(()=>{Qe(Je({type:J.DomContentLoaded,data:{}}))})));const t=e=>{var t;return Se({mutationCb:V,mousemoveCb:(e,t)=>Qe(Je({type:J.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.MouseInteraction},e)})),scrollCb:U,viewportResizeCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.ViewportResize},e)})),inputCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.Input},e)})),mediaInteractionCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.MediaInteraction},e)})),styleSheetRuleCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.StyleSheetRule},e)})),styleDeclarationCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.StyleDeclaration},e)})),canvasMutationCb:K,fontCb:e=>Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.Font},e)})),selectionCb:e=>{Qe(Je({type:J.IncrementalSnapshot,data:Object.assign({source:Q.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:x,inlineStylesheet:d,sampling:f,recordCanvas:v,inlineImages:w,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:T,blockSelector:s,slimDOMOptions:L,dataURLOptions:y,mirror:$e,iframeManager:H,stylesheetManager:Y,shadowDomManager:X,canvasManager:je,ignoreCSSAttributes:E,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Qe(Je({type:J.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},I)};H.addLoadListener((r=>{e.push(t(r.contentDocument))}));const r=()=>{Xe(),e.push(t(document)),qe=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():e.push(F("load",(()=>{Qe(Je({type:J.Load,data:{}})),r()}),window)),()=>{e.forEach((e=>e())),qe=!1}}catch(e){console.warn(e)}}et.addCustomEvent=(e,t)=>{if(!qe)throw new Error("please add custom event after start recording");Qe(Je({type:J.Custom,data:{tag:e,payload:t}}))},et.freezePage=()=>{ae.forEach((e=>e.freeze()))},et.takeFullSnapshot=e=>{if(!qe)throw new Error("please take full snapshot after start recording");Xe(e)},et.mirror=$e;const tt=crypto.randomUUID(),rt=`session-id/${tt}`;class nt extends XMLHttpRequest{constructor(){super(...arguments),this.tagsHeaderSet=!1,this.isLikelyLdSdk=!1}setRequestHeader(e,t){"x-launchdarkly-user-agent"===e.toLowerCase()&&(this.isLikelyLdSdk=!0);const r="x-launchdarkly-tags"===e,n=r?`${t} ${rt}`:t;super.setRequestHeader(e,n),r&&(this.tagsHeaderSet=!0)}send(e){!this.tagsHeaderSet&&this.isLikelyLdSdk&&super.setRequestHeader("x-launchdarkly-tags",rt),super.send(e)}}class ot{constructor(e){this.options=e,this.buffer=[],this.index=0,this.visibilityHandler=()=>{this.handleVisibilityChange()},document.addEventListener("visibilitychange",this.visibilityHandler,!0),this.timerHandle=setInterval((()=>{2!==this.buffer.length&&(this.recordCapture(),this.restartCapture())}),e.intervalMs),this.startCapture()}register(e){this.telemetry=e}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0,document.removeEventListener("visibilitychange",this.visibilityHandler),clearInterval(this.timerHandle)}handleVisibilityChange(){"hidden"===document.visibilityState&&(this.recordCapture(),this.restartCapture())}recordCapture(){var e;null===(e=this.telemetry)||void 0===e||e.captureSession({id:tt,events:[...this.buffer],index:this.index}),this.index+=1}startCapture(){const{buffer:e}=this;this.stopper=et({emit:t=>{e.push(t)}})}restartCapture(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.buffer.length=0,this.startCapture()}}class st{constructor(e){this.content=[],this.size=e}push(e){this.content.length<this.size&&this.content.push(e)}hasSpace(){return this.content.length<this.size}isPopulated(){return 0!==this.content.length}clear(){this.content=[]}}class it{constructor(e,t){this.buffers=[],this.writePointer=0,this.headPointer=0;for(let r=0;r<t;r+=1)this.buffers.push(new st(e))}push(e){const t=this.buffers[this.writePointer];if(!t.hasSpace())return this.writePointer<this.buffers.length-1?this.writePointer+=1:this.writePointer=0,this.buffers[this.writePointer].clear(),this.writePointer===this.headPointer&&(this.headPointer+=1,this.headPointer>=this.buffers.length-1&&(this.headPointer=0)),void this.push(e);t.push(e)}toArray(){const e=[],t=this.buffers.reduce(((e,t)=>t.isPopulated()?e+1:e),0);for(let r=this.headPointer;r<this.headPointer+t;r+=1){const t=r%this.buffers.length;e.push(...this.buffers[t].content)}return e}reset(){this.writePointer=0,this.headPointer=0,this.buffers.forEach((e=>e.clear()))}}class at{constructor(e){this.options=e,this.index=0,this.buffer=new it(e.eventSegmentLength,e.segmentBufferLength),this.startCapture()}startCapture(){this.stopper=et({checkoutEveryNth:this.options.eventSegmentLength,emit:e=>{this.buffer.push(e)}})}register(e){this.telemetry=e}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0}capture(){var e;null===(e=this.telemetry)||void 0===e||e.captureSession({id:crypto.randomUUID(),events:this.buffer.toArray(),index:this.index}),this.index+=1,this.restartCapture()}restartCapture(){var e;this.buffer.reset(),null===(e=this.stopper)||void 0===e||e.call(this),this.startCapture()}}class lt{constructor(e){window.XMLHttpRequest=nt;const t=null==e?void 0:e.capture;var r;"continuous"===(null==(r=t)?void 0:r.type)?this.impl=new ot(t):!function(e){return"rolling"===(null==e?void 0:e.type)}(t)?this.impl=new ot({type:"continuous",intervalMs:5e3}):this.impl=new at(t)}register(e){this.impl.register(e)}unregister(){this.impl.unregister()}handleFlagUsed(e,t,r){et.addCustomEvent("flag-used",{key:e,detail:t})}handleFlagDetailChanged(e,t){et.addCustomEvent("flag-detail-changed",{key:e,detail:t})}handleErrorEvent(e,t){et.addCustomEvent("error",{name:e,message:t})}}function ct(e,t){return null!=e?e:t}function dt(e){const t=function(e){var t,r,n,o;const s={breadcrumbs:{maxBreadcrumbs:50,evaluations:!0,flagChange:!0,click:!0},maxPendingEvents:100,collectors:[]};return{breadcrumbs:{maxBreadcrumbs:ct(null===(t=e.breadcrumbs)||void 0===t?void 0:t.maxBreadcrumbs,s.breadcrumbs.maxBreadcrumbs),evaluations:ct(null===(r=e.breadcrumbs)||void 0===r?void 0:r.evaluations,s.breadcrumbs.evaluations),flagChange:ct(null===(n=e.breadcrumbs)||void 0===n?void 0:n.flagChange,s.breadcrumbs.flagChange),click:ct(null===(o=e.breadcrumbs)||void 0===o?void 0:o.click,s.breadcrumbs.click)},maxPendingEvents:ct(e.maxPendingEvents,s.maxPendingEvents),collectors:[...ct(e.collectors,s.collectors)]}}(e||{});return new r(t)}export{lt as SessionReplay,dt as initializeTelemetry};
15
+ ***************************************************************************** */function Me(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}l((n=n.apply(e,t||[])).next())}))}for(var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ee="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ne=0;Ne<64;Ne++)Ee[Te.charCodeAt(Ne)]=Ne;const Re=new Map;const Oe=(e,t,r)=>{if(!e||!Le(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Re.get(e);return r||(r=new Map,Re.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function Fe(e,t,r){if(e instanceof Array)return e.map((e=>Fe(e,t,r)));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,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=Te[r[t]>>2],o+=Te[(3&r[t])<<4|r[t+1]>>4],o+=Te[(15&r[t+1])<<2|r[t+2]>>6],o+=Te[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Fe(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Fe(e.data,t,r),e.width,e.height]}}if(Le(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Oe(e,t,r)}}return e}const xe=(e,t,r)=>[...e].map((e=>Fe(e,t,r))),Le=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function De(e,t,r){const n=[];try{const o=W(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n,...o){return V(this,t,r,!0)||"__context"in this||(this.__context=n),e.apply(this,[n,...o])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Be(e,t,r,n,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=W(e,s,(function(e){return function(...a){const l=e.apply(this,a);if(Oe(l,i,this),!V(this.canvas,n,o,!0)){const e=xe([...a],i,this),n={type:t,property:s,args:e};r(this.canvas,n)}return l}}));a.push(l)}catch(n){const o=B(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var We=null;try{var Ze="undefined"!=typeof module&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||require("worker_threads");We=Ze.Worker}catch(e){}function Ge(e,t,r){var n=void 0===t?null:t,o=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),s=o.indexOf("\n",10)+1,i=o.substring(s)+(n?"//# sourceMappingURL="+n:"");return function(e){return new We(i,Object.assign({},e,{eval:!0}))}}function Ve(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),s=o.indexOf("\n",10)+1,i=o.substring(s)+(n?"//# sourceMappingURL="+n:""),a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var Ue="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ke,Ye,_e,Pe=(Ke="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5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lmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0b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A9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ye=null,_e=!1,Ue?Ge(Ke,Ye,_e):function(e,t,r){var n;return function(o){return n=n||Ve(e,t,r),new Worker(n,o)}}(Ke,Ye,_e));class ze{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:r,blockClass:n,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:i})}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,r,n,o){const s=De(t,r,n),i=new Map,a=new Pe;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:s}=e.data;this.mutationCb({id:t,type:j["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{V(t,r,n,!0)||e.push(t)})),e})().forEach((e=>Me(this,void 0,void 0,(function*(){var t;const r=this.mirror.getId(e);if(i.get(r))return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==r||r.clear(r.COLOR_BUFFER_BIT))}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))))),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=De(e,t,r),o=function(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=W(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(...s){return V(this.canvas,r,n,!0)||setTimeout((()=>{const r=xe([...s],t,this);e(this.canvas,{type:j["2D"],property:i,args:r})}),0),o.apply(this,s)}}));o.push(s)}catch(r){const n=B(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:j["2D"],property:i,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,n,o){const s=[];return s.push(...Be(t.WebGLRenderingContext.prototype,j.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Be(t.WebGL2RenderingContext.prototype,j.WebGL2,e,r,n,0,t)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),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 r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class Je{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new J,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 r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const r=Array.from(t.rules||CSSRule);n.push({styleId:e,rules:r.map(((e,t)=>({rule:a(e),index:t})))})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Qe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let He,Xe,je,qe=!1;const $e=new l;function et(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:I,packFn:C,sampling:f={},dataURLOptions:y={},mousemoveWait:v,recordCanvas:b=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:w=!1,plugins:M,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:E=new Set([])}=e,N=!S||window.parent===window;let R=!1;if(!N)try{window.parent.document,R=!1}catch(e){R=!0}if(N&&!t)throw new Error("emit function is required");void 0!==v&&void 0===f.mousemove&&(f.mousemove=v),$e.reset();const x=!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},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let D;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const W=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return C&&(e=C(e)),e};He=(e,o)=>{var s;if(!(null===(s=ae[0])||void 0===s?void 0:s.isFrozen())||e.type===Q.FullSnapshot||e.type===Q.IncrementalSnapshot&&e.data.source===H.Mutation||ae.forEach((e=>e.unfreeze())),N)null==t||t(W(e),o);else if(R){const t={type:"rrweb",event:W(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===Q.FullSnapshot)D=e,B=0;else if(e.type===Q.IncrementalSnapshot){if(e.data.source===H.Mutation&&e.data.isAttachIframe)return;B++;const t=n&&B>=n,o=r&&e.timestamp-D.timestamp>r;(t||o)&&Xe(!0)}};const V=e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Mutation},e)}))},U=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Scroll},e)})),K=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.CanvasMutation},e)})),Y=new Je({mutationCb:V,adoptedStyleSheetCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.AdoptedStyleSheet},e)}))}),J=new ke({mirror:$e,mutationCb:V,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:He});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:$e,crossOriginIframeMirror:J.crossOriginIframeMirror,crossOriginIframeStyleMirror:J.crossOriginIframeStyleMirror});je=new ze({recordCanvas:b,mutationCb:K,win:window,blockClass:o,blockSelector:s,mirror:$e,sampling:f.canvas,dataURLOptions:y});const X=new we({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:x,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:b,inlineImages:w,sampling:f,slimDOMOptions:L,iframeManager:J,stylesheetManager:Y,canvasManager:je,keepIframeSrcFn:T},mirror:$e});Xe=(e=!1)=>{var t,r,n,i,u,h;He(Qe({type:Q.Meta,data:{href:window.location.href,width:G(),height:Z()}}),e),Y.reset(),ae.forEach((e=>e.lock()));const p=function(e,t){var r=t||{},n=r.mirror,o=void 0===n?new l:n,s=r.blockClass,i=void 0===s?"rr-block":s,a=r.blockSelector,c=void 0===a?null:a,d=r.maskTextClass,u=void 0===d?"rr-mask":d,h=r.maskTextSelector,p=void 0===h?null:h,g=r.inlineStylesheet,m=void 0===g||g,I=r.inlineImages,C=void 0!==I&&I,f=r.recordCanvas,y=void 0!==f&&f,v=r.maskAllInputs,b=void 0!==v&&v,S=r.maskTextFn,A=r.maskInputFn,k=r.slimDOM,w=void 0!==k&&k,M=r.dataURLOptions,T=r.preserveWhiteSpace,E=r.onSerialize,N=r.onIframeLoad,R=r.iframeLoadTimeout,F=r.onStylesheetLoad,x=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn;return O(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:C,recordCanvas:y,preserveWhiteSpace:T,onSerialize:E,onIframeLoad:N,iframeLoadTimeout:R,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:$e,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:x,maskTextFn:m,slimDOM:L,dataURLOptions:y,recordCanvas:b,inlineImages:w,onSerialize:e=>{_(e,$e)&&J.addIframe(e),P(e,$e)&&Y.trackLinkElement(e),z(e)&&X.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{J.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");He(Qe({type:Q.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),ae.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,$e.getId(document))};try{const e=[];e.push(F("DOMContentLoaded",(()=>{He(Qe({type:Q.DomContentLoaded,data:{}}))})));const t=e=>{var t;return Se({mutationCb:V,mousemoveCb:(e,t)=>He(Qe({type:Q.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MouseInteraction},e)})),scrollCb:U,viewportResizeCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.ViewportResize},e)})),inputCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Input},e)})),mediaInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MediaInteraction},e)})),styleSheetRuleCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleSheetRule},e)})),styleDeclarationCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleDeclaration},e)})),canvasMutationCb:K,fontCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Font},e)})),selectionCb:e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:x,inlineStylesheet:d,sampling:f,recordCanvas:b,inlineImages:w,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:T,blockSelector:s,slimDOMOptions:L,dataURLOptions:y,mirror:$e,iframeManager:J,stylesheetManager:Y,shadowDomManager:X,canvasManager:je,ignoreCSSAttributes:E,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>He(Qe({type:Q.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},I)};J.addLoadListener((r=>{e.push(t(r.contentDocument))}));const r=()=>{Xe(),e.push(t(document)),qe=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():e.push(F("load",(()=>{He(Qe({type:Q.Load,data:{}})),r()}),window)),()=>{e.forEach((e=>e())),qe=!1}}catch(e){console.warn(e)}}et.addCustomEvent=(e,t)=>{if(!qe)throw new Error("please add custom event after start recording");He(Qe({type:Q.Custom,data:{tag:e,payload:t}}))},et.freezePage=()=>{ae.forEach((e=>e.freeze()))},et.takeFullSnapshot=e=>{if(!qe)throw new Error("please take full snapshot after start recording");Xe(e)},et.mirror=$e;class tt{constructor(e){this.buffer=[],this.index=0,this.sessionId="",void 0!==typeof crypto&&"function"==typeof crypto.randomUUID&&(this.sessionId=crypto.randomUUID(),this.visibilityHandler=()=>{this.handleVisibilityChange()},document.addEventListener("visibilitychange",this.visibilityHandler,!0),this.timerHandle=setInterval((()=>{2!==this.buffer.length&&(this.recordCapture(),this.restartCapture())}),e.intervalMs),this.startCapture())}register(e){this.telemetry=e}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0,document.removeEventListener("visibilitychange",this.visibilityHandler),clearInterval(this.timerHandle)}handleVisibilityChange(){"hidden"===document.visibilityState&&(this.recordCapture(),this.restartCapture())}recordCapture(){var e;null===(e=this.telemetry)||void 0===e||e.captureSession({id:this.sessionId,events:[...this.buffer],index:this.index}),this.index+=1}startCapture(){const{buffer:e}=this;this.stopper=et({emit:t=>{e.push(t)}})}restartCapture(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.buffer.length=0,this.startCapture()}}class rt{constructor(e){this.content=[],this.size=e}push(e){this.content.length<this.size&&this.content.push(e)}hasSpace(){return this.content.length<this.size}isPopulated(){return 0!==this.content.length}clear(){this.content=[]}}class nt{constructor(e,t){this.buffers=[],this.writePointer=0,this.headPointer=0;for(let r=0;r<t;r+=1)this.buffers.push(new rt(e))}push(e){const t=this.buffers[this.writePointer];if(!t.hasSpace())return this.writePointer<this.buffers.length-1?this.writePointer+=1:this.writePointer=0,this.buffers[this.writePointer].clear(),this.writePointer===this.headPointer&&(this.headPointer+=1,this.headPointer>=this.buffers.length-1&&(this.headPointer=0)),void this.push(e);t.push(e)}toArray(){const e=[],t=this.buffers.reduce(((e,t)=>t.isPopulated()?e+1:e),0);for(let r=this.headPointer;r<this.headPointer+t;r+=1){const t=r%this.buffers.length;e.push(...this.buffers[t].content)}return e}reset(){this.writePointer=0,this.headPointer=0,this.buffers.forEach((e=>e.clear()))}}class ot{constructor(e){this.options=e,this.index=0,this.buffer=new nt(e.eventSegmentLength,e.segmentBufferLength),this.startCapture()}startCapture(){this.stopper=et({checkoutEveryNth:this.options.eventSegmentLength,emit:e=>{this.buffer.push(e)}})}register(e){this.telemetry=e}unregister(){var e;null===(e=this.stopper)||void 0===e||e.call(this),this.telemetry=void 0}capture(){var e;null===(e=this.telemetry)||void 0===e||e.captureSession({id:crypto.randomUUID(),events:this.buffer.toArray(),index:this.index}),this.index+=1,this.restartCapture()}restartCapture(){var e;this.buffer.reset(),null===(e=this.stopper)||void 0===e||e.call(this),this.startCapture()}}class st{constructor(e){const t=null==e?void 0:e.capture;var r;"continuous"===(null==(r=t)?void 0:r.type)?this.impl=new tt(t):!function(e){return"rolling"===(null==e?void 0:e.type)}(t)?this.impl=new tt({type:"continuous",intervalMs:5e3}):this.impl=new ot(t)}register(e){this.impl.register(e)}unregister(){this.impl.unregister()}handleFlagUsed(e,t,r){et.addCustomEvent("flag-used",{key:e,detail:t})}handleFlagDetailChanged(e,t){et.addCustomEvent("flag-detail-changed",{key:e,detail:t})}handleErrorEvent(e,t){et.addCustomEvent("error",{name:e,message:t})}}function it(e,t){return null!=e?e:t}function at(e){const t=function(e){var t,r,n,o;const s={breadcrumbs:{maxBreadcrumbs:50,evaluations:!0,flagChange:!0,click:!0},maxPendingEvents:100,collectors:[]};return{breadcrumbs:{maxBreadcrumbs:it(null===(t=e.breadcrumbs)||void 0===t?void 0:t.maxBreadcrumbs,s.breadcrumbs.maxBreadcrumbs),evaluations:it(null===(r=e.breadcrumbs)||void 0===r?void 0:r.evaluations,s.breadcrumbs.evaluations),flagChange:it(null===(n=e.breadcrumbs)||void 0===n?void 0:n.flagChange,s.breadcrumbs.flagChange),click:it(null===(o=e.breadcrumbs)||void 0===o?void 0:o.click,s.breadcrumbs.click)},maxPendingEvents:it(e.maxPendingEvents,s.maxPendingEvents),collectors:[...it(e.collectors,s.collectors)]}}(e||{});return new r(t)}export{st as SessionReplay,at as initializeTelemetry};
16
16
  //# sourceMappingURL=bundle.es.js.map