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

@amplitude/rrweb-snapshot

Package Overview
Dependencies
Maintainers
21
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/rrweb-snapshot - npm Package Compare versions

Comparing version 2.0.0-alpha.23 to 2.0.0-alpha.24

2

dist/rrweb-snapshot.min.js

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

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

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

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc