@affogatosoftware/recorder 1.0.4 → 1.0.5

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,23 +1,10 @@
1
- var Recorder=function(xt){"use strict";var q;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(q||(q={}));function _i(e){return e.nodeType===e.ELEMENT_NODE}function ct(e){var t=e?.host;return t?.shadowRoot===e}function ut(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Di(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function lr(e){try{var t=e.rules||e.cssRules;return t?Di(Array.from(t).map(Kr).join("")):null}catch{return null}}function Kr(e){var t=e.cssText;if(Bi(e))try{t=lr(e.styleSheet)||t}catch{}return t}function Bi(e){return"styleSheet"in e}var Jr=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Ui(){return new Jr}function cr(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,i=e.value,o=e.maskInputFn,s=i||"";return(t[r.toLowerCase()]||t[n])&&(o?s=o(s):s="*".repeat(s.length)),s}var Yr="__rrweb_original__";function Pi(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var i=0;i<e.height;i+=r){var o=t.getImageData,s=Yr in o?o[Yr]:o,a=new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}var Wi=1,Hi=new RegExp("[^a-z0-9-_:]"),dt=-2;function Xr(){return Wi++}function Vi(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Hi.test(t)?"div":t}function Gi(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function zi(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Ze,Qr,Zi=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qi=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,ji=/^(data:)([^,]*),(.*)/i;function Mt(e,t){return(e||"").replace(Zi,function(r,n,i,o,s,a){var l=i||s||a,c=n||o||"";if(!l)return r;if(!qi.test(l)||ji.test(l))return"url(".concat(c).concat(l).concat(c,")");if(l[0]==="/")return"url(".concat(c).concat(zi(t)+l).concat(c,")");var u=t.split("/"),d=l.split("/");u.pop();for(var m=0,w=d;m<w.length;m++){var f=w[m];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}var Ki=/^[^ \t\n\r\u000c]+/,Ji=/^[, \t\n\r\u000c]+/;function Yi(e,t){if(t.trim()==="")return t;var r=0;function n(c){var u,d=c.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var i=[];n(Ji),!(r>=t.length);){var o=n(Ki);if(o.slice(-1)===",")o=qe(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=qe(e,o);for(var a=!1;;){var l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}function qe(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Xi(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ur(){var e=document.createElement("a");return e.href="",e.href}function $r(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?qe(e,n):r==="srcset"&&n?Yi(e,n):r==="style"&&n?Mt(n,ur()):t==="object"&&r==="data"&&n?qe(e,n):n}function Qi(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?e.matches(r):!1}function Nt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Nt(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?Nt(e.parentNode,t,r):!1}function en(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(Nt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function $i(e,t,r){var n=e.contentWindow;if(n){var i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){var s=setTimeout(function(){i||(t(),i=!0)},r);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function es(e,t,r){var n=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(o),n=!0,t()})}}function ts(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=c===void 0?{}:c,d=t.maskTextFn,m=t.maskInputFn,w=t.dataURLOptions,f=w===void 0?{}:w,v=t.inlineImages,C=t.recordCanvas,k=t.keepIframeSrcFn,S=t.newlyAddedElement,A=S===void 0?!1:S,O=rs(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:e.compatMode}:{type:q.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:O};case e.ELEMENT_NODE:return is(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:m,dataURLOptions:f,inlineImages:v,recordCanvas:C,keepIframeSrcFn:k,newlyAddedElement:A,rootId:O});case e.TEXT_NODE:return ns(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:d,rootId:O});case e.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:O};case e.COMMENT_NODE:return{type:q.Comment,textContent:e.textContent||"",rootId:O};default:return!1}}function rs(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function ns(e,t){var r,n=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;if(c&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=Gi(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}l=Mt(l,ur())}return u&&(l="SCRIPT_PLACEHOLDER"),!c&&!u&&l&&en(e,n,i)&&(l=o?o(l):l.replace(/[\S]/g,"*")),{type:q.Text,textContent:l||"",isStyle:c,rootId:s}}function is(e,t){for(var r=t.doc,n=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=s===void 0?{}:s,l=t.maskInputFn,c=t.dataURLOptions,u=c===void 0?{}:c,d=t.inlineImages,m=t.recordCanvas,w=t.keepIframeSrcFn,f=t.newlyAddedElement,v=f===void 0?!1:f,C=t.rootId,k=Qi(e,n,i),S=Vi(e),A={},O=e.attributes.length,L=0;L<O;L++){var B=e.attributes[L];A[B.name]=$r(r,S,B.name,B.value)}if(S==="link"&&o){var U=Array.from(r.styleSheets).find(function(ue){return ue.href===e.href}),N=null;U&&(N=lr(U)),N&&(delete A.rel,delete A.href,A._cssText=Mt(N,U.href))}if(S==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var N=lr(e.sheet);N&&(A._cssText=Mt(N,ur()))}if(S==="input"||S==="textarea"||S==="select"){var J=e.value,le=e.checked;A.type!=="radio"&&A.type!=="checkbox"&&A.type!=="submit"&&A.type!=="button"&&J?A.value=cr({type:A.type,tagName:S,value:J,maskInputOptions:a,maskInputFn:l}):le&&(A.checked=le)}if(S==="option"&&(e.selected&&!a.select?A.selected=!0:delete A.selected),S==="canvas"&&m){if(e.__context==="2d")Pi(e)||(A.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var he=e.toDataURL(u.type,u.quality),pe=document.createElement("canvas");pe.width=e.width,pe.height=e.height;var me=pe.toDataURL(u.type,u.quality);he!==me&&(A.rr_dataURL=he)}}if(S==="img"&&d){Ze||(Ze=r.createElement("canvas"),Qr=Ze.getContext("2d"));var Z=e,ce=Z.crossOrigin;Z.crossOrigin="anonymous";var ye=function(){try{Ze.width=Z.naturalWidth,Ze.height=Z.naturalHeight,Qr.drawImage(Z,0,0),A.rr_dataURL=Ze.toDataURL(u.type,u.quality)}catch(ue){console.warn("Cannot inline img src=".concat(Z.currentSrc,"! Error: ").concat(ue))}ce?A.crossOrigin=ce:Z.removeAttribute("crossorigin")};Z.complete&&Z.naturalWidth!==0?ye():Z.onload=ye}if((S==="audio"||S==="video")&&(A.rr_mediaState=e.paused?"paused":"played",A.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop)),k){var ke=e.getBoundingClientRect(),Ne=ke.width,se=ke.height;A={class:A.class,rr_width:"".concat(Ne,"px"),rr_height:"".concat(se,"px")}}return S==="iframe"&&!w(A.src)&&(e.contentDocument||(A.rr_src=A.src),delete A.src),{type:q.Element,tagName:S,attributes:A,childNodes:[],isSVG:Xi(e)||void 0,needBlock:k,rootId:C}}function D(e){return e===void 0?"":e.toLowerCase()}function ss(e,t){if(t.comment&&e.type===q.Comment)return!0;if(e.type===q.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(D(e.attributes.name).match(/^msapplication-tile(image|color)$/)||D(e.attributes.name)==="application-name"||D(e.attributes.rel)==="icon"||D(e.attributes.rel)==="apple-touch-icon"||D(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&D(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(D(e.attributes.property).match(/^(og|twitter|fb):/)||D(e.attributes.name).match(/^(og|twitter):/)||D(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(D(e.attributes.name)==="robots"||D(e.attributes.name)==="googlebot"||D(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(D(e.attributes.name)==="author"||D(e.attributes.name)==="generator"||D(e.attributes.name)==="framework"||D(e.attributes.name)==="publisher"||D(e.attributes.name)==="progid"||D(e.attributes.property).match(/^article:/)||D(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(D(e.attributes.name)==="google-site-verification"||D(e.attributes.name)==="yandex-verification"||D(e.attributes.name)==="csrf-token"||D(e.attributes.name)==="p:domain_verify"||D(e.attributes.name)==="verify-v1"||D(e.attributes.name)==="verification"||D(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function je(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,c=l===void 0?!1:l,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,w=m===void 0?{}:m,f=t.maskTextFn,v=t.maskInputFn,C=t.slimDOMOptions,k=t.dataURLOptions,S=k===void 0?{}:k,A=t.inlineImages,O=A===void 0?!1:A,L=t.recordCanvas,B=L===void 0?!1:L,U=t.onSerialize,N=t.onIframeLoad,J=t.iframeLoadTimeout,le=J===void 0?5e3:J,he=t.onStylesheetLoad,pe=t.stylesheetLoadTimeout,me=pe===void 0?5e3:pe,Z=t.keepIframeSrcFn,ce=Z===void 0?function(){return!1}:Z,ye=t.newlyAddedElement,ke=ye===void 0?!1:ye,Ne=t.preserveWhiteSpace,se=Ne===void 0?!0:Ne,ue=ts(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:w,maskTextFn:f,maskInputFn:v,dataURLOptions:S,inlineImages:O,recordCanvas:B,keepIframeSrcFn:ce,newlyAddedElement:ke});if(!ue)return console.warn(e,"not serialized"),null;var Ue;n.hasNode(e)?Ue=n.getId(e):ss(ue,C)||!se&&ue.type===q.Text&&!ue.isStyle&&!ue.textContent.replace(/^\s+|\s+$/gm,"").length?Ue=dt:Ue=Xr();var G=Object.assign(ue,{id:Ue});if(n.add(e,G),Ue===dt)return null;U&&U(e);var Ie=!c;if(G.type===q.Element){Ie=Ie&&!G.needBlock,delete G.needBlock;var Re=e.shadowRoot;Re&&ut(Re)&&(G.isShadowHost=!0)}if((G.type===q.Document||G.type===q.Element)&&Ie){C.headWhitespace&&G.type===q.Element&&G.tagName==="head"&&(se=!1);for(var lt={doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:w,maskTextFn:f,maskInputFn:v,slimDOMOptions:C,dataURLOptions:S,inlineImages:O,recordCanvas:B,preserveWhiteSpace:se,onSerialize:U,onIframeLoad:N,iframeLoadTimeout:le,onStylesheetLoad:he,stylesheetLoadTimeout:me,keepIframeSrcFn:ce},T=0,Q=Array.from(e.childNodes);T<Q.length;T++){var oe=Q[T],P=je(oe,lt);P&&G.childNodes.push(P)}if(_i(e)&&e.shadowRoot)for(var de=0,F=Array.from(e.shadowRoot.childNodes);de<F.length;de++){var oe=F[de],P=je(oe,lt);P&&(ut(e.shadowRoot)&&(P.isShadow=!0),G.childNodes.push(P))}}return e.parentNode&&ct(e.parentNode)&&ut(e.parentNode)&&(G.isShadow=!0),G.type===q.Element&&G.tagName==="iframe"&&$i(e,function(){var ae=e.contentDocument;if(ae&&N){var Ot=je(ae,{doc:ae,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:w,maskTextFn:f,maskInputFn:v,slimDOMOptions:C,dataURLOptions:S,inlineImages:O,recordCanvas:B,preserveWhiteSpace:se,onSerialize:U,onIframeLoad:N,iframeLoadTimeout:le,onStylesheetLoad:he,stylesheetLoadTimeout:me,keepIframeSrcFn:ce});Ot&&N(e,Ot)}},le),G.type===q.Element&&G.tagName==="link"&&G.attributes.rel==="stylesheet"&&es(e,function(){if(he){var ae=je(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:w,maskTextFn:f,maskInputFn:v,slimDOMOptions:C,dataURLOptions:S,inlineImages:O,recordCanvas:B,preserveWhiteSpace:se,onSerialize:U,onIframeLoad:N,iframeLoadTimeout:le,onStylesheetLoad:he,stylesheetLoadTimeout:me,keepIframeSrcFn:ce});ae&&he(e,ae)}},me),G}function os(e,t){var r=t||{},n=r.mirror,i=n===void 0?new Jr:n,o=r.blockClass,s=o===void 0?"rr-block":o,a=r.blockSelector,l=a===void 0?null:a,c=r.maskTextClass,u=c===void 0?"rr-mask":c,d=r.maskTextSelector,m=d===void 0?null:d,w=r.inlineStylesheet,f=w===void 0?!0:w,v=r.inlineImages,C=v===void 0?!1:v,k=r.recordCanvas,S=k===void 0?!1:k,A=r.maskAllInputs,O=A===void 0?!1:A,L=r.maskTextFn,B=r.maskInputFn,U=r.slimDOM,N=U===void 0?!1:U,J=r.dataURLOptions,le=r.preserveWhiteSpace,he=r.onSerialize,pe=r.onIframeLoad,me=r.iframeLoadTimeout,Z=r.onStylesheetLoad,ce=r.stylesheetLoadTimeout,ye=r.keepIframeSrcFn,ke=ye===void 0?function(){return!1}:ye,Ne=O===!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}:O===!1?{password:!0}:O,se=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;return je(e,{doc:e,mirror:i,blockClass:s,blockSelector:l,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:f,maskInputOptions:Ne,maskTextFn:L,maskInputFn:B,slimDOMOptions:se,dataURLOptions:J,inlineImages:C,recordCanvas:S,preserveWhiteSpace:le,onSerialize:he,onIframeLoad:pe,iframeLoadTimeout:me,onStylesheetLoad:Z,stylesheetLoadTimeout:ce,keepIframeSrcFn:ke,newlyAddedElement:!1})}function Y(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Ke=`Please stop import mirror directly. Instead of that,\r
1
+ var scryspell=function(exports){"use strict";var NodeType;(function(NodeType2){NodeType2[NodeType2.Document=0]="Document",NodeType2[NodeType2.DocumentType=1]="DocumentType",NodeType2[NodeType2.Element=2]="Element",NodeType2[NodeType2.Text=3]="Text",NodeType2[NodeType2.CDATA=4]="CDATA",NodeType2[NodeType2.Comment=5]="Comment"})(NodeType||(NodeType={}));function isElement(n){return n.nodeType===n.ELEMENT_NODE}function isShadowRoot(n){var host=n?.host;return host?.shadowRoot===n}function isNativeShadowDom(shadowRoot){return Object.prototype.toString.call(shadowRoot)==="[object ShadowRoot]"}function fixBrowserCompatibilityIssuesInCSS(cssText){return cssText.includes(" background-clip: text;")&&!cssText.includes(" -webkit-background-clip: text;")&&(cssText=cssText.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),cssText}function getCssRulesString(s){try{var rules=s.rules||s.cssRules;return rules?fixBrowserCompatibilityIssuesInCSS(Array.from(rules).map(getCssRuleString).join("")):null}catch{return null}}function getCssRuleString(rule){var cssStringified=rule.cssText;if(isCSSImportRule(rule))try{cssStringified=getCssRulesString(rule.styleSheet)||cssStringified}catch{}return cssStringified}function isCSSImportRule(rule){return"styleSheet"in rule}var Mirror=function(){function Mirror2(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return Mirror2.prototype.getId=function(n){var _a;if(!n)return-1;var id=(_a=this.getMeta(n))===null||_a===void 0?void 0:_a.id;return id??-1},Mirror2.prototype.getNode=function(id){return this.idNodeMap.get(id)||null},Mirror2.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},Mirror2.prototype.getMeta=function(n){return this.nodeMetaMap.get(n)||null},Mirror2.prototype.removeNodeFromMap=function(n){var _this=this,id=this.getId(n);this.idNodeMap.delete(id),n.childNodes&&n.childNodes.forEach(function(childNode){return _this.removeNodeFromMap(childNode)})},Mirror2.prototype.has=function(id){return this.idNodeMap.has(id)},Mirror2.prototype.hasNode=function(node){return this.nodeMetaMap.has(node)},Mirror2.prototype.add=function(n,meta){var id=meta.id;this.idNodeMap.set(id,n),this.nodeMetaMap.set(n,meta)},Mirror2.prototype.replace=function(id,n){var oldNode=this.getNode(id);if(oldNode){var meta=this.nodeMetaMap.get(oldNode);meta&&this.nodeMetaMap.set(n,meta)}this.idNodeMap.set(id,n)},Mirror2.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},Mirror2}();function createMirror(){return new Mirror}function maskInputValue(_a){var maskInputOptions=_a.maskInputOptions,tagName=_a.tagName,type=_a.type,value=_a.value,maskInputFn=_a.maskInputFn,text=value||"";return(maskInputOptions[tagName.toLowerCase()]||maskInputOptions[type])&&(maskInputFn?text=maskInputFn(text):text="*".repeat(text.length)),text}var ORIGINAL_ATTRIBUTE_NAME="__rrweb_original__";function is2DCanvasBlank(canvas){var ctx=canvas.getContext("2d");if(!ctx)return!0;for(var chunkSize=50,x=0;x<canvas.width;x+=chunkSize)for(var y=0;y<canvas.height;y+=chunkSize){var getImageData=ctx.getImageData,originalGetImageData=ORIGINAL_ATTRIBUTE_NAME in getImageData?getImageData[ORIGINAL_ATTRIBUTE_NAME]:getImageData,pixelBuffer=new Uint32Array(originalGetImageData.call(ctx,x,y,Math.min(chunkSize,canvas.width-x),Math.min(chunkSize,canvas.height-y)).data.buffer);if(pixelBuffer.some(function(pixel){return pixel!==0}))return!1}return!0}var _id=1,tagNameRegex=new RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(element){if(element instanceof HTMLFormElement)return"form";var processedTagName=element.tagName.toLowerCase().trim();return tagNameRegex.test(processedTagName)?"div":processedTagName}function stringifyStyleSheet(sheet){return sheet.cssRules?Array.from(sheet.cssRules).map(function(rule){return rule.cssText||""}).join(""):""}function extractOrigin(url){var origin2="";return url.indexOf("//")>-1?origin2=url.split("/").slice(0,3).join("/"):origin2=url.split("/")[0],origin2=origin2.split("?")[0],origin2}var canvasService,canvasCtx,URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(cssText,href){return(cssText||"").replace(URL_IN_CSS_REF,function(origin2,quote1,path1,quote2,path2,path3){var filePath=path1||path2||path3,maybeQuote=quote1||quote2||"";if(!filePath)return origin2;if(!RELATIVE_PATH.test(filePath)||DATA_URI.test(filePath))return"url(".concat(maybeQuote).concat(filePath).concat(maybeQuote,")");if(filePath[0]==="/")return"url(".concat(maybeQuote).concat(extractOrigin(href)+filePath).concat(maybeQuote,")");var stack=href.split("/"),parts=filePath.split("/");stack.pop();for(var _i=0,parts_1=parts;_i<parts_1.length;_i++){var part=parts_1[_i];part!=="."&&(part===".."?stack.pop():stack.push(part))}return"url(".concat(maybeQuote).concat(stack.join("/")).concat(maybeQuote,")")})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(doc,attributeValue){if(attributeValue.trim()==="")return attributeValue;var pos=0;function collectCharacters(regEx){var chars2,match=regEx.exec(attributeValue.substring(pos));return match?(chars2=match[0],pos+=chars2.length,chars2):""}for(var output=[];collectCharacters(SRCSET_COMMAS_OR_SPACES),!(pos>=attributeValue.length);){var url=collectCharacters(SRCSET_NOT_SPACES);if(url.slice(-1)===",")url=absoluteToDoc(doc,url.substring(0,url.length-1)),output.push(url);else{var descriptorsStr="";url=absoluteToDoc(doc,url);for(var inParens=!1;;){var c=attributeValue.charAt(pos);if(c===""){output.push((url+descriptorsStr).trim());break}else if(inParens)c===")"&&(inParens=!1);else if(c===","){pos+=1,output.push((url+descriptorsStr).trim());break}else c==="("&&(inParens=!0);descriptorsStr+=c,pos+=1}}}return output.join(", ")}function absoluteToDoc(doc,attributeValue){if(!attributeValue||attributeValue.trim()==="")return attributeValue;var a=doc.createElement("a");return a.href=attributeValue,a.href}function isSVGElement(el){return!!(el.tagName==="svg"||el.ownerSVGElement)}function getHref(){var a=document.createElement("a");return a.href="",a.href}function transformAttribute(doc,tagName,name,value){return name==="src"||name==="href"&&value&&!(tagName==="use"&&value[0]==="#")||name==="xlink:href"&&value&&value[0]!=="#"||name==="background"&&value&&(tagName==="table"||tagName==="td"||tagName==="th")?absoluteToDoc(doc,value):name==="srcset"&&value?getAbsoluteSrcsetString(doc,value):name==="style"&&value?absoluteToStylesheet(value,getHref()):tagName==="object"&&name==="data"&&value?absoluteToDoc(doc,value):value}function _isBlockedElement(element,blockClass,blockSelector){if(typeof blockClass=="string"){if(element.classList.contains(blockClass))return!0}else for(var eIndex=element.classList.length;eIndex--;){var className=element.classList[eIndex];if(blockClass.test(className))return!0}return blockSelector?element.matches(blockSelector):!1}function classMatchesRegex(node,regex,checkAncestors){if(!node)return!1;if(node.nodeType!==node.ELEMENT_NODE)return checkAncestors?classMatchesRegex(node.parentNode,regex,checkAncestors):!1;for(var eIndex=node.classList.length;eIndex--;){var className=node.classList[eIndex];if(regex.test(className))return!0}return checkAncestors?classMatchesRegex(node.parentNode,regex,checkAncestors):!1}function needMaskingText(node,maskTextClass,maskTextSelector){var el=node.nodeType===node.ELEMENT_NODE?node:node.parentElement;if(el===null)return!1;if(typeof maskTextClass=="string"){if(el.classList.contains(maskTextClass)||el.closest(".".concat(maskTextClass)))return!0}else if(classMatchesRegex(el,maskTextClass,!0))return!0;return!!(maskTextSelector&&(el.matches(maskTextSelector)||el.closest(maskTextSelector)))}function onceIframeLoaded(iframeEl,listener,iframeLoadTimeout){var win=iframeEl.contentWindow;if(win){var fired=!1,readyState;try{readyState=win.document.readyState}catch{return}if(readyState!=="complete"){var timer_1=setTimeout(function(){fired||(listener(),fired=!0)},iframeLoadTimeout);iframeEl.addEventListener("load",function(){clearTimeout(timer_1),fired=!0,listener()});return}var blankUrl="about:blank";if(win.location.href!==blankUrl||iframeEl.src===blankUrl||iframeEl.src==="")return setTimeout(listener,0),iframeEl.addEventListener("load",listener);iframeEl.addEventListener("load",listener)}}function onceStylesheetLoaded(link,listener,styleSheetLoadTimeout){var fired=!1,styleSheetLoaded;try{styleSheetLoaded=link.sheet}catch{return}if(!styleSheetLoaded){var timer=setTimeout(function(){fired||(listener(),fired=!0)},styleSheetLoadTimeout);link.addEventListener("load",function(){clearTimeout(timer),fired=!0,listener()})}}function serializeNode(n,options){var doc=options.doc,mirror2=options.mirror,blockClass=options.blockClass,blockSelector=options.blockSelector,maskTextClass=options.maskTextClass,maskTextSelector=options.maskTextSelector,inlineStylesheet=options.inlineStylesheet,_a=options.maskInputOptions,maskInputOptions=_a===void 0?{}:_a,maskTextFn=options.maskTextFn,maskInputFn=options.maskInputFn,_b=options.dataURLOptions,dataURLOptions=_b===void 0?{}:_b,inlineImages=options.inlineImages,recordCanvas=options.recordCanvas,keepIframeSrcFn=options.keepIframeSrcFn,_c=options.newlyAddedElement,newlyAddedElement=_c===void 0?!1:_c,rootId=getRootId(doc,mirror2);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:NodeType.Document,childNodes:[],compatMode:n.compatMode}:{type:NodeType.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId};case n.ELEMENT_NODE:return serializeElementNode(n,{doc,blockClass,blockSelector,inlineStylesheet,maskInputOptions,maskInputFn,dataURLOptions,inlineImages,recordCanvas,keepIframeSrcFn,newlyAddedElement,rootId});case n.TEXT_NODE:return serializeTextNode(n,{maskTextClass,maskTextSelector,maskTextFn,rootId});case n.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId};case n.COMMENT_NODE:return{type:NodeType.Comment,textContent:n.textContent||"",rootId};default:return!1}}function getRootId(doc,mirror2){if(mirror2.hasNode(doc)){var docId=mirror2.getId(doc);return docId===1?void 0:docId}}function serializeTextNode(n,options){var _a,maskTextClass=options.maskTextClass,maskTextSelector=options.maskTextSelector,maskTextFn=options.maskTextFn,rootId=options.rootId,parentTagName=n.parentNode&&n.parentNode.tagName,textContent=n.textContent,isStyle=parentTagName==="STYLE"?!0:void 0,isScript=parentTagName==="SCRIPT"?!0:void 0;if(isStyle&&textContent){try{n.nextSibling||n.previousSibling||!((_a=n.parentNode.sheet)===null||_a===void 0)&&_a.cssRules&&(textContent=stringifyStyleSheet(n.parentNode.sheet))}catch(err){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(err),n)}textContent=absoluteToStylesheet(textContent,getHref())}return isScript&&(textContent="SCRIPT_PLACEHOLDER"),!isStyle&&!isScript&&textContent&&needMaskingText(n,maskTextClass,maskTextSelector)&&(textContent=maskTextFn?maskTextFn(textContent):textContent.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:textContent||"",isStyle,rootId}}function serializeElementNode(n,options){for(var doc=options.doc,blockClass=options.blockClass,blockSelector=options.blockSelector,inlineStylesheet=options.inlineStylesheet,_a=options.maskInputOptions,maskInputOptions=_a===void 0?{}:_a,maskInputFn=options.maskInputFn,_b=options.dataURLOptions,dataURLOptions=_b===void 0?{}:_b,inlineImages=options.inlineImages,recordCanvas=options.recordCanvas,keepIframeSrcFn=options.keepIframeSrcFn,_c=options.newlyAddedElement,newlyAddedElement=_c===void 0?!1:_c,rootId=options.rootId,needBlock=_isBlockedElement(n,blockClass,blockSelector),tagName=getValidTagName(n),attributes={},len=n.attributes.length,i2=0;i2<len;i2++){var attr=n.attributes[i2];attributes[attr.name]=transformAttribute(doc,tagName,attr.name,attr.value)}if(tagName==="link"&&inlineStylesheet){var stylesheet=Array.from(doc.styleSheets).find(function(s){return s.href===n.href}),cssText=null;stylesheet&&(cssText=getCssRulesString(stylesheet)),cssText&&(delete attributes.rel,delete attributes.href,attributes._cssText=absoluteToStylesheet(cssText,stylesheet.href))}if(tagName==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){var cssText=getCssRulesString(n.sheet);cssText&&(attributes._cssText=absoluteToStylesheet(cssText,getHref()))}if(tagName==="input"||tagName==="textarea"||tagName==="select"){var value=n.value,checked=n.checked;attributes.type!=="radio"&&attributes.type!=="checkbox"&&attributes.type!=="submit"&&attributes.type!=="button"&&value?attributes.value=maskInputValue({type:attributes.type,tagName,value,maskInputOptions,maskInputFn}):checked&&(attributes.checked=checked)}if(tagName==="option"&&(n.selected&&!maskInputOptions.select?attributes.selected=!0:delete attributes.selected),tagName==="canvas"&&recordCanvas){if(n.__context==="2d")is2DCanvasBlank(n)||(attributes.rr_dataURL=n.toDataURL(dataURLOptions.type,dataURLOptions.quality));else if(!("__context"in n)){var canvasDataURL=n.toDataURL(dataURLOptions.type,dataURLOptions.quality),blankCanvas=document.createElement("canvas");blankCanvas.width=n.width,blankCanvas.height=n.height;var blankCanvasDataURL=blankCanvas.toDataURL(dataURLOptions.type,dataURLOptions.quality);canvasDataURL!==blankCanvasDataURL&&(attributes.rr_dataURL=canvasDataURL)}}if(tagName==="img"&&inlineImages){canvasService||(canvasService=doc.createElement("canvas"),canvasCtx=canvasService.getContext("2d"));var image_1=n,oldValue_1=image_1.crossOrigin;image_1.crossOrigin="anonymous";var recordInlineImage=function(){try{canvasService.width=image_1.naturalWidth,canvasService.height=image_1.naturalHeight,canvasCtx.drawImage(image_1,0,0),attributes.rr_dataURL=canvasService.toDataURL(dataURLOptions.type,dataURLOptions.quality)}catch(err){console.warn("Cannot inline img src=".concat(image_1.currentSrc,"! Error: ").concat(err))}oldValue_1?attributes.crossOrigin=oldValue_1:image_1.removeAttribute("crossorigin")};image_1.complete&&image_1.naturalWidth!==0?recordInlineImage():image_1.onload=recordInlineImage}if((tagName==="audio"||tagName==="video")&&(attributes.rr_mediaState=n.paused?"paused":"played",attributes.rr_mediaCurrentTime=n.currentTime),newlyAddedElement||(n.scrollLeft&&(attributes.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(attributes.rr_scrollTop=n.scrollTop)),needBlock){var _d=n.getBoundingClientRect(),width=_d.width,height=_d.height;attributes={class:attributes.class,rr_width:"".concat(width,"px"),rr_height:"".concat(height,"px")}}return tagName==="iframe"&&!keepIframeSrcFn(attributes.src)&&(n.contentDocument||(attributes.rr_src=attributes.src),delete attributes.src),{type:NodeType.Element,tagName,attributes,childNodes:[],isSVG:isSVGElement(n)||void 0,needBlock,rootId}}function lowerIfExists(maybeAttr){return maybeAttr===void 0?"":maybeAttr.toLowerCase()}function slimDOMExcluded(sn,slimDOMOptions){if(slimDOMOptions.comment&&sn.type===NodeType.Comment)return!0;if(sn.type===NodeType.Element){if(slimDOMOptions.script&&(sn.tagName==="script"||sn.tagName==="link"&&sn.attributes.rel==="preload"&&sn.attributes.as==="script"||sn.tagName==="link"&&sn.attributes.rel==="prefetch"&&typeof sn.attributes.href=="string"&&sn.attributes.href.endsWith(".js")))return!0;if(slimDOMOptions.headFavicon&&(sn.tagName==="link"&&sn.attributes.rel==="shortcut icon"||sn.tagName==="meta"&&(lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/)||lowerIfExists(sn.attributes.name)==="application-name"||lowerIfExists(sn.attributes.rel)==="icon"||lowerIfExists(sn.attributes.rel)==="apple-touch-icon"||lowerIfExists(sn.attributes.rel)==="shortcut icon")))return!0;if(sn.tagName==="meta"){if(slimDOMOptions.headMetaDescKeywords&&lowerIfExists(sn.attributes.name).match(/^description|keywords$/))return!0;if(slimDOMOptions.headMetaSocial&&(lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(sn.attributes.name).match(/^(og|twitter):/)||lowerIfExists(sn.attributes.name)==="pinterest"))return!0;if(slimDOMOptions.headMetaRobots&&(lowerIfExists(sn.attributes.name)==="robots"||lowerIfExists(sn.attributes.name)==="googlebot"||lowerIfExists(sn.attributes.name)==="bingbot"))return!0;if(slimDOMOptions.headMetaHttpEquiv&&sn.attributes["http-equiv"]!==void 0)return!0;if(slimDOMOptions.headMetaAuthorship&&(lowerIfExists(sn.attributes.name)==="author"||lowerIfExists(sn.attributes.name)==="generator"||lowerIfExists(sn.attributes.name)==="framework"||lowerIfExists(sn.attributes.name)==="publisher"||lowerIfExists(sn.attributes.name)==="progid"||lowerIfExists(sn.attributes.property).match(/^article:/)||lowerIfExists(sn.attributes.property).match(/^product:/)))return!0;if(slimDOMOptions.headMetaVerification&&(lowerIfExists(sn.attributes.name)==="google-site-verification"||lowerIfExists(sn.attributes.name)==="yandex-verification"||lowerIfExists(sn.attributes.name)==="csrf-token"||lowerIfExists(sn.attributes.name)==="p:domain_verify"||lowerIfExists(sn.attributes.name)==="verify-v1"||lowerIfExists(sn.attributes.name)==="verification"||lowerIfExists(sn.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function serializeNodeWithId(n,options){var doc=options.doc,mirror2=options.mirror,blockClass=options.blockClass,blockSelector=options.blockSelector,maskTextClass=options.maskTextClass,maskTextSelector=options.maskTextSelector,_a=options.skipChild,skipChild=_a===void 0?!1:_a,_b=options.inlineStylesheet,inlineStylesheet=_b===void 0?!0:_b,_c=options.maskInputOptions,maskInputOptions=_c===void 0?{}:_c,maskTextFn=options.maskTextFn,maskInputFn=options.maskInputFn,slimDOMOptions=options.slimDOMOptions,_d=options.dataURLOptions,dataURLOptions=_d===void 0?{}:_d,_e=options.inlineImages,inlineImages=_e===void 0?!1:_e,_f=options.recordCanvas,recordCanvas=_f===void 0?!1:_f,onSerialize=options.onSerialize,onIframeLoad=options.onIframeLoad,_g=options.iframeLoadTimeout,iframeLoadTimeout=_g===void 0?5e3:_g,onStylesheetLoad=options.onStylesheetLoad,_h=options.stylesheetLoadTimeout,stylesheetLoadTimeout=_h===void 0?5e3:_h,_j=options.keepIframeSrcFn,keepIframeSrcFn=_j===void 0?function(){return!1}:_j,_k=options.newlyAddedElement,newlyAddedElement=_k===void 0?!1:_k,_l=options.preserveWhiteSpace,preserveWhiteSpace=_l===void 0?!0:_l,_serializedNode=serializeNode(n,{doc,mirror:mirror2,blockClass,blockSelector,maskTextClass,maskTextSelector,inlineStylesheet,maskInputOptions,maskTextFn,maskInputFn,dataURLOptions,inlineImages,recordCanvas,keepIframeSrcFn,newlyAddedElement});if(!_serializedNode)return console.warn(n,"not serialized"),null;var id;mirror2.hasNode(n)?id=mirror2.getId(n):slimDOMExcluded(_serializedNode,slimDOMOptions)||!preserveWhiteSpace&&_serializedNode.type===NodeType.Text&&!_serializedNode.isStyle&&!_serializedNode.textContent.replace(/^\s+|\s+$/gm,"").length?id=IGNORED_NODE:id=genId();var serializedNode=Object.assign(_serializedNode,{id});if(mirror2.add(n,serializedNode),id===IGNORED_NODE)return null;onSerialize&&onSerialize(n);var recordChild=!skipChild;if(serializedNode.type===NodeType.Element){recordChild=recordChild&&!serializedNode.needBlock,delete serializedNode.needBlock;var shadowRoot=n.shadowRoot;shadowRoot&&isNativeShadowDom(shadowRoot)&&(serializedNode.isShadowHost=!0)}if((serializedNode.type===NodeType.Document||serializedNode.type===NodeType.Element)&&recordChild){slimDOMOptions.headWhitespace&&serializedNode.type===NodeType.Element&&serializedNode.tagName==="head"&&(preserveWhiteSpace=!1);for(var bypassOptions={doc,mirror:mirror2,blockClass,blockSelector,maskTextClass,maskTextSelector,skipChild,inlineStylesheet,maskInputOptions,maskTextFn,maskInputFn,slimDOMOptions,dataURLOptions,inlineImages,recordCanvas,preserveWhiteSpace,onSerialize,onIframeLoad,iframeLoadTimeout,onStylesheetLoad,stylesheetLoadTimeout,keepIframeSrcFn},_i=0,_m=Array.from(n.childNodes);_i<_m.length;_i++){var childN=_m[_i],serializedChildNode=serializeNodeWithId(childN,bypassOptions);serializedChildNode&&serializedNode.childNodes.push(serializedChildNode)}if(isElement(n)&&n.shadowRoot)for(var _o=0,_p=Array.from(n.shadowRoot.childNodes);_o<_p.length;_o++){var childN=_p[_o],serializedChildNode=serializeNodeWithId(childN,bypassOptions);serializedChildNode&&(isNativeShadowDom(n.shadowRoot)&&(serializedChildNode.isShadow=!0),serializedNode.childNodes.push(serializedChildNode))}}return n.parentNode&&isShadowRoot(n.parentNode)&&isNativeShadowDom(n.parentNode)&&(serializedNode.isShadow=!0),serializedNode.type===NodeType.Element&&serializedNode.tagName==="iframe"&&onceIframeLoaded(n,function(){var iframeDoc=n.contentDocument;if(iframeDoc&&onIframeLoad){var serializedIframeNode=serializeNodeWithId(iframeDoc,{doc:iframeDoc,mirror:mirror2,blockClass,blockSelector,maskTextClass,maskTextSelector,skipChild:!1,inlineStylesheet,maskInputOptions,maskTextFn,maskInputFn,slimDOMOptions,dataURLOptions,inlineImages,recordCanvas,preserveWhiteSpace,onSerialize,onIframeLoad,iframeLoadTimeout,onStylesheetLoad,stylesheetLoadTimeout,keepIframeSrcFn});serializedIframeNode&&onIframeLoad(n,serializedIframeNode)}},iframeLoadTimeout),serializedNode.type===NodeType.Element&&serializedNode.tagName==="link"&&serializedNode.attributes.rel==="stylesheet"&&onceStylesheetLoaded(n,function(){if(onStylesheetLoad){var serializedLinkNode=serializeNodeWithId(n,{doc,mirror:mirror2,blockClass,blockSelector,maskTextClass,maskTextSelector,skipChild:!1,inlineStylesheet,maskInputOptions,maskTextFn,maskInputFn,slimDOMOptions,dataURLOptions,inlineImages,recordCanvas,preserveWhiteSpace,onSerialize,onIframeLoad,iframeLoadTimeout,onStylesheetLoad,stylesheetLoadTimeout,keepIframeSrcFn});serializedLinkNode&&onStylesheetLoad(n,serializedLinkNode)}},stylesheetLoadTimeout),serializedNode}function snapshot(n,options){var _a=options||{},_b=_a.mirror,mirror2=_b===void 0?new Mirror:_b,_c=_a.blockClass,blockClass=_c===void 0?"rr-block":_c,_d=_a.blockSelector,blockSelector=_d===void 0?null:_d,_e=_a.maskTextClass,maskTextClass=_e===void 0?"rr-mask":_e,_f=_a.maskTextSelector,maskTextSelector=_f===void 0?null:_f,_g=_a.inlineStylesheet,inlineStylesheet=_g===void 0?!0:_g,_h=_a.inlineImages,inlineImages=_h===void 0?!1:_h,_j=_a.recordCanvas,recordCanvas=_j===void 0?!1:_j,_k=_a.maskAllInputs,maskAllInputs=_k===void 0?!1:_k,maskTextFn=_a.maskTextFn,maskInputFn=_a.maskInputFn,_l=_a.slimDOM,slimDOM=_l===void 0?!1:_l,dataURLOptions=_a.dataURLOptions,preserveWhiteSpace=_a.preserveWhiteSpace,onSerialize=_a.onSerialize,onIframeLoad=_a.onIframeLoad,iframeLoadTimeout=_a.iframeLoadTimeout,onStylesheetLoad=_a.onStylesheetLoad,stylesheetLoadTimeout=_a.stylesheetLoadTimeout,_m=_a.keepIframeSrcFn,keepIframeSrcFn=_m===void 0?function(){return!1}:_m,maskInputOptions=maskAllInputs===!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}:maskAllInputs===!1?{password:!0}:maskAllInputs,slimDOMOptions=slimDOM===!0||slimDOM==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:slimDOM==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:slimDOM===!1?{}:slimDOM;return serializeNodeWithId(n,{doc:n,mirror:mirror2,blockClass,blockSelector,maskTextClass,maskTextSelector,skipChild:!1,inlineStylesheet,maskInputOptions,maskTextFn,maskInputFn,slimDOMOptions,dataURLOptions,inlineImages,recordCanvas,preserveWhiteSpace,onSerialize,onIframeLoad,iframeLoadTimeout,onStylesheetLoad,stylesheetLoadTimeout,keepIframeSrcFn,newlyAddedElement:!1})}function on(type,fn,target=document){const options={capture:!0,passive:!0};return target.addEventListener(type,fn,options),()=>target.removeEventListener(type,fn,options)}const DEPARTED_MIRROR_ACCESS_WARNING=`Please stop import mirror directly. Instead of that,\r
2
2
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
3
- or you can use record.mirror to access the mirror instance during recording.`;let tn={map:{},getId(){return console.error(Ke),-1},getNode(){return console.error(Ke),null},removeNodeFromMap(){console.error(Ke)},has(){return console.error(Ke),!1},reset(){console.error(Ke)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tn=new Proxy(tn,{get(e,t,r){return t==="map"&&console.error(Ke),Reflect.get(e,t,r)}}));function ft(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();!i&&r.leading===!1&&(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function Lt(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Lt(e,t,o||{},!0)}function Je(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}function rn(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function X(e,t,r,n){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(Nt(i,t,n))return!0;return!!(r&&(e.matches(r)||n&&i.closest(r)!==null))}function as(e,t){return t.getId(e)!==-1}function dr(e,t){return t.getId(e)===dt}function sn(e,t){if(ct(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?sn(e.parentNode,t):!0:!0}function on(e){return!!e.changedTouches}function ls(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function an(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ln(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function cn(e){return!!e?.shadowRoot}class cs{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var M=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(M||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(x||{}),fr=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(fr||{}),Ye=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ye||{});function un(e){return"__ln"in e}class us{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&un(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&un(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const dn=(e,t)=>`${e}@${t}`;class ds{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new us,n=a=>{let l=a,c=dt;for(;c===dt;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},i=a=>{var l,c,u,d;let m=null;((c=(l=a.getRootNode)===null||l===void 0?void 0:l.call(a))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&a.getRootNode().host&&(m=a.getRootNode().host);let w=m;for(;((d=(u=w?.getRootNode)===null||u===void 0?void 0:u.call(w))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&w.getRootNode().host;)w=w.getRootNode().host;const f=!this.doc.contains(a)&&(!w||!this.doc.contains(w));if(!a.parentNode||f)return;const v=ct(a.parentNode)?this.mirror.getId(m):this.mirror.getId(a.parentNode),C=n(a);if(v===-1||C===-1)return r.addNode(a);const k=je(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:S=>{an(S,this.mirror)&&this.iframeManager.addIframe(S),ln(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),cn(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(S,A)=>{this.iframeManager.attachIframe(S,A),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,A)=>{this.stylesheetManager.attachLinkElement(S,A)}});k&&t.push({parentId:v,nextId:C,node:k})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))fn(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of Array.from(this.addedSet.values()))!pn(this.droppedSet,a)&&!fn(this.removes,a,this.mirror)||pn(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const l=this.mirror.getId(o.value.parentNode),c=n(o.value);l!==-1&&c!==-1&&(a=o)}if(!a)for(let l=r.length-1;l>=0;l--){const c=r.get(l);if(c){const u=this.mirror.getId(c.value.parentNode);if(n(c.value)===-1)continue;if(u!==-1){a=c;break}else{const m=c.value;if(m.parentNode&&m.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=m.parentNode.host;if(this.mirror.getId(w)!==-1){a=c;break}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const s={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!dr(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!X(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:en(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=cr({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),X(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let i=this.attributes.find(o=>o.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(i||(i={node:t.target,attributes:{}},this.attributes.push(i)),t.attributeName==="style"){const o=this.doc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue),(i.attributes.style===void 0||i.attributes.style===null)&&(i.attributes.style={});const s=i.attributes.style;for(const a of Array.from(r.style)){const l=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(l!==o.style.getPropertyValue(a)||c!==o.style.getPropertyPriority(a))&&(c===""?s[a]=l:s[a]=[l,c])}for(const a of Array.from(o.style))r.style.getPropertyValue(a)===""&&(s[a]=!1)}else i.attributes[t.attributeName]=$r(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(X(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=ct(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);X(t.target,this.blockClass,this.blockSelector,!1)||dr(r,this.mirror)||!as(r,this.mirror)||(this.addedSet.has(r)?(hr(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||sn(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[dn(n,i)]?hr(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:ct(t.target)&&ut(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(dr(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[dn(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);X(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function hr(e,t){e.delete(t),t.childNodes.forEach(r=>hr(e,r))}function fn(e,t,r){return e.length===0?!1:hn(e,t,r)}function hn(e,t,r){const{parentNode:n}=t;if(!n)return!1;const i=r.getId(n);return e.some(o=>o.id===i)?!0:hn(e,n,r)}function pn(e,t){return e.size===0?!1:mn(e,t)}function mn(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:mn(e,r):!1}const Pe=[],gn=typeof CSSGroupingRule<"u",bn=typeof CSSMediaRule<"u",wn=typeof CSSSupportsRule<"u",yn=typeof CSSConditionRule<"u";function ht(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function In(e,t){var r,n;const i=new ds;Pe.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");s&&window[s]&&(o=window[s]);const a=new o(i.processMutations.bind(i));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function fs({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let s=[],a;const l=ft(d=>{const m=Date.now()-a;e(s.map(w=>(w.timeOffset-=m,w)),d),s=[],a=null},o),c=ft(d=>{const m=ht(d),{clientX:w,clientY:f}=on(d)?d.changedTouches[0]:d;a||(a=Date.now()),s.push({x:w,y:f,id:n.getId(m),timeOffset:Date.now()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},i,{trailing:!1}),u=[Y("mousemove",c,r),Y("touchmove",c,r),Y("drag",c,r)];return()=>{u.forEach(d=>d())}}function hs({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>u=>{const d=ht(u);if(X(d,n,i,!0))return;const m=on(u)?u.changedTouches[0]:u;if(!m)return;const w=r.getId(d),{clientX:f,clientY:v}=m;e({type:fr[c],id:w,x:f,y:v})};return Object.keys(fr).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const u=c.toLowerCase(),d=l(c);a.push(Y(u,d,t))}),()=>{a.forEach(c=>c())}}function Cn({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=ft(a=>{const l=ht(a);if(!l||X(l,n,i,!0))return;const c=r.getId(l);if(l===t){const u=t.scrollingElement||t.documentElement;e({id:c,x:u.scrollLeft,y:u.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return Y("scroll",s,t)}function ps({viewportResizeCb:e}){let t=-1,r=-1;const n=ft(()=>{const i=rn(),o=nn();(t!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),t=i,r=o)},200);return Y("resize",n,window)}function Sn(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const ms=["INPUT","TEXTAREA","SELECT"],vn=new WeakMap;function gs({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(k){let S=ht(k);const A=k.isTrusted;if(S&&S.tagName==="OPTION"&&(S=S.parentElement),!S||!S.tagName||ms.indexOf(S.tagName)<0||X(S,n,i,!0))return;const O=S.type;if(S.classList.contains(o))return;let L=S.value,B=!1;O==="radio"||O==="checkbox"?B=S.checked:(s[S.tagName.toLowerCase()]||s[O])&&(L=cr({maskInputOptions:s,tagName:S.tagName,type:O,value:L,maskInputFn:a})),d(S,Sn({text:L,isChecked:B,userTriggered:A},c));const U=S.name;O==="radio"&&U&&B&&t.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(N=>{N!==S&&d(N,Sn({text:N.value,isChecked:!B,userTriggered:!1},c))})}function d(k,S){const A=vn.get(k);if(!A||A.text!==S.text||A.isChecked!==S.isChecked){vn.set(k,S);const O=r.getId(k);e(Object.assign(Object.assign({},S),{id:O}))}}const w=(l.input==="last"?["change"]:["input","change"]).map(k=>Y(k,u,t)),f=t.defaultView;if(!f)return()=>{w.forEach(k=>k())};const v=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),C=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&w.push(...C.map(k=>Lt(k[0],k[1],{set(){u({target:this})}},!1,f))),()=>{w.forEach(k=>k())}}function Ft(e){const t=[];function r(n,i){if(gn&&n.parentRule instanceof CSSGroupingRule||bn&&n.parentRule instanceof CSSMediaRule||wn&&n.parentRule instanceof CSSSupportsRule||yn&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Le(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function bs({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(u,d){const{id:m,styleId:w}=Le(this,t,r.styleMirror);return(m&&m!==-1||w&&w!==-1)&&e({id:m,styleId:w,adds:[{rule:u,index:d}]}),i.apply(this,[u,d])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(u){const{id:d,styleId:m}=Le(this,t,r.styleMirror);return(d&&d!==-1||m&&m!==-1)&&e({id:d,styleId:m,removes:[{index:u}]}),o.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(u){const{id:d,styleId:m}=Le(this,t,r.styleMirror);return(d&&d!==-1||m&&m!==-1)&&e({id:d,styleId:m,replace:u}),s.apply(this,[u])});let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(u){const{id:d,styleId:m}=Le(this,t,r.styleMirror);return(d&&d!==-1||m&&m!==-1)&&e({id:d,styleId:m,replaceSync:u}),a.apply(this,[u])});const l={};gn?l.CSSGroupingRule=n.CSSGroupingRule:(bn&&(l.CSSMediaRule=n.CSSMediaRule),yn&&(l.CSSConditionRule=n.CSSConditionRule),wn&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(m,w){const{id:f,styleId:v}=Le(this.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||v&&v!==-1)&&e({id:f,styleId:v,adds:[{rule:m,index:[...Ft(this),w||0]}]}),c[u].insertRule.apply(this,[m,w])},d.prototype.deleteRule=function(m){const{id:w,styleId:f}=Le(this.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||f&&f!==-1)&&e({id:w,styleId:f,removes:[{index:[...Ft(this),m]}]}),c[u].deleteRule.apply(this,[m])}}),()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})}}function An({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(r.host);const a=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets");return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;const d=(u=l.set)===null||u===void 0?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return d}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})}function ws({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(a,l,c){var u;if(r.has(a))return o.apply(this,[a,l,c]);const{id:d,styleId:m}=Le((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||m&&m!==-1)&&e({id:d,styleId:m,set:{property:a,value:l,priority:c},index:Ft(this.parentRule)}),o.apply(this,[a,l,c])};const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(a){var l;if(r.has(a))return s.apply(this,[a]);const{id:c,styleId:u}=Le((l=this.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||u&&u!==-1)&&e({id:c,styleId:u,remove:{property:a},index:Ft(this.parentRule)}),s.apply(this,[a])},()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}}function ys({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i}){const o=a=>ft(l=>{const c=ht(l);if(!c||X(c,t,r,!0))return;const{currentTime:u,volume:d,muted:m,playbackRate:w}=c;e({type:a,id:n.getId(c),currentTime:u,volume:d,muted:m,playbackRate:w})},i.media||500),s=[Y("play",o(0)),Y("pause",o(1)),Y("seeked",o(2)),Y("volumechange",o(3)),Y("ratechange",o(4))];return()=>{s.forEach(a=>a())}}function Is({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,u){const d=new o(l,c,u);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const s=Je(t.fonts,"add",function(a){return function(l){return setTimeout(()=>{const c=i.get(l);c&&(e(c),i.delete(l))},0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),()=>{n.forEach(a=>a())}}function Cs(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=()=>{const l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;const c=[],u=l.rangeCount||0;for(let d=0;d<u;d++){const m=l.getRangeAt(d),{startContainer:w,startOffset:f,endContainer:v,endOffset:C}=m;X(w,n,i,!0)||X(v,n,i,!0)||c.push({start:r.getId(w),startOffset:f,end:r.getId(v),endOffset:C})}o({ranges:c})};return a(),Y("selectionchange",a)}function Ss(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m,selectionCb:w}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),n(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),i(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),o(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),s(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),a(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),l(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),u(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),d(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),m(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),w(...f)}}function vs(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Ss(e,t);const n=In(e,e.doc),i=fs(e),o=hs(e),s=Cn(e),a=ps(e),l=gs(e),c=ys(e),u=bs(e,{win:r}),d=An(e,e.doc),m=ws(e,{win:r}),w=e.collectFonts?Is(e):()=>{},f=Cs(e),v=[];for(const C of e.plugins)v.push(C.observer(C.callback,r,C.options));return()=>{Pe.forEach(C=>C.reset()),n.disconnect(),i(),o(),s(),a(),l(),c(),u(),d(),m(),w(),f(),v.forEach(C=>C())}}class kn{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t);let a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class As{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new kn(Xr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new kn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case M.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:M.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return r;case M.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case M.IncrementalSnapshot:switch(r.data.source){case x.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case x.Drag:case x.TouchMove:case x.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(r.data,t,["id"]),r;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case x.Font:return r;case x.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case x.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}}replace(t,r,n,i){for(const o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}}class ks{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Je(Element.prototype,"attachShadow",function(n){return function(i){const o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){ut(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),In(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Cn(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),An({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Je(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(i){const o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}}/*! *****************************************************************************
4
- Copyright (c) Microsoft Corporation.
5
-
6
- Permission to use, copy, modify, and/or distribute this software for any
7
- purpose with or without fee is hereby granted.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */function Rs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Ts(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((n=n.apply(e,[])).next())})}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Es=typeof Uint8Array>"u"?[]:new Uint8Array(256),_t=0;_t<Xe.length;_t++)Es[Xe.charCodeAt(_t)]=_t;var Os=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Xe[t[r]>>2],i+=Xe[(t[r]&3)<<4|t[r+1]>>4],i+=Xe[(t[r+1]&15)<<2|t[r+2]>>6],i+=Xe[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Rn=new Map;function xs(e,t){let r=Rn.get(e);return r||(r=new Map,Rn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Tn=(e,t,r)=>{if(!e||!(On(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=xs(r,n);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Dt(e,t,r){if(e instanceof Array)return e.map(n=>Dt(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,i=Os(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Dt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Dt(e.data,t,r),e.width,e.height]};if(On(e,t)||typeof e=="object"){const n=e.constructor.name,i=Tn(e,t,r);return{rr_type:n,index:i}}}}return e}const En=(e,t,r)=>[...e].map(n=>Dt(n,t,r)),On=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function Ms(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;const a=Je(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return X(this.canvas,r,n,!0)||setTimeout(()=>{const u=En([...c],t,this);e(this.canvas,{type:Ye["2D"],property:s,args:u})},0),l.apply(this,c)}});i.push(a)}catch{const l=Lt(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:Ye["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function xn(e,t,r){const n=[];try{const i=Je(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return X(this,t,r,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(i=>i())}}function Mn(e,t,r,n,i,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const u=Je(e,c,function(d){return function(...m){const w=d.apply(this,m);if(Tn(w,s,this),!X(this.canvas,n,i,!0)){const f=En([...m],s,this),v={type:t,property:c,args:f};r(this.canvas,v)}return w}});a.push(u)}catch{const d=Lt(e,c,{set(m){r(this.canvas,{type:t,property:c,args:[m],setter:!0})}});a.push(d)}return a}function Ns(e,t,r,n,i){const o=[];return o.push(...Mn(t.WebGLRenderingContext.prototype,Ye.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Mn(t.WebGL2RenderingContext.prototype,Ye.WebGL2,e,r,n,i,t)),()=>{o.forEach(s=>s())}}var Nn=null;try{var Ls=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads");Nn=Ls.Worker}catch{}function Fs(e,t){return Buffer.from(e,"base64").toString("utf8")}function _s(e,t,r){var n=Fs(e),i=n.indexOf(`
17
- `,10)+1,o=n.substring(i)+"";return function(a){return new Nn(o,Object.assign({},a,{eval:!0}))}}function Ds(e,t){var r=atob(e);return r}function Bs(e,t,r){var n=Ds(e),i=n.indexOf(`
18
- `,10)+1,o=n.substring(i)+"",s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}function Us(e,t,r){var n;return function(o){return n=n||Bs(e),new Worker(n,o)}}var Ps=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function Ws(){return Ps}function Hs(e,t,r){return Ws()?_s(e):Us(e)}var Vs=Hs("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class Gs{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){const s=xn(r,n,i),a=new Map,l=new Vs;l.onmessage=f=>{const{id:v}=f.data;if(a.set(v,!1),!("base64"in f.data))return;const{base64:C,type:k,width:S,height:A}=f.data;this.mutationCb({id:v,type:Ye["2D"],commands:[{property:"clearRect",args:[0,0,S,A]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:k}]},0,0]}]})};const c=1e3/t;let u=0,d;const m=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(v=>{X(v,n,i,!0)||f.push(v)}),f},w=f=>{if(u&&f-u<c){d=requestAnimationFrame(w);return}u=f,m().forEach(v=>Ts(this,void 0,void 0,function*(){var C;const k=this.mirror.getId(v);if(a.get(k))return;if(a.set(k,!0),["webgl","webgl2"].includes(v.__context)){const A=v.getContext(v.__context);((C=A?.getContextAttributes())===null||C===void 0?void 0:C.preserveDrawingBuffer)===!1&&A?.clear(A.COLOR_BUFFER_BIT)}const S=yield createImageBitmap(v);l.postMessage({id:k,bitmap:S,width:v.width,height:v.height,dataURLOptions:o.dataURLOptions},[S])})),d=requestAnimationFrame(w)};d=requestAnimationFrame(w),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=xn(t,r,n),o=Ms(this.processMutation.bind(this),t,r,n),s=Ns(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(s=>Rs(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class zs{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new cs,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let s;if(this.styleMirror.has(o))s=this.styleMirror.getId(o);else{s=this.styleMirror.add(o);const a=Array.from(o.rules||CSSRule);i.push({styleId:s,rules:a.map((l,c)=>({rule:Kr(l),index:c}))})}n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}function z(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let W,Bt,pr,Ut=!1;const ge=Ui();function pt(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:w,maskTextFn:f,hooks:v,packFn:C,sampling:k={},dataURLOptions:S={},mousemoveWait:A,recordCanvas:O=!1,recordCrossOriginIframes:L=!1,userTriggeredOnInput:B=!1,collectFonts:U=!1,inlineImages:N=!1,plugins:J,keepIframeSrcFn:le=()=>!1,ignoreCSSAttributes:he=new Set([])}=e,pe=L?window.parent===window:!0;let me=!1;if(!pe)try{window.parent.document,me=!1}catch{me=!0}if(pe&&!t)throw new Error("emit function is required");A!==void 0&&k.mousemove===void 0&&(k.mousemove=A),ge.reset();const Z=u===!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}:d!==void 0?d:{password:!0},ce=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};ls();let ye,ke=0;const Ne=T=>{for(const Q of J||[])Q.eventProcessor&&(T=Q.eventProcessor(T));return C&&(T=C(T)),T};W=(T,Q)=>{var oe;if(!((oe=Pe[0])===null||oe===void 0)&&oe.isFrozen()&&T.type!==M.FullSnapshot&&!(T.type===M.IncrementalSnapshot&&T.data.source===x.Mutation)&&Pe.forEach(P=>P.unfreeze()),pe)t?.(Ne(T),Q);else if(me){const P={type:"rrweb",event:Ne(T),isCheckout:Q};window.parent.postMessage(P,"*")}if(T.type===M.FullSnapshot)ye=T,ke=0;else if(T.type===M.IncrementalSnapshot){if(T.data.source===x.Mutation&&T.data.isAttachIframe)return;ke++;const P=n&&ke>=n,de=r&&T.timestamp-ye.timestamp>r;(P||de)&&Bt(!0)}};const se=T=>{W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.Mutation},T)}))},ue=T=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.Scroll},T)})),Ue=T=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.CanvasMutation},T)})),G=T=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.AdoptedStyleSheet},T)})),Ie=new zs({mutationCb:se,adoptedStyleSheetCb:G}),Re=new As({mirror:ge,mutationCb:se,stylesheetManager:Ie,recordCrossOriginIframes:L,wrappedEmit:W});for(const T of J||[])T.getMirror&&T.getMirror({nodeMirror:ge,crossOriginIframeMirror:Re.crossOriginIframeMirror,crossOriginIframeStyleMirror:Re.crossOriginIframeStyleMirror});pr=new Gs({recordCanvas:O,mutationCb:Ue,win:window,blockClass:i,blockSelector:o,mirror:ge,sampling:k.canvas,dataURLOptions:S});const lt=new ks({mutationCb:se,scrollCb:ue,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:Z,dataURLOptions:S,maskTextFn:f,maskInputFn:w,recordCanvas:O,inlineImages:N,sampling:k,slimDOMOptions:ce,iframeManager:Re,stylesheetManager:Ie,canvasManager:pr,keepIframeSrcFn:le},mirror:ge});Bt=(T=!1)=>{var Q,oe,P,de,F,ae;W(z({type:M.Meta,data:{href:window.location.href,width:nn(),height:rn()}}),T),Ie.reset(),Pe.forEach($=>$.lock());const Ot=os(document,{mirror:ge,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:Z,maskTextFn:f,slimDOM:ce,dataURLOptions:S,recordCanvas:O,inlineImages:N,onSerialize:$=>{an($,ge)&&Re.addIframe($),ln($,ge)&&Ie.trackLinkElement($),cn($)&&lt.addShadowRoot($.shadowRoot,document)},onIframeLoad:($,jr)=>{Re.attachIframe($,jr),lt.observeAttachShadow($)},onStylesheetLoad:($,jr)=>{Ie.attachLinkElement($,jr)},keepIframeSrcFn:le});if(!Ot)return console.warn("Failed to snapshot the document");W(z({type:M.FullSnapshot,data:{node:Ot,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((oe=(Q=document?.body)===null||Q===void 0?void 0:Q.parentElement)===null||oe===void 0?void 0:oe.scrollLeft)||((P=document?.body)===null||P===void 0?void 0:P.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((F=(de=document?.body)===null||de===void 0?void 0:de.parentElement)===null||F===void 0?void 0:F.scrollTop)||((ae=document?.body)===null||ae===void 0?void 0:ae.scrollTop)||0}}})),Pe.forEach($=>$.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ie.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{const T=[];T.push(Y("DOMContentLoaded",()=>{W(z({type:M.DomContentLoaded,data:{}}))}));const Q=P=>{var de;return vs({mutationCb:se,mousemoveCb:(F,ae)=>W(z({type:M.IncrementalSnapshot,data:{source:ae,positions:F}})),mouseInteractionCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.MouseInteraction},F)})),scrollCb:ue,viewportResizeCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.ViewportResize},F)})),inputCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.Input},F)})),mediaInteractionCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.MediaInteraction},F)})),styleSheetRuleCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.StyleSheetRule},F)})),styleDeclarationCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.StyleDeclaration},F)})),canvasMutationCb:Ue,fontCb:F=>W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.Font},F)})),selectionCb:F=>{W(z({type:M.IncrementalSnapshot,data:Object.assign({source:x.Selection},F)}))},blockClass:i,ignoreClass:s,maskTextClass:a,maskTextSelector:l,maskInputOptions:Z,inlineStylesheet:c,sampling:k,recordCanvas:O,inlineImages:N,userTriggeredOnInput:B,collectFonts:U,doc:P,maskInputFn:w,maskTextFn:f,keepIframeSrcFn:le,blockSelector:o,slimDOMOptions:ce,dataURLOptions:S,mirror:ge,iframeManager:Re,stylesheetManager:Ie,shadowDomManager:lt,canvasManager:pr,ignoreCSSAttributes:he,plugins:((de=J?.filter(F=>F.observer))===null||de===void 0?void 0:de.map(F=>({observer:F.observer,options:F.options,callback:ae=>W(z({type:M.Plugin,data:{plugin:F.name,payload:ae}}))})))||[]},v)};Re.addLoadListener(P=>{T.push(Q(P.contentDocument))});const oe=()=>{Bt(),T.push(Q(document)),Ut=!0};return document.readyState==="interactive"||document.readyState==="complete"?oe():T.push(Y("load",()=>{W(z({type:M.Load,data:{}})),oe()},window)),()=>{T.forEach(P=>P()),Ut=!1}}catch(T){console.warn(T)}}pt.addCustomEvent=(e,t)=>{if(!Ut)throw new Error("please add custom event after start recording");W(z({type:M.Custom,data:{tag:e,payload:t}}))},pt.freezePage=()=>{Pe.forEach(e=>e.freeze())},pt.takeFullSnapshot=e=>{if(!Ut)throw new Error("please take full snapshot after start recording");Bt(e)},pt.mirror=ge;function Ln(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zs}=Object.prototype,{getPrototypeOf:mr}=Object,{iterator:Pt,toStringTag:Fn}=Symbol,Wt=(e=>t=>{const r=Zs.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),be=e=>(e=e.toLowerCase(),t=>Wt(t)===e),Ht=e=>t=>typeof t===e,{isArray:Qe}=Array,mt=Ht("undefined");function qs(e){return e!==null&&!mt(e)&&e.constructor!==null&&!mt(e.constructor)&&ee(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _n=be("ArrayBuffer");function js(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_n(e.buffer),t}const Ks=Ht("string"),ee=Ht("function"),Dn=Ht("number"),Vt=e=>e!==null&&typeof e=="object",Js=e=>e===!0||e===!1,Gt=e=>{if(Wt(e)!=="object")return!1;const t=mr(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Fn in e)&&!(Pt in e)},Ys=be("Date"),Xs=be("File"),Qs=be("Blob"),$s=be("FileList"),eo=e=>Vt(e)&&ee(e.pipe),to=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ee(e.append)&&((t=Wt(e))==="formdata"||t==="object"&&ee(e.toString)&&e.toString()==="[object FormData]"))},ro=be("URLSearchParams"),[no,io,so,oo]=["ReadableStream","Request","Response","Headers"].map(be),ao=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gt(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Qe(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function Bn(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Un=e=>!mt(e)&&e!==We;function gr(){const{caseless:e}=Un(this)&&this||{},t={},r=(n,i)=>{const o=e&&Bn(t,i)||i;Gt(t[o])&&Gt(n)?t[o]=gr(t[o],n):Gt(n)?t[o]=gr({},n):Qe(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&gt(arguments[n],r);return t}const lo=(e,t,r,{allOwnKeys:n}={})=>(gt(t,(i,o)=>{r&&ee(i)?e[o]=Ln(i,r):e[o]=i},{allOwnKeys:n}),e),co=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),uo=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},fo=(e,t,r,n)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&mr(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ho=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},po=e=>{if(!e)return null;if(Qe(e))return e;let t=e.length;if(!Dn(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},mo=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mr(Uint8Array)),go=(e,t)=>{const n=(e&&e[Pt]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},bo=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},wo=be("HTMLFormElement"),yo=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Pn=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Io=be("RegExp"),Wn=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};gt(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},Co=e=>{Wn(e,(t,r)=>{if(ee(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ee(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},So=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Qe(e)?n(e):n(String(e).split(t)),r},vo=()=>{},Ao=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ko(e){return!!(e&&ee(e.append)&&e[Fn]==="FormData"&&e[Pt])}const Ro=e=>{const t=new Array(10),r=(n,i)=>{if(Vt(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=Qe(n)?[]:{};return gt(n,(s,a)=>{const l=r(s,i+1);!mt(l)&&(o[a]=l)}),t[i]=void 0,o}}return n};return r(e,0)},To=be("AsyncFunction"),Eo=e=>e&&(Vt(e)||ee(e))&&ee(e.then)&&ee(e.catch),Hn=((e,t)=>e?setImmediate:t?((r,n)=>(We.addEventListener("message",({source:i,data:o})=>{i===We&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),We.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ee(We.postMessage)),Oo=typeof queueMicrotask<"u"?queueMicrotask.bind(We):typeof process<"u"&&process.nextTick||Hn,h={isArray:Qe,isArrayBuffer:_n,isBuffer:qs,isFormData:to,isArrayBufferView:js,isString:Ks,isNumber:Dn,isBoolean:Js,isObject:Vt,isPlainObject:Gt,isReadableStream:no,isRequest:io,isResponse:so,isHeaders:oo,isUndefined:mt,isDate:Ys,isFile:Xs,isBlob:Qs,isRegExp:Io,isFunction:ee,isStream:eo,isURLSearchParams:ro,isTypedArray:mo,isFileList:$s,forEach:gt,merge:gr,extend:lo,trim:ao,stripBOM:co,inherits:uo,toFlatObject:fo,kindOf:Wt,kindOfTest:be,endsWith:ho,toArray:po,forEachEntry:go,matchAll:bo,isHTMLForm:wo,hasOwnProperty:Pn,hasOwnProp:Pn,reduceDescriptors:Wn,freezeMethods:Co,toObjectSet:So,toCamelCase:yo,noop:vo,toFiniteNumber:Ao,findKey:Bn,global:We,isContextDefined:Un,isSpecCompliantForm:ko,toJSONObject:Ro,isAsyncFn:To,isThenable:Eo,setImmediate:Hn,asap:Oo,isIterable:e=>e!=null&&ee(e[Pt])};function E(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}h.inherits(E,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:h.toJSONObject(this.config),code:this.code,status:this.status}}});const Vn=E.prototype,Gn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Gn[e]={value:e}}),Object.defineProperties(E,Gn),Object.defineProperty(Vn,"isAxiosError",{value:!0}),E.from=(e,t,r,n,i,o)=>{const s=Object.create(Vn);return h.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),E.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const xo=null;function br(e){return h.isPlainObject(e)||h.isArray(e)}function zn(e){return h.endsWith(e,"[]")?e.slice(0,-2):e}function Zn(e,t,r){return e?e.concat(t).map(function(i,o){return i=zn(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function Mo(e){return h.isArray(e)&&!e.some(br)}const No=h.toFlatObject(h,{},null,function(t){return/^is[A-Z]/.test(t)});function zt(e,t,r){if(!h.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=h.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,C){return!h.isUndefined(C[v])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&h.isSpecCompliantForm(t);if(!h.isFunction(i))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(h.isDate(f))return f.toISOString();if(h.isBoolean(f))return f.toString();if(!l&&h.isBlob(f))throw new E("Blob is not supported. Use a Buffer instead.");return h.isArrayBuffer(f)||h.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,v,C){let k=f;if(f&&!C&&typeof f=="object"){if(h.endsWith(v,"{}"))v=n?v:v.slice(0,-2),f=JSON.stringify(f);else if(h.isArray(f)&&Mo(f)||(h.isFileList(f)||h.endsWith(v,"[]"))&&(k=h.toArray(f)))return v=zn(v),k.forEach(function(A,O){!(h.isUndefined(A)||A===null)&&t.append(s===!0?Zn([v],O,o):s===null?v:v+"[]",c(A))}),!1}return br(f)?!0:(t.append(Zn(C,v,o),c(f)),!1)}const d=[],m=Object.assign(No,{defaultVisitor:u,convertValue:c,isVisitable:br});function w(f,v){if(!h.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(f),h.forEach(f,function(k,S){(!(h.isUndefined(k)||k===null)&&i.call(t,k,h.isString(S)?S.trim():S,v,m))===!0&&w(k,v?v.concat(S):[S])}),d.pop()}}if(!h.isObject(e))throw new TypeError("data must be an object");return w(e),t}function qn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function wr(e,t){this._pairs=[],e&&zt(e,this,t)}const jn=wr.prototype;jn.append=function(t,r){this._pairs.push([t,r])},jn.toString=function(t){const r=t?function(n){return t.call(this,n,qn)}:qn;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Lo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Kn(e,t,r){if(!t)return e;const n=r&&r.encode||Lo;h.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let o;if(i?o=i(t,r):o=h.isURLSearchParams(t)?t.toString():new wr(t,r).toString(n),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Jn{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){h.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Yn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fo={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:wr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},yr=typeof window<"u"&&typeof document<"u",Ir=typeof navigator=="object"&&navigator||void 0,_o=yr&&(!Ir||["ReactNative","NativeScript","NS"].indexOf(Ir.product)<0),Do=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bo=yr&&window.location.href||"http://localhost",K={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yr,hasStandardBrowserEnv:_o,hasStandardBrowserWebWorkerEnv:Do,navigator:Ir,origin:Bo},Symbol.toStringTag,{value:"Module"})),...Fo};function Uo(e,t){return zt(e,new K.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return K.isNode&&h.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Po(e){return h.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wo(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function Xn(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=r.length;return s=!s&&h.isArray(i)?i.length:s,l?(h.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!h.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&h.isArray(i[s])&&(i[s]=Wo(i[s])),!a)}if(h.isFormData(e)&&h.isFunction(e.entries)){const r={};return h.forEachEntry(e,(n,i)=>{t(Po(n),i,r,0)}),r}return null}function Ho(e,t,r){if(h.isString(e))try{return(t||JSON.parse)(e),h.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const bt={transitional:Yn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=h.isObject(t);if(o&&h.isHTMLForm(t)&&(t=new FormData(t)),h.isFormData(t))return i?JSON.stringify(Xn(t)):t;if(h.isArrayBuffer(t)||h.isBuffer(t)||h.isStream(t)||h.isFile(t)||h.isBlob(t)||h.isReadableStream(t))return t;if(h.isArrayBufferView(t))return t.buffer;if(h.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Uo(t,this.formSerializer).toString();if((a=h.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return zt(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),Ho(t)):t}],transformResponse:[function(t){const r=this.transitional||bt.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(h.isResponse(t)||h.isReadableStream(t))return t;if(t&&h.isString(t)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?E.from(a,E.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:K.classes.FormData,Blob:K.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};h.forEach(["delete","get","head","post","put","patch"],e=>{bt.headers[e]={}});const Vo=h.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Go=e=>{const t={};let r,n,i;return e&&e.split(`
19
- `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&Vo[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Qn=Symbol("internals");function wt(e){return e&&String(e).trim().toLowerCase()}function Zt(e){return e===!1||e==null?e:h.isArray(e)?e.map(Zt):String(e)}function zo(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Zo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Cr(e,t,r,n,i){if(h.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!h.isString(t)){if(h.isString(n))return t.indexOf(n)!==-1;if(h.isRegExp(n))return n.test(t)}}function qo(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function jo(e,t){const r=h.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,s){return this[n].call(this,t,i,o,s)},configurable:!0})})}let te=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(a,l,c){const u=wt(l);if(!u)throw new Error("header name must be a non-empty string");const d=h.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Zt(a))}const s=(a,l)=>h.forEach(a,(c,u)=>o(c,u,l));if(h.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(h.isString(t)&&(t=t.trim())&&!Zo(t))s(Go(t),r);else if(h.isObject(t)&&h.isIterable(t)){let a={},l,c;for(const u of t){if(!h.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?h.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}s(a,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=wt(t),t){const n=h.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return zo(i);if(h.isFunction(r))return r.call(this,i,n);if(h.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=wt(t),t){const n=h.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Cr(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(s){if(s=wt(s),s){const a=h.findKey(n,s);a&&(!r||Cr(n,n[a],a,r))&&(delete n[a],i=!0)}}return h.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||Cr(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return h.forEach(this,(i,o)=>{const s=h.findKey(n,o);if(s){r[s]=Zt(i),delete r[o];return}const a=t?qo(o):String(o).trim();a!==o&&delete r[o],r[a]=Zt(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return h.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&h.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
20
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Qn]=this[Qn]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=wt(s);n[a]||(jo(i,s),n[a]=!0)}return h.isArray(t)?t.forEach(o):o(t),this}};te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.reduceDescriptors(te.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),h.freezeMethods(te);function Sr(e,t){const r=this||bt,n=t||r,i=te.from(n.headers);let o=n.data;return h.forEach(e,function(a){o=a.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function $n(e){return!!(e&&e.__CANCEL__)}function $e(e,t,r){E.call(this,e??"canceled",E.ERR_CANCELED,t,r),this.name="CanceledError"}h.inherits($e,E,{__CANCEL__:!0});function ei(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new E("Request failed with status code "+r.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ko(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Jo(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=n[o];s||(s=c),r[i]=l,n[i]=c;let d=o,m=0;for(;d!==i;)m+=r[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s<t)return;const w=u&&c-u;return w?Math.round(m*1e3/w):void 0}}function Yo(e,t){let r=0,n=1e3/t,i,o;const s=(c,u=Date.now())=>{r=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-r;d>=n?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},n-d)))},()=>i&&s(i)]}const qt=(e,t,r=3)=>{let n=0;const i=Jo(50,250);return Yo(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-n,c=i(l),u=s<=a;n=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},r)},ti=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ri=e=>(...t)=>h.asap(()=>e(...t)),Xo=K.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,K.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(K.origin),K.navigator&&/(msie|trident)/i.test(K.navigator.userAgent)):()=>!0,Qo=K.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];h.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),h.isString(n)&&s.push("path="+n),h.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $o(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ea(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ni(e,t,r){let n=!$o(t);return e&&(n||r==!1)?ea(e,t):t}const ii=e=>e instanceof te?{...e}:e;function He(e,t){t=t||{};const r={};function n(c,u,d,m){return h.isPlainObject(c)&&h.isPlainObject(u)?h.merge.call({caseless:m},c,u):h.isPlainObject(u)?h.merge({},u):h.isArray(u)?u.slice():u}function i(c,u,d,m){if(h.isUndefined(u)){if(!h.isUndefined(c))return n(void 0,c,d,m)}else return n(c,u,d,m)}function o(c,u){if(!h.isUndefined(u))return n(void 0,u)}function s(c,u){if(h.isUndefined(u)){if(!h.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,d){if(d in t)return n(c,u);if(d in e)return n(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u,d)=>i(ii(c),ii(u),d,!0)};return h.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,m=d(e[u],t[u],u);h.isUndefined(m)&&d!==a||(r[u]=m)}),r}const si=e=>{const t=He({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=te.from(s),t.url=Kn(ni(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(h.isFormData(r)){if(K.hasStandardBrowserEnv||K.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(K.hasStandardBrowserEnv&&(n&&h.isFunction(n)&&(n=n(t)),n||n!==!1&&Xo(t.url))){const c=i&&o&&Qo.read(o);c&&s.set(i,c)}return t},ta=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const i=si(e);let o=i.data;const s=te.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,m,w,f;function v(){w&&w(),f&&f(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function k(){if(!C)return;const A=te.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:A,config:e,request:C};ei(function(U){r(U),v()},function(U){n(U),v()},L),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(n(new E("Request aborted",E.ECONNABORTED,e,C)),C=null)},C.onerror=function(){n(new E("Network Error",E.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const L=i.transitional||Yn;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),n(new E(O,L.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,C)),C=null},o===void 0&&s.setContentType(null),"setRequestHeader"in C&&h.forEach(s.toJSON(),function(O,L){C.setRequestHeader(L,O)}),h.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),a&&a!=="json"&&(C.responseType=i.responseType),c&&([m,f]=qt(c,!0),C.addEventListener("progress",m)),l&&C.upload&&([d,w]=qt(l),C.upload.addEventListener("progress",d),C.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(u=A=>{C&&(n(!A||A.type?new $e(null,e,C):A),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const S=Ko(i.url);if(S&&K.protocols.indexOf(S)===-1){n(new E("Unsupported protocol "+S+":",E.ERR_BAD_REQUEST,e));return}C.send(o||null)})},ra=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const o=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;n.abort(u instanceof E?u:new $e(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new E(`timeout ${t} of ms exceeded`,E.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:l}=n;return l.unsubscribe=()=>h.asap(a),l}},na=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},ia=async function*(e,t){for await(const r of sa(e))yield*na(r,t)},sa=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},oi=(e,t,r,n)=>{const i=ia(e,t);let o=0,s,a=l=>{s||(s=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(r){let m=o+=d;r(m)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},jt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ai=jt&&typeof ReadableStream=="function",oa=jt&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),li=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aa=ai&&li(()=>{let e=!1;const t=new Request(K.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ci=64*1024,vr=ai&&li(()=>h.isReadableStream(new Response("").body)),Kt={stream:vr&&(e=>e.body)};jt&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kt[t]&&(Kt[t]=h.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new E(`Response type '${t}' is not supported`,E.ERR_NOT_SUPPORT,n)})})})(new Response);const la=async e=>{if(e==null)return 0;if(h.isBlob(e))return e.size;if(h.isSpecCompliantForm(e))return(await new Request(K.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(h.isArrayBufferView(e)||h.isArrayBuffer(e))return e.byteLength;if(h.isURLSearchParams(e)&&(e=e+""),h.isString(e))return(await oa(e)).byteLength},ca=async(e,t)=>{const r=h.toFiniteNumber(e.getContentLength());return r??la(t)},Ar={http:xo,xhr:ta,fetch:jt&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:m}=si(e);c=c?(c+"").toLowerCase():"text";let w=ra([i,o&&o.toAbortSignal()],s),f;const v=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let C;try{if(l&&aa&&r!=="get"&&r!=="head"&&(C=await ca(u,n))!==0){let L=new Request(t,{method:"POST",body:n,duplex:"half"}),B;if(h.isFormData(n)&&(B=L.headers.get("content-type"))&&u.setContentType(B),L.body){const[U,N]=ti(C,qt(ri(l)));n=oi(L.body,ci,U,N)}}h.isString(d)||(d=d?"include":"omit");const k="credentials"in Request.prototype;f=new Request(t,{...m,signal:w,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:k?d:void 0});let S=await fetch(f,m);const A=vr&&(c==="stream"||c==="response");if(vr&&(a||A&&v)){const L={};["status","statusText","headers"].forEach(J=>{L[J]=S[J]});const B=h.toFiniteNumber(S.headers.get("content-length")),[U,N]=a&&ti(B,qt(ri(a),!0))||[];S=new Response(oi(S.body,ci,U,()=>{N&&N(),v&&v()}),L)}c=c||"text";let O=await Kt[h.findKey(Kt,c)||"text"](S,e);return!A&&v&&v(),await new Promise((L,B)=>{ei(L,B,{data:O,headers:te.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:f})})}catch(k){throw v&&v(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,e,f),{cause:k.cause||k}):E.from(k,k&&k.code,e,f)}})};h.forEach(Ar,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ui=e=>`- ${e}`,ua=e=>h.isFunction(e)||e===null||e===!1,di={getAdapter:e=>{e=h.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!ua(r)&&(n=Ar[(s=String(r)).toLowerCase()],n===void 0))throw new E(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
21
- `+o.map(ui).join(`
22
- `):" "+ui(o[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Ar};function kr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $e(null,e)}function fi(e){return kr(e),e.headers=te.from(e.headers),e.data=Sr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),di.getAdapter(e.adapter||bt.adapter)(e).then(function(n){return kr(e),n.data=Sr.call(e,e.transformResponse,n),n.headers=te.from(n.headers),n},function(n){return $n(n)||(kr(e),n&&n.response&&(n.response.data=Sr.call(e,e.transformResponse,n.response),n.response.headers=te.from(n.response.headers))),Promise.reject(n)})}const hi="1.10.0",Jt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Jt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const pi={};Jt.transitional=function(t,r,n){function i(o,s){return"[Axios v"+hi+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(t===!1)throw new E(i(s," has been removed"+(r?" in "+r:"")),E.ERR_DEPRECATED);return r&&!pi[s]&&(pi[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,s,a):!0}},Jt.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function da(e,t,r){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new E("option "+o+" must be "+l,E.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const Yt={assertOptions:da,validators:Jt},Ce=Yt.validators;let Ve=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Jn,response:new Jn}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
23
- `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=He(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&Yt.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),i!=null&&(h.isFunction(i)?r.paramsSerializer={serialize:i}:Yt.assertOptions(i,{encode:Ce.function,serialize:Ce.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Yt.assertOptions(r,{baseUrl:Ce.spelling("baseURL"),withXsrfToken:Ce.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&h.merge(o.common,o[r.method]);o&&h.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),r.headers=te.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(l=l&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let u,d=0,m;if(!l){const f=[fi.bind(this),void 0];for(f.unshift.apply(f,a),f.push.apply(f,c),m=f.length,u=Promise.resolve(r);d<m;)u=u.then(f[d++],f[d++]);return u}m=a.length;let w=r;for(d=0;d<m;){const f=a[d++],v=a[d++];try{w=f(w)}catch(C){v.call(this,C);break}}try{u=fi.call(this,w)}catch(f){return Promise.reject(f)}for(d=0,m=c.length;d<m;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=He(this.defaults,t);const r=ni(t.baseURL,t.url,t.allowAbsoluteUrls);return Kn(r,t.params,t.paramsSerializer)}};h.forEach(["delete","get","head","options"],function(t){Ve.prototype[t]=function(r,n){return this.request(He(n||{},{method:t,url:r,data:(n||{}).data}))}}),h.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(He(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Ve.prototype[t]=r(),Ve.prototype[t+"Form"]=r(!0)});let fa=class Fi{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new $e(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Fi(function(i){t=i}),cancel:t}}};function ha(e){return function(r){return e.apply(null,r)}}function pa(e){return h.isObject(e)&&e.isAxiosError===!0}const Rr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rr).forEach(([e,t])=>{Rr[t]=e});function mi(e){const t=new Ve(e),r=Ln(Ve.prototype.request,t);return h.extend(r,Ve.prototype,t,{allOwnKeys:!0}),h.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return mi(He(e,i))},r}const H=mi(bt);H.Axios=Ve,H.CanceledError=$e,H.CancelToken=fa,H.isCancel=$n,H.VERSION=hi,H.toFormData=zt,H.AxiosError=E,H.Cancel=H.CanceledError,H.all=function(t){return Promise.all(t)},H.spread=ha,H.isAxiosError=pa,H.mergeConfig=He,H.AxiosHeaders=te,H.formToJSON=e=>Xn(h.isHTMLForm(e)?new FormData(e):e),H.getAdapter=di.getAdapter,H.HttpStatusCode=Rr,H.default=H;const{Axios:Pa,AxiosError:Wa,CanceledError:Ha,isCancel:Va,CancelToken:Ga,VERSION:za,all:Za,Cancel:qa,isAxiosError:ja,spread:Ka,toFormData:Ja,AxiosHeaders:Ya,HttpStatusCode:Xa,formToJSON:Qa,getAdapter:$a,mergeConfig:el}=H,Tr=H.create({baseURL:"https://scryspell.com",withCredentials:!0}),Er=(e,t,r)=>Tr.post(e,t,r),ma=(e,t,r)=>Tr.put(e,t,r),ga=(e,t,r)=>Tr.patch(e,t,r),Te={info:(...e)=>{console.log("info",...e)},warn:(...e)=>{console.log("warn",...e)},error:(...e)=>{console.log("error",...e)}};function Xt(e){throw new Error("Unexpected object: "+e)}class ba{constructor(t){this.recorderSettings=t,this.buffer={data:[]},this.flushIntervalMs=2e3}capturedSessionId=null;buffer;stopFn;flushIntervalMs;flushTimer;setCapturedSessionId(t){this.capturedSessionId=t}start=()=>{if(Object.assign===void 0)return;this.buffer={data:[]};const t={emit:r=>{this.buffer.data.push(r)},blockClass:"scry-block"};switch(this.recorderSettings.maskingLevel){case j.None:break;case j.All:t.maskTextFn=r=>r.replaceAll(/./g,"*");break;case null:case j.InputAndTextArea:t.maskAllInputs=!0;break;case j.InputPasswordOrEmailAndTextArea:t.maskInputOptions={password:!0,email:!0,textarea:!0};break;default:Xt(this.recorderSettings.maskingLevel)}this.stopFn=pt(t),this.scheduleFlush()};scheduleFlush=()=>{this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=setTimeout(this.flush,this.flushIntervalMs)};flush=async()=>{if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),this.capturedSessionId&&this.buffer.data.length>0)try{let t=await ga(`public/captured-sessions/${this.capturedSessionId}/recording`,this.buffer,{withCredentials:!1});t.status>=400?(Te.error(`status ${t.status} when trying to save session recording data.`),Te.error(t.data)):this.clearAllBufferData()}catch(t){Te.error("Error flushing session data:",t)}this.scheduleFlush()};stop=()=>{this.stopFn&&this.stopFn(),this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)};clearAllBufferData=()=>{this.buffer.data=[]}}class wa{constructor(t,r){this.window=t,this.recorderSettings=r}eventsBuffer=[];isRunning=!1;tagsToCapture=new Set(["button","a","select","textarea","input"]);queryParamsAllowed=new Set(["utm_source","source","ref","utm_medium","medium","utm_campaign","campaign","utm_content","content","utm_term","term"]);flushIntervalMs=2e3;capturedSessionId;flushTimerId=null;start=()=>{if(this.isRunning)return;this.isRunning=!0,this.eventsBuffer=[];const t=this.window.history.pushState.bind(this.window.history);this.window.history.pushState=(r,n,i)=>{let o="";return i instanceof URL?o=i.toString():i?o=i:o="",this.handlePageView(o),t(r,n,i)},this.window.addEventListener("pageshow",r=>{try{this.handlePageView(this.window.location.pathname)}catch(n){Te.error("Failed to capture URL change event",n)}}),this.window.addEventListener("change",this.handler),this.window.addEventListener("click",this.handler),this.window.addEventListener("keydown",this.handler),this.scheduleFlush()};scheduleFlush=()=>{this.flushTimerId&&clearTimeout(this.flushTimerId),this.flushTimerId=setTimeout(this.flush,this.flushIntervalMs)};flush=async()=>{if(this.eventsBuffer.length>0&&this.capturedSessionId)try{const t=await Er(`/public/captured-sessions/${this.capturedSessionId}/ui-events`,this.eventsBuffer,{withCredentials:!1});t.status!==201&&Te.error("Failed to save ui events",t.data),this.eventsBuffer=[]}catch(t){Te.error("Failed to save ui events",t),this.eventsBuffer=[]}this.scheduleFlush()};handlePageView=t=>{if(this.isRunning)try{const r=Date.now();t.charAt(0)==="/"||(t=this.window.location.pathname+"/"+t);const i=new URL(this.window.location.protocol+"//"+this.window.location.host+t+this.window.location.search),o=this.sanitizeUrlParams(i.toString(),this.queryParamsAllowed),s=new URL(o),a=Array.from(s.searchParams),l={eventType:"page_view",timestamp:r,text:t,host:s.hostname,path:t};a.length>0&&(l.queryParams=a),this.eventsBuffer.push(l)}catch(r){Te.error("Failed to capture URL change event",r)}};sanitizeUrlParams=(t,r)=>{try{const n=new URL(t);for(const i of n.searchParams.keys())r.has(i.toLowerCase())||n.searchParams.set(i,"$redacted");return n.toString()}catch(n){return Te.error("Failed to sanitize URL params",n),t}};handler=t=>{if(this.isRunning)try{const r=t.type,n=t.target,i=n?.tagName.toLowerCase();if(!(i&&this.tagsToCapture.has(i)))return;const o=new URL(this.window.location.href),s=o.hostname,a=o.pathname,l=Date.now(),c=this.captureDomContext(n);switch(t.type){case"click":const u=this.handleClick(n,i,l,s,a);this.eventsBuffer.push(u);break;case"keydown":const d=this.handleKeyDown(t,i,n,l,s,a);this.eventsBuffer.push(d);break;case"change":const m=this.handleChange(n,i,l,s,a);this.eventsBuffer.push(m);break;default:this.eventsBuffer.push({eventType:r,tagName:i,timestamp:l,host:s,path:a,text:null,domContext:c})}}catch(r){Te.error("Failed to capture event",r)}};handleChange(t,r,n,i,o){let s=null;switch(t instanceof HTMLSelectElement&&(s=t.options[t.selectedIndex].text),this.recorderSettings.maskingLevel){case j.None:break;case j.All:s=null;break;case null:case j.InputAndTextArea:break;case j.InputPasswordOrEmailAndTextArea:break;default:Xt(this.recorderSettings.maskingLevel)}return{eventType:"change",tagName:r,timestamp:n,text:s===""?null:s,host:i,path:o,domContext:this.captureDomContext(t)}}handleClick(t,r,n,i,o){let s="";if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){const a=this.findInputOrSelectOrTextAreaLabel(t);a?s=a:t.placeholder&&(s=t.placeholder)}else if(t instanceof HTMLSelectElement){const a=this.findInputOrSelectOrTextAreaLabel(t);a?s=a:s=t.value+" ("+t.options[t.selectedIndex].text+")"}else t instanceof HTMLButtonElement?s=t.innerText:t instanceof HTMLAnchorElement?s=t.href:t instanceof HTMLImageElement&&(s=t.src);switch(this.recorderSettings.maskingLevel){case j.None:break;case j.All:s=null;break;case null:case j.InputAndTextArea:(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(s=null);break;case j.InputPasswordOrEmailAndTextArea:(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&(t.type==="password"||t.type==="email"||t.type==="e-mail"))&&(s=null);break;default:Xt(this.recorderSettings.maskingLevel)}return{eventType:"click",tagName:r,timestamp:n,text:s===""?null:s,host:i,path:o,domContext:this.captureDomContext(t)}}handleKeyDown(t,r,n,i,o,s){const l=t.key;let c=null;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){const u=this.findInputOrSelectOrTextAreaLabel(n);u?c=u:n.placeholder&&(c=n.placeholder)}switch(this.recorderSettings.maskingLevel){case j.None:break;case j.All:c=null;break;case null:case j.InputAndTextArea:(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(c=null);break;case j.InputPasswordOrEmailAndTextArea:(n instanceof HTMLTextAreaElement||n instanceof HTMLInputElement&&(n.type==="password"||n.type==="email"||n.type==="e-mail"))&&(c=null);break;default:Xt(this.recorderSettings.maskingLevel)}return{eventType:"keydown",tagName:r,timestamp:i,text:c,key:l,host:o,path:s,domContext:this.captureDomContext(n)}}findInputOrSelectOrTextAreaLabel=t=>{if(!t||!new Set(["input","select","textarea"]).has(t.tagName.toLowerCase()))return null;const n=t.closest("label");if(n){const a=Array.from(n.childNodes).filter(l=>l.nodeName.toLowerCase()!=="select").map(l=>(l.textContent??"").trim()).filter(Boolean).join(" ").trim();if(a)return a}const i=t.id;if(i){const a=t.ownerDocument.querySelector(`label[for="${CSS.escape(i)}"]`);if(a){const l=Array.from(a.childNodes).filter(c=>c.nodeName.toLowerCase()!=="select").map(c=>(c.textContent??"").trim()).filter(Boolean).join(" ").trim();if(l)return l}}const o=t.getAttribute("aria-label");if(o)return o.trim();const s=t.getAttribute("aria-labelledby");return s&&t.ownerDocument.getElementById(s)?.textContent?.trim()||null};stop=()=>{this.isRunning=!1,this.window.removeEventListener("change",this.handler),this.window.removeEventListener("click",this.handler),this.window.removeEventListener("keydown",this.handler),this.flushTimerId&&(clearTimeout(this.flushTimerId),this.flushTimerId=null)};captureDomContext=t=>{const r=[];r.push(this.toJsonNode(t));let n=t.parentElement;for(;n!=null&&r.length<6;)r.push(this.toJsonNode(n)),n=n.parentElement;return r};toJsonNode=t=>{const r={};return["id","class","name","type","role","aria-label"].forEach(n=>{const i=t.getAttribute(n);i&&(r[n]=i)}),{tag:t.tagName.toLowerCase(),attrs:r}};setCapturedSessionId(t){this.capturedSessionId=t}}var ya="2.0.4",Or=500,gi="user-agent",et="",bi="?",Qt="function",Fe="undefined",tt="object",xr="string",re="browser",Ee="cpu",Se="device",we="engine",fe="os",rt="result",y="name",p="type",b="vendor",I="version",ne="architecture",yt="major",g="model",It="console",R="mobile",_="tablet",V="smarttv",ve="wearable",$t="xr",Ct="embedded",St="inapp",Mr="brands",Ge="formFactors",Nr="fullVersionList",nt="platform",Lr="platformVersion",er="bitness",_e="sec-ch-ua",Ia=_e+"-full-version-list",Ca=_e+"-arch",Sa=_e+"-"+er,va=_e+"-form-factors",Aa=_e+"-"+R,ka=_e+"-"+g,wi=_e+"-"+nt,Ra=wi+"-version",yi=[Mr,Nr,R,g,nt,Lr,ne,Ge,er],tr="Amazon",it="Apple",Ii="ASUS",Ci="BlackBerry",ze="Google",Si="Huawei",Fr="Lenovo",vi="Honor",rr="LG",_r="Microsoft",Dr="Motorola",Br="Nvidia",Ai="OnePlus",Ur="OPPO",vt="Samsung",ki="Sharp",At="Sony",Pr="Xiaomi",Wr="Zebra",Ri="Chrome",Ti="Chromium",De="Chromecast",nr="Edge",kt="Firefox",Rt="Opera",Hr="Facebook",Ei="Sogou",st="Mobile ",Tt=" Browser",Vr="Windows",Ta=typeof window!==Fe,ie=Ta&&window.navigator?window.navigator:void 0,Be=ie&&ie.userAgentData?ie.userAgentData:void 0,Ea=function(e,t){var r={},n=t;if(!sr(t)){n={};for(var i in t)for(var o in t[i])n[o]=t[i][o].concat(n[o]?n[o]:[])}for(var s in e)r[s]=n[s]&&n[s].length%2===0?n[s].concat(e[s]):e[s];return r},ir=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},Gr=function(e,t){if(typeof e===tt&&e.length>0){for(var r in e)if(Oe(t)==Oe(e[r]))return!0;return!1}return ot(e)?Oe(t)==Oe(e):!1},sr=function(e,t){for(var r in e)return/^(browser|cpu|device|engine|os)$/.test(r)||(t?sr(e[r]):!1)},ot=function(e){return typeof e===xr},zr=function(e){if(e){for(var t=[],r=at(/\\?\"/g,e).split(","),n=0;n<r.length;n++)if(r[n].indexOf(";")>-1){var i=or(r[n]).split(";v=");t[n]={brand:i[0],version:i[1]}}else t[n]=or(r[n]);return t}},Oe=function(e){return ot(e)?e.toLowerCase():e},Zr=function(e){return ot(e)?at(/[^\d\.]/g,e).split(".")[0]:void 0},xe=function(e){for(var t in e){var r=e[t];typeof r==tt&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this},at=function(e,t){return ot(t)?t.replace(e,et):t},Et=function(e){return at(/\\?\"/g,e)},or=function(e,t){if(ot(e))return e=at(/^\s\s*/,e),typeof t===Fe?e:e.substring(0,Or)},qr=function(e,t){if(!(!e||!t))for(var r=0,n,i,o,s,a,l;r<t.length&&!a;){var c=t[r],u=t[r+1];for(n=i=0;n<c.length&&!a&&c[n];)if(a=c[n++].exec(e),a)for(o=0;o<u.length;o++)l=a[++i],s=u[o],typeof s===tt&&s.length>0?s.length===2?typeof s[1]==Qt?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Qt&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;r+=2}},Ae=function(e,t){for(var r in t)if(typeof t[r]===tt&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(Gr(t[r][n],e))return r===bi?void 0:r}else if(Gr(t[r],e))return r===bi?void 0:r;return t.hasOwnProperty("*")?t["*"]:e},Oi={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},xi={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Oa={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Mi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[I,[y,st+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[I,[y,nr+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[I,[y,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[y,I],[/opios[\/ ]+([\w\.]+)/i],[I,[y,Rt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[I,[y,Rt+" GX"]],[/\bopr\/([\w\.]+)/i],[I,[y,Rt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[I,[y,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[I,[y,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[y,I],[/quark(?:pc)?\/([-\w\.]+)/i],[I,[y,"Quark"]],[/\bddg\/([\w\.]+)/i],[I,[y,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[I,[y,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[I,[y,"WeChat"]],[/konqueror\/([\w\.]+)/i],[I,[y,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[I,[y,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[I,[y,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[I,[y,"Smart "+Fr+Tt]],[/(avast|avg)\/([\w\.]+)/i],[[y,/(.+)/,"$1 Secure"+Tt],I],[/\bfocus\/([\w\.]+)/i],[I,[y,kt+" Focus"]],[/\bopt\/([\w\.]+)/i],[I,[y,Rt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[I,[y,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[I,[y,"Dolphin"]],[/coast\/([\w\.]+)/i],[I,[y,Rt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[I,[y,"MIUI"+Tt]],[/fxios\/([\w\.-]+)/i],[I,[y,st+kt]],[/\bqihoobrowser\/?([\w\.]*)/i],[I,[y,"360"]],[/\b(qq)\/([\w\.]+)/i],[[y,/(.+)/,"$1Browser"],I],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[y,/(.+)/,"$1"+Tt],I],[/samsungbrowser\/([\w\.]+)/i],[I,[y,vt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[I,[y,Ei+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[y,Ei+" Mobile"],I],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[y,I],[/(lbbrowser|rekonq)/i],[y],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[I,y],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[y,Hr],I,[p,St]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[y,I,[p,St]],[/\bgsa\/([\w\.]+) .*safari\//i],[I,[y,"GSA"],[p,St]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[I,[y,"TikTok"],[p,St]],[/\[(linkedin)app\]/i],[y,[p,St]],[/(chromium)[\/ ]([-\w\.]+)/i],[y,I],[/headlesschrome(?:\/([\w\.]+)| )/i],[I,[y,Ri+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[I,[y,nr+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[y,Ri+" WebView"],I],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[I,[y,"Android"+Tt]],[/chrome\/([\w\.]+) mobile/i],[I,[y,st+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[y,I],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[I,[y,st+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[y,st+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[I,y],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[y,[I,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[y,I],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[y,st+kt],I],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[y,"Netscape"],I],[/(wolvic|librewolf)\/([\w\.]+)/i],[y,I],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[I,[y,kt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[y,[I,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[y,[I,/[^\d\.]+./,et]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ne,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ne,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ne,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ne,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ne,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ne,/ower/,et,Oe]],[/ sun4\w[;\)]/i],[[ne,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ne,Oe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[b,vt],[p,_]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[g,[b,vt],[p,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[g,[b,it],[p,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[b,it],[p,_]],[/(macintosh);/i],[g,[b,it]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[b,ki],[p,R]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[g,[b,vi],[p,_]],[/honor([-\w ]+)[;\)]/i],[g,[b,vi],[p,R]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[g,[b,Si],[p,_]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[b,Si],[p,R]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[g,/_/g," "],[b,Pr],[p,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[g,/_/g," "],[b,Pr],[p,R]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[b,Ai],[p,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[b,Ur],[p,R]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[g,[b,Ae,{OnePlus:["203","304","403","404","413","415"],"*":Ur}],[p,_]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[g,[b,"BLU"],[p,R]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[b,"Vivo"],[p,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[g,[b,"Realme"],[p,R]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[g,[b,Fr],[p,_]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[g,[b,Fr],[p,R]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[g,[b,Dr],[p,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[b,Dr],[p,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[b,rr],[p,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[b,rr],[p,R]],[/(nokia) (t[12][01])/i],[b,g,[p,_]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[g,/_/g," "],[p,R],[b,"Nokia"]],[/(pixel (c|tablet))\b/i],[g,[b,ze],[p,_]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[g,[b,ze],[p,R]],[/(google) (pixelbook( go)?)/i],[b,g],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[b,At],[p,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[b,At],[p,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[b,tr],[p,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[b,tr],[p,R]],[/(playbook);[-\w\),; ]+(rim)/i],[g,b,[p,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[b,Ci],[p,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[b,Ii],[p,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[b,Ii],[p,R]],[/(nexus 9)/i],[g,[b,"HTC"],[p,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[g,/_/g," "],[p,R]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[p,_]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[g,[b,"TCL"],[p,R]],[/(itel) ((\w+))/i],[[b,Oe],g,[p,Ae,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[b,"Acer"],[p,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[b,"Meizu"],[p,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[g,[b,"Ulefone"],[p,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[g,[b,"Energizer"],[p,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[g,[b,"Cat"],[p,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[g,[b,"Smartfren"],[p,R]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[g,[b,"Nothing"],[p,R]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[g,[b,"Archos"],[p,_]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[g,[b,"Archos"],[p,R]],[/; (n159v)/i],[g,[b,"HMD"],[p,R]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[b,g,[p,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[b,g,[p,R]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[b,g,[p,_]],[/(surface duo)/i],[g,[b,_r],[p,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[b,"Fairphone"],[p,R]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[g,[b,Br],[p,_]],[/(sprint) (\w+)/i],[b,g,[p,R]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[b,_r],[p,R]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[b,Wr],[p,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[b,Wr],[p,R]],[/smart-tv.+(samsung)/i],[b,[p,V]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[b,vt],[p,V]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[b,g,[p,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,rr],[p,V]],[/(apple) ?tv/i],[b,[g,it+" TV"],[p,V]],[/crkey.*devicetype\/chromecast/i],[[g,De+" Third Generation"],[b,ze],[p,V]],[/crkey.*devicetype\/([^/]*)/i],[[g,/^/,"Chromecast "],[b,ze],[p,V]],[/fuchsia.*crkey/i],[[g,De+" Nest Hub"],[b,ze],[p,V]],[/crkey/i],[[g,De],[b,ze],[p,V]],[/(portaltv)/i],[g,[b,Hr],[p,V]],[/droid.+aft(\w+)( bui|\))/i],[g,[b,tr],[p,V]],[/(shield \w+ tv)/i],[g,[b,Br],[p,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[b,ki],[p,V]],[/(bravia[\w ]+)( bui|\))/i],[g,[b,At],[p,V]],[/(mi(tv|box)-?\w+) bui/i],[g,[b,Pr],[p,V]],[/Hbbtv.*(technisat) (.*);/i],[b,g,[p,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,/.+\/(\w+)/,"$1",Ae,{LG:"lge"}],[g,or],[p,V]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[g,[p,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[p,V]],[/(playstation \w+)/i],[g,[b,At],[p,It]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[b,_r],[p,It]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[b,g,[p,It]],[/droid.+; (shield)( bui|\))/i],[g,[b,Br],[p,It]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[g,[b,vt],[p,ve]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[b,g,[p,ve]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[g,[b,Ur],[p,ve]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[b,it],[p,ve]],[/(opwwe\d{3})/i],[g,[b,Ai],[p,ve]],[/(moto 360)/i],[g,[b,Dr],[p,ve]],[/(smartwatch 3)/i],[g,[b,At],[p,ve]],[/(g watch r)/i],[g,[b,rr],[p,ve]],[/droid.+; (wt63?0{2,3})\)/i],[g,[b,Wr],[p,ve]],[/droid.+; (glass) \d/i],[g,[b,ze],[p,$t]],[/(pico) (4|neo3(?: link|pro)?)/i],[b,g,[p,$t]],[/(quest( \d| pro)?s?).+vr/i],[g,[b,Hr],[p,$t]],[/mobile vr; rv.+firefox/i],[[p,$t]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[p,Ct]],[/(aeobc)\b/i],[g,[b,tr],[p,Ct]],[/(homepod).+mac os/i],[g,[b,it],[p,Ct]],[/windows iot/i],[[p,Ct]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[g,[p,Ae,{mobile:"Mobile",xr:"VR","*":_}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,R]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[g,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[I,[y,nr+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[y,I],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[I,[y,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[y,I],[/ladybird\//i],[[y,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[I,y]],os:[[/(windows nt) (6\.[23]); arm/i],[[y,/N/,"R"],[I,Ae,Oi]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[y,I],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[I,/(;|\))/g,"",Ae,Oi],[y,Vr]],[/(windows ce)\/?([\d\.]*)/i],[y,I],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[I,/_/g,"."],[y,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[y,"macOS"],[I,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[I,[y,De+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[I,[y,De+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[I,[y,De+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[I,[y,De+" Linux"]],[/crkey\/([\d\.]+)/i],[I,[y,De]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[I,y],[/(ubuntu) ([\w\.]+) like android/i],[[y,/(.+)/,"$1 Touch"],I],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[y,I],[/\(bb(10);/i],[I,[y,Ci]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[I,[y,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[I,[y,kt+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[I,[y,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[I,Ae,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[y,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[I,[y,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[y,"Chrome OS"],I],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[y,I],[/(sunos) ?([\d\.]*)/i],[[y,"Solaris"],I],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[y,I]]},ar=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return xe.call(e.init,[[re,[y,I,yt,p]],[Ee,[ne]],[Se,[p,g,b]],[we,[y,I]],[fe,[y,I]]]),xe.call(e.isIgnore,[[re,[I,yt]],[we,[I]],[fe,[I]]]),xe.call(e.isIgnoreRgx,[[re,/ ?browser$/i],[fe,/ ?os$/i]]),xe.call(e.toString,[[re,[y,I]],[Ee,[ne]],[Se,[b,g]],[we,[y,I]],[fe,[y,I]]]),e}(),xa=function(e,t){var r=ar.init[t],n=ar.isIgnore[t]||0,i=ar.isIgnoreRgx[t]||0,o=ar.toString[t]||0;function s(){xe.call(this,r)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return Be?Be.getHighEntropyValues(yi).then(function(a){return e.setCH(new Ni(a,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=rt&&(s.prototype.is=function(a){var l=!1;for(var c in this)if(this.hasOwnProperty(c)&&!Gr(n,c)&&Oe(i?at(i,this[c]):this[c])==Oe(i?at(i,a):a)){if(l=!0,a!=Fe)break}else if(a==Fe&&l){l=!l;break}return l},s.prototype.toString=function(){var a=et;for(var l in o)typeof this[o[l]]!==Fe&&(a+=(a?" ":et)+this[o[l]]);return a||Fe}),Be||(s.prototype.then=function(a){var l=this,c=function(){for(var d in l)l.hasOwnProperty(d)&&(this[d]=l[d])};c.prototype={is:s.prototype.is,toString:s.prototype.toString};var u=new c;return a(u),u}),new s};function Ni(e,t){if(e=e||{},xe.call(this,yi),t)xe.call(this,[[Mr,zr(e[_e])],[Nr,zr(e[Ia])],[R,/\?1/.test(e[Aa])],[g,Et(e[ka])],[nt,Et(e[wi])],[Lr,Et(e[Ra])],[ne,Et(e[Ca])],[Ge,zr(e[va])],[er,Et(e[Sa])]]);else for(var r in e)this.hasOwnProperty(r)&&typeof e[r]!==Fe&&(this[r]=e[r])}function Li(e,t,r,n){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,o){return this.data[i]=o,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(ie&&ie.userAgent==this.ua)switch(this.itemType){case re:ie.brave&&typeof ie.brave.isBrave==Qt&&this.set(y,"Brave");break;case Se:!this.get(p)&&Be&&Be[R]&&this.set(p,R),this.get(g)=="Macintosh"&&ie&&typeof ie.standalone!==Fe&&ie.maxTouchPoints&&ie.maxTouchPoints>2&&this.set(g,"iPad").set(p,_);break;case fe:!this.get(y)&&Be&&Be[nt]&&this.set(y,Be[nt]);break;case rt:var i=this.data,o=function(s){return i[s].getItem().detectFeature().get()};this.set(re,o(re)).set(Ee,o(Ee)).set(Se,o(Se)).set(we,o(we)).set(fe,o(fe))}return this},this.parseUA=function(){return this.itemType!=rt&&qr.call(this.data,this.ua,this.rgxMap),this.itemType==re&&this.set(yt,Zr(this.get(I))),this},this.parseCH=function(){var i=this.uaCH,o=this.rgxMap;switch(this.itemType){case re:case we:var s=i[Nr]||i[Mr],a;if(s)for(var l in s){var c=s[l].brand||s[l],u=s[l].version;this.itemType==re&&!/not.a.brand/i.test(c)&&(!a||/Chrom/.test(a)&&c!=Ti||a==nr&&/WebView2/.test(c))&&(c=Ae(c,Oa),a=this.get(y),a&&!/Chrom/.test(a)&&/Chrom/.test(c)||this.set(y,c).set(I,u).set(yt,Zr(u)),a=c),this.itemType==we&&c==Ti&&this.set(I,u)}break;case Ee:var d=i[ne];d&&(d&&i[er]=="64"&&(d+="64"),qr.call(this.data,d+";",o));break;case Se:if(i[R]&&this.set(p,R),i[g]&&(this.set(g,i[g]),!this.get(p)||!this.get(b))){var m={};qr.call(m,"droid 9; "+i[g]+")",o),!this.get(p)&&m.type&&this.set(p,m.type),!this.get(b)&&m.vendor&&this.set(b,m.vendor)}if(i[Ge]){var w;if(typeof i[Ge]!="string")for(var f=0;!w&&f<i[Ge].length;)w=Ae(i[Ge][f++],xi);else w=Ae(i[Ge],xi);this.set(p,w)}break;case fe:var v=i[nt];if(v){var C=i[Lr];v==Vr&&(C=parseInt(Zr(C),10)>=13?"11":"10"),this.set(y,v).set(I,C)}this.get(y)==Vr&&i[g]=="Xbox"&&this.set(y,"Xbox").set(I,void 0);break;case rt:var k=this.data,S=function(A){return k[A].getItem().setCH(i).parseCH().get()};this.set(re,S(re)).set(Ee,S(Ee)).set(Se,S(Se)).set(we,S(we)).set(fe,S(fe))}return this},xe.call(this,[["itemType",e],["ua",t],["uaCH",n],["rgxMap",r],["data",xa(this,e)]]),this}function Me(e,t,r){if(typeof e===tt?(sr(e,!0)?(typeof t===tt&&(r=t),t=e):(r=e,t=void 0),e=void 0):typeof e===xr&&!sr(t,!0)&&(r=t,t=void 0),r&&typeof r.append===Qt){var n={};r.forEach(function(l,c){n[c]=l}),r=n}if(!(this instanceof Me))return new Me(e,t,r).getResult();var i=typeof e===xr?e:r&&r[gi]?r[gi]:ie&&ie.userAgent?ie.userAgent:et,o=new Ni(r,!0),s=t?Ea(Mi,t):Mi,a=function(l){return l==rt?function(){return new Li(l,i,s,o).set("ua",i).set(re,this.getBrowser()).set(Ee,this.getCPU()).set(Se,this.getDevice()).set(we,this.getEngine()).set(fe,this.getOS()).get()}:function(){return new Li(l,i,s[l],o).parseUA().get()}};return xe.call(this,[["getBrowser",a(re)],["getCPU",a(Ee)],["getDevice",a(Se)],["getEngine",a(we)],["getOS",a(fe)],["getResult",a(rt)],["getUA",function(){return i}],["setUA",function(l){return ot(l)&&(i=l.length>Or?or(l,Or):l),this}]]).setUA(i),this}Me.VERSION=ya,Me.BROWSER=ir([y,I,yt,p]),Me.CPU=ir([ne]),Me.DEVICE=ir([g,b,p,It,R,V,_,ve,Ct]),Me.ENGINE=Me.OS=ir([y,I]);class Ma{constructor(t,r,n){this.window=t,this.publicToken=r,this.recorderSettings=n,n.maskingLevel==null&&(n.maskingLevel="input-and-textarea"),this.sessionRecorder=new ba(n),this.eventRecorder=new wa(t,n),Er("public/captured-sessions",{publicToken:r},{withCredentials:!1}).then(i=>{const o=i.data;this.capturedSessionId=o,this.sessionRecorder.setCapturedSessionId(o),this.eventRecorder.setCapturedSessionId(o),this.schedulePing();const s=this.collectCapturedUserMetadata();Er(`public/captured-sessions/${this.capturedSessionId}/captured-session/metadata`,s,{withCredentials:!1})}).catch(i=>{console.error(i),this.sessionRecorder.stop(),this.eventRecorder.stop()})}sessionRecorder;eventRecorder;capturedSessionId=null;pingIntervalMs=2e4;pingTimeout=null;schedulePing(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(this.ping,this.pingIntervalMs)}ping=async()=>{await ma(`public/captured-sessions/${this.capturedSessionId}/ping`,{},{withCredentials:!1}),this.schedulePing()};start(){this.sessionRecorder.start(),this.eventRecorder.start()}stop(){this.sessionRecorder.stop(),this.eventRecorder.stop()}collectCapturedUserMetadata=()=>{const t=new Me,r=t.getBrowser().name,n=t.getBrowser().version,i=t.getOS().name,o=t.getOS().version,s=t.getDevice().type??"desktop",a=navigator.language,l=Intl.DateTimeFormat().resolvedOptions().timeZone,c=document.referrer||void 0;let u;try{u=c?new URL(c).hostname:void 0}catch{}const d=window.innerWidth||document.documentElement.clientWidth,m=window.innerHeight||document.documentElement.clientHeight,w=new URL(window.location.href),f=w.searchParams.get("utm_source")||w.searchParams.get("source")||w.searchParams.get("ref")||void 0,v=w.searchParams.get("utm_medium")||w.searchParams.get("medium")||void 0,C=w.searchParams.get("utm_campaign")||w.searchParams.get("campaign")||void 0,k=w.searchParams.get("utm_content")||w.searchParams.get("content")||void 0,S=w.searchParams.get("utm_term")||w.searchParams.get("term")||void 0;return{browserName:r,browserVersion:n,osName:i,osVersion:o,deviceType:s,browserLanguage:a,browserTimeZone:l,referringUrl:c,referringDomain:u,viewportWidth:d,viewportHeight:m,utmSource:f,utmMedium:v,utmCampaign:C,utmContent:k,utmTerm:S}}}var j=(e=>(e.None="none",e.All="all",e.InputAndTextArea="input-and-textarea",e.InputPasswordOrEmailAndTextArea="input-password-or-email-and-textarea",e))(j||{});return xt.MaskingLevel=j,xt.Recorder=Ma,Object.defineProperty(xt,Symbol.toStringTag,{value:"Module"}),xt}({});
3
+ or you can use record.mirror to access the mirror instance during recording.`;let _mirror={map:{},getId(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),-1},getNode(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),null},removeNodeFromMap(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)},has(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),!1},reset(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(_mirror=new Proxy(_mirror,{get(target,prop,receiver){return prop==="map"&&console.error(DEPARTED_MIRROR_ACCESS_WARNING),Reflect.get(target,prop,receiver)}}));function throttle$1(func,wait,options={}){let timeout=null,previous=0;return function(...args){const now=Date.now();!previous&&options.leading===!1&&(previous=now);const remaining=wait-(now-previous),context=this;remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=now,func.apply(context,args)):!timeout&&options.trailing!==!1&&(timeout=setTimeout(()=>{previous=options.leading===!1?0:Date.now(),timeout=null,func.apply(context,args)},remaining))}}function hookSetter(target,key,d,isRevoked,win=window){const original=win.Object.getOwnPropertyDescriptor(target,key);return win.Object.defineProperty(target,key,isRevoked?d:{set(value){setTimeout(()=>{d.set.call(this,value)},0),original&&original.set&&original.set.call(this,value)}}),()=>hookSetter(target,key,original||{},!0)}function patch$1(source,name,replacement){try{if(!(name in source))return()=>{};const original=source[name],wrapped=replacement(original);return typeof wrapped=="function"&&(wrapped.prototype=wrapped.prototype||{},Object.defineProperties(wrapped,{__rrweb_original__:{enumerable:!1,value:original}})),source[name]=wrapped,()=>{source[name]=original}}catch{return()=>{}}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(node,blockClass,blockSelector,checkAncestors){if(!node)return!1;const el=node.nodeType===node.ELEMENT_NODE?node:node.parentElement;if(!el)return!1;if(typeof blockClass=="string"){if(el.classList.contains(blockClass)||checkAncestors&&el.closest("."+blockClass)!==null)return!0}else if(classMatchesRegex(el,blockClass,checkAncestors))return!0;return!!(blockSelector&&(node.matches(blockSelector)||checkAncestors&&el.closest(blockSelector)!==null))}function isSerialized(n,mirror2){return mirror2.getId(n)!==-1}function isIgnored(n,mirror2){return mirror2.getId(n)===IGNORED_NODE}function isAncestorRemoved(target,mirror2){if(isShadowRoot(target))return!1;const id=mirror2.getId(target);return mirror2.has(id)?target.parentNode&&target.parentNode.nodeType===target.DOCUMENT_NODE?!1:target.parentNode?isAncestorRemoved(target.parentNode,mirror2):!0:!0}function isTouchEvent(event){return!!event.changedTouches}function polyfill(win=window){"NodeList"in win&&!win.NodeList.prototype.forEach&&(win.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in win&&!win.DOMTokenList.prototype.forEach&&(win.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...args)=>{let node=args[0];if(!(0 in args))throw new TypeError("1 argument is required");do if(this===node)return!0;while(node=node&&node.parentNode);return!1})}function isSerializedIframe(n,mirror2){return!!(n.nodeName==="IFRAME"&&mirror2.getMeta(n))}function isSerializedStylesheet(n,mirror2){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&mirror2.getMeta(n))}function hasShadowRoot(n){return!!n?.shadowRoot}class StyleSheetMirror{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(stylesheet){var _a;return(_a=this.styleIDMap.get(stylesheet))!==null&&_a!==void 0?_a:-1}has(stylesheet){return this.styleIDMap.has(stylesheet)}add(stylesheet,id){if(this.has(stylesheet))return this.getId(stylesheet);let newId;return id===void 0?newId=this.id++:newId=id,this.styleIDMap.set(stylesheet,newId),this.idStyleMap.set(newId,stylesheet),newId}getStyle(id){return this.idStyleMap.get(id)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var EventType=(EventType2=>(EventType2[EventType2.DomContentLoaded=0]="DomContentLoaded",EventType2[EventType2.Load=1]="Load",EventType2[EventType2.FullSnapshot=2]="FullSnapshot",EventType2[EventType2.IncrementalSnapshot=3]="IncrementalSnapshot",EventType2[EventType2.Meta=4]="Meta",EventType2[EventType2.Custom=5]="Custom",EventType2[EventType2.Plugin=6]="Plugin",EventType2))(EventType||{}),IncrementalSource=(IncrementalSource2=>(IncrementalSource2[IncrementalSource2.Mutation=0]="Mutation",IncrementalSource2[IncrementalSource2.MouseMove=1]="MouseMove",IncrementalSource2[IncrementalSource2.MouseInteraction=2]="MouseInteraction",IncrementalSource2[IncrementalSource2.Scroll=3]="Scroll",IncrementalSource2[IncrementalSource2.ViewportResize=4]="ViewportResize",IncrementalSource2[IncrementalSource2.Input=5]="Input",IncrementalSource2[IncrementalSource2.TouchMove=6]="TouchMove",IncrementalSource2[IncrementalSource2.MediaInteraction=7]="MediaInteraction",IncrementalSource2[IncrementalSource2.StyleSheetRule=8]="StyleSheetRule",IncrementalSource2[IncrementalSource2.CanvasMutation=9]="CanvasMutation",IncrementalSource2[IncrementalSource2.Font=10]="Font",IncrementalSource2[IncrementalSource2.Log=11]="Log",IncrementalSource2[IncrementalSource2.Drag=12]="Drag",IncrementalSource2[IncrementalSource2.StyleDeclaration=13]="StyleDeclaration",IncrementalSource2[IncrementalSource2.Selection=14]="Selection",IncrementalSource2[IncrementalSource2.AdoptedStyleSheet=15]="AdoptedStyleSheet",IncrementalSource2))(IncrementalSource||{}),MouseInteractions=(MouseInteractions2=>(MouseInteractions2[MouseInteractions2.MouseUp=0]="MouseUp",MouseInteractions2[MouseInteractions2.MouseDown=1]="MouseDown",MouseInteractions2[MouseInteractions2.Click=2]="Click",MouseInteractions2[MouseInteractions2.ContextMenu=3]="ContextMenu",MouseInteractions2[MouseInteractions2.DblClick=4]="DblClick",MouseInteractions2[MouseInteractions2.Focus=5]="Focus",MouseInteractions2[MouseInteractions2.Blur=6]="Blur",MouseInteractions2[MouseInteractions2.TouchStart=7]="TouchStart",MouseInteractions2[MouseInteractions2.TouchMove_Departed=8]="TouchMove_Departed",MouseInteractions2[MouseInteractions2.TouchEnd=9]="TouchEnd",MouseInteractions2[MouseInteractions2.TouchCancel=10]="TouchCancel",MouseInteractions2))(MouseInteractions||{}),CanvasContext=(CanvasContext2=>(CanvasContext2[CanvasContext2["2D"]=0]="2D",CanvasContext2[CanvasContext2.WebGL=1]="WebGL",CanvasContext2[CanvasContext2.WebGL2=2]="WebGL2",CanvasContext2))(CanvasContext||{});function isNodeInLinkedList(n){return"__ln"in n}class DoubleLinkedList{constructor(){this.length=0,this.head=null}get(position){if(position>=this.length)throw new Error("Position outside of list range");let current=this.head;for(let index=0;index<position;index++)current=current?.next||null;return current}addNode(n){const node={value:n,previous:null,next:null};if(n.__ln=node,n.previousSibling&&isNodeInLinkedList(n.previousSibling)){const current=n.previousSibling.__ln.next;node.next=current,node.previous=n.previousSibling.__ln,n.previousSibling.__ln.next=node,current&&(current.previous=node)}else if(n.nextSibling&&isNodeInLinkedList(n.nextSibling)&&n.nextSibling.__ln.previous){const current=n.nextSibling.__ln.previous;node.previous=current,node.next=n.nextSibling.__ln,n.nextSibling.__ln.previous=node,current&&(current.next=node)}else this.head&&(this.head.previous=node),node.next=this.head,this.head=node;this.length++}removeNode(n){const current=n.__ln;this.head&&(current.previous?(current.previous.next=current.next,current.next&&(current.next.previous=current.previous)):(this.head=current.next,this.head&&(this.head.previous=null)),n.__ln&&delete n.__ln,this.length--)}}const moveKey=(id,parentId)=>`${id}@${parentId}`;class MutationBuffer{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=mutations=>{mutations.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const adds=[],addList=new DoubleLinkedList,getNextId=n=>{let ns=n,nextId=IGNORED_NODE;for(;nextId===IGNORED_NODE;)ns=ns&&ns.nextSibling,nextId=ns&&this.mirror.getId(ns);return nextId},pushAdd=n=>{var _a,_b,_c,_d;let shadowHost=null;((_b=(_a=n.getRootNode)===null||_a===void 0?void 0:_a.call(n))===null||_b===void 0?void 0:_b.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(shadowHost=n.getRootNode().host);let rootShadowHost=shadowHost;for(;((_d=(_c=rootShadowHost?.getRootNode)===null||_c===void 0?void 0:_c.call(rootShadowHost))===null||_d===void 0?void 0:_d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rootShadowHost.getRootNode().host;)rootShadowHost=rootShadowHost.getRootNode().host;const notInDoc=!this.doc.contains(n)&&(!rootShadowHost||!this.doc.contains(rootShadowHost));if(!n.parentNode||notInDoc)return;const parentId=isShadowRoot(n.parentNode)?this.mirror.getId(shadowHost):this.mirror.getId(n.parentNode),nextId=getNextId(n);if(parentId===-1||nextId===-1)return addList.addNode(n);const sn=serializeNodeWithId(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:currentN=>{isSerializedIframe(currentN,this.mirror)&&this.iframeManager.addIframe(currentN),isSerializedStylesheet(currentN,this.mirror)&&this.stylesheetManager.trackLinkElement(currentN),hasShadowRoot(n)&&this.shadowDomManager.addShadowRoot(n.shadowRoot,this.doc)},onIframeLoad:(iframe,childSn)=>{this.iframeManager.attachIframe(iframe,childSn),this.shadowDomManager.observeAttachShadow(iframe)},onStylesheetLoad:(link,childSn)=>{this.stylesheetManager.attachLinkElement(link,childSn)}});sn&&adds.push({parentId,nextId,node:sn})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const n of Array.from(this.movedSet.values()))isParentRemoved(this.removes,n,this.mirror)&&!this.movedSet.has(n.parentNode)||pushAdd(n);for(const n of Array.from(this.addedSet.values()))!isAncestorInSet(this.droppedSet,n)&&!isParentRemoved(this.removes,n,this.mirror)||isAncestorInSet(this.movedSet,n)?pushAdd(n):this.droppedSet.add(n);let candidate=null;for(;addList.length;){let node=null;if(candidate){const parentId=this.mirror.getId(candidate.value.parentNode),nextId=getNextId(candidate.value);parentId!==-1&&nextId!==-1&&(node=candidate)}if(!node)for(let index=addList.length-1;index>=0;index--){const _node=addList.get(index);if(_node){const parentId=this.mirror.getId(_node.value.parentNode);if(getNextId(_node.value)===-1)continue;if(parentId!==-1){node=_node;break}else{const unhandledNode=_node.value;if(unhandledNode.parentNode&&unhandledNode.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const shadowHost=unhandledNode.parentNode.host;if(this.mirror.getId(shadowHost)!==-1){node=_node;break}}}}}if(!node){for(;addList.head;)addList.removeNode(addList.head.value);break}candidate=node.previous,addList.removeNode(node.value),pushAdd(node.value)}const payload={texts:this.texts.map(text=>({id:this.mirror.getId(text.node),value:text.value})).filter(text=>this.mirror.has(text.id)),attributes:this.attributes.map(attribute=>({id:this.mirror.getId(attribute.node),attributes:attribute.attributes})).filter(attribute=>this.mirror.has(attribute.id)),removes:this.removes,adds};!payload.texts.length&&!payload.attributes.length&&!payload.removes.length&&!payload.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(payload))},this.processMutation=m=>{if(!isIgnored(m.target,this.mirror))switch(m.type){case"characterData":{const value=m.target.textContent;!isBlocked(m.target,this.blockClass,this.blockSelector,!1)&&value!==m.oldValue&&this.texts.push({value:needMaskingText(m.target,this.maskTextClass,this.maskTextSelector)&&value?this.maskTextFn?this.maskTextFn(value):value.replace(/[\S]/g,"*"):value,node:m.target});break}case"attributes":{const target=m.target;let value=m.target.getAttribute(m.attributeName);if(m.attributeName==="value"&&(value=maskInputValue({maskInputOptions:this.maskInputOptions,tagName:m.target.tagName,type:m.target.getAttribute("type"),value,maskInputFn:this.maskInputFn})),isBlocked(m.target,this.blockClass,this.blockSelector,!1)||value===m.oldValue)return;let item=this.attributes.find(a=>a.node===m.target);if(target.tagName==="IFRAME"&&m.attributeName==="src"&&!this.keepIframeSrcFn(value))if(!target.contentDocument)m.attributeName="rr_src";else return;if(item||(item={node:m.target,attributes:{}},this.attributes.push(item)),m.attributeName==="style"){const old=this.doc.createElement("span");m.oldValue&&old.setAttribute("style",m.oldValue),(item.attributes.style===void 0||item.attributes.style===null)&&(item.attributes.style={});const styleObj=item.attributes.style;for(const pname of Array.from(target.style)){const newValue=target.style.getPropertyValue(pname),newPriority=target.style.getPropertyPriority(pname);(newValue!==old.style.getPropertyValue(pname)||newPriority!==old.style.getPropertyPriority(pname))&&(newPriority===""?styleObj[pname]=newValue:styleObj[pname]=[newValue,newPriority])}for(const pname of Array.from(old.style))target.style.getPropertyValue(pname)===""&&(styleObj[pname]=!1)}else item.attributes[m.attributeName]=transformAttribute(this.doc,target.tagName,m.attributeName,value);break}case"childList":{if(isBlocked(m.target,this.blockClass,this.blockSelector,!0))return;m.addedNodes.forEach(n=>this.genAdds(n,m.target)),m.removedNodes.forEach(n=>{const nodeId=this.mirror.getId(n),parentId=isShadowRoot(m.target)?this.mirror.getId(m.target.host):this.mirror.getId(m.target);isBlocked(m.target,this.blockClass,this.blockSelector,!1)||isIgnored(n,this.mirror)||!isSerialized(n,this.mirror)||(this.addedSet.has(n)?(deepDelete(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(m.target)&&nodeId===-1||isAncestorRemoved(m.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[moveKey(nodeId,parentId)]?deepDelete(this.movedSet,n):this.removes.push({parentId,id:nodeId,isShadow:isShadowRoot(m.target)&&isNativeShadowDom(m.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(n,target)=>{if(this.mirror.hasNode(n)){if(isIgnored(n,this.mirror))return;this.movedSet.add(n);let targetId=null;target&&this.mirror.hasNode(target)&&(targetId=this.mirror.getId(target)),targetId&&targetId!==-1&&(this.movedMap[moveKey(this.mirror.getId(n),targetId)]=!0)}else this.addedSet.add(n),this.droppedSet.delete(n);isBlocked(n,this.blockClass,this.blockSelector,!1)||n.childNodes.forEach(childN=>this.genAdds(childN))}}init(options){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(key=>{this[key]=options[key]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function deepDelete(addsSet,n){addsSet.delete(n),n.childNodes.forEach(childN=>deepDelete(addsSet,childN))}function isParentRemoved(removes,n,mirror2){return removes.length===0?!1:_isParentRemoved(removes,n,mirror2)}function _isParentRemoved(removes,n,mirror2){const{parentNode}=n;if(!parentNode)return!1;const parentId=mirror2.getId(parentNode);return removes.some(r=>r.id===parentId)?!0:_isParentRemoved(removes,parentNode,mirror2)}function isAncestorInSet(set,n){return set.size===0?!1:_isAncestorInSet(set,n)}function _isAncestorInSet(set,n){const{parentNode}=n;return parentNode?set.has(parentNode)?!0:_isAncestorInSet(set,parentNode):!1}const mutationBuffers=[],isCSSGroupingRuleSupported=typeof CSSGroupingRule<"u",isCSSMediaRuleSupported=typeof CSSMediaRule<"u",isCSSSupportsRuleSupported=typeof CSSSupportsRule<"u",isCSSConditionRuleSupported=typeof CSSConditionRule<"u";function getEventTarget(event){try{if("composedPath"in event){const path=event.composedPath();if(path.length)return path[0]}else if("path"in event&&event.path.length)return event.path[0];return event.target}catch{return event.target}}function initMutationObserver(options,rootEl){var _a,_b;const mutationBuffer=new MutationBuffer;mutationBuffers.push(mutationBuffer),mutationBuffer.init(options);let mutationObserverCtor=window.MutationObserver||window.__rrMutationObserver;const angularZoneSymbol=(_b=(_a=window?.Zone)===null||_a===void 0?void 0:_a.__symbol__)===null||_b===void 0?void 0:_b.call(_a,"MutationObserver");angularZoneSymbol&&window[angularZoneSymbol]&&(mutationObserverCtor=window[angularZoneSymbol]);const observer=new mutationObserverCtor(mutationBuffer.processMutations.bind(mutationBuffer));return observer.observe(rootEl,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),observer}function initMoveObserver({mousemoveCb,sampling,doc,mirror:mirror2}){if(sampling.mousemove===!1)return()=>{};const threshold=typeof sampling.mousemove=="number"?sampling.mousemove:50,callbackThreshold=typeof sampling.mousemoveCallback=="number"?sampling.mousemoveCallback:500;let positions=[],timeBaseline;const wrappedCb=throttle$1(source=>{const totalOffset=Date.now()-timeBaseline;mousemoveCb(positions.map(p=>(p.timeOffset-=totalOffset,p)),source),positions=[],timeBaseline=null},callbackThreshold),updatePosition=throttle$1(evt=>{const target=getEventTarget(evt),{clientX,clientY}=isTouchEvent(evt)?evt.changedTouches[0]:evt;timeBaseline||(timeBaseline=Date.now()),positions.push({x:clientX,y:clientY,id:mirror2.getId(target),timeOffset:Date.now()-timeBaseline}),wrappedCb(typeof DragEvent<"u"&&evt instanceof DragEvent?IncrementalSource.Drag:evt instanceof MouseEvent?IncrementalSource.MouseMove:IncrementalSource.TouchMove)},threshold,{trailing:!1}),handlers=[on("mousemove",updatePosition,doc),on("touchmove",updatePosition,doc),on("drag",updatePosition,doc)];return()=>{handlers.forEach(h=>h())}}function initMouseInteractionObserver({mouseInteractionCb,doc,mirror:mirror2,blockClass,blockSelector,sampling}){if(sampling.mouseInteraction===!1)return()=>{};const disableMap=sampling.mouseInteraction===!0||sampling.mouseInteraction===void 0?{}:sampling.mouseInteraction,handlers=[],getHandler=eventKey=>event=>{const target=getEventTarget(event);if(isBlocked(target,blockClass,blockSelector,!0))return;const e=isTouchEvent(event)?event.changedTouches[0]:event;if(!e)return;const id=mirror2.getId(target),{clientX,clientY}=e;mouseInteractionCb({type:MouseInteractions[eventKey],id,x:clientX,y:clientY})};return Object.keys(MouseInteractions).filter(key=>Number.isNaN(Number(key))&&!key.endsWith("_Departed")&&disableMap[key]!==!1).forEach(eventKey=>{const eventName=eventKey.toLowerCase(),handler=getHandler(eventKey);handlers.push(on(eventName,handler,doc))}),()=>{handlers.forEach(h=>h())}}function initScrollObserver({scrollCb,doc,mirror:mirror2,blockClass,blockSelector,sampling}){const updatePosition=throttle$1(evt=>{const target=getEventTarget(evt);if(!target||isBlocked(target,blockClass,blockSelector,!0))return;const id=mirror2.getId(target);if(target===doc){const scrollEl=doc.scrollingElement||doc.documentElement;scrollCb({id,x:scrollEl.scrollLeft,y:scrollEl.scrollTop})}else scrollCb({id,x:target.scrollLeft,y:target.scrollTop})},sampling.scroll||100);return on("scroll",updatePosition,doc)}function initViewportResizeObserver({viewportResizeCb}){let lastH=-1,lastW=-1;const updateDimension=throttle$1(()=>{const height=getWindowHeight(),width=getWindowWidth();(lastH!==height||lastW!==width)&&(viewportResizeCb({width:Number(width),height:Number(height)}),lastH=height,lastW=width)},200);return on("resize",updateDimension,window)}function wrapEventWithUserTriggeredFlag(v,enable){const value=Object.assign({},v);return enable||delete value.userTriggered,value}const INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver({inputCb,doc,mirror:mirror2,blockClass,blockSelector,ignoreClass,maskInputOptions,maskInputFn,sampling,userTriggeredOnInput}){function eventHandler(event){let target=getEventTarget(event);const userTriggered=event.isTrusted;if(target&&target.tagName==="OPTION"&&(target=target.parentElement),!target||!target.tagName||INPUT_TAGS.indexOf(target.tagName)<0||isBlocked(target,blockClass,blockSelector,!0))return;const type=target.type;if(target.classList.contains(ignoreClass))return;let text=target.value,isChecked=!1;type==="radio"||type==="checkbox"?isChecked=target.checked:(maskInputOptions[target.tagName.toLowerCase()]||maskInputOptions[type])&&(text=maskInputValue({maskInputOptions,tagName:target.tagName,type,value:text,maskInputFn})),cbWithDedup(target,wrapEventWithUserTriggeredFlag({text,isChecked,userTriggered},userTriggeredOnInput));const name=target.name;type==="radio"&&name&&isChecked&&doc.querySelectorAll(`input[type="radio"][name="${name}"]`).forEach(el=>{el!==target&&cbWithDedup(el,wrapEventWithUserTriggeredFlag({text:el.value,isChecked:!isChecked,userTriggered:!1},userTriggeredOnInput))})}function cbWithDedup(target,v){const lastInputValue=lastInputValueMap.get(target);if(!lastInputValue||lastInputValue.text!==v.text||lastInputValue.isChecked!==v.isChecked){lastInputValueMap.set(target,v);const id=mirror2.getId(target);inputCb(Object.assign(Object.assign({},v),{id}))}}const handlers=(sampling.input==="last"?["change"]:["input","change"]).map(eventName=>on(eventName,eventHandler,doc)),currentWindow=doc.defaultView;if(!currentWindow)return()=>{handlers.forEach(h=>h())};const propertyDescriptor=currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype,"value"),hookProperties=[[currentWindow.HTMLInputElement.prototype,"value"],[currentWindow.HTMLInputElement.prototype,"checked"],[currentWindow.HTMLSelectElement.prototype,"value"],[currentWindow.HTMLTextAreaElement.prototype,"value"],[currentWindow.HTMLSelectElement.prototype,"selectedIndex"],[currentWindow.HTMLOptionElement.prototype,"selected"]];return propertyDescriptor&&propertyDescriptor.set&&handlers.push(...hookProperties.map(p=>hookSetter(p[0],p[1],{set(){eventHandler({target:this})}},!1,currentWindow))),()=>{handlers.forEach(h=>h())}}function getNestedCSSRulePositions(rule){const positions=[];function recurse(childRule,pos){if(isCSSGroupingRuleSupported&&childRule.parentRule instanceof CSSGroupingRule||isCSSMediaRuleSupported&&childRule.parentRule instanceof CSSMediaRule||isCSSSupportsRuleSupported&&childRule.parentRule instanceof CSSSupportsRule||isCSSConditionRuleSupported&&childRule.parentRule instanceof CSSConditionRule){const index=Array.from(childRule.parentRule.cssRules).indexOf(childRule);pos.unshift(index)}else if(childRule.parentStyleSheet){const index=Array.from(childRule.parentStyleSheet.cssRules).indexOf(childRule);pos.unshift(index)}return pos}return recurse(rule,positions)}function getIdAndStyleId(sheet,mirror2,styleMirror){let id,styleId;return sheet?(sheet.ownerNode?id=mirror2.getId(sheet.ownerNode):styleId=styleMirror.getId(sheet),{styleId,id}):{}}function initStyleSheetObserver({styleSheetRuleCb,mirror:mirror2,stylesheetManager},{win}){const insertRule=win.CSSStyleSheet.prototype.insertRule;win.CSSStyleSheet.prototype.insertRule=function(rule,index){const{id,styleId}=getIdAndStyleId(this,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,adds:[{rule,index}]}),insertRule.apply(this,[rule,index])};const deleteRule=win.CSSStyleSheet.prototype.deleteRule;win.CSSStyleSheet.prototype.deleteRule=function(index){const{id,styleId}=getIdAndStyleId(this,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,removes:[{index}]}),deleteRule.apply(this,[index])};let replace;win.CSSStyleSheet.prototype.replace&&(replace=win.CSSStyleSheet.prototype.replace,win.CSSStyleSheet.prototype.replace=function(text){const{id,styleId}=getIdAndStyleId(this,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,replace:text}),replace.apply(this,[text])});let replaceSync;win.CSSStyleSheet.prototype.replaceSync&&(replaceSync=win.CSSStyleSheet.prototype.replaceSync,win.CSSStyleSheet.prototype.replaceSync=function(text){const{id,styleId}=getIdAndStyleId(this,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,replaceSync:text}),replaceSync.apply(this,[text])});const supportedNestedCSSRuleTypes={};isCSSGroupingRuleSupported?supportedNestedCSSRuleTypes.CSSGroupingRule=win.CSSGroupingRule:(isCSSMediaRuleSupported&&(supportedNestedCSSRuleTypes.CSSMediaRule=win.CSSMediaRule),isCSSConditionRuleSupported&&(supportedNestedCSSRuleTypes.CSSConditionRule=win.CSSConditionRule),isCSSSupportsRuleSupported&&(supportedNestedCSSRuleTypes.CSSSupportsRule=win.CSSSupportsRule));const unmodifiedFunctions={};return Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey,type])=>{unmodifiedFunctions[typeKey]={insertRule:type.prototype.insertRule,deleteRule:type.prototype.deleteRule},type.prototype.insertRule=function(rule,index){const{id,styleId}=getIdAndStyleId(this.parentStyleSheet,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,adds:[{rule,index:[...getNestedCSSRulePositions(this),index||0]}]}),unmodifiedFunctions[typeKey].insertRule.apply(this,[rule,index])},type.prototype.deleteRule=function(index){const{id,styleId}=getIdAndStyleId(this.parentStyleSheet,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleSheetRuleCb({id,styleId,removes:[{index:[...getNestedCSSRulePositions(this),index]}]}),unmodifiedFunctions[typeKey].deleteRule.apply(this,[index])}}),()=>{win.CSSStyleSheet.prototype.insertRule=insertRule,win.CSSStyleSheet.prototype.deleteRule=deleteRule,replace&&(win.CSSStyleSheet.prototype.replace=replace),replaceSync&&(win.CSSStyleSheet.prototype.replaceSync=replaceSync),Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey,type])=>{type.prototype.insertRule=unmodifiedFunctions[typeKey].insertRule,type.prototype.deleteRule=unmodifiedFunctions[typeKey].deleteRule})}}function initAdoptedStyleSheetObserver({mirror:mirror2,stylesheetManager},host){var _a,_b,_c;let hostId=null;host.nodeName==="#document"?hostId=mirror2.getId(host):hostId=mirror2.getId(host.host);const patchTarget=host.nodeName==="#document"?(_a=host.defaultView)===null||_a===void 0?void 0:_a.Document:(_c=(_b=host.ownerDocument)===null||_b===void 0?void 0:_b.defaultView)===null||_c===void 0?void 0:_c.ShadowRoot,originalPropertyDescriptor=Object.getOwnPropertyDescriptor(patchTarget?.prototype,"adoptedStyleSheets");return hostId===null||hostId===-1||!patchTarget||!originalPropertyDescriptor?()=>{}:(Object.defineProperty(host,"adoptedStyleSheets",{configurable:originalPropertyDescriptor.configurable,enumerable:originalPropertyDescriptor.enumerable,get(){var _a2;return(_a2=originalPropertyDescriptor.get)===null||_a2===void 0?void 0:_a2.call(this)},set(sheets){var _a2;const result=(_a2=originalPropertyDescriptor.set)===null||_a2===void 0?void 0:_a2.call(this,sheets);if(hostId!==null&&hostId!==-1)try{stylesheetManager.adoptStyleSheets(sheets,hostId)}catch{}return result}}),()=>{Object.defineProperty(host,"adoptedStyleSheets",{configurable:originalPropertyDescriptor.configurable,enumerable:originalPropertyDescriptor.enumerable,get:originalPropertyDescriptor.get,set:originalPropertyDescriptor.set})})}function initStyleDeclarationObserver({styleDeclarationCb,mirror:mirror2,ignoreCSSAttributes,stylesheetManager},{win}){const setProperty=win.CSSStyleDeclaration.prototype.setProperty;win.CSSStyleDeclaration.prototype.setProperty=function(property,value,priority){var _a;if(ignoreCSSAttributes.has(property))return setProperty.apply(this,[property,value,priority]);const{id,styleId}=getIdAndStyleId((_a=this.parentRule)===null||_a===void 0?void 0:_a.parentStyleSheet,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleDeclarationCb({id,styleId,set:{property,value,priority},index:getNestedCSSRulePositions(this.parentRule)}),setProperty.apply(this,[property,value,priority])};const removeProperty=win.CSSStyleDeclaration.prototype.removeProperty;return win.CSSStyleDeclaration.prototype.removeProperty=function(property){var _a;if(ignoreCSSAttributes.has(property))return removeProperty.apply(this,[property]);const{id,styleId}=getIdAndStyleId((_a=this.parentRule)===null||_a===void 0?void 0:_a.parentStyleSheet,mirror2,stylesheetManager.styleMirror);return(id&&id!==-1||styleId&&styleId!==-1)&&styleDeclarationCb({id,styleId,remove:{property},index:getNestedCSSRulePositions(this.parentRule)}),removeProperty.apply(this,[property])},()=>{win.CSSStyleDeclaration.prototype.setProperty=setProperty,win.CSSStyleDeclaration.prototype.removeProperty=removeProperty}}function initMediaInteractionObserver({mediaInteractionCb,blockClass,blockSelector,mirror:mirror2,sampling}){const handler=type=>throttle$1(event=>{const target=getEventTarget(event);if(!target||isBlocked(target,blockClass,blockSelector,!0))return;const{currentTime,volume,muted,playbackRate}=target;mediaInteractionCb({type,id:mirror2.getId(target),currentTime,volume,muted,playbackRate})},sampling.media||500),handlers=[on("play",handler(0)),on("pause",handler(1)),on("seeked",handler(2)),on("volumechange",handler(3)),on("ratechange",handler(4))];return()=>{handlers.forEach(h=>h())}}function initFontObserver({fontCb,doc}){const win=doc.defaultView;if(!win)return()=>{};const handlers=[],fontMap=new WeakMap,originalFontFace=win.FontFace;win.FontFace=function(family,source,descriptors2){const fontFace=new originalFontFace(family,source,descriptors2);return fontMap.set(fontFace,{family,buffer:typeof source!="string",descriptors:descriptors2,fontSource:typeof source=="string"?source:JSON.stringify(Array.from(new Uint8Array(source)))}),fontFace};const restoreHandler=patch$1(doc.fonts,"add",function(original){return function(fontFace){return setTimeout(()=>{const p=fontMap.get(fontFace);p&&(fontCb(p),fontMap.delete(fontFace))},0),original.apply(this,[fontFace])}});return handlers.push(()=>{win.FontFace=originalFontFace}),handlers.push(restoreHandler),()=>{handlers.forEach(h=>h())}}function initSelectionObserver(param){const{doc,mirror:mirror2,blockClass,blockSelector,selectionCb}=param;let collapsed=!0;const updateSelection=()=>{const selection=doc.getSelection();if(!selection||collapsed&&selection?.isCollapsed)return;collapsed=selection.isCollapsed||!1;const ranges=[],count=selection.rangeCount||0;for(let i2=0;i2<count;i2++){const range=selection.getRangeAt(i2),{startContainer,startOffset,endContainer,endOffset}=range;isBlocked(startContainer,blockClass,blockSelector,!0)||isBlocked(endContainer,blockClass,blockSelector,!0)||ranges.push({start:mirror2.getId(startContainer),startOffset,end:mirror2.getId(endContainer),endOffset})}selectionCb({ranges})};return updateSelection(),on("selectionchange",updateSelection)}function mergeHooks(o,hooks){const{mutationCb,mousemoveCb,mouseInteractionCb,scrollCb,viewportResizeCb,inputCb,mediaInteractionCb,styleSheetRuleCb,styleDeclarationCb,canvasMutationCb,fontCb,selectionCb}=o;o.mutationCb=(...p)=>{hooks.mutation&&hooks.mutation(...p),mutationCb(...p)},o.mousemoveCb=(...p)=>{hooks.mousemove&&hooks.mousemove(...p),mousemoveCb(...p)},o.mouseInteractionCb=(...p)=>{hooks.mouseInteraction&&hooks.mouseInteraction(...p),mouseInteractionCb(...p)},o.scrollCb=(...p)=>{hooks.scroll&&hooks.scroll(...p),scrollCb(...p)},o.viewportResizeCb=(...p)=>{hooks.viewportResize&&hooks.viewportResize(...p),viewportResizeCb(...p)},o.inputCb=(...p)=>{hooks.input&&hooks.input(...p),inputCb(...p)},o.mediaInteractionCb=(...p)=>{hooks.mediaInteaction&&hooks.mediaInteaction(...p),mediaInteractionCb(...p)},o.styleSheetRuleCb=(...p)=>{hooks.styleSheetRule&&hooks.styleSheetRule(...p),styleSheetRuleCb(...p)},o.styleDeclarationCb=(...p)=>{hooks.styleDeclaration&&hooks.styleDeclaration(...p),styleDeclarationCb(...p)},o.canvasMutationCb=(...p)=>{hooks.canvasMutation&&hooks.canvasMutation(...p),canvasMutationCb(...p)},o.fontCb=(...p)=>{hooks.font&&hooks.font(...p),fontCb(...p)},o.selectionCb=(...p)=>{hooks.selection&&hooks.selection(...p),selectionCb(...p)}}function initObservers(o,hooks={}){const currentWindow=o.doc.defaultView;if(!currentWindow)return()=>{};mergeHooks(o,hooks);const mutationObserver=initMutationObserver(o,o.doc),mousemoveHandler=initMoveObserver(o),mouseInteractionHandler=initMouseInteractionObserver(o),scrollHandler=initScrollObserver(o),viewportResizeHandler=initViewportResizeObserver(o),inputHandler=initInputObserver(o),mediaInteractionHandler=initMediaInteractionObserver(o),styleSheetObserver=initStyleSheetObserver(o,{win:currentWindow}),adoptedStyleSheetObserver=initAdoptedStyleSheetObserver(o,o.doc),styleDeclarationObserver=initStyleDeclarationObserver(o,{win:currentWindow}),fontObserver=o.collectFonts?initFontObserver(o):()=>{},selectionObserver=initSelectionObserver(o),pluginHandlers=[];for(const plugin of o.plugins)pluginHandlers.push(plugin.observer(plugin.callback,currentWindow,plugin.options));return()=>{mutationBuffers.forEach(b=>b.reset()),mutationObserver.disconnect(),mousemoveHandler(),mouseInteractionHandler(),scrollHandler(),viewportResizeHandler(),inputHandler(),mediaInteractionHandler(),styleSheetObserver(),adoptedStyleSheetObserver(),styleDeclarationObserver(),fontObserver(),selectionObserver(),pluginHandlers.forEach(h=>h())}}class CrossOriginIframeMirror{constructor(generateIdFn){this.generateIdFn=generateIdFn,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(iframe,remoteId,idToRemoteMap,remoteToIdMap){const idToRemoteIdMap=idToRemoteMap||this.getIdToRemoteIdMap(iframe),remoteIdToIdMap=remoteToIdMap||this.getRemoteIdToIdMap(iframe);let id=idToRemoteIdMap.get(remoteId);return id||(id=this.generateIdFn(),idToRemoteIdMap.set(remoteId,id),remoteIdToIdMap.set(id,remoteId)),id}getIds(iframe,remoteId){const idToRemoteIdMap=this.getIdToRemoteIdMap(iframe),remoteIdToIdMap=this.getRemoteIdToIdMap(iframe);return remoteId.map(id=>this.getId(iframe,id,idToRemoteIdMap,remoteIdToIdMap))}getRemoteId(iframe,id,map){const remoteIdToIdMap=map||this.getRemoteIdToIdMap(iframe);if(typeof id!="number")return id;const remoteId=remoteIdToIdMap.get(id);return remoteId||-1}getRemoteIds(iframe,ids){const remoteIdToIdMap=this.getRemoteIdToIdMap(iframe);return ids.map(id=>this.getRemoteId(iframe,id,remoteIdToIdMap))}reset(iframe){if(!iframe){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(iframe),this.iframeRemoteIdToIdMap.delete(iframe)}getIdToRemoteIdMap(iframe){let idToRemoteIdMap=this.iframeIdToRemoteIdMap.get(iframe);return idToRemoteIdMap||(idToRemoteIdMap=new Map,this.iframeIdToRemoteIdMap.set(iframe,idToRemoteIdMap)),idToRemoteIdMap}getRemoteIdToIdMap(iframe){let remoteIdToIdMap=this.iframeRemoteIdToIdMap.get(iframe);return remoteIdToIdMap||(remoteIdToIdMap=new Map,this.iframeRemoteIdToIdMap.set(iframe,remoteIdToIdMap)),remoteIdToIdMap}}class IframeManager{constructor(options){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.mutationCb=options.mutationCb,this.wrappedEmit=options.wrappedEmit,this.stylesheetManager=options.stylesheetManager,this.recordCrossOriginIframes=options.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=options.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(iframeEl){this.iframes.set(iframeEl,!0),iframeEl.contentWindow&&this.crossOriginIframeMap.set(iframeEl.contentWindow,iframeEl)}addLoadListener(cb){this.loadListener=cb}attachIframe(iframeEl,childSn){var _a;this.mutationCb({adds:[{parentId:this.mirror.getId(iframeEl),nextId:null,node:childSn}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(_a=this.loadListener)===null||_a===void 0||_a.call(this,iframeEl),iframeEl.contentDocument&&iframeEl.contentDocument.adoptedStyleSheets&&iframeEl.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets,this.mirror.getId(iframeEl.contentDocument))}handleMessage(message){if(message.data.type==="rrweb"){if(!message.source)return;const iframeEl=this.crossOriginIframeMap.get(message.source);if(!iframeEl)return;const transformedEvent=this.transformCrossOriginEvent(iframeEl,message.data.event);transformedEvent&&this.wrappedEmit(transformedEvent,message.data.isCheckout)}}transformCrossOriginEvent(iframeEl,e){var _a;switch(e.type){case EventType.FullSnapshot:return this.crossOriginIframeMirror.reset(iframeEl),this.crossOriginIframeStyleMirror.reset(iframeEl),this.replaceIdOnNode(e.data.node,iframeEl),{timestamp:e.timestamp,type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.Mutation,adds:[{parentId:this.mirror.getId(iframeEl),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case EventType.Meta:case EventType.Load:case EventType.DomContentLoaded:return!1;case EventType.Plugin:return e;case EventType.Custom:return this.replaceIds(e.data.payload,iframeEl,["id","parentId","previousId","nextId"]),e;case EventType.IncrementalSnapshot:switch(e.data.source){case IncrementalSource.Mutation:return e.data.adds.forEach(n=>{this.replaceIds(n,iframeEl,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,iframeEl)}),e.data.removes.forEach(n=>{this.replaceIds(n,iframeEl,["parentId","id"])}),e.data.attributes.forEach(n=>{this.replaceIds(n,iframeEl,["id"])}),e.data.texts.forEach(n=>{this.replaceIds(n,iframeEl,["id"])}),e;case IncrementalSource.Drag:case IncrementalSource.TouchMove:case IncrementalSource.MouseMove:return e.data.positions.forEach(p=>{this.replaceIds(p,iframeEl,["id"])}),e;case IncrementalSource.ViewportResize:return!1;case IncrementalSource.MediaInteraction:case IncrementalSource.MouseInteraction:case IncrementalSource.Scroll:case IncrementalSource.CanvasMutation:case IncrementalSource.Input:return this.replaceIds(e.data,iframeEl,["id"]),e;case IncrementalSource.StyleSheetRule:case IncrementalSource.StyleDeclaration:return this.replaceIds(e.data,iframeEl,["id"]),this.replaceStyleIds(e.data,iframeEl,["styleId"]),e;case IncrementalSource.Font:return e;case IncrementalSource.Selection:return e.data.ranges.forEach(range=>{this.replaceIds(range,iframeEl,["start","end"])}),e;case IncrementalSource.AdoptedStyleSheet:return this.replaceIds(e.data,iframeEl,["id"]),this.replaceStyleIds(e.data,iframeEl,["styleIds"]),(_a=e.data.styles)===null||_a===void 0||_a.forEach(style=>{this.replaceStyleIds(style,iframeEl,["styleId"])}),e}}}replace(iframeMirror,obj,iframeEl,keys){for(const key of keys)!Array.isArray(obj[key])&&typeof obj[key]!="number"||(Array.isArray(obj[key])?obj[key]=iframeMirror.getIds(iframeEl,obj[key]):obj[key]=iframeMirror.getId(iframeEl,obj[key]));return obj}replaceIds(obj,iframeEl,keys){return this.replace(this.crossOriginIframeMirror,obj,iframeEl,keys)}replaceStyleIds(obj,iframeEl,keys){return this.replace(this.crossOriginIframeStyleMirror,obj,iframeEl,keys)}replaceIdOnNode(node,iframeEl){this.replaceIds(node,iframeEl,["id"]),"childNodes"in node&&node.childNodes.forEach(child=>{this.replaceIdOnNode(child,iframeEl)})}}class ShadowDomManager{constructor(options){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=options.mutationCb,this.scrollCb=options.scrollCb,this.bypassOptions=options.bypassOptions,this.mirror=options.mirror;const manager=this;this.restorePatches.push(patch$1(Element.prototype,"attachShadow",function(original){return function(option){const shadowRoot=original.call(this,option);return this.shadowRoot&&manager.addShadowRoot(this.shadowRoot,this.ownerDocument),shadowRoot}}))}addShadowRoot(shadowRoot,doc){isNativeShadowDom(shadowRoot)&&(this.shadowDoms.has(shadowRoot)||(this.shadowDoms.add(shadowRoot),initMutationObserver(Object.assign(Object.assign({},this.bypassOptions),{doc,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),shadowRoot),initScrollObserver(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:shadowRoot,mirror:this.mirror})),setTimeout(()=>{shadowRoot.adoptedStyleSheets&&shadowRoot.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets,this.mirror.getId(shadowRoot.host)),initAdoptedStyleSheetObserver({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},shadowRoot)},0)))}observeAttachShadow(iframeElement){if(iframeElement.contentWindow){const manager=this;this.restorePatches.push(patch$1(iframeElement.contentWindow.HTMLElement.prototype,"attachShadow",function(original){return function(option){const shadowRoot=original.call(this,option);return this.shadowRoot&&manager.addShadowRoot(this.shadowRoot,iframeElement.contentDocument),shadowRoot}}))}}reset(){this.restorePatches.forEach(restorePatch=>restorePatch()),this.shadowDoms=new WeakSet}}function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i2=0,p=Object.getOwnPropertySymbols(s);i2<p.length;i2++)e.indexOf(p[i2])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i2])&&(t[p[i2]]=s[p[i2]]);return t}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,[])).next())})}for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i<chars.length;i++)lookup[chars.charCodeAt(i)]=i;var encode$2=function(arraybuffer){var bytes=new Uint8Array(arraybuffer),i2,len=bytes.length,base64="";for(i2=0;i2<len;i2+=3)base64+=chars[bytes[i2]>>2],base64+=chars[(bytes[i2]&3)<<4|bytes[i2+1]>>4],base64+=chars[(bytes[i2+1]&15)<<2|bytes[i2+2]>>6],base64+=chars[bytes[i2+2]&63];return len%3===2?base64=base64.substring(0,base64.length-1)+"=":len%3===1&&(base64=base64.substring(0,base64.length-2)+"=="),base64};const canvasVarMap=new Map;function variableListFor(ctx,ctor){let contextMap=canvasVarMap.get(ctx);return contextMap||(contextMap=new Map,canvasVarMap.set(ctx,contextMap)),contextMap.has(ctor)||contextMap.set(ctor,[]),contextMap.get(ctor)}const saveWebGLVar=(value,win,ctx)=>{if(!value||!(isInstanceOfWebGLObject(value,win)||typeof value=="object"))return;const name=value.constructor.name,list=variableListFor(ctx,name);let index=list.indexOf(value);return index===-1&&(index=list.length,list.push(value)),index};function serializeArg(value,win,ctx){if(value instanceof Array)return value.map(arg=>serializeArg(arg,win,ctx));if(value===null)return value;if(value instanceof Float32Array||value instanceof Float64Array||value instanceof Int32Array||value instanceof Uint32Array||value instanceof Uint8Array||value instanceof Uint16Array||value instanceof Int16Array||value instanceof Int8Array||value instanceof Uint8ClampedArray)return{rr_type:value.constructor.name,args:[Object.values(value)]};if(value instanceof ArrayBuffer){const name=value.constructor.name,base64=encode$2(value);return{rr_type:name,base64}}else{if(value instanceof DataView)return{rr_type:value.constructor.name,args:[serializeArg(value.buffer,win,ctx),value.byteOffset,value.byteLength]};if(value instanceof HTMLImageElement){const name=value.constructor.name,{src}=value;return{rr_type:name,src}}else if(value instanceof HTMLCanvasElement){const name="HTMLImageElement",src=value.toDataURL();return{rr_type:name,src}}else{if(value instanceof ImageData)return{rr_type:value.constructor.name,args:[serializeArg(value.data,win,ctx),value.width,value.height]};if(isInstanceOfWebGLObject(value,win)||typeof value=="object"){const name=value.constructor.name,index=saveWebGLVar(value,win,ctx);return{rr_type:name,index}}}}return value}const serializeArgs=(args,win,ctx)=>[...args].map(arg=>serializeArg(arg,win,ctx)),isInstanceOfWebGLObject=(value,win)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(name=>typeof win[name]=="function").find(name=>value instanceof win[name]);function initCanvas2DMutationObserver(cb,win,blockClass,blockSelector){const handlers=[],props2D=Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);for(const prop of props2D)try{if(typeof win.CanvasRenderingContext2D.prototype[prop]!="function")continue;const restoreHandler=patch$1(win.CanvasRenderingContext2D.prototype,prop,function(original){return function(...args){return isBlocked(this.canvas,blockClass,blockSelector,!0)||setTimeout(()=>{const recordArgs=serializeArgs([...args],win,this);cb(this.canvas,{type:CanvasContext["2D"],property:prop,args:recordArgs})},0),original.apply(this,args)}});handlers.push(restoreHandler)}catch{const hookHandler=hookSetter(win.CanvasRenderingContext2D.prototype,prop,{set(v){cb(this.canvas,{type:CanvasContext["2D"],property:prop,args:[v],setter:!0})}});handlers.push(hookHandler)}return()=>{handlers.forEach(h=>h())}}function initCanvasContextObserver(win,blockClass,blockSelector){const handlers=[];try{const restoreHandler=patch$1(win.HTMLCanvasElement.prototype,"getContext",function(original){return function(contextType,...args){return isBlocked(this,blockClass,blockSelector,!0)||"__context"in this||(this.__context=contextType),original.apply(this,[contextType,...args])}});handlers.push(restoreHandler)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{handlers.forEach(h=>h())}}function patchGLPrototype(prototype2,type,cb,blockClass,blockSelector,mirror2,win){const handlers=[],props=Object.getOwnPropertyNames(prototype2);for(const prop of props)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(prop))try{if(typeof prototype2[prop]!="function")continue;const restoreHandler=patch$1(prototype2,prop,function(original){return function(...args){const result=original.apply(this,args);if(saveWebGLVar(result,win,this),!isBlocked(this.canvas,blockClass,blockSelector,!0)){const recordArgs=serializeArgs([...args],win,this),mutation={type,property:prop,args:recordArgs};cb(this.canvas,mutation)}return result}});handlers.push(restoreHandler)}catch{const hookHandler=hookSetter(prototype2,prop,{set(v){cb(this.canvas,{type,property:prop,args:[v],setter:!0})}});handlers.push(hookHandler)}return handlers}function initCanvasWebGLMutationObserver(cb,win,blockClass,blockSelector,mirror2){const handlers=[];return handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype,CanvasContext.WebGL,cb,blockClass,blockSelector,mirror2,win)),typeof win.WebGL2RenderingContext<"u"&&handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype,CanvasContext.WebGL2,cb,blockClass,blockSelector,mirror2,win)),()=>{handlers.forEach(h=>h())}}var WorkerClass=null;try{var WorkerThreads=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads");WorkerClass=WorkerThreads.Worker}catch{}function decodeBase64$1(base64,enableUnicode){return Buffer.from(base64,"base64").toString("utf8")}function createBase64WorkerFactory$2(base64,sourcemapArg,enableUnicodeArg){var source=decodeBase64$1(base64),start=source.indexOf(`
4
+ `,10)+1,body=source.substring(start)+"";return function(options){return new WorkerClass(body,Object.assign({},options,{eval:!0}))}}function decodeBase64(base64,enableUnicode){var binaryString=atob(base64);return binaryString}function createURL(base64,sourcemapArg,enableUnicodeArg){var source=decodeBase64(base64),start=source.indexOf(`
5
+ `,10)+1,body=source.substring(start)+"",blob=new Blob([body],{type:"application/javascript"});return URL.createObjectURL(blob)}function createBase64WorkerFactory$1(base64,sourcemapArg,enableUnicodeArg){var url;return function(options){return url=url||createURL(base64),new Worker(url,options)}}var kIsNodeJS=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function isNodeJS(){return kIsNodeJS}function createBase64WorkerFactory(base64,sourcemapArg,enableUnicodeArg){return isNodeJS()?createBase64WorkerFactory$2(base64):createBase64WorkerFactory$1(base64)}var WorkerFactory=createBase64WorkerFactory("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class CanvasManager{constructor(options){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(target,mutation)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(target)||this.pendingCanvasMutations.set(target,[]),this.pendingCanvasMutations.get(target).push(mutation)};const{sampling="all",win,blockClass,blockSelector,recordCanvas,dataURLOptions}=options;this.mutationCb=options.mutationCb,this.mirror=options.mirror,recordCanvas&&sampling==="all"&&this.initCanvasMutationObserver(win,blockClass,blockSelector),recordCanvas&&typeof sampling=="number"&&this.initCanvasFPSObserver(sampling,win,blockClass,blockSelector,{dataURLOptions})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(fps,win,blockClass,blockSelector,options){const canvasContextReset=initCanvasContextObserver(win,blockClass,blockSelector),snapshotInProgressMap=new Map,worker=new WorkerFactory;worker.onmessage=e=>{const{id}=e.data;if(snapshotInProgressMap.set(id,!1),!("base64"in e.data))return;const{base64,type,width,height}=e.data;this.mutationCb({id,type:CanvasContext["2D"],commands:[{property:"clearRect",args:[0,0,width,height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64}],type}]},0,0]}]})};const timeBetweenSnapshots=1e3/fps;let lastSnapshotTime=0,rafId;const getCanvas=()=>{const matchedCanvas=[];return win.document.querySelectorAll("canvas").forEach(canvas=>{isBlocked(canvas,blockClass,blockSelector,!0)||matchedCanvas.push(canvas)}),matchedCanvas},takeCanvasSnapshots=timestamp=>{if(lastSnapshotTime&&timestamp-lastSnapshotTime<timeBetweenSnapshots){rafId=requestAnimationFrame(takeCanvasSnapshots);return}lastSnapshotTime=timestamp,getCanvas().forEach(canvas=>__awaiter(this,void 0,void 0,function*(){var _a;const id=this.mirror.getId(canvas);if(snapshotInProgressMap.get(id))return;if(snapshotInProgressMap.set(id,!0),["webgl","webgl2"].includes(canvas.__context)){const context=canvas.getContext(canvas.__context);((_a=context?.getContextAttributes())===null||_a===void 0?void 0:_a.preserveDrawingBuffer)===!1&&context?.clear(context.COLOR_BUFFER_BIT)}const bitmap=yield createImageBitmap(canvas);worker.postMessage({id,bitmap,width:canvas.width,height:canvas.height,dataURLOptions:options.dataURLOptions},[bitmap])})),rafId=requestAnimationFrame(takeCanvasSnapshots)};rafId=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{canvasContextReset(),cancelAnimationFrame(rafId)}}initCanvasMutationObserver(win,blockClass,blockSelector){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const canvasContextReset=initCanvasContextObserver(win,blockClass,blockSelector),canvas2DReset=initCanvas2DMutationObserver(this.processMutation.bind(this),win,blockClass,blockSelector),canvasWebGL1and2Reset=initCanvasWebGLMutationObserver(this.processMutation.bind(this),win,blockClass,blockSelector,this.mirror);this.resetObservers=()=>{canvasContextReset(),canvas2DReset(),canvasWebGL1and2Reset()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const setLatestRAFTimestamp=timestamp=>{this.rafStamps.latestId=timestamp,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((values,canvas)=>{const id=this.mirror.getId(canvas);this.flushPendingCanvasMutationFor(canvas,id)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(canvas,id){if(this.frozen||this.locked)return;const valuesWithType=this.pendingCanvasMutations.get(canvas);if(!valuesWithType||id===-1)return;const values=valuesWithType.map(value=>__rest(value,["type"])),{type}=valuesWithType[0];this.mutationCb({id,type,commands:values}),this.pendingCanvasMutations.delete(canvas)}}class StylesheetManager{constructor(options){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=options.mutationCb,this.adoptedStyleSheetCb=options.adoptedStyleSheetCb}attachLinkElement(linkEl,childSn){"_cssText"in childSn.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:childSn.id,attributes:childSn.attributes}]}),this.trackLinkElement(linkEl)}trackLinkElement(linkEl){this.trackedLinkElements.has(linkEl)||(this.trackedLinkElements.add(linkEl),this.trackStylesheetInLinkElement(linkEl))}adoptStyleSheets(sheets,hostId){if(sheets.length===0)return;const adoptedStyleSheetData={id:hostId,styleIds:[]},styles=[];for(const sheet of sheets){let styleId;if(this.styleMirror.has(sheet))styleId=this.styleMirror.getId(sheet);else{styleId=this.styleMirror.add(sheet);const rules=Array.from(sheet.rules||CSSRule);styles.push({styleId,rules:rules.map((r,index)=>({rule:getCssRuleString(r),index}))})}adoptedStyleSheetData.styleIds.push(styleId)}styles.length>0&&(adoptedStyleSheetData.styles=styles),this.adoptedStyleSheetCb(adoptedStyleSheetData)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(linkEl){}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let wrappedEmit,takeFullSnapshot,canvasManager,recording=!1;const mirror=createMirror();function record(options={}){const{emit,checkoutEveryNms,checkoutEveryNth,blockClass="rr-block",blockSelector=null,ignoreClass="rr-ignore",maskTextClass="rr-mask",maskTextSelector=null,inlineStylesheet=!0,maskAllInputs,maskInputOptions:_maskInputOptions,slimDOMOptions:_slimDOMOptions,maskInputFn,maskTextFn,hooks,packFn,sampling={},dataURLOptions={},mousemoveWait,recordCanvas=!1,recordCrossOriginIframes=!1,userTriggeredOnInput=!1,collectFonts=!1,inlineImages=!1,plugins,keepIframeSrcFn=()=>!1,ignoreCSSAttributes=new Set([])}=options,inEmittingFrame=recordCrossOriginIframes?window.parent===window:!0;let passEmitsToParent=!1;if(!inEmittingFrame)try{window.parent.document,passEmitsToParent=!1}catch{passEmitsToParent=!0}if(inEmittingFrame&&!emit)throw new Error("emit function is required");mousemoveWait!==void 0&&sampling.mousemove===void 0&&(sampling.mousemove=mousemoveWait),mirror.reset();const maskInputOptions=maskAllInputs===!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}:_maskInputOptions!==void 0?_maskInputOptions:{password:!0},slimDOMOptions=_slimDOMOptions===!0||_slimDOMOptions==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_slimDOMOptions==="all",headMetaDescKeywords:_slimDOMOptions==="all"}:_slimDOMOptions||{};polyfill();let lastFullSnapshotEvent,incrementalSnapshotCount=0;const eventProcessor=e=>{for(const plugin of plugins||[])plugin.eventProcessor&&(e=plugin.eventProcessor(e));return packFn&&(e=packFn(e)),e};wrappedEmit=(e,isCheckout)=>{var _a;if(!((_a=mutationBuffers[0])===null||_a===void 0)&&_a.isFrozen()&&e.type!==EventType.FullSnapshot&&!(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.Mutation)&&mutationBuffers.forEach(buf=>buf.unfreeze()),inEmittingFrame)emit?.(eventProcessor(e),isCheckout);else if(passEmitsToParent){const message={type:"rrweb",event:eventProcessor(e),isCheckout};window.parent.postMessage(message,"*")}if(e.type===EventType.FullSnapshot)lastFullSnapshotEvent=e,incrementalSnapshotCount=0;else if(e.type===EventType.IncrementalSnapshot){if(e.data.source===IncrementalSource.Mutation&&e.data.isAttachIframe)return;incrementalSnapshotCount++;const exceedCount=checkoutEveryNth&&incrementalSnapshotCount>=checkoutEveryNth,exceedTime=checkoutEveryNms&&e.timestamp-lastFullSnapshotEvent.timestamp>checkoutEveryNms;(exceedCount||exceedTime)&&takeFullSnapshot(!0)}};const wrappedMutationEmit=m=>{wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Mutation},m)}))},wrappedScrollEmit=p=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Scroll},p)})),wrappedCanvasMutationEmit=p=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.CanvasMutation},p)})),wrappedAdoptedStyleSheetEmit=a=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.AdoptedStyleSheet},a)})),stylesheetManager=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:wrappedAdoptedStyleSheetEmit}),iframeManager=new IframeManager({mirror,mutationCb:wrappedMutationEmit,stylesheetManager,recordCrossOriginIframes,wrappedEmit});for(const plugin of plugins||[])plugin.getMirror&&plugin.getMirror({nodeMirror:mirror,crossOriginIframeMirror:iframeManager.crossOriginIframeMirror,crossOriginIframeStyleMirror:iframeManager.crossOriginIframeStyleMirror});canvasManager=new CanvasManager({recordCanvas,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass,blockSelector,mirror,sampling:sampling.canvas,dataURLOptions});const shadowDomManager=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass,blockSelector,maskTextClass,maskTextSelector,inlineStylesheet,maskInputOptions,dataURLOptions,maskTextFn,maskInputFn,recordCanvas,inlineImages,sampling,slimDOMOptions,iframeManager,stylesheetManager,canvasManager,keepIframeSrcFn},mirror});takeFullSnapshot=(isCheckout=!1)=>{var _a,_b,_c,_d,_e,_f;wrappedEmit(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),isCheckout),stylesheetManager.reset(),mutationBuffers.forEach(buf=>buf.lock());const node=snapshot(document,{mirror,blockClass,blockSelector,maskTextClass,maskTextSelector,inlineStylesheet,maskAllInputs:maskInputOptions,maskTextFn,slimDOM:slimDOMOptions,dataURLOptions,recordCanvas,inlineImages,onSerialize:n=>{isSerializedIframe(n,mirror)&&iframeManager.addIframe(n),isSerializedStylesheet(n,mirror)&&stylesheetManager.trackLinkElement(n),hasShadowRoot(n)&&shadowDomManager.addShadowRoot(n.shadowRoot,document)},onIframeLoad:(iframe,childSn)=>{iframeManager.attachIframe(iframe,childSn),shadowDomManager.observeAttachShadow(iframe)},onStylesheetLoad:(linkEl,childSn)=>{stylesheetManager.attachLinkElement(linkEl,childSn)},keepIframeSrcFn});if(!node)return console.warn("Failed to snapshot the document");wrappedEmit(wrapEvent({type:EventType.FullSnapshot,data:{node,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((_b=(_a=document?.body)===null||_a===void 0?void 0:_a.parentElement)===null||_b===void 0?void 0:_b.scrollLeft)||((_c=document?.body)===null||_c===void 0?void 0:_c.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((_e=(_d=document?.body)===null||_d===void 0?void 0:_d.parentElement)===null||_e===void 0?void 0:_e.scrollTop)||((_f=document?.body)===null||_f===void 0?void 0:_f.scrollTop)||0}}})),mutationBuffers.forEach(buf=>buf.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets,mirror.getId(document))};try{const handlers=[];handlers.push(on("DOMContentLoaded",()=>{wrappedEmit(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));const observe=doc=>{var _a;return initObservers({mutationCb:wrappedMutationEmit,mousemoveCb:(positions,source)=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:{source,positions}})),mouseInteractionCb:d=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.MouseInteraction},d)})),scrollCb:wrappedScrollEmit,viewportResizeCb:d=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.ViewportResize},d)})),inputCb:v=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Input},v)})),mediaInteractionCb:p=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.MediaInteraction},p)})),styleSheetRuleCb:r=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.StyleSheetRule},r)})),styleDeclarationCb:r=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.StyleDeclaration},r)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:p=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Font},p)})),selectionCb:p=>{wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Selection},p)}))},blockClass,ignoreClass,maskTextClass,maskTextSelector,maskInputOptions,inlineStylesheet,sampling,recordCanvas,inlineImages,userTriggeredOnInput,collectFonts,doc,maskInputFn,maskTextFn,keepIframeSrcFn,blockSelector,slimDOMOptions,dataURLOptions,mirror,iframeManager,stylesheetManager,shadowDomManager,canvasManager,ignoreCSSAttributes,plugins:((_a=plugins?.filter(p=>p.observer))===null||_a===void 0?void 0:_a.map(p=>({observer:p.observer,options:p.options,callback:payload=>wrappedEmit(wrapEvent({type:EventType.Plugin,data:{plugin:p.name,payload}}))})))||[]},hooks)};iframeManager.addLoadListener(iframeEl=>{handlers.push(observe(iframeEl.contentDocument))});const init=()=>{takeFullSnapshot(),handlers.push(observe(document)),recording=!0};return document.readyState==="interactive"||document.readyState==="complete"?init():handlers.push(on("load",()=>{wrappedEmit(wrapEvent({type:EventType.Load,data:{}})),init()},window)),()=>{handlers.forEach(h=>h()),recording=!1}}catch(error){console.warn(error)}}record.addCustomEvent=(tag,payload)=>{if(!recording)throw new Error("please add custom event after start recording");wrappedEmit(wrapEvent({type:EventType.Custom,data:{tag,payload}}))},record.freezePage=()=>{mutationBuffers.forEach(buf=>buf.freeze())},record.takeFullSnapshot=isCheckout=>{if(!recording)throw new Error("please take full snapshot after start recording");takeFullSnapshot(isCheckout)},record.mirror=mirror;function bind(fn,thisArg){return function(){return fn.apply(thisArg,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(cache=>thing=>{const str=toString.call(thing);return cache[str]||(cache[str]=str.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=type=>(type=type.toLowerCase(),thing=>kindOf(thing)===type),typeOfTest=type=>thing=>typeof thing===type,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(val){return val!==null&&!isUndefined(val)&&val.constructor!==null&&!isUndefined(val.constructor)&&isFunction(val.constructor.isBuffer)&&val.constructor.isBuffer(val)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(val){let result;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?result=ArrayBuffer.isView(val):result=val&&val.buffer&&isArrayBuffer(val.buffer),result}const isString$1=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=thing=>thing!==null&&typeof thing=="object",isBoolean=thing=>thing===!0||thing===!1,isPlainObject=val=>{if(kindOf(val)!=="object")return!1;const prototype2=getPrototypeOf(val);return(prototype2===null||prototype2===Object.prototype||Object.getPrototypeOf(prototype2)===null)&&!(toStringTag in val)&&!(iterator in val)},isEmptyObject=val=>{if(!isObject(val)||isBuffer(val))return!1;try{return Object.keys(val).length===0&&Object.getPrototypeOf(val)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=val=>isObject(val)&&isFunction(val.pipe),isFormData=thing=>{let kind;return thing&&(typeof FormData=="function"&&thing instanceof FormData||isFunction(thing.append)&&((kind=kindOf(thing))==="formdata"||kind==="object"&&isFunction(thing.toString)&&thing.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim$1=str=>str.trim?str.trim():str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(obj,fn,{allOwnKeys=!1}={}){if(obj===null||typeof obj>"u")return;let i2,l;if(typeof obj!="object"&&(obj=[obj]),isArray(obj))for(i2=0,l=obj.length;i2<l;i2++)fn.call(null,obj[i2],i2,obj);else{if(isBuffer(obj))return;const keys=allOwnKeys?Object.getOwnPropertyNames(obj):Object.keys(obj),len=keys.length;let key;for(i2=0;i2<len;i2++)key=keys[i2],fn.call(null,obj[key],key,obj)}}function findKey(obj,key){if(isBuffer(obj))return null;key=key.toLowerCase();const keys=Object.keys(obj);let i2=keys.length,_key;for(;i2-- >0;)if(_key=keys[i2],key===_key.toLowerCase())return _key;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=context=>!isUndefined(context)&&context!==_global;function merge(){const{caseless}=isContextDefined(this)&&this||{},result={},assignValue=(val,key)=>{const targetKey=caseless&&findKey(result,key)||key;isPlainObject(result[targetKey])&&isPlainObject(val)?result[targetKey]=merge(result[targetKey],val):isPlainObject(val)?result[targetKey]=merge({},val):isArray(val)?result[targetKey]=val.slice():result[targetKey]=val};for(let i2=0,l=arguments.length;i2<l;i2++)arguments[i2]&&forEach(arguments[i2],assignValue);return result}const extend$1=(a,b,thisArg,{allOwnKeys}={})=>(forEach(b,(val,key)=>{thisArg&&isFunction(val)?a[key]=bind(val,thisArg):a[key]=val},{allOwnKeys}),a),stripBOM=content=>(content.charCodeAt(0)===65279&&(content=content.slice(1)),content),inherits=(constructor,superConstructor,props,descriptors2)=>{constructor.prototype=Object.create(superConstructor.prototype,descriptors2),constructor.prototype.constructor=constructor,Object.defineProperty(constructor,"super",{value:superConstructor.prototype}),props&&Object.assign(constructor.prototype,props)},toFlatObject=(sourceObj,destObj,filter,propFilter)=>{let props,i2,prop;const merged={};if(destObj=destObj||{},sourceObj==null)return destObj;do{for(props=Object.getOwnPropertyNames(sourceObj),i2=props.length;i2-- >0;)prop=props[i2],(!propFilter||propFilter(prop,sourceObj,destObj))&&!merged[prop]&&(destObj[prop]=sourceObj[prop],merged[prop]=!0);sourceObj=filter!==!1&&getPrototypeOf(sourceObj)}while(sourceObj&&(!filter||filter(sourceObj,destObj))&&sourceObj!==Object.prototype);return destObj},endsWith=(str,searchString,position)=>{str=String(str),(position===void 0||position>str.length)&&(position=str.length),position-=searchString.length;const lastIndex=str.indexOf(searchString,position);return lastIndex!==-1&&lastIndex===position},toArray=thing=>{if(!thing)return null;if(isArray(thing))return thing;let i2=thing.length;if(!isNumber(i2))return null;const arr=new Array(i2);for(;i2-- >0;)arr[i2]=thing[i2];return arr},isTypedArray=(TypedArray=>thing=>TypedArray&&thing instanceof TypedArray)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(obj,fn)=>{const _iterator=(obj&&obj[iterator]).call(obj);let result;for(;(result=_iterator.next())&&!result.done;){const pair=result.value;fn.call(obj,pair[0],pair[1])}},matchAll=(regExp,str)=>{let matches;const arr=[];for(;(matches=regExp.exec(str))!==null;)arr.push(matches);return arr},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=str=>str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(m,p1,p2){return p1.toUpperCase()+p2}),hasOwnProperty=(({hasOwnProperty:hasOwnProperty2})=>(obj,prop)=>hasOwnProperty2.call(obj,prop))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(obj,reducer)=>{const descriptors2=Object.getOwnPropertyDescriptors(obj),reducedDescriptors={};forEach(descriptors2,(descriptor,name)=>{let ret;(ret=reducer(descriptor,name,obj))!==!1&&(reducedDescriptors[name]=ret||descriptor)}),Object.defineProperties(obj,reducedDescriptors)},freezeMethods=obj=>{reduceDescriptors(obj,(descriptor,name)=>{if(isFunction(obj)&&["arguments","caller","callee"].indexOf(name)!==-1)return!1;const value=obj[name];if(isFunction(value)){if(descriptor.enumerable=!1,"writable"in descriptor){descriptor.writable=!1;return}descriptor.set||(descriptor.set=()=>{throw Error("Can not rewrite read-only method '"+name+"'")})}})},toObjectSet=(arrayOrString,delimiter)=>{const obj={},define=arr=>{arr.forEach(value=>{obj[value]=!0})};return isArray(arrayOrString)?define(arrayOrString):define(String(arrayOrString).split(delimiter)),obj},noop=()=>{},toFiniteNumber=(value,defaultValue)=>value!=null&&Number.isFinite(value=+value)?value:defaultValue;function isSpecCompliantForm(thing){return!!(thing&&isFunction(thing.append)&&thing[toStringTag]==="FormData"&&thing[iterator])}const toJSONObject=obj=>{const stack=new Array(10),visit=(source,i2)=>{if(isObject(source)){if(stack.indexOf(source)>=0)return;if(isBuffer(source))return source;if(!("toJSON"in source)){stack[i2]=source;const target=isArray(source)?[]:{};return forEach(source,(value,key)=>{const reducedValue=visit(value,i2+1);!isUndefined(reducedValue)&&(target[key]=reducedValue)}),stack[i2]=void 0,target}}return source};return visit(obj,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=thing=>thing&&(isObject(thing)||isFunction(thing))&&isFunction(thing.then)&&isFunction(thing.catch),_setImmediate=((setImmediateSupported,postMessageSupported)=>setImmediateSupported?setImmediate:postMessageSupported?((token,callbacks)=>(_global.addEventListener("message",({source,data})=>{source===_global&&data===token&&callbacks.length&&callbacks.shift()()},!1),cb=>{callbacks.push(cb),_global.postMessage(token,"*")}))(`axios@${Math.random()}`,[]):cb=>setTimeout(cb))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean,isObject,isPlainObject,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend:extend$1,trim:trim$1,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable:thing=>thing!=null&&isFunction(thing[iterator])};function AxiosError$1(message,code,config,request,response){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=message,this.name="AxiosError",code&&(this.code=code),config&&(this.config=config),request&&(this.request=request),response&&(this.response=response,this.status=response.status?response.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(code=>{descriptors[code]={value:code}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(error,code,config,request,response,customProps)=>{const axiosError=Object.create(prototype$1);return utils$1.toFlatObject(error,axiosError,function(obj){return obj!==Error.prototype},prop=>prop!=="isAxiosError"),AxiosError$1.call(axiosError,error.message,code,config,request,response),axiosError.cause=error,axiosError.name=error.name,customProps&&Object.assign(axiosError,customProps),axiosError};const httpAdapter=null;function isVisitable(thing){return utils$1.isPlainObject(thing)||utils$1.isArray(thing)}function removeBrackets(key){return utils$1.endsWith(key,"[]")?key.slice(0,-2):key}function renderKey(path,key,dots){return path?path.concat(key).map(function(token,i2){return token=removeBrackets(token),!dots&&i2?"["+token+"]":token}).join(dots?".":""):key}function isFlatArray(arr){return utils$1.isArray(arr)&&!arr.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(prop){return/^is[A-Z]/.test(prop)});function toFormData$1(obj,formData,options){if(!utils$1.isObject(obj))throw new TypeError("target must be an object");formData=formData||new FormData,options=utils$1.toFlatObject(options,{metaTokens:!0,dots:!1,indexes:!1},!1,function(option,source){return!utils$1.isUndefined(source[option])});const metaTokens=options.metaTokens,visitor=options.visitor||defaultVisitor,dots=options.dots,indexes=options.indexes,useBlob=(options.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(formData);if(!utils$1.isFunction(visitor))throw new TypeError("visitor must be a function");function convertValue(value){if(value===null)return"";if(utils$1.isDate(value))return value.toISOString();if(utils$1.isBoolean(value))return value.toString();if(!useBlob&&utils$1.isBlob(value))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(value)||utils$1.isTypedArray(value)?useBlob&&typeof Blob=="function"?new Blob([value]):Buffer.from(value):value}function defaultVisitor(value,key,path){let arr=value;if(value&&!path&&typeof value=="object"){if(utils$1.endsWith(key,"{}"))key=metaTokens?key:key.slice(0,-2),value=JSON.stringify(value);else if(utils$1.isArray(value)&&isFlatArray(value)||(utils$1.isFileList(value)||utils$1.endsWith(key,"[]"))&&(arr=utils$1.toArray(value)))return key=removeBrackets(key),arr.forEach(function(el,index){!(utils$1.isUndefined(el)||el===null)&&formData.append(indexes===!0?renderKey([key],index,dots):indexes===null?key:key+"[]",convertValue(el))}),!1}return isVisitable(value)?!0:(formData.append(renderKey(path,key,dots),convertValue(value)),!1)}const stack=[],exposedHelpers=Object.assign(predicates,{defaultVisitor,convertValue,isVisitable});function build(value,path){if(!utils$1.isUndefined(value)){if(stack.indexOf(value)!==-1)throw Error("Circular reference detected in "+path.join("."));stack.push(value),utils$1.forEach(value,function(el,key){(!(utils$1.isUndefined(el)||el===null)&&visitor.call(formData,el,utils$1.isString(key)?key.trim():key,path,exposedHelpers))===!0&&build(el,path?path.concat(key):[key])}),stack.pop()}}if(!utils$1.isObject(obj))throw new TypeError("data must be an object");return build(obj),formData}function encode$1(str){const charMap={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g,function(match){return charMap[match]})}function AxiosURLSearchParams(params,options){this._pairs=[],params&&toFormData$1(params,this,options)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(name,value){this._pairs.push([name,value])},prototype.toString=function(encoder){const _encode=encoder?function(value){return encoder.call(this,value,encode$1)}:encode$1;return this._pairs.map(function(pair){return _encode(pair[0])+"="+_encode(pair[1])},"").join("&")};function encode(val){return encodeURIComponent(val).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(url,params,options){if(!params)return url;const _encode=options&&options.encode||encode;utils$1.isFunction(options)&&(options={serialize:options});const serializeFn=options&&options.serialize;let serializedParams;if(serializeFn?serializedParams=serializeFn(params,options):serializedParams=utils$1.isURLSearchParams(params)?params.toString():new AxiosURLSearchParams(params,options).toString(_encode),serializedParams){const hashmarkIndex=url.indexOf("#");hashmarkIndex!==-1&&(url=url.slice(0,hashmarkIndex)),url+=(url.indexOf("?")===-1?"?":"&")+serializedParams}return url}class InterceptorManager{constructor(){this.handlers=[]}use(fulfilled,rejected,options){return this.handlers.push({fulfilled,rejected,synchronous:options?options.synchronous:!1,runWhen:options?options.runWhen:null}),this.handlers.length-1}eject(id){this.handlers[id]&&(this.handlers[id]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(fn){utils$1.forEach(this.handlers,function(h){h!==null&&fn(h)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},platform$1={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",platform={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),...platform$1};function toURLEncodedForm(data,options){return toFormData$1(data,new platform.classes.URLSearchParams,{visitor:function(value,key,path,helpers){return platform.isNode&&utils$1.isBuffer(value)?(this.append(key,value.toString("base64")),!1):helpers.defaultVisitor.apply(this,arguments)},...options})}function parsePropPath(name){return utils$1.matchAll(/\w+|\[(\w*)]/g,name).map(match=>match[0]==="[]"?"":match[1]||match[0])}function arrayToObject(arr){const obj={},keys=Object.keys(arr);let i2;const len=keys.length;let key;for(i2=0;i2<len;i2++)key=keys[i2],obj[key]=arr[key];return obj}function formDataToJSON(formData){function buildPath(path,value,target,index){let name=path[index++];if(name==="__proto__")return!0;const isNumericKey=Number.isFinite(+name),isLast=index>=path.length;return name=!name&&utils$1.isArray(target)?target.length:name,isLast?(utils$1.hasOwnProp(target,name)?target[name]=[target[name],value]:target[name]=value,!isNumericKey):((!target[name]||!utils$1.isObject(target[name]))&&(target[name]=[]),buildPath(path,value,target[name],index)&&utils$1.isArray(target[name])&&(target[name]=arrayToObject(target[name])),!isNumericKey)}if(utils$1.isFormData(formData)&&utils$1.isFunction(formData.entries)){const obj={};return utils$1.forEachEntry(formData,(name,value)=>{buildPath(parsePropPath(name),value,obj,0)}),obj}return null}function stringifySafely(rawValue,parser,encoder){if(utils$1.isString(rawValue))try{return(parser||JSON.parse)(rawValue),utils$1.trim(rawValue)}catch(e){if(e.name!=="SyntaxError")throw e}return(encoder||JSON.stringify)(rawValue)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(data,headers){const contentType=headers.getContentType()||"",hasJSONContentType=contentType.indexOf("application/json")>-1,isObjectPayload=utils$1.isObject(data);if(isObjectPayload&&utils$1.isHTMLForm(data)&&(data=new FormData(data)),utils$1.isFormData(data))return hasJSONContentType?JSON.stringify(formDataToJSON(data)):data;if(utils$1.isArrayBuffer(data)||utils$1.isBuffer(data)||utils$1.isStream(data)||utils$1.isFile(data)||utils$1.isBlob(data)||utils$1.isReadableStream(data))return data;if(utils$1.isArrayBufferView(data))return data.buffer;if(utils$1.isURLSearchParams(data))return headers.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),data.toString();let isFileList2;if(isObjectPayload){if(contentType.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(data,this.formSerializer).toString();if((isFileList2=utils$1.isFileList(data))||contentType.indexOf("multipart/form-data")>-1){const _FormData=this.env&&this.env.FormData;return toFormData$1(isFileList2?{"files[]":data}:data,_FormData&&new _FormData,this.formSerializer)}}return isObjectPayload||hasJSONContentType?(headers.setContentType("application/json",!1),stringifySafely(data)):data}],transformResponse:[function(data){const transitional=this.transitional||defaults.transitional,forcedJSONParsing=transitional&&transitional.forcedJSONParsing,JSONRequested=this.responseType==="json";if(utils$1.isResponse(data)||utils$1.isReadableStream(data))return data;if(data&&utils$1.isString(data)&&(forcedJSONParsing&&!this.responseType||JSONRequested)){const strictJSONParsing=!(transitional&&transitional.silentJSONParsing)&&JSONRequested;try{return JSON.parse(data)}catch(e){if(strictJSONParsing)throw e.name==="SyntaxError"?AxiosError$1.from(e,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):e}}return data}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(status){return status>=200&&status<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],method=>{defaults.headers[method]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=rawHeaders=>{const parsed={};let key,val,i2;return rawHeaders&&rawHeaders.split(`
6
+ `).forEach(function(line){i2=line.indexOf(":"),key=line.substring(0,i2).trim().toLowerCase(),val=line.substring(i2+1).trim(),!(!key||parsed[key]&&ignoreDuplicateOf[key])&&(key==="set-cookie"?parsed[key]?parsed[key].push(val):parsed[key]=[val]:parsed[key]=parsed[key]?parsed[key]+", "+val:val)}),parsed},$internals=Symbol("internals");function normalizeHeader(header){return header&&String(header).trim().toLowerCase()}function normalizeValue(value){return value===!1||value==null?value:utils$1.isArray(value)?value.map(normalizeValue):String(value)}function parseTokens(str){const tokens=Object.create(null),tokensRE=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let match;for(;match=tokensRE.exec(str);)tokens[match[1]]=match[2];return tokens}const isValidHeaderName=str=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());function matchHeaderValue(context,value,header,filter,isHeaderNameFilter){if(utils$1.isFunction(filter))return filter.call(this,value,header);if(isHeaderNameFilter&&(value=header),!!utils$1.isString(value)){if(utils$1.isString(filter))return value.indexOf(filter)!==-1;if(utils$1.isRegExp(filter))return filter.test(value)}}function formatHeader(header){return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(w,char,str)=>char.toUpperCase()+str)}function buildAccessors(obj,header){const accessorName=utils$1.toCamelCase(" "+header);["get","set","has"].forEach(methodName=>{Object.defineProperty(obj,methodName+accessorName,{value:function(arg1,arg2,arg3){return this[methodName].call(this,header,arg1,arg2,arg3)},configurable:!0})})}let AxiosHeaders$1=class{constructor(headers){headers&&this.set(headers)}set(header,valueOrRewrite,rewrite){const self2=this;function setHeader(_value,_header,_rewrite){const lHeader=normalizeHeader(_header);if(!lHeader)throw new Error("header name must be a non-empty string");const key=utils$1.findKey(self2,lHeader);(!key||self2[key]===void 0||_rewrite===!0||_rewrite===void 0&&self2[key]!==!1)&&(self2[key||_header]=normalizeValue(_value))}const setHeaders=(headers,_rewrite)=>utils$1.forEach(headers,(_value,_header)=>setHeader(_value,_header,_rewrite));if(utils$1.isPlainObject(header)||header instanceof this.constructor)setHeaders(header,valueOrRewrite);else if(utils$1.isString(header)&&(header=header.trim())&&!isValidHeaderName(header))setHeaders(parseHeaders(header),valueOrRewrite);else if(utils$1.isObject(header)&&utils$1.isIterable(header)){let obj={},dest,key;for(const entry of header){if(!utils$1.isArray(entry))throw TypeError("Object iterator must return a key-value pair");obj[key=entry[0]]=(dest=obj[key])?utils$1.isArray(dest)?[...dest,entry[1]]:[dest,entry[1]]:entry[1]}setHeaders(obj,valueOrRewrite)}else header!=null&&setHeader(valueOrRewrite,header,rewrite);return this}get(header,parser){if(header=normalizeHeader(header),header){const key=utils$1.findKey(this,header);if(key){const value=this[key];if(!parser)return value;if(parser===!0)return parseTokens(value);if(utils$1.isFunction(parser))return parser.call(this,value,key);if(utils$1.isRegExp(parser))return parser.exec(value);throw new TypeError("parser must be boolean|regexp|function")}}}has(header,matcher){if(header=normalizeHeader(header),header){const key=utils$1.findKey(this,header);return!!(key&&this[key]!==void 0&&(!matcher||matchHeaderValue(this,this[key],key,matcher)))}return!1}delete(header,matcher){const self2=this;let deleted=!1;function deleteHeader(_header){if(_header=normalizeHeader(_header),_header){const key=utils$1.findKey(self2,_header);key&&(!matcher||matchHeaderValue(self2,self2[key],key,matcher))&&(delete self2[key],deleted=!0)}}return utils$1.isArray(header)?header.forEach(deleteHeader):deleteHeader(header),deleted}clear(matcher){const keys=Object.keys(this);let i2=keys.length,deleted=!1;for(;i2--;){const key=keys[i2];(!matcher||matchHeaderValue(this,this[key],key,matcher,!0))&&(delete this[key],deleted=!0)}return deleted}normalize(format){const self2=this,headers={};return utils$1.forEach(this,(value,header)=>{const key=utils$1.findKey(headers,header);if(key){self2[key]=normalizeValue(value),delete self2[header];return}const normalized=format?formatHeader(header):String(header).trim();normalized!==header&&delete self2[header],self2[normalized]=normalizeValue(value),headers[normalized]=!0}),this}concat(...targets){return this.constructor.concat(this,...targets)}toJSON(asStrings){const obj=Object.create(null);return utils$1.forEach(this,(value,header)=>{value!=null&&value!==!1&&(obj[header]=asStrings&&utils$1.isArray(value)?value.join(", "):value)}),obj}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([header,value])=>header+": "+value).join(`
7
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(thing){return thing instanceof this?thing:new this(thing)}static concat(first,...targets){const computed=new this(first);return targets.forEach(target=>computed.set(target)),computed}static accessor(header){const accessors=(this[$internals]=this[$internals]={accessors:{}}).accessors,prototype2=this.prototype;function defineAccessor(_header){const lHeader=normalizeHeader(_header);accessors[lHeader]||(buildAccessors(prototype2,_header),accessors[lHeader]=!0)}return utils$1.isArray(header)?header.forEach(defineAccessor):defineAccessor(header),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value},key)=>{let mapped=key[0].toUpperCase()+key.slice(1);return{get:()=>value,set(headerValue){this[mapped]=headerValue}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(fns,response){const config=this||defaults,context=response||config,headers=AxiosHeaders$1.from(context.headers);let data=context.data;return utils$1.forEach(fns,function(fn){data=fn.call(config,data,headers.normalize(),response?response.status:void 0)}),headers.normalize(),data}function isCancel$1(value){return!!(value&&value.__CANCEL__)}function CanceledError$1(message,config,request){AxiosError$1.call(this,message??"canceled",AxiosError$1.ERR_CANCELED,config,request),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(resolve,reject,response){const validateStatus=response.config.validateStatus;!response.status||!validateStatus||validateStatus(response.status)?resolve(response):reject(new AxiosError$1("Request failed with status code "+response.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status/100)-4],response.config,response.request,response))}function parseProtocol(url){const match=/^([-+\w]{1,25})(:?\/\/|:)/.exec(url);return match&&match[1]||""}function speedometer(samplesCount,min){samplesCount=samplesCount||10;const bytes=new Array(samplesCount),timestamps=new Array(samplesCount);let head=0,tail=0,firstSampleTS;return min=min!==void 0?min:1e3,function(chunkLength){const now=Date.now(),startedAt=timestamps[tail];firstSampleTS||(firstSampleTS=now),bytes[head]=chunkLength,timestamps[head]=now;let i2=tail,bytesCount=0;for(;i2!==head;)bytesCount+=bytes[i2++],i2=i2%samplesCount;if(head=(head+1)%samplesCount,head===tail&&(tail=(tail+1)%samplesCount),now-firstSampleTS<min)return;const passed=startedAt&&now-startedAt;return passed?Math.round(bytesCount*1e3/passed):void 0}}function throttle(fn,freq){let timestamp=0,threshold=1e3/freq,lastArgs,timer;const invoke=(args,now=Date.now())=>{timestamp=now,lastArgs=null,timer&&(clearTimeout(timer),timer=null),fn(...args)};return[(...args)=>{const now=Date.now(),passed=now-timestamp;passed>=threshold?invoke(args,now):(lastArgs=args,timer||(timer=setTimeout(()=>{timer=null,invoke(lastArgs)},threshold-passed)))},()=>lastArgs&&invoke(lastArgs)]}const progressEventReducer=(listener,isDownloadStream,freq=3)=>{let bytesNotified=0;const _speedometer=speedometer(50,250);return throttle(e=>{const loaded=e.loaded,total=e.lengthComputable?e.total:void 0,progressBytes=loaded-bytesNotified,rate=_speedometer(progressBytes),inRange=loaded<=total;bytesNotified=loaded;const data={loaded,total,progress:total?loaded/total:void 0,bytes:progressBytes,rate:rate||void 0,estimated:rate&&total&&inRange?(total-loaded)/rate:void 0,event:e,lengthComputable:total!=null,[isDownloadStream?"download":"upload"]:!0};listener(data)},freq)},progressEventDecorator=(total,throttled)=>{const lengthComputable=total!=null;return[loaded=>throttled[0]({lengthComputable,total,loaded}),throttled[1]]},asyncDecorator=fn=>(...args)=>utils$1.asap(()=>fn(...args)),isURLSameOrigin=platform.hasStandardBrowserEnv?((origin2,isMSIE)=>url=>(url=new URL(url,platform.origin),origin2.protocol===url.protocol&&origin2.host===url.host&&(isMSIE||origin2.port===url.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(name,value,expires,path,domain,secure){const cookie=[name+"="+encodeURIComponent(value)];utils$1.isNumber(expires)&&cookie.push("expires="+new Date(expires).toGMTString()),utils$1.isString(path)&&cookie.push("path="+path),utils$1.isString(domain)&&cookie.push("domain="+domain),secure===!0&&cookie.push("secure"),document.cookie=cookie.join("; ")},read(name){const match=document.cookie.match(new RegExp("(^|;\\s*)("+name+")=([^;]*)"));return match?decodeURIComponent(match[3]):null},remove(name){this.write(name,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(url){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(url)}function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/?\/$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}function buildFullPath(baseURL,requestedURL,allowAbsoluteUrls){let isRelativeUrl=!isAbsoluteURL(requestedURL);return baseURL&&(isRelativeUrl||allowAbsoluteUrls==!1)?combineURLs(baseURL,requestedURL):requestedURL}const headersToObject=thing=>thing instanceof AxiosHeaders$1?{...thing}:thing;function mergeConfig$1(config1,config2){config2=config2||{};const config={};function getMergedValue(target,source,prop,caseless){return utils$1.isPlainObject(target)&&utils$1.isPlainObject(source)?utils$1.merge.call({caseless},target,source):utils$1.isPlainObject(source)?utils$1.merge({},source):utils$1.isArray(source)?source.slice():source}function mergeDeepProperties(a,b,prop,caseless){if(utils$1.isUndefined(b)){if(!utils$1.isUndefined(a))return getMergedValue(void 0,a,prop,caseless)}else return getMergedValue(a,b,prop,caseless)}function valueFromConfig2(a,b){if(!utils$1.isUndefined(b))return getMergedValue(void 0,b)}function defaultToConfig2(a,b){if(utils$1.isUndefined(b)){if(!utils$1.isUndefined(a))return getMergedValue(void 0,a)}else return getMergedValue(void 0,b)}function mergeDirectKeys(a,b,prop){if(prop in config2)return getMergedValue(a,b);if(prop in config1)return getMergedValue(void 0,a)}const mergeMap={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,withXSRFToken:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:(a,b,prop)=>mergeDeepProperties(headersToObject(a),headersToObject(b),prop,!0)};return utils$1.forEach(Object.keys({...config1,...config2}),function(prop){const merge2=mergeMap[prop]||mergeDeepProperties,configValue=merge2(config1[prop],config2[prop],prop);utils$1.isUndefined(configValue)&&merge2!==mergeDirectKeys||(config[prop]=configValue)}),config}const resolveConfig=config=>{const newConfig=mergeConfig$1({},config);let{data,withXSRFToken,xsrfHeaderName,xsrfCookieName,headers,auth}=newConfig;newConfig.headers=headers=AxiosHeaders$1.from(headers),newConfig.url=buildURL(buildFullPath(newConfig.baseURL,newConfig.url,newConfig.allowAbsoluteUrls),config.params,config.paramsSerializer),auth&&headers.set("Authorization","Basic "+btoa((auth.username||"")+":"+(auth.password?unescape(encodeURIComponent(auth.password)):"")));let contentType;if(utils$1.isFormData(data)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)headers.setContentType(void 0);else if((contentType=headers.getContentType())!==!1){const[type,...tokens]=contentType?contentType.split(";").map(token=>token.trim()).filter(Boolean):[];headers.setContentType([type||"multipart/form-data",...tokens].join("; "))}}if(platform.hasStandardBrowserEnv&&(withXSRFToken&&utils$1.isFunction(withXSRFToken)&&(withXSRFToken=withXSRFToken(newConfig)),withXSRFToken||withXSRFToken!==!1&&isURLSameOrigin(newConfig.url))){const xsrfValue=xsrfHeaderName&&xsrfCookieName&&cookies.read(xsrfCookieName);xsrfValue&&headers.set(xsrfHeaderName,xsrfValue)}return newConfig},xhrAdapter=typeof XMLHttpRequest<"u"&&function(config){return new Promise(function(resolve,reject){const _config=resolveConfig(config);let requestData=_config.data;const requestHeaders=AxiosHeaders$1.from(_config.headers).normalize();let{responseType,onUploadProgress,onDownloadProgress}=_config,onCanceled,uploadThrottled,downloadThrottled,flushUpload,flushDownload;function done(){flushUpload&&flushUpload(),flushDownload&&flushDownload(),_config.cancelToken&&_config.cancelToken.unsubscribe(onCanceled),_config.signal&&_config.signal.removeEventListener("abort",onCanceled)}let request=new XMLHttpRequest;request.open(_config.method.toUpperCase(),_config.url,!0),request.timeout=_config.timeout;function onloadend(){if(!request)return;const responseHeaders=AxiosHeaders$1.from("getAllResponseHeaders"in request&&request.getAllResponseHeaders()),response={data:!responseType||responseType==="text"||responseType==="json"?request.responseText:request.response,status:request.status,statusText:request.statusText,headers:responseHeaders,config,request};settle(function(value){resolve(value),done()},function(err){reject(err),done()},response),request=null}"onloadend"in request?request.onloadend=onloadend:request.onreadystatechange=function(){!request||request.readyState!==4||request.status===0&&!(request.responseURL&&request.responseURL.indexOf("file:")===0)||setTimeout(onloadend)},request.onabort=function(){request&&(reject(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,config,request)),request=null)},request.onerror=function(){reject(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,config,request)),request=null},request.ontimeout=function(){let timeoutErrorMessage=_config.timeout?"timeout of "+_config.timeout+"ms exceeded":"timeout exceeded";const transitional=_config.transitional||transitionalDefaults;_config.timeoutErrorMessage&&(timeoutErrorMessage=_config.timeoutErrorMessage),reject(new AxiosError$1(timeoutErrorMessage,transitional.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,config,request)),request=null},requestData===void 0&&requestHeaders.setContentType(null),"setRequestHeader"in request&&utils$1.forEach(requestHeaders.toJSON(),function(val,key){request.setRequestHeader(key,val)}),utils$1.isUndefined(_config.withCredentials)||(request.withCredentials=!!_config.withCredentials),responseType&&responseType!=="json"&&(request.responseType=_config.responseType),onDownloadProgress&&([downloadThrottled,flushDownload]=progressEventReducer(onDownloadProgress,!0),request.addEventListener("progress",downloadThrottled)),onUploadProgress&&request.upload&&([uploadThrottled,flushUpload]=progressEventReducer(onUploadProgress),request.upload.addEventListener("progress",uploadThrottled),request.upload.addEventListener("loadend",flushUpload)),(_config.cancelToken||_config.signal)&&(onCanceled=cancel=>{request&&(reject(!cancel||cancel.type?new CanceledError$1(null,config,request):cancel),request.abort(),request=null)},_config.cancelToken&&_config.cancelToken.subscribe(onCanceled),_config.signal&&(_config.signal.aborted?onCanceled():_config.signal.addEventListener("abort",onCanceled)));const protocol=parseProtocol(_config.url);if(protocol&&platform.protocols.indexOf(protocol)===-1){reject(new AxiosError$1("Unsupported protocol "+protocol+":",AxiosError$1.ERR_BAD_REQUEST,config));return}request.send(requestData||null)})},composeSignals=(signals,timeout)=>{const{length}=signals=signals?signals.filter(Boolean):[];if(timeout||length){let controller=new AbortController,aborted;const onabort=function(reason){if(!aborted){aborted=!0,unsubscribe();const err=reason instanceof Error?reason:this.reason;controller.abort(err instanceof AxiosError$1?err:new CanceledError$1(err instanceof Error?err.message:err))}};let timer=timeout&&setTimeout(()=>{timer=null,onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`,AxiosError$1.ETIMEDOUT))},timeout);const unsubscribe=()=>{signals&&(timer&&clearTimeout(timer),timer=null,signals.forEach(signal2=>{signal2.unsubscribe?signal2.unsubscribe(onabort):signal2.removeEventListener("abort",onabort)}),signals=null)};signals.forEach(signal2=>signal2.addEventListener("abort",onabort));const{signal}=controller;return signal.unsubscribe=()=>utils$1.asap(unsubscribe),signal}},streamChunk=function*(chunk,chunkSize){let len=chunk.byteLength;if(len<chunkSize){yield chunk;return}let pos=0,end;for(;pos<len;)end=pos+chunkSize,yield chunk.slice(pos,end),pos=end},readBytes=async function*(iterable,chunkSize){for await(const chunk of readStream(iterable))yield*streamChunk(chunk,chunkSize)},readStream=async function*(stream){if(stream[Symbol.asyncIterator]){yield*stream;return}const reader=stream.getReader();try{for(;;){const{done,value}=await reader.read();if(done)break;yield value}}finally{await reader.cancel()}},trackStream=(stream,chunkSize,onProgress,onFinish)=>{const iterator2=readBytes(stream,chunkSize);let bytes=0,done,_onFinish=e=>{done||(done=!0,onFinish&&onFinish(e))};return new ReadableStream({async pull(controller){try{const{done:done2,value}=await iterator2.next();if(done2){_onFinish(),controller.close();return}let len=value.byteLength;if(onProgress){let loadedBytes=bytes+=len;onProgress(loadedBytes)}controller.enqueue(new Uint8Array(value))}catch(err){throw _onFinish(err),err}},cancel(reason){return _onFinish(reason),iterator2.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(encoder=>str=>encoder.encode(str))(new TextEncoder):async str=>new Uint8Array(await new Response(str).arrayBuffer())),test=(fn,...args)=>{try{return!!fn(...args)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let duplexAccessed=!1;const hasContentType=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return duplexAccessed=!0,"half"}}).headers.has("Content-Type");return duplexAccessed&&!hasContentType}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(res=>res.body)};isFetchSupported&&(res=>{["text","arrayBuffer","blob","formData","stream"].forEach(type=>{!resolvers[type]&&(resolvers[type]=utils$1.isFunction(res[type])?res2=>res2[type]():(_,config)=>{throw new AxiosError$1(`Response type '${type}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,config)})})})(new Response);const getBodyLength=async body=>{if(body==null)return 0;if(utils$1.isBlob(body))return body.size;if(utils$1.isSpecCompliantForm(body))return(await new Request(platform.origin,{method:"POST",body}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(body)||utils$1.isArrayBuffer(body))return body.byteLength;if(utils$1.isURLSearchParams(body)&&(body=body+""),utils$1.isString(body))return(await encodeText(body)).byteLength},resolveBodyLength=async(headers,body)=>{const length=utils$1.toFiniteNumber(headers.getContentLength());return length??getBodyLength(body)},knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:isFetchSupported&&(async config=>{let{url,method,data,signal,cancelToken,timeout,onDownloadProgress,onUploadProgress,responseType,headers,withCredentials="same-origin",fetchOptions}=resolveConfig(config);responseType=responseType?(responseType+"").toLowerCase():"text";let composedSignal=composeSignals([signal,cancelToken&&cancelToken.toAbortSignal()],timeout),request;const unsubscribe=composedSignal&&composedSignal.unsubscribe&&(()=>{composedSignal.unsubscribe()});let requestContentLength;try{if(onUploadProgress&&supportsRequestStream&&method!=="get"&&method!=="head"&&(requestContentLength=await resolveBodyLength(headers,data))!==0){let _request=new Request(url,{method:"POST",body:data,duplex:"half"}),contentTypeHeader;if(utils$1.isFormData(data)&&(contentTypeHeader=_request.headers.get("content-type"))&&headers.setContentType(contentTypeHeader),_request.body){const[onProgress,flush]=progressEventDecorator(requestContentLength,progressEventReducer(asyncDecorator(onUploadProgress)));data=trackStream(_request.body,DEFAULT_CHUNK_SIZE,onProgress,flush)}}utils$1.isString(withCredentials)||(withCredentials=withCredentials?"include":"omit");const isCredentialsSupported="credentials"in Request.prototype;request=new Request(url,{...fetchOptions,signal:composedSignal,method:method.toUpperCase(),headers:headers.normalize().toJSON(),body:data,duplex:"half",credentials:isCredentialsSupported?withCredentials:void 0});let response=await fetch(request,fetchOptions);const isStreamResponse=supportsResponseStream&&(responseType==="stream"||responseType==="response");if(supportsResponseStream&&(onDownloadProgress||isStreamResponse&&unsubscribe)){const options={};["status","statusText","headers"].forEach(prop=>{options[prop]=response[prop]});const responseContentLength=utils$1.toFiniteNumber(response.headers.get("content-length")),[onProgress,flush]=onDownloadProgress&&progressEventDecorator(responseContentLength,progressEventReducer(asyncDecorator(onDownloadProgress),!0))||[];response=new Response(trackStream(response.body,DEFAULT_CHUNK_SIZE,onProgress,()=>{flush&&flush(),unsubscribe&&unsubscribe()}),options)}responseType=responseType||"text";let responseData=await resolvers[utils$1.findKey(resolvers,responseType)||"text"](response,config);return!isStreamResponse&&unsubscribe&&unsubscribe(),await new Promise((resolve,reject)=>{settle(resolve,reject,{data:responseData,headers:AxiosHeaders$1.from(response.headers),status:response.status,statusText:response.statusText,config,request})})}catch(err){throw unsubscribe&&unsubscribe(),err&&err.name==="TypeError"&&/Load failed|fetch/i.test(err.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,config,request),{cause:err.cause||err}):AxiosError$1.from(err,err&&err.code,config,request)}})};utils$1.forEach(knownAdapters,(fn,value)=>{if(fn){try{Object.defineProperty(fn,"name",{value})}catch{}Object.defineProperty(fn,"adapterName",{value})}});const renderReason=reason=>`- ${reason}`,isResolvedHandle=adapter=>utils$1.isFunction(adapter)||adapter===null||adapter===!1,adapters={getAdapter:adapters2=>{adapters2=utils$1.isArray(adapters2)?adapters2:[adapters2];const{length}=adapters2;let nameOrAdapter,adapter;const rejectedReasons={};for(let i2=0;i2<length;i2++){nameOrAdapter=adapters2[i2];let id;if(adapter=nameOrAdapter,!isResolvedHandle(nameOrAdapter)&&(adapter=knownAdapters[(id=String(nameOrAdapter)).toLowerCase()],adapter===void 0))throw new AxiosError$1(`Unknown adapter '${id}'`);if(adapter)break;rejectedReasons[id||"#"+i2]=adapter}if(!adapter){const reasons=Object.entries(rejectedReasons).map(([id,state])=>`adapter ${id} `+(state===!1?"is not supported by the environment":"is not available in the build"));let s=length?reasons.length>1?`since :
8
+ `+reasons.map(renderReason).join(`
9
+ `):" "+renderReason(reasons[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return adapter},adapters:knownAdapters};function throwIfCancellationRequested(config){if(config.cancelToken&&config.cancelToken.throwIfRequested(),config.signal&&config.signal.aborted)throw new CanceledError$1(null,config)}function dispatchRequest(config){return throwIfCancellationRequested(config),config.headers=AxiosHeaders$1.from(config.headers),config.data=transformData.call(config,config.transformRequest),["post","put","patch"].indexOf(config.method)!==-1&&config.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(config.adapter||defaults.adapter)(config).then(function(response){return throwIfCancellationRequested(config),response.data=transformData.call(config,config.transformResponse,response),response.headers=AxiosHeaders$1.from(response.headers),response},function(reason){return isCancel$1(reason)||(throwIfCancellationRequested(config),reason&&reason.response&&(reason.response.data=transformData.call(config,config.transformResponse,reason.response),reason.response.headers=AxiosHeaders$1.from(reason.response.headers))),Promise.reject(reason)})}const VERSION$2="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((type,i2)=>{validators$1[type]=function(thing){return typeof thing===type||"a"+(i2<1?"n ":" ")+type}});const deprecatedWarnings={};validators$1.transitional=function(validator2,version,message){function formatMessage(opt,desc){return"[Axios v"+VERSION$2+"] Transitional option '"+opt+"'"+desc+(message?". "+message:"")}return(value,opt,opts)=>{if(validator2===!1)throw new AxiosError$1(formatMessage(opt," has been removed"+(version?" in "+version:"")),AxiosError$1.ERR_DEPRECATED);return version&&!deprecatedWarnings[opt]&&(deprecatedWarnings[opt]=!0,console.warn(formatMessage(opt," has been deprecated since v"+version+" and will be removed in the near future"))),validator2?validator2(value,opt,opts):!0}},validators$1.spelling=function(correctSpelling){return(value,opt)=>(console.warn(`${opt} is likely a misspelling of ${correctSpelling}`),!0)};function assertOptions(options,schema,allowUnknown){if(typeof options!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const keys=Object.keys(options);let i2=keys.length;for(;i2-- >0;){const opt=keys[i2],validator2=schema[opt];if(validator2){const value=options[opt],result=value===void 0||validator2(value,opt,options);if(result!==!0)throw new AxiosError$1("option "+opt+" must be "+result,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(allowUnknown!==!0)throw new AxiosError$1("Unknown option "+opt,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(instanceConfig){this.defaults=instanceConfig||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(configOrUrl,config){try{return await this._request(configOrUrl,config)}catch(err){if(err instanceof Error){let dummy={};Error.captureStackTrace?Error.captureStackTrace(dummy):dummy=new Error;const stack=dummy.stack?dummy.stack.replace(/^.+\n/,""):"";try{err.stack?stack&&!String(err.stack).endsWith(stack.replace(/^.+\n.+\n/,""))&&(err.stack+=`
10
+ `+stack):err.stack=stack}catch{}}throw err}}_request(configOrUrl,config){typeof configOrUrl=="string"?(config=config||{},config.url=configOrUrl):config=configOrUrl||{},config=mergeConfig$1(this.defaults,config);const{transitional,paramsSerializer,headers}=config;transitional!==void 0&&validator.assertOptions(transitional,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),paramsSerializer!=null&&(utils$1.isFunction(paramsSerializer)?config.paramsSerializer={serialize:paramsSerializer}:validator.assertOptions(paramsSerializer,{encode:validators.function,serialize:validators.function},!0)),config.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?config.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:config.allowAbsoluteUrls=!0),validator.assertOptions(config,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),config.method=(config.method||this.defaults.method||"get").toLowerCase();let contextHeaders=headers&&utils$1.merge(headers.common,headers[config.method]);headers&&utils$1.forEach(["delete","get","head","post","put","patch","common"],method=>{delete headers[method]}),config.headers=AxiosHeaders$1.concat(contextHeaders,headers);const requestInterceptorChain=[];let synchronousRequestInterceptors=!0;this.interceptors.request.forEach(function(interceptor){typeof interceptor.runWhen=="function"&&interceptor.runWhen(config)===!1||(synchronousRequestInterceptors=synchronousRequestInterceptors&&interceptor.synchronous,requestInterceptorChain.unshift(interceptor.fulfilled,interceptor.rejected))});const responseInterceptorChain=[];this.interceptors.response.forEach(function(interceptor){responseInterceptorChain.push(interceptor.fulfilled,interceptor.rejected)});let promise,i2=0,len;if(!synchronousRequestInterceptors){const chain=[dispatchRequest.bind(this),void 0];for(chain.unshift(...requestInterceptorChain),chain.push(...responseInterceptorChain),len=chain.length,promise=Promise.resolve(config);i2<len;)promise=promise.then(chain[i2++],chain[i2++]);return promise}len=requestInterceptorChain.length;let newConfig=config;for(i2=0;i2<len;){const onFulfilled=requestInterceptorChain[i2++],onRejected=requestInterceptorChain[i2++];try{newConfig=onFulfilled(newConfig)}catch(error){onRejected.call(this,error);break}}try{promise=dispatchRequest.call(this,newConfig)}catch(error){return Promise.reject(error)}for(i2=0,len=responseInterceptorChain.length;i2<len;)promise=promise.then(responseInterceptorChain[i2++],responseInterceptorChain[i2++]);return promise}getUri(config){config=mergeConfig$1(this.defaults,config);const fullPath=buildFullPath(config.baseURL,config.url,config.allowAbsoluteUrls);return buildURL(fullPath,config.params,config.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function(method){Axios$1.prototype[method]=function(url,config){return this.request(mergeConfig$1(config||{},{method,url,data:(config||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(method){function generateHTTPMethod(isForm){return function(url,data,config){return this.request(mergeConfig$1(config||{},{method,headers:isForm?{"Content-Type":"multipart/form-data"}:{},url,data}))}}Axios$1.prototype[method]=generateHTTPMethod(),Axios$1.prototype[method+"Form"]=generateHTTPMethod(!0)});let CancelToken$1=class CancelToken2{constructor(executor){if(typeof executor!="function")throw new TypeError("executor must be a function.");let resolvePromise;this.promise=new Promise(function(resolve){resolvePromise=resolve});const token=this;this.promise.then(cancel=>{if(!token._listeners)return;let i2=token._listeners.length;for(;i2-- >0;)token._listeners[i2](cancel);token._listeners=null}),this.promise.then=onfulfilled=>{let _resolve;const promise=new Promise(resolve=>{token.subscribe(resolve),_resolve=resolve}).then(onfulfilled);return promise.cancel=function(){token.unsubscribe(_resolve)},promise},executor(function(message,config,request){token.reason||(token.reason=new CanceledError$1(message,config,request),resolvePromise(token.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(listener){if(this.reason){listener(this.reason);return}this._listeners?this._listeners.push(listener):this._listeners=[listener]}unsubscribe(listener){if(!this._listeners)return;const index=this._listeners.indexOf(listener);index!==-1&&this._listeners.splice(index,1)}toAbortSignal(){const controller=new AbortController,abort=err=>{controller.abort(err)};return this.subscribe(abort),controller.signal.unsubscribe=()=>this.unsubscribe(abort),controller.signal}static source(){let cancel;return{token:new CancelToken2(function(c){cancel=c}),cancel}}};function spread$1(callback){return function(arr){return callback.apply(null,arr)}}function isAxiosError$1(payload){return utils$1.isObject(payload)&&payload.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([key,value])=>{HttpStatusCode$1[value]=key});function createInstance(defaultConfig){const context=new Axios$1(defaultConfig),instance=bind(Axios$1.prototype.request,context);return utils$1.extend(instance,Axios$1.prototype,context,{allOwnKeys:!0}),utils$1.extend(instance,context,null,{allOwnKeys:!0}),instance.create=function(instanceConfig){return createInstance(mergeConfig$1(defaultConfig,instanceConfig))},instance}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$2,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(promises){return Promise.all(promises)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=thing=>formDataToJSON(utils$1.isHTMLForm(thing)?new FormData(thing):thing),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION:VERSION$1,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,api=axios.create({baseURL:"https://scryspell.com",withCredentials:!0}),post=(url,data,config)=>api.post(url,data,config),put=(url,data,config)=>api.put(url,data,config),patch=(url,data,config)=>api.patch(url,data,config),logger={info:(...args)=>{console.log("info",...args)},warn:(...args)=>{console.log("warn",...args)},error:(...args)=>{console.log("error",...args)}};function assertNever(x){throw new Error("Unexpected object: "+x)}class SessionRecorder{constructor(recorderSettings){this.recorderSettings=recorderSettings,this.buffer={data:[]},this.flushIntervalMs=2e3}capturedSessionId=null;buffer;stopFn;flushIntervalMs;flushTimer;setCapturedSessionId(id){this.capturedSessionId=id}start=()=>{if(Object.assign===void 0)return;this.buffer={data:[]};const recordOptions={emit:event=>{this.buffer.data.push(event)},blockClass:"scry-block"};switch(this.recorderSettings.maskingLevel){case MaskingLevel.None:break;case MaskingLevel.All:recordOptions.maskTextFn=input=>input.replaceAll(/./g,"*");break;case null:case MaskingLevel.InputAndTextArea:recordOptions.maskAllInputs=!0;break;case MaskingLevel.InputPasswordOrEmailAndTextArea:recordOptions.maskInputOptions={password:!0,email:!0,textarea:!0};break;default:assertNever(this.recorderSettings.maskingLevel)}this.stopFn=record(recordOptions),this.scheduleFlush()};scheduleFlush=()=>{this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=setTimeout(this.flush,this.flushIntervalMs)};flush=async()=>{if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),this.capturedSessionId&&this.buffer.data.length>0)try{let response=await patch(`public/captured-sessions/${this.capturedSessionId}/recording`,this.buffer,{withCredentials:!1});response.status>=400?(logger.error(`status ${response.status} when trying to save session recording data.`),logger.error(response.data)):this.clearAllBufferData()}catch(error){logger.error("Error flushing session data:",error)}this.scheduleFlush()};stop=()=>{this.stopFn&&this.stopFn(),this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)};clearAllBufferData=()=>{this.buffer.data=[]}}class EventRecorder{constructor(window2,recorderSettings){this.window=window2,this.recorderSettings=recorderSettings}eventsBuffer=[];isRunning=!1;tagsToCapture=new Set(["button","a","select","textarea","input"]);queryParamsAllowed=new Set(["utm_source","source","ref","utm_medium","medium","utm_campaign","campaign","utm_content","content","utm_term","term"]);flushIntervalMs=2e3;capturedSessionId;flushTimerId=null;start=()=>{if(this.isRunning)return;this.isRunning=!0,this.eventsBuffer=[];const originalPushState=this.window.history.pushState.bind(this.window.history);this.window.history.pushState=(data,unused,url)=>{let urlString="";return url instanceof URL?urlString=url.toString():url?urlString=url:urlString="",this.handlePageView(urlString),originalPushState(data,unused,url)},this.window.addEventListener("pageshow",e=>{try{this.handlePageView(this.window.location.pathname)}catch(error){logger.error("Failed to capture URL change event",error)}}),this.window.addEventListener("change",this.handler),this.window.addEventListener("click",this.handler),this.window.addEventListener("keydown",this.handler),this.scheduleFlush()};scheduleFlush=()=>{this.flushTimerId&&clearTimeout(this.flushTimerId),this.flushTimerId=setTimeout(this.flush,this.flushIntervalMs)};flush=async()=>{if(this.eventsBuffer.length>0&&this.capturedSessionId)try{const response=await post(`/public/captured-sessions/${this.capturedSessionId}/ui-events`,this.eventsBuffer,{withCredentials:!1});response.status!==201&&logger.error("Failed to save ui events",response.data),this.eventsBuffer=[]}catch(error){logger.error("Failed to save ui events",error),this.eventsBuffer=[]}this.scheduleFlush()};handlePageView=path=>{if(this.isRunning)try{const timestamp=Date.now();path.charAt(0)==="/"||(path=this.window.location.pathname+"/"+path);const url=new URL(this.window.location.protocol+"//"+this.window.location.host+path+this.window.location.search),sanitizedUrlString=this.sanitizeUrlParams(url.toString(),this.queryParamsAllowed),sanitizedUrl=new URL(sanitizedUrlString),searchParamsArray=Array.from(sanitizedUrl.searchParams),interactionEvent={eventType:"page_view",timestamp,text:path,host:sanitizedUrl.hostname,path};searchParamsArray.length>0&&(interactionEvent.queryParams=searchParamsArray),this.eventsBuffer.push(interactionEvent)}catch(error){logger.error("Failed to capture URL change event",error)}};sanitizeUrlParams=(url,paramsAllowed)=>{try{const urlObj=new URL(url);for(const key of urlObj.searchParams.keys())paramsAllowed.has(key.toLowerCase())||urlObj.searchParams.set(key,"$redacted");return urlObj.toString()}catch(e){return logger.error("Failed to sanitize URL params",e),url}};handler=e=>{if(this.isRunning)try{const eventType=e.type,target=e.target,tagName=target?.tagName.toLowerCase();if(!(tagName&&this.tagsToCapture.has(tagName)))return;const url=new URL(this.window.location.href),host=url.hostname,path=url.pathname,timestamp=Date.now(),domContext=this.captureDomContext(target);switch(e.type){case"click":const clickEvent=this.handleClick(target,tagName,timestamp,host,path);this.eventsBuffer.push(clickEvent);break;case"keydown":const keyEvent=this.handleKeyDown(e,tagName,target,timestamp,host,path);this.eventsBuffer.push(keyEvent);break;case"change":const changeEvent=this.handleChange(target,tagName,timestamp,host,path);this.eventsBuffer.push(changeEvent);break;default:this.eventsBuffer.push({eventType,tagName,timestamp,host,path,text:null,domContext})}}catch(error){logger.error("Failed to capture event",error)}};handleChange(target,tagName,timestamp,host,path){let text=null;switch(target instanceof HTMLSelectElement&&(text=target.options[target.selectedIndex].text),this.recorderSettings.maskingLevel){case MaskingLevel.None:break;case MaskingLevel.All:text=null;break;case null:case MaskingLevel.InputAndTextArea:break;case MaskingLevel.InputPasswordOrEmailAndTextArea:break;default:assertNever(this.recorderSettings.maskingLevel)}return{eventType:"change",tagName,timestamp,text:text===""?null:text,host,path,domContext:this.captureDomContext(target)}}handleClick(target,tagName,timestamp,host,path){let text="";if(target instanceof HTMLInputElement||target instanceof HTMLTextAreaElement){const labelText=this.findInputOrSelectOrTextAreaLabel(target);labelText?text=labelText:target.placeholder&&(text=target.placeholder)}else if(target instanceof HTMLSelectElement){const labelText=this.findInputOrSelectOrTextAreaLabel(target);labelText?text=labelText:text=target.value+" ("+target.options[target.selectedIndex].text+")"}else target instanceof HTMLButtonElement?text=target.innerText:target instanceof HTMLAnchorElement?text=target.href:target instanceof HTMLImageElement&&(text=target.src);switch(this.recorderSettings.maskingLevel){case MaskingLevel.None:break;case MaskingLevel.All:text=null;break;case null:case MaskingLevel.InputAndTextArea:(target instanceof HTMLInputElement||target instanceof HTMLTextAreaElement)&&(text=null);break;case MaskingLevel.InputPasswordOrEmailAndTextArea:(target instanceof HTMLTextAreaElement||target instanceof HTMLInputElement&&(target.type==="password"||target.type==="email"||target.type==="e-mail"))&&(text=null);break;default:assertNever(this.recorderSettings.maskingLevel)}return{eventType:"click",tagName,timestamp,text:text===""?null:text,host,path,domContext:this.captureDomContext(target)}}handleKeyDown(e,tagName,target,timestamp,host,path){const key=e.key;let text=null;if(target instanceof HTMLInputElement||target instanceof HTMLTextAreaElement){const labelText=this.findInputOrSelectOrTextAreaLabel(target);labelText?text=labelText:target.placeholder&&(text=target.placeholder)}switch(this.recorderSettings.maskingLevel){case MaskingLevel.None:break;case MaskingLevel.All:text=null;break;case null:case MaskingLevel.InputAndTextArea:(target instanceof HTMLInputElement||target instanceof HTMLTextAreaElement)&&(text=null);break;case MaskingLevel.InputPasswordOrEmailAndTextArea:(target instanceof HTMLTextAreaElement||target instanceof HTMLInputElement&&(target.type==="password"||target.type==="email"||target.type==="e-mail"))&&(text=null);break;default:assertNever(this.recorderSettings.maskingLevel)}return{eventType:"keydown",tagName,timestamp,text,key,host,path,domContext:this.captureDomContext(target)}}findInputOrSelectOrTextAreaLabel=el=>{if(!el||!new Set(["input","select","textarea"]).has(el.tagName.toLowerCase()))return null;const wrappingLabel=el.closest("label");if(wrappingLabel){const text=Array.from(wrappingLabel.childNodes).filter(node=>node.nodeName.toLowerCase()!=="select").map(node=>(node.textContent??"").trim()).filter(Boolean).join(" ").trim();if(text)return text}const id=el.id;if(id){const explicitLabel=el.ownerDocument.querySelector(`label[for="${CSS.escape(id)}"]`);if(explicitLabel){const text=Array.from(explicitLabel.childNodes).filter(node=>node.nodeName.toLowerCase()!=="select").map(node=>(node.textContent??"").trim()).filter(Boolean).join(" ").trim();if(text)return text}}const ariaLabel=el.getAttribute("aria-label");if(ariaLabel)return ariaLabel.trim();const ariaLabelledBy=el.getAttribute("aria-labelledby");return ariaLabelledBy&&el.ownerDocument.getElementById(ariaLabelledBy)?.textContent?.trim()||null};stop=()=>{this.isRunning=!1,this.window.removeEventListener("change",this.handler),this.window.removeEventListener("click",this.handler),this.window.removeEventListener("keydown",this.handler),this.flushTimerId&&(clearTimeout(this.flushTimerId),this.flushTimerId=null)};captureDomContext=targetElement=>{const context=[];context.push(this.toJsonNode(targetElement));let current=targetElement.parentElement;for(;current!=null&&context.length<6;)context.push(this.toJsonNode(current)),current=current.parentElement;return context};toJsonNode=node=>{const attrs={};return["id","class","name","type","role","aria-label"].forEach(key=>{const val=node.getAttribute(key);val&&(attrs[key]=val)}),{tag:node.tagName.toLowerCase(),attrs}};setCapturedSessionId(uuid){this.capturedSessionId=uuid}}var LIBVERSION="2.0.4",UA_MAX_LENGTH=500,USER_AGENT="user-agent",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",MAJOR="major",MODEL="model",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTORS=CH_HEADER+"-form-factors",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",NVIDIA="Nvidia",ONEPLUS="OnePlus",OPPO="OPPO",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",CHROME="Chrome",CHROMIUM="Chromium",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",WINDOWS="Windows",isWindow=typeof window!==UNDEF_TYPE,NAVIGATOR=isWindow&&window.navigator?window.navigator:void 0,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:void 0,extend=function(defaultRgx,extensions){var mergedRgx={},extraRgx=extensions;if(!isExtensions(extensions)){extraRgx={};for(var i2 in extensions)for(var j in extensions[i2])extraRgx[j]=extensions[i2][j].concat(extraRgx[j]?extraRgx[j]:[])}for(var k in defaultRgx)mergedRgx[k]=extraRgx[k]&&extraRgx[k].length%2===0?extraRgx[k].concat(defaultRgx[k]):defaultRgx[k];return mergedRgx},enumerize=function(arr){for(var enums={},i2=0;i2<arr.length;i2++)enums[arr[i2].toUpperCase()]=arr[i2];return enums},has=function(str1,str2){if(typeof str1===OBJ_TYPE&&str1.length>0){for(var i2 in str1)if(lowerize(str2)==lowerize(str1[i2]))return!0;return!1}return isString(str1)?lowerize(str2)==lowerize(str1):!1},isExtensions=function(obj,deep){for(var prop in obj)return/^(browser|cpu|device|engine|os)$/.test(prop)||(deep?isExtensions(obj[prop]):!1)},isString=function(val){return typeof val===STR_TYPE},itemListToArray=function(header){if(header){for(var arr=[],tokens=strip(/\\?\"/g,header).split(","),i2=0;i2<tokens.length;i2++)if(tokens[i2].indexOf(";")>-1){var token=trim(tokens[i2]).split(";v=");arr[i2]={brand:token[0],version:token[1]}}else arr[i2]=trim(tokens[i2]);return arr}},lowerize=function(str){return isString(str)?str.toLowerCase():str},majorize=function(version){return isString(version)?strip(/[^\d\.]/g,version).split(".")[0]:void 0},setProps=function(arr){for(var i2 in arr){var propName=arr[i2];typeof propName==OBJ_TYPE&&propName.length==2?this[propName[0]]=propName[1]:this[propName]=void 0}return this},strip=function(pattern,str){return isString(str)?str.replace(pattern,EMPTY):str},stripQuotes=function(str){return strip(/\\?\"/g,str)},trim=function(str,len){if(isString(str))return str=strip(/^\s\s*/,str),typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)},rgxMapper=function(ua,arrays){if(!(!ua||!arrays))for(var i2=0,j,k,p,q,matches,match;i2<arrays.length&&!matches;){var regex=arrays[i2],props=arrays[i2+1];for(j=k=0;j<regex.length&&!matches&&regex[j];)if(matches=regex[j++].exec(ua),matches)for(p=0;p<props.length;p++)match=matches[++k],q=props[p],typeof q===OBJ_TYPE&&q.length>0?q.length===2?typeof q[1]==FUNC_TYPE?this[q[0]]=q[1].call(this,match):this[q[0]]=q[1]:q.length>=3&&(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)?q.length>3?this[q[0]]=match?q[1].apply(this,q.slice(2)):void 0:this[q[0]]=match?q[1].call(this,match,q[2]):void 0:q.length==3?this[q[0]]=match?match.replace(q[1],q[2]):void 0:q.length==4?this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):void 0:q.length>4&&(this[q[0]]=match?q[3].apply(this,[match.replace(q[1],q[2])].concat(q.slice(4))):void 0)):this[q]=match||void 0;i2+=2}},strMapper=function(str,map){for(var i2 in map)if(typeof map[i2]===OBJ_TYPE&&map[i2].length>0){for(var j=0;j<map[i2].length;j++)if(has(map[i2][j],str))return i2===UNKNOWN?void 0:i2}else if(has(map[i2],str))return i2===UNKNOWN?void 0:i2;return map.hasOwnProperty("*")?map["*"]:str},windowsVersionMap={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},formFactorsMap={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},browserHintsMap={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},defaultRegexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" GX"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[VERSION,[NAME,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[NAME,VERSION],[/quark(?:pc)?\/([-\w\.]+)/i],[VERSION,[NAME,"Quark"]],[/\bddg\/([\w\.]+)/i],[VERSION,[NAME,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION,[NAME,"Smart "+LENOVO+SUFFIX_BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure"+SUFFIX_BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI"+SUFFIX_BROWSER]],[/fxios\/([\w\.-]+)/i],[VERSION,[NAME,PREFIX_MOBILE+FIREFOX]],[/\bqihoobrowser\/?([\w\.]*)/i],[VERSION,[NAME,"360"]],[/\b(qq)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1Browser"],VERSION],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1"+SUFFIX_BROWSER],VERSION],[/samsungbrowser\/([\w\.]+)/i],[VERSION,[NAME,SAMSUNG+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[VERSION,[NAME,SOGOU+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,SOGOU+" Mobile"],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[NAME,VERSION],[/(lbbrowser|rekonq)/i],[NAME],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[VERSION,NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION,[TYPE,INAPP]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[NAME,VERSION,[TYPE,INAPP]],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"],[TYPE,INAPP]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION,[NAME,"TikTok"],[TYPE,INAPP]],[/\[(linkedin)app\]/i],[NAME,[TYPE,INAPP]],[/(chromium)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[VERSION,[NAME,EDGE+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android"+SUFFIX_BROWSER]],[/chrome\/([\w\.]+) mobile/i],[VERSION,[NAME,PREFIX_MOBILE+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[VERSION,[NAME,PREFIX_MOBILE+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[NAME,PREFIX_MOBILE+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[NAME,PREFIX_MOBILE+FIREFOX],VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/(wolvic|librewolf)\/([\w\.]+)/i],[NAME,VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[NAME,[VERSION,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION,/[^\d\.]+./,EMPTY]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ARCHITECTURE,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/ sun4\w[;\)]/i],[[ARCHITECTURE,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[MODEL,[VENDOR,HONOR],[TYPE,TABLET]],[/honor([-\w ]+)[;\)]/i],[MODEL,[VENDOR,HONOR],[TYPE,MOBILE]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,MOBILE]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,OPPO],[TYPE,MOBILE]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[MODEL,[VENDOR,strMapper,{OnePlus:["203","304","403","404","413","415"],"*":OPPO}],[TYPE,TABLET]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[MODEL,[VENDOR,"BLU"],[TYPE,MOBILE]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,TABLET]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(nokia) (t[12][01])/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[MODEL,/_/g," "],[TYPE,MOBILE],[VENDOR,"Nokia"]],[/(pixel (c|tablet))\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/(google) (pixelbook( go)?)/i],[VENDOR,MODEL],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,TABLET]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,MOBILE]],[/(itel) ((\w+))/i],[[VENDOR,lowerize],MODEL,[TYPE,strMapper,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Energizer"],[TYPE,MOBILE]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[MODEL,[VENDOR,"Cat"],[TYPE,MOBILE]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Smartfren"],[TYPE,MOBILE]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[MODEL,[VENDOR,"Nothing"],[TYPE,MOBILE]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,TABLET]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,MOBILE]],[/; (n159v)/i],[MODEL,[VENDOR,"HMD"],[TYPE,MOBILE]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey.*devicetype\/chromecast/i],[[MODEL,CHROMECAST+" Third Generation"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey.*devicetype\/([^/]*)/i],[[MODEL,/^/,"Chromecast "],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/fuchsia.*crkey/i],[[MODEL,CHROMECAST+" Nest Hub"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROMECAST],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/(portaltv)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/(shield \w+ tv)/i],[MODEL,[VENDOR,NVIDIA],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mi(tv|box)-?\w+) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,/.+\/(\w+)/,"$1",strMapper,{LG:"lge"}],[MODEL,trim],[TYPE,SMARTTV]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[MODEL,[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[TYPE,SMARTTV]],[/(playstation \w+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield)( bui|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,CONSOLE]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,WEARABLE]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[MODEL,[VENDOR,OPPO],[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/(opwwe\d{3})/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,WEARABLE]],[/(moto 360)/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,WEARABLE]],[/(smartwatch 3)/i],[MODEL,[VENDOR,SONY],[TYPE,WEARABLE]],[/(g watch r)/i],[MODEL,[VENDOR,LG],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,XR]],[/(pico) (4|neo3(?: link|pro)?)/i],[VENDOR,MODEL,[TYPE,XR]],[/(quest( \d| pro)?s?).+vr/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,XR]],[/mobile vr; rv.+firefox/i],[[TYPE,XR]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/(homepod).+mac os/i],[MODEL,[VENDOR,APPLE],[TYPE,EMBEDDED]],[/windows iot/i],[[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[MODEL,[TYPE,strMapper,{mobile:"Mobile",xr:"VR","*":TABLET}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[NAME,VERSION],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION],[/ladybird\//i],[[NAME,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/(windows nt) (6\.[23]); arm/i],[[NAME,/N/,"R"],[VERSION,strMapper,windowsVersionMap]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[NAME,VERSION],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[VERSION,/(;|\))/g,"",strMapper,windowsVersionMap],[NAME,WINDOWS]],[/(windows ce)\/?([\d\.]*)/i],[NAME,VERSION],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[NAME,"macOS"],[VERSION,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[VERSION,[NAME,CHROMECAST+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[VERSION,[NAME,CHROMECAST+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST+" Linux"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROMECAST]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[VERSION,NAME],[/(ubuntu) ([\w\.]+) like android/i],[[NAME,/(.+)/,"$1 Touch"],VERSION],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[VERSION,[NAME,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[VERSION,strMapper,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION,[NAME,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,"Chrome OS"],VERSION],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[NAME,VERSION],[/(sunos) ?([\d\.]*)/i],[[NAME,"Solaris"],VERSION],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]},defaultProps=function(){var props={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return setProps.call(props.init,[[UA_BROWSER,[NAME,VERSION,MAJOR,TYPE]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[TYPE,MODEL,VENDOR]],[UA_ENGINE,[NAME,VERSION]],[UA_OS,[NAME,VERSION]]]),setProps.call(props.isIgnore,[[UA_BROWSER,[VERSION,MAJOR]],[UA_ENGINE,[VERSION]],[UA_OS,[VERSION]]]),setProps.call(props.isIgnoreRgx,[[UA_BROWSER,/ ?browser$/i],[UA_OS,/ ?os$/i]]),setProps.call(props.toString,[[UA_BROWSER,[NAME,VERSION]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[VENDOR,MODEL]],[UA_ENGINE,[NAME,VERSION]],[UA_OS,[NAME,VERSION]]]),props}(),createIData=function(item,itemType){var init_props=defaultProps.init[itemType],is_ignoreProps=defaultProps.isIgnore[itemType]||0,is_ignoreRgx=defaultProps.isIgnoreRgx[itemType]||0,toString_props=defaultProps.toString[itemType]||0;function IData(){setProps.call(this,init_props)}return IData.prototype.getItem=function(){return item},IData.prototype.withClientHints=function(){return NAVIGATOR_UADATA?NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(res){return item.setCH(new UACHData(res,!1)).parseCH().get()}):item.parseCH().get()},IData.prototype.withFeatureCheck=function(){return item.detectFeature().get()},itemType!=UA_RESULT&&(IData.prototype.is=function(strToCheck){var is=!1;for(var i2 in this)if(this.hasOwnProperty(i2)&&!has(is_ignoreProps,i2)&&lowerize(is_ignoreRgx?strip(is_ignoreRgx,this[i2]):this[i2])==lowerize(is_ignoreRgx?strip(is_ignoreRgx,strToCheck):strToCheck)){if(is=!0,strToCheck!=UNDEF_TYPE)break}else if(strToCheck==UNDEF_TYPE&&is){is=!is;break}return is},IData.prototype.toString=function(){var str=EMPTY;for(var i2 in toString_props)typeof this[toString_props[i2]]!==UNDEF_TYPE&&(str+=(str?" ":EMPTY)+this[toString_props[i2]]);return str||UNDEF_TYPE}),NAVIGATOR_UADATA||(IData.prototype.then=function(cb){var that=this,IDataResolve=function(){for(var prop in that)that.hasOwnProperty(prop)&&(this[prop]=that[prop])};IDataResolve.prototype={is:IData.prototype.is,toString:IData.prototype.toString};var resolveData=new IDataResolve;return cb(resolveData),resolveData}),new IData};function UACHData(uach,isHttpUACH){if(uach=uach||{},setProps.call(this,CH_ALL_VALUES),isHttpUACH)setProps.call(this,[[BRANDS,itemListToArray(uach[CH_HEADER])],[FULLVERLIST,itemListToArray(uach[CH_HEADER_FULL_VER_LIST])],[MOBILE,/\?1/.test(uach[CH_HEADER_MOBILE])],[MODEL,stripQuotes(uach[CH_HEADER_MODEL])],[PLATFORM,stripQuotes(uach[CH_HEADER_PLATFORM])],[PLATFORMVER,stripQuotes(uach[CH_HEADER_PLATFORM_VER])],[ARCHITECTURE,stripQuotes(uach[CH_HEADER_ARCH])],[FORMFACTORS,itemListToArray(uach[CH_HEADER_FORM_FACTORS])],[BITNESS,stripQuotes(uach[CH_HEADER_BITNESS])]]);else for(var prop in uach)this.hasOwnProperty(prop)&&typeof uach[prop]!==UNDEF_TYPE&&(this[prop]=uach[prop])}function UAItem(itemType,ua,rgxMap,uaCH){return this.get=function(prop){return prop?this.data.hasOwnProperty(prop)?this.data[prop]:void 0:this.data},this.set=function(prop,val){return this.data[prop]=val,this},this.setCH=function(ch){return this.uaCH=ch,this},this.detectFeature=function(){if(NAVIGATOR&&NAVIGATOR.userAgent==this.ua)switch(this.itemType){case UA_BROWSER:NAVIGATOR.brave&&typeof NAVIGATOR.brave.isBrave==FUNC_TYPE&&this.set(NAME,"Brave");break;case UA_DEVICE:!this.get(TYPE)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[MOBILE]&&this.set(TYPE,MOBILE),this.get(MODEL)=="Macintosh"&&NAVIGATOR&&typeof NAVIGATOR.standalone!==UNDEF_TYPE&&NAVIGATOR.maxTouchPoints&&NAVIGATOR.maxTouchPoints>2&&this.set(MODEL,"iPad").set(TYPE,TABLET);break;case UA_OS:!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]&&this.set(NAME,NAVIGATOR_UADATA[PLATFORM]);break;case UA_RESULT:var data=this.data,detect=function(itemType2){return data[itemType2].getItem().detectFeature().get()};this.set(UA_BROWSER,detect(UA_BROWSER)).set(UA_CPU,detect(UA_CPU)).set(UA_DEVICE,detect(UA_DEVICE)).set(UA_ENGINE,detect(UA_ENGINE)).set(UA_OS,detect(UA_OS))}return this},this.parseUA=function(){return this.itemType!=UA_RESULT&&rgxMapper.call(this.data,this.ua,this.rgxMap),this.itemType==UA_BROWSER&&this.set(MAJOR,majorize(this.get(VERSION))),this},this.parseCH=function(){var uaCH2=this.uaCH,rgxMap2=this.rgxMap;switch(this.itemType){case UA_BROWSER:case UA_ENGINE:var brands=uaCH2[FULLVERLIST]||uaCH2[BRANDS],prevName;if(brands)for(var i2 in brands){var brandName=brands[i2].brand||brands[i2],brandVersion=brands[i2].version;this.itemType==UA_BROWSER&&!/not.a.brand/i.test(brandName)&&(!prevName||/Chrom/.test(prevName)&&brandName!=CHROMIUM||prevName==EDGE&&/WebView2/.test(brandName))&&(brandName=strMapper(brandName,browserHintsMap),prevName=this.get(NAME),prevName&&!/Chrom/.test(prevName)&&/Chrom/.test(brandName)||this.set(NAME,brandName).set(VERSION,brandVersion).set(MAJOR,majorize(brandVersion)),prevName=brandName),this.itemType==UA_ENGINE&&brandName==CHROMIUM&&this.set(VERSION,brandVersion)}break;case UA_CPU:var archName=uaCH2[ARCHITECTURE];archName&&(archName&&uaCH2[BITNESS]=="64"&&(archName+="64"),rgxMapper.call(this.data,archName+";",rgxMap2));break;case UA_DEVICE:if(uaCH2[MOBILE]&&this.set(TYPE,MOBILE),uaCH2[MODEL]&&(this.set(MODEL,uaCH2[MODEL]),!this.get(TYPE)||!this.get(VENDOR))){var reParse={};rgxMapper.call(reParse,"droid 9; "+uaCH2[MODEL]+")",rgxMap2),!this.get(TYPE)&&reParse.type&&this.set(TYPE,reParse.type),!this.get(VENDOR)&&reParse.vendor&&this.set(VENDOR,reParse.vendor)}if(uaCH2[FORMFACTORS]){var ff;if(typeof uaCH2[FORMFACTORS]!="string")for(var idx=0;!ff&&idx<uaCH2[FORMFACTORS].length;)ff=strMapper(uaCH2[FORMFACTORS][idx++],formFactorsMap);else ff=strMapper(uaCH2[FORMFACTORS],formFactorsMap);this.set(TYPE,ff)}break;case UA_OS:var osName=uaCH2[PLATFORM];if(osName){var osVersion=uaCH2[PLATFORMVER];osName==WINDOWS&&(osVersion=parseInt(majorize(osVersion),10)>=13?"11":"10"),this.set(NAME,osName).set(VERSION,osVersion)}this.get(NAME)==WINDOWS&&uaCH2[MODEL]=="Xbox"&&this.set(NAME,"Xbox").set(VERSION,void 0);break;case UA_RESULT:var data=this.data,parse=function(itemType2){return data[itemType2].getItem().setCH(uaCH2).parseCH().get()};this.set(UA_BROWSER,parse(UA_BROWSER)).set(UA_CPU,parse(UA_CPU)).set(UA_DEVICE,parse(UA_DEVICE)).set(UA_ENGINE,parse(UA_ENGINE)).set(UA_OS,parse(UA_OS))}return this},setProps.call(this,[["itemType",itemType],["ua",ua],["uaCH",uaCH],["rgxMap",rgxMap],["data",createIData(this,itemType)]]),this}function UAParser(ua,extensions,headers){if(typeof ua===OBJ_TYPE?(isExtensions(ua,!0)?(typeof extensions===OBJ_TYPE&&(headers=extensions),extensions=ua):(headers=ua,extensions=void 0),ua=void 0):typeof ua===STR_TYPE&&!isExtensions(extensions,!0)&&(headers=extensions,extensions=void 0),headers&&typeof headers.append===FUNC_TYPE){var kv={};headers.forEach(function(v,k){kv[k]=v}),headers=kv}if(!(this instanceof UAParser))return new UAParser(ua,extensions,headers).getResult();var userAgent=typeof ua===STR_TYPE?ua:headers&&headers[USER_AGENT]?headers[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,httpUACH=new UACHData(headers,!0),regexMap=extensions?extend(defaultRegexes,extensions):defaultRegexes,createItemFunc=function(itemType){return itemType==UA_RESULT?function(){return new UAItem(itemType,userAgent,regexMap,httpUACH).set("ua",userAgent).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}:function(){return new UAItem(itemType,userAgent,regexMap[itemType],httpUACH).parseUA().get()}};return setProps.call(this,[["getBrowser",createItemFunc(UA_BROWSER)],["getCPU",createItemFunc(UA_CPU)],["getDevice",createItemFunc(UA_DEVICE)],["getEngine",createItemFunc(UA_ENGINE)],["getOS",createItemFunc(UA_OS)],["getResult",createItemFunc(UA_RESULT)],["getUA",function(){return userAgent}],["setUA",function(ua2){return isString(ua2)&&(userAgent=ua2.length>UA_MAX_LENGTH?trim(ua2,UA_MAX_LENGTH):ua2),this}]]).setUA(userAgent),this}UAParser.VERSION=LIBVERSION,UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR,TYPE]),UAParser.CPU=enumerize([ARCHITECTURE]),UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);class Recorder{constructor(window2,publicToken,recorderSettings){this.window=window2,this.publicToken=publicToken,this.recorderSettings=recorderSettings,recorderSettings.maskingLevel==null&&(recorderSettings.maskingLevel="input-and-textarea"),this.sessionRecorder=new SessionRecorder(recorderSettings),this.eventRecorder=new EventRecorder(window2,recorderSettings),post("public/captured-sessions",{publicToken},{withCredentials:!1}).then(response=>{const id=response.data;this.capturedSessionId=id,this.sessionRecorder.setCapturedSessionId(id),this.eventRecorder.setCapturedSessionId(id),this.schedulePing();const capturedUserMetadata=this.collectCapturedUserMetadata();post(`public/captured-sessions/${this.capturedSessionId}/captured-session/metadata`,capturedUserMetadata,{withCredentials:!1})}).catch(error=>{console.error(error),this.sessionRecorder.stop(),this.eventRecorder.stop()})}sessionRecorder;eventRecorder;capturedSessionId=null;pingIntervalMs=2e4;pingTimeout=null;schedulePing(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(this.ping,this.pingIntervalMs)}ping=async()=>{await put(`public/captured-sessions/${this.capturedSessionId}/ping`,{},{withCredentials:!1}),this.schedulePing()};start(){this.sessionRecorder.start(),this.eventRecorder.start()}stop(){this.sessionRecorder.stop(),this.eventRecorder.stop()}collectCapturedUserMetadata=()=>{const ua=new UAParser,browserName=ua.getBrowser().name,browserVersion=ua.getBrowser().version,osName=ua.getOS().name,osVersion=ua.getOS().version,deviceType=ua.getDevice().type??"desktop",browserLanguage=navigator.language,browserTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,referringUrl=document.referrer||void 0;let referringDomain;try{referringDomain=referringUrl?new URL(referringUrl).hostname:void 0}catch{}const viewportWidth=window.innerWidth||document.documentElement.clientWidth,viewportHeight=window.innerHeight||document.documentElement.clientHeight,url=new URL(window.location.href),utmSource=url.searchParams.get("utm_source")||url.searchParams.get("source")||url.searchParams.get("ref")||void 0,utmMedium=url.searchParams.get("utm_medium")||url.searchParams.get("medium")||void 0,utmCampaign=url.searchParams.get("utm_campaign")||url.searchParams.get("campaign")||void 0,utmContent=url.searchParams.get("utm_content")||url.searchParams.get("content")||void 0,utmTerm=url.searchParams.get("utm_term")||url.searchParams.get("term")||void 0;return{browserName,browserVersion,osName,osVersion,deviceType,browserLanguage,browserTimeZone,referringUrl,referringDomain,viewportWidth,viewportHeight,utmSource,utmMedium,utmCampaign,utmContent,utmTerm}}}var MaskingLevel=(MaskingLevel2=>(MaskingLevel2.None="none",MaskingLevel2.All="all",MaskingLevel2.InputAndTextArea="input-and-textarea",MaskingLevel2.InputPasswordOrEmailAndTextArea="input-password-or-email-and-textarea",MaskingLevel2))(MaskingLevel||{});return exports.MaskingLevel=MaskingLevel,exports.Recorder=Recorder,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});