Socket
Socket
Sign inDemoInstall

rrweb-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb-snapshot - npm Package Compare versions

Comparing version 2.0.0-alpha.11 to 2.0.0-alpha.12

2

dist/rrweb-snapshot.min.js

@@ -1,2 +0,2 @@

var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function a(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){var t=e.cssText;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function i(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(s).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function s(e){var t;if(l(e))try{t=i(e.styleSheet)||o(e)}catch(e){}return c(t||e.cssText)}function c(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}function l(e){return"styleSheet"in e}e.NodeType=void 0,(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";var u=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function d(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&p(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function p(e){return e.toLowerCase()}var f="__rrweb_original__";function m(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o=f in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function h(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.NodeType.Document?t.compatMode===r.compatMode:t.type===e.NodeType.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===r.textContent:t.type===e.NodeType.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function v(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?p(t):null}var y,g,T=1,b=new RegExp("[^a-z0-9-_:]");function k(){return T++}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?:[a-z+]+:)?\/\//i,S=/^www\..*/i,w=/^(data:)([^,]*),(.*)/i;function x(e,t){return(e||"").replace(N,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(C.test(c)||S.test(c))return"url(".concat(l).concat(c).concat(l,")");if(w.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var I=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;function L(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function M(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function O(){var e=document.createElement("a");return e.href="",e.href}function D(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?L(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(E),!(r>=t.length);){var o=n(I);if(","===o.slice(-1))o=L(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=L(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r?x(n,O()):"object"===t&&"data"===r?L(e,n):n:L(e,n):n}function _(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function A(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&A(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&A(e.parentNode,t,r)}function R(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(A(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function F(t,r){var n=r.doc,a=r.mirror,o=r.blockClass,s=r.blockSelector,c=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,f=r.maskInputOptions,h=void 0===f?{}:f,T=r.maskTextFn,k=r.maskInputFn,N=r.dataURLOptions,C=void 0===N?{}:N,S=r.inlineImages,w=r.recordCanvas,I=r.keepIframeSrcFn,E=r.newlyAddedElement,L=void 0!==E&&E,A=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:A};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,o=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,u=r.maskInputFn,f=r.dataURLOptions,h=void 0===f?{}:f,T=r.inlineImages,k=r.recordCanvas,N=r.keepIframeSrcFn,C=r.newlyAddedElement,S=void 0!==C&&C,w=r.rootId,I=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,o),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=p(e.tagName);return b.test(t)?"div":t}(t),L={},A=t.attributes.length,R=0;R<A;R++){var F=t.attributes[R];_(E,F.name,F.value)||(L[F.name]=D(n,E,p(F.name),F.value))}if("link"===E&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=i(U)),W&&(delete L.rel,delete L.href,L._cssText=x(W,U.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=i(t.sheet))&&(L._cssText=x(W,O()))}if("input"===E||"textarea"===E||"select"===E){var j=t.value,B=t.checked;if("radio"!==L.type&&"checkbox"!==L.type&&"submit"!==L.type&&"button"!==L.type&&j){var P=v(t);L.value=d({element:t,type:P,tagName:E,value:j,maskInputOptions:l,maskInputFn:u})}else B&&(L.checked=B)}"option"===E&&(t.selected&&!l.select?L.selected=!0:delete L.selected);if("canvas"===E&&k)if("2d"===t.__context)m(t)||(L.rr_dataURL=t.toDataURL(h.type,h.quality));else if(!("__context"in t)){var G=t.toDataURL(h.type,h.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(h.type,h.quality)&&(L.rr_dataURL=G)}if("img"===E&&T){y||(y=n.createElement("canvas"),g=y.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var q=function(){z.removeEventListener("load",q);try{y.width=z.naturalWidth,y.height=z.naturalHeight,g.drawImage(z,0,0),L.rr_dataURL=y.toDataURL(h.type,h.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?L.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}"audio"!==E&&"video"!==E||(L.rr_mediaState=t.paused?"paused":"played",L.rr_mediaCurrentTime=t.currentTime);S||(t.scrollLeft&&(L.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(L.rr_scrollTop=t.scrollTop));if(I){var $=t.getBoundingClientRect(),Y=$.width,J=$.height;L={class:L.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==E||N(L.src)||(t.contentDocument||(L.rr_src=L.src),delete L.src);return{type:e.NodeType.Element,tagName:E,attributes:L,childNodes:[],isSVG:M(t)||void 0,needBlock:I,rootId:w}}(t,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:u,maskInputOptions:h,maskInputFn:k,dataURLOptions:C,inlineImages:S,recordCanvas:w,keepIframeSrcFn:I,newlyAddedElement:L,rootId:A});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,s=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,p="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=i(t.parentNode.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=x(u,O())}p&&(u="SCRIPT_PLACEHOLDER");!d&&!p&&u&&R(t,a,o)&&(u=s?s(u):u.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:T,rootId:A});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:A};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:A};default:return!1}}function U(e){return null==e?"":e.toLowerCase()}function W(t,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,p=o.maskTextSelector,f=o.skipChild,m=void 0!==f&&f,h=o.inlineStylesheet,v=void 0===h||h,y=o.maskInputOptions,g=void 0===y?{}:y,T=o.maskTextFn,b=o.maskInputFn,N=o.slimDOMOptions,C=o.dataURLOptions,S=void 0===C?{}:C,w=o.inlineImages,x=void 0!==w&&w,I=o.recordCanvas,E=void 0!==I&&I,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,A=o.stylesheetLoadTimeout,R=void 0===A?5e3:A,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=F(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,dataURLOptions:S,inlineImages:x,recordCanvas:E,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(t,"not serialized"),null;i=c.hasNode(t)?c.getId(t):!function(t,r){if(r.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(U(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===U(t.attributes.name)||"icon"===U(t.attributes.rel)||"apple-touch-icon"===U(t.attributes.rel)||"shortcut icon"===U(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&U(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(U(t.attributes.property).match(/^(og|twitter|fb):/)||U(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===U(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===U(t.attributes.name)||"googlebot"===U(t.attributes.name)||"bingbot"===U(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===U(t.attributes.name)||"generator"===U(t.attributes.name)||"framework"===U(t.attributes.name)||"publisher"===U(t.attributes.name)||"progid"===U(t.attributes.name)||U(t.attributes.property).match(/^article:/)||U(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===U(t.attributes.name)||"yandex-verification"===U(t.attributes.name)||"csrf-token"===U(t.attributes.name)||"p:domain_verify"===U(t.attributes.name)||"verify-v1"===U(t.attributes.name)||"verification"===U(t.attributes.name)||"shopify-checkout-api-token"===U(t.attributes.name)))return!0}}return!1}(V,N)&&(z||V.type!==e.NodeType.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?k():-2;var q=Object.assign(V,{id:i});if(c.add(t,q),-2===i)return null;L&&L(t);var $=!m;if(q.type===e.NodeType.Element){$=$&&!q.needBlock,delete q.needBlock;var Y=t.shadowRoot;Y&&a(Y)&&(q.isShadowHost=!0)}if((q.type===e.NodeType.Document||q.type===e.NodeType.Element)&&$){N.headWhitespace&&q.type===e.NodeType.Element&&"head"===q.tagName&&(z=!1);for(var J={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:E,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B},X=0,K=Array.from(t.childNodes);X<K.length;X++){(ee=W(K[X],J))&&q.childNodes.push(ee)}if(r(t)&&t.shadowRoot)for(var Q=0,Z=Array.from(t.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=W(Z[Q],J))&&(a(t.shadowRoot)&&(ee.isShadow=!0),q.childNodes.push(ee))}}return t.parentNode&&n(t.parentNode)&&a(t.parentNode)&&(q.isShadow=!0),q.type===e.NodeType.Element&&"iframe"===q.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=W(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:E,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});r&&M(t,r)}}),D),q.type===e.NodeType.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(t,(function(){if(_){var e=W(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:E,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});e&&_(t,e)}}),R),q}var j=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function B(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),f(),t}}var i=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};i.prototype.content=e;var s=[];function c(a){var o=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(a));if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){var t,r=[];for(f(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||x());)t&&(r.push(t),m(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function f(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=p(/^([^{]+)/);if(e)return P(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=o(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=P(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(j,""),value:n?P(n[0]).replace(j,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return u()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=S("import"),N=S("charset"),C=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function w(){if("@"===e[0])return function(){var e=o(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=P(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:P(t[1]),media:P(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=P(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||C()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=P(t[1]),n=P(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function x(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return G((b=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function P(e){return e?e.replace(/^\s+|\s+$/g,""):""}function G(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,o=Object.keys(e);a<o.length;a++){var i=e[o[a]];Array.isArray(i)?i.forEach((function(e){G(e,n)})):i&&"object"==typeof i&&G(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var H={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var z=/([^\\]):hover/,V=new RegExp(z.source,"g");function q(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=B(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){z.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(V,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function $(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.NodeType.Document:return n.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:var i,s=function(e){var t=H[e.tagName]?H[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,p="style"===s&&"_cssText"===l;if(p&&a&&"string"==typeof u&&(u=q(u,o)),!d&&!p||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var f=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(f)}}}var y=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var g in c)y(g);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?q(t.textContent,o):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function Y(t,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(t.id)){var p=o.getNode(t.id);if(h(o.getMeta(p),t))return o.getNode(t.id)}var f=$(t,{doc:a,hackCss:l,cache:d});if(!f)return null;if(t.rootId&&o.getNode(t.rootId)!==a&&o.replace(t.rootId,a),t.type===e.NodeType.Document&&(a.close(),a.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=a),o.add(f,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var m=function(n){var i=Y(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&r(f)&&f.shadowRoot)f.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&n.type==e.NodeType.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),f.appendChild(i),s.appendChild(c)):f.appendChild(i)}else f.appendChild(i);u&&u(i,n.id)},v=0,y=t.childNodes;v<y.length;v++){m(y[v])}return f}return e.IGNORED_NODE=-2,e.Mirror=u,e.addHoverClass=q,e.buildNodeWithSN=Y,e.classMatchesRegex=A,e.cleanupSnapshot=function(){T=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new u},e.escapeImportStatement=o,e.genId=k,e.getInputType=v,e.ignoreAttribute=_,e.is2DCanvasBlank=m,e.isCSSImportRule=l,e.isElement=r,e.isNativeShadowDom=a,e.isNodeMetaEqual=h,e.isShadowRoot=n,e.maskInputValue=d,e.needMaskingText=R,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,c=r.cache,l=r.mirror,d=void 0===l?new u:l,p=Y(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:c});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.NodeType.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),p},e.serializeNodeWithId=W,e.snapshot=function(e,t){var r=t||{},n=r.mirror,a=void 0===n?new u:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,c=void 0===s?null:s,l=r.maskTextClass,d=void 0===l?"rr-mask":l,p=r.maskTextSelector,f=void 0===p?null:p,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,y=void 0!==v&&v,g=r.recordCanvas,T=void 0!==g&&g,b=r.maskAllInputs,k=void 0!==b&&b,N=r.maskTextFn,C=r.maskInputFn,S=r.slimDOM,w=void 0!==S&&S,x=r.dataURLOptions,I=r.preserveWhiteSpace,E=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return W(e,{doc:e,mirror:a,blockClass:i,blockSelector:c,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,maskTextFn:N,maskInputFn:C,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:x,inlineImages:y,recordCanvas:T,preserveWhiteSpace:I,onSerialize:E,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})},e.stringifyRule=s,e.stringifyStylesheet=i,e.toLowerCase=p,e.transformAttribute=D,e.validateStringifiedCssRule=c,e.visitSnapshot=function(t,r){!function t(n){r(n),n.type!==e.NodeType.Document&&n.type!==e.NodeType.Element||n.childNodes.forEach(t)}(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var rrwebSnapshot=function(e){"use strict";var t;function n(e){return e.nodeType===e.ELEMENT_NODE}function r(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function o(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function i(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,a).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(l(e))try{t=i(e.styleSheet)||s(e)}catch(e){}else if(u(e)&&e.selectorText.includes(":"))return c(e.cssText);return t||e.cssText}function c(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function l(e){return"styleSheet"in e}function u(e){return"selectorText"in e}e.NodeType=void 0,(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";class d{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function p({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:s}){let i=o||"";const a=r&&m(r);return(t[n.toLowerCase()]||a&&t[a])&&(i=s?s(i,e):"*".repeat(i.length)),i}function m(e){return e.toLowerCase()}const f="__rrweb_original__";function h(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s=f in o?o.__rrweb_original__:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0}function y(t,n){return!(!t||!n||t.type!==n.type)&&(t.type===e.NodeType.Document?t.compatMode===n.compatMode:t.type===e.NodeType.DocumentType?t.name===n.name&&t.publicId===n.publicId&&t.systemId===n.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===n.textContent:t.type===e.NodeType.Element&&(t.tagName===n.tagName&&JSON.stringify(t.attributes)===JSON.stringify(n.attributes)&&t.isSVG===n.isSVG&&t.needBlock===n.needBlock))}function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?m(t):null}function b(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let T=1;const k=new RegExp("[^a-z0-9-_:]");function N(){return T++}let S,w;const C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,v=/^(?:[a-z+]+:)?\/\//i,x=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function I(e,t){return(e||"").replace(C,((e,n,r,o,s,i)=>{const a=r||s||i,c=n||o||"";if(!a)return e;if(v.test(a)||x.test(a))return`url(${c}${a}${c})`;if(E.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const M=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function O(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function D(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function R(){const e=document.createElement("a");return e.href="",e.href}function _(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?O(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(L),!(n>=t.length);){let s=r(M);if(","===s.slice(-1))s=O(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=O(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?I(r,R()):"object"===t&&"data"===n?O(e,r):r:O(e,r):r}function A(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function F(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&F(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&F(e.parentNode,t,n)}function $(e,t,n,r){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(F(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 U(t,n){const{doc:r,mirror:o,blockClass:s,blockSelector:a,needsMask:c,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,dataURLOptions:y={},inlineImages:b,recordCanvas:T,keepIframeSrcFn:N,newlyAddedElement:C=!1}=n,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:v};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:b=!1,rootId:T}=n,N=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,o,s),C=function(e){if(e instanceof HTMLFormElement)return"form";const t=m(e.tagName);return k.test(t)?"div":t}(t);let v={};const x=t.attributes.length;for(let e=0;e<x;e++){const n=t.attributes[e];A(C,n.name,n.value)||(v[n.name]=_(r,C,m(n.name),n.value))}if("link"===C&&a){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=i(e)),n&&(delete v.rel,delete v.href,v._cssText=I(n,e.href))}if("style"===C&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=i(t.sheet);e&&(v._cssText=I(e,R()))}if("input"===C||"textarea"===C||"select"===C){const e=t.value,n=t.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&e?v.value=p({element:t,type:g(t),tagName:C,value:e,maskInputOptions:c,maskInputFn:l}):n&&(v.checked=n)}"option"===C&&(t.selected&&!c.select?v.selected=!0:delete v.selected);if("canvas"===C&&f)if("2d"===t.__context)h(t)||(v.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(v.rr_dataURL=e)}if("img"===C&&d){S||(S=r.createElement("canvas"),w=S.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{S.width=e.naturalWidth,S.height=e.naturalHeight,w.drawImage(e,0,0),v.rr_dataURL=S.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?v.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==C&&"video"!==C||(v.rr_mediaState=t.paused?"paused":"played",v.rr_mediaCurrentTime=t.currentTime);b||(t.scrollLeft&&(v.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(v.rr_scrollTop=t.scrollTop));if(N){const{width:e,height:n}=t.getBoundingClientRect();v={class:v.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==C||y(v.src)||(t.contentDocument||(v.rr_src=v.src),delete v.src);let E;try{customElements.get(C)&&(E=!0)}catch(e){}return{type:e.NodeType.Element,tagName:C,attributes:v,childNodes:[],isSVG:D(t)||void 0,needBlock:N,rootId:T,isCustom:E}}(t,{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:l,maskInputOptions:u,maskInputFn:f,dataURLOptions:y,inlineImages:b,recordCanvas:T,keepIframeSrcFn:N,newlyAddedElement:C,rootId:v});case t.TEXT_NODE:return function(t,n){var r;const{needsMask:o,maskTextFn:s,rootId:a}=n,c=t.parentNode&&t.parentNode.tagName;let l=t.textContent;const u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(l=i(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}l=I(l,R())}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&o&&(l=s?s(l,t.parentElement):l.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:l||"",isStyle:u,rootId:a}}(t,{needsMask:c,maskTextFn:d,rootId:v});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:v};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:v};default:return!1}}function W(e){return null==e?"":e.toLowerCase()}function j(t,s){const{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:p=!1,inlineStylesheet:m=!0,maskInputOptions:f={},maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T={},inlineImages:k=!1,recordCanvas:S=!1,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:v=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:M=!1}=s;let{needsMask:L}=s,{preserveWhiteSpace:O=!0}=s;if(!L&&t.childNodes){L=$(t,u,d,void 0===L)}const D=U(t,{doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,dataURLOptions:T,inlineImages:k,recordCanvas:S,keepIframeSrcFn:I,newlyAddedElement:M});if(!D)return console.warn(t,"not serialized"),null;let R;R=a.hasNode(t)?a.getId(t):!function(t,n){if(n.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===b(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(W(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===W(t.attributes.name)||"icon"===W(t.attributes.rel)||"apple-touch-icon"===W(t.attributes.rel)||"shortcut icon"===W(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&W(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(W(t.attributes.property).match(/^(og|twitter|fb):/)||W(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===W(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===W(t.attributes.name)||"googlebot"===W(t.attributes.name)||"bingbot"===W(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===W(t.attributes.name)||"generator"===W(t.attributes.name)||"framework"===W(t.attributes.name)||"publisher"===W(t.attributes.name)||"progid"===W(t.attributes.name)||W(t.attributes.property).match(/^article:/)||W(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===W(t.attributes.name)||"yandex-verification"===W(t.attributes.name)||"csrf-token"===W(t.attributes.name)||"p:domain_verify"===W(t.attributes.name)||"verify-v1"===W(t.attributes.name)||"verification"===W(t.attributes.name)||"shopify-checkout-api-token"===W(t.attributes.name)))return!0}}return!1}(D,g)&&(O||D.type!==e.NodeType.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?N():-2;const _=Object.assign(D,{id:R});if(a.add(t,_),-2===R)return null;w&&w(t);let A=!p;if(_.type===e.NodeType.Element){A=A&&!_.needBlock,delete _.needBlock;const e=t.shadowRoot;e&&o(e)&&(_.isShadowHost=!0)}if((_.type===e.NodeType.Document||_.type===e.NodeType.Element)&&A){g.headWhitespace&&_.type===e.NodeType.Element&&"head"===_.tagName&&(O=!1);const r={doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:p,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:k,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:v,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:I};if(_.type===e.NodeType.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else for(const e of Array.from(t.childNodes)){const t=j(e,r);t&&_.childNodes.push(t)}if(n(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const n=j(e,r);n&&(o(t.shadowRoot)&&(n.isShadow=!0),_.childNodes.push(n))}}return t.parentNode&&r(t.parentNode)&&o(t.parentNode)&&(_.isShadow=!0),_.type===e.NodeType.Element&&"iframe"===_.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&C){const n=j(e,{doc:e,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:k,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:v,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:I});n&&C(t,n)}}),v),_.type===e.NodeType.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===b(_.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(t,(()=>{if(x){const e=j(t,{doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:k,recordCanvas:S,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:v,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:I});e&&x(t,e)}}),E),_}const B=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function P(e,t={}){let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function s(){const e={line:n,column:r};return t=>(t.position=new i(e),m(),t)}class i{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}i.prototype.content=e;const a=[];function c(o){const s=new Error(`${t.source||""}:${n}:${r}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=r,s.source=e,!t.silent)throw s;a.push(s)}function l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=C()||v());)t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function m(){p(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");const i=e.slice(2,n-2);return r+=2,o(i),e=e.slice(n),r+=2,t({type:"comment",comment:i})}function y(){const e=p(/^([^{]+)/);if(e)return G(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/).map((e=>e.replace(/\u200C/g,",")))}function g(){const e=s(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=G(t[0]);if(!p(/^:\s*/))return c("property missing ':'");const r=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(B,""),value:r?G(r[0]).replace(B,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!l())return c("missing '{'");let t;for(f(e);t=g();)!1!==t&&(e.push(t),f(e)),t=g();return u()?e:c("missing '}'")}function T(){let e;const t=[],n=s();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const k=w("import"),N=w("charset"),S=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){if("@"===e[0])return function(){const e=s();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let o,i=f();for(;o=T();)i.push(o),i=i.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:i}):c("@keyframes missing '}'")}()||function(){const e=s(),t=p(/^@media *([^{]+)/);if(!t)return;const n=G(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=s(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:G(t[1]),media:G(t[2])})}()||function(){const e=s(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=G(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||k()||N()||S()||function(){const e=s(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=G(t[1]),r=G(t[2]);if(!l())return c("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}()||function(){const e=s();if(!p(/^@page */))return;const t=y()||[];if(!l())return c("@page missing '{'");let n,r=f();for(;n=g();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=s();if(!p(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=s();if(!p(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=f();for(;t=g();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function v(){const e=s(),t=y();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):c("selector missing")}return V(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function G(e){return e?e.replace(/^\s+|\s+$/g,""):""}function V(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{V(e,r)})):n&&"object"==typeof n&&V(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const z={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function H(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const q=/(max|min)-device-(width|height)/,Y=new RegExp(q.source,"g"),J=/([^\\]):hover/,K=new RegExp(J.source,"g");function X(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const r=P(e,{silent:!0});if(!r.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{J.test(e)&&o.push(e)})),"media"in t&&t.media&&q.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(r.stylesheet);let i=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>H(e))).join("|"),"g");i=i.replace(e,(e=>{const t=e.replace(K,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>H(e))).join("|"),"g");i=i.replace(e,(e=>e.replace(Y,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,i),i}function Q(t,n){var r;const{doc:o,hackCss:s,cache:i}=n;switch(t.type){case e.NodeType.Document:return o.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return o.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:{const e=function(e){let t=z[e.tagName]?z[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=o.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&(null===(r=o.defaultView)||void 0===r?void 0:r.customElements)&&!o.defaultView.customElements.get(t.tagName)&&o.defaultView.customElements.define(t.tagName,class extends o.defaultView.HTMLElement{}),n=o.createElement(e));const a={};for(const r in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,r))continue;let c=t.attributes[r];if("option"===e&&"selected"===r&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),r.startsWith("rr_")){a[r]=c;continue}const l="textarea"===e&&"value"===r,u="style"===e&&"_cssText"===r;if(u&&s&&"string"==typeof c&&(c=X(c,i)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===r)n.setAttributeNS("http://www.w3.org/1999/xlink",r,c.toString());else if("onload"===r||"onclick"===r||"onmouse"===r.substring(0,7))n.setAttribute("_"+r,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===r){n.setAttribute("csp-content",c.toString());continue}("link"!==e||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===e&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===e&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("rrweb-original-srcset",t.attributes.srcset):n.setAttribute(r,c.toString())))}}catch(e){}else n.appendChild(o.createTextNode(c)),t.childNodes=[]}for(const r in a){const o=a[r];if("canvas"===e&&"rr_dataURL"===r){const e=document.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),n.RRNodeType&&(n.rr_dataURL=o.toString())}else if("img"===e&&"rr_dataURL"===r){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=o.toString())}if("rr_width"===r)n.style.width=o.toString();else if("rr_height"===r)n.style.height=o.toString();else if("rr_mediaCurrentTime"===r&&"number"==typeof o)n.currentTime=o;else if("rr_mediaState"===r)switch(o){case"played":n.play().catch((e=>console.warn("media playback error",e)));break;case"paused":n.pause()}}if(t.isShadowHost)if(n.shadowRoot)for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);else n.attachShadow({mode:"open"});return n}case e.NodeType.Text:return o.createTextNode(t.isStyle&&s?X(t.textContent,i):t.textContent);case e.NodeType.CDATA:return o.createCDATASection(t.textContent);case e.NodeType.Comment:return o.createComment(t.textContent);default:return null}}function Z(t,r){const{doc:o,mirror:s,skipChild:i=!1,hackCss:a=!0,afterAppend:c,cache:l}=r;if(s.has(t.id)){const e=s.getNode(t.id);if(y(s.getMeta(e),t))return s.getNode(t.id)}let u=Q(t,{doc:o,hackCss:a,cache:l});if(!u)return null;if(t.rootId&&s.getNode(t.rootId)!==o&&s.replace(t.rootId,o),t.type===e.NodeType.Document&&(o.close(),o.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=o),s.add(u,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!i)for(const r of t.childNodes){const i=Z(r,{doc:o,mirror:s,skipChild:!1,hackCss:a,afterAppend:c,cache:l});if(i){if(r.isShadow&&n(u)&&u.shadowRoot)u.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&r.type==e.NodeType.Element){const e=i;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(i),e.appendChild(t)):u.appendChild(i)}else u.appendChild(i);c&&c(i,r.id)}else console.warn("Failed to rebuild",r)}return u}return e.IGNORED_NODE=-2,e.Mirror=d,e.adaptCssForReplay=X,e.buildNodeWithSN=Z,e.classMatchesRegex=F,e.cleanupSnapshot=function(){T=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new d},e.escapeImportStatement=s,e.extractFileExtension=b,e.fixSafariColons=c,e.genId=N,e.getInputType=g,e.ignoreAttribute=A,e.is2DCanvasBlank=h,e.isCSSImportRule=l,e.isCSSStyleRule=u,e.isElement=n,e.isNativeShadowDom=o,e.isNodeMetaEqual=y,e.isShadowRoot=r,e.maskInputValue=p,e.needMaskingText=$,e.rebuild=function(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:i,cache:a,mirror:c=new d}=n,l=Z(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:i,cache:a});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{o&&o(t),function(t,n){const r=n.getMeta(t);if((null==r?void 0:r.type)!==e.NodeType.Element)return;const o=t;for(const e in r.attributes){if(!Object.prototype.hasOwnProperty.call(r.attributes,e)||!e.startsWith("rr_"))continue;const t=r.attributes[e];"rr_scrollLeft"===e&&(o.scrollLeft=t),"rr_scrollTop"===e&&(o.scrollTop=t)}}(t,c)})),l},e.serializeNodeWithId=j,e.snapshot=function(e,t){const{mirror:n=new d,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:m,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:y,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:N,keepIframeSrcFn:S=(()=>!1)}=t||{};return j(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:y,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:N,keepIframeSrcFn:S,newlyAddedElement:!1})},e.stringifyRule=a,e.stringifyStylesheet=i,e.toLowerCase=m,e.transformAttribute=_,e.visitSnapshot=function(t,n){!function t(r){n(r),r.type!==e.NodeType.Document&&r.type!==e.NodeType.Element||r.childNodes.forEach(t)}(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -1,2 +0,2 @@

var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function n(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){var t=e.cssText;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function o(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(i).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function i(e){var t;if(c(e))try{t=o(e.styleSheet)||a(e)}catch(e){}return s(t||e.cssText)}function s(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}function c(e){return"styleSheet"in e}!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"}(e||(e={}));var l=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function u(){return new l}function d(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&f(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function f(e){return e.toLowerCase()}function p(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function m(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.Document?t.compatMode===r.compatMode:t.type===e.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===r.textContent:t.type===e.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function h(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}var v,g,y=1,b=new RegExp("[^a-z0-9-_:]"),k=-2;function T(){return y++}var C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,S=/^(?:[a-z+]+:)?\/\//i,w=/^www\..*/i,x=/^(data:)([^,]*),(.*)/i;function N(e,t){return(e||"").replace(C,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(S.test(c)||w.test(c))return"url(".concat(l).concat(c).concat(l,")");if(x.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var m=p[f];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var E=/^[^ \t\n\r\u000c]+/,I=/^[, \t\n\r\u000c]+/;function L(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function M(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function O(){var e=document.createElement("a");return e.href="",e.href}function D(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?L(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(I),!(r>=t.length);){var o=n(E);if(","===o.slice(-1))o=L(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=L(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r?N(n,O()):"object"===t&&"data"===r?L(e,n):n:L(e,n):n}function _(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function A(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&A(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&A(e.parentNode,t,r)}function R(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(A(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function F(t,r){var n=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,c=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,m=r.maskInputOptions,y=void 0===m?{}:m,k=r.maskTextFn,T=r.maskInputFn,C=r.dataURLOptions,S=void 0===C?{}:C,w=r.inlineImages,x=r.recordCanvas,E=r.keepIframeSrcFn,I=r.newlyAddedElement,L=void 0!==I&&I,A=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:A};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,u=r.maskInputFn,m=r.dataURLOptions,y=void 0===m?{}:m,k=r.inlineImages,T=r.recordCanvas,C=r.keepIframeSrcFn,S=r.newlyAddedElement,w=void 0!==S&&S,x=r.rootId,E=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,i),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=f(e.tagName);return b.test(t)?"div":t}(t),L={},A=t.attributes.length,R=0;R<A;R++){var F=t.attributes[R];_(I,F.name,F.value)||(L[F.name]=D(n,I,f(F.name),F.value))}if("link"===I&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=o(U)),W&&(delete L.rel,delete L.href,L._cssText=N(W,U.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=o(t.sheet))&&(L._cssText=N(W,O()))}if("input"===I||"textarea"===I||"select"===I){var j=t.value,B=t.checked;if("radio"!==L.type&&"checkbox"!==L.type&&"submit"!==L.type&&"button"!==L.type&&j){var P=h(t);L.value=d({element:t,type:P,tagName:I,value:j,maskInputOptions:l,maskInputFn:u})}else B&&(L.checked=B)}"option"===I&&(t.selected&&!l.select?L.selected=!0:delete L.selected);if("canvas"===I&&T)if("2d"===t.__context)p(t)||(L.rr_dataURL=t.toDataURL(y.type,y.quality));else if(!("__context"in t)){var G=t.toDataURL(y.type,y.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(y.type,y.quality)&&(L.rr_dataURL=G)}if("img"===I&&k){v||(v=n.createElement("canvas"),g=v.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var $=function(){z.removeEventListener("load",$);try{v.width=z.naturalWidth,v.height=z.naturalHeight,g.drawImage(z,0,0),L.rr_dataURL=v.toDataURL(y.type,y.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?L.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?$():z.addEventListener("load",$)}"audio"!==I&&"video"!==I||(L.rr_mediaState=t.paused?"paused":"played",L.rr_mediaCurrentTime=t.currentTime);w||(t.scrollLeft&&(L.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(L.rr_scrollTop=t.scrollTop));if(E){var q=t.getBoundingClientRect(),Y=q.width,J=q.height;L={class:L.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==I||C(L.src)||(t.contentDocument||(L.rr_src=L.src),delete L.src);return{type:e.Element,tagName:I,attributes:L,childNodes:[],isSVG:M(t)||void 0,needBlock:E,rootId:x}}(t,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:u,maskInputOptions:y,maskInputFn:T,dataURLOptions:S,inlineImages:w,recordCanvas:x,keepIframeSrcFn:E,newlyAddedElement:L,rootId:A});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,i=r.maskTextSelector,s=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,f="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=o(t.parentNode.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=N(u,O())}f&&(u="SCRIPT_PLACEHOLDER");!d&&!f&&u&&R(t,a,i)&&(u=s?s(u):u.replace(/[\S]/g,"*"));return{type:e.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:k,rootId:A});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:A};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:A};default:return!1}}function U(e){return null==e?"":e.toLowerCase()}function W(a,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,f=o.maskTextSelector,p=o.skipChild,m=void 0!==p&&p,h=o.inlineStylesheet,v=void 0===h||h,g=o.maskInputOptions,y=void 0===g?{}:g,b=o.maskTextFn,k=o.maskInputFn,C=o.slimDOMOptions,S=o.dataURLOptions,w=void 0===S?{}:S,x=o.inlineImages,N=void 0!==x&&x,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,A=o.stylesheetLoadTimeout,R=void 0===A?5e3:A,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=F(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,dataURLOptions:w,inlineImages:N,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(a,"not serialized"),null;i=c.hasNode(a)?c.getId(a):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(U(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===U(t.attributes.name)||"icon"===U(t.attributes.rel)||"apple-touch-icon"===U(t.attributes.rel)||"shortcut icon"===U(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&U(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(U(t.attributes.property).match(/^(og|twitter|fb):/)||U(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===U(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===U(t.attributes.name)||"googlebot"===U(t.attributes.name)||"bingbot"===U(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===U(t.attributes.name)||"generator"===U(t.attributes.name)||"framework"===U(t.attributes.name)||"publisher"===U(t.attributes.name)||"progid"===U(t.attributes.name)||U(t.attributes.property).match(/^article:/)||U(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===U(t.attributes.name)||"yandex-verification"===U(t.attributes.name)||"csrf-token"===U(t.attributes.name)||"p:domain_verify"===U(t.attributes.name)||"verify-v1"===U(t.attributes.name)||"verification"===U(t.attributes.name)||"shopify-checkout-api-token"===U(t.attributes.name)))return!0}}return!1}(V,C)&&(z||V.type!==e.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?T():-2;var $=Object.assign(V,{id:i});if(c.add(a,$),-2===i)return null;L&&L(a);var q=!m;if($.type===e.Element){q=q&&!$.needBlock,delete $.needBlock;var Y=a.shadowRoot;Y&&n(Y)&&($.isShadowHost=!0)}if(($.type===e.Document||$.type===e.Element)&&q){C.headWhitespace&&$.type===e.Element&&"head"===$.tagName&&(z=!1);for(var J={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B},X=0,K=Array.from(a.childNodes);X<K.length;X++){(ee=W(K[X],J))&&$.childNodes.push(ee)}if(t(a)&&a.shadowRoot)for(var Q=0,Z=Array.from(a.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=W(Z[Q],J))&&(n(a.shadowRoot)&&(ee.isShadow=!0),$.childNodes.push(ee))}}return a.parentNode&&r(a.parentNode)&&n(a.parentNode)&&($.isShadow=!0),$.type===e.Element&&"iframe"===$.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(a,(function(){var e=a.contentDocument;if(e&&M){var t=W(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});t&&M(a,t)}}),D),$.type===e.Element&&"link"===$.tagName&&"stylesheet"===$.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(a,(function(){if(_){var e=W(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});e&&_(a,e)}}),R),$}function j(e,t){var r=t||{},n=r.mirror,a=void 0===n?new l:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,c=void 0===s?null:s,u=r.maskTextClass,d=void 0===u?"rr-mask":u,f=r.maskTextSelector,p=void 0===f?null:f,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,g=void 0!==v&&v,y=r.recordCanvas,b=void 0!==y&&y,k=r.maskAllInputs,T=void 0!==k&&k,C=r.maskTextFn,S=r.maskInputFn,w=r.slimDOM,x=void 0!==w&&w,N=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return W(e,{doc:e,mirror:a,blockClass:i,blockSelector:c,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===T?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===T?{password:!0}:T,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:N,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})}function B(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function P(){y=1}var G=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function H(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),p(),t}}var i=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};i.prototype.content=e;var s=[];function c(a){var o=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(a));if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=x()||N());)t&&(r.push(t),m(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){f(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=f(/^([^{]+)/);if(e)return z(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function g(){var e=o(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=z(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(G,""),value:n?z(n[0]).replace(G,""):""});return f(/^[;\s]*/),a}}function y(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return u()?t:c("missing '}'")}function b(){for(var e,t=[],r=o();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,T=w("import"),C=w("charset"),S=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=f(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function x(){if("@"===e[0])return function(){var e=o(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var i=m();n=b();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=f(/^@media *([^{]+)/);if(t){var r=z(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:z(t[1]),media:z(t[2])})}()||function(){var e=o(),t=f(/^@supports *([^{]+)/);if(t){var r=z(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||T()||C()||S()||function(){var e=o(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=z(t[1]),n=z(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(f(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(f(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(f(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function N(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return V((k=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function z(e){return e?e.replace(/^\s+|\s+$/g,""):""}function V(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,o=Object.keys(e);a<o.length;a++){var i=e[o[a]];Array.isArray(i)?i.forEach((function(e){V(e,n)})):i&&"object"==typeof i&&V(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var $={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var q=/([^\\]):hover/,Y=new RegExp(q.source,"g");function J(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=H(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){q.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(Y,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function X(){return{stylesWithHoverClass:new Map}}function K(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.Document:return n.implementation.createDocument(null,"",null);case e.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:var i,s=function(e){var t=$[e.tagName]?$[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,f="style"===s&&"_cssText"===l;if(f&&a&&"string"==typeof u&&(u=J(u,o)),!d&&!f||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var p=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(p)}}}var g=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var y in c)g(y);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.Text:return n.createTextNode(t.isStyle&&a?J(t.textContent,o):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function Q(r,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(r.id)){var f=o.getNode(r.id);if(m(o.getMeta(f),r))return o.getNode(r.id)}var p=K(r,{doc:a,hackCss:l,cache:d});if(!p)return null;if(r.rootId&&o.getNode(r.rootId)!==a&&o.replace(r.rootId,a),r.type===e.Document&&(a.close(),a.open(),"BackCompat"===r.compatMode&&r.childNodes&&r.childNodes[0].type!==e.DocumentType&&(r.childNodes[0].type===e.Element&&"xmlns"in r.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===r.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),p=a),o.add(p,r),(r.type===e.Document||r.type===e.Element)&&!s)for(var h=function(n){var i=Q(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&t(p)&&p.shadowRoot)p.shadowRoot.appendChild(i);else if(r.type===e.Document&&n.type==e.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),p.appendChild(i),s.appendChild(c)):p.appendChild(i)}else p.appendChild(i);u&&u(i,n.id)},v=0,g=r.childNodes;v<g.length;v++){h(g[v])}return p}function Z(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,c=r.cache,u=r.mirror,d=void 0===u?new l:u,f=Q(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:c});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),f}export{k as IGNORED_NODE,l as Mirror,e as NodeType,J as addHoverClass,Q as buildNodeWithSN,A as classMatchesRegex,P as cleanupSnapshot,X as createCache,u as createMirror,a as escapeImportStatement,T as genId,h as getInputType,_ as ignoreAttribute,p as is2DCanvasBlank,c as isCSSImportRule,t as isElement,n as isNativeShadowDom,m as isNodeMetaEqual,r as isShadowRoot,d as maskInputValue,R as needMaskingText,Z as rebuild,W as serializeNodeWithId,j as snapshot,i as stringifyRule,o as stringifyStylesheet,f as toLowerCase,D as transformAttribute,s as validateStringifiedCssRule,B as visitSnapshot};
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function n(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function r(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function s(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,i).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(c(e))try{t=s(e.styleSheet)||o(e)}catch(e){}else if(l(e)&&e.selectorText.includes(":"))return a(e.cssText);return t||e.cssText}function a(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function c(e){return"styleSheet"in e}function l(e){return"selectorText"in e}!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"}(e||(e={}));class u{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function d(){return new u}function m({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:s}){let i=o||"";const a=r&&p(r);return(t[n.toLowerCase()]||a&&t[a])&&(i=s?s(i,e):"*".repeat(i.length)),i}function p(e){return e.toLowerCase()}function f(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s="__rrweb_original__"in o?o.__rrweb_original__:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0}function h(t,n){return!(!t||!n||t.type!==n.type)&&(t.type===e.Document?t.compatMode===n.compatMode:t.type===e.DocumentType?t.name===n.name&&t.publicId===n.publicId&&t.systemId===n.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===n.textContent:t.type===e.Element&&(t.tagName===n.tagName&&JSON.stringify(t.attributes)===JSON.stringify(n.attributes)&&t.isSVG===n.isSVG&&t.needBlock===n.needBlock))}function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?p(t):null}function y(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let b=1;const k=new RegExp("[^a-z0-9-_:]"),w=-2;function C(){return b++}let T,S;const N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,x=/^(?:[a-z+]+:)?\/\//i,v=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function I(e,t){return(e||"").replace(N,((e,n,r,o,s,i)=>{const a=r||s||i,c=n||o||"";if(!a)return e;if(x.test(a)||v.test(a))return`url(${c}${a}${c})`;if(E.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const M=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function O(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function D(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function _(){const e=document.createElement("a");return e.href="",e.href}function A(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?O(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(L),!(n>=t.length);){let s=r(M);if(","===s.slice(-1))s=O(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=O(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?I(r,_()):"object"===t&&"data"===n?O(e,r):r:O(e,r):r}function R(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function F(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&F(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&F(e.parentNode,t,n)}function $(e,t,n,r){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(F(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 U(t,n){const{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:c,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,dataURLOptions:y={},inlineImages:b,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:N=!1}=n,x=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:b=!1,rootId:w}=n,C=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,o,i),N=function(e){if(e instanceof HTMLFormElement)return"form";const t=p(e.tagName);return k.test(t)?"div":t}(t);let x={};const v=t.attributes.length;for(let e=0;e<v;e++){const n=t.attributes[e];R(N,n.name,n.value)||(x[n.name]=A(r,N,p(n.name),n.value))}if("link"===N&&a){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=s(e)),n&&(delete x.rel,delete x.href,x._cssText=I(n,e.href))}if("style"===N&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=s(t.sheet);e&&(x._cssText=I(e,_()))}if("input"===N||"textarea"===N||"select"===N){const e=t.value,n=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&e?x.value=m({element:t,type:g(t),tagName:N,value:e,maskInputOptions:c,maskInputFn:l}):n&&(x.checked=n)}"option"===N&&(t.selected&&!c.select?x.selected=!0:delete x.selected);if("canvas"===N&&h)if("2d"===t.__context)f(t)||(x.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(x.rr_dataURL=e)}if("img"===N&&d){T||(T=r.createElement("canvas"),S=T.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{T.width=e.naturalWidth,T.height=e.naturalHeight,S.drawImage(e,0,0),x.rr_dataURL=T.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?x.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==N&&"video"!==N||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);b||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(C){const{width:e,height:n}=t.getBoundingClientRect();x={class:x.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==N||y(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);let E;try{customElements.get(N)&&(E=!0)}catch(e){}return{type:e.Element,tagName:N,attributes:x,childNodes:[],isSVG:D(t)||void 0,needBlock:C,rootId:w,isCustom:E}}(t,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:N,rootId:x});case t.TEXT_NODE:return function(t,n){var r;const{needsMask:o,maskTextFn:i,rootId:a}=n,c=t.parentNode&&t.parentNode.tagName;let l=t.textContent;const u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(l=s(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}l=I(l,_())}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&o&&(l=i?i(l,t.parentElement):l.replace(/[\S]/g,"*"));return{type:e.Text,textContent:l||"",isStyle:u,rootId:a}}(t,{needsMask:c,maskTextFn:d,rootId:x});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:x};default:return!1}}function W(e){return null==e?"":e.toLowerCase()}function j(o,s){const{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:m=!1,inlineStylesheet:p=!0,maskInputOptions:f={},maskTextFn:h,maskInputFn:g,slimDOMOptions:b,dataURLOptions:k={},inlineImages:w=!1,recordCanvas:T=!1,onSerialize:S,onIframeLoad:N,iframeLoadTimeout:x=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:M=!1}=s;let{needsMask:L}=s,{preserveWhiteSpace:O=!0}=s;if(!L&&o.childNodes){L=$(o,u,d,void 0===L)}const D=U(o,{doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,dataURLOptions:k,inlineImages:w,recordCanvas:T,keepIframeSrcFn:I,newlyAddedElement:M});if(!D)return console.warn(o,"not serialized"),null;let _;_=a.hasNode(o)?a.getId(o):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===y(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(W(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===W(t.attributes.name)||"icon"===W(t.attributes.rel)||"apple-touch-icon"===W(t.attributes.rel)||"shortcut icon"===W(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&W(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(W(t.attributes.property).match(/^(og|twitter|fb):/)||W(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===W(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===W(t.attributes.name)||"googlebot"===W(t.attributes.name)||"bingbot"===W(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===W(t.attributes.name)||"generator"===W(t.attributes.name)||"framework"===W(t.attributes.name)||"publisher"===W(t.attributes.name)||"progid"===W(t.attributes.name)||W(t.attributes.property).match(/^article:/)||W(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===W(t.attributes.name)||"yandex-verification"===W(t.attributes.name)||"csrf-token"===W(t.attributes.name)||"p:domain_verify"===W(t.attributes.name)||"verify-v1"===W(t.attributes.name)||"verification"===W(t.attributes.name)||"shopify-checkout-api-token"===W(t.attributes.name)))return!0}}return!1}(D,b)&&(O||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?C():-2;const A=Object.assign(D,{id:_});if(a.add(o,A),-2===_)return null;S&&S(o);let R=!m;if(A.type===e.Element){R=R&&!A.needBlock,delete A.needBlock;const e=o.shadowRoot;e&&r(e)&&(A.isShadowHost=!0)}if((A.type===e.Document||A.type===e.Element)&&R){b.headWhitespace&&A.type===e.Element&&"head"===A.tagName&&(O=!1);const n={doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:m,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:b,dataURLOptions:k,inlineImages:w,recordCanvas:T,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:N,iframeLoadTimeout:x,onStylesheetLoad:v,stylesheetLoadTimeout:E,keepIframeSrcFn:I};if(A.type===e.Element&&"textarea"===A.tagName&&void 0!==A.attributes.value);else for(const e of Array.from(o.childNodes)){const t=j(e,n);t&&A.childNodes.push(t)}if(t(o)&&o.shadowRoot)for(const e of Array.from(o.shadowRoot.childNodes)){const t=j(e,n);t&&(r(o.shadowRoot)&&(t.isShadow=!0),A.childNodes.push(t))}}return o.parentNode&&n(o.parentNode)&&r(o.parentNode)&&(A.isShadow=!0),A.type===e.Element&&"iframe"===A.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(o,(()=>{const e=o.contentDocument;if(e&&N){const t=j(e,{doc:e,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:b,dataURLOptions:k,inlineImages:w,recordCanvas:T,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:N,iframeLoadTimeout:x,onStylesheetLoad:v,stylesheetLoadTimeout:E,keepIframeSrcFn:I});t&&N(o,t)}}),x),A.type===e.Element&&"link"===A.tagName&&"string"==typeof A.attributes.rel&&("stylesheet"===A.attributes.rel||"preload"===A.attributes.rel&&"string"==typeof A.attributes.href&&"css"===y(A.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(o,(()=>{if(v){const e=j(o,{doc:i,mirror:a,blockClass:c,blockSelector:l,needsMask:L,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:b,dataURLOptions:k,inlineImages:w,recordCanvas:T,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:N,iframeLoadTimeout:x,onStylesheetLoad:v,stylesheetLoadTimeout:E,keepIframeSrcFn:I});e&&v(o,e)}}),E),A}function B(e,t){const{mirror:n=new u,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:m,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:k,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:T=(()=>!1)}=t||{};return j(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:m,maskInputFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:k,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:T,newlyAddedElement:!1})}function P(t,n){!function t(r){n(r),r.type!==e.Document&&r.type!==e.Element||r.childNodes.forEach(t)}(t)}function G(){b=1}const H=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function V(e,t={}){let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function s(){const e={line:n,column:r};return t=>(t.position=new i(e),p(),t)}class i{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}i.prototype.content=e;const a=[];function c(o){const s=new Error(`${t.source||""}:${n}:${r}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=r,s.source=e,!t.silent)throw s;a.push(s)}function l(){return m(/^{\s*/)}function u(){return m(/^}/)}function d(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=N()||x());)t&&(n.push(t),f(n));return n}function m(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function p(){m(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");const i=e.slice(2,n-2);return r+=2,o(i),e=e.slice(n),r+=2,t({type:"comment",comment:i})}function g(){const e=m(/^([^{]+)/);if(e)return z(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/).map((e=>e.replace(/\u200C/g,",")))}function y(){const e=s(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=z(t[0]);if(!m(/^:\s*/))return c("property missing ':'");const r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(H,""),value:r?z(r[0]).replace(H,""):""});return m(/^[;\s]*/),o}function b(){const e=[];if(!l())return c("missing '{'");let t;for(f(e);t=y();)!1!==t&&(e.push(t),f(e)),t=y();return u()?e:c("missing '}'")}function k(){let e;const t=[],n=s();for(;e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const w=S("import"),C=S("charset"),T=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),r=m(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function N(){if("@"===e[0])return function(){const e=s();let t=m(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=m(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let o,i=f();for(;o=k();)i.push(o),i=i.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:i}):c("@keyframes missing '}'")}()||function(){const e=s(),t=m(/^@media *([^{]+)/);if(!t)return;const n=z(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=s(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:z(t[1]),media:z(t[2])})}()||function(){const e=s(),t=m(/^@supports *([^{]+)/);if(!t)return;const n=z(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||w()||C()||T()||function(){const e=s(),t=m(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=z(t[1]),r=z(t[2]);if(!l())return c("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}()||function(){const e=s();if(!m(/^@page */))return;const t=g()||[];if(!l())return c("@page missing '{'");let n,r=f();for(;n=y();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=s();if(!m(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=s();if(!m(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=f();for(;t=y();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function x(){const e=s(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):c("selector missing")}return q(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function z(e){return e?e.replace(/^\s+|\s+$/g,""):""}function q(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{q(e,r)})):n&&"object"==typeof n&&q(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const Y={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function J(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const K=/(max|min)-device-(width|height)/,X=new RegExp(K.source,"g"),Q=/([^\\]):hover/,Z=new RegExp(Q.source,"g");function ee(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const r=V(e,{silent:!0});if(!r.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{Q.test(e)&&o.push(e)})),"media"in t&&t.media&&K.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(r.stylesheet);let i=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>J(e))).join("|"),"g");i=i.replace(e,(e=>{const t=e.replace(Z,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>J(e))).join("|"),"g");i=i.replace(e,(e=>e.replace(X,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,i),i}function te(){return{stylesWithHoverClass:new Map}}function ne(t,n){var r;const{doc:o,hackCss:s,cache:i}=n;switch(t.type){case e.Document:return o.implementation.createDocument(null,"",null);case e.DocumentType:return o.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:{const e=function(e){let t=Y[e.tagName]?Y[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=o.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&(null===(r=o.defaultView)||void 0===r?void 0:r.customElements)&&!o.defaultView.customElements.get(t.tagName)&&o.defaultView.customElements.define(t.tagName,class extends o.defaultView.HTMLElement{}),n=o.createElement(e));const a={};for(const r in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,r))continue;let c=t.attributes[r];if("option"===e&&"selected"===r&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),r.startsWith("rr_")){a[r]=c;continue}const l="textarea"===e&&"value"===r,u="style"===e&&"_cssText"===r;if(u&&s&&"string"==typeof c&&(c=ee(c,i)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===r)n.setAttributeNS("http://www.w3.org/1999/xlink",r,c.toString());else if("onload"===r||"onclick"===r||"onmouse"===r.substring(0,7))n.setAttribute("_"+r,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===r){n.setAttribute("csp-content",c.toString());continue}("link"!==e||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===e&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===e&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("rrweb-original-srcset",t.attributes.srcset):n.setAttribute(r,c.toString())))}}catch(e){}else n.appendChild(o.createTextNode(c)),t.childNodes=[]}for(const r in a){const o=a[r];if("canvas"===e&&"rr_dataURL"===r){const e=document.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),n.RRNodeType&&(n.rr_dataURL=o.toString())}else if("img"===e&&"rr_dataURL"===r){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=o.toString())}if("rr_width"===r)n.style.width=o.toString();else if("rr_height"===r)n.style.height=o.toString();else if("rr_mediaCurrentTime"===r&&"number"==typeof o)n.currentTime=o;else if("rr_mediaState"===r)switch(o){case"played":n.play().catch((e=>console.warn("media playback error",e)));break;case"paused":n.pause()}}if(t.isShadowHost)if(n.shadowRoot)for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);else n.attachShadow({mode:"open"});return n}case e.Text:return o.createTextNode(t.isStyle&&s?ee(t.textContent,i):t.textContent);case e.CDATA:return o.createCDATASection(t.textContent);case e.Comment:return o.createComment(t.textContent);default:return null}}function re(n,r){const{doc:o,mirror:s,skipChild:i=!1,hackCss:a=!0,afterAppend:c,cache:l}=r;if(s.has(n.id)){const e=s.getNode(n.id);if(h(s.getMeta(e),n))return s.getNode(n.id)}let u=ne(n,{doc:o,hackCss:a,cache:l});if(!u)return null;if(n.rootId&&s.getNode(n.rootId)!==o&&s.replace(n.rootId,o),n.type===e.Document&&(o.close(),o.open(),"BackCompat"===n.compatMode&&n.childNodes&&n.childNodes[0].type!==e.DocumentType&&(n.childNodes[0].type===e.Element&&"xmlns"in n.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===n.childNodes[0].attributes.xmlns?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=o),s.add(u,n),(n.type===e.Document||n.type===e.Element)&&!i)for(const r of n.childNodes){const i=re(r,{doc:o,mirror:s,skipChild:!1,hackCss:a,afterAppend:c,cache:l});if(i){if(r.isShadow&&t(u)&&u.shadowRoot)u.shadowRoot.appendChild(i);else if(n.type===e.Document&&r.type==e.Element){const e=i;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(i),e.appendChild(t)):u.appendChild(i)}else u.appendChild(i);c&&c(i,r.id)}else console.warn("Failed to rebuild",r)}return u}function oe(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:i,cache:a,mirror:c=new u}=n,l=re(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:i,cache:a});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{o&&o(t),function(t,n){const r=n.getMeta(t);if((null==r?void 0:r.type)!==e.Element)return;const o=t;for(const e in r.attributes){if(!Object.prototype.hasOwnProperty.call(r.attributes,e)||!e.startsWith("rr_"))continue;const t=r.attributes[e];"rr_scrollLeft"===e&&(o.scrollLeft=t),"rr_scrollTop"===e&&(o.scrollTop=t)}}(t,c)})),l}export{w as IGNORED_NODE,u as Mirror,e as NodeType,ee as adaptCssForReplay,re as buildNodeWithSN,F as classMatchesRegex,G as cleanupSnapshot,te as createCache,d as createMirror,o as escapeImportStatement,y as extractFileExtension,a as fixSafariColons,C as genId,g as getInputType,R as ignoreAttribute,f as is2DCanvasBlank,c as isCSSImportRule,l as isCSSStyleRule,t as isElement,r as isNativeShadowDom,h as isNodeMetaEqual,n as isShadowRoot,m as maskInputValue,$ as needMaskingText,oe as rebuild,j as serializeNodeWithId,B as snapshot,i as stringifyRule,s as stringifyStylesheet,p as toLowerCase,A as transformAttribute,P as visitSnapshot};
//# sourceMappingURL=rrweb-snapshot.min.js.map
{
"name": "rrweb-snapshot",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",

@@ -8,3 +8,4 @@ "scripts": {

"prepack": "npm run bundle && npm run typings",
"test": "jest",
"retest": "jest",
"test": "yarn bundle && yarn retest",
"test:watch": "jest --watch",

@@ -11,0 +12,0 @@ "test:update": "jest --updateSnapshot",

@@ -27,2 +27,5 @@ export interface ParserOptions {

}
export interface NodeWithRules extends Node {
rules: Array<Rule | Comment | AtRule>;
}
export interface Rule extends Node {

@@ -46,6 +49,5 @@ selectors?: string[];

}
export interface Document extends Node {
export interface Document extends NodeWithRules {
document?: string;
vendor?: string;
rules?: Array<Rule | Comment | AtRule>;
}

@@ -55,5 +57,3 @@ export interface FontFace extends Node {

}
export interface Host extends Node {
rules?: Array<Rule | Comment | AtRule>;
}
export type Host = NodeWithRules;
export interface Import extends Node {

@@ -71,5 +71,4 @@ import?: string;

}
export interface Media extends Node {
export interface Media extends NodeWithRules {
media?: string;
rules?: Array<Rule | Comment | AtRule>;
}

@@ -83,10 +82,8 @@ export interface Namespace extends Node {

}
export interface Supports extends Node {
export interface Supports extends NodeWithRules {
supports?: string;
rules?: Array<Rule | Comment | AtRule>;
}
export type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
export interface StyleRules {
export interface StyleRules extends NodeWithRules {
source?: string;
rules: Array<Rule | Comment | AtRule>;
parsingErrors?: ParserError[];

@@ -93,0 +90,0 @@ }

import snapshot, { serializeNodeWithId, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, IGNORED_NODE, genId } from './snapshot';
import rebuild, { buildNodeWithSN, addHoverClass, createCache } from './rebuild';
import rebuild, { buildNodeWithSN, adaptCssForReplay, createCache } from './rebuild';
export * from './types';
export * from './utils';
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, createCache, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, IGNORED_NODE, genId, };
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, adaptCssForReplay, createCache, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, IGNORED_NODE, genId, };
import { serializedNodeWithId, BuildCache } from './types';
import { Mirror } from './utils';
export declare function addHoverClass(cssText: string, cache: BuildCache): string;
export declare function adaptCssForReplay(cssText: string, cache: BuildCache): string;
export declare function createCache(): BuildCache;

@@ -5,0 +5,0 @@ export declare function buildNodeWithSN(n: serializedNodeWithId, options: {

@@ -11,3 +11,3 @@ import { serializedNodeWithId, MaskInputOptions, SlimDOMOptions, DataURLOptions, MaskTextFn, MaskInputFn, KeepIframeSrcFn, serializedElementNodeWithId } from './types';

export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null): boolean;
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
export declare function serializeNodeWithId(n: Node, options: {

@@ -24,2 +24,3 @@ doc: Document;

maskInputOptions?: MaskInputOptions;
needsMask?: boolean;
maskTextFn: MaskTextFn | undefined;

@@ -26,0 +27,0 @@ maskInputFn: MaskInputFn | undefined;

@@ -33,2 +33,3 @@ export declare enum NodeType {

needBlock?: boolean;
isCustom?: true;
};

@@ -114,3 +115,3 @@ export type textNode = {

}>;
export type MaskTextFn = (text: string) => string;
export type MaskTextFn = (text: string, element: HTMLElement | null) => string;
export type MaskInputFn = (text: string, element: HTMLElement) => string;

@@ -117,0 +118,0 @@ export type KeepIframeSrcFn = (src: string) => boolean;

@@ -15,4 +15,5 @@ import { MaskInputFn, MaskInputOptions, IMirror, serializedNodeWithId, serializedNode } from './types';

export declare function stringifyRule(rule: CSSRule): string;
export declare function validateStringifiedCssRule(cssStringified: string): string;
export declare function fixSafariColons(cssStringified: string): string;
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule;
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
export declare class Mirror implements IMirror<Node> {

@@ -45,2 +46,3 @@ private idNodeMap;

export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
export {};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc