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 1.1.3 to 1.1.4

10

dist/rrweb-snapshot.js

@@ -23,3 +23,3 @@ var rrwebSnapshot = (function (exports) {

var _id = 1;
var tagNameRegex = RegExp('[^a-z0-9-_]');
var tagNameRegex = RegExp('[^a-z0-9-_:]');
var IGNORED_NODE = -2;

@@ -277,3 +277,3 @@ function genId() {

iframeEl.src === '') {
listener();
setTimeout(listener, 0);
return;

@@ -1288,2 +1288,8 @@ }

}
else if (tagName === 'meta' &&
n.attributes['http-equiv'] === 'Content-Security-Policy' &&
name == 'content') {
node_1.setAttribute('csp-content', value);
return "continue";
}
else {

@@ -1290,0 +1296,0 @@ node_1.setAttribute(name, value);

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,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}(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 a=1,o=RegExp("[^a-z0-9-_]"),i=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?s(e.styleSheet)||"":e.cssText}var u=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function d(e,t){return(e||"").replace(u,function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var d=t.split("/"),p=c.split("/");d.pop();for(var m=0,h=p;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?d.pop():d.push(v))}return"url("+u+d.join("/")+u+")"})}var p=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(p);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(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?d(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,a,i=r.doc,c=r.blockClass,u=r.blockSelector,l=r.maskTextClass,f=r.maskTextSelector,p=r.inlineStylesheet,m=r.maskInputOptions,h=void 0===m?{}:m,T=r.maskTextFn,b=r.recordCanvas;if(i.__sn){var k=i.__sn.id;n=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[],rootId:n};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:n};case t.ELEMENT_NODE:for(var N=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,c,u),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return o.test(t)?"div":t}(t),x={},E=0,S=Array.from(t.attributes);E<S.length;E++){var w=S[E],_=w.name,D=w.value;x[_]=y(i,C,_,D)}if("link"===C&&p){var A,O=Array.from(i.styleSheets).find(function(e){return e.href===t.href});(A=s(O))&&(delete x.rel,delete x.href,x._cssText=d(A,O.href))}if("style"===C&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(A=s(t.sheet))&&(x._cssText=d(A,v()));if("input"===C||"textarea"===C||"select"===C){D=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=h[x.type]||h[C]?"*".repeat(D.length):D:t.checked&&(x.checked=t.checked)}if("option"===C){var L=t.parentElement;x.value===L.value&&(x.selected=t.selected)}if("canvas"===C&&b&&(x.rr_dataURL=t.toDataURL()),"audio"!==C&&"video"!==C||(x.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),N){var I=t.getBoundingClientRect(),M=I.width,R=I.height;x={class:x.class,rr_width:M+"px",rr_height:R+"px"}}return"iframe"===C&&delete x.src,{type:e.NodeType.Element,tagName:C,attributes:x,childNodes:[],isSVG:(a=t,"svg"===a.tagName||a instanceof SVGElement||void 0),needBlock:N,rootId:n};case t.TEXT_NODE:var F=t.parentNode&&t.parentNode.tagName,G=t.textContent,W="STYLE"===F||void 0,j="SCRIPT"===F||void 0;return W&&G&&(G=d(G,v())),j&&(G="SCRIPT_PLACEHOLDER"),!W&&!j&&g(t,l,f)&&G&&(G=T?T(G):G.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:G||"",isStyle:W,rootId:n};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:n};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:n};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,o){var s,c=o.doc,u=o.map,l=o.blockClass,f=o.blockSelector,d=o.maskTextClass,p=o.maskTextSelector,m=o.skipChild,h=void 0!==m&&m,v=o.inlineStylesheet,y=void 0===v||v,g=o.maskInputOptions,N=void 0===g?{}:g,C=o.maskTextFn,x=o.slimDOMOptions,E=o.recordCanvas,S=void 0!==E&&E,w=o.onSerialize,_=o.onIframeLoad,D=o.iframeLoadTimeout,A=void 0===D?5e3:D,O=o.preserveWhiteSpace,L=void 0===O||O,I=T(t,{doc:c,blockClass:l,blockSelector:f,maskTextClass:d,maskTextSelector:p,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,recordCanvas:S});if(!I)return console.warn(t,"not serialized"),null;s="__sn"in t?t.__sn.id:!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&&"script"===t.attributes.as))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(I,x)&&(L||I.type!==e.NodeType.Text||I.isStyle||I.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:i;var M=Object.assign(I,{id:s});if(t.__sn=M,s===i)return null;u[s]=t,w&&w(t);var R=!h;if(M.type===e.NodeType.Element&&(R=R&&!M.needBlock,delete M.needBlock),(M.type===e.NodeType.Document||M.type===e.NodeType.Element)&&R){x.headWhitespace&&I.type===e.NodeType.Element&&"head"===I.tagName&&(L=!1);for(var F={doc:c,map:u,blockClass:l,blockSelector:f,maskTextClass:d,maskTextSelector:p,skipChild:h,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A},G=0,W=Array.from(t.childNodes);G<W.length;G++){(P=k(W[G],F))&&M.childNodes.push(P)}if(r(t)&&t.shadowRoot){M.isShadowHost=!0;for(var j=0,z=Array.from(t.shadowRoot.childNodes);j<z.length;j++){var P;(P=k(z[j],F))&&(P.isShadow=!0,M.childNodes.push(P))}}}return t.parentNode&&n(t.parentNode)&&(M.isShadow=!0),M.type===e.NodeType.Element&&"iframe"===M.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)"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):t();else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}(t,function(){var e=t.contentDocument;if(e&&_){var r=k(e,{doc:e,map:u,blockClass:l,blockSelector:f,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A});r&&_(t,r)}},A),M}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function C(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(){return 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(t.source+":"+r+":"+n+": "+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 u(){return d(/^{\s*/)}function l(){return d(/^}/)}function f(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||_());)!1!==t&&(r.push(t),m(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){d(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==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=d(/^([^{]+)/);if(e)return x(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=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=x(t[0]);if(!d(/^:\s*/))return c("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?x(n[0]).replace(N,""):""});return d(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=S("import"),C=S("charset"),E=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=d(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=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=d(/^@media *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:x(t[1]),media:x(t[2])})}()||function(){var e=o(),t=d(/^@supports *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||C()||E()||function(){var e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=x(t[1]),n=x(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(d(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(d(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(d(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function _(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var o=0,i=Object.keys(t);o<i.length;o++){var s=i[o],c=t[s];Array.isArray(c)?c.forEach(function(t){e(t,a)}):c&&"object"==typeof c&&e(c,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function x(e){return e?e.replace(/^\s+|\s+$/g,""):""}var E={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 S=/([^\\]):hover/,w=new RegExp(S,"g");function _(e){var t=C(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){S.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(w,"$1.\\:hover");return e+", "+t})}function D(t,r){var n=r.doc,a=r.hackCss;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 o,i=function(e){var t=E[e.tagName]?E[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",i):n.createElement(i);var s=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=r,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaState"===e)switch(r){case"played":o.play();case"paused":o.pause()}}else{var c="textarea"===i&&"value"===e,u="style"===i&&"_cssText"===e;if(u&&a&&(r=_(r)),c||u){for(var l=n.createTextNode(r),f=0,d=Array.from(o.childNodes);f<d.length;f++){var p=d[f];p.nodeType===o.TEXT_NODE&&o.removeChild(p)}return o.appendChild(l),"continue"}if("iframe"===i&&"src"===e)return"continue";try{t.isSVG&&"xlink:href"===e?o.setAttributeNS("http://www.w3.org/1999/xlink",e,r):"onload"===e||"onclick"===e||"onmouse"===e.substring(0,7)?o.setAttribute("_"+e,r):o.setAttribute(e,r)}catch(e){}}};for(var c in t.attributes)s(c);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?_(t.textContent):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function A(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=D(t,{doc:a,hackCss:u});if(!f)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),f=a),f.__sn=t,o[t.id]=f,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var d=0,p=t.childNodes;d<p.length;d++){var m=p[d],h=A(m,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l});h?(m.isShadow&&r(f)&&f.shadowRoot?f.shadowRoot.appendChild(h):f.appendChild(h),l&&l(h)):console.warn("Failed to rebuild",m)}return f}return e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,d=void 0===f||f,p=r.recordCanvas,m=void 0!==p&&p,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.slimDOM,T=void 0!==g&&g,b={};return[k(e,{doc:e,map:b,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:m,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),b]},e.serializeNodeWithId=k,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=A(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)}),[s,i]},e.buildNodeWithSN=A,e.addHoverClass=_,e.transformAttribute=y,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)},e.cleanupSnapshot=function(){a=1},e.needMaskingText=g,e.IGNORED_NODE=i,e.isElement=r,e.isShadowRoot=n,e}({});
var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}(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 a=1,o=RegExp("[^a-z0-9-_:]"),i=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?s(e.styleSheet)||"":e.cssText}var u=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var p=t.split("/"),d=c.split("/");p.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?p.pop():p.push(v))}return"url("+u+p.join("/")+u+")"})}var d=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(d);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(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?p(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,a,i=r.doc,c=r.blockClass,u=r.blockSelector,l=r.maskTextClass,f=r.maskTextSelector,d=r.inlineStylesheet,m=r.maskInputOptions,h=void 0===m?{}:m,T=r.maskTextFn,b=r.recordCanvas;if(i.__sn){var k=i.__sn.id;n=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[],rootId:n};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:n};case t.ELEMENT_NODE:for(var N=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,c,u),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return o.test(t)?"div":t}(t),x={},E=0,S=Array.from(t.attributes);E<S.length;E++){var w=S[E],_=w.name,D=w.value;x[_]=y(i,C,_,D)}if("link"===C&&d){var A,O=Array.from(i.styleSheets).find(function(e){return e.href===t.href});(A=s(O))&&(delete x.rel,delete x.href,x._cssText=p(A,O.href))}if("style"===C&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(A=s(t.sheet))&&(x._cssText=p(A,v()));if("input"===C||"textarea"===C||"select"===C){D=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=h[x.type]||h[C]?"*".repeat(D.length):D:t.checked&&(x.checked=t.checked)}if("option"===C){var L=t.parentElement;x.value===L.value&&(x.selected=t.selected)}if("canvas"===C&&b&&(x.rr_dataURL=t.toDataURL()),"audio"!==C&&"video"!==C||(x.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),N){var I=t.getBoundingClientRect(),M=I.width,R=I.height;x={class:x.class,rr_width:M+"px",rr_height:R+"px"}}return"iframe"===C&&delete x.src,{type:e.NodeType.Element,tagName:C,attributes:x,childNodes:[],isSVG:(a=t,"svg"===a.tagName||a instanceof SVGElement||void 0),needBlock:N,rootId:n};case t.TEXT_NODE:var F=t.parentNode&&t.parentNode.tagName,G=t.textContent,W="STYLE"===F||void 0,j="SCRIPT"===F||void 0;return W&&G&&(G=p(G,v())),j&&(G="SCRIPT_PLACEHOLDER"),!W&&!j&&g(t,l,f)&&G&&(G=T?T(G):G.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:G||"",isStyle:W,rootId:n};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:n};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:n};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,o){var s,c=o.doc,u=o.map,l=o.blockClass,f=o.blockSelector,p=o.maskTextClass,d=o.maskTextSelector,m=o.skipChild,h=void 0!==m&&m,v=o.inlineStylesheet,y=void 0===v||v,g=o.maskInputOptions,N=void 0===g?{}:g,C=o.maskTextFn,x=o.slimDOMOptions,E=o.recordCanvas,S=void 0!==E&&E,w=o.onSerialize,_=o.onIframeLoad,D=o.iframeLoadTimeout,A=void 0===D?5e3:D,O=o.preserveWhiteSpace,L=void 0===O||O,I=T(t,{doc:c,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,recordCanvas:S});if(!I)return console.warn(t,"not serialized"),null;s="__sn"in t?t.__sn.id:!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&&"script"===t.attributes.as))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(I,x)&&(L||I.type!==e.NodeType.Text||I.isStyle||I.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:i;var M=Object.assign(I,{id:s});if(t.__sn=M,s===i)return null;u[s]=t,w&&w(t);var R=!h;if(M.type===e.NodeType.Element&&(R=R&&!M.needBlock,delete M.needBlock),(M.type===e.NodeType.Document||M.type===e.NodeType.Element)&&R){x.headWhitespace&&I.type===e.NodeType.Element&&"head"===I.tagName&&(L=!1);for(var F={doc:c,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:h,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A},G=0,W=Array.from(t.childNodes);G<W.length;G++){(P=k(W[G],F))&&M.childNodes.push(P)}if(r(t)&&t.shadowRoot){M.isShadowHost=!0;for(var j=0,z=Array.from(t.shadowRoot.childNodes);j<z.length;j++){var P;(P=k(z[j],F))&&(P.isShadow=!0,M.childNodes.push(P))}}}return t.parentNode&&n(t.parentNode)&&(M.isShadow=!0),M.type===e.NodeType.Element&&"iframe"===M.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)"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0);else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}(t,function(){var e=t.contentDocument;if(e&&_){var r=k(e,{doc:e,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:!1,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A});r&&_(t,r)}},A),M}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function C(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),d(),t}}var i=function(){return 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(t.source+":"+r+":"+n+": "+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 u(){return p(/^{\s*/)}function l(){return p(/^}/)}function f(){var t,r=[];for(d(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||_());)!1!==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 d(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==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 x(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=x(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?x(n[0]).replace(N,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?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"),C=S("charset"),E=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(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?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:x(t[1]),media:x(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||C()||E()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=x(t[1]),n=x(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function _(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var o=0,i=Object.keys(t);o<i.length;o++){var s=i[o],c=t[s];Array.isArray(c)?c.forEach(function(t){e(t,a)}):c&&"object"==typeof c&&e(c,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function x(e){return e?e.replace(/^\s+|\s+$/g,""):""}var E={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 S=/([^\\]):hover/,w=new RegExp(S,"g");function _(e){var t=C(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){S.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(w,"$1.\\:hover");return e+", "+t})}function D(t,r){var n=r.doc,a=r.hackCss;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 o,i=function(e){var t=E[e.tagName]?E[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",i):n.createElement(i);var s=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=r,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaState"===e)switch(r){case"played":o.play();case"paused":o.pause()}}else{var c="textarea"===i&&"value"===e,u="style"===i&&"_cssText"===e;if(u&&a&&(r=_(r)),c||u){for(var l=n.createTextNode(r),f=0,p=Array.from(o.childNodes);f<p.length;f++){var d=p[f];d.nodeType===o.TEXT_NODE&&o.removeChild(d)}return o.appendChild(l),"continue"}if("iframe"===i&&"src"===e)return"continue";try{if(t.isSVG&&"xlink:href"===e)o.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))o.setAttribute("_"+e,r);else{if("meta"===i&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"==e)return o.setAttribute("csp-content",r),"continue";o.setAttribute(e,r)}}catch(e){}}};for(var c in t.attributes)s(c);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?_(t.textContent):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function A(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=D(t,{doc:a,hackCss:u});if(!f)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),f=a),f.__sn=t,o[t.id]=f,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var p=0,d=t.childNodes;p<d.length;p++){var m=d[p],h=A(m,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l});h?(m.isShadow&&r(f)&&f.shadowRoot?f.shadowRoot.appendChild(h):f.appendChild(h),l&&l(h)):console.warn("Failed to rebuild",m)}return f}return e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,p=void 0===f||f,d=r.recordCanvas,m=void 0!==d&&d,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.slimDOM,T=void 0!==g&&g,b={};return[k(e,{doc:e,map:b,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:m,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),b]},e.serializeNodeWithId=k,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=A(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)}),[s,i]},e.buildNodeWithSN=A,e.addHoverClass=_,e.transformAttribute=y,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)},e.cleanupSnapshot=function(){a=1},e.needMaskingText=g,e.IGNORED_NODE=i,e.isElement=r,e.isShadowRoot=n,e}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -21,3 +21,3 @@ var NodeType;

var _id = 1;
var tagNameRegex = RegExp('[^a-z0-9-_]');
var tagNameRegex = RegExp('[^a-z0-9-_:]');
var IGNORED_NODE = -2;

@@ -275,3 +275,3 @@ function genId() {

iframeEl.src === '') {
listener();
setTimeout(listener, 0);
return;

@@ -1286,2 +1286,8 @@ }

}
else if (tagName === 'meta' &&
n.attributes['http-equiv'] === 'Content-Security-Policy' &&
name == 'content') {
node_1.setAttribute('csp-content', value);
return "continue";
}
else {

@@ -1288,0 +1294,0 @@ node_1.setAttribute(name, value);

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

var NodeType;function isElement(e){return e.nodeType===e.ELEMENT_NODE}function isShadowRoot(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===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"}(NodeType||(NodeType={}));var _id=1,tagNameRegex=RegExp("[^a-z0-9-_]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tagNameRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(getCssRuleString).join(""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,a,o,i){var s=n||o||i,l=r||a||"";if(!s)return e;if(!RELATIVE_PATH.test(s))return"url("+l+s+l+")";if(DATA_URI.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(extractOrigin(t)+s)+l+")";var c=t.split("/"),u=s.split("/");c.pop();for(var f=0,d=u;f<d.length;f++){var m=d[f];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(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(SRCSET_COMMAS_OR_SPACES),!(r>=t.length);){var o=n(SRCSET_NOT_SPACES);if(","===o.slice(-1))o=absoluteToDoc(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=absoluteToDoc(e,o);for(var s=!1;;){var l=t.charAt(r);if(""===l){a.push((o+i).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,a.push((o+i).trim());break}"("===l&&(s=!0)}i+=l,r+=1}}}return a.join(", ")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function getHref(){var e=document.createElement("a");return e.href="",e.href}function transformAttribute(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?absoluteToDoc(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?getAbsoluteSrcsetString(e,n):"style"===r&&n?absoluteToStylesheet(n,getHref()):n:absoluteToDoc(e,n)}function _isBlockedElement(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}function needMaskingText(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||needMaskingText(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,needMaskingText(e.parentNode,t,r)}function onceIframeLoaded(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):t()}else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}function serializeNode(e,t){var r,n=t.doc,a=t.blockClass,o=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,f=t.maskTextFn,d=t.recordCanvas;if(n.__sn){var m=n.__sn.id;r=1===m?void 0:m}switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[],rootId:r};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:r};case e.ELEMENT_NODE:for(var p=_isBlockedElement(e,a,o),h=getValidTagName(e),v={},g=0,y=Array.from(e.attributes);g<y.length;g++){var T=y[g],E=T.name,S=T.value;v[E]=transformAttribute(n,h,E,S)}if("link"===h&&l){var b,N=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(b=getCssRulesString(N))&&(delete v.rel,delete v.href,v._cssText=absoluteToStylesheet(b,N.href))}if("style"===h&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(b=getCssRulesString(e.sheet))&&(v._cssText=absoluteToStylesheet(b,getHref()));if("input"===h||"textarea"===h||"select"===h){S=e.value;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&S?v.value=u[v.type]||u[h]?"*".repeat(S.length):S:e.checked&&(v.checked=e.checked)}if("option"===h){var x=e.parentElement;v.value===x.value&&(v.selected=e.selected)}if("canvas"===h&&d&&(v.rr_dataURL=e.toDataURL()),"audio"!==h&&"video"!==h||(v.rr_mediaState=e.paused?"paused":"played"),e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop),p){var C=e.getBoundingClientRect(),k=C.width,w=C.height;v={class:v.class,rr_width:k+"px",rr_height:w+"px"}}return"iframe"===h&&delete v.src,{type:NodeType.Element,tagName:h,attributes:v,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:p,rootId:r};case e.TEXT_NODE:var _=e.parentNode&&e.parentNode.tagName,I=e.textContent,O="STYLE"===_||void 0,R="SCRIPT"===_||void 0;return O&&I&&(I=absoluteToStylesheet(I,getHref())),R&&(I="SCRIPT_PLACEHOLDER"),!O&&!R&&needMaskingText(e,i,s)&&I&&(I=f?f(I):I.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:I||"",isStyle:O,rootId:r};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId:r};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||"",rootId:r};default:return!1}}function lowerIfExists(e){return void 0===e?"":e.toLowerCase()}function slimDOMExcluded(e,t){if(t.comment&&e.type===NodeType.Comment)return!0;if(e.type===NodeType.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(lowerIfExists(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(e.attributes.name)||"icon"===lowerIfExists(e.attributes.rel)||"apple-touch-icon"===lowerIfExists(e.attributes.rel)||"shortcut icon"===lowerIfExists(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&lowerIfExists(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(lowerIfExists(e.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===lowerIfExists(e.attributes.name)||"googlebot"===lowerIfExists(e.attributes.name)||"bingbot"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===lowerIfExists(e.attributes.name)||"generator"===lowerIfExists(e.attributes.name)||"framework"===lowerIfExists(e.attributes.name)||"publisher"===lowerIfExists(e.attributes.name)||"progid"===lowerIfExists(e.attributes.name)||lowerIfExists(e.attributes.property).match(/^article:/)||lowerIfExists(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===lowerIfExists(e.attributes.name)||"yandex-verification"===lowerIfExists(e.attributes.name)||"csrf-token"===lowerIfExists(e.attributes.name)||"p:domain_verify"===lowerIfExists(e.attributes.name)||"verify-v1"===lowerIfExists(e.attributes.name)||"verification"===lowerIfExists(e.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(e.attributes.name)))return!0}}return!1}function serializeNodeWithId(e,t){var r,n=t.doc,a=t.map,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,f=t.inlineStylesheet,d=void 0===f||f,m=t.maskInputOptions,p=void 0===m?{}:m,h=t.maskTextFn,v=t.slimDOMOptions,g=t.recordCanvas,y=void 0!==g&&g,T=t.onSerialize,E=t.onIframeLoad,S=t.iframeLoadTimeout,b=void 0===S?5e3:S,N=t.preserveWhiteSpace,x=void 0===N||N,C=serializeNode(e,{doc:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,recordCanvas:y});if(!C)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:slimDOMExcluded(C,v)||!x&&C.type===NodeType.Text&&!C.isStyle&&!C.textContent.replace(/^\s+|\s+$/gm,"").length?IGNORED_NODE:genId();var k=Object.assign(C,{id:r});if(e.__sn=k,r===IGNORED_NODE)return null;a[r]=e,T&&T(e);var w=!u;if(k.type===NodeType.Element&&(w=w&&!k.needBlock,delete k.needBlock),(k.type===NodeType.Document||k.type===NodeType.Element)&&w){v.headWhitespace&&C.type===NodeType.Element&&"head"===C.tagName&&(x=!1);for(var _={doc:n,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:u,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:b},I=0,O=Array.from(e.childNodes);I<O.length;I++){(A=serializeNodeWithId(O[I],_))&&k.childNodes.push(A)}if(isElement(e)&&e.shadowRoot){k.isShadowHost=!0;for(var R=0,D=Array.from(e.shadowRoot.childNodes);R<D.length;R++){var A;(A=serializeNodeWithId(D[R],_))&&(A.isShadow=!0,k.childNodes.push(A))}}}return e.parentNode&&isShadowRoot(e.parentNode)&&(k.isShadow=!0),k.type===NodeType.Element&&"iframe"===k.tagName&&onceIframeLoaded(e,function(){var t=e.contentDocument;if(t&&E){var r=serializeNodeWithId(t,{doc:t,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:b});r&&E(e,r)}},b),k}function snapshot(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,l=void 0===s?"rr-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,f=r.inlineStylesheet,d=void 0===f||f,m=r.recordCanvas,p=void 0!==m&&m,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.slimDOM,T=void 0!==y&&y,E={};return[serializeNodeWithId(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:p,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),E]}function visitSnapshot(e,t){!function e(r){t(r),r.type!==NodeType.Document&&r.type!==NodeType.Element||r.childNodes.forEach(e)}(e)}function cleanupSnapshot(){_id=1}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function parse(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),m(),t}}var i=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();i.prototype.content=e;var s=[];function l(a){var o=new Error(t.source+":"+r+":"+n+": "+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 c(){return d(/^{\s*/)}function u(){return d(/^}/)}function f(){var t,r=[];for(m(),p(r);e.length&&"}"!==e.charAt(0)&&(t=C()||k());)!1!==t&&(r.push(t),p(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){d(/^\s*/)}function p(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==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 l("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=d(/^([^{]+)/);if(e)return trim(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=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return l("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),a}}function y(){var e,t=[];if(!c())return l("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return u()?t:l("missing '}'")}function T(){for(var e,t=[],r=o();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var E,S=x("import"),b=x("charset"),N=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function C(){if("@"===e[0])return function(){var e=o(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return l("@keyframes missing name");var n,a=t[1];if(!c())return l("@keyframes missing '{'");for(var i=p();n=T();)i.push(n),i=i.concat(p());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):l("@keyframes missing '}'")}}()||function(){var e=o(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@media missing '{'");var n=p().concat(f());return u()?e({type:"media",media:r,rules:n}):l("@media missing '}'")}}()||function(){var e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=o(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@supports missing '{'");var n=p().concat(f());return u()?e({type:"supports",supports:r,rules:n}):l("@supports missing '}'")}}()||S()||b()||N()||function(){var e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return l("@document missing '{'");var a=p().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):l("@document missing '}'")}}()||function(){var e=o();if(d(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var r,n=p();r=g();)n.push(r),n=n.concat(p());return u()?e({type:"page",selectors:t,declarations:n}):l("@page missing '}'")}}()||function(){var e=o();if(d(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=p().concat(f());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=o();if(d(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,r=p();t=g();)r.push(t),r=r.concat(p());return u()?e({type:"font-face",declarations:r}):l("@font-face missing '}'")}}()}function k(){var e=o(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return addParent((E=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(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){addParent(e,n)}):i&&"object"==typeof i&&addParent(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={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 getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var HOVER_SELECTOR=/([^\\]):hover/,HOVER_SELECTOR_GLOBAL=new RegExp(HOVER_SELECTOR,"g");function addHoverClass(e){var t=parse(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){HOVER_SELECTOR.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return escapeRegExp(e)}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(HOVER_SELECTOR_GLOBAL,"$1.\\:hover");return e+", "+t})}function buildNode(e,t){var r=t.doc,n=t.hackCss;switch(e.type){case NodeType.Document:return r.implementation.createDocument(null,"",null);case NodeType.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case NodeType.Element:var a,o=getTagName(e);a=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",o):r.createElement(o);var i=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var i=e.attributes[t];if(i="boolean"==typeof i||"number"==typeof i?"":i,t.startsWith("rr_")){if("canvas"===o&&"rr_dataURL"===t){var s=document.createElement("img");s.src=i,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(a.style.width=i),"rr_height"===t&&(a.style.height=i),"rr_mediaState"===t)switch(i){case"played":a.play();case"paused":a.pause()}}else{var l="textarea"===o&&"value"===t,c="style"===o&&"_cssText"===t;if(c&&n&&(i=addHoverClass(i)),l||c){for(var u=r.createTextNode(i),f=0,d=Array.from(a.childNodes);f<d.length;f++){var m=d[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(u),"continue"}if("iframe"===o&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?a.setAttributeNS("http://www.w3.org/1999/xlink",t,i):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?a.setAttribute("_"+t,i):a.setAttribute(t,i)}catch(e){}}};for(var s in e.attributes)i(s);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case NodeType.Text:return r.createTextNode(e.isStyle&&n?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return r.createCDATASection(e.textContent);case NodeType.Comment:return r.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t){var r=t.doc,n=t.map,a=t.skipChild,o=void 0!==a&&a,i=t.hackCss,s=void 0===i||i,l=t.afterAppend,c=buildNode(e,{doc:r,hackCss:s});if(!c)return null;if(e.rootId&&console.assert(n[e.rootId]===r,"Target document should has the same root id."),e.type===NodeType.Document&&(r.close(),r.open(),c=r),c.__sn=e,n[e.id]=c,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var u=0,f=e.childNodes;u<f.length;u++){var d=f[u],m=buildNodeWithSN(d,{doc:r,map:n,skipChild:!1,hackCss:s,afterAppend:l});m?(d.isShadow&&isElement(c)&&c.shadowRoot?c.shadowRoot.appendChild(m):c.appendChild(m),l&&l(m)):console.warn("Failed to rebuild",d)}return c}function visit(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}function handleScroll(e){var t=e.__sn;if(t.type===NodeType.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var a=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=a),"rr_scrollTop"===n&&(r.scrollTop=a)}}}function rebuild(e,t){var r=t.doc,n=t.onVisit,a=t.hackCss,o={},i=buildNodeWithSN(e,{doc:r,map:o,skipChild:!1,hackCss:void 0===a||a,afterAppend:t.afterAppend});return visit(o,function(e){n&&n(e),handleScroll(e)}),[i,o]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,visitSnapshot,cleanupSnapshot,needMaskingText,IGNORED_NODE,NodeType,isElement,isShadowRoot};
var NodeType;function isElement(e){return e.nodeType===e.ELEMENT_NODE}function isShadowRoot(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===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"}(NodeType||(NodeType={}));var _id=1,tagNameRegex=RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tagNameRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(getCssRuleString).join(""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,a,o,i){var s=n||o||i,l=r||a||"";if(!s)return e;if(!RELATIVE_PATH.test(s))return"url("+l+s+l+")";if(DATA_URI.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(extractOrigin(t)+s)+l+")";var c=t.split("/"),u=s.split("/");c.pop();for(var f=0,d=u;f<d.length;f++){var m=d[f];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(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(SRCSET_COMMAS_OR_SPACES),!(r>=t.length);){var o=n(SRCSET_NOT_SPACES);if(","===o.slice(-1))o=absoluteToDoc(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=absoluteToDoc(e,o);for(var s=!1;;){var l=t.charAt(r);if(""===l){a.push((o+i).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,a.push((o+i).trim());break}"("===l&&(s=!0)}i+=l,r+=1}}}return a.join(", ")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function getHref(){var e=document.createElement("a");return e.href="",e.href}function transformAttribute(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?absoluteToDoc(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?getAbsoluteSrcsetString(e,n):"style"===r&&n?absoluteToStylesheet(n,getHref()):n:absoluteToDoc(e,n)}function _isBlockedElement(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}function needMaskingText(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||needMaskingText(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,needMaskingText(e.parentNode,t,r)}function onceIframeLoaded(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}function serializeNode(e,t){var r,n=t.doc,a=t.blockClass,o=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,f=t.maskTextFn,d=t.recordCanvas;if(n.__sn){var m=n.__sn.id;r=1===m?void 0:m}switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[],rootId:r};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:r};case e.ELEMENT_NODE:for(var p=_isBlockedElement(e,a,o),h=getValidTagName(e),v={},g=0,y=Array.from(e.attributes);g<y.length;g++){var T=y[g],E=T.name,b=T.value;v[E]=transformAttribute(n,h,E,b)}if("link"===h&&l){var S,N=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(S=getCssRulesString(N))&&(delete v.rel,delete v.href,v._cssText=absoluteToStylesheet(S,N.href))}if("style"===h&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(S=getCssRulesString(e.sheet))&&(v._cssText=absoluteToStylesheet(S,getHref()));if("input"===h||"textarea"===h||"select"===h){b=e.value;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&b?v.value=u[v.type]||u[h]?"*".repeat(b.length):b:e.checked&&(v.checked=e.checked)}if("option"===h){var x=e.parentElement;v.value===x.value&&(v.selected=e.selected)}if("canvas"===h&&d&&(v.rr_dataURL=e.toDataURL()),"audio"!==h&&"video"!==h||(v.rr_mediaState=e.paused?"paused":"played"),e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop),p){var C=e.getBoundingClientRect(),k=C.width,w=C.height;v={class:v.class,rr_width:k+"px",rr_height:w+"px"}}return"iframe"===h&&delete v.src,{type:NodeType.Element,tagName:h,attributes:v,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:p,rootId:r};case e.TEXT_NODE:var _=e.parentNode&&e.parentNode.tagName,I=e.textContent,O="STYLE"===_||void 0,R="SCRIPT"===_||void 0;return O&&I&&(I=absoluteToStylesheet(I,getHref())),R&&(I="SCRIPT_PLACEHOLDER"),!O&&!R&&needMaskingText(e,i,s)&&I&&(I=f?f(I):I.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:I||"",isStyle:O,rootId:r};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId:r};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||"",rootId:r};default:return!1}}function lowerIfExists(e){return void 0===e?"":e.toLowerCase()}function slimDOMExcluded(e,t){if(t.comment&&e.type===NodeType.Comment)return!0;if(e.type===NodeType.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(lowerIfExists(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(e.attributes.name)||"icon"===lowerIfExists(e.attributes.rel)||"apple-touch-icon"===lowerIfExists(e.attributes.rel)||"shortcut icon"===lowerIfExists(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&lowerIfExists(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(lowerIfExists(e.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===lowerIfExists(e.attributes.name)||"googlebot"===lowerIfExists(e.attributes.name)||"bingbot"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===lowerIfExists(e.attributes.name)||"generator"===lowerIfExists(e.attributes.name)||"framework"===lowerIfExists(e.attributes.name)||"publisher"===lowerIfExists(e.attributes.name)||"progid"===lowerIfExists(e.attributes.name)||lowerIfExists(e.attributes.property).match(/^article:/)||lowerIfExists(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===lowerIfExists(e.attributes.name)||"yandex-verification"===lowerIfExists(e.attributes.name)||"csrf-token"===lowerIfExists(e.attributes.name)||"p:domain_verify"===lowerIfExists(e.attributes.name)||"verify-v1"===lowerIfExists(e.attributes.name)||"verification"===lowerIfExists(e.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(e.attributes.name)))return!0}}return!1}function serializeNodeWithId(e,t){var r,n=t.doc,a=t.map,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,f=t.inlineStylesheet,d=void 0===f||f,m=t.maskInputOptions,p=void 0===m?{}:m,h=t.maskTextFn,v=t.slimDOMOptions,g=t.recordCanvas,y=void 0!==g&&g,T=t.onSerialize,E=t.onIframeLoad,b=t.iframeLoadTimeout,S=void 0===b?5e3:b,N=t.preserveWhiteSpace,x=void 0===N||N,C=serializeNode(e,{doc:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,recordCanvas:y});if(!C)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:slimDOMExcluded(C,v)||!x&&C.type===NodeType.Text&&!C.isStyle&&!C.textContent.replace(/^\s+|\s+$/gm,"").length?IGNORED_NODE:genId();var k=Object.assign(C,{id:r});if(e.__sn=k,r===IGNORED_NODE)return null;a[r]=e,T&&T(e);var w=!u;if(k.type===NodeType.Element&&(w=w&&!k.needBlock,delete k.needBlock),(k.type===NodeType.Document||k.type===NodeType.Element)&&w){v.headWhitespace&&C.type===NodeType.Element&&"head"===C.tagName&&(x=!1);for(var _={doc:n,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:u,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:S},I=0,O=Array.from(e.childNodes);I<O.length;I++){(A=serializeNodeWithId(O[I],_))&&k.childNodes.push(A)}if(isElement(e)&&e.shadowRoot){k.isShadowHost=!0;for(var R=0,D=Array.from(e.shadowRoot.childNodes);R<D.length;R++){var A;(A=serializeNodeWithId(D[R],_))&&(A.isShadow=!0,k.childNodes.push(A))}}}return e.parentNode&&isShadowRoot(e.parentNode)&&(k.isShadow=!0),k.type===NodeType.Element&&"iframe"===k.tagName&&onceIframeLoaded(e,function(){var t=e.contentDocument;if(t&&E){var r=serializeNodeWithId(t,{doc:t,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:S});r&&E(e,r)}},S),k}function snapshot(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,l=void 0===s?"rr-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,f=r.inlineStylesheet,d=void 0===f||f,m=r.recordCanvas,p=void 0!==m&&m,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.slimDOM,T=void 0!==y&&y,E={};return[serializeNodeWithId(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:p,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),E]}function visitSnapshot(e,t){!function e(r){t(r),r.type!==NodeType.Document&&r.type!==NodeType.Element||r.childNodes.forEach(e)}(e)}function cleanupSnapshot(){_id=1}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function parse(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),m(),t}}var i=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();i.prototype.content=e;var s=[];function l(a){var o=new Error(t.source+":"+r+":"+n+": "+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 c(){return d(/^{\s*/)}function u(){return d(/^}/)}function f(){var t,r=[];for(m(),p(r);e.length&&"}"!==e.charAt(0)&&(t=C()||k());)!1!==t&&(r.push(t),p(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){d(/^\s*/)}function p(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==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 l("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=d(/^([^{]+)/);if(e)return trim(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=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return l("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),a}}function y(){var e,t=[];if(!c())return l("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return u()?t:l("missing '}'")}function T(){for(var e,t=[],r=o();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var E,b=x("import"),S=x("charset"),N=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function C(){if("@"===e[0])return function(){var e=o(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return l("@keyframes missing name");var n,a=t[1];if(!c())return l("@keyframes missing '{'");for(var i=p();n=T();)i.push(n),i=i.concat(p());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):l("@keyframes missing '}'")}}()||function(){var e=o(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@media missing '{'");var n=p().concat(f());return u()?e({type:"media",media:r,rules:n}):l("@media missing '}'")}}()||function(){var e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=o(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@supports missing '{'");var n=p().concat(f());return u()?e({type:"supports",supports:r,rules:n}):l("@supports missing '}'")}}()||b()||S()||N()||function(){var e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return l("@document missing '{'");var a=p().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):l("@document missing '}'")}}()||function(){var e=o();if(d(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var r,n=p();r=g();)n.push(r),n=n.concat(p());return u()?e({type:"page",selectors:t,declarations:n}):l("@page missing '}'")}}()||function(){var e=o();if(d(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=p().concat(f());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=o();if(d(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,r=p();t=g();)r.push(t),r=r.concat(p());return u()?e({type:"font-face",declarations:r}):l("@font-face missing '}'")}}()}function k(){var e=o(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return addParent((E=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(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){addParent(e,n)}):i&&"object"==typeof i&&addParent(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={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 getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var HOVER_SELECTOR=/([^\\]):hover/,HOVER_SELECTOR_GLOBAL=new RegExp(HOVER_SELECTOR,"g");function addHoverClass(e){var t=parse(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){HOVER_SELECTOR.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return escapeRegExp(e)}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(HOVER_SELECTOR_GLOBAL,"$1.\\:hover");return e+", "+t})}function buildNode(e,t){var r=t.doc,n=t.hackCss;switch(e.type){case NodeType.Document:return r.implementation.createDocument(null,"",null);case NodeType.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case NodeType.Element:var a,o=getTagName(e);a=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",o):r.createElement(o);var i=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var i=e.attributes[t];if(i="boolean"==typeof i||"number"==typeof i?"":i,t.startsWith("rr_")){if("canvas"===o&&"rr_dataURL"===t){var s=document.createElement("img");s.src=i,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(a.style.width=i),"rr_height"===t&&(a.style.height=i),"rr_mediaState"===t)switch(i){case"played":a.play();case"paused":a.pause()}}else{var l="textarea"===o&&"value"===t,c="style"===o&&"_cssText"===t;if(c&&n&&(i=addHoverClass(i)),l||c){for(var u=r.createTextNode(i),f=0,d=Array.from(a.childNodes);f<d.length;f++){var m=d[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(u),"continue"}if("iframe"===o&&"src"===t)return"continue";try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,i);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,i);else{if("meta"===o&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"==t)return a.setAttribute("csp-content",i),"continue";a.setAttribute(t,i)}}catch(e){}}};for(var s in e.attributes)i(s);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case NodeType.Text:return r.createTextNode(e.isStyle&&n?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return r.createCDATASection(e.textContent);case NodeType.Comment:return r.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t){var r=t.doc,n=t.map,a=t.skipChild,o=void 0!==a&&a,i=t.hackCss,s=void 0===i||i,l=t.afterAppend,c=buildNode(e,{doc:r,hackCss:s});if(!c)return null;if(e.rootId&&console.assert(n[e.rootId]===r,"Target document should has the same root id."),e.type===NodeType.Document&&(r.close(),r.open(),c=r),c.__sn=e,n[e.id]=c,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var u=0,f=e.childNodes;u<f.length;u++){var d=f[u],m=buildNodeWithSN(d,{doc:r,map:n,skipChild:!1,hackCss:s,afterAppend:l});m?(d.isShadow&&isElement(c)&&c.shadowRoot?c.shadowRoot.appendChild(m):c.appendChild(m),l&&l(m)):console.warn("Failed to rebuild",d)}return c}function visit(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}function handleScroll(e){var t=e.__sn;if(t.type===NodeType.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var a=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=a),"rr_scrollTop"===n&&(r.scrollTop=a)}}}function rebuild(e,t){var r=t.doc,n=t.onVisit,a=t.hackCss,o={},i=buildNodeWithSN(e,{doc:r,map:o,skipChild:!1,hackCss:void 0===a||a,afterAppend:t.afterAppend});return visit(o,function(e){n&&n(e),handleScroll(e)}),[i,o]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,visitSnapshot,cleanupSnapshot,needMaskingText,IGNORED_NODE,NodeType,isElement,isShadowRoot};
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -24,3 +24,3 @@ 'use strict';

var _id = 1;
var tagNameRegex = RegExp('[^a-z0-9-_]');
var tagNameRegex = RegExp('[^a-z0-9-_:]');
var IGNORED_NODE = -2;

@@ -278,3 +278,3 @@ function genId() {

iframeEl.src === '') {
listener();
setTimeout(listener, 0);
return;

@@ -1289,2 +1289,8 @@ }

}
else if (tagName === 'meta' &&
n.attributes['http-equiv'] === 'Content-Security-Policy' &&
name == 'content') {
node_1.setAttribute('csp-content', value);
return "continue";
}
else {

@@ -1291,0 +1297,0 @@ node_1.setAttribute(name, value);

{
"name": "rrweb-snapshot",
"version": "1.1.3",
"version": "1.1.4",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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