@posthog/rrweb-snapshot 0.0.32 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,6 @@
1
- (function (g, f) {
2
- if ("object" == typeof exports && "object" == typeof module) {
3
- module.exports = f();
4
- } else if ("function" == typeof define && define.amd) {
5
- define("rrwebSnapshotRecord", [], f);
6
- } else if ("object" == typeof exports) {
7
- exports["rrwebSnapshotRecord"] = f();
8
- } else {
9
- g["rrwebSnapshotRecord"] = f();
10
- }
11
- }(this, () => {
12
- var exports = {};
13
- var module = { exports };
14
- "use strict";var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pe=Ce(y=>{"use strict";var xe=Object.defineProperty,Ee=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ee=(e,t,r)=>Ee(e,typeof t!="symbol"?t+"":t,r),_=(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))(_||{}),te={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},re={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},z={};function we(e){var t,r;let i=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(i&&globalThis[i])return globalThis[i]}function Y(e){if(z[e])return z[e];let t=we(e)||globalThis[e],r=t.prototype,i=e in te?te[e]:void 0,o=!!(i&&i.every(d=>{var s,f;return!!((f=(s=Object.getOwnPropertyDescriptor(r,d))==null?void 0:s.get)!=null&&f.toString().includes("[native code]"))})),a=e in re?re[e]:void 0,c=!!(a&&a.every(d=>{var s;return typeof r[d]=="function"&&((s=r[d])==null?void 0:s.toString().includes("[native code]"))}));if(o&&c)return z[e]=t.prototype,t.prototype;try{let d=document.createElement("iframe");document.body.appendChild(d);let s=d.contentWindow;if(!s)return t.prototype;let f=s[e].prototype;return document.body.removeChild(d),f?z[e]=f:r}catch(d){return r}}var G={};function R(e,t,r){var i;let o=`${e}.${String(r)}`;if(G[o])return G[o].call(t);let a=Y(e),c=(i=Object.getOwnPropertyDescriptor(a,r))==null?void 0:i.get;return c?(G[o]=c,c.call(t)):t[r]}var V={};function ne(e,t,r){let i=`${e}.${String(r)}`;if(V[i])return V[i].bind(t);let a=Y(e)[r];return typeof a!="function"?t[r]:(V[i]=a,a.bind(t))}function ve(e){return R("Node",e,"childNodes")}function Me(e){return R("Node",e,"parentNode")}function Te(e){return R("Node",e,"parentElement")}function _e(e){return R("Node",e,"textContent")}function Re(e,t){return ne("Node",e,"contains")(t)}function De(e){return ne("Node",e,"getRootNode")()}function ke(e){return!e||!("host"in e)?null:R("ShadowRoot",e,"host")}function Ae(e){return e.styleSheets}function Le(e){return!e||!("shadowRoot"in e)?null:R("Element",e,"shadowRoot")}function $e(e,t){return R("Element",e,"querySelector")(t)}function Oe(e,t){return R("Element",e,"querySelectorAll")(t)}function Pe(){return Y("MutationObserver").constructor}function Be(e,t,r){try{if(!(t in e))return()=>{};let i=e[t],o=r(i);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=o,()=>{e[t]=i}}catch(i){return()=>{}}}var q={childNodes:ve,parentNode:Me,parentElement:Te,textContent:_e,contains:Re,getRootNode:De,host:ke,styleSheets:Ae,shadowRoot:Le,querySelector:$e,querySelectorAll:Oe,mutationObserver:Pe,patch:Be};function We(e){return e.nodeType===e.ELEMENT_NODE}function ze(e){let t=e&&"host"in e&&"mode"in e&&q.host(e)||null;return!!(t&&"shadowRoot"in t&&q.shadowRoot(t)===e)}function Ue(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Fe(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ae(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function se(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let i=Array.from(t,o=>le(o,r)).join("");return Fe(i)}catch(t){return null}}function le(e,t){var r;if(ue(e)){let i;try{i=se(e.styleSheet)||ae(e)}catch(o){i=e.cssText}try{if(i&&((r=e.styleSheet)!=null&&r.href))return J(i,e.styleSheet.href)}catch(o){}return i}else{let i=e.cssText;return de(e)&&e.selectorText.includes(":")&&(i=ce(i)),t?J(i,t):i}}function ce(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ue(e){return"styleSheet"in e}function de(e){return"selectorText"in e}var U=class{constructor(){ee(this,"idNodeMap",new Map),ee(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;let i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){let i=this.getNode(t);if(i){let o=this.nodeMetaMap.get(i);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function He(){return new U}function Ze({element:e,maskInputOptions:t,tagName:r,type:i,value:o,maskInputFn:a}){let c=o||"",d=i&&K(i);return(t[r.toLowerCase()]||d&&t[d])&&(a?c=a(c,e):c="*".repeat(c.length)),c}function K(e){return e.toLowerCase()}var ie="__rrweb_original__";function je(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let i=0;i<e.width;i+=r)for(let o=0;o<e.height;o+=r){let a=t.getImageData,c=ie in a?a[ie]:a;if(new Uint32Array(c.call(t,i,o,Math.min(r,e.width-i),Math.min(r,e.height-o)).data.buffer).some(s=>s!==0))return!1}return!0}function Ge(e,t){return!e||!t||e.type!==t.type?!1:e.type===_.Document?e.compatMode===t.compatMode:e.type===_.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===_.Comment||e.type===_.Text||e.type===_.CDATA?e.textContent===t.textContent:e.type===_.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Ve(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?K(t):null}function qe(e,t){var a;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(c){return null}let i=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(i);return(a=o==null?void 0:o[1])!=null?a:null}function Je(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Ye=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ke=/^(?:[a-z+]+:)?\/\//i,Qe=/^www\..*/i,Xe=/^(data:)([^,]*),(.*)/i;function J(e,t){return(e||"").replace(Ye,(r,i,o,a,c,d)=>{let s=o||c||d,f=i||a||"";if(!s)return r;if(Ke.test(s)||Qe.test(s))return`url(${f}${s}${f})`;if(Xe.test(s))return`url(${f}${s}${f})`;if(s[0]==="/")return`url(${f}${Je(t)+s}${f})`;let S=t.split("/"),I=s.split("/");S.pop();for(let C of I)C!=="."&&(C===".."?S.pop():S.push(C));return`url(${f}${S.join("/")}${f})`})}var et="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",oe=4096;function tt(e,t,r,i){if(!e.complete||e.naturalWidth===0||e.naturalWidth>oe||e.naturalHeight>oe)return t;try{let o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;let a=o.getContext("2d");return a?(a.drawImage(e,0,0),o.toDataURL(r||"image/webp",i!=null?i:.4)):t}catch(o){return t}}function rt(e,t){return!t||e.length<=t?e:et}var fe=(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))(fe||{});y.Mirror=U;y.NodeType=fe;y.NodeType$1=_;y.absolutifyURLs=J;y.checkDataURLSize=rt;y.createMirror=He;y.escapeImportStatement=ae;y.extractFileExtension=qe;y.fixSafariColons=ce;y.getInputType=Ve;y.index=q;y.is2DCanvasBlank=je;y.isCSSImportRule=ue;y.isCSSStyleRule=de;y.isElement=We;y.isNativeShadowDom=Ue;y.isNodeMetaEqual=Ge;y.isShadowRoot=ze;y.maskInputValue=Ze;y.recompressBase64Image=tt;y.stringifyRule=le;y.stringifyStylesheet=se;y.toLowerCase=K});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=pe(),ye=1,it=new RegExp("[^a-z0-9-_:]"),Q=-2;function Se(){return ye++}function ot(e){if(e instanceof HTMLFormElement)return"form";let t=n.toLowerCase(e.tagName);return it.test(t)?"div":t}var $,me,nt=/^[^ \t\n\r\u000c]+/,at=/^[, \t\n\r\u000c]+/;function st(e,t){if(t.trim()==="")return t;let r=0;function i(a){let c,d=a.exec(t.substring(r));return d?(c=d[0],r+=c.length,c):""}let o=[];for(;i(at),!(r>=t.length);){let a=i(nt);if(a.slice(-1)===",")a=O(e,a.substring(0,a.length-1)),o.push(a);else{let c="";a=O(e,a);let d=!1;for(;;){let s=t.charAt(r);if(s===""){o.push((a+c).trim());break}else if(d)s===")"&&(d=!1);else if(s===","){r+=1,o.push((a+c).trim());break}else s==="("&&(d=!0);c+=s,r+=1}}}return o.join(", ")}var he=new WeakMap;function O(e,t){return!t||t.trim()===""?t:X(e,t)}function lt(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function X(e,t){let r=he.get(e);if(r||(r=e.createElement("a"),he.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ne(e,t,r,i,o,a){if(!i)return i;if(r==="src"||r==="href"&&!(t==="use"&&i[0]==="#")){let c=O(e,i);if(t==="img"&&c.startsWith("data:")&&o){let d=o,s=c;return(a!=null&&a.type||(a==null?void 0:a.quality)!==void 0)&&(s=n.recompressBase64Image(d,c,a.type,a.quality)),a!=null&&a.maxBase64ImageLength&&(s=n.checkDataURLSize(s,a.maxBase64ImageLength)),s}return c}else{if(r==="xlink:href"&&i[0]!=="#")return O(e,i);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return O(e,i);if(r==="srcset")return st(e,i);if(r==="style")return n.absolutifyURLs(i,X(e));if(t==="object"&&r==="data")return O(e,i)}return i}function be(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function ct(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}if(r)return e.matches(r)}catch(i){}return!1}function F(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?F(n.index.parentNode(e),t,r):!1;for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}return r?F(n.index.parentNode(e),t,r):!1}function Ie(e,t,r,i){let o;if(n.isElement(e)){if(o=e,!n.index.childNodes(o).length)return!1}else{if(n.index.parentElement(e)===null)return!1;o=n.index.parentElement(e)}try{if(typeof t=="string"){if(i){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(F(o,t,i))return!0;if(r){if(i){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch(a){}return!1}function ut(e,t,r){let i=e.contentWindow;if(!i)return;let o=!1,a;try{a=i.document.readyState}catch(d){return}if(a!=="complete"){let d=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(d),o=!0,t()});return}let c="about:blank";if(i.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function dt(e,t,r){let i=!1,o;try{o=e.sheet}catch(c){return}if(o)return;let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()})}function ft(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:c,inlineStylesheet:d,maskInputOptions:s={},maskTextFn:f,maskInputFn:S,dataURLOptions:I={},inlineImages:C,recordCanvas:N,keepIframeSrcFn:w,newlyAddedElement:m=!1}=t,u=pt(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:n.NodeType$1.Document,childNodes:[],compatMode:e.compatMode}:{type:n.NodeType$1.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:n.NodeType$1.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:u};case e.ELEMENT_NODE:return gt(e,{doc:r,blockClass:o,blockSelector:a,inlineStylesheet:d,maskInputOptions:s,maskInputFn:S,dataURLOptions:I,inlineImages:C,recordCanvas:N,keepIframeSrcFn:w,newlyAddedElement:m,rootId:u});case e.TEXT_NODE:return mt(e,{doc:r,needsMask:c,maskTextFn:f,rootId:u});case e.CDATA_SECTION_NODE:return{type:n.NodeType$1.CDATA,textContent:"",rootId:u};case e.COMMENT_NODE:return{type:n.NodeType$1.Comment,textContent:n.index.textContent(e)||"",rootId:u};default:return!1}}function pt(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function mt(e,t){var r;let{needsMask:i,maskTextFn:o,rootId:a}=t,c=n.index.parentNode(e),d=c&&c.tagName,s=n.index.textContent(e),f=d==="STYLE"?!0:void 0,S=d==="SCRIPT"?!0:void 0;if(f&&s){try{e.nextSibling||e.previousSibling||(r=c.sheet)!=null&&r.cssRules&&(s=n.stringifyStylesheet(c.sheet))}catch(I){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${I}`,e)}s=n.absolutifyURLs(s,X(t.doc))}return S&&(s="SCRIPT_PLACEHOLDER"),!f&&!S&&s&&i&&(s=o?o(s,n.index.parentElement(e)):s.replace(/[\S]/g,"*")),{type:n.NodeType$1.Text,textContent:s||"",isStyle:f,rootId:a}}function ge(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function ht(e){return e.href}function gt(e,t){let{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:d,dataURLOptions:s={},inlineImages:f,recordCanvas:S,keepIframeSrcFn:I,newlyAddedElement:C=!1,rootId:N}=t,w=ct(e,i,o),m=ot(e),u={},M=e.attributes.length;for(let l=0;l<M;l++){let p=e.attributes[l];be(m,p.name,p.value)||(u[p.name]=Ne(r,m,n.toLowerCase(p.name),p.value,e,s))}if(m==="link"&&a){let l=ht(e);if(l){let p=ge(r,l);if(!p&&l.includes(".css")){let x=window.location.origin,D=l.replace(window.location.href,""),T=x+"/"+D;p=ge(r,T)}let b=null;p&&(b=n.stringifyStylesheet(p)),b&&(delete u.rel,delete u.href,u._cssText=b)}}if(m==="style"&&e.sheet&&!(e.innerText||n.index.textContent(e)||"").trim().length){let l=n.stringifyStylesheet(e.sheet);l&&(u._cssText=l)}if(m==="input"||m==="textarea"||m==="select"){let l=e.value,p=e.checked;u.type!=="radio"&&u.type!=="checkbox"&&u.type!=="submit"&&u.type!=="button"&&l?u.value=n.maskInputValue({element:e,type:n.getInputType(e),tagName:m,value:l,maskInputOptions:c,maskInputFn:d}):p&&(u.checked=p)}if(m==="option"&&(e.selected&&!c.select?u.selected=!0:delete u.selected),m==="dialog"&&e.open)try{u.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(l){u.rr_open_mode="modal",u.ph_rr_could_not_detect_modal=!0}if(m==="canvas"&&S){if(e.__context==="2d")n.is2DCanvasBlank(e)||(u.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){let l=e.toDataURL(s.type,s.quality),p=r.createElement("canvas");p.width=e.width,p.height=e.height;let b=p.toDataURL(s.type,s.quality);l!==b&&(u.rr_dataURL=l)}}if(m==="img"&&f){$||($=r.createElement("canvas"),me=$.getContext("2d"));let l=e,p=l.currentSrc||l.getAttribute("src")||"<unknown-src>",b=l.crossOrigin,x=()=>{l.removeEventListener("load",x);try{$.width=l.naturalWidth,$.height=l.naturalHeight,me.drawImage(l,0,0),u.rr_dataURL=$.toDataURL(s.type,s.quality)}catch(D){if(l.crossOrigin!=="anonymous"){l.crossOrigin="anonymous",l.complete&&l.naturalWidth!==0?x():l.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${p}! Error: ${D}`)}l.crossOrigin==="anonymous"&&(b?u.crossOrigin=b:l.removeAttribute("crossorigin"))};l.complete&&l.naturalWidth!==0?x():l.addEventListener("load",x)}if(m==="audio"||m==="video"){let l=u;l.rr_mediaState=e.paused?"paused":"played",l.rr_mediaCurrentTime=e.currentTime,l.rr_mediaPlaybackRate=e.playbackRate,l.rr_mediaMuted=e.muted,l.rr_mediaLoop=e.loop,l.rr_mediaVolume=e.volume}if(C||(e.scrollLeft&&(u.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(u.rr_scrollTop=e.scrollTop)),w){let{width:l,height:p}=e.getBoundingClientRect();u={class:u.class,rr_width:`${l}px`,rr_height:`${p}px`}}m==="iframe"&&!I(u.src)&&(e.contentDocument||(u.rr_src=u.src),delete u.src);let v;try{customElements.get(m)&&(v=!0)}catch(l){}return{type:n.NodeType$1.Element,tagName:m,attributes:u,childNodes:[],isSVG:lt(e)||void 0,needBlock:w,rootId:N,isCustom:v}}function h(e){return e==null?"":e.toLowerCase()}function yt(e,t){if(t.comment&&e.type===n.NodeType$1.Comment)return!0;if(e.type===n.NodeType$1.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&n.extractFileExtension(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(h(e.attributes.name).match(/^msapplication-tile(image|color)$/)||h(e.attributes.name)==="application-name"||h(e.attributes.rel)==="icon"||h(e.attributes.rel)==="apple-touch-icon"||h(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&h(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(h(e.attributes.property).match(/^(og|twitter|fb):/)||h(e.attributes.name).match(/^(og|twitter):/)||h(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(h(e.attributes.name)==="robots"||h(e.attributes.name)==="googlebot"||h(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(h(e.attributes.name)==="author"||h(e.attributes.name)==="generator"||h(e.attributes.name)==="framework"||h(e.attributes.name)==="publisher"||h(e.attributes.name)==="progid"||h(e.attributes.property).match(/^article:/)||h(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(h(e.attributes.name)==="google-site-verification"||h(e.attributes.name)==="yandex-verification"||h(e.attributes.name)==="csrf-token"||h(e.attributes.name)==="p:domain_verify"||h(e.attributes.name)==="verify-v1"||h(e.attributes.name)==="verification"||h(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function P(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:a,maskTextClass:c,maskTextSelector:d,skipChild:s=!1,inlineStylesheet:f=!0,maskInputOptions:S={},maskTextFn:I,maskInputFn:C,slimDOMOptions:N,dataURLOptions:w={},inlineImages:m=!1,recordCanvas:u=!1,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:l=5e3,onStylesheetLoad:p,stylesheetLoadTimeout:b=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:D=!1}=t,{needsMask:T}=t,{preserveWhiteSpace:B=!0}=t;T||(T=Ie(e,c,d,T===void 0));let k=ft(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:T,inlineStylesheet:f,maskInputOptions:S,maskTextFn:I,maskInputFn:C,dataURLOptions:w,inlineImages:m,recordCanvas:u,keepIframeSrcFn:x,newlyAddedElement:D});if(!k)return console.warn(e,"not serialized"),null;let W;i.hasNode(e)?W=i.getId(e):yt(k,N)||!B&&k.type===n.NodeType$1.Text&&!k.isStyle&&!k.textContent.replace(/^\s+|\s+$/gm,"").length?W=Q:W=Se();let g=Object.assign(k,{id:W});if(i.add(e,g),W===Q)return null;M&&M(e);let H=!s;if(g.type===n.NodeType$1.Element){H=H&&!g.needBlock,delete g.needBlock;let E=n.index.shadowRoot(e);E&&n.isNativeShadowDom(E)&&(g.isShadowHost=!0)}if((g.type===n.NodeType$1.Document||g.type===n.NodeType$1.Element)&&H){N.headWhitespace&&g.type===n.NodeType$1.Element&&g.tagName==="head"&&(B=!1);let E={doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:c,maskTextSelector:d,skipChild:s,inlineStylesheet:f,maskInputOptions:S,maskTextFn:I,maskInputFn:C,slimDOMOptions:N,dataURLOptions:w,inlineImages:m,recordCanvas:u,preserveWhiteSpace:B,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:l,onStylesheetLoad:p,stylesheetLoadTimeout:b,keepIframeSrcFn:x};if(!(g.type===n.NodeType$1.Element&&g.tagName==="textarea"&&g.attributes.value!==void 0))for(let j of Array.from(n.index.childNodes(e))){let L=P(j,E);L&&g.childNodes.push(L)}let A=null;if(n.isElement(e)&&(A=n.index.shadowRoot(e)))for(let j of Array.from(n.index.childNodes(A))){let L=P(j,E);L&&(n.isNativeShadowDom(A)&&(L.isShadow=!0),g.childNodes.push(L))}}let Z=n.index.parentNode(e);return Z&&n.isShadowRoot(Z)&&n.isNativeShadowDom(Z)&&(g.isShadow=!0),g.type===n.NodeType$1.Element&&g.tagName==="iframe"&&ut(e,()=>{let E=e.contentDocument;if(E&&v){let A=P(E,{doc:E,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:S,maskTextFn:I,maskInputFn:C,slimDOMOptions:N,dataURLOptions:w,inlineImages:m,recordCanvas:u,preserveWhiteSpace:B,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:l,onStylesheetLoad:p,stylesheetLoadTimeout:b,keepIframeSrcFn:x});A&&v(e,A)}},l),g.type===n.NodeType$1.Element&&g.tagName==="link"&&typeof g.attributes.rel=="string"&&(g.attributes.rel==="stylesheet"||g.attributes.rel==="preload"&&typeof g.attributes.href=="string"&&n.extractFileExtension(g.attributes.href)==="css")&&dt(e,()=>{if(p){let E=P(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:S,maskTextFn:I,maskInputFn:C,slimDOMOptions:N,dataURLOptions:w,inlineImages:m,recordCanvas:u,preserveWhiteSpace:B,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:l,onStylesheetLoad:p,stylesheetLoadTimeout:b,keepIframeSrcFn:x});E&&p(e,E)}},b),g}function St(e,t){let{mirror:r=new n.Mirror,blockClass:i="rr-block",blockSelector:o=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:s=!1,recordCanvas:f=!1,maskAllInputs:S=!1,maskTextFn:I,maskInputFn:C,slimDOM:N=!1,dataURLOptions:w,preserveWhiteSpace:m,onSerialize:u,onIframeLoad:M,iframeLoadTimeout:v,onStylesheetLoad:l,stylesheetLoadTimeout:p,keepIframeSrcFn:b=()=>!1}=t||{};return P(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:S===!0?{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}:S===!1?{password:!0}:S,maskTextFn:I,maskInputFn:C,slimDOMOptions:N===!0||N==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:N==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:N===!1?{}:N,dataURLOptions:w,inlineImages:s,recordCanvas:f,preserveWhiteSpace:m,onSerialize:u,onIframeLoad:M,iframeLoadTimeout:v,onStylesheetLoad:l,stylesheetLoadTimeout:p,keepIframeSrcFn:b,newlyAddedElement:!1})}function Nt(e,t){function r(i){t(i),(i.type===n.NodeType$1.Document||i.type===n.NodeType$1.Element)&&i.childNodes.forEach(r)}r(e)}function bt(){ye=1}exports.Mirror=n.Mirror;exports.NodeType=n.NodeType;exports.absolutifyURLs=n.absolutifyURLs;exports.checkDataURLSize=n.checkDataURLSize;exports.createMirror=n.createMirror;exports.escapeImportStatement=n.escapeImportStatement;exports.extractFileExtension=n.extractFileExtension;exports.fixSafariColons=n.fixSafariColons;exports.getInputType=n.getInputType;exports.is2DCanvasBlank=n.is2DCanvasBlank;exports.isCSSImportRule=n.isCSSImportRule;exports.isCSSStyleRule=n.isCSSStyleRule;exports.isElement=n.isElement;exports.isNativeShadowDom=n.isNativeShadowDom;exports.isNodeMetaEqual=n.isNodeMetaEqual;exports.isShadowRoot=n.isShadowRoot;exports.maskInputValue=n.maskInputValue;exports.recompressBase64Image=n.recompressBase64Image;exports.stringifyRule=n.stringifyRule;exports.stringifyStylesheet=n.stringifyStylesheet;exports.toLowerCase=n.toLowerCase;exports.IGNORED_NODE=Q;exports.classMatchesRegex=F;exports.cleanupSnapshot=bt;exports.genId=Se;exports.ignoreAttribute=be;exports.needMaskingText=Ie;exports.serializeNodeWithId=P;exports.snapshot=St;exports.transformAttribute=Ne;exports.visitSnapshot=Nt;
15
- if (typeof module.exports == "object" && typeof exports == "object") {
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebSnapshotRecord", [], f);} else if ("object" == typeof exports) {exports["rrwebSnapshotRecord"] = f();} else {g["rrwebSnapshotRecord"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
2
+ "use strict";var xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pe=xe(S=>{"use strict";var Ce=Object.defineProperty,Ee=(e,t,r)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ee=(e,t,r)=>Ee(e,typeof t!="symbol"?t+"":t,r),k=(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))(k||{}),te={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},re={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},z={};function we(e){var t,r;let i=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(i&&globalThis[i])return globalThis[i]}function J(e){if(z[e])return z[e];let t=we(e)||globalThis[e],r=t.prototype,i=e in te?te[e]:void 0,o=!!(i&&i.every(u=>{var l,f;return!!((f=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&f.toString().includes("[native code]"))})),a=e in re?re[e]:void 0,c=!!(a&&a.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(o&&c)return z[e]=t.prototype,t.prototype;try{let u=document.createElement("iframe");document.body.appendChild(u);let l=u.contentWindow;if(!l)return t.prototype;let f=l[e].prototype;return document.body.removeChild(u),f?z[e]=f:r}catch(u){return r}}var V={};function A(e,t,r){var i;let o=`${e}.${String(r)}`;if(V[o])return V[o].call(t);let a=J(e),c=(i=Object.getOwnPropertyDescriptor(a,r))==null?void 0:i.get;return c?(V[o]=c,c.call(t)):t[r]}var G={};function ne(e,t,r){let i=`${e}.${String(r)}`;if(G[i])return G[i].bind(t);let a=J(e)[r];return typeof a!="function"?t[r]:(G[i]=a,a.bind(t))}function ve(e){return A("Node",e,"childNodes")}function Me(e){return A("Node",e,"parentNode")}function _e(e){return A("Node",e,"parentElement")}function Te(e){return A("Node",e,"textContent")}function Re(e,t){return ne("Node",e,"contains")(t)}function De(e){return ne("Node",e,"getRootNode")()}function ke(e){return!e||!("host"in e)?null:A("ShadowRoot",e,"host")}function Ae(e){return e.styleSheets}function Le(e){return!e||!("shadowRoot"in e)?null:A("Element",e,"shadowRoot")}function $e(e,t){return A("Element",e,"querySelector")(t)}function Oe(e,t){return A("Element",e,"querySelectorAll")(t)}function Pe(){return J("MutationObserver").constructor}function Be(e,t,r){try{if(!(t in e))return()=>{};let i=e[t],o=r(i);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=o,()=>{e[t]=i}}catch(i){return()=>{}}}var q={childNodes:ve,parentNode:Me,parentElement:_e,textContent:Te,contains:Re,getRootNode:De,host:ke,styleSheets:Ae,shadowRoot:Le,querySelector:$e,querySelectorAll:Oe,mutationObserver:Pe,patch:Be};function We(e){return e.nodeType===e.ELEMENT_NODE}function ze(e){let t=e&&"host"in e&&"mode"in e&&q.host(e)||null;return!!(t&&"shadowRoot"in t&&q.shadowRoot(t)===e)}function Ue(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Fe(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ae(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function se(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let i=Array.from(t,o=>le(o,r)).join("");return Fe(i)}catch(t){return null}}function le(e,t){var r;if(ue(e)){let i;try{i=se(e.styleSheet)||ae(e)}catch(o){i=e.cssText}try{if(i&&((r=e.styleSheet)!=null&&r.href))return Y(i,e.styleSheet.href)}catch(o){}return i}else{let i=e.cssText;return de(e)&&e.selectorText.includes(":")&&(i=ce(i)),t?Y(i,t):i}}function ce(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ue(e){return"styleSheet"in e}function de(e){return"selectorText"in e}var U=class{constructor(){ee(this,"idNodeMap",new Map),ee(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;let i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){let i=this.getNode(t);if(i){let o=this.nodeMetaMap.get(i);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function He(){return new U}function Ze({element:e,maskInputOptions:t,tagName:r,type:i,value:o,maskInputFn:a}){let c=o||"",u=i&&K(i);return(t[r.toLowerCase()]||u&&t[u])&&(a?c=a(c,e):c="*".repeat(c.length)),c}function K(e){return e.toLowerCase()}var ie="__rrweb_original__";function je(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let i=0;i<e.width;i+=r)for(let o=0;o<e.height;o+=r){let a=t.getImageData,c=ie in a?a[ie]:a;if(new Uint32Array(c.call(t,i,o,Math.min(r,e.width-i),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function Ve(e,t){return!e||!t||e.type!==t.type?!1:e.type===k.Document?e.compatMode===t.compatMode:e.type===k.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===k.Comment||e.type===k.Text||e.type===k.CDATA?e.textContent===t.textContent:e.type===k.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Ge(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?K(t):null}function qe(e,t){var a;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(c){return null}let i=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(i);return(a=o==null?void 0:o[1])!=null?a:null}function Ye(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Je=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ke=/^(?:[a-z+]+:)?\/\//i,Xe=/^www\..*/i,Qe=/^(data:)([^,]*),(.*)/i;function Y(e,t){return(e||"").replace(Je,(r,i,o,a,c,u)=>{let l=o||c||u,f=i||a||"";if(!l)return r;if(Ke.test(l)||Xe.test(l))return`url(${f}${l}${f})`;if(Qe.test(l))return`url(${f}${l}${f})`;if(l[0]==="/")return`url(${f}${Ye(t)+l}${f})`;let p=t.split("/"),x=l.split("/");p.pop();for(let C of x)C!=="."&&(C===".."?p.pop():p.push(C));return`url(${f}${p.join("/")}${f})`})}var et="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",oe=4096;function tt(e,t,r,i){if(!e.complete||e.naturalWidth===0||e.naturalWidth>oe||e.naturalHeight>oe)return t;try{let o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;let a=o.getContext("2d");return a?(a.drawImage(e,0,0),o.toDataURL(r||"image/webp",i!=null?i:.4)):t}catch(o){return t}}function rt(e,t){return!t||e.length<=t?e:et}var fe=(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))(fe||{});S.Mirror=U;S.NodeType=fe;S.NodeType$1=k;S.absolutifyURLs=Y;S.checkDataURLSize=rt;S.createMirror=He;S.escapeImportStatement=ae;S.extractFileExtension=qe;S.fixSafariColons=ce;S.getInputType=Ge;S.index=q;S.is2DCanvasBlank=je;S.isCSSImportRule=ue;S.isCSSStyleRule=de;S.isElement=We;S.isNativeShadowDom=Ue;S.isNodeMetaEqual=Ve;S.isShadowRoot=ze;S.maskInputValue=Ze;S.recompressBase64Image=tt;S.stringifyRule=le;S.stringifyStylesheet=se;S.toLowerCase=K});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=pe(),ye=1,it=new RegExp("[^a-z0-9-_:]"),X=-2;function Se(){return ye++}function ot(e){if(e instanceof HTMLFormElement)return"form";let t=n.toLowerCase(e.tagName);return it.test(t)?"div":t}var O,he,nt=/^[^ \t\n\r\u000c]+/,at=/^[, \t\n\r\u000c]+/;function st(e,t){if(t.trim()==="")return t;let r=0;function i(a){let c,u=a.exec(t.substring(r));return u?(c=u[0],r+=c.length,c):""}let o=[];for(;i(at),!(r>=t.length);){let a=i(nt);if(a.slice(-1)===",")a=P(e,a.substring(0,a.length-1)),o.push(a);else{let c="";a=P(e,a);let u=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((a+c).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,o.push((a+c).trim());break}else l==="("&&(u=!0);c+=l,r+=1}}}return o.join(", ")}var me=new WeakMap;function P(e,t){return!t||t.trim()===""?t:Q(e,t)}function lt(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Q(e,t){let r=me.get(e);if(r||(r=e.createElement("a"),me.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ne(e,t,r,i,o,a){if(!i)return i;if(r==="src"||r==="href"&&!(t==="use"&&i[0]==="#")){let c=P(e,i);if(t==="img"&&c.startsWith("data:")&&o){let u=o,l=c;return(a!=null&&a.type||(a==null?void 0:a.quality)!==void 0)&&(l=n.recompressBase64Image(u,c,a.type,a.quality)),a!=null&&a.maxBase64ImageLength&&(l=n.checkDataURLSize(l,a.maxBase64ImageLength)),l}return c}else{if(r==="xlink:href"&&i[0]!=="#")return P(e,i);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return P(e,i);if(r==="srcset")return st(e,i);if(r==="style")return n.absolutifyURLs(i,Q(e));if(t==="object"&&r==="data")return P(e,i)}return i}function be(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function ct(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}if(r)return e.matches(r)}catch(i){}return!1}function F(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?F(n.index.parentNode(e),t,r):!1;for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}return r?F(n.index.parentNode(e),t,r):!1}function Ie(e,t,r,i){let o;if(n.isElement(e)){if(o=e,!n.index.childNodes(o).length)return!1}else{if(n.index.parentElement(e)===null)return!1;o=n.index.parentElement(e)}try{if(typeof t=="string"){if(i){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(F(o,t,i))return!0;if(r){if(i){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch(a){}return!1}function ut(e,t,r){let i=e.contentWindow;if(!i)return;let o=!1,a;try{a=i.document.readyState}catch(u){return}if(a!=="complete"){let u=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),o=!0,t()});return}let c="about:blank";if(i.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function dt(e,t,r){let i=!1,o;try{o=e.sheet}catch(c){return}if(o)return;let a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()})}function ft(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:c,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:f,maskInputFn:p,dataURLOptions:x={},inlineImages:C,recordCanvas:b,keepIframeSrcFn:v,newlyAddedElement:M=!1}=t,I=pt(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:n.NodeType$1.Document,childNodes:[],compatMode:e.compatMode}:{type:n.NodeType$1.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:n.NodeType$1.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return gt(e,{doc:r,blockClass:o,blockSelector:a,inlineStylesheet:u,maskInputOptions:l,maskInputFn:p,dataURLOptions:x,inlineImages:C,recordCanvas:b,keepIframeSrcFn:v,newlyAddedElement:M,rootId:I});case e.TEXT_NODE:return ht(e,{doc:r,needsMask:c,maskTextFn:f,rootId:I});case e.CDATA_SECTION_NODE:return{type:n.NodeType$1.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:n.NodeType$1.Comment,textContent:n.index.textContent(e)||"",rootId:I};default:return!1}}function pt(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function ht(e,t){var r;let{needsMask:i,maskTextFn:o,rootId:a}=t,c=n.index.parentNode(e),u=c&&c.tagName,l=n.index.textContent(e),f=u==="STYLE"?!0:void 0,p=u==="SCRIPT"?!0:void 0;if(f&&l){try{e.nextSibling||e.previousSibling||(r=c.sheet)!=null&&r.cssRules&&(l=n.stringifyStylesheet(c.sheet))}catch(x){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${x}`,e)}l=n.absolutifyURLs(l,Q(t.doc))}return p&&(l="SCRIPT_PLACEHOLDER"),!f&&!p&&l&&i&&(l=o?o(l,n.index.parentElement(e)):l.replace(/[\S]/g,"*")),{type:n.NodeType$1.Text,textContent:l||"",isStyle:f,rootId:a}}function ge(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function mt(e){return e.href}function gt(e,t){var r,i;let{doc:o,blockClass:a,blockSelector:c,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:f,dataURLOptions:p={},inlineImages:x,recordCanvas:C,keepIframeSrcFn:b,newlyAddedElement:v=!1,rootId:M}=t,I=ct(e,a,c),g=ot(e),d={},R=e.attributes.length;for(let s=0;s<R;s++){let h=e.attributes[s];be(g,h.name,h.value)||(d[h.name]=Ne(o,g,n.toLowerCase(h.name),h.value,e,p))}if(g==="link"&&u){let s=mt(e);if(s){let h=ge(o,s);if(!h&&s.includes(".css")){let N=window.location.origin,T=s.replace(window.location.href,""),D=N+"/"+T;h=ge(o,D)}let E=null;h&&(E=n.stringifyStylesheet(h)),E&&(delete d.rel,delete d.href,d._cssText=E)}}if(g==="style"&&e.sheet&&!(e.innerText||n.index.textContent(e)||"").trim().length){let s=n.stringifyStylesheet(e.sheet);s&&(d._cssText=s)}if(g==="input"||g==="textarea"||g==="select"){let s=e.value,h=e.checked;d.type!=="radio"&&d.type!=="checkbox"&&d.type!=="submit"&&d.type!=="button"&&s?d.value=n.maskInputValue({element:e,type:n.getInputType(e),tagName:g,value:s,maskInputOptions:l,maskInputFn:f}):h&&(d.checked=h)}if(g==="option"&&(e.selected&&!l.select?d.selected=!0:delete d.selected),g==="dialog"&&e.open)try{d.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(s){d.rr_open_mode="modal",d.ph_rr_could_not_detect_modal=!0}if(g==="canvas"&&C){if(e.__context==="2d")n.is2DCanvasBlank(e)||(d.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){let s=e.toDataURL(p.type,p.quality),h=o.createElement("canvas");h.width=e.width,h.height=e.height;let E=h.toDataURL(p.type,p.quality);s!==E&&(d.rr_dataURL=s)}}if(g==="img"&&x){O||(O=o.createElement("canvas"),he=O.getContext("2d"));let s=e,h=s.currentSrc||s.getAttribute("src")||"<unknown-src>",E=s.crossOrigin,N=()=>{s.removeEventListener("load",N);try{O.width=s.naturalWidth,O.height=s.naturalHeight,he.drawImage(s,0,0),d.rr_dataURL=O.toDataURL(p.type,p.quality)}catch(T){if(s.crossOrigin!=="anonymous"){s.crossOrigin="anonymous",s.complete&&s.naturalWidth!==0?N():s.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${h}! Error: ${T}`)}s.crossOrigin==="anonymous"&&(E?d.crossOrigin=E:s.removeAttribute("crossorigin"))};s.complete&&s.naturalWidth!==0?N():s.addEventListener("load",N)}if(g==="audio"||g==="video"){let s=d;s.rr_mediaState=e.paused?"paused":"played",s.rr_mediaCurrentTime=e.currentTime,s.rr_mediaPlaybackRate=e.playbackRate,s.rr_mediaMuted=e.muted,s.rr_mediaLoop=e.loop,s.rr_mediaVolume=e.volume}if(v||(e.scrollLeft&&(d.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(d.rr_scrollTop=e.scrollTop)),I){let{width:s,height:h,left:E,top:N}=e.getBoundingClientRect();d={class:d.class,rr_width:`${s}px`,rr_height:`${h}px`,rr_left:`${Math.floor(E+(((r=o.defaultView)==null?void 0:r.scrollX)||0))}px`,rr_top:`${Math.floor(N+(((i=o.defaultView)==null?void 0:i.scrollY)||0))}px`}}g==="iframe"&&!b(d.src)&&(e.contentDocument||(d.rr_src=d.src),delete d.src);let _;try{customElements.get(g)&&(_=!0)}catch(s){}return{type:n.NodeType$1.Element,tagName:g,attributes:d,childNodes:[],isSVG:lt(e)||void 0,needBlock:I,rootId:M,isCustom:_}}function m(e){return e==null?"":e.toLowerCase()}function yt(e,t){if(t.comment&&e.type===n.NodeType$1.Comment)return!0;if(e.type===n.NodeType$1.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&n.extractFileExtension(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(m(e.attributes.name).match(/^msapplication-tile(image|color)$/)||m(e.attributes.name)==="application-name"||m(e.attributes.rel)==="icon"||m(e.attributes.rel)==="apple-touch-icon"||m(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&m(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(m(e.attributes.property).match(/^(og|twitter|fb):/)||m(e.attributes.name).match(/^(og|twitter):/)||m(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(m(e.attributes.name)==="robots"||m(e.attributes.name)==="googlebot"||m(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(m(e.attributes.name)==="author"||m(e.attributes.name)==="generator"||m(e.attributes.name)==="framework"||m(e.attributes.name)==="publisher"||m(e.attributes.name)==="progid"||m(e.attributes.property).match(/^article:/)||m(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(m(e.attributes.name)==="google-site-verification"||m(e.attributes.name)==="yandex-verification"||m(e.attributes.name)==="csrf-token"||m(e.attributes.name)==="p:domain_verify"||m(e.attributes.name)==="verify-v1"||m(e.attributes.name)==="verification"||m(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function B(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:a,maskTextClass:c,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:f=!0,maskInputOptions:p={},maskTextFn:x,maskInputFn:C,slimDOMOptions:b,dataURLOptions:v={},inlineImages:M=!1,recordCanvas:I=!1,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R=5e3,onStylesheetLoad:_,stylesheetLoadTimeout:s=5e3,keepIframeSrcFn:h=()=>!1,newlyAddedElement:E=!1}=t,{needsMask:N}=t,{preserveWhiteSpace:T=!0}=t;N||(N=Ie(e,c,u,N===void 0));let D=ft(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:N,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:C,dataURLOptions:v,inlineImages:M,recordCanvas:I,keepIframeSrcFn:h,newlyAddedElement:E});if(!D)return console.warn(e,"not serialized"),null;let W;i.hasNode(e)?W=i.getId(e):yt(D,b)||!T&&D.type===n.NodeType$1.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?W=X:W=Se();let y=Object.assign(D,{id:W});if(i.add(e,y),W===X)return null;g&&g(e);let H=!l;if(y.type===n.NodeType$1.Element){H=H&&!y.needBlock,delete y.needBlock;let w=n.index.shadowRoot(e);w&&n.isNativeShadowDom(w)&&(y.isShadowHost=!0)}if((y.type===n.NodeType$1.Document||y.type===n.NodeType$1.Element)&&H){b.headWhitespace&&y.type===n.NodeType$1.Element&&y.tagName==="head"&&(T=!1);let w={doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:N,maskTextClass:c,maskTextSelector:u,skipChild:l,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:C,slimDOMOptions:b,dataURLOptions:v,inlineImages:M,recordCanvas:I,preserveWhiteSpace:T,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h};if(!(y.type===n.NodeType$1.Element&&y.tagName==="textarea"&&y.attributes.value!==void 0))for(let j of Array.from(n.index.childNodes(e))){let $=B(j,w);$&&y.childNodes.push($)}let L=null;if(n.isElement(e)&&(L=n.index.shadowRoot(e)))for(let j of Array.from(n.index.childNodes(L))){let $=B(j,w);$&&(n.isNativeShadowDom(L)&&($.isShadow=!0),y.childNodes.push($))}}let Z=n.index.parentNode(e);return Z&&n.isShadowRoot(Z)&&n.isNativeShadowDom(Z)&&(y.isShadow=!0),y.type===n.NodeType$1.Element&&y.tagName==="iframe"&&ut(e,()=>{let w=e.contentDocument;if(w&&d){let L=B(w,{doc:w,mirror:i,blockClass:o,blockSelector:a,needsMask:N,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:C,slimDOMOptions:b,dataURLOptions:v,inlineImages:M,recordCanvas:I,preserveWhiteSpace:T,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h});L&&d(e,L)}},R),y.type===n.NodeType$1.Element&&y.tagName==="link"&&typeof y.attributes.rel=="string"&&(y.attributes.rel==="stylesheet"||y.attributes.rel==="preload"&&typeof y.attributes.href=="string"&&n.extractFileExtension(y.attributes.href)==="css")&&dt(e,()=>{if(_){let w=B(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,needsMask:N,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:C,slimDOMOptions:b,dataURLOptions:v,inlineImages:M,recordCanvas:I,preserveWhiteSpace:T,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h});w&&_(e,w)}},s),y}function St(e,t){let{mirror:r=new n.Mirror,blockClass:i="rr-block",blockSelector:o=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskTextFn:x,maskInputFn:C,slimDOM:b=!1,dataURLOptions:v,preserveWhiteSpace:M,onSerialize:I,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:R,stylesheetLoadTimeout:_,keepIframeSrcFn:s=()=>!1}=t||{};return B(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:p===!0?{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}:p===!1?{password:!0}:p,maskTextFn:x,maskInputFn:C,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:v,inlineImages:l,recordCanvas:f,preserveWhiteSpace:M,onSerialize:I,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:R,stylesheetLoadTimeout:_,keepIframeSrcFn:s,newlyAddedElement:!1})}function Nt(e,t){function r(i){t(i),(i.type===n.NodeType$1.Document||i.type===n.NodeType$1.Element)&&i.childNodes.forEach(r)}r(e)}function bt(){ye=1}exports.Mirror=n.Mirror;exports.NodeType=n.NodeType;exports.absolutifyURLs=n.absolutifyURLs;exports.checkDataURLSize=n.checkDataURLSize;exports.createMirror=n.createMirror;exports.escapeImportStatement=n.escapeImportStatement;exports.extractFileExtension=n.extractFileExtension;exports.fixSafariColons=n.fixSafariColons;exports.getInputType=n.getInputType;exports.is2DCanvasBlank=n.is2DCanvasBlank;exports.isCSSImportRule=n.isCSSImportRule;exports.isCSSStyleRule=n.isCSSStyleRule;exports.isElement=n.isElement;exports.isNativeShadowDom=n.isNativeShadowDom;exports.isNodeMetaEqual=n.isNodeMetaEqual;exports.isShadowRoot=n.isShadowRoot;exports.maskInputValue=n.maskInputValue;exports.recompressBase64Image=n.recompressBase64Image;exports.stringifyRule=n.stringifyRule;exports.stringifyStylesheet=n.stringifyStylesheet;exports.toLowerCase=n.toLowerCase;exports.IGNORED_NODE=X;exports.classMatchesRegex=F;exports.cleanupSnapshot=bt;exports.genId=Se;exports.ignoreAttribute=be;exports.needMaskingText=Ie;exports.serializeNodeWithId=B;exports.snapshot=St;exports.transformAttribute=Ne;exports.visitSnapshot=Nt;
3
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
16
4
  var __cp = (to, from, except, desc) => {
17
5
  if ((from && typeof from === "object") || typeof from === "function") {
18
6
  for (let key of Object.getOwnPropertyNames(from)) {