@posthog/rrweb-snapshot 0.0.40 → 0.0.41
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.
- package/dist/record.cjs +34 -6
- package/dist/record.cjs.map +1 -1
- package/dist/record.d.cts +8 -0
- package/dist/record.d.ts +8 -0
- package/dist/record.js +35 -7
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +34 -6
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +1 -1
- package/dist/record.umd.min.cjs.map +3 -3
- package/dist/rrweb-snapshot.cjs +2 -0
- package/dist/rrweb-snapshot.cjs.map +1 -1
- package/dist/rrweb-snapshot.d.cts +8 -0
- package/dist/rrweb-snapshot.d.ts +8 -0
- package/dist/rrweb-snapshot.js +4 -2
- package/dist/rrweb-snapshot.umd.cjs +36 -6
- package/dist/rrweb-snapshot.umd.cjs.map +2 -2
- package/dist/rrweb-snapshot.umd.min.cjs +10 -10
- package/dist/rrweb-snapshot.umd.min.cjs.map +3 -3
- package/package.json +3 -3
package/dist/record.umd.min.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var me=Ce(S=>{"use strict";var Ee=Object.defineProperty,we=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ee=(e,t,r)=>we(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 ve(e){var t,r;let o=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(o&&globalThis[o])return globalThis[o]}function J(e){if(z[e])return z[e];let t=ve(e)||globalThis[e],r=t.prototype,o=e in te?te[e]:void 0,i=!!(o&&o.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(i&&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 G={};function A(e,t,r){var o;let i=`${e}.${String(r)}`;if(G[i])return G[i].call(t);let a=J(e),c=(o=Object.getOwnPropertyDescriptor(a,r))==null?void 0:o.get;return c?(G[i]=c,c.call(t)):t[r]}var q={};function ne(e,t,r){let o=`${e}.${String(r)}`;if(q[o])return q[o].bind(t);let a=J(e)[r];return typeof a!="function"?t[r]:(q[o]=a,a.bind(t))}function Me(e){return A("Node",e,"childNodes")}function _e(e){return A("Node",e,"parentNode")}function Te(e){return A("Node",e,"parentElement")}function Re(e){return A("Node",e,"textContent")}function De(e,t){return ne("Node",e,"contains")(t)}function ke(e){return ne("Node",e,"getRootNode")()}function Ae(e){return!e||!("host"in e)?null:A("ShadowRoot",e,"host")}function Le(e){return e.styleSheets}function $e(e){return!e||!("shadowRoot"in e)?null:A("Element",e,"shadowRoot")}function Oe(e,t){return A("Element",e,"querySelector")(t)}function Pe(e,t){return A("Element",e,"querySelectorAll")(t)}function Be(){return J("MutationObserver").constructor}function We(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],i=r(o);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=i,()=>{e[t]=o}}catch(o){return()=>{}}}var F={childNodes:Me,parentNode:_e,parentElement:Te,textContent:Re,contains:De,getRootNode:ke,host:Ae,styleSheets:Le,shadowRoot:$e,querySelector:Oe,querySelectorAll:Pe,mutationObserver:Be,patch:We};function ae(e){return e.nodeType===e.ELEMENT_NODE}function ze(e){let t=e&&"host"in e&&"mode"in e&&F.host(e)||null;return!!(t&&"shadowRoot"in t&&F.shadowRoot(t)===e)}function Fe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ue(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 se(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 le(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let o=Array.from(t,i=>ce(i,r)).join("");return Ue(o)}catch(t){return null}}function ce(e,t){var r;if(de(e)){let o;try{o=le(e.styleSheet)||se(e)}catch(i){o=e.cssText}try{if(o&&((r=e.styleSheet)!=null&&r.href))return Y(o,e.styleSheet.href)}catch(i){}return o}else{let o=e.cssText;return fe(e)&&e.selectorText.includes(":")&&(o=ue(o)),t?Y(o,t):o}}function ue(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function de(e){return"styleSheet"in e}function fe(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 o=(r=this.getMeta(t))==null?void 0:r.id;return o!=null?o:-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);if(this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o)),ae(t)){let o=F.shadowRoot(t);o&&this.removeNodeFromMap(o),t.nodeName==="IFRAME"&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(r,i)}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:o,value:i,maskInputFn:a}){let c=i||"",u=o&&K(o);return(t[r.toLowerCase()]||u&&t[u])&&(a?c=a(c,e):c="*".repeat(c.length)),c}function K(e){return e.toLowerCase()}var oe="__rrweb_original__";function je(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let o=0;o<e.width;o+=r)for(let i=0;i<e.height;i+=r){let a=t.getImageData,c=oe in a?a[oe]:a;if(new Uint32Array(c.call(t,o,i,Math.min(r,e.width-o),Math.min(r,e.height-i)).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 o=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(o);return(a=i==null?void 0:i[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,o,i,a,c,u)=>{let l=i||c||u,f=o||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==",ie=4096;function tt(e,t,r,o){if(!e.complete||e.naturalWidth===0||e.naturalWidth>ie||e.naturalHeight>ie)return t;try{let i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;let a=i.getContext("2d");return a?(a.drawImage(e,0,0),i.toDataURL(r||"image/webp",o!=null?o:.4)):t}catch(i){return t}}function rt(e,t){return!t||e.length<=t?e:et}var pe=(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))(pe||{});S.Mirror=U;S.NodeType=pe;S.NodeType$1=k;S.absolutifyURLs=Y;S.checkDataURLSize=rt;S.createMirror=He;S.escapeImportStatement=se;S.extractFileExtension=qe;S.fixSafariColons=ue;S.getInputType=Ge;S.index=F;S.is2DCanvasBlank=je;S.isCSSImportRule=de;S.isCSSStyleRule=fe;S.isElement=ae;S.isNativeShadowDom=Fe;S.isNodeMetaEqual=Ve;S.isShadowRoot=ze;S.maskInputValue=Ze;S.recompressBase64Image=tt;S.stringifyRule=ce;S.stringifyStylesheet=le;S.toLowerCase=K});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=me(),Se=1,ot=new RegExp("[^a-z0-9-_:]"),X=-2;function Ne(){return Se++}function it(e){if(e instanceof HTMLFormElement)return"form";let t=n.toLowerCase(e.tagName);return ot.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 o(a){let c,u=a.exec(t.substring(r));return u?(c=u[0],r+=c.length,c):""}let i=[];for(;o(at),!(r>=t.length);){let a=o(nt);if(a.slice(-1)===",")a=P(e,a.substring(0,a.length-1)),i.push(a);else{let c="";a=P(e,a);let u=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((a+c).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,i.push((a+c).trim());break}else l==="("&&(u=!0);c+=l,r+=1}}}return i.join(", ")}var ge=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=ge.get(e);if(r||(r=e.createElement("a"),ge.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function be(e,t,r,o,i,a){if(!o)return o;if(r==="src"||r==="href"&&!(t==="use"&&o[0]==="#")){let c=P(e,o);if(t==="img"&&c.startsWith("data:")&&i){let u=i,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"&&o[0]!=="#")return P(e,o);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return P(e,o);if(r==="srcset")return st(e,o);if(r==="style")return n.absolutifyURLs(o,Q(e));if(t==="object"&&r==="data")return P(e,o)}return o}function Ie(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 o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(r)return e.matches(r)}catch(o){}return!1}function H(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?H(n.index.parentNode(e),t,r):!1;for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}return r?H(n.index.parentNode(e),t,r):!1}function xe(e,t,r,o){let i;if(n.isElement(e)){if(i=e,!n.index.childNodes(i).length)return!1}else{if(n.index.parentElement(e)===null)return!1;i=n.index.parentElement(e)}try{if(typeof t=="string"){if(o){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(H(i,t,o))return!0;if(r){if(o){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(a){}return!1}function ut(e,t,r){let o=e.contentWindow;if(!o)return;let i=!1,a;try{a=o.document.readyState}catch(u){return}if(a!=="complete"){let u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}let c="about:blank";if(o.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 o=!1,i;try{i=e.sheet}catch(c){return}if(i)return;let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()})}function ft(e,t){let{doc:r,mirror:o,blockClass:i,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,o);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:i,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 mt(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 mt(e,t){var r;let{needsMask:o,maskTextFn:i,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&&o&&(l=i?i(l,n.index.parentElement(e)):l.replace(/[\S]/g,"*")),{type:n.NodeType$1.Text,textContent:l||"",isStyle:f,rootId:a}}function ye(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function ht(e){return e.href}function gt(e,t){var r,o;let{doc:i,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=it(e),d={},R=e.attributes.length;for(let s=0;s<R;s++){let m=e.attributes[s];Ie(g,m.name,m.value)||(d[m.name]=be(i,g,n.toLowerCase(m.name),m.value,e,p))}if(g==="link"&&u){let s=ht(e);if(s){let m=ye(i,s);if(!m&&s.includes(".css")){let N=window.location.origin,T=s.replace(window.location.href,""),D=N+"/"+T;m=ye(i,D)}let E=null;m&&(E=n.stringifyStylesheet(m)),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,m=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}):m&&(d.checked=m)}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),m=i.createElement("canvas");m.width=e.width,m.height=e.height;let E=m.toDataURL(p.type,p.quality);s!==E&&(d.rr_dataURL=s)}}if(g==="img"&&x){O||(O=i.createElement("canvas"),he=O.getContext("2d"));let s=e,m=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=${m}! 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:m,left:E,top:N}=e.getBoundingClientRect();d={class:d.class,rr_width:`${s}px`,rr_height:`${m}px`,rr_left:`${Math.floor(E+(((r=i.defaultView)==null?void 0:r.scrollX)||0))}px`,rr_top:`${Math.floor(N+(((o=i.defaultView)==null?void 0:o.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 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 B(e,t){let{doc:r,mirror:o,blockClass:i,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:m=()=>!1,newlyAddedElement:E=!1}=t,{needsMask:N}=t,{preserveWhiteSpace:T=!0}=t;N||(N=xe(e,c,u,N===void 0));let D=ft(e,{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:N,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:C,dataURLOptions:v,inlineImages:M,recordCanvas:I,keepIframeSrcFn:m,newlyAddedElement:E});if(!D)return console.warn(e,"not serialized"),null;let W;o.hasNode(e)?W=o.getId(e):yt(D,b)||!T&&D.type===n.NodeType$1.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?W=X:W=Ne();let y=Object.assign(D,{id:W});if(o.add(e,y),W===X)return null;g&&g(e);let Z=!l;if(y.type===n.NodeType$1.Element){Z=Z&&!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)&&Z){b.headWhitespace&&y.type===n.NodeType$1.Element&&y.tagName==="head"&&(T=!1);let w={doc:r,mirror:o,blockClass:i,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:m};if(!(y.type===n.NodeType$1.Element&&y.tagName==="textarea"&&y.attributes.value!==void 0))for(let V of Array.from(n.index.childNodes(e))){let $=B(V,w);$&&y.childNodes.push($)}let L=null;if(n.isElement(e)&&(L=n.index.shadowRoot(e)))for(let V of Array.from(n.index.childNodes(L))){let $=B(V,w);$&&(n.isNativeShadowDom(L)&&($.isShadow=!0),y.childNodes.push($))}}let j=n.index.parentNode(e);return j&&n.isShadowRoot(j)&&n.isNativeShadowDom(j)&&(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:o,blockClass:i,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:m});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:o,blockClass:i,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:m});w&&_(e,w)}},s),y}function St(e,t){let{mirror:r=new n.Mirror,blockClass:o="rr-block",blockSelector:i=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:o,blockSelector:i,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(o){t(o),(o.type===n.NodeType$1.Document||o.type===n.NodeType$1.Element)&&o.childNodes.forEach(r)}r(e)}function bt(){Se=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=H;exports.cleanupSnapshot=bt;exports.genId=Ne;exports.ignoreAttribute=Ie;exports.needMaskingText=xe;exports.serializeNodeWithId=B;exports.snapshot=St;exports.transformAttribute=be;exports.visitSnapshot=Nt;
|
|
2
|
+
"use strict";var _e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ge=_e(S=>{"use strict";var Te=Object.defineProperty,De=(e,t,r)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,re=(e,t,r)=>De(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||{}),oe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},U={};function Re(e){var t,r;let o=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(o&&globalThis[o])return globalThis[o]}function K(e){if(U[e])return U[e];let t=Re(e)||globalThis[e],r=t.prototype,o=e in oe?oe[e]:void 0,i=!!(o&&o.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 ie?ie[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(i&&c)return U[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?U[e]=f:r}catch(u){return r}}var X={};function A(e,t,r){var o;let i=`${e}.${String(r)}`;if(X[i])return X[i].call(t);let a=K(e),c=(o=Object.getOwnPropertyDescriptor(a,r))==null?void 0:o.get;return c?(X[i]=c,c.call(t)):t[r]}var Y={};function se(e,t,r){let o=`${e}.${String(r)}`;if(Y[o])return Y[o].bind(t);let a=K(e)[r];return typeof a!="function"?t[r]:(Y[o]=a,a.bind(t))}function ke(e){return A("Node",e,"childNodes")}function Ae(e){return A("Node",e,"parentNode")}function Le(e){return A("Node",e,"parentElement")}function $e(e){return A("Node",e,"textContent")}function Oe(e,t){return se("Node",e,"contains")(t)}function Pe(e){return se("Node",e,"getRootNode")()}function Be(e){return!e||!("host"in e)?null:A("ShadowRoot",e,"host")}function We(e){return e.styleSheets}function Fe(e){return!e||!("shadowRoot"in e)?null:A("Element",e,"shadowRoot")}function ze(e,t){return A("Element",e,"querySelector")(t)}function Ue(e,t){return A("Element",e,"querySelectorAll")(t)}function He(){return K("MutationObserver").constructor}function Ze(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],i=r(o);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=i,()=>{e[t]=o}}catch(o){return()=>{}}}var H={childNodes:ke,parentNode:Ae,parentElement:Le,textContent:$e,contains:Oe,getRootNode:Pe,host:Be,styleSheets:We,shadowRoot:Fe,querySelector:ze,querySelectorAll:Ue,mutationObserver:He,patch:Ze};function le(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&H.host(e)||null;return!!(t&&"shadowRoot"in t&&H.shadowRoot(t)===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ge(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 ce(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 ue(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let o=Array.from(t,i=>de(i,r)).join("");return Ge(o)}catch(t){return null}}function de(e,t){var r;if(pe(e)){let o;try{o=ue(e.styleSheet)||ce(e)}catch(i){o=e.cssText}try{if(o&&((r=e.styleSheet)!=null&&r.href))return J(o,e.styleSheet.href)}catch(i){}return o}else{let o=e.cssText;return he(e)&&e.selectorText.includes(":")&&(o=fe(o)),t?J(o,t):o}}function fe(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function pe(e){return"styleSheet"in e}function he(e){return"selectorText"in e}var Z=class{constructor(){re(this,"idNodeMap",new Map),re(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;let o=(r=this.getMeta(t))==null?void 0:r.id;return o!=null?o:-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);if(this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o)),le(t)){let o=H.shadowRoot(t);o&&this.removeNodeFromMap(o),t.nodeName==="IFRAME"&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function qe(){return new Z}function Xe({element:e,maskInputOptions:t,tagName:r,type:o,value:i,maskInputFn:a}){let c=i||"",u=o&&Q(o);return(t[r.toLowerCase()]||u&&t[u])&&(a?c=a(c,e):c="*".repeat(c.length)),c}function Q(e){return e.toLowerCase()}var ne="__rrweb_original__";function Ye(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let o=0;o<e.width;o+=r)for(let i=0;i<e.height;i+=r){let a=t.getImageData,c=ne in a?a[ne]:a;if(new Uint32Array(c.call(t,o,i,Math.min(r,e.width-o),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Je(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 Ke(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Q(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 o=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(o);return(a=i==null?void 0:i[1])!=null?a:null}function et(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var tt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,rt=/^(?:[a-z+]+:)?\/\//i,ot=/^www\..*/i,it=/^(data:)([^,]*),(.*)/i;function J(e,t){return(e||"").replace(tt,(r,o,i,a,c,u)=>{let l=i||c||u,f=o||a||"";if(!l)return r;if(rt.test(l)||ot.test(l))return`url(${f}${l}${f})`;if(it.test(l))return`url(${f}${l}${f})`;if(l[0]==="/")return`url(${f}${et(t)+l}${f})`;let p=t.split("/"),x=l.split("/");p.pop();for(let w of x)w!=="."&&(w===".."?p.pop():p.push(w));return`url(${f}${p.join("/")}${f})`})}var nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",ae=4096;function at(e,t,r,o){if(!e.complete||e.naturalWidth===0||e.naturalWidth>ae||e.naturalHeight>ae)return t;try{let i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;let a=i.getContext("2d");return a?(a.drawImage(e,0,0),i.toDataURL(r||"image/webp",o!=null?o:.4)):t}catch(i){return t}}function st(e,t){return!t||e.length<=t?e:nt}var me=(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))(me||{});S.Mirror=Z;S.NodeType=me;S.NodeType$1=k;S.absolutifyURLs=J;S.checkDataURLSize=st;S.createMirror=qe;S.escapeImportStatement=ce;S.extractFileExtension=Qe;S.fixSafariColons=fe;S.getInputType=Ke;S.index=H;S.is2DCanvasBlank=Ye;S.isCSSImportRule=pe;S.isCSSStyleRule=he;S.isElement=le;S.isNativeShadowDom=Ve;S.isNodeMetaEqual=Je;S.isShadowRoot=je;S.maskInputValue=Xe;S.recompressBase64Image=at;S.stringifyRule=de;S.stringifyStylesheet=ue;S.toLowerCase=Q});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=ge(),Ie=1,lt=new RegExp("[^a-z0-9-_:]"),ee=-2;function xe(){return Ie++}function ct(e){if(e instanceof HTMLFormElement)return"form";let t=n.toLowerCase(e.tagName);return lt.test(t)?"div":t}var P,ye,ut=/^[^ \t\n\r\u000c]+/,dt=/^[, \t\n\r\u000c]+/;function ft(e,t){if(t.trim()==="")return t;let r=0;function o(a){let c,u=a.exec(t.substring(r));return u?(c=u[0],r+=c.length,c):""}let i=[];for(;o(dt),!(r>=t.length);){let a=o(ut);if(a.slice(-1)===",")a=B(e,a.substring(0,a.length-1)),i.push(a);else{let c="";a=B(e,a);let u=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((a+c).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,i.push((a+c).trim());break}else l==="("&&(u=!0);c+=l,r+=1}}}return i.join(", ")}var Se=new WeakMap;function B(e,t){return!t||t.trim()===""?t:te(e,t)}function pt(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function te(e,t){let r=Se.get(e);if(r||(r=e.createElement("a"),Se.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function we(e,t,r,o,i,a){if(!o)return o;if(r==="src"||r==="href"&&!(t==="use"&&o[0]==="#")){let c=B(e,o);if(t==="img"&&c.startsWith("data:")&&i){let u=i,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"&&o[0]!=="#")return B(e,o);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return B(e,o);if(r==="srcset")return ft(e,o);if(r==="style")return n.absolutifyURLs(o,te(e));if(t==="object"&&r==="data")return B(e,o)}return o}function Ee(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function ht(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(r)return e.matches(r)}catch(o){}return!1}function j(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?j(n.index.parentNode(e),t,r):!1;for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}return r?j(n.index.parentNode(e),t,r):!1}function Ce(e,t,r,o){let i;if(n.isElement(e)){if(i=e,!n.index.childNodes(i).length)return!1}else{if(n.index.parentElement(e)===null)return!1;i=n.index.parentElement(e)}try{if(typeof t=="string"){if(o){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(j(i,t,o))return!0;if(r){if(o){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(a){}return!1}function mt(e,t,r){let o=e.contentWindow;if(!o)return;let i=!1,a;try{a=o.document.readyState}catch(u){return}if(a!=="complete"){let u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}let c="about:blank";if(o.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function gt(e,t,r){let o=!1,i;try{i=e.sheet}catch(c){return}if(i)return;let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()})}function yt(e,t){let{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:c,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:f,maskInputFn:p,dataURLOptions:x={},inlineImages:w,recordCanvas:N,keepIframeSrcFn:M,newlyAddedElement:v=!1}=t,b=St(r,o);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:b};case e.ELEMENT_NODE:return It(e,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:u,maskInputOptions:l,maskInputFn:p,dataURLOptions:x,inlineImages:w,recordCanvas:N,keepIframeSrcFn:M,newlyAddedElement:v,rootId:b});case e.TEXT_NODE:return Nt(e,{doc:r,needsMask:c,maskTextFn:f,rootId:b});case e.CDATA_SECTION_NODE:return{type:n.NodeType$1.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:n.NodeType$1.Comment,textContent:n.index.textContent(e)||"",rootId:b};default:return!1}}function St(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Nt(e,t){var r;let{needsMask:o,maskTextFn:i,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,te(t.doc))}return p&&(l="SCRIPT_PLACEHOLDER"),!f&&!p&&l&&o&&(l=i?i(l,n.index.parentElement(e)):l.replace(/[\S]/g,"*")),{type:n.NodeType$1.Text,textContent:l||"",isStyle:f,rootId:a}}function Ne(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function bt(e){return e.href}function It(e,t){var r,o;let{doc:i,blockClass:a,blockSelector:c,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:f,dataURLOptions:p={},inlineImages:x,recordCanvas:w,keepIframeSrcFn:N,newlyAddedElement:M=!1,rootId:v}=t,b=ht(e,a,c),g=ct(e),d={},R=e.attributes.length;for(let s=0;s<R;s++){let h=e.attributes[s];Ee(g,h.name,h.value)||(d[h.name]=we(i,g,n.toLowerCase(h.name),h.value,e,p))}if(g==="link"&&u){let s=bt(e);if(s){let h=Ne(i,s);if(!h&&s.includes(".css")){let I=window.location.origin,T=s.replace(window.location.href,""),D=I+"/"+T;h=Ne(i,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"&&w){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=i.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){P||(P=i.createElement("canvas"),ye=P.getContext("2d"));let s=e,h=s.currentSrc||s.getAttribute("src")||"<unknown-src>",E=s.crossOrigin,I=()=>{s.removeEventListener("load",I);try{P.width=s.naturalWidth,P.height=s.naturalHeight,ye.drawImage(s,0,0),d.rr_dataURL=P.toDataURL(p.type,p.quality)}catch(T){if(s.crossOrigin!=="anonymous"){s.crossOrigin="anonymous",s.complete&&s.naturalWidth!==0?I():s.addEventListener("load",I);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?I():s.addEventListener("load",I)}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(M||(e.scrollLeft&&(d.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(d.rr_scrollTop=e.scrollTop)),b){let{width:s,height:h,left:E,top:I}=e.getBoundingClientRect();d={class:d.class,rr_width:`${s}px`,rr_height:`${h}px`,rr_left:`${Math.floor(E+(((r=i.defaultView)==null?void 0:r.scrollX)||0))}px`,rr_top:`${Math.floor(I+(((o=i.defaultView)==null?void 0:o.scrollY)||0))}px`}}g==="iframe"&&!N(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:pt(e)||void 0,needBlock:b,rootId:v,isCustom:_}}function m(e){return e==null?"":e.toLowerCase()}function xt(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}var Me=50,be=!1,ve=!1;function wt(){return ve}function W(e,t){let{doc:r,mirror:o,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:f=!0,maskInputOptions:p={},maskTextFn:x,maskInputFn:w,slimDOMOptions:N,dataURLOptions:M={},inlineImages:v=!1,recordCanvas:b=!1,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R=5e3,onStylesheetLoad:_,stylesheetLoadTimeout:s=5e3,keepIframeSrcFn:h=()=>!1,newlyAddedElement:E=!1,depth:I=0,maxDepth:T=Me}=t,{needsMask:D}=t,{preserveWhiteSpace:F=!0}=t;if(I>=T)return ve=!0,be||(be=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${T}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;D||(D=Ce(e,c,u,D===void 0));let L=yt(e,{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:D,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:w,dataURLOptions:M,inlineImages:v,recordCanvas:b,keepIframeSrcFn:h,newlyAddedElement:E});if(!L)return console.warn(e,"not serialized"),null;let z;o.hasNode(e)?z=o.getId(e):xt(L,N)||!F&&L.type===n.NodeType$1.Text&&!L.isStyle&&!L.textContent.replace(/^\s+|\s+$/gm,"").length?z=ee:z=xe();let y=Object.assign(L,{id:z});if(o.add(e,y),z===ee)return null;g&&g(e);let V=!l;if(y.type===n.NodeType$1.Element){V=V&&!y.needBlock,delete y.needBlock;let C=n.index.shadowRoot(e);C&&n.isNativeShadowDom(C)&&(y.isShadowHost=!0)}if((y.type===n.NodeType$1.Document||y.type===n.NodeType$1.Element)&&V){N.headWhitespace&&y.type===n.NodeType$1.Element&&y.tagName==="head"&&(F=!1);let C={doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:c,maskTextSelector:u,skipChild:l,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:w,slimDOMOptions:N,dataURLOptions:M,inlineImages:v,recordCanvas:b,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h,depth:I+1,maxDepth:T};if(!(y.type===n.NodeType$1.Element&&y.tagName==="textarea"&&y.attributes.value!==void 0))for(let q of Array.from(n.index.childNodes(e))){let O=W(q,C);O&&y.childNodes.push(O)}let $=null;if(n.isElement(e)&&($=n.index.shadowRoot(e)))for(let q of Array.from(n.index.childNodes($))){let O=W(q,C);O&&(n.isNativeShadowDom($)&&(O.isShadow=!0),y.childNodes.push(O))}}let G=n.index.parentNode(e);return G&&n.isShadowRoot(G)&&n.isNativeShadowDom(G)&&(y.isShadow=!0),y.type===n.NodeType$1.Element&&y.tagName==="iframe"&&mt(e,()=>{let C=e.contentDocument;if(C&&d){let $=W(C,{doc:C,mirror:o,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:w,slimDOMOptions:N,dataURLOptions:M,inlineImages:v,recordCanvas:b,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h,depth:I+1,maxDepth:T});$&&d(e,$)}},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")&>(e,()=>{if(_){let C=W(e,{doc:r,mirror:o,blockClass:i,blockSelector:a,needsMask:D,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskTextFn:x,maskInputFn:w,slimDOMOptions:N,dataURLOptions:M,inlineImages:v,recordCanvas:b,preserveWhiteSpace:F,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:R,onStylesheetLoad:_,stylesheetLoadTimeout:s,keepIframeSrcFn:h,depth:I,maxDepth:T});C&&_(e,C)}},s),y}function Et(e,t){let{mirror:r=new n.Mirror,blockClass:o="rr-block",blockSelector:i=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskTextFn:x,maskInputFn:w,slimDOM:N=!1,dataURLOptions:M,preserveWhiteSpace:v,onSerialize:b,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:R,stylesheetLoadTimeout:_,keepIframeSrcFn:s=()=>!1,maxDepth:h}=t||{};return W(e,{doc:e,mirror:r,blockClass:o,blockSelector:i,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:w,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:M,inlineImages:l,recordCanvas:f,preserveWhiteSpace:v,onSerialize:b,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:R,stylesheetLoadTimeout:_,keepIframeSrcFn:s,newlyAddedElement:!1,maxDepth:h})}function Ct(e,t){function r(o){t(o),(o.type===n.NodeType$1.Document||o.type===n.NodeType$1.Element)&&o.childNodes.forEach(r)}r(e)}function Mt(){Ie=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.DEFAULT_MAX_DEPTH=Me;exports.IGNORED_NODE=ee;exports.classMatchesRegex=j;exports.cleanupSnapshot=Mt;exports.genId=xe;exports.ignoreAttribute=Ee;exports.needMaskingText=Ce;exports.serializeNodeWithId=W;exports.snapshot=Et;exports.transformAttribute=we;exports.visitSnapshot=Ct;exports.wasMaxDepthReached=wt;
|
|
3
3
|
;if (typeof module.exports == "object" && typeof exports == "object") {
|
|
4
4
|
var __cp = (to, from, except, desc) => {
|
|
5
5
|
if ((from && typeof from === "object") || typeof from === "function") {
|