posthog-js 1.166.0 → 1.166.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),i=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return M()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=b(i,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d={};function p(){}function f(){}function h(){}var g={};u(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(k([])));v&&v!==t&&n.call(v,a)&&(g=v);var y=h.prototype=p.prototype=Object.create(g);function I(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,a,i,s){var u=l(e[o],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=h,u(y,"constructor",h),u(h,"constructor",f),f.displayName=u(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},I(C.prototype),u(C.prototype,i,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(c(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t,n,r,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}var m,v="2.0.0-alpha.13";function y(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(b).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function b(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=C(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(m||(m={}));var S=function(){function e(){s(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return c(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function w(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,a=e.value,i=e.maskInputFn,s=a||"",u=o&&A(o);return(n[r.toLowerCase()]||u&&n[u])&&(s=i?i(s,t):"*".repeat(s.length)),s}function A(e){return e.toLowerCase()}var k="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}function T(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}var N,O,E=1,R=new RegExp("[^a-z0-9-_:]"),x=-2;function L(){return E++}var F=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,B=/^www\..*/i,W=/^(data:)([^,]*),(.*)/i;function G(e,t){return(e||"").replace(F,(function(e,n,r,o,a,i){var s,u=r||a||i,c=n||o||"";if(!u)return e;if(D.test(u)||B.test(u))return"url(".concat(c).concat(u).concat(c,")");if(W.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),d=u.split("/");l.pop();var p,f=g(d);try{for(f.s();!(p=f.n()).done;){var h=p.value;"."!==h&&(".."===h?l.pop():l.push(h))}}catch(e){f.e(e)}finally{f.f()}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var V=/^[^ \t\n\r\u000c]+/,Z=/^[, \t\n\r\u000c]+/;function U(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function _(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function K(){var e=document.createElement("a");return e.href="",e.href}function j(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?U(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(Z),!(n>=t.length);){var a=r(V);if(","===a.slice(-1))a=U(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=U(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n?G(r,K()):"object"===t&&"data"===n?U(e,r):r:U(e,r):r}function H(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function P(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&P(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&P(e.parentNode,t,n)}function Y(e,t,n,r){try{var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(".".concat(t)))return!0}else if(o.classList.contains(t))return!0}else if(P(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function q(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.needsMask,s=t.inlineStylesheet,u=t.maskInputOptions,c=void 0===u?{}:u,l=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,h=t.inlineImages,g=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,I=void 0!==y&&y,b=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:m.Document,childNodes:[],compatMode:e.compatMode}:{type:m.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:m.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,o=t.blockClass,a=t.blockSelector,i=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,c=t.maskInputFn,l=t.dataURLOptions,d=void 0===l?{}:l,p=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,g=t.newlyAddedElement,v=void 0!==g&&g,y=t.rootId,I=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,o,a),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return R.test(t)?"div":t}(e),S={},T=e.attributes.length,E=0;E<T;E++){var x=e.attributes[E];H(b,x.name,x.value)||(S[x.name]=j(r,b,A(x.name),x.value))}if("link"===b&&i){var L=e.href,F=Array.from(r.styleSheets).find((function(e){return e.href===L}));if(!F&&L.includes(".css")){var D=window.location.origin+"/"+L.replace(window.location.href,"");F=Array.from(r.styleSheets).find((function(e){return e.href===D}))}var B=null;F&&(B=C(F)),B&&(delete S.rel,delete S.href,S._cssText=G(B,F.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var W=C(e.sheet);W&&(S._cssText=G(W,K()))}if("input"===b||"textarea"===b||"select"===b){var V=e.value,Z=e.checked;"radio"!==S.type&&"checkbox"!==S.type&&"submit"!==S.type&&"button"!==S.type&&V?S.value=w({element:e,type:M(e),tagName:b,value:V,maskInputOptions:u,maskInputFn:c}):Z&&(S.checked=Z)}"option"===b&&(e.selected&&!u.select?S.selected=!0:delete S.selected);if("canvas"===b&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,a=k in o?o[k]:o;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),P=document.createElement("canvas");P.width=e.width,P.height=e.height,U!==P.toDataURL(d.type,d.quality)&&(S.rr_dataURL=U)}if("img"===b&&p){N||(N=r.createElement("canvas"),O=N.getContext("2d"));var Y=e,q=Y.crossOrigin;Y.crossOrigin="anonymous";var J=function e(){Y.removeEventListener("load",e);try{N.width=Y.naturalWidth,N.height=Y.naturalHeight,O.drawImage(Y,0,0),S.rr_dataURL=N.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(Y.currentSrc,"! Error: ").concat(e))}q?S.crossOrigin=q:Y.removeAttribute("crossorigin")};Y.complete&&0!==Y.naturalWidth?J():Y.addEventListener("load",J)}if("audio"===b||"video"===b){var z=S;z.rr_mediaState=e.paused?"paused":"played",z.rr_mediaCurrentTime=e.currentTime,z.rr_mediaPlaybackRate=e.playbackRate,z.rr_mediaMuted=e.muted,z.rr_mediaLoop=e.loop,z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop));if(I){var Q=e.getBoundingClientRect(),X=Q.width,$=Q.height;S={class:S.class,rr_width:"".concat(X,"px"),rr_height:"".concat($,"px")}}"iframe"!==b||h(S.src)||(e.contentDocument||(S.rr_src=S.src),delete S.src);try{customElements.get(b)&&(n=!0)}catch(e){}return{type:m.Element,tagName:b,attributes:S,childNodes:[],isSVG:_(e)||void 0,needBlock:I,rootId:y,isCustom:n}}(e,{doc:n,blockClass:o,blockSelector:a,inlineStylesheet:s,maskInputOptions:c,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:g,keepIframeSrcFn:v,newlyAddedElement:I,rootId:b});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,o=t.maskTextFn,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,s=e.textContent,u="STYLE"===i||void 0,c="SCRIPT"===i||void 0;if(u&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=C(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=G(s,K())}c&&(s="SCRIPT_PLACEHOLDER");!u&&!c&&s&&r&&(s=o?o(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:m.Text,textContent:s||"",isStyle:u,rootId:a}}(e,{needsMask:i,maskTextFn:l,rootId:b});case e.CDATA_SECTION_NODE:return{type:m.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:m.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function J(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,c=void 0!==u&&u,l=t.inlineStylesheet,d=void 0===l||l,p=t.maskInputOptions,f=void 0===p?{}:p,h=t.maskTextFn,g=t.maskInputFn,v=t.slimDOMOptions,C=t.dataURLOptions,b=void 0===C?{}:C,S=t.inlineImages,w=void 0!==S&&S,A=t.recordCanvas,k=void 0!==A&&A,M=t.onSerialize,N=t.onIframeLoad,O=t.iframeLoadTimeout,E=void 0===O?5e3:O,R=t.onStylesheetLoad,F=t.stylesheetLoadTimeout,D=void 0===F?5e3:F,B=t.keepIframeSrcFn,W=void 0===B?function(){return!1}:B,G=t.newlyAddedElement,V=void 0!==G&&G,Z=t.needsMask,U=t.preserveWhiteSpace,_=void 0===U||U;!Z&&e.childNodes&&(Z=Y(e,i,s,void 0===Z));var K,j=q(e,{doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,keepIframeSrcFn:W,newlyAddedElement:V});if(!j)return console.warn(e,"not serialized"),null;K=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===m.Comment)return!0;if(e.type===m.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===T(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(e.attributes.name)||"icon"===J(e.attributes.rel)||"apple-touch-icon"===J(e.attributes.rel)||"shortcut icon"===J(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===J(e.attributes.name)||"googlebot"===J(e.attributes.name)||"bingbot"===J(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===J(e.attributes.name)||"generator"===J(e.attributes.name)||"framework"===J(e.attributes.name)||"publisher"===J(e.attributes.name)||"progid"===J(e.attributes.name)||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===J(e.attributes.name)||"yandex-verification"===J(e.attributes.name)||"csrf-token"===J(e.attributes.name)||"p:domain_verify"===J(e.attributes.name)||"verify-v1"===J(e.attributes.name)||"verification"===J(e.attributes.name)||"shopify-checkout-api-token"===J(e.attributes.name)))return!0}}return!1}(j,v)&&(_||j.type!==m.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?L():x;var H=Object.assign(j,{id:K});if(r.add(e,H),K===x)return null;M&&M(e);var P=!c;if(H.type===m.Element){P=P&&!H.needBlock,delete H.needBlock;var Q=e.shadowRoot;Q&&I(Q)&&(H.isShadowHost=!0)}if((H.type===m.Document||H.type===m.Element)&&P){v.headWhitespace&&H.type===m.Element&&"head"===H.tagName&&(_=!1);var X={doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:c,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W};if(H.type===m.Element&&"textarea"===H.tagName&&void 0!==H.attributes.value);else for(var $=0,ee=Array.from(e.childNodes);$<ee.length;$++){var te=z(ee[$],X);te&&H.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var oe=z(re[ne],X);oe&&(I(e.shadowRoot)&&(oe.isShadow=!0),H.childNodes.push(oe))}}return e.parentNode&&y(e.parentNode)&&I(e.parentNode)&&(H.isShadow=!0),H.type===m.Element&&"iframe"===H.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&N){var n=z(t,{doc:t,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W});n&&N(e,n)}}),E),H.type===m.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===T(H.attributes.href))&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var a=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(e,(function(){if(R){var t=z(e,{doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W});t&&R(e,t)}}),D),H}function Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var 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.",$={map:{},getId:function(){return console.error(X),-1},getNode:function(){return console.error(X),null},removeNodeFromMap:function(){console.error(X)},has:function(){return console.error(X),!1},reset:function(){console.error(X)}};function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==n.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=u,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),c))}}function te(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return te(e,t,a||{},!0)}}function ne(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($=new Proxy($,{get:function(e,t,n){return"map"===t&&console.error(X),Reflect.get(e,t,n)}}));var re=Date.now;function oe(e){var t,n,r,o,a,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(a=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.scrollTop)||0}}function ae(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function se(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function ue(e,t,n,r){if(!e)return!1;var o=se(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(P(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ce(e,t){return t.getId(e)===x}function le(e,t){if(y(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||le(e.parentNode,t))}function de(e){return Boolean(e.changedTouches)}function pe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function he(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(re=function(){return(new Date).getTime()});var ge=function(){function e(){s(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return c(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function me(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=me(n);)n=t;return n}(e);return t.contains(n)}function ye(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var Ie=function(e){return 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}(Ie||{}),Ce=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Ce||{}),be=function(e){return 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}(be||{}),Se=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Se||{}),we=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(we||{});function Ae(e){return"__ln"in e}var ke,Me=function(){function e(){s(this,e),this.length=0,this.head=null,this.tail=null}return c(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ae(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ae(e.nextSibling)&&e.nextSibling.__ln.previous){var 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;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),Te=function(e,t){return"".concat(e,"@").concat(t)},Ne=function(){function e(){var t=this;s(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new Me,o=function(e){for(var n=e,r=x;r===x;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},a=function(a){if(a.parentNode&&ye(a)&&"TEXTAREA"!==a.parentNode.tagName){var i=y(a.parentNode)?t.mirror.getId(me(a)):t.mirror.getId(a.parentNode),s=o(a);if(-1===i||-1===s)return r.addNode(a);var u=z(a,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){pe(e,t.mirror)&&t.iframeManager.addIframe(e),fe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),he(a)&&t.shadowDomManager.addShadowRoot(a.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});u&&(e.push({parentId:i,nextId:s,node:u}),n.add(u.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var i,s=g(t.movedSet);try{for(s.s();!(i=s.n()).done;){var u=i.value;Ee(t.removes,u,t.mirror)&&!t.movedSet.has(u.parentNode)||a(u)}}catch(e){s.e(e)}finally{s.f()}var c,l=g(t.addedSet);try{for(l.s();!(c=l.n()).done;){var d=c.value;xe(t.droppedSet,d)||Ee(t.removes,d,t.mirror)?xe(t.movedSet,d)?a(d):t.droppedSet.add(d):a(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var h=t.mirror.getId(p.value.parentNode),m=o(p.value);-1!==h&&-1!==m&&(f=p)}if(!f)for(var v=r.tail;v;){var I=v;if(v=v.previous,I){var C=t.mirror.getId(I.value.parentNode);if(-1===o(I.value))continue;if(-1!==C){f=I;break}var b=I.value;if(b.parentNode&&b.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var S=b.parentNode.host;if(-1!==t.mirror.getId(S)){f=I;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),a(f.value)}var w={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(w))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ce(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;ue(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:Y(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,se(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,o=e.attributeName,a=e.target.getAttribute(o);if("value"===o){var i=M(r);a=w({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:i,value:a,maskInputFn:t.maskInputFn})}if(ue(e.target,t.blockClass,t.blockSelector,!1)||a===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===o&&!t.keepIframeSrcFn(a)){if(r.contentDocument)return;o="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===o&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!H(r.tagName,o)&&(s.attributes[o]=j(t.doc,A(r.tagName),A(o),a),"style"===o)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var c=0,l=Array.from(r.style);c<l.length;c++){var d=l[c],p=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);p!==u.style.getPropertyValue(d)||f!==u.style.getPropertyPriority(d)?s.styleDiff[d]=""===f?p:[p,f]:s._unchangedStyles[d]=[p,f]}for(var h=0,g=Array.from(u.style);h<g.length;h++){var m=g[h];""===r.style.getPropertyValue(m)&&(s.styleDiff[m]=!1)}}break;case"childList":if(ue(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=y(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ue(e.target,t.blockClass,t.blockSelector,!1)||ce(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Oe(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||le(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[Te(r,o)]?Oe(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!y(e.target)||!I(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ce(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[Te(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ue(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),he(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return c(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Oe(e,t){e.delete(t),t.childNodes.forEach((function(t){return Oe(e,t)}))}function Ee(e,t,n){return 0!==e.length&&Re(e,t,n)}function Re(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Re(e,r,n)}function xe(e,t){return 0!==e.size&&Le(e,t)}function Le(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Le(e,n))}function Fe(e){ke=e}function De(){ke=void 0}var Be=function(e){if(!ke)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(ke&&!0===ke(e))return;throw e}}},We=[];function Ge(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ve(e,t){var n,r,o=new Ne;We.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(Be(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ze(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[],c=null;return Object.keys(be).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=A(e),s=function(e){return function(n){var i=Ge(n);if(!ue(i,o,a,!0)){var s=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Se.Mouse;break;case"touch":s=Se.Touch;break;case"pen":s=Se.Pen}s===Se.Touch?be[e]===be.MouseDown?u="TouchStart":be[e]===be.MouseUp&&(u="TouchEnd"):Se.Pen}else de(n)&&(s=Se.Touch);null!==s?(c=s,(u.startsWith("Touch")&&s===Se.Touch||u.startsWith("Mouse")&&s===Se.Mouse)&&(s=null)):be[e]===be.Click&&(s=c,c=null);var l=de(n)?n.changedTouches[0]:n;if(l){var d=r.getId(i),p=l.clientX,f=l.clientY;Be(t)(Object.assign({type:be[u],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(be[e]){case be.MouseDown:case be.MouseUp:i=i.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}u.push(Q(i,s,n))})),Be((function(){u.forEach((function(e){return e()}))}))}function Ue(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;return Q("scroll",Be(ee(Be((function(e){var i=Ge(e);if(i&&!ue(i,o,a,!0)){var s=r.getId(i);if(i===n&&n.defaultView){var u=oe(n.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}})),i.scroll||100)),n)}var _e=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function je(e){return function(e,t){if(qe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function He(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Pe(e,t){var n,r,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,c=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return n}}),Be((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):function(){}}function Ye(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb,h=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),h.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Ve(e,e.doc));var o=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=ee(Be((function(e){var n=Date.now()-a;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],a=null})),s),l=Be(ee(Be((function(e){var t=Ge(e),n=de(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=re()),u.push({x:r,y:i,id:o.getId(t),timeOffset:re()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ce.Drag:e instanceof MouseEvent?Ce.MouseMove:Ce.TouchMove)})),i,{trailing:!1})),d=[Q("mousemove",l,r),Q("touchmove",l,r),Q("drag",l,r)];return Be((function(){d.forEach((function(e){return e()}))}))}(e),a=Ze(e),i=Ue(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,a=-1;return Q("resize",Be(ee(Be((function(){var e=ae(),t=ie();o===e&&a===t||(n({width:Number(t),height:Number(e)}),o=e,a=t)})),200)),r)}(e,{win:r}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,c=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function f(e){var t=Ge(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(_e.indexOf(l)<0)&&!ue(t,o,a,!0)&&!(t.classList.contains(i)||s&&t.matches(s))){var p=t.value,f=!1,g=M(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(u[l.toLowerCase()]||u[g])&&(p=w({element:t,maskInputOptions:u,tagName:l,type:g,value:p,maskInputFn:c})),h(t,d?{text:p,isChecked:f,userTriggered:r}:{text:p,isChecked:f});var m=t.name;"radio"===g&&m&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(m,'"]')).forEach((function(e){if(e!==t){var n=e.value;h(e,d?{text:n,isChecked:!f,userTriggered:!1}:{text:n,isChecked:!f})}}))}}function h(e,n){var o=Ke.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ke.set(e,n);var a=r.getId(e);Be(t)(Object.assign(Object.assign({},n),{id:a}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return Q(e,Be(f),n)})),m=n.defaultView;if(!m)return function(){g.forEach((function(e){return e()}))};var v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&g.push.apply(g,p(y.map((function(e){return te(e[0],e[1],{set:function(){Be(f)({target:this,isTrusted:!1})}},!1,m)})))),Be((function(){g.forEach((function(e){return e()}))}))}(e),c=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=e.doc,s=Be((function(e){return ee(Be((function(a){var i=Ge(a);if(i&&!ue(i,n,r,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate,d=i.loop;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l,loop:d})}})),a.media||500)})),u=[Q("play",s(0),i),Q("pause",s(1),i),Q("seeked",s(2),i),Q("volumechange",s(3),i),Q("ratechange",s(4),i)];return Be((function(){u.forEach((function(e){return e()}))}))}(e),l=function(){},f=function(){},h=function(){},m=function(){};e.recordDOM&&(l=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return function(){};var i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Be((function(e,t,a){var i=d(a,2),s=i[0],u=i[1],c=He(t,r,o.styleMirror),l=c.id,p=c.styleId;return(l&&-1!==l||p&&-1!==p)&&n({id:l,styleId:p,adds:[{rule:s,index:u}]}),e.apply(t,a)}))});var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:i}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replace:i}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replaceSync:i}),e.apply(t,a)}))}));var l={};Je("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(Je("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),Je("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),Je("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=d(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(f[a].insertRule,{apply:Be((function(e,t,a){var i=d(a,2),s=i[0],u=i[1],c=He(t.parentStyleSheet,r,o.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&n({id:l,styleId:f,adds:[{rule:s,index:[].concat(p(je(t)),[u||0])}]}),e.apply(t,a)}))}),i.prototype.deleteRule=new Proxy(f[a].deleteRule,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t.parentStyleSheet,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:[].concat(p(je(t)),[i])}]}),e.apply(t,a)}))})})),Be((function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:r}),f=Pe(e,e.doc),h=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Be((function(e,t,i){var u,c=d(i,3),l=c[0],p=c[1],f=c[2];if(o.has(l))return s.apply(t,[l,p,f]);var h=He(null===(u=t.parentRule)||void 0===u?void 0:u.parentStyleSheet,r,a.styleMirror),g=h.id,m=h.styleId;return(g&&-1!==g||m&&-1!==m)&&n({id:g,styleId:m,set:{property:l,value:p,priority:f},index:je(t.parentRule)}),e.apply(t,i)}))});var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Be((function(e,t,i){var s,c=d(i,1)[0];if(o.has(c))return u.apply(t,[c]);var l=He(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,a.styleMirror),p=l.id,f=l.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:c},index:je(t.parentRule)}),e.apply(t,i)}))}),Be((function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:r}),e.collectFonts&&(m=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ne(n.fonts,"add",(function(e){return function(n){return setTimeout(Be((function(){var e=a.get(n);e&&(t(e),a.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),Be((function(){o.forEach((function(e){return e()}))}))}(e)));var v,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=Be((function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;ue(d,r,o,!0)||ue(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}a({ranges:s})}}));return s(),Q("selectionchange",s)}(e),I=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?ne(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,o])}})):function(){}}(e),C=[],b=g(e.plugins);try{for(b.s();!(v=b.n()).done;){var S=v.value;C.push(S.observer(S.callback,r,S.options))}}catch(e){b.e(e)}finally{b.f()}return Be((function(){We.forEach((function(e){return e.reset()})),null==t||t.disconnect(),o(),a(),i(),s(),u(),c(),l(),f(),h(),m(),y(),I(),C.forEach((function(e){return e()}))}))}function qe(e){return void 0!==window[e]}function Je(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){s(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return c(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Qe=function(){function e(t){s(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(L),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return c(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case Ie.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:Ie.IncrementalSnapshot,data:{source:Ce.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ie.Meta:case Ie.Load:case Ie.DomContentLoaded:return!1;case Ie.Plugin:return t;case Ie.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ie.IncrementalSnapshot:switch(t.data.source){case Ce.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case Ce.Drag:case Ce.TouchMove:case Ce.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case Ce.ViewportResize:return!1;case Ce.MediaInteraction:case Ce.MouseInteraction:case Ce.Scroll:case Ce.CanvasMutation:case Ce.Input:return this.replaceIds(t.data,e,["id"]),t;case Ce.StyleSheetRule:case Ce.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ce.Font:return t;case Ce.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case Ce.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var o,a=g(r);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===m.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Xe=function(){function e(t){s(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return c(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Ve(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Ue(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(Pe({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(ne(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&ye(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function $e(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))}for(var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nt=0;nt<64;nt++)tt[et.charCodeAt(nt)]=nt;var rt=new Map;var ot=function(e,t,n){if(e&&(st(e,t)||"object"===o(e))){var r=function(e,t){var n=rt.get(e);return n||(n=new Map,rt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),a=r.indexOf(e);return-1===a&&(a=r.length,r.push(e)),a}};function at(e,t,n){if(e instanceof Array)return e.map((function(e){return at(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,a=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=et[n[t]>>2],o+=et[(3&n[t])<<4|n[t+1]>>4],o+=et[(15&n[t+1])<<2|n[t+2]>>6],o+=et[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:r,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[at(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[at(e.data,t,n),e.width,e.height]}:st(e,t)||"object"===o(e)?{rr_type:e.constructor.name,index:ot(e,t,n)}:e}var it=function(e,t,n){return e.map((function(e){return at(e,t,n)}))},st=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ut(e,t,n,r){var a=[];try{var i=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(a){for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];if(!ue(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(a);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===o(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a].concat(s))}}));a.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){a.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,a,i){var s,u=[],c=g(Object.getOwnPropertyNames(e));try{var l=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var c=ne(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(ot(l,i,this),"tagName"in this.canvas&&!ue(this.canvas,r,o,!0)){var d=it(u,i,this),p={type:t,property:a,args:d};n(this.canvas,p)}return l}}));u.push(c)}catch(r){var l=te(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}return u}function lt(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var dt,pt,ft,ht,gt,mt,vt,yt=(dt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyB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yYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",pt=null,ft=!1,function(e){return ht=ht||lt(dt,pt,ft),new Worker(ht,e)}),It=function(){function e(t){var n=this;s(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,a=t.win,i=t.blockClass,u=t.blockSelector,c=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&"all"===o&&this.initCanvasMutationObserver(a,i,u),c&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,u,{dataURLOptions:l})}return c(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,n,o,a){var i=this,s=ut(t,n,o,!0),u=new Map,c=new yt;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,s=n.height;i.mutationCb({id:t,type:we["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){ue(e,n,o,!0)||f.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),f).forEach((function(e){return $e(i,void 0,void 0,r().mark((function t(){var n,o,i,s,l,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)),s=e.clientWidth||e.width,l=e.clientHeight||e.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:l});case 11:d=t.sent,c.postMessage({id:o,bitmap:d,width:s,height:l,dataURLOptions:a.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=ut(e,t,n,!1),o=function(e,t,n,r){var o,a=[],i=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=ne(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ue(this.canvas,n,r,!0)||setTimeout((function(){var n=it(u,t,a);e(a.canvas,{type:we["2D"],property:i,args:n})}),0),o.apply(this,u)}}));a.push(s)}catch(n){var u=te(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:we["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(i.s();!(o=i.n()).done;)s()}catch(e){i.e(e)}finally{i.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),a=function(e,t,n,r,o){var a=[];return a.push.apply(a,p(ct(t.WebGLRenderingContext.prototype,we.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,p(ct(t.WebGL2RenderingContext.prototype,we.WebGL2,e,n,r,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
1
+ !function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(){r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),i=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return M()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=b(i,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d={};function p(){}function f(){}function h(){}var g={};u(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(k([])));v&&v!==t&&n.call(v,a)&&(g=v);var y=h.prototype=p.prototype=Object.create(g);function I(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,a,i,s){var u=l(e[o],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=h,u(y,"constructor",h),u(h,"constructor",f),f.displayName=u(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},I(C.prototype),u(C.prototype,i,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(c(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t,n,r,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,u,"next",e)}function u(e){a(i,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}var m,v="2.0.0-alpha.13";function y(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(b).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function b(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=C(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(m||(m={}));var S=function(){function e(){s(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return c(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function w(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,a=e.value,i=e.maskInputFn,s=a||"",u=o&&A(o);return(n[r.toLowerCase()]||u&&n[u])&&(s=i?i(s,t):"*".repeat(s.length)),s}function A(e){return e.toLowerCase()}var k="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}function T(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}var N,O,E=1,R=new RegExp("[^a-z0-9-_:]"),x=-2;function L(){return E++}var F=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,B=/^www\..*/i,W=/^(data:)([^,]*),(.*)/i;function G(e,t){return(e||"").replace(F,(function(e,n,r,o,a,i){var s,u=r||a||i,c=n||o||"";if(!u)return e;if(D.test(u)||B.test(u))return"url(".concat(c).concat(u).concat(c,")");if(W.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),d=u.split("/");l.pop();var p,f=g(d);try{for(f.s();!(p=f.n()).done;){var h=p.value;"."!==h&&(".."===h?l.pop():l.push(h))}}catch(e){f.e(e)}finally{f.f()}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var V=/^[^ \t\n\r\u000c]+/,Z=/^[, \t\n\r\u000c]+/;function U(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function _(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function K(){var e=document.createElement("a");return e.href="",e.href}function j(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?U(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(Z),!(n>=t.length);){var a=r(V);if(","===a.slice(-1))a=U(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=U(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n?G(r,K()):"object"===t&&"data"===n?U(e,r):r:U(e,r):r}function H(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t||"video"===e&&"src"===t&&n&&n.startsWith("blob:http")}function P(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&P(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&P(e.parentNode,t,n)}function Y(e,t,n,r){try{var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(".".concat(t)))return!0}else if(o.classList.contains(t))return!0}else if(P(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function q(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.needsMask,s=t.inlineStylesheet,u=t.maskInputOptions,c=void 0===u?{}:u,l=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,h=t.inlineImages,g=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,I=void 0!==y&&y,b=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:m.Document,childNodes:[],compatMode:e.compatMode}:{type:m.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:m.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,o=t.blockClass,a=t.blockSelector,i=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,c=t.maskInputFn,l=t.dataURLOptions,d=void 0===l?{}:l,p=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,g=t.newlyAddedElement,v=void 0!==g&&g,y=t.rootId,I=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,o,a),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return R.test(t)?"div":t}(e),S={},T=e.attributes.length,E=0;E<T;E++){var x=e.attributes[E];H(b,x.name,x.value)||(S[x.name]=j(r,b,A(x.name),x.value))}if("link"===b&&i){var L=e.href,F=Array.from(r.styleSheets).find((function(e){return e.href===L}));if(!F&&L.includes(".css")){var D=window.location.origin+"/"+L.replace(window.location.href,"");F=Array.from(r.styleSheets).find((function(e){return e.href===D}))}var B=null;F&&(B=C(F)),B&&(delete S.rel,delete S.href,S._cssText=G(B,F.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var W=C(e.sheet);W&&(S._cssText=G(W,K()))}if("input"===b||"textarea"===b||"select"===b){var V=e.value,Z=e.checked;"radio"!==S.type&&"checkbox"!==S.type&&"submit"!==S.type&&"button"!==S.type&&V?S.value=w({element:e,type:M(e),tagName:b,value:V,maskInputOptions:u,maskInputFn:c}):Z&&(S.checked=Z)}"option"===b&&(e.selected&&!u.select?S.selected=!0:delete S.selected);if("canvas"===b&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,a=k in o?o[k]:o;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),P=document.createElement("canvas");P.width=e.width,P.height=e.height,U!==P.toDataURL(d.type,d.quality)&&(S.rr_dataURL=U)}if("img"===b&&p){N||(N=r.createElement("canvas"),O=N.getContext("2d"));var Y=e,q=Y.crossOrigin;Y.crossOrigin="anonymous";var J=function e(){Y.removeEventListener("load",e);try{N.width=Y.naturalWidth,N.height=Y.naturalHeight,O.drawImage(Y,0,0),S.rr_dataURL=N.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(Y.currentSrc,"! Error: ").concat(e))}q?S.crossOrigin=q:Y.removeAttribute("crossorigin")};Y.complete&&0!==Y.naturalWidth?J():Y.addEventListener("load",J)}if("audio"===b||"video"===b){var z=S;z.rr_mediaState=e.paused?"paused":"played",z.rr_mediaCurrentTime=e.currentTime,z.rr_mediaPlaybackRate=e.playbackRate,z.rr_mediaMuted=e.muted,z.rr_mediaLoop=e.loop,z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop));if(I){var Q=e.getBoundingClientRect(),X=Q.width,$=Q.height;S={class:S.class,rr_width:"".concat(X,"px"),rr_height:"".concat($,"px")}}"iframe"!==b||h(S.src)||(e.contentDocument||(S.rr_src=S.src),delete S.src);try{customElements.get(b)&&(n=!0)}catch(e){}return{type:m.Element,tagName:b,attributes:S,childNodes:[],isSVG:_(e)||void 0,needBlock:I,rootId:y,isCustom:n}}(e,{doc:n,blockClass:o,blockSelector:a,inlineStylesheet:s,maskInputOptions:c,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:g,keepIframeSrcFn:v,newlyAddedElement:I,rootId:b});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,o=t.maskTextFn,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,s=e.textContent,u="STYLE"===i||void 0,c="SCRIPT"===i||void 0;if(u&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=C(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=G(s,K())}c&&(s="SCRIPT_PLACEHOLDER");!u&&!c&&s&&r&&(s=o?o(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:m.Text,textContent:s||"",isStyle:u,rootId:a}}(e,{needsMask:i,maskTextFn:l,rootId:b});case e.CDATA_SECTION_NODE:return{type:m.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:m.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function J(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,c=void 0!==u&&u,l=t.inlineStylesheet,d=void 0===l||l,p=t.maskInputOptions,f=void 0===p?{}:p,h=t.maskTextFn,g=t.maskInputFn,v=t.slimDOMOptions,C=t.dataURLOptions,b=void 0===C?{}:C,S=t.inlineImages,w=void 0!==S&&S,A=t.recordCanvas,k=void 0!==A&&A,M=t.onSerialize,N=t.onIframeLoad,O=t.iframeLoadTimeout,E=void 0===O?5e3:O,R=t.onStylesheetLoad,F=t.stylesheetLoadTimeout,D=void 0===F?5e3:F,B=t.keepIframeSrcFn,W=void 0===B?function(){return!1}:B,G=t.newlyAddedElement,V=void 0!==G&&G,Z=t.needsMask,U=t.preserveWhiteSpace,_=void 0===U||U;!Z&&e.childNodes&&(Z=Y(e,i,s,void 0===Z));var K,j=q(e,{doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,keepIframeSrcFn:W,newlyAddedElement:V});if(!j)return console.warn(e,"not serialized"),null;K=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===m.Comment)return!0;if(e.type===m.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===T(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(e.attributes.name)||"icon"===J(e.attributes.rel)||"apple-touch-icon"===J(e.attributes.rel)||"shortcut icon"===J(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===J(e.attributes.name)||"googlebot"===J(e.attributes.name)||"bingbot"===J(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===J(e.attributes.name)||"generator"===J(e.attributes.name)||"framework"===J(e.attributes.name)||"publisher"===J(e.attributes.name)||"progid"===J(e.attributes.name)||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===J(e.attributes.name)||"yandex-verification"===J(e.attributes.name)||"csrf-token"===J(e.attributes.name)||"p:domain_verify"===J(e.attributes.name)||"verify-v1"===J(e.attributes.name)||"verification"===J(e.attributes.name)||"shopify-checkout-api-token"===J(e.attributes.name)))return!0}}return!1}(j,v)&&(_||j.type!==m.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?L():x;var H=Object.assign(j,{id:K});if(r.add(e,H),K===x)return null;M&&M(e);var P=!c;if(H.type===m.Element){P=P&&!H.needBlock,delete H.needBlock;var Q=e.shadowRoot;Q&&I(Q)&&(H.isShadowHost=!0)}if((H.type===m.Document||H.type===m.Element)&&P){v.headWhitespace&&H.type===m.Element&&"head"===H.tagName&&(_=!1);var X={doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:c,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W};if(H.type===m.Element&&"textarea"===H.tagName&&void 0!==H.attributes.value);else for(var $=0,ee=Array.from(e.childNodes);$<ee.length;$++){var te=z(ee[$],X);te&&H.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var oe=z(re[ne],X);oe&&(I(e.shadowRoot)&&(oe.isShadow=!0),H.childNodes.push(oe))}}return e.parentNode&&y(e.parentNode)&&I(e.parentNode)&&(H.isShadow=!0),H.type===m.Element&&"iframe"===H.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&N){var n=z(t,{doc:t,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W});n&&N(e,n)}}),E),H.type===m.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===T(H.attributes.href))&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var a=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(e,(function(){if(R){var t=z(e,{doc:n,mirror:r,blockClass:o,blockSelector:a,needsMask:Z,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:_,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:W});t&&R(e,t)}}),D),H}function Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var 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.",$={map:{},getId:function(){return console.error(X),-1},getNode:function(){return console.error(X),null},removeNodeFromMap:function(){console.error(X)},has:function(){return console.error(X),!1},reset:function(){console.error(X)}};function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==n.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=u,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),c))}}function te(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return te(e,t,a||{},!0)}}function ne(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($=new Proxy($,{get:function(e,t,n){return"map"===t&&console.error(X),Reflect.get(e,t,n)}}));var re=Date.now;function oe(e){var t,n,r,o,a,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(a=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.scrollTop)||0}}function ae(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function se(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function ue(e,t,n,r){if(!e)return!1;var o=se(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(P(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ce(e,t){return t.getId(e)===x}function le(e,t){if(y(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||le(e.parentNode,t))}function de(e){return Boolean(e.changedTouches)}function pe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function he(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(re=function(){return(new Date).getTime()});var ge=function(){function e(){s(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return c(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function me(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=me(n);)n=t;return n}(e);return t.contains(n)}function ye(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var Ie=function(e){return 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}(Ie||{}),Ce=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Ce||{}),be=function(e){return 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}(be||{}),Se=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Se||{}),we=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(we||{});function Ae(e){return"__ln"in e}var ke,Me=function(){function e(){s(this,e),this.length=0,this.head=null,this.tail=null}return c(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ae(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ae(e.nextSibling)&&e.nextSibling.__ln.previous){var 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;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),Te=function(e,t){return"".concat(e,"@").concat(t)},Ne=function(){function e(){var t=this;s(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new Me,o=function(e){for(var n=e,r=x;r===x;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},a=function(a){if(a.parentNode&&ye(a)&&"TEXTAREA"!==a.parentNode.tagName){var i=y(a.parentNode)?t.mirror.getId(me(a)):t.mirror.getId(a.parentNode),s=o(a);if(-1===i||-1===s)return r.addNode(a);var u=z(a,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){pe(e,t.mirror)&&t.iframeManager.addIframe(e),fe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),he(a)&&t.shadowDomManager.addShadowRoot(a.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});u&&(e.push({parentId:i,nextId:s,node:u}),n.add(u.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var i,s=g(t.movedSet);try{for(s.s();!(i=s.n()).done;){var u=i.value;Ee(t.removes,u,t.mirror)&&!t.movedSet.has(u.parentNode)||a(u)}}catch(e){s.e(e)}finally{s.f()}var c,l=g(t.addedSet);try{for(l.s();!(c=l.n()).done;){var d=c.value;xe(t.droppedSet,d)||Ee(t.removes,d,t.mirror)?xe(t.movedSet,d)?a(d):t.droppedSet.add(d):a(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var h=t.mirror.getId(p.value.parentNode),m=o(p.value);-1!==h&&-1!==m&&(f=p)}if(!f)for(var v=r.tail;v;){var I=v;if(v=v.previous,I){var C=t.mirror.getId(I.value.parentNode);if(-1===o(I.value))continue;if(-1!==C){f=I;break}var b=I.value;if(b.parentNode&&b.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var S=b.parentNode.host;if(-1!==t.mirror.getId(S)){f=I;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),a(f.value)}var w={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(w))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ce(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;ue(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:Y(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,se(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,o=e.attributeName,a=e.target.getAttribute(o);if("value"===o){var i=M(r);a=w({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:i,value:a,maskInputFn:t.maskInputFn})}if(ue(e.target,t.blockClass,t.blockSelector,!1)||a===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===o&&!t.keepIframeSrcFn(a)){if(r.contentDocument)return;o="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===o&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!H(r.tagName,o,a)&&(s.attributes[o]=j(t.doc,A(r.tagName),A(o),a),"style"===o)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var c=0,l=Array.from(r.style);c<l.length;c++){var d=l[c],p=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);p!==u.style.getPropertyValue(d)||f!==u.style.getPropertyPriority(d)?s.styleDiff[d]=""===f?p:[p,f]:s._unchangedStyles[d]=[p,f]}for(var h=0,g=Array.from(u.style);h<g.length;h++){var m=g[h];""===r.style.getPropertyValue(m)&&(s.styleDiff[m]=!1)}}break;case"childList":if(ue(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=y(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ue(e.target,t.blockClass,t.blockSelector,!1)||ce(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Oe(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||le(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[Te(r,o)]?Oe(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!y(e.target)||!I(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ce(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[Te(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ue(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),he(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return c(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Oe(e,t){e.delete(t),t.childNodes.forEach((function(t){return Oe(e,t)}))}function Ee(e,t,n){return 0!==e.length&&Re(e,t,n)}function Re(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Re(e,r,n)}function xe(e,t){return 0!==e.size&&Le(e,t)}function Le(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Le(e,n))}function Fe(e){ke=e}function De(){ke=void 0}var Be=function(e){if(!ke)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(ke&&!0===ke(e))return;throw e}}},We=[];function Ge(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ve(e,t){var n,r,o=new Ne;We.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(Be(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ze(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[],c=null;return Object.keys(be).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=A(e),s=function(e){return function(n){var i=Ge(n);if(!ue(i,o,a,!0)){var s=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Se.Mouse;break;case"touch":s=Se.Touch;break;case"pen":s=Se.Pen}s===Se.Touch?be[e]===be.MouseDown?u="TouchStart":be[e]===be.MouseUp&&(u="TouchEnd"):Se.Pen}else de(n)&&(s=Se.Touch);null!==s?(c=s,(u.startsWith("Touch")&&s===Se.Touch||u.startsWith("Mouse")&&s===Se.Mouse)&&(s=null)):be[e]===be.Click&&(s=c,c=null);var l=de(n)?n.changedTouches[0]:n;if(l){var d=r.getId(i),p=l.clientX,f=l.clientY;Be(t)(Object.assign({type:be[u],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(be[e]){case be.MouseDown:case be.MouseUp:i=i.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}u.push(Q(i,s,n))})),Be((function(){u.forEach((function(e){return e()}))}))}function Ue(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;return Q("scroll",Be(ee(Be((function(e){var i=Ge(e);if(i&&!ue(i,o,a,!0)){var s=r.getId(i);if(i===n&&n.defaultView){var u=oe(n.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}})),i.scroll||100)),n)}var _e=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function je(e){return function(e,t){if(qe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||qe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||qe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||qe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function He(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Pe(e,t){var n,r,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,c=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return n}}),Be((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):function(){}}function Ye(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb,h=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),h.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Ve(e,e.doc));var o=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=ee(Be((function(e){var n=Date.now()-a;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],a=null})),s),l=Be(ee(Be((function(e){var t=Ge(e),n=de(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=re()),u.push({x:r,y:i,id:o.getId(t),timeOffset:re()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ce.Drag:e instanceof MouseEvent?Ce.MouseMove:Ce.TouchMove)})),i,{trailing:!1})),d=[Q("mousemove",l,r),Q("touchmove",l,r),Q("drag",l,r)];return Be((function(){d.forEach((function(e){return e()}))}))}(e),a=Ze(e),i=Ue(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,a=-1;return Q("resize",Be(ee(Be((function(){var e=ae(),t=ie();o===e&&a===t||(n({width:Number(t),height:Number(e)}),o=e,a=t)})),200)),r)}(e,{win:r}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,c=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function f(e){var t=Ge(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(_e.indexOf(l)<0)&&!ue(t,o,a,!0)&&!(t.classList.contains(i)||s&&t.matches(s))){var p=t.value,f=!1,g=M(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(u[l.toLowerCase()]||u[g])&&(p=w({element:t,maskInputOptions:u,tagName:l,type:g,value:p,maskInputFn:c})),h(t,d?{text:p,isChecked:f,userTriggered:r}:{text:p,isChecked:f});var m=t.name;"radio"===g&&m&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(m,'"]')).forEach((function(e){if(e!==t){var n=e.value;h(e,d?{text:n,isChecked:!f,userTriggered:!1}:{text:n,isChecked:!f})}}))}}function h(e,n){var o=Ke.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ke.set(e,n);var a=r.getId(e);Be(t)(Object.assign(Object.assign({},n),{id:a}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return Q(e,Be(f),n)})),m=n.defaultView;if(!m)return function(){g.forEach((function(e){return e()}))};var v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&g.push.apply(g,p(y.map((function(e){return te(e[0],e[1],{set:function(){Be(f)({target:this,isTrusted:!1})}},!1,m)})))),Be((function(){g.forEach((function(e){return e()}))}))}(e),c=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=e.doc,s=Be((function(e){return ee(Be((function(a){var i=Ge(a);if(i&&!ue(i,n,r,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate,d=i.loop;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l,loop:d})}})),a.media||500)})),u=[Q("play",s(0),i),Q("pause",s(1),i),Q("seeked",s(2),i),Q("volumechange",s(3),i),Q("ratechange",s(4),i)];return Be((function(){u.forEach((function(e){return e()}))}))}(e),l=function(){},f=function(){},h=function(){},m=function(){};e.recordDOM&&(l=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return function(){};var i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Be((function(e,t,a){var i=d(a,2),s=i[0],u=i[1],c=He(t,r,o.styleMirror),l=c.id,p=c.styleId;return(l&&-1!==l||p&&-1!==p)&&n({id:l,styleId:p,adds:[{rule:s,index:u}]}),e.apply(t,a)}))});var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:i}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replace:i}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replaceSync:i}),e.apply(t,a)}))}));var l={};Je("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(Je("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),Je("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),Je("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=d(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(f[a].insertRule,{apply:Be((function(e,t,a){var i=d(a,2),s=i[0],u=i[1],c=He(t.parentStyleSheet,r,o.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&n({id:l,styleId:f,adds:[{rule:s,index:[].concat(p(je(t)),[u||0])}]}),e.apply(t,a)}))}),i.prototype.deleteRule=new Proxy(f[a].deleteRule,{apply:Be((function(e,t,a){var i=d(a,1)[0],s=He(t.parentStyleSheet,r,o.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:[].concat(p(je(t)),[i])}]}),e.apply(t,a)}))})})),Be((function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:r}),f=Pe(e,e.doc),h=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Be((function(e,t,i){var u,c=d(i,3),l=c[0],p=c[1],f=c[2];if(o.has(l))return s.apply(t,[l,p,f]);var h=He(null===(u=t.parentRule)||void 0===u?void 0:u.parentStyleSheet,r,a.styleMirror),g=h.id,m=h.styleId;return(g&&-1!==g||m&&-1!==m)&&n({id:g,styleId:m,set:{property:l,value:p,priority:f},index:je(t.parentRule)}),e.apply(t,i)}))});var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Be((function(e,t,i){var s,c=d(i,1)[0];if(o.has(c))return u.apply(t,[c]);var l=He(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,a.styleMirror),p=l.id,f=l.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:c},index:je(t.parentRule)}),e.apply(t,i)}))}),Be((function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:r}),e.collectFonts&&(m=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ne(n.fonts,"add",(function(e){return function(n){return setTimeout(Be((function(){var e=a.get(n);e&&(t(e),a.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),Be((function(){o.forEach((function(e){return e()}))}))}(e)));var v,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=Be((function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;ue(d,r,o,!0)||ue(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}a({ranges:s})}}));return s(),Q("selectionchange",s)}(e),I=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?ne(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,o])}})):function(){}}(e),C=[],b=g(e.plugins);try{for(b.s();!(v=b.n()).done;){var S=v.value;C.push(S.observer(S.callback,r,S.options))}}catch(e){b.e(e)}finally{b.f()}return Be((function(){We.forEach((function(e){return e.reset()})),null==t||t.disconnect(),o(),a(),i(),s(),u(),c(),l(),f(),h(),m(),y(),I(),C.forEach((function(e){return e()}))}))}function qe(e){return void 0!==window[e]}function Je(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){s(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return c(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Qe=function(){function e(t){s(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(L),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return c(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case Ie.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:Ie.IncrementalSnapshot,data:{source:Ce.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ie.Meta:case Ie.Load:case Ie.DomContentLoaded:return!1;case Ie.Plugin:return t;case Ie.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ie.IncrementalSnapshot:switch(t.data.source){case Ce.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case Ce.Drag:case Ce.TouchMove:case Ce.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case Ce.ViewportResize:return!1;case Ce.MediaInteraction:case Ce.MouseInteraction:case Ce.Scroll:case Ce.CanvasMutation:case Ce.Input:return this.replaceIds(t.data,e,["id"]),t;case Ce.StyleSheetRule:case Ce.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ce.Font:return t;case Ce.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case Ce.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var o,a=g(r);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===m.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Xe=function(){function e(t){s(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return c(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Ve(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Ue(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(Pe({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(ne(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&ye(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function $e(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))}for(var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nt=0;nt<64;nt++)tt[et.charCodeAt(nt)]=nt;var rt=new Map;var ot=function(e,t,n){if(e&&(st(e,t)||"object"===o(e))){var r=function(e,t){var n=rt.get(e);return n||(n=new Map,rt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),a=r.indexOf(e);return-1===a&&(a=r.length,r.push(e)),a}};function at(e,t,n){if(e instanceof Array)return e.map((function(e){return at(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,a=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=et[n[t]>>2],o+=et[(3&n[t])<<4|n[t+1]>>4],o+=et[(15&n[t+1])<<2|n[t+2]>>6],o+=et[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:r,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[at(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[at(e.data,t,n),e.width,e.height]}:st(e,t)||"object"===o(e)?{rr_type:e.constructor.name,index:ot(e,t,n)}:e}var it=function(e,t,n){return e.map((function(e){return at(e,t,n)}))},st=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ut(e,t,n,r){var a=[];try{var i=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(a){for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];if(!ue(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(a);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===o(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a].concat(s))}}));a.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){a.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,a,i){var s,u=[],c=g(Object.getOwnPropertyNames(e));try{var l=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var c=ne(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(ot(l,i,this),"tagName"in this.canvas&&!ue(this.canvas,r,o,!0)){var d=it(u,i,this),p={type:t,property:a,args:d};n(this.canvas,p)}return l}}));u.push(c)}catch(r){var l=te(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}return u}function lt(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([i],{type:"application/javascript"});return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LCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",pt=null,ft=!1,function(e){return ht=ht||lt(dt,pt,ft),new Worker(ht,e)}),It=function(){function e(t){var n=this;s(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,a=t.win,i=t.blockClass,u=t.blockSelector,c=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&"all"===o&&this.initCanvasMutationObserver(a,i,u),c&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,u,{dataURLOptions:l})}return c(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,n,o,a){var i=this,s=ut(t,n,o,!0),u=new Map,c=new yt;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,s=n.height;i.mutationCb({id:t,type:we["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){ue(e,n,o,!0)||f.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),f).forEach((function(e){return $e(i,void 0,void 0,r().mark((function t(){var n,o,i,s,l,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)),s=e.clientWidth||e.width,l=e.clientHeight||e.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:l});case 11:d=t.sent,c.postMessage({id:o,bitmap:d,width:s,height:l,dataURLOptions:a.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=ut(e,t,n,!1),o=function(e,t,n,r){var o,a=[],i=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=ne(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ue(this.canvas,n,r,!0)||setTimeout((function(){var n=it(u,t,a);e(a.canvas,{type:we["2D"],property:i,args:n})}),0),o.apply(this,u)}}));a.push(s)}catch(n){var u=te(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:we["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(i.s();!(o=i.n()).done;)s()}catch(e){i.e(e)}finally{i.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),a=function(e,t,n,r,o){var a=[];return a.push.apply(a,p(ct(t.WebGLRenderingContext.prototype,we.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,p(ct(t.WebGL2RenderingContext.prototype,we.WebGL2,e,n,r,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4