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.13 to 1.1.14

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)}function a(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}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 i="__rrweb_original__";function o(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=i 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}var s,c,u=1,l=new RegExp("[^a-z0-9-_:]");function f(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(d).join(""):null}catch(e){return null}}function d(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=f(e.styleSheet)||t}catch(e){}return t}var p=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,m=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,h=/^(data:)([^,]*),(.*)/i;function v(e,t){return(e||"").replace(p,(function(e,r,n,a,i,o){var s,c=n||i||o,u=r||a||"";if(!c)return e;if(!m.test(c))return"url("+u+c+u+")";if(h.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 l=t.split("/"),f=c.split("/");l.pop();for(var d=0,p=f;d<p.length;d++){var v=p[d];"."!==v&&(".."===v?l.pop():l.push(v))}return"url("+u+l.join("/")+u+")"}))}var y=/^[^ \t\n\r\u000c]+/,g=/^[, \t\n\r\u000c]+/;function T(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function b(){var e=document.createElement("a");return e.href="",e.href}function k(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?T(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(g),!(r>=t.length);){var i=n(y);if(","===i.slice(-1))i=T(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=T(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?v(n,b()):"object"===t&&"data"===r&&n?T(e,n):n:T(e,n)}function C(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))||C(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,r)}function N(t,r){var n,i,u,d,p=r.doc,m=r.blockClass,h=r.blockSelector,y=r.maskTextClass,g=r.maskTextSelector,T=r.inlineStylesheet,N=r.maskInputOptions,w=void 0===N?{}:N,S=r.maskTextFn,x=r.maskInputFn,E=r.dataURLOptions,_=void 0===E?{}:E,I=r.inlineImages,D=r.recordCanvas,L=r.keepIframeSrcFn;if(p.__sn){var O=p.__sn.id;i=1===O?void 0:O}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.NodeType.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var A=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,m,h),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return l.test(t)?"div":t}(t),M={},F=0,U=Array.from(t.attributes);F<U.length;F++){var W=U[F],j=W.name,P=W.value;M[j]=k(p,R,j,P)}if("link"===R&&T){var B=Array.from(p.styleSheets).find((function(e){return e.href===t.href})),H=null;B&&(H=f(B)),H&&(delete M.rel,delete M.href,M._cssText=v(H,B.href))}if("style"===R&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(H=f(t.sheet))&&(M._cssText=v(H,b()));if("input"===R||"textarea"===R||"select"===R){P=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&P?M.value=a({type:M.type,tagName:R,value:P,maskInputOptions:w,maskInputFn:x}):t.checked&&(M.checked=t.checked)}if("option"===R&&(t.selected&&!w.select?M.selected=!0:delete M.selected),"canvas"===R&&D)if("2d"===t.__context)o(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var G=t.toDataURL(_.type,_.quality),z=document.createElement("canvas");z.width=t.width,z.height=t.height,G!==z.toDataURL(_.type,_.quality)&&(M.rr_dataURL=G)}if("img"===R&&I){s||(s=p.createElement("canvas"),c=s.getContext("2d"));var q=t,V=q.crossOrigin;q.crossOrigin="anonymous";var $=function(){try{s.width=q.naturalWidth,s.height=q.naturalHeight,c.drawImage(q,0,0),M.rr_dataURL=s.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+q.currentSrc+"! Error: "+e)}V?M.crossOrigin=V:delete M.crossOrigin};q.complete&&0!==q.naturalWidth?$():q.onload=$}if("audio"!==R&&"video"!==R||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),A){var X=t.getBoundingClientRect(),Y=X.width,K=X.height;M={class:M.class,rr_width:Y+"px",rr_height:K+"px"}}return"iframe"!==R||L(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.NodeType.Element,tagName:R,attributes:M,childNodes:[],isSVG:(d=t,Boolean("svg"===d.tagName||d.ownerSVGElement)||void 0),needBlock:A,rootId:i};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,J=t.textContent,Q="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(Q&&J){try{(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(J=(u=t.parentNode.sheet).cssRules?Array.from(u.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}J=v(J,b())}return ee&&(J="SCRIPT_PLACEHOLDER"),!Q&&!ee&&C(t,y,g)&&J&&(J=S?S(J):J.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:J||"",isStyle:Q,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function w(e){return void 0===e?"":e.toLowerCase()}function S(t,a){var i,o=a.doc,s=a.map,c=a.blockClass,l=a.blockSelector,f=a.maskTextClass,d=a.maskTextSelector,p=a.skipChild,m=void 0!==p&&p,h=a.inlineStylesheet,v=void 0===h||h,y=a.maskInputOptions,g=void 0===y?{}:y,T=a.maskTextFn,b=a.maskInputFn,k=a.slimDOMOptions,C=a.dataURLOptions,x=void 0===C?{}:C,E=a.inlineImages,_=void 0!==E&&E,I=a.recordCanvas,D=void 0!==I&&I,L=a.onSerialize,O=a.onIframeLoad,A=a.iframeLoadTimeout,R=void 0===A?5e3:A,M=a.keepIframeSrcFn,F=void 0===M?function(){return!1}:M,U=a.preserveWhiteSpace,W=void 0===U||U,j=N(t,{doc:o,blockClass:c,blockSelector:l,maskTextClass:f,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,dataURLOptions:x,inlineImages:_,recordCanvas:D,keepIframeSrcFn:F});if(!j)return console.warn(t,"not serialized"),null;i="__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||"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&&(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(r.headMetaDescKeywords&&w(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(w(t.attributes.property).match(/^(og|twitter|fb):/)||w(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===w(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===w(t.attributes.name)||"googlebot"===w(t.attributes.name)||"bingbot"===w(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.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(r.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}(j,k)&&(W||j.type!==e.NodeType.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?u++:-2;var P=Object.assign(j,{id:i});if(t.__sn=P,-2===i)return null;s[i]=t,L&&L(t);var B=!m;if(P.type===e.NodeType.Element&&(B=B&&!P.needBlock,delete P.needBlock),(P.type===e.NodeType.Document||P.type===e.NodeType.Element)&&B){k.headWhitespace&&j.type===e.NodeType.Element&&"head"===j.tagName&&(W=!1);for(var H={doc:o,map:s,blockClass:c,blockSelector:l,maskTextClass:f,maskTextSelector:d,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:x,inlineImages:_,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F},G=0,z=Array.from(t.childNodes);G<z.length;G++){($=S(z[G],H))&&P.childNodes.push($)}if(r(t)&&t.shadowRoot){P.isShadowHost=!0;for(var q=0,V=Array.from(t.shadowRoot.childNodes);q<V.length;q++){var $;($=S(V[q],H))&&($.isShadow=!0,P.childNodes.push($))}}}return t.parentNode&&n(t.parentNode)&&(P.isShadow=!0),P.type===e.NodeType.Element&&"iframe"===P.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&O){var r=S(e,{doc:e,map:s,blockClass:c,blockSelector:l,maskTextClass:f,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:x,inlineImages:_,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F});r&&O(t,r)}}),R),P}var x=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function E(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 i(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function u(){return d(/^{\s*/)}function l(){return d(/^}/)}function f(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=S()||E());)!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=i();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 o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=d(/^([^{]+)/);if(e)return _(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=i(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=_(t[0]);if(!d(/^:\s*/))return c("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(x,""),value:n?_(n[0]).replace(x,""):""});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=i();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=w("import"),C=w("charset"),N=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function S(){if("@"===e[0])return function(){var e=i(),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 o=m();n=T();)o.push(n),o=o.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=d(/^@media *([^{]+)/);if(t){var r=_(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=i(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:_(t[1]),media:_(t[2])})}()||function(){var e=i(),t=d(/^@supports *([^{]+)/);if(t){var r=_(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()||N()||function(){var e=i(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=_(t[1]),n=_(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=i();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=i();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=i();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 E(){var e=i(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return I((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function _(e){return e?e.replace(/^\s+|\s+$/g,""):""}function I(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){I(e,n)})):o&&"object"==typeof o&&I(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var D={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 L=/([^\\]):hover/,O=new RegExp(L.source,"g");function A(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=E(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){L.test(e)&&a.push(e)}))})),0===a.length)return e;var i=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"),o=e.replace(i,(function(e){var t=e.replace(O,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function R(t,r){var n=r.doc,a=r.hackCss,i=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 o,s=function(e){var t=D[e.tagName]?D[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",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}else if("img"===s&&"rr_dataURL"===e){var u=o;u.currentSrc.startsWith("data:")||(u.setAttribute("rrweb-original-src",t.attributes.src),u.src=r)}if("rr_width"===e)o.style.width=r;else if("rr_height"===e)o.style.height=r;else if("rr_mediaCurrentTime"===e)o.currentTime=t.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var l="textarea"===s&&"value"===e,f="style"===s&&"_cssText"===e;if(f&&a&&(r=A(r,i)),l||f){for(var d=n.createTextNode(r),p=0,m=Array.from(o.childNodes);p<m.length;p++){var h=m[p];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(d),"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"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===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?o.setAttribute("rrweb-original-srcset",t.attributes.srcset):o.setAttribute(e,r))}}catch(e){}}};for(var u in t.attributes)c(u);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?A(t.textContent,i):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function M(t,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,d=R(t,{doc:a,hackCss:u,cache:f});if(!d)return null;if(t.rootId&&console.assert(i[t.rootId]===a,"Target document should has the same root id."),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" "">')),d=a),d.__sn=t,i[t.id]=d,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var p=0,m=t.childNodes;p<m.length;p++){var h=m[p],v=M(h,{doc:a,map:i,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&r(d)&&d.shadowRoot?d.shadowRoot.appendChild(v):d.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return d}return e.IGNORED_NODE=-2,e.addHoverClass=A,e.buildNodeWithSN=M,e.cleanupSnapshot=function(){u=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.is2DCanvasBlank=o,e.isElement=r,e.isShadowRoot=n,e.maskInputValue=a,e.needMaskingText=C,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=M(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(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 i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]},e.serializeNodeWithId=S,e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,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.inlineImages,m=void 0!==p&&p,h=r.recordCanvas,v=void 0!==h&&h,y=r.maskAllInputs,g=void 0!==y&&y,T=r.maskTextFn,b=r.maskInputFn,k=r.slimDOM,C=void 0!==k&&k,N=r.dataURLOptions,w=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,_=r.iframeLoadTimeout,I=r.keepIframeSrcFn,D={};return[S(e,{doc:e,map:D,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===g?{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===g?{password:!0}:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===C,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===C?{}:C,dataURLOptions:N,inlineImages:m,recordCanvas:v,preserveWhiteSpace:w,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:void 0===I?function(){return!1}:I}),D]},e.transformAttribute=k,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 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)}function a(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}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 i="__rrweb_original__";function o(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=i 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}var s,c,l=1,u=new RegExp("[^a-z0-9-_:]");function f(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(d).join(""):null}catch(e){return null}}function d(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=f(e.styleSheet)||t}catch(e){}return t}var p=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,m=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,h=/^(data:)([^,]*),(.*)/i;function v(e,t){return(e||"").replace(p,(function(e,r,n,a,i,o){var s,c=n||i||o,l=r||a||"";if(!c)return e;if(!m.test(c))return"url("+l+c+l+")";if(h.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),f=c.split("/");u.pop();for(var d=0,p=f;d<p.length;d++){var v=p[d];"."!==v&&(".."===v?u.pop():u.push(v))}return"url("+l+u.join("/")+l+")"}))}var y=/^[^ \t\n\r\u000c]+/,g=/^[, \t\n\r\u000c]+/;function T(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function b(){var e=document.createElement("a");return e.href="",e.href}function k(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?T(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(g),!(r>=t.length);){var i=n(y);if(","===i.slice(-1))i=T(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=T(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?v(n,b()):"object"===t&&"data"===r&&n?T(e,n):n:T(e,n)}function C(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 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))||C(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,r)}function N(t,r){var n,i,l,d,p=r.doc,m=r.blockClass,h=r.blockSelector,y=r.maskTextClass,g=r.maskTextSelector,T=r.inlineStylesheet,N=r.maskInputOptions,w=void 0===N?{}:N,S=r.maskTextFn,x=r.maskInputFn,E=r.dataURLOptions,_=void 0===E?{}:E,I=r.inlineImages,D=r.recordCanvas,L=r.keepIframeSrcFn;if(p.__sn){var O=p.__sn.id;i=1===O?void 0:O}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.NodeType.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var A=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,m,h),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return u.test(t)?"div":t}(t),M={},F=0,U=Array.from(t.attributes);F<U.length;F++){var W=U[F],j=W.name,P=W.value;M[j]=k(p,R,j,P)}if("link"===R&&T){var B=Array.from(p.styleSheets).find((function(e){return e.href===t.href})),H=null;B&&(H=f(B)),H&&(delete M.rel,delete M.href,M._cssText=v(H,B.href))}if("style"===R&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(H=f(t.sheet))&&(M._cssText=v(H,b()));if("input"===R||"textarea"===R||"select"===R){P=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&P?M.value=a({type:M.type,tagName:R,value:P,maskInputOptions:w,maskInputFn:x}):t.checked&&(M.checked=t.checked)}if("option"===R&&(t.selected&&!w.select?M.selected=!0:delete M.selected),"canvas"===R&&D)if("2d"===t.__context)o(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var G=t.toDataURL(_.type,_.quality),z=document.createElement("canvas");z.width=t.width,z.height=t.height,G!==z.toDataURL(_.type,_.quality)&&(M.rr_dataURL=G)}if("img"===R&&I){s||(s=p.createElement("canvas"),c=s.getContext("2d"));var q=t,V=q.crossOrigin;q.crossOrigin="anonymous";var $=function(){try{s.width=q.naturalWidth,s.height=q.naturalHeight,c.drawImage(q,0,0),M.rr_dataURL=s.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+q.currentSrc+"! Error: "+e)}V?M.crossOrigin=V:delete M.crossOrigin};q.complete&&0!==q.naturalWidth?$():q.onload=$}if("audio"!==R&&"video"!==R||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),A){var X=t.getBoundingClientRect(),Y=X.width,K=X.height;M={class:M.class,rr_width:Y+"px",rr_height:K+"px"}}return"iframe"!==R||L(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.NodeType.Element,tagName:R,attributes:M,childNodes:[],isSVG:(d=t,Boolean("svg"===d.tagName||d.ownerSVGElement)||void 0),needBlock:A,rootId:i};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,J=t.textContent,Q="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(Q&&J){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(J=(l=t.parentNode.sheet).cssRules?Array.from(l.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}J=v(J,b())}return ee&&(J="SCRIPT_PLACEHOLDER"),!Q&&!ee&&C(t,y,g)&&J&&(J=S?S(J):J.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:J||"",isStyle:Q,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function w(e){return void 0===e?"":e.toLowerCase()}function S(t,a){var i,o=a.doc,s=a.map,c=a.blockClass,u=a.blockSelector,f=a.maskTextClass,d=a.maskTextSelector,p=a.skipChild,m=void 0!==p&&p,h=a.inlineStylesheet,v=void 0===h||h,y=a.maskInputOptions,g=void 0===y?{}:y,T=a.maskTextFn,b=a.maskInputFn,k=a.slimDOMOptions,C=a.dataURLOptions,x=void 0===C?{}:C,E=a.inlineImages,_=void 0!==E&&E,I=a.recordCanvas,D=void 0!==I&&I,L=a.onSerialize,O=a.onIframeLoad,A=a.iframeLoadTimeout,R=void 0===A?5e3:A,M=a.keepIframeSrcFn,F=void 0===M?function(){return!1}:M,U=a.preserveWhiteSpace,W=void 0===U||U,j=N(t,{doc:o,blockClass:c,blockSelector:u,maskTextClass:f,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,dataURLOptions:x,inlineImages:_,recordCanvas:D,keepIframeSrcFn:F});if(!j)return console.warn(t,"not serialized"),null;i="__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||"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&&(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(r.headMetaDescKeywords&&w(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(w(t.attributes.property).match(/^(og|twitter|fb):/)||w(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===w(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===w(t.attributes.name)||"googlebot"===w(t.attributes.name)||"bingbot"===w(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.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(r.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}(j,k)&&(W||j.type!==e.NodeType.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?l++:-2;var P=Object.assign(j,{id:i});if(t.__sn=P,-2===i)return null;s[i]=t,L&&L(t);var B=!m;if(P.type===e.NodeType.Element&&(B=B&&!P.needBlock,delete P.needBlock,t.shadowRoot&&(P.isShadowHost=!0)),(P.type===e.NodeType.Document||P.type===e.NodeType.Element)&&B){k.headWhitespace&&j.type===e.NodeType.Element&&"head"===j.tagName&&(W=!1);for(var H={doc:o,map:s,blockClass:c,blockSelector:u,maskTextClass:f,maskTextSelector:d,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:x,inlineImages:_,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F},G=0,z=Array.from(t.childNodes);G<z.length;G++){($=S(z[G],H))&&P.childNodes.push($)}if(r(t)&&t.shadowRoot)for(var q=0,V=Array.from(t.shadowRoot.childNodes);q<V.length;q++){var $;($=S(V[q],H))&&($.isShadow=!0,P.childNodes.push($))}}return t.parentNode&&n(t.parentNode)&&(P.isShadow=!0),P.type===e.NodeType.Element&&"iframe"===P.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&O){var r=S(e,{doc:e,map:s,blockClass:c,blockSelector:u,maskTextClass:f,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:x,inlineImages:_,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F});r&&O(t,r)}}),R),P}var x=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function E(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 i(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function l(){return d(/^{\s*/)}function u(){return d(/^}/)}function f(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=S()||E());)!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=i();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 o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=d(/^([^{]+)/);if(e)return _(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=i(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=_(t[0]);if(!d(/^:\s*/))return c("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(x,""),value:n?_(n[0]).replace(x,""):""});return d(/^[;\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=i();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=w("import"),C=w("charset"),N=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function S(){if("@"===e[0])return function(){var e=i(),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(!l())return c("@keyframes missing '{'");for(var o=m();n=T();)o.push(n),o=o.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=d(/^@media *([^{]+)/);if(t){var r=_(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(f());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:_(t[1]),media:_(t[2])})}()||function(){var e=i(),t=d(/^@supports *([^{]+)/);if(t){var r=_(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(f());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||C()||N()||function(){var e=i(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=_(t[1]),n=_(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=i();if(d(/^@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=i();if(d(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(f());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(d(/^@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 E(){var e=i(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return I((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function _(e){return e?e.replace(/^\s+|\s+$/g,""):""}function I(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){I(e,n)})):o&&"object"==typeof o&&I(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var D={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 L=/([^\\]):hover/,O=new RegExp(L.source,"g");function A(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=E(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){L.test(e)&&a.push(e)}))})),0===a.length)return e;var i=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"),o=e.replace(i,(function(e){var t=e.replace(O,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function R(t,r){var n=r.doc,a=r.hackCss,i=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 o,s=function(e){var t=D[e.tagName]?D[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",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}else if("img"===s&&"rr_dataURL"===e){var l=o;l.currentSrc.startsWith("data:")||(l.setAttribute("rrweb-original-src",t.attributes.src),l.src=r)}if("rr_width"===e)o.style.width=r;else if("rr_height"===e)o.style.height=r;else if("rr_mediaCurrentTime"===e)o.currentTime=t.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var u="textarea"===s&&"value"===e,f="style"===s&&"_cssText"===e;if(f&&a&&(r=A(r,i)),u||f){for(var d=n.createTextNode(r),p=0,m=Array.from(o.childNodes);p<m.length;p++){var h=m[p];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(d),"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"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===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?o.setAttribute("rrweb-original-srcset",t.attributes.srcset):o.setAttribute(e,r))}}catch(e){}}};for(var l in t.attributes)c(l);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?A(t.textContent,i):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function M(t,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,f=n.cache,d=R(t,{doc:a,hackCss:l,cache:f});if(!d)return null;if(t.rootId&&console.assert(i[t.rootId]===a,"Target document should has the same root id."),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" "">')),d=a),d.__sn=t,i[t.id]=d,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var p=0,m=t.childNodes;p<m.length;p++){var h=m[p],v=M(h,{doc:a,map:i,skipChild:!1,hackCss:l,afterAppend:u,cache:f});v?(h.isShadow&&r(d)&&d.shadowRoot?d.shadowRoot.appendChild(v):d.appendChild(v),u&&u(v)):console.warn("Failed to rebuild",h)}return d}return e.IGNORED_NODE=-2,e.addHoverClass=A,e.buildNodeWithSN=M,e.cleanupSnapshot=function(){l=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.is2DCanvasBlank=o,e.isElement=r,e.isShadowRoot=n,e.maskInputValue=a,e.needMaskingText=C,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=M(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(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 i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]},e.serializeNodeWithId=S,e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,c=void 0===s?"rr-mask":s,l=r.maskTextSelector,u=void 0===l?null:l,f=r.inlineStylesheet,d=void 0===f||f,p=r.inlineImages,m=void 0!==p&&p,h=r.recordCanvas,v=void 0!==h&&h,y=r.maskAllInputs,g=void 0!==y&&y,T=r.maskTextFn,b=r.maskInputFn,k=r.slimDOM,C=void 0!==k&&k,N=r.dataURLOptions,w=r.preserveWhiteSpace,x=r.onSerialize,E=r.onIframeLoad,_=r.iframeLoadTimeout,I=r.keepIframeSrcFn,D={};return[S(e,{doc:e,map:D,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===g?{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===g?{password:!0}:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===C,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===C?{}:C,dataURLOptions:N,inlineImages:m,recordCanvas:v,preserveWhiteSpace:w,onSerialize:x,onIframeLoad:E,iframeLoadTimeout:_,keepIframeSrcFn:void 0===I?function(){return!1}:I}),D]},e.transformAttribute=k,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}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -280,7 +280,8 @@ var NodeType;

else {
node.classList.forEach(function (className) {
for (var eIndex = 0; eIndex < node.classList.length; eIndex++) {
var className = node.classList[eIndex];
if (maskTextClass.test(className)) {
return true;
}
});
}
}

@@ -515,3 +516,5 @@ if (maskTextSelector) {

try {
if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
if (n.nextSibling || n.previousSibling) {
}
else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
textContent = stringifyStyleSheet(n.parentNode.sheet);

@@ -686,2 +689,4 @@ }

delete serializedNode.needBlock;
if (n.shadowRoot)
serializedNode.isShadowHost = true;
}

@@ -726,3 +731,2 @@ if ((serializedNode.type === NodeType.Document ||

if (isElement(n) && n.shadowRoot) {
serializedNode.isShadowHost = true;
for (var _l = 0, _m = Array.from(n.shadowRoot.childNodes); _l < _m.length; _l++) {

@@ -729,0 +733,0 @@ var childN = _m[_l];

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

var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function n(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}!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={}));function a(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,i="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(i.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}var i,o,s=1,c=new RegExp("[^a-z0-9-_:]"),u=-2;function l(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(f).join(""):null}catch(e){return null}}function f(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=l(e.styleSheet)||t}catch(e){}return t}var m=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,d=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,p=/^(data:)([^,]*),(.*)/i;function h(e,t){return(e||"").replace(m,(function(e,r,n,a,i,o){var s,c=n||i||o,u=r||a||"";if(!c)return e;if(!d.test(c))return"url("+u+c+u+")";if(p.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 l=t.split("/"),f=c.split("/");l.pop();for(var m=0,h=f;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?l.pop():l.push(v))}return"url("+u+l.join("/")+u+")"}))}var v=/^[^ \t\n\r\u000c]+/,g=/^[, \t\n\r\u000c]+/;function y(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function b(){var e=document.createElement("a");return e.href="",e.href}function k(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?y(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(g),!(r>=t.length);){var i=n(v);if(","===i.slice(-1))i=y(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=y(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?h(n,b()):"object"===t&&"data"===r&&n?y(e,n):n:y(e,n)}function C(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))||C(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,r)}function T(t,r){var s,u,f,m,d=r.doc,p=r.blockClass,v=r.blockSelector,g=r.maskTextClass,y=r.maskTextSelector,T=r.inlineStylesheet,w=r.maskInputOptions,x=void 0===w?{}:w,S=r.maskTextFn,E=r.maskInputFn,_=r.dataURLOptions,N=void 0===_?{}:_,I=r.inlineImages,D=r.recordCanvas,L=r.keepIframeSrcFn;if(d.__sn){var O=d.__sn.id;u=1===O?void 0:O}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:u}:{type:e.Document,childNodes:[],rootId:u};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:u};case t.ELEMENT_NODE:for(var A=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,p,v),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return c.test(t)?"div":t}(t),M={},F=0,U=Array.from(t.attributes);F<U.length;F++){var W=U[F],j=W.name,P=W.value;M[j]=k(d,R,j,P)}if("link"===R&&T){var B=Array.from(d.styleSheets).find((function(e){return e.href===t.href})),H=null;B&&(H=l(B)),H&&(delete M.rel,delete M.href,M._cssText=h(H,B.href))}if("style"===R&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(H=l(t.sheet))&&(M._cssText=h(H,b()));if("input"===R||"textarea"===R||"select"===R){P=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&P?M.value=n({type:M.type,tagName:R,value:P,maskInputOptions:x,maskInputFn:E}):t.checked&&(M.checked=t.checked)}if("option"===R&&(t.selected&&!x.select?M.selected=!0:delete M.selected),"canvas"===R&&D)if("2d"===t.__context)a(t)||(M.rr_dataURL=t.toDataURL(N.type,N.quality));else if(!("__context"in t)){var G=t.toDataURL(N.type,N.quality),z=document.createElement("canvas");z.width=t.width,z.height=t.height,G!==z.toDataURL(N.type,N.quality)&&(M.rr_dataURL=G)}if("img"===R&&I){i||(i=d.createElement("canvas"),o=i.getContext("2d"));var q=t,V=q.crossOrigin;q.crossOrigin="anonymous";var $=function(){try{i.width=q.naturalWidth,i.height=q.naturalHeight,o.drawImage(q,0,0),M.rr_dataURL=i.toDataURL(N.type,N.quality)}catch(e){console.warn("Cannot inline img src="+q.currentSrc+"! Error: "+e)}V?M.crossOrigin=V:delete M.crossOrigin};q.complete&&0!==q.naturalWidth?$():q.onload=$}if("audio"!==R&&"video"!==R||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),A){var X=t.getBoundingClientRect(),Y=X.width,K=X.height;M={class:M.class,rr_width:Y+"px",rr_height:K+"px"}}return"iframe"!==R||L(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:R,attributes:M,childNodes:[],isSVG:(m=t,Boolean("svg"===m.tagName||m.ownerSVGElement)||void 0),needBlock:A,rootId:u};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,J=t.textContent,Q="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(Q&&J){try{(null===(s=t.parentNode.sheet)||void 0===s?void 0:s.cssRules)&&(J=(f=t.parentNode.sheet).cssRules?Array.from(f.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}J=h(J,b())}return ee&&(J="SCRIPT_PLACEHOLDER"),!Q&&!ee&&C(t,g,y)&&J&&(J=S?S(J):J.replace(/[\S]/g,"*")),{type:e.Text,textContent:J||"",isStyle:Q,rootId:u};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:u};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:u};default:return!1}}function w(e){return void 0===e?"":e.toLowerCase()}function x(n,a){var i,o=a.doc,c=a.map,u=a.blockClass,l=a.blockSelector,f=a.maskTextClass,m=a.maskTextSelector,d=a.skipChild,p=void 0!==d&&d,h=a.inlineStylesheet,v=void 0===h||h,g=a.maskInputOptions,y=void 0===g?{}:g,b=a.maskTextFn,k=a.maskInputFn,C=a.slimDOMOptions,S=a.dataURLOptions,E=void 0===S?{}:S,_=a.inlineImages,N=void 0!==_&&_,I=a.recordCanvas,D=void 0!==I&&I,L=a.onSerialize,O=a.onIframeLoad,A=a.iframeLoadTimeout,R=void 0===A?5e3:A,M=a.keepIframeSrcFn,F=void 0===M?function(){return!1}:M,U=a.preserveWhiteSpace,W=void 0===U||U,j=T(n,{doc:o,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,dataURLOptions:E,inlineImages:N,recordCanvas:D,keepIframeSrcFn:F});if(!j)return console.warn(n,"not serialized"),null;i="__sn"in n?n.__sn.id:!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&&"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&&(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(r.headMetaDescKeywords&&w(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(w(t.attributes.property).match(/^(og|twitter|fb):/)||w(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===w(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===w(t.attributes.name)||"googlebot"===w(t.attributes.name)||"bingbot"===w(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.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(r.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}(j,C)&&(W||j.type!==e.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?s++:-2;var P=Object.assign(j,{id:i});if(n.__sn=P,-2===i)return null;c[i]=n,L&&L(n);var B=!p;if(P.type===e.Element&&(B=B&&!P.needBlock,delete P.needBlock),(P.type===e.Document||P.type===e.Element)&&B){C.headWhitespace&&j.type===e.Element&&"head"===j.tagName&&(W=!1);for(var H={doc:o,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:p,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:E,inlineImages:N,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F},G=0,z=Array.from(n.childNodes);G<z.length;G++){($=x(z[G],H))&&P.childNodes.push($)}if(t(n)&&n.shadowRoot){P.isShadowHost=!0;for(var q=0,V=Array.from(n.shadowRoot.childNodes);q<V.length;q++){var $;($=x(V[q],H))&&($.isShadow=!0,P.childNodes.push($))}}}return n.parentNode&&r(n.parentNode)&&(P.isShadow=!0),P.type===e.Element&&"iframe"===P.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(n,(function(){var e=n.contentDocument;if(e&&O){var t=x(e,{doc:e,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:E,inlineImages:N,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F});t&&O(n,t)}}),R),P}function S(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,m=void 0===f||f,d=r.inlineImages,p=void 0!==d&&d,h=r.recordCanvas,v=void 0!==h&&h,g=r.maskAllInputs,y=void 0!==g&&g,b=r.maskTextFn,k=r.maskInputFn,C=r.slimDOM,T=void 0!==C&&C,w=r.dataURLOptions,S=r.preserveWhiteSpace,E=r.onSerialize,_=r.onIframeLoad,N=r.iframeLoadTimeout,I=r.keepIframeSrcFn,D={};return[x(e,{doc:e,map:D,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===y?{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===y?{password:!0}:y,maskTextFn:b,maskInputFn:k,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,dataURLOptions:w,inlineImages:p,recordCanvas:v,preserveWhiteSpace:S,onSerialize:E,onIframeLoad:_,iframeLoadTimeout:N,keepIframeSrcFn:void 0===I?function(){return!1}:I}),D]}function E(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function _(){s=1}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function I(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 i(){var e={line:r,column:n};return function(t){return t.position=new o(e),d(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function u(){return m(/^{\s*/)}function l(){return m(/^}/)}function f(){var t,r=[];for(d(),p(r);e.length&&"}"!==e.charAt(0)&&(t=S()||E());)!1!==t&&(r.push(t),p(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){m(/^\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=i();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 o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=m(/^([^{]+)/);if(e)return D(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=i(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=D(t[0]);if(!m(/^:\s*/))return c("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?D(n[0]).replace(N,""):""});return m(/^[;\s]*/),a}}function y(){var e,t=[];if(!u())return c("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return l()?t:c("missing '}'")}function b(){for(var e,t=[],r=i();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,C=x("import"),T=x("charset"),w=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=m(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function S(){if("@"===e[0])return function(){var e=i(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var o=p();n=b();)o.push(n),o=o.concat(p());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=m(/^@media *([^{]+)/);if(t){var r=D(t[1]);if(!u())return c("@media missing '{'");var n=p().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:D(t[1]),media:D(t[2])})}()||function(){var e=i(),t=m(/^@supports *([^{]+)/);if(t){var r=D(t[1]);if(!u())return c("@supports missing '{'");var n=p().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||C()||T()||w()||function(){var e=i(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=D(t[1]),n=D(t[2]);if(!u())return c("@document missing '{'");var a=p().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=i();if(m(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=p();r=g();)n.push(r),n=n.concat(p());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=i();if(m(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=p().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(m(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=p();t=g();)r.push(t),r=r.concat(p());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function E(){var e=i(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return L((k=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function D(e){return e?e.replace(/^\s+|\s+$/g,""):""}function L(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){L(e,n)})):o&&"object"==typeof o&&L(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var O={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 A=/([^\\]):hover/,R=new RegExp(A.source,"g");function M(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=I(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){A.test(e)&&a.push(e)}))})),0===a.length)return e;var i=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"),o=e.replace(i,(function(e){var t=e.replace(R,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function F(){return{stylesWithHoverClass:new Map}}function U(t,r){var n=r.doc,a=r.hackCss,i=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 o,s=function(e){var t=O[e.tagName]?O[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",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}else if("img"===s&&"rr_dataURL"===e){var u=o;u.currentSrc.startsWith("data:")||(u.setAttribute("rrweb-original-src",t.attributes.src),u.src=r)}if("rr_width"===e)o.style.width=r;else if("rr_height"===e)o.style.height=r;else if("rr_mediaCurrentTime"===e)o.currentTime=t.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var l="textarea"===s&&"value"===e,f="style"===s&&"_cssText"===e;if(f&&a&&(r=M(r,i)),l||f){for(var m=n.createTextNode(r),d=0,p=Array.from(o.childNodes);d<p.length;d++){var h=p[d];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(m),"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"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===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?o.setAttribute("rrweb-original-srcset",t.attributes.srcset):o.setAttribute(e,r))}}catch(e){}}};for(var u in t.attributes)c(u);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.Text:return n.createTextNode(t.isStyle&&a?M(t.textContent,i):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function W(r,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,m=U(r,{doc:a,hackCss:u,cache:f});if(!m)return null;if(r.rootId&&console.assert(i[r.rootId]===a,"Target document should has the same root id."),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" "">')),m=a),m.__sn=r,i[r.id]=m,(r.type===e.Document||r.type===e.Element)&&!s)for(var d=0,p=r.childNodes;d<p.length;d++){var h=p[d],v=W(h,{doc:a,map:i,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&t(m)&&m.shadowRoot?m.shadowRoot.appendChild(v):m.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return m}function j(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=W(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]}export{u as IGNORED_NODE,e as NodeType,M as addHoverClass,W as buildNodeWithSN,_ as cleanupSnapshot,F as createCache,a as is2DCanvasBlank,t as isElement,r as isShadowRoot,n as maskInputValue,C as needMaskingText,j as rebuild,x as serializeNodeWithId,S as snapshot,k as transformAttribute,E as visitSnapshot};
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function n(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}!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={}));function a(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,i="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(i.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}var i,o,s=1,c=new RegExp("[^a-z0-9-_:]"),l=-2;function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(f).join(""):null}catch(e){return null}}function f(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=u(e.styleSheet)||t}catch(e){}return t}var m=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,d=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,p=/^(data:)([^,]*),(.*)/i;function h(e,t){return(e||"").replace(m,(function(e,r,n,a,i,o){var s,c=n||i||o,l=r||a||"";if(!c)return e;if(!d.test(c))return"url("+l+c+l+")";if(p.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),f=c.split("/");u.pop();for(var m=0,h=f;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?u.pop():u.push(v))}return"url("+l+u.join("/")+l+")"}))}var v=/^[^ \t\n\r\u000c]+/,g=/^[, \t\n\r\u000c]+/;function y(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function b(){var e=document.createElement("a");return e.href="",e.href}function k(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?y(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(g),!(r>=t.length);){var i=n(v);if(","===i.slice(-1))i=y(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=y(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?h(n,b()):"object"===t&&"data"===r&&n?y(e,n):n:y(e,n)}function C(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 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))||C(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,r)}function T(t,r){var s,l,f,m,d=r.doc,p=r.blockClass,v=r.blockSelector,g=r.maskTextClass,y=r.maskTextSelector,T=r.inlineStylesheet,w=r.maskInputOptions,x=void 0===w?{}:w,S=r.maskTextFn,E=r.maskInputFn,_=r.dataURLOptions,N=void 0===_?{}:_,I=r.inlineImages,D=r.recordCanvas,L=r.keepIframeSrcFn;if(d.__sn){var O=d.__sn.id;l=1===O?void 0:O}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:l}:{type:e.Document,childNodes:[],rootId:l};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:l};case t.ELEMENT_NODE:for(var A=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,p,v),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return c.test(t)?"div":t}(t),M={},F=0,U=Array.from(t.attributes);F<U.length;F++){var W=U[F],j=W.name,P=W.value;M[j]=k(d,R,j,P)}if("link"===R&&T){var B=Array.from(d.styleSheets).find((function(e){return e.href===t.href})),H=null;B&&(H=u(B)),H&&(delete M.rel,delete M.href,M._cssText=h(H,B.href))}if("style"===R&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(H=u(t.sheet))&&(M._cssText=h(H,b()));if("input"===R||"textarea"===R||"select"===R){P=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&P?M.value=n({type:M.type,tagName:R,value:P,maskInputOptions:x,maskInputFn:E}):t.checked&&(M.checked=t.checked)}if("option"===R&&(t.selected&&!x.select?M.selected=!0:delete M.selected),"canvas"===R&&D)if("2d"===t.__context)a(t)||(M.rr_dataURL=t.toDataURL(N.type,N.quality));else if(!("__context"in t)){var G=t.toDataURL(N.type,N.quality),z=document.createElement("canvas");z.width=t.width,z.height=t.height,G!==z.toDataURL(N.type,N.quality)&&(M.rr_dataURL=G)}if("img"===R&&I){i||(i=d.createElement("canvas"),o=i.getContext("2d"));var q=t,V=q.crossOrigin;q.crossOrigin="anonymous";var $=function(){try{i.width=q.naturalWidth,i.height=q.naturalHeight,o.drawImage(q,0,0),M.rr_dataURL=i.toDataURL(N.type,N.quality)}catch(e){console.warn("Cannot inline img src="+q.currentSrc+"! Error: "+e)}V?M.crossOrigin=V:delete M.crossOrigin};q.complete&&0!==q.naturalWidth?$():q.onload=$}if("audio"!==R&&"video"!==R||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),A){var X=t.getBoundingClientRect(),Y=X.width,K=X.height;M={class:M.class,rr_width:Y+"px",rr_height:K+"px"}}return"iframe"!==R||L(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:R,attributes:M,childNodes:[],isSVG:(m=t,Boolean("svg"===m.tagName||m.ownerSVGElement)||void 0),needBlock:A,rootId:l};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,J=t.textContent,Q="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(Q&&J){try{t.nextSibling||t.previousSibling||(null===(s=t.parentNode.sheet)||void 0===s?void 0:s.cssRules)&&(J=(f=t.parentNode.sheet).cssRules?Array.from(f.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}J=h(J,b())}return ee&&(J="SCRIPT_PLACEHOLDER"),!Q&&!ee&&C(t,g,y)&&J&&(J=S?S(J):J.replace(/[\S]/g,"*")),{type:e.Text,textContent:J||"",isStyle:Q,rootId:l};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:l};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:l};default:return!1}}function w(e){return void 0===e?"":e.toLowerCase()}function x(n,a){var i,o=a.doc,c=a.map,l=a.blockClass,u=a.blockSelector,f=a.maskTextClass,m=a.maskTextSelector,d=a.skipChild,p=void 0!==d&&d,h=a.inlineStylesheet,v=void 0===h||h,g=a.maskInputOptions,y=void 0===g?{}:g,b=a.maskTextFn,k=a.maskInputFn,C=a.slimDOMOptions,S=a.dataURLOptions,E=void 0===S?{}:S,_=a.inlineImages,N=void 0!==_&&_,I=a.recordCanvas,D=void 0!==I&&I,L=a.onSerialize,O=a.onIframeLoad,A=a.iframeLoadTimeout,R=void 0===A?5e3:A,M=a.keepIframeSrcFn,F=void 0===M?function(){return!1}:M,U=a.preserveWhiteSpace,W=void 0===U||U,j=T(n,{doc:o,blockClass:l,blockSelector:u,maskTextClass:f,maskTextSelector:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,dataURLOptions:E,inlineImages:N,recordCanvas:D,keepIframeSrcFn:F});if(!j)return console.warn(n,"not serialized"),null;i="__sn"in n?n.__sn.id:!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&&"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&&(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(r.headMetaDescKeywords&&w(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(w(t.attributes.property).match(/^(og|twitter|fb):/)||w(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===w(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===w(t.attributes.name)||"googlebot"===w(t.attributes.name)||"bingbot"===w(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.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(r.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}(j,C)&&(W||j.type!==e.Text||j.isStyle||j.textContent.replace(/^\s+|\s+$/gm,"").length)?s++:-2;var P=Object.assign(j,{id:i});if(n.__sn=P,-2===i)return null;c[i]=n,L&&L(n);var B=!p;if(P.type===e.Element&&(B=B&&!P.needBlock,delete P.needBlock,n.shadowRoot&&(P.isShadowHost=!0)),(P.type===e.Document||P.type===e.Element)&&B){C.headWhitespace&&j.type===e.Element&&"head"===j.tagName&&(W=!1);for(var H={doc:o,map:c,blockClass:l,blockSelector:u,maskTextClass:f,maskTextSelector:m,skipChild:p,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:E,inlineImages:N,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F},G=0,z=Array.from(n.childNodes);G<z.length;G++){($=x(z[G],H))&&P.childNodes.push($)}if(t(n)&&n.shadowRoot)for(var q=0,V=Array.from(n.shadowRoot.childNodes);q<V.length;q++){var $;($=x(V[q],H))&&($.isShadow=!0,P.childNodes.push($))}}return n.parentNode&&r(n.parentNode)&&(P.isShadow=!0),P.type===e.Element&&"iframe"===P.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(n,(function(){var e=n.contentDocument;if(e&&O){var t=x(e,{doc:e,map:c,blockClass:l,blockSelector:u,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:C,dataURLOptions:E,inlineImages:N,recordCanvas:D,preserveWhiteSpace:W,onSerialize:L,onIframeLoad:O,iframeLoadTimeout:R,keepIframeSrcFn:F});t&&O(n,t)}}),R),P}function S(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,c=void 0===s?"rr-mask":s,l=r.maskTextSelector,u=void 0===l?null:l,f=r.inlineStylesheet,m=void 0===f||f,d=r.inlineImages,p=void 0!==d&&d,h=r.recordCanvas,v=void 0!==h&&h,g=r.maskAllInputs,y=void 0!==g&&g,b=r.maskTextFn,k=r.maskInputFn,C=r.slimDOM,T=void 0!==C&&C,w=r.dataURLOptions,S=r.preserveWhiteSpace,E=r.onSerialize,_=r.onIframeLoad,N=r.iframeLoadTimeout,I=r.keepIframeSrcFn,D={};return[x(e,{doc:e,map:D,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===y?{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===y?{password:!0}:y,maskTextFn:b,maskInputFn:k,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,dataURLOptions:w,inlineImages:p,recordCanvas:v,preserveWhiteSpace:S,onSerialize:E,onIframeLoad:_,iframeLoadTimeout:N,keepIframeSrcFn:void 0===I?function(){return!1}:I}),D]}function E(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function _(){s=1}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function I(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 i(){var e={line:r,column:n};return function(t){return t.position=new o(e),d(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function l(){return m(/^{\s*/)}function u(){return m(/^}/)}function f(){var t,r=[];for(d(),p(r);e.length&&"}"!==e.charAt(0)&&(t=S()||E());)!1!==t&&(r.push(t),p(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){m(/^\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=i();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 o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=m(/^([^{]+)/);if(e)return D(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=i(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=D(t[0]);if(!m(/^:\s*/))return c("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?D(n[0]).replace(N,""):""});return m(/^[;\s]*/),a}}function y(){var e,t=[];if(!l())return c("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return u()?t:c("missing '}'")}function b(){for(var e,t=[],r=i();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,C=x("import"),T=x("charset"),w=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=m(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function S(){if("@"===e[0])return function(){var e=i(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var o=p();n=b();)o.push(n),o=o.concat(p());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=m(/^@media *([^{]+)/);if(t){var r=D(t[1]);if(!l())return c("@media missing '{'");var n=p().concat(f());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:D(t[1]),media:D(t[2])})}()||function(){var e=i(),t=m(/^@supports *([^{]+)/);if(t){var r=D(t[1]);if(!l())return c("@supports missing '{'");var n=p().concat(f());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||C()||T()||w()||function(){var e=i(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=D(t[1]),n=D(t[2]);if(!l())return c("@document missing '{'");var a=p().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=i();if(m(/^@page */)){var t=v()||[];if(!l())return c("@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}):c("@page missing '}'")}}()||function(){var e=i();if(m(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=p().concat(f());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(m(/^@font-face\s*/)){if(!l())return c("@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}):c("@font-face missing '}'")}}()}function E(){var e=i(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return L((k=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function D(e){return e?e.replace(/^\s+|\s+$/g,""):""}function L(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){L(e,n)})):o&&"object"==typeof o&&L(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var O={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 A=/([^\\]):hover/,R=new RegExp(A.source,"g");function M(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=I(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){A.test(e)&&a.push(e)}))})),0===a.length)return e;var i=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"),o=e.replace(i,(function(e){var t=e.replace(R,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function F(){return{stylesWithHoverClass:new Map}}function U(t,r){var n=r.doc,a=r.hackCss,i=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 o,s=function(e){var t=O[e.tagName]?O[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",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}else if("img"===s&&"rr_dataURL"===e){var l=o;l.currentSrc.startsWith("data:")||(l.setAttribute("rrweb-original-src",t.attributes.src),l.src=r)}if("rr_width"===e)o.style.width=r;else if("rr_height"===e)o.style.height=r;else if("rr_mediaCurrentTime"===e)o.currentTime=t.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var u="textarea"===s&&"value"===e,f="style"===s&&"_cssText"===e;if(f&&a&&(r=M(r,i)),u||f){for(var m=n.createTextNode(r),d=0,p=Array.from(o.childNodes);d<p.length;d++){var h=p[d];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(m),"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"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===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?o.setAttribute("rrweb-original-srcset",t.attributes.srcset):o.setAttribute(e,r))}}catch(e){}}};for(var l in t.attributes)c(l);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.Text:return n.createTextNode(t.isStyle&&a?M(t.textContent,i):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function W(r,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,f=n.cache,m=U(r,{doc:a,hackCss:l,cache:f});if(!m)return null;if(r.rootId&&console.assert(i[r.rootId]===a,"Target document should has the same root id."),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" "">')),m=a),m.__sn=r,i[r.id]=m,(r.type===e.Document||r.type===e.Element)&&!s)for(var d=0,p=r.childNodes;d<p.length;d++){var h=p[d],v=W(h,{doc:a,map:i,skipChild:!1,hackCss:l,afterAppend:u,cache:f});v?(h.isShadow&&t(m)&&m.shadowRoot?m.shadowRoot.appendChild(v):m.appendChild(v),u&&u(v)):console.warn("Failed to rebuild",h)}return m}function j(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=W(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]}export{l as IGNORED_NODE,e as NodeType,M as addHoverClass,W as buildNodeWithSN,_ as cleanupSnapshot,F as createCache,a as is2DCanvasBlank,t as isElement,r as isShadowRoot,n as maskInputValue,C as needMaskingText,j as rebuild,x as serializeNodeWithId,S as snapshot,k as transformAttribute,E as visitSnapshot};
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -284,7 +284,8 @@ 'use strict';

else {
node.classList.forEach(function (className) {
for (var eIndex = 0; eIndex < node.classList.length; eIndex++) {
var className = node.classList[eIndex];
if (maskTextClass.test(className)) {
return true;
}
});
}
}

@@ -519,3 +520,5 @@ if (maskTextSelector) {

try {
if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
if (n.nextSibling || n.previousSibling) {
}
else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
textContent = stringifyStyleSheet(n.parentNode.sheet);

@@ -690,2 +693,4 @@ }

delete serializedNode.needBlock;
if (n.shadowRoot)
serializedNode.isShadowHost = true;
}

@@ -730,3 +735,2 @@ if ((serializedNode.type === exports.NodeType.Document ||

if (isElement(n) && n.shadowRoot) {
serializedNode.isShadowHost = true;
for (var _l = 0, _m = Array.from(n.shadowRoot.childNodes); _l < _m.length; _l++) {

@@ -733,0 +737,0 @@ var childN = _m[_l];

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

@@ -61,3 +61,3 @@ "scripts": {

},
"gitHead": "bd144be39be799dc598e11377bb5356b0752e986"
"gitHead": "e110660ac666505e13ee561cdf5cf9ad52de1bcb"
}

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

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