Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 0.7.26 to 0.7.27

5

dist/rrweb-snapshot.js

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

var _id = 1;
var symbolAndNumberRegex = RegExp('[^a-z1-6]');
var symbolAndNumberRegex = RegExp('[^a-z1-6\-]');
function genId() {

@@ -861,2 +861,5 @@ return _id++;

}
else if (name == 'onload' || name == 'onclick' || name.substring(0, 7) == 'onmouse') {
node_1.setAttribute('_' + name, value);
}
else {

@@ -863,0 +866,0 @@ node_1.setAttribute(name, value);

2

dist/rrweb-snapshot.min.js

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

var rrwebSnapshot=function(e){"use strict";var t;(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 r=1,n=RegExp("[^a-z1-6]");function a(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+(function(e){return"styleSheet"in e}(r=t)?a(r.styleSheet)||"":r.cssText);var r},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function u(e,t){return(e||"").replace(i,function(e,r,n,a){var i,u=r||n||a;if(!u)return e;if(!o.test(u))return"url('"+u+"')";if(s.test(u))return"url("+u+")";if("/"===u[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+u)+"')";var c=t.split("/"),f=u.split("/");c.pop();for(var l=0,p=f;l<p.length;l++){var d=p[l];"."!==d&&(".."===d?c.pop():c.push(d))}return"url('"+c.join("/")+"')"})}function c(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function f(e,t,r){return"src"===t||"href"===t&&r?c(e,r):"srcset"===t&&r?function(e,t){return""===t.trim()?t:t.split(",").map(function(t){var r=t.trimLeft().trimRight().split(" ");return 2===r.length?c(e,r[0])+" "+r[1]:1===r.length?""+c(e,r[0]):""}).join(",")}(e,r):"style"===t&&r?u(r,location.href):r}function l(t,r,i,o,s){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:var c=!1;"string"==typeof i?c=t.classList.contains(i):t.classList.forEach(function(e){i.test(e)&&(c=!0)});for(var l=function(e){var t=e.toLowerCase().trim();return n.test(t)?"div":t}(t.tagName),p={},d=0,m=Array.from(t.attributes);d<m.length;d++){var h=m[d],v=h.name,y=h.value;p[v]=f(r,v,y)}if("link"===l&&o){var g,T=Array.from(r.styleSheets).find(function(e){return e.href===t.href});(g=a(T))&&(delete p.rel,delete p.href,p._cssText=u(g,T.href))}if("style"===l&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(g=a(t.sheet))&&(p._cssText=u(g,location.href));if("input"===l||"textarea"===l||"select"===l){y=t.value;"radio"!==p.type&&"checkbox"!==p.type&&y?p.value=s?"*".repeat(y.length):y:t.checked&&(p.checked=t.checked)}if("option"===l){var N=t.parentElement;p.value===N.value&&(p.selected=t.selected)}if("canvas"===l&&(p.rr_dataURL=t.toDataURL()),"audio"!==l&&"video"!==l||(p.rr_mediaState=t.paused?"paused":"played"),c){var E=t.getBoundingClientRect(),C=E.width,x=E.height;p.rr_width=C+"px",p.rr_height=x+"px"}return{type:e.NodeType.Element,tagName:l,attributes:p,childNodes:[],isSVG:(A=t,"svg"===A.tagName||A instanceof SVGElement||void 0),needBlock:c};case t.TEXT_NODE:var w=t.parentNode&&t.parentNode.tagName,D=t.textContent,b="STYLE"===w||void 0;return b&&D&&(D=u(D,location.href)),"SCRIPT"===w&&(D="SCRIPT_PLACEHOLDER"),{type:e.NodeType.Text,textContent:D||"",isStyle:b};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||""};default:return!1}var A}function p(t,n,a,i,o,s,u){void 0===o&&(o=!1),void 0===s&&(s=!0),void 0===u&&(u=!1);var c,f=l(t,n,i,s,u);if(!f)return console.warn(t,"not serialized"),null;c="__sn"in t?t.__sn.id:r++;var d=Object.assign(f,{id:c});t.__sn=d,a[c]=t;var m=!o;if(d.type===e.NodeType.Element&&(m=m&&!d.needBlock,delete d.needBlock),(d.type===e.NodeType.Document||d.type===e.NodeType.Element)&&m)for(var h=0,v=Array.from(t.childNodes);h<v.length;h++){var y=p(v[h],n,a,i,o,s,u);y&&d.childNodes.push(y)}return d}var d=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;function m(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),m(),t}}var o=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();o.prototype.content=e;var s=[];function u(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 c(){return p(/^{\s*/)}function f(){return p(/^}/)}function l(){var t,r=[];for(m(),v(r);e.length&&"}"!==e.charAt(0)&&(t=A()||_());)!1!==t&&(r.push(t),v(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){p(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){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 u("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 g(){var e=p(/^([^{]+)/);if(e)return h(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 T(){var e=i(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=h(t[0]);if(!p(/^:\s*/))return u("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(d,""),value:n?h(n[0]).replace(d,""):""});return p(/^[;\s]*/),a}}function N(){var e,t=[];if(!c())return u("missing '{'");for(v(t);e=T();)!1!==e&&(t.push(e),v(t)),e=T();return f()?t:u("missing '}'")}function E(){for(var e,t=[],r=i();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:N()})}var C,x=b("import"),w=b("charset"),D=b("namespace");function b(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function A(){if("@"===e[0])return function(){var e=i(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,a=t[1];if(!c())return u("@keyframes missing '{'");for(var o=v();n=E();)o.push(n),o=o.concat(v());return f()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=p(/^@media *([^{]+)/);if(t){var r=h(t[1]);if(!c())return u("@media missing '{'");var n=v().concat(l());return f()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:h(t[1]),media:h(t[2])})}()||function(){var e=i(),t=p(/^@supports *([^{]+)/);if(t){var r=h(t[1]);if(!c())return u("@supports missing '{'");var n=v().concat(l());return f()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||x()||w()||D()||function(){var e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=h(t[1]),n=h(t[2]);if(!c())return u("@document missing '{'");var a=v().concat(l());return f()?e({type:"document",document:n,vendor:r,rules:a}):u("@document missing '}'")}}()||function(){var e=i();if(p(/^@page */)){var t=g()||[];if(!c())return u("@page missing '{'");for(var r,n=v();r=T();)n.push(r),n=n.concat(v());return f()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(p(/^@host\s*/)){if(!c())return u("@host missing '{'");var t=v().concat(l());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(p(/^@font-face\s*/)){if(!c())return u("@font-face missing '{'");for(var t,r=v();t=T();)r.push(t),r=r.concat(v());return f()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function _(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:N()})):u("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var i=0,o=Object.keys(t);i<o.length;i++){var s=o[i],u=t[s];Array.isArray(u)?u.forEach(function(t){e(t,a)}):u&&"object"==typeof u&&e(u,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((C=l(),{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:s}}))}function h(e){return e?e.replace(/^\s+|\s+$/g,""):""}var v={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 y=/([^\\]):hover/g;function g(e){var t=m(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach(function(t){"selectors"in t&&(t.selectors||[]).forEach(function(t){if(y.test(t)){var r=t.replace(y,"$1.\\:hover");e=e.replace(t,t+", "+r)}})}),e):e}function T(t,r,n){switch(t.type){case e.NodeType.Document:return r.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return r.implementation.createDocumentType(t.name,t.publicId,t.systemId);case e.NodeType.Element:var a,i=function(e){var t=v[e.tagName]?v[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);a=t.isSVG?r.createElementNS("http://www.w3.org/2000/svg",i):r.createElement(i);var o=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var o=t.attributes[e];if(o="boolean"==typeof o?"":o,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=o,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(a.style.width=o),"rr_height"===e&&(a.style.height=o),"rr_mediaState"===e)switch(o){case"played":a.play();case"paused":a.pause()}}else{var u="textarea"===i&&"value"===e,c="style"===i&&"_cssText"===e;if(c&&n&&(o=g(o)),u||c){for(var f=r.createTextNode(o),l=0,p=Array.from(a.childNodes);l<p.length;l++){var d=p[l];d.nodeType===a.TEXT_NODE&&a.removeChild(d)}return a.appendChild(f),"continue"}if("iframe"===i&&"src"===e)return"continue";try{t.isSVG&&"xlink:href"===e?a.setAttributeNS("http://www.w3.org/1999/xlink",e,o):a.setAttribute(e,o)}catch(e){}}};for(var s in t.attributes)o(s);return a;case e.NodeType.Text:return r.createTextNode(t.isStyle&&n?g(t.textContent):t.textContent);case e.NodeType.CDATA:return r.createCDATASection(t.textContent);case e.NodeType.Comment:return r.createComment(t.textContent);default:return null}}function N(t,r,n,a,i){void 0===a&&(a=!1),void 0===i&&(i=!0);var o=T(t,r,i);if(!o)return null;if(t.type===e.NodeType.Document&&(r.close(),r.open(),o=r),o.__sn=t,n[t.id]=o,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!a)for(var s=0,u=t.childNodes;s<u.length;s++){var c=u[s],f=N(c,r,n,!1,i);f?o.appendChild(f):console.warn("Failed to rebuild",c)}return o}return e.snapshot=function(e,t,r,n){void 0===t&&(t="rr-block"),void 0===r&&(r=!0),void 0===n&&(n=!1);var a={};return[p(e,e,a,t,!1,r,n),a]},e.serializeNodeWithId=p,e.rebuild=function(e,t,r){void 0===r&&(r=!0);var n={};return[N(e,t,n,!1,r),n]},e.buildNodeWithSN=N,e.addHoverClass=g,e.transformAttribute=f,e}({});
var rrwebSnapshot=function(e){"use strict";var t;(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 r=1,n=RegExp("[^a-z1-6-]");function a(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+(function(e){return"styleSheet"in e}(r=t)?a(r.styleSheet)||"":r.cssText);var r},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function u(e,t){return(e||"").replace(i,function(e,r,n,a){var i,u=r||n||a;if(!u)return e;if(!o.test(u))return"url('"+u+"')";if(s.test(u))return"url("+u+")";if("/"===u[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+u)+"')";var c=t.split("/"),f=u.split("/");c.pop();for(var l=0,p=f;l<p.length;l++){var d=p[l];"."!==d&&(".."===d?c.pop():c.push(d))}return"url('"+c.join("/")+"')"})}function c(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function f(e,t,r){return"src"===t||"href"===t&&r?c(e,r):"srcset"===t&&r?function(e,t){return""===t.trim()?t:t.split(",").map(function(t){var r=t.trimLeft().trimRight().split(" ");return 2===r.length?c(e,r[0])+" "+r[1]:1===r.length?""+c(e,r[0]):""}).join(",")}(e,r):"style"===t&&r?u(r,location.href):r}function l(t,r,i,o,s){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:var c=!1;"string"==typeof i?c=t.classList.contains(i):t.classList.forEach(function(e){i.test(e)&&(c=!0)});for(var l=function(e){var t=e.toLowerCase().trim();return n.test(t)?"div":t}(t.tagName),p={},d=0,m=Array.from(t.attributes);d<m.length;d++){var h=m[d],v=h.name,y=h.value;p[v]=f(r,v,y)}if("link"===l&&o){var g,T=Array.from(r.styleSheets).find(function(e){return e.href===t.href});(g=a(T))&&(delete p.rel,delete p.href,p._cssText=u(g,T.href))}if("style"===l&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(g=a(t.sheet))&&(p._cssText=u(g,location.href));if("input"===l||"textarea"===l||"select"===l){y=t.value;"radio"!==p.type&&"checkbox"!==p.type&&y?p.value=s?"*".repeat(y.length):y:t.checked&&(p.checked=t.checked)}if("option"===l){var N=t.parentElement;p.value===N.value&&(p.selected=t.selected)}if("canvas"===l&&(p.rr_dataURL=t.toDataURL()),"audio"!==l&&"video"!==l||(p.rr_mediaState=t.paused?"paused":"played"),c){var E=t.getBoundingClientRect(),C=E.width,x=E.height;p.rr_width=C+"px",p.rr_height=x+"px"}return{type:e.NodeType.Element,tagName:l,attributes:p,childNodes:[],isSVG:(A=t,"svg"===A.tagName||A instanceof SVGElement||void 0),needBlock:c};case t.TEXT_NODE:var w=t.parentNode&&t.parentNode.tagName,b=t.textContent,D="STYLE"===w||void 0;return D&&b&&(b=u(b,location.href)),"SCRIPT"===w&&(b="SCRIPT_PLACEHOLDER"),{type:e.NodeType.Text,textContent:b||"",isStyle:D};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||""};default:return!1}var A}function p(t,n,a,i,o,s,u){void 0===o&&(o=!1),void 0===s&&(s=!0),void 0===u&&(u=!1);var c,f=l(t,n,i,s,u);if(!f)return console.warn(t,"not serialized"),null;c="__sn"in t?t.__sn.id:r++;var d=Object.assign(f,{id:c});t.__sn=d,a[c]=t;var m=!o;if(d.type===e.NodeType.Element&&(m=m&&!d.needBlock,delete d.needBlock),(d.type===e.NodeType.Document||d.type===e.NodeType.Element)&&m)for(var h=0,v=Array.from(t.childNodes);h<v.length;h++){var y=p(v[h],n,a,i,o,s,u);y&&d.childNodes.push(y)}return d}var d=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;function m(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),m(),t}}var o=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();o.prototype.content=e;var s=[];function u(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 c(){return p(/^{\s*/)}function f(){return p(/^}/)}function l(){var t,r=[];for(m(),v(r);e.length&&"}"!==e.charAt(0)&&(t=A()||_());)!1!==t&&(r.push(t),v(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){p(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){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 u("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 g(){var e=p(/^([^{]+)/);if(e)return h(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 T(){var e=i(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=h(t[0]);if(!p(/^:\s*/))return u("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(d,""),value:n?h(n[0]).replace(d,""):""});return p(/^[;\s]*/),a}}function N(){var e,t=[];if(!c())return u("missing '{'");for(v(t);e=T();)!1!==e&&(t.push(e),v(t)),e=T();return f()?t:u("missing '}'")}function E(){for(var e,t=[],r=i();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:N()})}var C,x=D("import"),w=D("charset"),b=D("namespace");function D(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function A(){if("@"===e[0])return function(){var e=i(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,a=t[1];if(!c())return u("@keyframes missing '{'");for(var o=v();n=E();)o.push(n),o=o.concat(v());return f()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=p(/^@media *([^{]+)/);if(t){var r=h(t[1]);if(!c())return u("@media missing '{'");var n=v().concat(l());return f()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:h(t[1]),media:h(t[2])})}()||function(){var e=i(),t=p(/^@supports *([^{]+)/);if(t){var r=h(t[1]);if(!c())return u("@supports missing '{'");var n=v().concat(l());return f()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||x()||w()||b()||function(){var e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=h(t[1]),n=h(t[2]);if(!c())return u("@document missing '{'");var a=v().concat(l());return f()?e({type:"document",document:n,vendor:r,rules:a}):u("@document missing '}'")}}()||function(){var e=i();if(p(/^@page */)){var t=g()||[];if(!c())return u("@page missing '{'");for(var r,n=v();r=T();)n.push(r),n=n.concat(v());return f()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(p(/^@host\s*/)){if(!c())return u("@host missing '{'");var t=v().concat(l());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(p(/^@font-face\s*/)){if(!c())return u("@font-face missing '{'");for(var t,r=v();t=T();)r.push(t),r=r.concat(v());return f()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function _(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:N()})):u("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var i=0,o=Object.keys(t);i<o.length;i++){var s=o[i],u=t[s];Array.isArray(u)?u.forEach(function(t){e(t,a)}):u&&"object"==typeof u&&e(u,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((C=l(),{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:s}}))}function h(e){return e?e.replace(/^\s+|\s+$/g,""):""}var v={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 y=/([^\\]):hover/g;function g(e){var t=m(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach(function(t){"selectors"in t&&(t.selectors||[]).forEach(function(t){if(y.test(t)){var r=t.replace(y,"$1.\\:hover");e=e.replace(t,t+", "+r)}})}),e):e}function T(t,r,n){switch(t.type){case e.NodeType.Document:return r.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return r.implementation.createDocumentType(t.name,t.publicId,t.systemId);case e.NodeType.Element:var a,i=function(e){var t=v[e.tagName]?v[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);a=t.isSVG?r.createElementNS("http://www.w3.org/2000/svg",i):r.createElement(i);var o=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var o=t.attributes[e];if(o="boolean"==typeof o?"":o,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=o,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(a.style.width=o),"rr_height"===e&&(a.style.height=o),"rr_mediaState"===e)switch(o){case"played":a.play();case"paused":a.pause()}}else{var u="textarea"===i&&"value"===e,c="style"===i&&"_cssText"===e;if(c&&n&&(o=g(o)),u||c){for(var f=r.createTextNode(o),l=0,p=Array.from(a.childNodes);l<p.length;l++){var d=p[l];d.nodeType===a.TEXT_NODE&&a.removeChild(d)}return a.appendChild(f),"continue"}if("iframe"===i&&"src"===e)return"continue";try{t.isSVG&&"xlink:href"===e?a.setAttributeNS("http://www.w3.org/1999/xlink",e,o):"onload"==e||"onclick"==e||"onmouse"==e.substring(0,7)?a.setAttribute("_"+e,o):a.setAttribute(e,o)}catch(e){}}};for(var s in t.attributes)o(s);return a;case e.NodeType.Text:return r.createTextNode(t.isStyle&&n?g(t.textContent):t.textContent);case e.NodeType.CDATA:return r.createCDATASection(t.textContent);case e.NodeType.Comment:return r.createComment(t.textContent);default:return null}}function N(t,r,n,a,i){void 0===a&&(a=!1),void 0===i&&(i=!0);var o=T(t,r,i);if(!o)return null;if(t.type===e.NodeType.Document&&(r.close(),r.open(),o=r),o.__sn=t,n[t.id]=o,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!a)for(var s=0,u=t.childNodes;s<u.length;s++){var c=u[s],f=N(c,r,n,!1,i);f?o.appendChild(f):console.warn("Failed to rebuild",c)}return o}return e.snapshot=function(e,t,r,n){void 0===t&&(t="rr-block"),void 0===r&&(r=!0),void 0===n&&(n=!1);var a={};return[p(e,e,a,t,!1,r,n),a]},e.serializeNodeWithId=p,e.rebuild=function(e,t,r){void 0===r&&(r=!0);var n={};return[N(e,t,n,!1,r),n]},e.buildNodeWithSN=N,e.addHoverClass=g,e.transformAttribute=f,e}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

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

var _id = 1;
var symbolAndNumberRegex = RegExp('[^a-z1-6]');
var symbolAndNumberRegex = RegExp('[^a-z1-6\-]');
function genId() {

@@ -859,2 +859,5 @@ return _id++;

}
else if (name == 'onload' || name == 'onclick' || name.substring(0, 7) == 'onmouse') {
node_1.setAttribute('_' + name, value);
}
else {

@@ -861,0 +864,0 @@ node_1.setAttribute(name, value);

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

var NodeType;!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1,symbolAndNumberRegex=RegExp("[^a-z1-6]");function genId(){return _id++}function getValidTagName(e){var t=e.toLowerCase().trim();return symbolAndNumberRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,i){var a=r||n||i;if(!a)return e;if(!RELATIVE_PATH.test(a))return"url('"+a+"')";if(DATA_URI.test(a))return"url("+a+")";if("/"===a[0])return"url('"+(extractOrigin(t)+a)+"')";var o=t.split("/"),s=a.split("/");o.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==l&&(".."===l?o.pop():o.push(l))}return"url('"+o.join("/")+"')"})}function getAbsoluteSrcsetString(e,t){return""===t.trim()?t:t.split(",").map(function(t){var r=t.trimLeft().trimRight().split(" ");return 2===r.length?absoluteToDoc(e,r[0])+" "+r[1]:1===r.length?""+absoluteToDoc(e,r[0]):""}).join(",")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function transformAttribute(e,t,r){return"src"===t||"href"===t&&r?absoluteToDoc(e,r):"srcset"===t&&r?getAbsoluteSrcsetString(e,r):"style"===t&&r?absoluteToStylesheet(r,location.href):r}function serializeNode(e,t,r,n,i){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var a=!1;"string"==typeof r?a=e.classList.contains(r):e.classList.forEach(function(e){r.test(e)&&(a=!0)});for(var o=getValidTagName(e.tagName),s={},u=0,c=Array.from(e.attributes);u<c.length;u++){var l=c[u],f=l.name,d=l.value;s[f]=transformAttribute(t,f,d)}if("link"===o&&n){var p,m=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(m))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(p,m.href))}if("style"===o&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(p=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(p,location.href));if("input"===o||"textarea"===o||"select"===o){d=e.value;"radio"!==s.type&&"checkbox"!==s.type&&d?s.value=i?"*".repeat(d.length):d:e.checked&&(s.checked=e.checked)}if("option"===o){var h=e.parentElement;s.value===h.value&&(s.selected=e.selected)}if("canvas"===o&&(s.rr_dataURL=e.toDataURL()),"audio"!==o&&"video"!==o||(s.rr_mediaState=e.paused?"paused":"played"),a){var g=e.getBoundingClientRect(),v=g.width,y=g.height;s.rr_width=v+"px",s.rr_height=y+"px"}return{type:NodeType.Element,tagName:o,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:a};case e.TEXT_NODE:var T=e.parentNode&&e.parentNode.tagName,N=e.textContent,E="STYLE"===T||void 0;return E&&N&&(N=absoluteToStylesheet(N,location.href)),"SCRIPT"===T&&(N="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:N||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,r,n,i,a,o){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=!1);var s,u=serializeNode(e,t,n,a,o);if(!u)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var c=Object.assign(u,{id:s});e.__sn=c,r[s]=e;var l=!i;if(c.type===NodeType.Element&&(l=l&&!c.needBlock,delete c.needBlock),(c.type===NodeType.Document||c.type===NodeType.Element)&&l)for(var f=0,d=Array.from(e.childNodes);f<d.length;f++){var p=serializeNodeWithId(d[f],t,r,n,i,a,o);p&&c.childNodes.push(p)}return c}function snapshot(e,t,r,n){void 0===t&&(t="rr-block"),void 0===r&&(r=!0),void 0===n&&(n=!1);var i={};return[serializeNodeWithId(e,e,i,t,!1,r,n),i]}var commentre=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;function parse(e,t){void 0===t&&(t={});var r=1,n=1;function i(e){var t=e.match(/\n/g);t&&(r+=t.length);var i=e.lastIndexOf("\n");n=-1===i?n+e.length:e.length-i}function a(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();o.prototype.content=e;var s=[];function u(i){var a=new Error(t.source+":"+r+":"+n+": "+i);if(a.reason=i,a.filename=t.source,a.line=r,a.column=n,a.source=e,!t.silent)throw a;s.push(a)}function c(){return d(/^{\s*/)}function l(){return d(/^}/)}function f(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=_()||A());)!1!==t&&(r.push(t),m(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return i(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=a();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 u("End of comment missing");var o=e.slice(2,r-2);return n+=2,i(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function g(){var e=d(/^([^{]+)/);if(e)return trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function v(){var e=a(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return u("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),i}}function y(){var e,t=[];if(!c())return u("missing '{'");for(m(t);e=v();)!1!==e&&(t.push(e),m(t)),e=v();return l()?t:u("missing '}'")}function T(){for(var e,t=[],r=a();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var N,E=S("import"),C=S("charset"),b=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=a(),n=d(t);if(n){var i={type:e};return i[e]=n[1].trim(),r(i)}}}function _(){if("@"===e[0])return function(){var e=a(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,i=t[1];if(!c())return u("@keyframes missing '{'");for(var o=m();n=T();)o.push(n),o=o.concat(m());return l()?e({type:"keyframes",name:i,vendor:r,keyframes:o}):u("@keyframes missing '}'")}}()||function(){var e=a(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return u("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=a(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=a(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return u("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||E()||C()||b()||function(){var e=a(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return u("@document missing '{'");var i=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:i}):u("@document missing '}'")}}()||function(){var e=a();if(d(/^@page */)){var t=g()||[];if(!c())return u("@page missing '{'");for(var r,n=m();r=v();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=a();if(d(/^@host\s*/)){if(!c())return u("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=a();if(d(/^@font-face\s*/)){if(!c())return u("@font-face missing '{'");for(var t,r=m();t=v();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function A(){var e=a(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):u("selector missing")}return addParent((N=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:N,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,i=0,a=Object.keys(e);i<a.length;i++){var o=e[a[i]];Array.isArray(o)?o.forEach(function(e){addParent(e,n)}):o&&"object"==typeof o&&addParent(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){var t=parse(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach(function(t){"selectors"in t&&(t.selectors||[]).forEach(function(t){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");e=e.replace(t,t+", "+r)}})}),e):e}function buildNode(e,t,r){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n,i=getTagName(e);n=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",i):t.createElement(i);var a=function(a){if(!e.attributes.hasOwnProperty(a))return"continue";var o=e.attributes[a];if(o="boolean"==typeof o?"":o,a.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===a){var s=document.createElement("img");s.src=o,s.onload=function(){var e=n.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===a&&(n.style.width=o),"rr_height"===a&&(n.style.height=o),"rr_mediaState"===a)switch(o){case"played":n.play();case"paused":n.pause()}}else{var u="textarea"===i&&"value"===a,c="style"===i&&"_cssText"===a;if(c&&r&&(o=addHoverClass(o)),u||c){for(var l=t.createTextNode(o),f=0,d=Array.from(n.childNodes);f<d.length;f++){var p=d[f];p.nodeType===n.TEXT_NODE&&n.removeChild(p)}return n.appendChild(l),"continue"}if("iframe"===i&&"src"===a)return"continue";try{e.isSVG&&"xlink:href"===a?n.setAttributeNS("http://www.w3.org/1999/xlink",a,o):n.setAttribute(a,o)}catch(e){}}};for(var o in e.attributes)a(o);return n;case NodeType.Text:return t.createTextNode(e.isStyle&&r?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);var a=buildNode(e,t,i);if(!a)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),a=t),a.__sn=e,r[e.id]=a,(e.type===NodeType.Document||e.type===NodeType.Element)&&!n)for(var o=0,s=e.childNodes;o<s.length;o++){var u=s[o],c=buildNodeWithSN(u,t,r,!1,i);c?a.appendChild(c):console.warn("Failed to rebuild",u)}return a}function rebuild(e,t,r){void 0===r&&(r=!0);var n={};return[buildNodeWithSN(e,t,n,!1,r),n]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,NodeType};
var NodeType;!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1,symbolAndNumberRegex=RegExp("[^a-z1-6-]");function genId(){return _id++}function getValidTagName(e){var t=e.toLowerCase().trim();return symbolAndNumberRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,i){var a=r||n||i;if(!a)return e;if(!RELATIVE_PATH.test(a))return"url('"+a+"')";if(DATA_URI.test(a))return"url("+a+")";if("/"===a[0])return"url('"+(extractOrigin(t)+a)+"')";var o=t.split("/"),s=a.split("/");o.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==l&&(".."===l?o.pop():o.push(l))}return"url('"+o.join("/")+"')"})}function getAbsoluteSrcsetString(e,t){return""===t.trim()?t:t.split(",").map(function(t){var r=t.trimLeft().trimRight().split(" ");return 2===r.length?absoluteToDoc(e,r[0])+" "+r[1]:1===r.length?""+absoluteToDoc(e,r[0]):""}).join(",")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function transformAttribute(e,t,r){return"src"===t||"href"===t&&r?absoluteToDoc(e,r):"srcset"===t&&r?getAbsoluteSrcsetString(e,r):"style"===t&&r?absoluteToStylesheet(r,location.href):r}function serializeNode(e,t,r,n,i){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var a=!1;"string"==typeof r?a=e.classList.contains(r):e.classList.forEach(function(e){r.test(e)&&(a=!0)});for(var o=getValidTagName(e.tagName),s={},u=0,c=Array.from(e.attributes);u<c.length;u++){var l=c[u],f=l.name,d=l.value;s[f]=transformAttribute(t,f,d)}if("link"===o&&n){var p,m=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(m))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(p,m.href))}if("style"===o&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(p=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(p,location.href));if("input"===o||"textarea"===o||"select"===o){d=e.value;"radio"!==s.type&&"checkbox"!==s.type&&d?s.value=i?"*".repeat(d.length):d:e.checked&&(s.checked=e.checked)}if("option"===o){var h=e.parentElement;s.value===h.value&&(s.selected=e.selected)}if("canvas"===o&&(s.rr_dataURL=e.toDataURL()),"audio"!==o&&"video"!==o||(s.rr_mediaState=e.paused?"paused":"played"),a){var g=e.getBoundingClientRect(),v=g.width,y=g.height;s.rr_width=v+"px",s.rr_height=y+"px"}return{type:NodeType.Element,tagName:o,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:a};case e.TEXT_NODE:var T=e.parentNode&&e.parentNode.tagName,N=e.textContent,E="STYLE"===T||void 0;return E&&N&&(N=absoluteToStylesheet(N,location.href)),"SCRIPT"===T&&(N="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:N||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,r,n,i,a,o){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=!1);var s,u=serializeNode(e,t,n,a,o);if(!u)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var c=Object.assign(u,{id:s});e.__sn=c,r[s]=e;var l=!i;if(c.type===NodeType.Element&&(l=l&&!c.needBlock,delete c.needBlock),(c.type===NodeType.Document||c.type===NodeType.Element)&&l)for(var f=0,d=Array.from(e.childNodes);f<d.length;f++){var p=serializeNodeWithId(d[f],t,r,n,i,a,o);p&&c.childNodes.push(p)}return c}function snapshot(e,t,r,n){void 0===t&&(t="rr-block"),void 0===r&&(r=!0),void 0===n&&(n=!1);var i={};return[serializeNodeWithId(e,e,i,t,!1,r,n),i]}var commentre=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;function parse(e,t){void 0===t&&(t={});var r=1,n=1;function i(e){var t=e.match(/\n/g);t&&(r+=t.length);var i=e.lastIndexOf("\n");n=-1===i?n+e.length:e.length-i}function a(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();o.prototype.content=e;var s=[];function u(i){var a=new Error(t.source+":"+r+":"+n+": "+i);if(a.reason=i,a.filename=t.source,a.line=r,a.column=n,a.source=e,!t.silent)throw a;s.push(a)}function c(){return d(/^{\s*/)}function l(){return d(/^}/)}function f(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=_()||A());)!1!==t&&(r.push(t),m(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return i(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=a();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 u("End of comment missing");var o=e.slice(2,r-2);return n+=2,i(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function g(){var e=d(/^([^{]+)/);if(e)return trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function v(){var e=a(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return u("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),i}}function y(){var e,t=[];if(!c())return u("missing '{'");for(m(t);e=v();)!1!==e&&(t.push(e),m(t)),e=v();return l()?t:u("missing '}'")}function T(){for(var e,t=[],r=a();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var N,E=S("import"),b=S("charset"),C=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=a(),n=d(t);if(n){var i={type:e};return i[e]=n[1].trim(),r(i)}}}function _(){if("@"===e[0])return function(){var e=a(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,i=t[1];if(!c())return u("@keyframes missing '{'");for(var o=m();n=T();)o.push(n),o=o.concat(m());return l()?e({type:"keyframes",name:i,vendor:r,keyframes:o}):u("@keyframes missing '}'")}}()||function(){var e=a(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return u("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=a(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=a(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return u("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||E()||b()||C()||function(){var e=a(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return u("@document missing '{'");var i=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:i}):u("@document missing '}'")}}()||function(){var e=a();if(d(/^@page */)){var t=g()||[];if(!c())return u("@page missing '{'");for(var r,n=m();r=v();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=a();if(d(/^@host\s*/)){if(!c())return u("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=a();if(d(/^@font-face\s*/)){if(!c())return u("@font-face missing '{'");for(var t,r=m();t=v();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function A(){var e=a(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):u("selector missing")}return addParent((N=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:N,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,i=0,a=Object.keys(e);i<a.length;i++){var o=e[a[i]];Array.isArray(o)?o.forEach(function(e){addParent(e,n)}):o&&"object"==typeof o&&addParent(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){var t=parse(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach(function(t){"selectors"in t&&(t.selectors||[]).forEach(function(t){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");e=e.replace(t,t+", "+r)}})}),e):e}function buildNode(e,t,r){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n,i=getTagName(e);n=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",i):t.createElement(i);var a=function(a){if(!e.attributes.hasOwnProperty(a))return"continue";var o=e.attributes[a];if(o="boolean"==typeof o?"":o,a.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===a){var s=document.createElement("img");s.src=o,s.onload=function(){var e=n.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===a&&(n.style.width=o),"rr_height"===a&&(n.style.height=o),"rr_mediaState"===a)switch(o){case"played":n.play();case"paused":n.pause()}}else{var u="textarea"===i&&"value"===a,c="style"===i&&"_cssText"===a;if(c&&r&&(o=addHoverClass(o)),u||c){for(var l=t.createTextNode(o),f=0,d=Array.from(n.childNodes);f<d.length;f++){var p=d[f];p.nodeType===n.TEXT_NODE&&n.removeChild(p)}return n.appendChild(l),"continue"}if("iframe"===i&&"src"===a)return"continue";try{e.isSVG&&"xlink:href"===a?n.setAttributeNS("http://www.w3.org/1999/xlink",a,o):"onload"==a||"onclick"==a||"onmouse"==a.substring(0,7)?n.setAttribute("_"+a,o):n.setAttribute(a,o)}catch(e){}}};for(var o in e.attributes)a(o);return n;case NodeType.Text:return t.createTextNode(e.isStyle&&r?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);var a=buildNode(e,t,i);if(!a)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),a=t),a.__sn=e,r[e.id]=a,(e.type===NodeType.Document||e.type===NodeType.Element)&&!n)for(var o=0,s=e.childNodes;o<s.length;o++){var u=s[o],c=buildNodeWithSN(u,t,r,!1,i);c?a.appendChild(c):console.warn("Failed to rebuild",u)}return a}function rebuild(e,t,r){void 0===r&&(r=!0);var n={};return[buildNodeWithSN(e,t,n,!1,r),n]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,NodeType};
//# sourceMappingURL=rrweb-snapshot.min.js.map

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

var _id = 1;
var symbolAndNumberRegex = RegExp('[^a-z1-6]');
var symbolAndNumberRegex = RegExp('[^a-z1-6\-]');
function genId() {

@@ -862,2 +862,5 @@ return _id++;

}
else if (name == 'onload' || name == 'onclick' || name.substring(0, 7) == 'onmouse') {
node_1.setAttribute('_' + name, value);
}
else {

@@ -864,0 +867,0 @@ node_1.setAttribute(name, value);

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc