@checksum-ai/runtime 2.0.2 → 2.0.3-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +1 -1
- package/checksumlib.js +2 -2
- package/index.js +70 -70
- package/package.json +1 -1
- package/vtg-pw-bridge-runner.js +75 -75
package/checksumlib.js
CHANGED
|
@@ -73,7 +73,7 @@ https://www.w3ctech.com/topic/2226`));let u=t(...a);return u.postcssPlugin=e,u.p
|
|
|
73
73
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
74
74
|
https://www.w3ctech.com/topic/2226`));let u=t(...a);return u.postcssPlugin=e,u.postcssVersion=new od().version,u}l(i,"creator");let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,u,f){return Le([i(f)]).process(a,u)},i},"plugin2");Le.stringify=C_;Le.parse=R_;Le.fromJSON=M_;Le.list=O_;Le.comment=n=>new eS(n);Le.atRule=n=>new tS(n);Le.decl=n=>new Jv(n);Le.rule=n=>new rS(n);Le.root=n=>new nS(n);Le.document=n=>new Qv(n);Le.CssSyntaxError=w_;Le.Declaration=Jv;Le.Container=x_;Le.Processor=od;Le.Document=Qv;Le.Comment=eS;Le.Warning=T_;Le.AtRule=tS;Le.Result=I_;Le.Input=A_;Le.Rule=rS;Le.Root=nS;Le.Node=L_;E_.registerPostcss(Le);var N_=Le;Le.default=Le;var Ke=GL(N_);Ke.stringify;Ke.fromJSON;Ke.plugin;Ke.parse;Ke.list;Ke.document;Ke.comment;Ke.atRule;Ke.rule;Ke.decl;Ke.root;Ke.CssSyntaxError;Ke.Declaration;Ke.Container;Ke.Processor;Ke.Document;Ke.Comment;Ke.Warning;Ke.AtRule;Ke.Result;Ke.Input;Ke.Rule;Ke.Root;Ke.Node;var we=(n=>(n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n))(we||{});function __(n){let e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return n.replace(i,"").split(t).forEach(function(o){if(o){let a=o.split(r);a.length>1&&(e[ph(a[0].trim())]=a[1].trim())}}),e}l(__,"parseCSSText");function cb(n){let e=[];for(let t in n){let r=n[t];if(typeof r!="string")continue;let i=F_(t);e.push(`${i}: ${r};`)}return e.join(" ")}l(cb,"toCSSText");var D_=/-([a-z])/g,k_=/^--[a-zA-Z0-9-]+$/,ph=l(n=>k_.test(n)?n:n.replace(D_,(e,t)=>t?t.toUpperCase():""),"camelize"),P_=/\B([A-Z])/g,F_=l(n=>n.replace(P_,"-$1").toLowerCase(),"hyphenate"),sr=class n{static{l(this,"BaseRRNode")}constructor(...e){J(this,"parentElement",null),J(this,"parentNode",null),J(this,"ownerDocument"),J(this,"firstChild",null),J(this,"lastChild",null),J(this,"previousSibling",null),J(this,"nextSibling",null),J(this,"ELEMENT_NODE",1),J(this,"TEXT_NODE",3),J(this,"nodeType"),J(this,"nodeName"),J(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof n){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},mh=class n extends sr{static{l(this,"BaseRRDocument")}constructor(...e){super(e),J(this,"nodeType",9),J(this,"nodeName","#document"),J(this,"compatMode","CSS1Compat"),J(this,"RRNodeType",we.Document),J(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===we.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===we.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===we.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){let t=e.RRNodeType;if((t===we.Element||t===we.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===we.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let r=ad(this,e);return r.parentElement=null,r}insertBefore(e,t){let r=e.RRNodeType;if((r===we.Element||r===we.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===we.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let i=iS(this,e,t);return i.parentElement=null,i}removeChild(e){return sS(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){let r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new n}createDocumentType(e,t,r){let i=new ul(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=new Ti(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){let t=new fl(e);return t.ownerDocument=this,t}createComment(e){let t=new hl(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new dl(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}},ul=class extends sr{static{l(this,"BaseRRDocumentType")}constructor(e,t,r){super(),J(this,"nodeType",10),J(this,"RRNodeType",we.DocumentType),J(this,"name"),J(this,"publicId"),J(this,"systemId"),J(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}},Ti=class extends sr{static{l(this,"BaseRRElement")}constructor(e){super(),J(this,"nodeType",1),J(this,"RRNodeType",we.Element),J(this,"tagName"),J(this,"attributes",{}),J(this,"shadowRoot",null),J(this,"scrollLeft"),J(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new bh(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let e=this.attributes.style?__(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(t.test(r))return;let a=ph(r);i?e[a]=i:delete e[a],o==="important"&&(e[a]+=" !important"),this.attributes.style=cb(e)},e.removeProperty=r=>{if(t.test(r))return"";let i=ph(r),o=e[i]||"";return delete e[i],this.attributes.style=cb(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return ad(this,e)}insertBefore(e,t){return iS(this,e,t)}removeChild(e){return sS(this,e)}attachShadow(e){let t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(let t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}},gh=class extends Ti{static{l(this,"BaseRRMediaElement")}constructor(){super(...arguments),J(this,"currentTime"),J(this,"volume"),J(this,"paused"),J(this,"muted"),J(this,"playbackRate"),J(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},yh=class extends Ti{static{l(this,"BaseRRDialogElement")}constructor(){super(...arguments),J(this,"tagName","DIALOG"),J(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}},fl=class extends sr{static{l(this,"BaseRRText")}constructor(e){super(),J(this,"nodeType",3),J(this,"nodeName","#text"),J(this,"RRNodeType",we.Text),J(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},hl=class extends sr{static{l(this,"BaseRRComment")}constructor(e){super(),J(this,"nodeType",8),J(this,"nodeName","#comment"),J(this,"RRNodeType",we.Comment),J(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},dl=class extends sr{static{l(this,"BaseRRCDATASection")}constructor(e){super(),J(this,"nodeName","#cdata-section"),J(this,"nodeType",4),J(this,"RRNodeType",we.CDATA),J(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},bh=class{static{l(this,"ClassList")}constructor(e,t){if(J(this,"onChange"),J(this,"classes",[]),J(this,"add",(...r)=>{for(let i of r){let o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),J(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){let r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}};function ad(n,e){return e.parentNode&&e.parentNode.removeChild(e),n.lastChild?(n.lastChild.nextSibling=e,e.previousSibling=n.lastChild):(n.firstChild=e,e.previousSibling=null),n.lastChild=e,e.nextSibling=null,e.parentNode=n,e.parentElement=n,e.ownerDocument=n.ownerDocument,e}l(ad,"appendChild");function iS(n,e,t){if(!t)return ad(n,e);if(t.parentNode!==n)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:n.firstChild=e,e.parentElement=n,e.parentNode=n,e.ownerDocument=n.ownerDocument),e}l(iS,"insertBefore");function sS(n,e){if(e.parentNode!==n)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:n.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:n.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}l(sS,"removeChild");var Wt=(n=>(n[n.PLACEHOLDER=0]="PLACEHOLDER",n[n.ELEMENT_NODE=1]="ELEMENT_NODE",n[n.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",n[n.TEXT_NODE=3]="TEXT_NODE",n[n.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",n[n.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",n[n.ENTITY_NODE=6]="ENTITY_NODE",n[n.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",n[n.COMMENT_NODE=8]="COMMENT_NODE",n[n.DOCUMENT_NODE=9]="DOCUMENT_NODE",n[n.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",n[n.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",n))(Wt||{}),vh={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},$_={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"},br=null;function pl(n,e,t,r=e.mirror||e.ownerDocument.mirror){n=H_(n,e,t,r),oS(n,e,t,r),B_(n,e,t)}l(pl,"diff");function H_(n,e,t,r){var i;if(t.afterAppend&&!br&&(br=new WeakSet,setTimeout(()=>{br=null},0)),!ld(n,e)){let o=ml(e,t.mirror,r);(i=n.parentNode)==null||i.replaceChild(o,n),n=o}switch(e.RRNodeType){case we.Document:{if(!di(n,e,t.mirror,r)){let o=r.getMeta(e);o&&(t.mirror.removeNodeFromMap(n),n.close(),n.open(),t.mirror.add(n,o),br?.add(n))}break}case we.Element:{let o=n,a=e;switch(a.tagName){case"IFRAME":{let u=n.contentDocument;if(!u)break;pl(u,e.contentDocument,t,r);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),oS(o.shadowRoot,a.shadowRoot,t,r)),W_(o,a,r);break}}return n}l(H_,"diffBeforeUpdatingChildren");function B_(n,e,t){var r;switch(e.RRNodeType){case we.Document:{let i=e.scrollData;i&&t.applyScroll(i,!0);break}case we.Element:{let i=n,o=e;switch(o.scrollData&&t.applyScroll(o.scrollData,!0),o.inputData&&t.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{let a=n,u=o;u.paused!==void 0&&(u.paused?a.pause():a.play()),u.muted!==void 0&&(a.muted=u.muted),u.volume!==void 0&&(a.volume=u.volume),u.currentTime!==void 0&&(a.currentTime=u.currentTime),u.playbackRate!==void 0&&(a.playbackRate=u.playbackRate),u.loop!==void 0&&(a.loop=u.loop);break}case"CANVAS":{let a=e;if(a.rr_dataURL!==null){let u=document.createElement("img");u.onload=()=>{let f=i.getContext("2d");f&&f.drawImage(u,0,0,u.width,u.height)},u.src=a.rr_dataURL}a.canvasMutations.forEach(u=>t.applyCanvas(u.event,u.mutation,n));break}case"STYLE":{let a=i.sheet;a&&e.rules.forEach(u=>t.applyStyleSheetMutation(u,a));break}case"DIALOG":{let a=i,u=o,f=a.open,d=a.matches("dialog:modal"),p=u.open,g=u.isModal,y=d!==g,S=f!==p;if((y||f&&S)&&a.close(),p&&(S||y))try{g?a.showModal():a.show()}catch(w){console.warn(w)}break}}break}case we.Text:case we.Comment:case we.CDATA:{n.textContent!==e.data&&(n.textContent=e.data);break}}br?.has(n)&&(br.delete(n),(r=t.afterAppend)==null||r.call(t,n,t.mirror.getId(n)))}l(B_,"diffAfterUpdatingChildren");function W_(n,e,t){let r=n.attributes,i=e.attributes;for(let o in i){let a=i[o],u=t.getMeta(e);if(u?.isSVG&&vh[o])n.setAttributeNS(vh[o],o,a);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){let f=document.createElement("img");f.src=a,f.onload=()=>{let d=n.getContext("2d");d&&d.drawImage(f,0,0,f.width,f.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;try{n.setAttribute(o,a)}catch(f){console.warn(f)}}}for(let{name:o}of Array.from(r))o in i||n.removeAttribute(o);e.scrollLeft&&(n.scrollLeft=e.scrollLeft),e.scrollTop&&(n.scrollTop=e.scrollTop)}l(W_,"diffProps");function oS(n,e,t,r){let i=Array.from(n.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let a=0,u=i.length-1,f=0,d=o.length-1,p=i[a],g=i[u],y=o[f],S=o[d],w,E;for(;a<=u&&f<=d;)if(p===void 0)p=i[++a];else if(g===void 0)g=i[--u];else if(di(p,y,t.mirror,r))p=i[++a],y=o[++f];else if(di(g,S,t.mirror,r))g=i[--u],S=o[--d];else if(di(p,S,t.mirror,r)){try{n.insertBefore(p,g.nextSibling)}catch(R){console.warn(R)}p=i[++a],S=o[--d]}else if(di(g,y,t.mirror,r)){try{n.insertBefore(g,p)}catch(R){console.warn(R)}g=i[--u],y=o[++f]}else{if(!w){w={};for(let T=a;T<=u;T++){let N=i[T];N&&t.mirror.hasNode(N)&&(w[t.mirror.getId(N)]=T)}}E=w[r.getId(y)];let R=i[E];if(E!==void 0&&R&&di(R,y,t.mirror,r)){try{n.insertBefore(R,p)}catch(T){console.warn(T)}i[E]=void 0}else{let T=ml(y,t.mirror,r);n.nodeName==="#document"&&p&&(T.nodeType===T.DOCUMENT_TYPE_NODE&&p.nodeType===p.DOCUMENT_TYPE_NODE||T.nodeType===T.ELEMENT_NODE&&p.nodeType===p.ELEMENT_NODE)&&(n.removeChild(p),t.mirror.removeNodeFromMap(p),p=i[++a]);try{n.insertBefore(T,p||null)}catch(N){console.warn(N)}}y=o[++f]}if(a>u){let R=o[d+1],T=null;for(R&&(T=t.mirror.getNode(r.getId(R)));f<=d;++f){let N=ml(o[f],t.mirror,r);try{n.insertBefore(N,T)}catch(U){console.warn(U)}}}else if(f>d)for(;a<=u;a++){let R=i[a];if(!(!R||R.parentNode!==n))try{n.removeChild(R),t.mirror.removeNodeFromMap(R)}catch(T){console.warn(T)}}let v=n.firstChild,M=e.firstChild;for(;v!==null&&M!==null;)pl(v,M,t,r),v=v.nextSibling,M=M.nextSibling}l(oS,"diffChildren");function ml(n,e,t){let r=t.getId(n),i=t.getMeta(n),o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&ld(o,n))return o;switch(n.RRNodeType){case we.Document:o=new Document;break;case we.DocumentType:o=document.implementation.createDocumentType(n.name,n.publicId,n.systemId);break;case we.Element:{let a=n.tagName.toLowerCase();a=$_[a]||a,i&&"isSVG"in i&&i?.isSVG?o=document.createElementNS(vh.svg,a):o=document.createElement(n.tagName);break}case we.Text:o=document.createTextNode(n.data);break;case we.Comment:o=document.createComment(n.data);break;case we.CDATA:o=document.createCDATASection(n.data);break}i&&e.add(o,{...i});try{br?.add(o)}catch{}return o}l(ml,"createOrGetNode");function ld(n,e){return n.nodeType!==e.nodeType?!1:n.nodeType!==n.ELEMENT_NODE||n.tagName.toUpperCase()===e.tagName}l(ld,"sameNodeType");function di(n,e,t,r){let i=t.getId(n),o=r.getId(e);return i===-1||i!==o?!1:ld(n,e)}l(di,"nodeMatching");var Ii=class n extends mh{static{l(this,"RRDocument")}constructor(e){super(),J(this,"UNSERIALIZED_STARTING_ID",-2),J(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),J(this,"mirror",Y_()),J(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new n}createDocumentType(e,t,r){let i=new V_(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=e.toUpperCase(),r;switch(t){case"AUDIO":case"VIDEO":r=new Sh(t);break;case"IFRAME":r=new Ch(t,this.mirror);break;case"CANVAS":r=new Eh(t);break;case"STYLE":r=new xh(t);break;case"DIALOG":r=new wh(t);break;default:r=new Ai(t);break}return r.ownerDocument=this,r}createComment(e){let t=new G_(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new z_(e);return t.ownerDocument=this,t}createTextNode(e){let t=new U_(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},V_=ul,Ai=class extends Ti{static{l(this,"RRElement")}constructor(){super(...arguments),J(this,"inputData",null),J(this,"scrollData",null)}},Sh=class extends gh{static{l(this,"RRMediaElement")}},wh=class extends yh{static{l(this,"RRDialogElement")}},Eh=class extends Ai{static{l(this,"RRCanvasElement")}constructor(){super(...arguments),J(this,"rr_dataURL",null),J(this,"canvasMutations",[])}getContext(){return null}},xh=class extends Ai{static{l(this,"RRStyleElement")}constructor(){super(...arguments),J(this,"rules",[])}},Ch=class extends Ai{static{l(this,"RRIFrameElement")}constructor(e,t){super(e),J(this,"contentDocument",new Ii),this.contentDocument.mirror=t}},U_=fl,G_=hl,z_=dl;function j_(n){return n instanceof HTMLFormElement?"FORM":n.tagName.toUpperCase()}l(j_,"getValidTagName");function aS(n,e,t,r){let i;switch(n.nodeType){case Wt.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=n.compatMode);break;case Wt.DOCUMENT_TYPE_NODE:{let a=n;i=e.createDocumentType(a.name,a.publicId,a.systemId);break}case Wt.ELEMENT_NODE:{let a=n,u=j_(a);i=e.createElement(u);let f=i;for(let{name:d,value:p}of Array.from(a.attributes))f.attributes[d]=p;a.scrollLeft&&(f.scrollLeft=a.scrollLeft),a.scrollTop&&(f.scrollTop=a.scrollTop);break}case Wt.TEXT_NODE:i=e.createTextNode(n.textContent||"");break;case Wt.CDATA_SECTION_NODE:i=e.createCDATASection(n.data);break;case Wt.COMMENT_NODE:i=e.createComment(n.textContent||"");break;case Wt.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(n);return e instanceof Ii&&(o||(o=lS(i,e.unserializedId),t.add(n,o)),e.mirror.add(i,{...o})),i}l(aS,"buildFromNode");function q_(n,e=UL(),t=new Ii){function r(i,o){let a=aS(i,t,e,o);if(a!==null)if(o?.nodeName!=="IFRAME"&&i.nodeType!==Wt.DOCUMENT_FRAGMENT_NODE&&(o?.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){let u=i.contentDocument;u&&r(u,a)}else(i.nodeType===Wt.DOCUMENT_NODE||i.nodeType===Wt.ELEMENT_NODE||i.nodeType===Wt.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===Wt.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(u=>r(u,a)))}return l(r,"walk2"),r(n,null),t}l(q_,"buildFromDom");function Y_(){return new Mh}l(Y_,"createMirror");var Mh=class{static{l(this,"Mirror22")}constructor(){J(this,"idNodeMap",new Map),J(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function lS(n,e){switch(n.RRNodeType){case we.Document:return{id:e,type:n.RRNodeType,childNodes:[]};case we.DocumentType:{let t=n;return{id:e,type:n.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case we.Element:return{id:e,type:n.RRNodeType,tagName:n.tagName.toLowerCase(),attributes:{},childNodes:[]};case we.Text:return{id:e,type:n.RRNodeType,textContent:n.textContent||""};case we.Comment:return{id:e,type:n.RRNodeType,textContent:n.textContent||""};case we.CDATA:return{id:e,type:n.RRNodeType,textContent:""}}}l(lS,"getDefaultSN");var ub={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Va={},K_=l(()=>!!globalThis.Zone,"isAngularZonePresent");function cd(n){if(Va[n])return Va[n];let e=globalThis[n],t=e.prototype,r=n in ub?ub[n]:void 0,i=!!(r&&r.every(u=>{var f,d;return!!((d=(f=Object.getOwnPropertyDescriptor(t,u))==null?void 0:f.get)!=null&&d.toString().includes("[native code]"))})),o=n in fb?fb[n]:void 0,a=!!(o&&o.every(u=>{var f;return typeof t[u]=="function"&&((f=t[u])==null?void 0:f.toString().includes("[native code]"))}));if(i&&a&&!K_())return Va[n]=e.prototype,e.prototype;try{let u=document.createElement("iframe");document.body.appendChild(u);let f=u.contentWindow;if(!f)return e.prototype;let d=f[n].prototype;return document.body.removeChild(u),d?Va[n]=d:t}catch{return t}}l(cd,"getUntaintedPrototype");var Lf={};function dn(n,e,t){var r;let i=`${n}.${String(t)}`;if(Lf[i])return Lf[i].call(e);let o=cd(n),a=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return a?(Lf[i]=a,a.call(e)):e[t]}l(dn,"getUntaintedAccessor");var Nf={};function cS(n,e,t){let r=`${n}.${String(t)}`;if(Nf[r])return Nf[r].bind(e);let o=cd(n)[t];return typeof o!="function"?e[t]:(Nf[r]=o,o.bind(e))}l(cS,"getUntaintedMethod");function X_(n){return dn("Node",n,"childNodes")}l(X_,"childNodes");function Z_(n){return dn("Node",n,"parentNode")}l(Z_,"parentNode");function J_(n){return dn("Node",n,"parentElement")}l(J_,"parentElement");function Q_(n){return dn("Node",n,"textContent")}l(Q_,"textContent");function eD(n,e){return cS("Node",n,"contains")(e)}l(eD,"contains");function tD(n){return cS("Node",n,"getRootNode")()}l(tD,"getRootNode");function rD(n){return!n||!("host"in n)?null:dn("ShadowRoot",n,"host")}l(rD,"host");function nD(n){return n.styleSheets}l(nD,"styleSheets");function iD(n){return!n||!("shadowRoot"in n)?null:dn("Element",n,"shadowRoot")}l(iD,"shadowRoot");function sD(n,e){return dn("Element",n,"querySelector")(e)}l(sD,"querySelector");function oD(n,e){return dn("Element",n,"querySelectorAll")(e)}l(oD,"querySelectorAll");function uS(){return cd("MutationObserver").constructor}l(uS,"mutationObserverCtor");function $n(n,e,t){try{if(!(e in n))return()=>{};let r=n[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),n[e]=i,()=>{n[e]=r}}catch{return()=>{}}}l($n,"patch");var be={childNodes:X_,parentNode:Z_,parentElement:J_,textContent:Q_,contains:eD,getRootNode:tD,host:rD,styleSheets:nD,shadowRoot:iD,querySelector:sD,querySelectorAll:oD,mutationObserver:uS,patch:$n};function It(n,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(n,e,r),()=>t.removeEventListener(n,e,r)}l(It,"on");var pi=`Please stop import mirror directly. Instead of that,\r
|
|
75
75
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
76
|
-
or you can use record.mirror to access the mirror instance during recording.`,hb={map:{},getId(){return console.error(pi),-1},getNode(){return console.error(pi),null},removeNodeFromMap(){console.error(pi)},has(){return console.error(pi),!1},reset(){console.error(pi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(hb=new Proxy(hb,{get(n,e,t){return e==="map"&&console.error(pi),Reflect.get(n,e,t)}}));function Us(n,e,t={}){let r=null,i=0;return function(...o){let a=Date.now();!i&&t.leading===!1&&(i=a);let u=e-(a-i),f=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),i=a,n.apply(f,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,n.apply(f,o)},u))}}l(Us,"throttle");function Dl(n,e,t,r,i=window){let o=i.Object.getOwnPropertyDescriptor(n,e);return i.Object.defineProperty(n,e,r?t:{set(a){setTimeout(()=>{t.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Dl(n,e,o||{},!0)}l(Dl,"hookSetter");var gl=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(gl=l(()=>new Date().getTime(),"nowTimestamp"));function fS(n){var e,t,r,i;let o=n.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=be.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o?.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=be.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}l(fS,"getWindowScroll");function hS(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}l(hS,"getWindowHeight");function dS(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}l(dS,"getWindowWidth");function pS(n){return n?n.nodeType===n.ELEMENT_NODE?n:be.parentElement(n):null}l(pS,"closestElementOfNode");function At(n,e,t,r){if(!n)return!1;let i=pS(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(tl(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}l(At,"isBlocked");function aD(n,e){return e.getId(n)!==-1}l(aD,"isSerialized");function _f(n,e,t){return n.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(n)===Ds}l(_f,"isIgnored");function mS(n,e){if(As(n))return!1;let t=e.getId(n);if(!e.has(t))return!0;let r=be.parentNode(n);return r&&r.nodeType===n.DOCUMENT_NODE?!1:r?mS(r,e):!0}l(mS,"isAncestorRemoved");function Th(n){return!!n.changedTouches}l(Th,"legacy_isTouchEvent");function gS(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach)}l(gS,"polyfill$1");function lD(n){let e={},t=l((i,o)=>{let a={value:i,parent:o,children:[]};return e[i.node.id]=a,a},"putIntoMap"),r=[];for(let i of n){let{nextId:o,parentId:a}=i;if(o&&o in e){let u=e[o];if(u.parent){let f=u.parent.children.indexOf(u);u.parent.children.splice(f,0,t(i,u.parent))}else{let f=r.indexOf(u);r.splice(f,0,t(i,null))}continue}if(a in e){let u=e[a];u.children.push(t(i,u));continue}r.push(t(i,null))}return r}l(lD,"queueToResolveTrees");function yS(n,e){e(n.value);for(let t=n.children.length-1;t>=0;t--)yS(n.children[t],e)}l(yS,"iterateResolveTree");function Ls(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}l(Ls,"isSerializedIframe");function bS(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}l(bS,"isSerializedStylesheet");function vS(n,e){var t,r;let i=(r=(t=n.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=i.getBoundingClientRect(),a=vS(i,e),u=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}}l(vS,"getBaseDimension");function Dn(n){return n?n instanceof sr&&"shadowRoot"in n?!!n.shadowRoot:!!be.shadowRoot(n):!1}l(Dn,"hasShadowRoot");function Ts(n,e){let t=n[e[0]];return e.length===1?t:Ts(t.cssRules[e[1]].cssRules,e.slice(2))}l(Ts,"getNestedRule");function db(n){let e=[...n],t=e.pop();return{positions:e,index:t}}l(db,"getPositionsAndIndex");function cD(n){let e=new Set,t=[];for(let r=n.length;r--;){let i=n[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}l(cD,"uniqueTextMutations");var yl=class{static{l(this,"StyleSheetMirror")}constructor(){P(this,"id",1),P(this,"styleIDMap",new WeakMap),P(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function SS(n){var e;let t=null;return"getRootNode"in n&&((e=be.getRootNode(n))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&be.host(be.getRootNode(n))&&(t=be.host(be.getRootNode(n))),t}l(SS,"getShadowHost");function uD(n){let e=n,t;for(;t=SS(e);)e=t;return e}l(uD,"getRootShadowHost");function fD(n){let e=n.ownerDocument;if(!e)return!1;let t=uD(n);return be.contains(e,t)}l(fD,"shadowHostInDom");function wS(n){let e=n.ownerDocument;return e?be.contains(e,n)||fD(n):!1}l(wS,"inDom");var j=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(j||{}),V=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(V||{}),ne=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(ne||{}),Fr=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(Fr||{}),Wr=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(Wr||{}),cn=(n=>(n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n))(cn||{}),Se=(n=>(n.Start="start",n.Pause="pause",n.Resume="resume",n.Resize="resize",n.Finish="finish",n.FullsnapshotRebuilded="fullsnapshot-rebuilded",n.LoadStylesheetStart="load-stylesheet-start",n.LoadStylesheetEnd="load-stylesheet-end",n.SkipStart="skip-start",n.SkipEnd="skip-end",n.MouseInteraction="mouse-interaction",n.EventCast="event-cast",n.CustomEvent="custom-event",n.Flush="flush",n.StateChange="state-change",n.PlayBack="play-back",n.Destroy="destroy",n))(Se||{}),$r=(n=>(n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n))($r||{});function pb(n){return"__ln"in n}l(pb,"isNodeInLinkedList");var Ih=class{static{l(this,"DoubleLinkedList")}constructor(){P(this,"length",0),P(this,"head",null),P(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pb(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&pb(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},mb=l((n,e)=>`${n}@${e}`,"moveKey"),Ah=class{static{l(this,"MutationBuffer")}constructor(){P(this,"frozen",!1),P(this,"locked",!1),P(this,"texts",[]),P(this,"attributes",[]),P(this,"attributeMap",new WeakMap),P(this,"removes",[]),P(this,"mapRemoves",[]),P(this,"movedMap",{}),P(this,"addedSet",new Set),P(this,"movedSet",new Set),P(this,"droppedSet",new Set),P(this,"removesSubTreeCache",new Set),P(this,"mutationCb"),P(this,"blockClass"),P(this,"blockSelector"),P(this,"maskTextClass"),P(this,"maskTextSelector"),P(this,"inlineStylesheet"),P(this,"maskInputOptions"),P(this,"maskTextFn"),P(this,"maskInputFn"),P(this,"keepIframeSrcFn"),P(this,"recordCanvas"),P(this,"inlineImages"),P(this,"slimDOMOptions"),P(this,"dataURLOptions"),P(this,"doc"),P(this,"mirror"),P(this,"iframeManager"),P(this,"stylesheetManager"),P(this,"shadowDomManager"),P(this,"canvasManager"),P(this,"processedNodeManager"),P(this,"unattachedDoc"),P(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),P(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Ih,i=l(f=>{let d=f,p=Ds;for(;p===Ds;)d=d&&d.nextSibling,p=d&&this.mirror.getId(d);return p},"getNextId"),o=l(f=>{let d=be.parentNode(f);if(!d||!wS(f))return;let p=!1;if(f.nodeType===Node.TEXT_NODE){let w=d.tagName;if(w==="TEXTAREA")return;w==="STYLE"&&this.addedSet.has(d)&&(p=!0)}let g=As(d)?this.mirror.getId(SS(f)):this.mirror.getId(d),y=i(f);if(g===-1||y===-1)return r.addNode(f);let S=yi(f,{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:l(w=>{Ls(w,this.mirror)&&this.iframeManager.addIframe(w),bS(w,this.mirror)&&this.stylesheetManager.trackLinkElement(w),Dn(f)&&this.shadowDomManager.addShadowRoot(be.shadowRoot(f),this.doc)},"onSerialize"),onIframeLoad:l((w,E)=>{this.iframeManager.attachIframe(w,E),this.shadowDomManager.observeAttachShadow(w)},"onIframeLoad"),onStylesheetLoad:l((w,E)=>{this.stylesheetManager.attachLinkElement(w,E)},"onStylesheetLoad"),cssCaptured:p});S&&(e.push({parentId:g,nextId:y,node:S}),t.add(S.id))},"pushAdd");for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet)gb(this.removesSubTreeCache,f,this.mirror)&&!this.movedSet.has(be.parentNode(f))||o(f);for(let f of this.addedSet)!yb(this.droppedSet,f)&&!gb(this.removesSubTreeCache,f,this.mirror)||yb(this.movedSet,f)?o(f):this.droppedSet.add(f);let a=null;for(;r.length;){let f=null;if(a){let d=this.mirror.getId(be.parentNode(a.value)),p=i(a.value);d!==-1&&p!==-1&&(f=a)}if(!f){let d=r.tail;for(;d;){let p=d;if(d=d.previous,p){let g=this.mirror.getId(be.parentNode(p.value));if(i(p.value)===-1)continue;if(g!==-1){f=p;break}else{let S=p.value,w=be.parentNode(S);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let E=be.host(w);if(this.mirror.getId(E)!==-1){f=p;break}}}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}a=f.previous,r.removeNode(f.value),o(f.value)}let u={texts:this.texts.map(f=>{let d=f.node,p=be.parentNode(d);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(d),value:f.value}}).filter(f=>!t.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:d}=f;if(typeof d.style=="string"){let p=JSON.stringify(f.styleDiff),g=JSON.stringify(f._unchangedStyles);p.length<d.style.length&&(p+g).split("var(").length===d.style.split("var(").length&&(d.style=f.styleDiff)}return{id:this.mirror.getId(f.node),attributes:d}}).filter(f=>!t.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),P(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(be.childNodes(e),i=>be.textContent(i)||"").join("");t.attributes.value=Ja({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Qa(e),value:r,maskInputFn:this.maskInputFn})}),P(this,"processMutation",e=>{if(!_f(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=be.textContent(e.target);!At(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Hb(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,pS(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let a=Qa(t);i=Ja({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(At(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!$b(t.tagName,r))if(o.attributes[r]=Fb(this.doc,fn(t.tagName),fn(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(let u of Array.from(t.style)){let f=t.style.getPropertyValue(u),d=t.style.getPropertyPriority(u);f!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?d===""?o.styleDiff[u]=f:o.styleDiff[u]=[f,d]:o._unchangedStyles[u]=[f,d]}for(let u of Array.from(a.style))t.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(At(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=As(e.target)?this.mirror.getId(be.host(e.target)):this.mirror.getId(e.target);At(e.target,this.blockClass,this.blockSelector,!1)||_f(t,this.mirror,this.slimDOMOptions)||!aD(t,this.mirror)||(this.addedSet.has(t)?(Rh(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||mS(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[mb(r,i)]?Rh(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:As(e.target)&&Rs(e.target)?!0:void 0}),hD(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),P(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(_f(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[mb(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);At(e,this.blockClass,this.blockSelector,!1)||(be.childNodes(e).forEach(r=>this.genAdds(r)),Dn(e)&&be.childNodes(be.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}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 Rh(n,e){n.delete(e),be.childNodes(e).forEach(t=>Rh(n,t))}l(Rh,"deepDelete");function hD(n,e){let t=[n];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),be.childNodes(r).forEach(i=>t.push(i)))}}l(hD,"processRemoves");function gb(n,e,t){return n.size===0?!1:dD(n,e)}l(gb,"isParentRemoved");function dD(n,e,t){let r=be.parentNode(e);return r?n.has(r):!1}l(dD,"_isParentRemoved");function yb(n,e){return n.size===0?!1:ES(n,e)}l(yb,"isAncestorInSet");function ES(n,e){let t=be.parentNode(e);return t?n.has(t)?!0:ES(n,t):!1}l(ES,"_isAncestorInSet");var Ns;function pD(n){Ns=n}l(pD,"registerErrorHandler");function mD(){Ns=void 0}l(mD,"unregisterErrorHandler");var Ee=l(n=>Ns?l((...t)=>{try{return n(...t)}catch(r){if(Ns&&Ns(r)===!0)return;throw r}},"rrwebWrapped"):n,"callbackWrapper"),kn=[];function Ys(n){try{if("composedPath"in n){let e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}l(Ys,"getEventTarget");function xS(n,e){let t=new Ah;kn.push(t),t.init(n);let r=new(uS())(Ee(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}l(xS,"initMutationObserver");function gD({mousemoveCb:n,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],u,f=Us(Ee(g=>{let y=Date.now()-u;n(a.map(S=>(S.timeOffset-=y,S)),g),a=[],u=null}),o),d=Ee(Us(Ee(g=>{let y=Ys(g),{clientX:S,clientY:w}=Th(g)?g.changedTouches[0]:g;u||(u=gl()),a.push({x:S,y:w,id:r.getId(y),timeOffset:gl()-u}),f(typeof DragEvent<"u"&&g instanceof DragEvent?V.Drag:g instanceof MouseEvent?V.MouseMove:V.TouchMove)}),i,{trailing:!1})),p=[It("mousemove",d,t),It("touchmove",d,t),It("drag",d,t)];return Ee(()=>{p.forEach(g=>g())})}l(gD,"initMoveObserver");function yD({mouseInteractionCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[],f=null,d=l(p=>g=>{let y=Ys(g);if(At(y,r,i,!0))return;let S=null,w=p;if("pointerType"in g){switch(g.pointerType){case"mouse":S=Fr.Mouse;break;case"touch":S=Fr.Touch;break;case"pen":S=Fr.Pen;break}S===Fr.Touch?ne[p]===ne.MouseDown?w="TouchStart":ne[p]===ne.MouseUp&&(w="TouchEnd"):Fr.Pen}else Th(g)&&(S=Fr.Touch);S!==null?(f=S,(w.startsWith("Touch")&&S===Fr.Touch||w.startsWith("Mouse")&&S===Fr.Mouse)&&(S=null)):ne[p]===ne.Click&&(S=f,f=null);let E=Th(g)?g.changedTouches[0]:g;if(!E)return;let v=t.getId(y),{clientX:M,clientY:R}=E;Ee(n)({type:ne[w],id:v,x:M,y:R,...S!==null&&{pointerType:S}})},"getHandler");return Object.keys(ne).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=fn(p),y=d(p);if(window.PointerEvent)switch(ne[p]){case ne.MouseDown:case ne.MouseUp:g=g.replace("mouse","pointer");break;case ne.TouchStart:case ne.TouchEnd:return}u.push(It(g,y,e))}),Ee(()=>{u.forEach(p=>p())})}l(yD,"initMouseInteractionObserver");function CS({scrollCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){let a=Ee(Us(Ee(u=>{let f=Ys(u);if(!f||At(f,r,i,!0))return;let d=t.getId(f);if(f===e&&e.defaultView){let p=fS(e.defaultView);n({id:d,x:p.left,y:p.top})}else n({id:d,x:f.scrollLeft,y:f.scrollTop})}),o.scroll||100));return It("scroll",a,e)}l(CS,"initScrollObserver");function bD({viewportResizeCb:n},{win:e}){let t=-1,r=-1,i=Ee(Us(Ee(()=>{let o=hS(),a=dS();(t!==o||r!==a)&&(n({width:Number(a),height:Number(o)}),t=o,r=a)}),200));return It("resize",i,e)}l(bD,"initViewportResizeObserver");var vD=["INPUT","TEXTAREA","SELECT"],bb=new WeakMap;function SD({inputCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:f,sampling:d,userTriggeredOnInput:p}){function g(R){let T=Ys(R),N=R.isTrusted,U=T&&T.tagName;if(T&&U==="OPTION"&&(T=be.parentElement(T)),!T||!U||vD.indexOf(U)<0||At(T,r,i,!0)||T.classList.contains(o)||a&&T.matches(a))return;let G=T.value,Q=!1,W=Qa(T)||"";W==="radio"||W==="checkbox"?Q=T.checked:(u[U.toLowerCase()]||u[W])&&(G=Ja({element:T,maskInputOptions:u,tagName:U,type:W,value:G,maskInputFn:f})),y(T,p?{text:G,isChecked:Q,userTriggered:N}:{text:G,isChecked:Q});let z=T.name;W==="radio"&&z&&Q&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(re=>{if(re!==T){let B=re.value;y(re,p?{text:B,isChecked:!Q,userTriggered:!1}:{text:B,isChecked:!Q})}})}l(g,"eventHandler");function y(R,T){let N=bb.get(R);if(!N||N.text!==T.text||N.isChecked!==T.isChecked){bb.set(R,T);let U=t.getId(R);Ee(n)({...T,id:U})}}l(y,"cbWithDedup");let w=(d.input==="last"?["change"]:["input","change"]).map(R=>It(R,Ee(g),e)),E=e.defaultView;if(!E)return()=>{w.forEach(R=>R())};let v=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),M=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&w.push(...M.map(R=>Dl(R[0],R[1],{set(){Ee(g)({target:this,isTrusted:!1})}},!1,E))),Ee(()=>{w.forEach(R=>R())})}l(SD,"initInputObserver");function bl(n){let e=[];function t(r,i){if(Ua("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ua("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ua("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ua("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(a)}return i}return l(t,"recurse"),t(n,e)}l(bl,"getNestedCSSRulePositions");function ln(n,e,t){let r,i;return n?(n.ownerNode?r=e.getId(n.ownerNode):i=t.getId(n),{styleId:i,id:r}):{}}l(ln,"getIdAndStyleId");function wD({styleSheetRuleCb:n,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Ee((p,g,y)=>{let[S,w]=y,{id:E,styleId:v}=ln(g,e,t.styleMirror);return(E&&E!==-1||v&&v!==-1)&&n({id:E,styleId:v,adds:[{rule:S,index:w}]}),p.apply(g,y)})}),r.CSSStyleSheet.prototype.addRule=function(p,g,y=this.cssRules.length){let S=`${p} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[S,y])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,removes:[{index:S}]}),p.apply(g,y)})}),r.CSSStyleSheet.prototype.removeRule=function(p){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,replace:S}),p.apply(g,y)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,replaceSync:S}),p.apply(g,y)})}));let f={};Ga("CSSGroupingRule")?f.CSSGroupingRule=r.CSSGroupingRule:(Ga("CSSMediaRule")&&(f.CSSMediaRule=r.CSSMediaRule),Ga("CSSConditionRule")&&(f.CSSConditionRule=r.CSSConditionRule),Ga("CSSSupportsRule")&&(f.CSSSupportsRule=r.CSSSupportsRule));let d={};return Object.entries(f).forEach(([p,g])=>{d[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(d[p].insertRule,{apply:Ee((y,S,w)=>{let[E,v]=w,{id:M,styleId:R}=ln(S.parentStyleSheet,e,t.styleMirror);return(M&&M!==-1||R&&R!==-1)&&n({id:M,styleId:R,adds:[{rule:E,index:[...bl(S),v||0]}]}),y.apply(S,w)})}),g.prototype.deleteRule=new Proxy(d[p].deleteRule,{apply:Ee((y,S,w)=>{let[E]=w,{id:v,styleId:M}=ln(S.parentStyleSheet,e,t.styleMirror);return(v&&v!==-1||M&&M!==-1)&&n({id:v,styleId:M,removes:[{index:[...bl(S),E]}]}),y.apply(S,w)})})}),Ee(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(f).forEach(([p,g])=>{g.prototype.insertRule=d[p].insertRule,g.prototype.deleteRule=d[p].deleteRule})})}l(wD,"initStyleSheetObserver");function MS({mirror:n,stylesheetManager:e},t){var r,i,o;let a=null;t.nodeName==="#document"?a=n.getId(t):a=n.getId(be.host(t));let u=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,f=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!f?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get(){var d;return(d=f.get)==null?void 0:d.call(this)},set(d){var p;let g=(p=f.set)==null?void 0:p.call(this,d);if(a!==null&&a!==-1)try{e.adoptStyleSheets(d,a)}catch{}return g}}),Ee(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get:f.get,set:f.set})}))}l(MS,"initAdoptedStyleSheetObserver");function ED({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ee((u,f,d)=>{var p;let[g,y,S]=d;if(t.has(g))return o.apply(f,[g,y,S]);let{id:w,styleId:E}=ln((p=f.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,set:{property:g,value:y,priority:S},index:bl(f.parentRule)}),u.apply(f,d)})});let a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ee((u,f,d)=>{var p;let[g]=d;if(t.has(g))return a.apply(f,[g]);let{id:y,styleId:S}=ln((p=f.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&n({id:y,styleId:S,remove:{property:g},index:bl(f.parentRule)}),u.apply(f,d)})}),Ee(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}l(ED,"initStyleDeclarationObserver");function xD({mediaInteractionCb:n,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){let a=Ee(f=>Us(Ee(d=>{let p=Ys(d);if(!p||At(p,e,t,!0))return;let{currentTime:g,volume:y,muted:S,playbackRate:w,loop:E}=p;n({type:f,id:r.getId(p),currentTime:g,volume:y,muted:S,playbackRate:w,loop:E})}),i.media||500)),u=[It("play",a(cn.Play),o),It("pause",a(cn.Pause),o),It("seeked",a(cn.Seeked),o),It("volumechange",a(cn.VolumeChange),o),It("ratechange",a(cn.RateChange),o)];return Ee(()=>{u.forEach(f=>f())})}l(xD,"initMediaInteractionObserver");function CD({fontCb:n,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,o=t.FontFace;t.FontFace=l(function(f,d,p){let g=new o(f,d,p);return i.set(g,{family:f,buffer:typeof d!="string",descriptors:p,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),g},"FontFace2");let a=$n(e.fonts,"add",function(u){return function(f){return setTimeout(Ee(()=>{let d=i.get(f);d&&(n(d),i.delete(f))}),0),u.apply(this,[f])}});return r.push(()=>{t.FontFace=o}),r.push(a),Ee(()=>{r.forEach(u=>u())})}l(CD,"initFontObserver");function MD(n){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=n,a=!0,u=Ee(()=>{let f=e.getSelection();if(!f||a&&f?.isCollapsed)return;a=f.isCollapsed||!1;let d=[],p=f.rangeCount||0;for(let g=0;g<p;g++){let y=f.getRangeAt(g),{startContainer:S,startOffset:w,endContainer:E,endOffset:v}=y;At(S,r,i,!0)||At(E,r,i,!0)||d.push({start:t.getId(S),startOffset:w,end:t.getId(E),endOffset:v})}o({ranges:d})});return u(),It("selectionchange",u)}l(MD,"initSelectionObserver");function TD({doc:n,customElementCb:e}){let t=n.defaultView;return!t||!t.customElements?()=>{}:$n(t.customElements,"define",function(i){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,u])}})}l(TD,"initCustomElementObserver");function ID(n,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:f,styleSheetRuleCb:d,styleDeclarationCb:p,canvasMutationCb:g,fontCb:y,selectionCb:S,customElementCb:w}=n;n.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),t(...E)},n.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},n.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),i(...E)},n.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},n.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},n.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},n.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),f(...E)},n.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),d(...E)},n.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),p(...E)},n.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},n.fontCb=(...E)=>{e.font&&e.font(...E),y(...E)},n.selectionCb=(...E)=>{e.selection&&e.selection(...E),S(...E)},n.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),w(...E)}}l(ID,"mergeHooks");function AD(n,e={}){let t=n.doc.defaultView;if(!t)return()=>{};ID(n,e);let r;n.recordDOM&&(r=xS(n,n.doc));let i=gD(n),o=yD(n),a=CS(n),u=bD(n,{win:t}),f=SD(n),d=xD(n),p=l(()=>{},"styleSheetObserver"),g=l(()=>{},"adoptedStyleSheetObserver"),y=l(()=>{},"styleDeclarationObserver"),S=l(()=>{},"fontObserver");n.recordDOM&&(p=wD(n,{win:t}),g=MS(n,n.doc),y=ED(n,{win:t}),n.collectFonts&&(S=CD(n)));let w=MD(n),E=TD(n),v=[];for(let M of n.plugins)v.push(M.observer(M.callback,t,M.options));return Ee(()=>{kn.forEach(M=>M.reset()),r?.disconnect(),i(),o(),a(),u(),f(),d(),p(),g(),y(),S(),w(),E(),v.forEach(M=>M())})}l(AD,"initObservers");function Ua(n){return typeof window[n]<"u"}l(Ua,"hasNestedCSSRule");function Ga(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}l(Ga,"canMonkeyPatchNestedCSSRule");var vl=class{static{l(this,"CrossOriginIframeMirror")}constructor(e){P(this,"iframeIdToRemoteIdMap",new WeakMap),P(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let o=r||this.getIdToRemoteIdMap(e),a=i||this.getRemoteIdToIdMap(e),u=o.get(t);return u||(u=this.generateIdFn(),o.set(t,u),a.set(u,t)),u}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let o=i.get(t);return o||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Oh=class{static{l(this,"IframeManager")}constructor(e){P(this,"iframes",new WeakMap),P(this,"crossOriginIframeMap",new WeakMap),P(this,"crossOriginIframeMirror",new vl(Pb)),P(this,"crossOriginIframeStyleMirror"),P(this,"crossOriginIframeRootIdMap",new WeakMap),P(this,"mirror"),P(this,"mutationCb"),P(this,"wrappedEmit"),P(this,"loadListener"),P(this,"stylesheetManager"),P(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case j.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:j.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case j.Meta:case j.Load:case j.DomContentLoaded:return!1;case j.Plugin:return t;case j.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case j.IncrementalSnapshot:switch(t.data.source){case V.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case V.Drag:case V.TouchMove:case V.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case V.ViewportResize:return!1;case V.MediaInteraction:case V.MouseInteraction:case V.Scroll:case V.CanvasMutation:case V.Input:return this.replaceIds(t.data,e,["id"]),t;case V.StyleSheetRule:case V.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case V.Font:return t;case V.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case V.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==$r.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},Lh=class{static{l(this,"ShadowDomManager")}constructor(e){P(this,"shadowDoms",new WeakSet),P(this,"mutationCb"),P(this,"scrollCb"),P(this,"bypassOptions"),P(this,"mirror"),P(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Rs(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=xS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(CS({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(be.host(e))),this.restoreHandlers.push(MS({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push($n(e.prototype,"attachShadow",function(i){return function(o){let a=i.call(this,o),u=be.shadowRoot(this);return u&&wS(this)&&r.addShadowRoot(u,t),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Is=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ms=0;Ms<bi.length;Ms++)Is[bi.charCodeAt(Ms)]=Ms;var Ms,RD=l(function(n){var e=new Uint8Array(n),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=bi[e[t]>>2],i+=bi[(e[t]&3)<<4|e[t+1]>>4],i+=bi[(e[t+1]&15)<<2|e[t+2]>>6],i+=bi[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},"encode"),OD=l(function(n){var e=n.length*.75,t=n.length,r,i=0,o,a,u,f;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var d=new ArrayBuffer(e),p=new Uint8Array(d);for(r=0;r<t;r+=4)o=Is[n.charCodeAt(r)],a=Is[n.charCodeAt(r+1)],u=Is[n.charCodeAt(r+2)],f=Is[n.charCodeAt(r+3)],p[i++]=o<<2|a>>4,p[i++]=(a&15)<<4|u>>2,p[i++]=(u&3)<<6|f&63;return d},"decode"),vb=new Map;function LD(n,e){let t=vb.get(n);return t||(t=new Map,vb.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}l(LD,"variableListFor$1");var TS=l((n,e,t)=>{if(!n||!(AS(n,e)||typeof n=="object"))return;let r=n.constructor.name,i=LD(t,r),o=i.indexOf(n);return o===-1&&(o=i.length,i.push(n)),o},"saveWebGLVar");function Xa(n,e,t){if(n instanceof Array)return n.map(r=>Xa(r,e,t));if(n===null)return n;if(n instanceof Float32Array||n instanceof Float64Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Uint8Array||n instanceof Uint16Array||n instanceof Int16Array||n instanceof Int8Array||n instanceof Uint8ClampedArray)return{rr_type:n.constructor.name,args:[Object.values(n)]};if(n instanceof ArrayBuffer){let r=n.constructor.name,i=RD(n);return{rr_type:r,base64:i}}else{if(n instanceof DataView)return{rr_type:n.constructor.name,args:[Xa(n.buffer,e,t),n.byteOffset,n.byteLength]};if(n instanceof HTMLImageElement){let r=n.constructor.name,{src:i}=n;return{rr_type:r,src:i}}else if(n instanceof HTMLCanvasElement){let r="HTMLImageElement",i=n.toDataURL();return{rr_type:r,src:i}}else{if(n instanceof ImageData)return{rr_type:n.constructor.name,args:[Xa(n.data,e,t),n.width,n.height]};if(AS(n,e)||typeof n=="object"){let r=n.constructor.name,i=TS(n,e,t);return{rr_type:r,index:i}}}}return n}l(Xa,"serializeArg");var IS=l((n,e,t)=>n.map(r=>Xa(r,e,t)),"serializeArgs"),AS=l((n,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>n instanceof e[i]),"isInstanceOfWebGLObject");function ND(n,e,t,r){let i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;let u=$n(e.CanvasRenderingContext2D.prototype,a,function(f){return function(...d){return At(this.canvas,t,r,!0)||setTimeout(()=>{let p=IS(d,e,this);n(this.canvas,{type:Wr["2D"],property:a,args:p})},0),f.apply(this,d)}});i.push(u)}catch{let u=Dl(e.CanvasRenderingContext2D.prototype,a,{set(f){n(this.canvas,{type:Wr["2D"],property:a,args:[f],setter:!0})}});i.push(u)}return()=>{i.forEach(a=>a())}}l(ND,"initCanvas2DMutationObserver");function _D(n){return n==="experimental-webgl"?"webgl":n}l(_D,"getNormalizedContextName");function Sb(n,e,t,r){let i=[];try{let o=$n(n.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...f){if(!At(this,e,t,!0)){let d=_D(u);if("__context"in this||(this.__context=d),r&&["webgl","webgl2"].includes(d))if(f[0]&&typeof f[0]=="object"){let p=f[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else f.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...f])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}l(Sb,"initCanvasContextObserver");function wb(n,e,t,r,i,o){let a=[],u=Object.getOwnPropertyNames(n);for(let f of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(f))try{if(typeof n[f]!="function")continue;let d=$n(n,f,function(p){return function(...g){let y=p.apply(this,g);if(TS(y,o,this),"tagName"in this.canvas&&!At(this.canvas,r,i,!0)){let S=IS(g,o,this),w={type:e,property:f,args:S};t(this.canvas,w)}return y}});a.push(d)}catch{let d=Dl(n,f,{set(p){t(this.canvas,{type:e,property:f,args:[p],setter:!0})}});a.push(d)}return a}l(wb,"patchGLPrototype");function DD(n,e,t,r){let i=[];return i.push(...wb(e.WebGLRenderingContext.prototype,Wr.WebGL,n,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...wb(e.WebGL2RenderingContext.prototype,Wr.WebGL2,n,t,r,e)),()=>{i.forEach(o=>o())}}l(DD,"initCanvasWebGLMutationObserver");var RS="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kD=l(n=>Uint8Array.from(atob(n),e=>e.charCodeAt(0)),"decodeBase64"),Eb=typeof window<"u"&&window.Blob&&new Blob([kD(RS)],{type:"text/javascript;charset=utf-8"});function PD(n){let e;try{if(e=Eb&&(window.URL||window.webkitURL).createObjectURL(Eb),!e)throw"";let t=new Worker(e,{name:n?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+RS,{name:n?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}l(PD,"WorkerWrapper");var Nh=class{static{l(this,"CanvasManager")}constructor(e){P(this,"pendingCanvasMutations",new Map),P(this,"rafStamps",{latestId:0,invokeId:null}),P(this,"mirror"),P(this,"mutationCb"),P(this,"resetObservers"),P(this,"frozen",!1),P(this,"locked",!1),P(this,"processMutation",(f,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(f)||this.pendingCanvasMutations.set(f,[]),this.pendingCanvasMutations.get(f).push(d)});let{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t==="all"&&this.initCanvasMutationObserver(r,i,o),a&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:u})}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(e,t,r,i,o){let a=Sb(t,r,i,!0),u=new Map,f=new PD;f.onmessage=w=>{let{id:E}=w.data;if(u.set(E,!1),!("base64"in w.data))return;let{base64:v,type:M,width:R,height:T}=w.data;this.mutationCb({id:E,type:Wr["2D"],commands:[{property:"clearRect",args:[0,0,R,T]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:v}],type:M}]},0,0]}]})};let d=1e3/e,p=0,g,y=l(()=>{let w=[];return t.document.querySelectorAll("canvas").forEach(E=>{At(E,r,i,!0)||w.push(E)}),w},"getCanvas"),S=l(w=>{if(p&&w-p<d){g=requestAnimationFrame(S);return}p=w,y().forEach(async E=>{var v;let M=this.mirror.getId(E);if(u.get(M)||E.width===0||E.height===0)return;if(u.set(M,!0),["webgl","webgl2"].includes(E.__context)){let T=E.getContext(E.__context);((v=T?.getContextAttributes())==null?void 0:v.preserveDrawingBuffer)===!1&&T.clear(T.COLOR_BUFFER_BIT)}let R=await createImageBitmap(E);f.postMessage({id:M,bitmap:R,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[R])}),g=requestAnimationFrame(S)},"takeCanvasSnapshots");g=requestAnimationFrame(S),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Sb(e,t,r,!1),o=ND(this.processMutation.bind(this),e,t,r),a=DD(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=l(t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)},"setLatestRAFTimestamp");requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(a=>{let{type:u,...f}=a;return f}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}},_h=class{static{l(this,"StylesheetManager")}constructor(e){P(this,"trackedLinkElements",new WeakSet),P(this,"mutationCb"),P(this,"adoptedStyleSheetCb"),P(this,"styleMirror",new yl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,f)=>({rule:Db(u,o.href),index:f}))})),r.styleIds.push(a)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Dh=class{static{l(this,"ProcessedNodeManager")}constructor(){P(this,"nodeMap",new WeakMap),P(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},rt,Za,Df,Sl=!1;try{if(Array.from([1],n=>n*2)[0]!==2){let n=document.createElement("iframe");document.body.appendChild(n),Array.from=((Sy=n.contentWindow)==null?void 0:Sy.Array.from)||Array.from,document.body.removeChild(n)}}catch(n){console.debug("Unable to override Array.from",n)}var ir=kb();function Zt(n={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:f="rr-mask",maskTextSelector:d=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:S,maskInputFn:w,maskTextFn:E,hooks:v,packFn:M,sampling:R={},dataURLOptions:T={},mousemoveWait:N,recordDOM:U=!0,recordCanvas:G=!1,recordCrossOriginIframes:Q=!1,recordAfter:W=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:re=!1,inlineImages:B=!1,plugins:q,keepIframeSrcFn:k=l(()=>!1,"keepIframeSrcFn"),ignoreCSSAttributes:ee=new Set([]),errorHandler:X}=n;pD(X);let Y=Q?window.parent===window:!0,fe=!1;if(!Y)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(Y&&!e)throw new Error("emit function is required");if(!Y&&!fe)return()=>{};N!==void 0&&R.mousemove===void 0&&(R.mousemove=N),ir.reset();let Ae=g===!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}:y!==void 0?y:{password:!0},xe=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all",headTitleMutations:S==="all"}:S||{};gS();let Cr,me=0,dt=l(Ce=>{for(let Je of q||[])Je.eventProcessor&&(Ce=Je.eventProcessor(Ce));return M&&!fe&&(Ce=M(Ce)),Ce},"eventProcessor");rt=l((Ce,Je)=>{var _e;let je=Ce;if(je.timestamp=gl(),(_e=kn[0])!=null&&_e.isFrozen()&&je.type!==j.FullSnapshot&&!(je.type===j.IncrementalSnapshot&&je.data.source===V.Mutation)&&kn.forEach(ot=>ot.unfreeze()),Y)e?.(dt(je),Je);else if(fe){let ot={type:"rrweb",event:dt(je),origin:window.location.origin,isCheckout:Je};window.parent.postMessage(ot,"*")}if(je.type===j.FullSnapshot)Cr=je,me=0;else if(je.type===j.IncrementalSnapshot){if(je.data.source===V.Mutation&&je.data.isAttachIframe)return;me++;let ot=r&&me>=r,Te=t&&je.timestamp-Cr.timestamp>t;(ot||Te)&&Za(!0)}},"wrappedEmit");let ut=l(Ce=>{rt({type:j.IncrementalSnapshot,data:{source:V.Mutation,...Ce}})},"wrappedMutationEmit"),st=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.Scroll,...Ce}}),"wrappedScrollEmit"),vn=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.CanvasMutation,...Ce}}),"wrappedCanvasMutationEmit"),Vt=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.AdoptedStyleSheet,...Ce}}),"wrappedAdoptedStyleSheetEmit"),Dt=new _h({mutationCb:ut,adoptedStyleSheetCb:Vt}),Mr=new Oh({mirror:ir,mutationCb:ut,stylesheetManager:Dt,recordCrossOriginIframes:Q,wrappedEmit:rt});for(let Ce of q||[])Ce.getMirror&&Ce.getMirror({nodeMirror:ir,crossOriginIframeMirror:Mr.crossOriginIframeMirror,crossOriginIframeStyleMirror:Mr.crossOriginIframeStyleMirror});let qr=new Dh;Df=new Nh({recordCanvas:G,mutationCb:vn,win:window,blockClass:i,blockSelector:o,mirror:ir,sampling:R.canvas,dataURLOptions:T});let Tr=new Lh({mutationCb:ut,scrollCb:st,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:d,inlineStylesheet:p,maskInputOptions:Ae,dataURLOptions:T,maskTextFn:E,maskInputFn:w,recordCanvas:G,inlineImages:B,sampling:R,slimDOMOptions:xe,iframeManager:Mr,stylesheetManager:Dt,canvasManager:Df,keepIframeSrcFn:k,processedNodeManager:qr},mirror:ir});Za=l((Ce=!1)=>{if(!U)return;rt({type:j.Meta,data:{href:window.location.href,width:dS(),height:hS()}},Ce),Dt.reset(),Tr.init(),kn.forEach(_e=>_e.lock());let Je=$R(document,{mirror:ir,blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:d,inlineStylesheet:p,maskAllInputs:Ae,maskTextFn:E,maskInputFn:w,slimDOM:xe,dataURLOptions:T,recordCanvas:G,inlineImages:B,onSerialize:l(_e=>{Ls(_e,ir)&&Mr.addIframe(_e),bS(_e,ir)&&Dt.trackLinkElement(_e),Dn(_e)&&Tr.addShadowRoot(be.shadowRoot(_e),document)},"onSerialize"),onIframeLoad:l((_e,je)=>{Mr.attachIframe(_e,je),Tr.observeAttachShadow(_e)},"onIframeLoad"),onStylesheetLoad:l((_e,je)=>{Dt.attachLinkElement(_e,je)},"onStylesheetLoad"),keepIframeSrcFn:k});if(!Je)return console.warn("Failed to snapshot the document");rt({type:j.FullSnapshot,data:{node:Je,initialOffset:fS(window)}},Ce),kn.forEach(_e=>_e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Dt.adoptStyleSheets(document.adoptedStyleSheets,ir.getId(document))},"takeFullSnapshot$1");try{let Ce=[],Je=l(je=>{var ot;return Ee(AD)({mutationCb:ut,mousemoveCb:l((Te,ji)=>rt({type:j.IncrementalSnapshot,data:{source:ji,positions:Te}}),"mousemoveCb"),mouseInteractionCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.MouseInteraction,...Te}}),"mouseInteractionCb"),scrollCb:st,viewportResizeCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.ViewportResize,...Te}}),"viewportResizeCb"),inputCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.Input,...Te}}),"inputCb"),mediaInteractionCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.MediaInteraction,...Te}}),"mediaInteractionCb"),styleSheetRuleCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.StyleSheetRule,...Te}}),"styleSheetRuleCb"),styleDeclarationCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.StyleDeclaration,...Te}}),"styleDeclarationCb"),canvasMutationCb:vn,fontCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.Font,...Te}}),"fontCb"),selectionCb:l(Te=>{rt({type:j.IncrementalSnapshot,data:{source:V.Selection,...Te}})},"selectionCb"),customElementCb:l(Te=>{rt({type:j.IncrementalSnapshot,data:{source:V.CustomElement,...Te}})},"customElementCb"),blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:f,maskTextSelector:d,maskInputOptions:Ae,inlineStylesheet:p,sampling:R,recordDOM:U,recordCanvas:G,inlineImages:B,userTriggeredOnInput:z,collectFonts:re,doc:je,maskInputFn:w,maskTextFn:E,keepIframeSrcFn:k,blockSelector:o,slimDOMOptions:xe,dataURLOptions:T,mirror:ir,iframeManager:Mr,stylesheetManager:Dt,shadowDomManager:Tr,processedNodeManager:qr,canvasManager:Df,ignoreCSSAttributes:ee,plugins:((ot=q?.filter(Te=>Te.observer))==null?void 0:ot.map(Te=>({observer:Te.observer,options:Te.options,callback:l(ji=>rt({type:j.Plugin,data:{plugin:Te.name,payload:ji}}),"callback")})))||[]},v)},"observe");Mr.addLoadListener(je=>{try{Ce.push(Je(je.contentDocument))}catch(ot){console.warn(ot)}});let _e=l(()=>{Za(),Ce.push(Je(document)),Sl=!0},"init");return document.readyState==="interactive"||document.readyState==="complete"?_e():(Ce.push(It("DOMContentLoaded",()=>{rt({type:j.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&_e()})),Ce.push(It("load",()=>{rt({type:j.Load,data:{}}),W==="load"&&_e()},window))),()=>{Ce.forEach(je=>je()),qr.destroy(),Sl=!1,mD()}}catch(Ce){console.warn(Ce)}}l(Zt,"record");Zt.addCustomEvent=(n,e)=>{if(!Sl)throw new Error("please add custom event after start recording");rt({type:j.Custom,data:{tag:n,payload:e}})};Zt.freezePage=()=>{kn.forEach(n=>n.freeze())};Zt.takeFullSnapshot=n=>{if(!Sl)throw new Error("please take full snapshot after start recording");Za(n)};Zt.mirror=ir;function OS(n){return{all:n=n||new Map,on:l(function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},"on"),off:l(function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},"off"),emit:l(function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})},"emit")}}l(OS,"mitt$1");var FD=Object.freeze(Object.defineProperty({__proto__:null,default:OS},Symbol.toStringTag,{value:"Module"}));function $D(n=window,e=document){if("scrollBehavior"in e.documentElement.style&&n.__forceSmoothScrollPolyfill__!==!0)return;let t=n.HTMLElement||n.Element,r=468,i={scroll:n.scroll||n.scrollTo,scrollBy:n.scrollBy,elementScroll:t.prototype.scroll||f,scrollIntoView:t.prototype.scrollIntoView},o=n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now;function a(M){let R=["MSIE ","Trident/","Edge/"];return new RegExp(R.join("|")).test(M)}l(a,"isMicrosoftBrowser");let u=a(n.navigator.userAgent)?1:0;function f(M,R){this.scrollLeft=M,this.scrollTop=R}l(f,"scrollElement");function d(M){return .5*(1-Math.cos(Math.PI*M))}l(d,"ease");function p(M){if(M===null||typeof M!="object"||M.behavior===void 0||M.behavior==="auto"||M.behavior==="instant")return!0;if(typeof M=="object"&&M.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+M.behavior+" is not a valid value for enumeration ScrollBehavior.")}l(p,"shouldBailOut");function g(M,R){if(R==="Y")return M.clientHeight+u<M.scrollHeight;if(R==="X")return M.clientWidth+u<M.scrollWidth}l(g,"hasScrollableSpace");function y(M,R){let T=n.getComputedStyle(M,null)["overflow"+R];return T==="auto"||T==="scroll"}l(y,"canOverflow");function S(M){let R=g(M,"Y")&&y(M,"Y"),T=g(M,"X")&&y(M,"X");return R||T}l(S,"isScrollable");function w(M){for(;M!==e.body&&S(M)===!1;)M=M.parentNode||M.host;return M}l(w,"findScrollableParent");function E(M){let R=o(),T,N,U,G=(R-M.startTime)/r;G=G>1?1:G,T=d(G),N=M.startX+(M.x-M.startX)*T,U=M.startY+(M.y-M.startY)*T,M.method.call(M.scrollable,N,U),(N!==M.x||U!==M.y)&&n.requestAnimationFrame(E.bind(n,M))}l(E,"step");function v(M,R,T){let N,U,G,Q,W=o();M===e.body?(N=n,U=n.scrollX||n.pageXOffset,G=n.scrollY||n.pageYOffset,Q=i.scroll):(N=M,U=M.scrollLeft,G=M.scrollTop,Q=f),E({scrollable:N,method:Q,startTime:W,startX:U,startY:G,x:R,y:T})}l(v,"smoothScroll"),n.scroll=n.scrollTo=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){i.scroll.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:n.scrollY||n.pageYOffset);return}v.call(n,e.body,arguments[0].left!==void 0?~~arguments[0].left:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:n.scrollY||n.pageYOffset)}},n.scrollBy=function(){if(arguments[0]!==void 0){if(p(arguments[0])){i.scrollBy.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}v.call(n,e.body,~~arguments[0].left+(n.scrollX||n.pageXOffset),~~arguments[0].top+(n.scrollY||n.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(p(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let M=arguments[0].left,R=arguments[0].top;v.call(this,this,typeof M>"u"?this.scrollLeft:~~M,typeof R>"u"?this.scrollTop:~~R)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(p(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let M=w(this),R=M.getBoundingClientRect(),T=this.getBoundingClientRect();M!==e.body?(v.call(this,M,M.scrollLeft+T.left-R.left,M.scrollTop+T.top-R.top),n.getComputedStyle(M).position!=="fixed"&&n.scrollBy({left:R.left,top:R.top,behavior:"smooth"})):n.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}l($D,"polyfill");var kh=class{static{l(this,"Timer")}constructor(e=[],t){P(this,"timeOffset",0),P(this,"speed"),P(this,"actions"),P(this,"raf",null),P(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}};function xb(n,e){if(n.type===j.IncrementalSnapshot&&n.data.source===V.MouseMove&&n.data.positions&&n.data.positions.length){let t=n.data.positions[0].timeOffset,r=n.timestamp+t;return n.delay=r-e,r-e}return n.delay=n.timestamp-e,n.delay}l(xb,"addDelay");function Cb(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a}l(Cb,"t");var vi;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(vi||(vi={}));var LS={type:"xstate.init"};function kf(n){return n===void 0?[]:[].concat(n)}l(kf,"r");function mi(n){return{type:"xstate.assign",assignment:n}}l(mi,"o");function Mb(n,e){return typeof(n=typeof n=="string"&&e&&e[n]?e[n]:n)=="string"?{type:n}:typeof n=="function"?{type:n.name,exec:n}:n}l(Mb,"i");function wl(n){return function(e){return n===e}}l(wl,"a");function NS(n){return typeof n=="string"?{type:n}:n}l(NS,"u");function Tb(n,e){return{value:n,context:e,actions:[],changed:!1,matches:wl(n)}}l(Tb,"c");function Ib(n,e,t){var r=e,i=!1;return[n.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,t):Object.keys(o.assignment).forEach(function(u){a[u]=typeof o.assignment[u]=="function"?o.assignment[u](r,t):o.assignment[u]}),r=a,!1}return!0}),r,i]}l(Ib,"f");function _S(n,e){e===void 0&&(e={});var t=Cb(Ib(kf(n.states[n.initial].entry).map(function(a){return Mb(a,e.actions)}),n.context,LS),2),r=t[0],i=t[1],o={config:n,_options:e,initialState:{value:n.initial,actions:r,context:i,matches:wl(n.initial)},transition:l(function(a,u){var f,d,p=typeof a=="string"?{value:a,context:n.context}:a,g=p.value,y=p.context,S=NS(u),w=n.states[g];if(w.on){var E=kf(w.on[S.type]);try{for(var v=function(fe){var Ae=typeof Symbol=="function"&&Symbol.iterator,xe=Ae&&fe[Ae],Cr=0;if(xe)return xe.call(fe);if(fe&&typeof fe.length=="number")return{next:l(function(){return fe&&Cr>=fe.length&&(fe=void 0),{value:fe&&fe[Cr++],done:!fe}},"next")};throw new TypeError(Ae?"Object is not iterable.":"Symbol.iterator is not defined.")}(E),M=v.next();!M.done;M=v.next()){var R=M.value;if(R===void 0)return Tb(g,y);var T=typeof R=="string"?{target:R}:R,N=T.target,U=T.actions,G=U===void 0?[]:U,Q=T.cond,W=Q===void 0?function(){return!0}:Q,z=N===void 0,re=N??g,B=n.states[re];if(W(y,S)){var q=Cb(Ib((z?kf(G):[].concat(w.exit,G,B.entry).filter(function(fe){return fe})).map(function(fe){return Mb(fe,o._options.actions)}),y,S),3),k=q[0],ee=q[1],X=q[2],Y=N??g;return{value:Y,context:ee,actions:k,changed:N!==g||k.length>0||X,matches:wl(Y)}}}}catch(fe){f={error:fe}}finally{try{M&&!M.done&&(d=v.return)&&d.call(v)}finally{if(f)throw f.error}}}return Tb(g,y)},"transition")};return o}l(_S,"s");var Ab=l(function(n,e){return n.actions.forEach(function(t){var r=t.exec;return r&&r(n.context,e)})},"l");function DS(n){var e=n.initialState,t=vi.NotStarted,r=new Set,i={_machine:n,send:l(function(o){t===vi.Running&&(e=n.transition(e,o),Ab(e,NS(o)),r.forEach(function(a){return a(e)}))},"send"),subscribe:l(function(o){return r.add(o),o(e),{unsubscribe:l(function(){return r.delete(o)},"unsubscribe")}},"subscribe"),start:l(function(o){if(o){var a=typeof o=="object"?o:{context:n.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:wl(a.value)}}return t=vi.Running,Ab(e,LS),i},"start"),stop:l(function(){return t=vi.Stopped,r.clear(),i},"stop"),get state(){return e},get status(){return t}};return i}l(DS,"v");function HD(n,e){for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.type===j.Meta&&r.timestamp<=e)return n.slice(t)}return n}l(HD,"discardPriorSnapshots");function BD(n,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){let i=_S({id:"player",context:n,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:mi({lastPlayedEvent:l((o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent,"lastPlayedEvent")}),recordTimeOffset:mi((o,a)=>{let u=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(u=a.payload.timeOffset),{...o,timeOffset:u,baselineTime:o.events[0].timestamp+u}}),play(o){var a;let{timer:u,events:f,baselineTime:d,lastPlayedEvent:p}=o;u.clear();for(let w of f)xb(w,d);let g=HD(f,d),y=p?.timestamp;p?.type===j.IncrementalSnapshot&&p.data.source===V.MouseMove&&(y=p.timestamp+((a=p.data.positions[0])==null?void 0:a.timeOffset)),d<(y||0)&&r.emit(Se.PlayBack);let S=new Array;for(let w of g)if(!(y&&y<d&&(w.timestamp<=y||w===p)))if(w.timestamp<d)S.push(w);else{let E=e(w,!1);u.addAction({doAction:l(()=>{E()},"doAction"),delay:w.delay})}t(S),r.emit(Se.Flush),u.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:mi(o=>({...o,lastPlayedEvent:null})),startLive:mi({baselineTime:l((o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now()),"baselineTime")}),addEvent:mi((o,a)=>{let{baselineTime:u,timer:f,events:d}=o;if(a.type==="ADD_EVENT"){let{event:p}=a.payload;xb(p,u);let g=d.length-1;if(!d[g]||d[g].timestamp<=p.timestamp)d.push(p);else{let w=-1,E=0;for(;E<=g;){let v=Math.floor((E+g)/2);d[v].timestamp<=p.timestamp?E=v+1:g=v-1}w===-1&&(w=E),d.splice(w,0,p)}let y=p.timestamp<u,S=e(p,y);y?S():f.isActive()&&f.addAction({doAction:l(()=>{S()},"doAction"),delay:p.delay})}return{...o,events:d}})}});return DS(i)}l(BD,"createPlayerService");function WD(n){let e=_S({id:"speed",context:n,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:l((t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},"setSpeed"),recordSpeed:mi({normalSpeed:l(t=>t.timer.speed,"normalSpeed")}),restoreSpeed:l(t=>{t.timer.setSpeed(t.normalSpeed)},"restoreSpeed")}});return DS(e)}l(WD,"createSpeedService");var VD=l(n=>[`.${n} { background: currentColor }`,"noscript { display: none !important; }"],"rules"),Rb=new Map;function kS(n,e){let t=Rb.get(n);return t||(t=new Map,Rb.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}l(kS,"variableListFor");function un(n,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let i=await un(n,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;let{rr_type:i,index:o}=r;return kS(e,i)[o]}else if("args"in r){let{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map(un(n,e,t))))}else{if("base64"in r)return OD(r.base64);if("src"in r){let i=n.get(r.src);if(i)return i;{let o=new Image;return o.src=r.src,n.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){let i=await Promise.all(r.data.map(un(n,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(un(n,e,t)));return r}}l(un,"deserializeArg");function UD(n,e){try{return e===Wr.WebGL?n.getContext("webgl")||n.getContext("experimental-webgl"):n.getContext("webgl2")}catch{return null}}l(UD,"getContext");var GD=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function zD(n,e){if(!e?.constructor)return;let{name:t}=e.constructor;if(!GD.includes(t))return;let r=kS(n,t);r.includes(e)||r.push(e)}l(zD,"saveToWebGLVarMap");async function jD({mutation:n,target:e,type:t,imageMap:r,errorHandler:i}){try{let o=UD(e,t);if(!o)return;if(n.setter){o[n.property]=n.args[0];return}let a=o[n.property],u=await Promise.all(n.args.map(un(r,o))),f=a.apply(o,u);zD(o,f);let d=!1}catch(o){i(n,o)}}l(jD,"webglMutation");async function qD({event:n,mutations:e,target:t,imageMap:r,errorHandler:i}){let o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}let a=e.map(async f=>Promise.all(f.args.map(un(r,o))));(await Promise.all(a)).forEach((f,d)=>{let p=e[d];try{if(p.setter){o[p.property]=p.args[0];return}let g=o[p.property];p.property==="drawImage"&&typeof p.args[0]=="string"?(r.get(n),g.apply(o,p.args)):g.apply(o,f)}catch(g){i(p,g)}})}l(qD,"canvasMutation$1");async function Ob({event:n,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{let a=i.get(n)||e,u="commands"in a?a.commands:[a];if([Wr.WebGL,Wr.WebGL2].includes(e.type)){for(let f=0;f<u.length;f++){let d=u[f];await jD({mutation:d,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await qD({event:n,mutations:u,target:t,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}l(Ob,"canvasMutation");var Ph=class{static{l(this,"MediaManager")}constructor(e){P(this,"mediaMap",new Map),P(this,"warn"),P(this,"service"),P(this,"speedService"),P(this,"emitter"),P(this,"getCurrentTime"),P(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(Se.Start,this.start.bind(this)),this.emitter.on(Se.SkipStart,this.start.bind(this)),this.emitter.on(Se.Pause,this.pause.bind(this)),this.emitter.on(Se.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,a="duration"in t&&t.duration;if(Number.isNaN(a)){this.waitForMetadata(t);return}let u=r.currentTimeAtLastInteraction+o;t.loop&&a!==!1&&(u=u%a),t.currentTime=u}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=l(()=>{this.metadataCallbackMap.delete(e);let r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})},"onLoadedMetadata");this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){let i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:u,muted:f,volume:d,loop:p}=r;return{isPlaying:o===cn.Play||o!==cn.Pause&&(i?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:u??i?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:a??i?.playbackRate??1,volume:d??i?.volume??1,muted:f??i?.muted??e.getAttribute("muted")===null,loop:p??i?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:i,volume:o,isPlaying:a}=t,u=this.service.state.matches("paused"),f=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==f&&(e.playbackRate=f),a&&!u?e.play():e.pause()}catch(d){this.warn(`Failed to replay media interactions: ${d.message||d}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;let a=this.service.state.matches("paused"),u=o.attributes,f=!1;u.rr_mediaState?f=u.rr_mediaState==="played":f=i.getAttribute("autoplay")!==null,f&&a&&i.pause();let d=1;typeof u.rr_mediaPlaybackRate=="number"&&(d=u.rr_mediaPlaybackRate);let p=!1;typeof u.rr_mediaMuted=="boolean"?p=u.rr_mediaMuted:p=i.getAttribute("muted")!==null;let g=!1;typeof u.rr_mediaLoop=="boolean"?g=u.rr_mediaLoop:g=i.getAttribute("loop")!==null;let y=1;typeof u.rr_mediaVolume=="number"&&(y=u.rr_mediaVolume);let S=0;typeof u.rr_mediaCurrentTime=="number"&&(S=u.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:f,currentTimeAtLastInteraction:S,lastInteractionTimeOffset:t,playbackRate:d,volume:y,muted:p,loop:g}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};function za(n,e){if(n.nodeName!=="DIALOG"||n instanceof sr)return;let t=n,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),a=typeof e?.attributes.open=="string"||typeof t.getAttribute("open")=="string",u=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&u))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),a&&(u?t.showModal():t.show())}}l(za,"applyDialogToTopLevel");function YD(n,e){if(n.nodeName!=="DIALOG"||n instanceof sr)return;let t=n;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}l(YD,"removeDialogFromTopLevel");var KD=5*1e3,XD=OS||FD,Lb="[replayer]",Pf={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Nb(n){return n.type==j.IncrementalSnapshot&&(n.data.source==V.TouchMove||n.data.source==V.MouseInteraction&&n.data.type==ne.TouchStart)}l(Nb,"indicatesTouchDevice");var El=class{static{l(this,"Replayer")}constructor(e,t){if(P(this,"wrapper"),P(this,"iframe"),P(this,"service"),P(this,"speedService"),P(this,"config"),P(this,"usingVirtualDom",!1),P(this,"virtualDom",new Ii),P(this,"mouse"),P(this,"mouseTail",null),P(this,"tailPositions",[]),P(this,"emitter",XD()),P(this,"nextUserInteractionEvent"),P(this,"legacy_missingNodeRetryMap",{}),P(this,"cache",zy()),P(this,"imageMap",new Map),P(this,"canvasEventMap",new Map),P(this,"mirror",kb()),P(this,"styleMirror",new yl),P(this,"mediaManager"),P(this,"firstFullSnapshot",null),P(this,"newDocumentQueue",[]),P(this,"mousePos",null),P(this,"touchActive",null),P(this,"lastMouseDownEvent",null),P(this,"lastHoveredRootNode"),P(this,"lastSelectionData",null),P(this,"constructedStyleMutations",[]),P(this,"adoptedStyleSheets",[]),P(this,"handleResize",u=>{this.iframe.style.display="inherit";for(let f of[this.mouseTail,this.iframe])f&&(f.setAttribute("width",String(u.width)),f.setAttribute("height",String(u.height)))}),P(this,"applyEventsSynchronously",u=>{for(let f of u){switch(f.type){case j.DomContentLoaded:case j.Load:case j.Custom:continue;case j.FullSnapshot:case j.Meta:case j.Plugin:case j.IncrementalSnapshot:break}this.getCastFn(f,!0)()}}),P(this,"getCastFn",(u,f=!1)=>{let d;switch(u.type){case j.DomContentLoaded:case j.Load:break;case j.Custom:d=l(()=>{this.emitter.emit(Se.CustomEvent,u)},"castFn");break;case j.Meta:d=l(()=>this.emitter.emit(Se.Resize,{width:u.data.width,height:u.data.height}),"castFn");break;case j.FullSnapshot:d=l(()=>{var g;if(this.firstFullSnapshot){if(this.firstFullSnapshot===u){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(u,f),(g=this.iframe.contentWindow)==null||g.scrollTo(u.data.initialOffset)},"castFn");break;case j.IncrementalSnapshot:d=l(()=>{if(this.applyIncremental(u,f),!f&&(u===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let g of this.service.state.context.events)if(!(g.timestamp<=u.timestamp)&&this.isUserInteraction(g)){g.delay-u.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=g);break}if(this.nextUserInteractionEvent){let g=this.nextUserInteractionEvent.delay-u.delay,y={speed:Math.min(Math.round(g/KD),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:y}),this.emitter.emit(Se.SkipStart,y)}}},"castFn");break}return l(()=>{d&&d();for(let y of this.config.plugins||[])y.handler&&y.handler(u,f,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:u}});let g=this.service.state.context.events.length-1;if(!this.config.liveMode&&u===this.service.state.context.events[g]){let y=l(()=>{g<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Se.Finish))},"finish"),S=50;u.type===j.IncrementalSnapshot&&u.data.source===V.MouseMove&&u.data.positions.length&&(S+=Math.max(0,-u.data.positions[0].timeOffset)),setTimeout(y,S)}this.emitter.emit(Se.EventCast,u)},"wrappedCastFn")}),!t?.liveMode&&e.length<2)throw new Error("Replayer need at least 2 events.");let r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Pf,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Se.Resize,this.handleResize),this.setupDom();for(let u of this.config.plugins||[])u.getMirror&&u.getMirror({nodeMirror:this.mirror});this.emitter.on(Se.Flush,()=>{if(this.usingVirtualDom){let u={mirror:this.mirror,applyCanvas:l((f,d,p)=>{Ob({event:f,mutation:d,target:p,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},"applyCanvas"),applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:l((f,d)=>{f.source===V.StyleSheetRule?this.applyStyleSheetRule(f,d):f.source===V.StyleDeclaration&&this.applyStyleDeclaration(f,d)},"applyStyleSheetMutation"),afterAppend:l((f,d)=>{for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(f,{id:d,replayer:this})},"afterAppend")};if(this.iframe.contentDocument)try{pl(this.iframe.contentDocument,this.virtualDom,u,this.virtualDom.mirror)}catch(f){console.warn(f)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let f in this.legacy_missingNodeRetryMap)try{let d=this.legacy_missingNodeRetryMap[f],p=ml(d.node,this.mirror,this.virtualDom.mirror);pl(p,d.node,u,this.virtualDom.mirror),d.node=p}catch(d){this.warn(d)}this.constructedStyleMutations.forEach(f=>{this.applyStyleSheetMutation(f)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(f=>{this.applyAdoptedStyleSheet(f)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[u,f]=this.lastMouseDownEvent;u.dispatchEvent(f)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Se.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let i=new kh([],{speed:this.config.speed});this.service=BD({events:e.map(u=>t&&t.unpackFn?t.unpackFn(u):u).sort((u,f)=>u.timestamp-f.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(u=>{this.emitter.emit(Se.StateChange,{player:u})}),this.speedService=WD({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(Se.StateChange,{speed:u})}),this.mediaManager=new Ph({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let o=this.service.state.context.events.find(u=>u.type===j.Meta),a=this.service.state.context.events.find(u=>u.type===j.FullSnapshot);if(o){let{width:u,height:f}=o.data;setTimeout(()=>{this.emitter.emit(Se.Resize,{width:u,height:f})},0)}a&&setTimeout(()=>{var u;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(u=this.iframe.contentWindow)==null||u.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Nb)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(Se.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(Se.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(Se.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Se.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;Nb(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=zy()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&($D(this.iframe.contentWindow,this.iframe.contentDocument),gS(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],i=new Set,o=l((f,d)=>{if(f.nodeName==="DIALOG"&&i.add(f),this.collectIframeAndAttachDocument(r,f),this.mediaManager.isSupportedMediaElement(f)){let{events:p}=this.service.state.context;this.mediaManager.addMediaElements(f,e.timestamp-p[0].timestamp,this.mirror)}for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(f,{id:d,replayer:this})},"afterAppend");this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),FL(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:f,builtNode:d}of r)this.attachDocumentToIframe(f,d),this.newDocumentQueue=this.newDocumentQueue.filter(p=>p!==f);let{documentElement:a,head:u}=this.iframe.contentDocument;this.insertStyleRules(a,u),i.forEach(f=>za(f)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Se.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;let i=VD(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,lS(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:V.StyleSheetRule,adds:i.map((a,u)=>({rule:a,index:u}))})}else{let o=document.createElement("style");e.insertBefore(o,t);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,a=l((u,f)=>{u.nodeName==="DIALOG"&&o.add(u),this.collectIframeAndAttachDocument(i,u);let d=r.getMeta(u);if(d?.type===$r.Element&&d?.tagName.toUpperCase()==="HTML"){let{documentElement:p,head:g}=t.contentDocument;this.insertStyleRules(p,g)}if(!this.usingVirtualDom)for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(u,{id:f,replayer:this})},"afterAppend");Os(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(t.contentDocument,e.node.id);for(let{mutationInQueue:u,builtNode:f}of i)this.attachDocumentToIframe(u,f),this.newDocumentQueue=this.newDocumentQueue.filter(d=>d!==u);o.forEach(u=>za(u))}collectIframeAndAttachDocument(e,t){if(Ls(t,this.mirror)){let r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let r=new Set,i,o=this.service.state,a=l(()=>{o=this.service.state},"stateHandler");this.emitter.on(Se.Start,a),this.emitter.on(Se.Pause,a);let u=l(()=>{this.emitter.off(Se.Start,a),this.emitter.off(Se.Pause,a)},"unsubscribe");t.querySelectorAll('link[rel="stylesheet"]').forEach(f=>{f.sheet||(r.add(f),f.addEventListener("load",()=>{r.delete(f),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Se.LoadStylesheetEnd),i&&clearTimeout(i),u())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Se.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,u()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===j.IncrementalSnapshot&&t.data.source===V.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let r=document.createElement("canvas"),i=r.getContext("2d"),o=i?.createImageData(r.width,r.height);i?.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let i=await Promise.all(e.commands.map(async o=>{let a=await Promise.all(o.args.map(un(this.imageMap,null,r)));return{...o,args:a}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:i})}else{let i=await Promise.all(e.args.map(un(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:i})}}}applyIncremental(e,t){var r,i,o;let{data:a}=e;switch(a.source){case V.Mutation:{try{this.applyMutation(a,t)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,a)}break}case V.Drag:case V.TouchMove:case V.MouseMove:if(t){let u=a.positions[a.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:a}}else a.positions.forEach(u=>{let f={doAction:l(()=>{this.moveAndHover(u.x,u.y,u.id,t,a)},"doAction"),delay:u.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(f)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case V.MouseInteraction:{if(a.id===-1)break;let u=new Event(fn(ne[a.type])),f=this.mirror.getNode(a.id);if(!f)return this.debugNodeNotFound(a,a.id);this.emitter.emit(Se.MouseInteraction,{type:a.type,target:f});let{triggerFocus:d}=this.config;switch(a.type){case ne.Blur:"blur"in f&&f.blur();break;case ne.Focus:d&&f.focus&&f.focus({preventScroll:!0});break;case ne.Click:case ne.TouchStart:case ne.TouchEnd:case ne.MouseDown:case ne.MouseUp:t?(a.type===ne.TouchStart?this.touchActive=!0:a.type===ne.TouchEnd&&(this.touchActive=!1),a.type===ne.MouseDown?this.lastMouseDownEvent=[f,u]:a.type===ne.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===ne.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,t,a),a.type===ne.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===ne.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===ne.TouchEnd?this.mouse.classList.remove("touch-active"):f.dispatchEvent(u));break;case ne.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:f.dispatchEvent(u)}break}case V.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.scrollData=a;break}this.applyScroll(a,t);break}case V.ViewportResize:this.emitter.emit(Se.Resize,{width:a.width,height:a.height});break;case V.Input:{if(a.id===-1)break;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.inputData=a;break}this.applyInput(a);break}case V.MediaInteraction:{let u=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);let f=u,{events:d}=this.service.state.context;this.mediaManager.mediaMutation({target:f,timeOffset:e.timestamp-d[0].timestamp,mutation:a});break}case V.StyleSheetRule:case V.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case V.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.canvasMutations.push({event:e,mutation:a})}else{let u=this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);Ob({event:e,mutation:a,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case V.Font:{try{let u=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(u)}catch(u){this.warn(u)}break}case V.Selection:{if(t){this.lastSelectionData=a;break}this.applySelection(a);break}case V.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,q_(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let d in this.legacy_missingNodeRetryMap)try{let p=this.legacy_missingNodeRetryMap[d],g=aS(p.node,this.virtualDom,this.mirror);g&&(p.node=g)}catch(p){this.warn(p)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(d=>r.getNode(d.id)?!0:(this.warnNodeNotFound(e,d.id),!1)),e.removes.forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return;let y=r.getNode(d.parentId);if(!y)return this.warnNodeNotFound(e,d.parentId);if(d.isShadow&&Dn(y)&&(y=y.shadowRoot),r.removeNodeFromMap(g),y)try{y.removeChild(g),this.usingVirtualDom&&g.nodeName==="#text"&&y.nodeName==="STYLE"&&((p=y.rules)==null?void 0:p.length)>0&&(y.rules=[])}catch(S){if(S instanceof DOMException)this.warn("parent could not remove child in mutation",y,g,e);else throw S}});let i={...this.legacy_missingNodeRetryMap},o=[],a=l(d=>{let p=null;return d.nextId&&(p=r.getNode(d.nextId)),d.nextId!==null&&d.nextId!==void 0&&d.nextId!==-1&&!p},"nextNotInDOM"),u=l(d=>{var p,g;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let y=r.getNode(d.parentId);if(!y)return d.node.type===$r.Document?this.newDocumentQueue.push(d):o.push(d);d.node.isShadow&&(Dn(y)||y.attachShadow({mode:"open"}),y=y.shadowRoot);let S=null,w=null;if(d.previousId&&(S=r.getNode(d.previousId)),d.nextId&&(w=r.getNode(d.nextId)),a(d))return o.push(d);if(d.node.rootId&&!r.getNode(d.node.rootId))return;let E=d.node.rootId?r.getNode(d.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ls(y,r)){this.attachDocumentToIframe(d,y);return}let v=l((T,N)=>{if(!this.usingVirtualDom){za(T);for(let U of this.config.plugins||[])U.onBuild&&U.onBuild(T,{id:N,replayer:this})}},"afterAppend"),M=Os(d.node,{doc:E,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:v});if(d.previousId===-1||d.nextId===-1){i[d.node.id]={node:M,mutation:d};return}let R=r.getMeta(y);if(R&&R.type===$r.Element&&d.node.type===$r.Text){let T=Array.isArray(y.childNodes)?y.childNodes:Array.from(y.childNodes);if(R.tagName==="textarea")for(let N of T)N.nodeType===y.TEXT_NODE&&y.removeChild(N);else if(R.tagName==="style"&&T.length===1)for(let N of T)N.nodeType===y.TEXT_NODE&&!r.hasNode(N)&&(M.textContent=N.textContent,y.removeChild(N))}else if(R?.type===$r.Document){let T=y;d.node.type===$r.DocumentType&&((p=T.childNodes[0])==null?void 0:p.nodeType)===Node.DOCUMENT_TYPE_NODE&&T.removeChild(T.childNodes[0]),M.nodeName==="HTML"&&T.documentElement&&T.removeChild(T.documentElement)}if(S&&S.nextSibling&&S.nextSibling.parentNode?y.insertBefore(M,S.nextSibling):w&&w.parentNode?y.contains(w)?y.insertBefore(M,w):y.insertBefore(M,null):y.appendChild(M),v(M,d.node.id),this.usingVirtualDom&&M.nodeName==="#text"&&y.nodeName==="STYLE"&&((g=y.rules)==null?void 0:g.length)>0&&(y.rules=[]),Ls(M,this.mirror)){let T=this.mirror.getId(M),N=this.newDocumentQueue.find(U=>U.parentId===T);N&&(this.attachDocumentToIframe(N,M),this.newDocumentQueue=this.newDocumentQueue.filter(U=>U!==N))}(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(i,y,M,d)},"appendNode");e.adds.forEach(d=>{u(d)});let f=Date.now();for(;o.length;){let d=lD(o);if(o.length=0,Date.now()-f>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}for(let p of d)r.getNode(p.value.parentId)?yS(p,y=>{u(y)}):this.debug("Drop resolve tree since there is no parent for the root node.",p)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),cD(e.texts).forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return e.removes.find(S=>S.id===d.id)?void 0:this.warnNodeNotFound(e,d.id);let y=g.parentElement;if(d.value&&y&&y.tagName==="STYLE"?g.textContent=Al(d.value,this.cache):g.textContent=d.value,this.usingVirtualDom){let S=g.parentNode;((p=S?.rules)==null?void 0:p.length)>0&&(S.rules=[])}}),e.attributes.forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return e.removes.find(y=>y.id===d.id)?void 0:this.warnNodeNotFound(e,d.id);for(let y in d.attributes)if(typeof y=="string"){let S=d.attributes[y];if(S===null)g.removeAttribute(y),y==="open"&&YD(g,d);else if(typeof S=="string")try{if(y==="_cssText"&&(g.nodeName==="LINK"||g.nodeName==="STYLE"))try{let w=r.getMeta(g),E=Os({...w,attributes:{...w.attributes,...d.attributes}},{doc:g.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(w.attributes,d.attributes);let v=g.nextSibling,M=g.parentNode;if(E&&M){M.removeChild(g),M.insertBefore(E,v),r.replace(d.id,E);break}}catch{}if(y==="value"&&g.nodeName==="TEXTAREA"){let w=g;w.childNodes.forEach(v=>w.removeChild(v));let E=(p=g.ownerDocument)==null?void 0:p.createTextNode(S);E&&w.appendChild(E)}else g.setAttribute(y,S);y==="rr_open_mode"&&g.nodeName==="DIALOG"&&za(g,d)}catch(w){this.warn("An error occurred may due to the checkout feature.",w)}else if(y==="style"){let w=S,E=g;for(let v in w)if(w[v]===!1)E.style.removeProperty(v);else if(w[v]instanceof Array){let M=w[v];E.style.setProperty(v,M[0],M[1])}else{let M=w[v];E.style.setProperty(v,M)}}}})}applyScroll(e,t){var r,i;let o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);let a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(a?.type===$r.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:u})=>{let f=this.mirror.getNode(i),d=this.mirror.getNode(a);if(!f||!d)return;let p=new Range;p.setStart(f,o),p.setEnd(d,u);let g=f.ownerDocument,y=g?.getSelection();return y&&t.add(y),{range:p,selection:y}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===V.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===V.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:u,index:f})=>{try{if(Array.isArray(f)){let{positions:d,index:p}=db(f);Ts(t.cssRules,d).insertRule(u,p)}else{let d=f===void 0?void 0:Math.min(f,t.cssRules.length);t?.insertRule(u,d)}}catch{}}),(i=e.removes)==null||i.forEach(({index:u})=>{try{if(Array.isArray(u)){let{positions:f,index:d}=db(u);Ts(t.cssRules,f).deleteRule(d||0)}else t?.deleteRule(u)}catch{}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch{}if(e.replaceSync)try{(a=t.replaceSync)==null||a.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){e.set&&Ts(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ts(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(u=>{var f;let d=null,p=null;if(Dn(r)?p=((f=r.ownerDocument)==null?void 0:f.defaultView)||null:r.nodeName==="#document"&&(p=r.defaultView),!!p)try{d=new p.CSSStyleSheet,this.styleMirror.add(d,u.styleId),this.applyStyleSheetRule({source:V.StyleSheetRule,adds:u.rules},d)}catch{}});let i=10,o=0,a=l((u,f)=>{let d=f.map(p=>this.styleMirror.getStyle(p)).filter(p=>p!==null);Dn(u)?u.shadowRoot.adoptedStyleSheets=d:u.nodeName==="#document"&&(u.adoptedStyleSheets=d),d.length!==f.length&&o<i&&(setTimeout(()=>a(u,f),0+100*o),o++)},"adoptStyleSheets");a(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){let{previousId:o,nextId:a}=i,u=o&&e[o],f=a&&e[a];if(u){let{node:d,mutation:p}=u;t.insertBefore(d,r),delete e[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(e,t,d,p)}if(f){let{node:d,mutation:p}=f;t.insertBefore(d,r.nextSibling),delete e[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(e,t,d,p)}}moveAndHover(e,t,r,i,o){let a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);let u=vS(a,this.iframe),f=e*u.absoluteScale+u.x,d=t*u.absoluteScale+u.y;this.mouse.style.left=`${f}px`,this.mouse.style.top=`${d}px`,i||this.drawMouseTail({x:f,y:d}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?Pf:Object.assign({},Pf,this.config.mouseTail),a=l(()=>{if(!this.mouseTail)return;let u=this.mouseTail.getContext("2d");!u||!this.tailPositions.length||(u.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),u.beginPath(),u.lineWidth=r,u.lineCap=t,u.strokeStyle=i,u.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(f=>u.lineTo(f.x,f.y)),u.stroke())},"draw");this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(u=>u!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==j.IncrementalSnapshot?!1:e.data.source>V.Mutation&&e.data.source<=V.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Se.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Lb,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Lb,...e)}},{addCustomEvent:bU}=Zt,{freezePage:vU}=Zt,{takeFullSnapshot:SU}=Zt,ZD="0.0.3-beta.1";typeof window<"u"&&(window.checksumRRWeb={version:ZD});var FS=l(n=>{let e=l(o=>o&&(o instanceof HTMLInputElement&&/|text|email|number|password|search|tel|url/.test(o.type||"")||o instanceof HTMLTextAreaElement)?!(o.disabled||o.readOnly):!1,"isEditableInputOrTextArea"),t=l((o,a)=>{n({key:o,eventTarget:a})},"sendKeyEvent"),r=l(o=>(o.ctrlKey?"ctrl ":"")+(o.altKey?"alt ":"")+(o.shiftKey?"shift ":"")+(o.metaKey?"meta ":"")+o.key,"formatKeyProperties"),i=l(o=>{try{if(e(o.target))return;t(r(o),o.target)}catch{}},"onKeyUp");window.addEventListener("keyup",o=>{i(o)})},"startKeyboardObserver");var kl=class n{constructor(e=document,t){this.target=e;this.onEvent=t;this.monitoredTextElements=[];this.inputEnabledSelectors=["[contenteditable=true]"].join(",");this.iframeObservers=[];this.monitorInputEnabledElement=l(e=>{e.addEventListener("input",t=>{this.onEvent({text:t.target?.innerText,eventTarget:t.target})})},"monitorInputEnabledElement")}static{l(this,"ContendEditableObserver")}startObserver(){this.startIframesObserver(),this.observer=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE&&r.nodeType===Node.ELEMENT_NODE){let i=r;i.matches(this.inputEnabledSelectors)||i.isContentEditable?this.monitorInputEnabledElement(i):Array.from(de("*",i)).filter(o=>o.matches&&o.matches(this.inputEnabledSelectors)||o.isContentEditable).forEach(this.monitorInputEnabledElement)}})})}),this.observer.observe(this.target,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.startInputMonitoring()}startIframesObserver(){setInterval(()=>{de("iframe",this.target).forEach(t=>{if(this.iframeObservers.find(a=>a.iframe===t))return;let r=l(a=>{if(a.iframe.contentWindow)try{a.observer=new n(a.iframe.contentWindow.document,this.onEvent),a.observer.startObserver()}catch{}},"observeIframe"),i=t,o={iframe:i,observer:null};this.iframeObservers.push(o),i.contentWindow?r(o):i.addEventListener("load",()=>{r(o)})})},500)}startInputMonitoring(){this.monitoredTextElements=de(this.inputEnabledSelectors,this.target),this.monitoredTextElements.forEach(this.monitorInputEnabledElement)}};var Pl=class{constructor(e){this.onEvent=e;this.onURLChange=l(()=>{setTimeout(()=>{let e=window.location.href;if(e!==this.currentURL){this.currentURL=e;try{this.onEvent({url:e})}catch{}}})},"onURLChange")}static{l(this,"URLObserver")}start(){window.addEventListener("popstate",r=>{this.onURLChange()}),window.addEventListener("locationchange",r=>{this.onURLChange()}),window.addEventListener("hashchange",r=>{this.onURLChange()});let e=window.history.pushState;window.history.pushState=(...r)=>(this.onURLChange(),e.apply(window.history,r));let t=window.history.replaceState;window.history.replaceState=(...r)=>(this.onURLChange(),t.apply(window.history,r))}};var pn={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},LU={defaultMerge:pn.defaultMerge};function JD(n,e){return e}l(JD,"defaultMetaDataUpdater");function QD(n,e){return n.filter(t=>t!==void 0)}l(QD,"defaultFilterValues");var $S;(function(n){n[n.NOT=0]="NOT",n[n.RECORD=1]="RECORD",n[n.ARRAY=2]="ARRAY",n[n.SET=3]="SET",n[n.MAP=4]="MAP",n[n.OTHER=5]="OTHER"})($S||($S={}));function HS(n){return typeof n!="object"||n===null?0:Array.isArray(n)?2:rk(n)?1:n instanceof Set?3:n instanceof Map?4:5}l(HS,"getObjectType");function ek(n){let e=new Set;for(let t of n)for(let r of[...Object.keys(t),...Object.getOwnPropertySymbols(t)])e.add(r);return e}l(ek,"getKeys");function tk(n,e){return typeof n=="object"&&Object.prototype.propertyIsEnumerable.call(n,e)}l(tk,"objectHasProperty");function WS(n){let e=0,t=n[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(t===void 0)return{done:!0,value:void 0};let r=t.next();if(r.done===!0){e+=1,t=n[e]?.[Symbol.iterator]();continue}return{done:!1,value:r.value}}while(!0)}}}}}l(WS,"getIterableOfIterables");var BS=["[object Object]","[object Module]"];function rk(n){if(!BS.includes(Object.prototype.toString.call(n)))return!1;let{constructor:e}=n;if(e===void 0)return!0;let t=e.prototype;return!(t===null||typeof t!="object"||!BS.includes(Object.prototype.toString.call(t))||!t.hasOwnProperty("isPrototypeOf"))}l(rk,"isRecord");function nk(n,e,t){let r={};for(let i of ek(n)){let o=[];for(let f of n)tk(f,i)&&o.push(f[i]);if(o.length===0)continue;let a=e.metaDataUpdater(t,{key:i,parents:n}),u=US(o,e,a);u!==pn.skip&&(i==="__proto__"?Object.defineProperty(r,i,{value:u,configurable:!0,enumerable:!0,writable:!0}):r[i]=u)}return r}l(nk,"mergeRecords$1");function ik(n){return n.flat()}l(ik,"mergeArrays$1");function sk(n){return new Set(WS(n))}l(sk,"mergeSets$1");function ok(n){return new Map(WS(n))}l(ok,"mergeMaps$1");function ak(n){return n.at(-1)}l(ak,"mergeOthers$1");var Fl={mergeRecords:nk,mergeArrays:ik,mergeSets:sk,mergeMaps:ok,mergeOthers:ak};function VS(...n){return lk({})(...n)}l(VS,"deepmerge");function lk(n,e){let t=ck(n,r);function r(...i){return US(i,t,e)}return l(r,"customizedDeepmerge"),r}l(lk,"deepmergeCustom");function ck(n,e){return{defaultMergeFunctions:Fl,mergeFunctions:{...Fl,...Object.fromEntries(Object.entries(n).filter(([t,r])=>Object.hasOwn(Fl,t)).map(([t,r])=>r===!1?[t,Fl.mergeOthers]:[t,r]))},metaDataUpdater:n.metaDataUpdater??JD,deepmerge:e,useImplicitDefaultMerging:n.enableImplicitDefaultMerging??!1,filterValues:n.filterValues===!1?void 0:n.filterValues??QD,actions:pn}}l(ck,"getUtils");function US(n,e,t){let r=e.filterValues?.(n,t)??n;if(r.length===0)return;if(r.length===1)return ud(r,e,t);let i=HS(r[0]);if(i!==0&&i!==5){for(let o=1;o<r.length;o++)if(HS(r[o])!==i)return ud(r,e,t)}switch(i){case 1:return uk(r,e,t);case 2:return fk(r,e,t);case 3:return hk(r,e,t);case 4:return dk(r,e,t);default:return ud(r,e,t)}}l(US,"mergeUnknowns");function uk(n,e,t){let r=e.mergeFunctions.mergeRecords(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(n,e,t):r}l(uk,"mergeRecords");function fk(n,e,t){let r=e.mergeFunctions.mergeArrays(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(n):r}l(fk,"mergeArrays");function hk(n,e,t){let r=e.mergeFunctions.mergeSets(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(n):r}l(hk,"mergeSets");function dk(n,e,t){let r=e.mergeFunctions.mergeMaps(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(n):r}l(dk,"mergeMaps");function ud(n,e,t){let r=e.mergeFunctions.mergeOthers(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(n):r}l(ud,"mergeOthers");var pk={sampling:{mousemove:!1},userTriggeredOnInput:!0,maskInputOptions:{password:!1}},$l=class{constructor(e,t={}){this.eventHandler=e;this.options=t;this.logNativeMutationObserver=!1;this.stopRRWebRecording=l(()=>{},"stopRRWebRecording");this.start=l(()=>{console.log("starting with options",this.options),this.stopRRWebRecording=Zt({...this.options,emit:this.eventHandler}),this.logNativeMutationObserver&&this.selfObserve(),this.startURLObserver(),this.startKeyboardObserver(),this.startContentEditableObserver()},"start");this.stop=l(()=>{this.stopRRWebRecording()},"stop");this.startURLObserver=l(()=>{this.urlObserver=new Pl(({url:e})=>{let t={url:e};this.addCustomEvent("url-change",t)}),this.urlObserver.start()},"startURLObserver");this.startContentEditableObserver=l(()=>{this.contentEditableObserver=new kl(document,({text:e,eventTarget:t})=>{let r={text:e,id:this.tryGetMetaFromEventTarget(t)?.id};this.addCustomEvent("contenteditable-input",r)}),this.contentEditableObserver.startObserver()},"startContentEditableObserver");this.startKeyboardObserver=l(()=>{FS(({key:e,eventTarget:t})=>{let r={key:e,id:this.tryGetMetaFromEventTarget(t)?.id};this.addCustomEvent("key-stroke",r)})},"startKeyboardObserver");this.addCustomEvent=l((e,t)=>{Zt.addCustomEvent(e,t)},"addCustomEvent");this.tryGetMetaFromEventTarget=l(e=>{try{return this.getMeta(e)}catch{}},"tryGetMetaFromEventTarget");this.selfObserve=l(()=>{let e=document.getElementsByTagName("body"),t={attributes:!0,childList:!0,subtree:!0},r=l((o,a)=>{for(let u of o)u.type==="childList"?console.log("A child node has been added or removed.",u):u.type==="attributes"&&console.log(`The ${u.attributeName} attribute was modified.`,u)},"callback");new MutationObserver(r).observe(e[0],t)},"selfObserve");this.getNodeById=l(e=>Zt.mirror.getNode(e),"getNodeById");this.getMeta=l(e=>Zt.mirror.getMeta(e),"getMeta");this.eventHandler=e,this.options=VS(pk,t)}static{l(this,"SessionRecorder")}};var GS=[{selector:'path[d="M17.5 13V15.6667C17.5 16.0203 17.3361 16.3594 17.0444 16.6095C16.7527 16.8595 16.357 17 15.9444 17H5.05556C4.643 17 4.24733 16.8595 3.95561 16.6095C3.66389 16.3594 3.5 16.0203 3.5 15.6667V13"] + path[d="M14.6673 6.92057L10.5007 2.75391L6.33398 6.92057"] + path[d="M10.5 2.75391V12.7539"]',description:"export button"},{selector:'path[d="M16.0893 13.1868C16.6838 12.7754 17.1321 12.1858 17.3697 11.503C17.6072 10.8202 17.6216 10.0796 17.4107 9.38816C17.1999 8.69667 16.7748 8.09007 16.1968 7.65594C15.6187 7.2218 14.9177 6.9826 14.1948 6.97285H12.8308C12.6017 6.20011 12.1996 5.48973 11.6549 4.89565C11.1102 4.30157 10.4374 3.83943 9.68735 3.54431C8.93734 3.24918 8.12995 3.12885 7.32648 3.19244C6.52301 3.25603 5.7446 3.50187 5.05036 3.9113C4.35612 4.32072 3.7643 4.88297 3.31985 5.55533C2.8754 6.22769 2.59001 6.99248 2.48535 7.79164C2.38068 8.59079 2.4595 9.40329 2.71582 10.1674C2.97214 10.9316 3.39921 11.6272 3.96461 12.2016"] + path[d="M10.0273 10.0039V16.8241"] + path[d="M13.0585 13.0351L10.0273 10.0039L6.99609 13.0351"]',description:"import button"},{selector:'path[d="M20.4696 21.5303C20.7625 21.8232 21.2373 21.8232 21.5302 21.5303C21.8231 21.2374 21.8231 20.7626 21.5302 20.4697L20.4696 21.5303ZM17.1802 16.1197C16.8873 15.8268 16.4125 15.8268 16.1196 16.1197C15.8267 16.4126 15.8267 16.8874 16.1196 17.1803L17.1802 16.1197ZM18.25 11C18.25 15.0041 15.0041 18.25 11 18.25V19.75C15.8325 19.75 19.75 15.8325 19.75 11H18.25ZM11 18.25C6.99594 18.25 3.75 15.0041 3.75 11H2.25C2.25 15.8325 6.16751 19.75 11 19.75V18.25ZM3.75 11C3.75 6.99594 6.99594 3.75 11 3.75V2.25C6.16751 2.25 2.25 6.16751 2.25 11H3.75ZM11 3.75C15.0041 3.75 18.25 6.99594 18.25 11H19.75C19.75 6.16751 15.8325 2.25 11 2.25V3.75ZM21.5302 20.4697L17.1802 16.1197L16.1196 17.1803L20.4696 21.5303L21.5302 20.4697Z"]',description:"search"},{selector:'path[d="M3.75 10H16.875"] + path[d="M8.125 5L3.125 10L8.125 15"]',description:"back"},{selector:'path[d="M3.33301 8H12.6663"] + path[d="M8 3.33331L12.6667 7.99998L8 12.6666"]',description:"forward"},{selector:'path[d="M10 4.16667V15.8333"] + path[d="M4.16699 10H15.8337"]',description:"new or Add button"},{selector:'path[d="M10 10.75C10.4142 10.75 10.75 10.4142 10.75 10C10.75 9.58579 10.4142 9.25 10 9.25C9.58579 9.25 9.25 9.58579 9.25 10C9.25 10.4142 9.58579 10.75 10 10.75Z"] + path[d="M15.833 10.75C16.2472 10.75 16.583 10.4142 16.583 10C16.583 9.58579 16.2472 9.25 15.833 9.25C15.4188 9.25 15.083 9.58579 15.083 10C15.083 10.4142 15.4188 10.75 15.833 10.75Z"] + path[d="M4.16699 10.75C4.58121 10.75 4.91699 10.4142 4.91699 10C4.91699 9.58579 4.58121 9.25 4.16699 9.25C3.75278 9.25 3.41699 9.58579 3.41699 10C3.41699 10.4142 3.75278 10.75 4.16699 10.75Z"]',description:"open menu"},{selector:'path[d="M10 4.16667V15.8333"] + path[d="M4.16699 10H15.8337"]',description:"add filter"},{selector:'path[d="M15 5L5 15"] + path[d="M5 5L15 15"]',description:"close or remove"},{selector:'path[d="M4 6L8 10L12 6"]',description:"open or close dropdown"},{selector:'path[d="M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5Z"] + path[d="M12.5 7.5L7.5 12.5"] + path[d="M7.5 7.5L12.5 12.5"]',description:"clear input"},{selector:'path[d="M3.33301 5.49054H4.81449H16.6663"] + path[d="M7.14286 5.49999V3.99999C7.14286 3.60216 7.29337 3.22063 7.56128 2.93932C7.82919 2.65802 8.19255 2.49998 8.57143 2.49998H11.4286C11.8075 2.49998 12.1708 2.65802 12.4387 2.93932C12.7066 3.22063 12.8571 3.60216 12.8571 3.99999V5.49999M15 5.49999V16C15 16.3978 14.8495 16.7793 14.5816 17.0607C14.3137 17.342 13.9503 17.5 13.5714 17.5H6.42857C6.04969 17.5 5.68633 17.342 5.41842 17.0607C5.15051 16.7793 5 16.3978 5 16V5.49999H15Z"] + path[d="M8.33203 9.23726V13.4039"] + path[d="M11.666 9.23726V13.4039"]',description:"delete"},{selector:'path[d="M13.3334 4L6.00008 11.3333L2.66675 8"]',description:"checked"},{selector:'path[d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"]',description:"downward-pointing arrow"},{selector:'path[d="M18.0893 3.08926C18.4147 2.76382 18.4147 2.23618 18.0893 1.91074C17.7638 1.58531 17.2362 1.58531 16.9107 1.91074L18.0893 3.08926ZM9.41074 9.41074L8.82149 10L10 11.1785L10.5893 10.5893L9.41074 9.41074ZM16.9107 1.91074L9.41074 9.41074L10.5893 10.5893L18.0893 3.08926L16.9107 1.91074Z"] + path[d="M17.5 2.5L12.25 17.5L9.25 10.75L2.5 7.75L17.5 2.5Z"]',description:"send"}];var mk=5*60*1e3,Hl=class{constructor(){this.flashingTextElements=[]}static{l(this,"FlashingElementsDetector")}start(){this.stop(),this.flashingTextElements=[],this.observer=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.length>0&&t.addedNodes.forEach(r=>{r instanceof HTMLElement&&this.includeElement(r)&&setTimeout(()=>{this.flashingTextElements.push(this.processTextElements(r))},1e3)})})}),this.observer.observe(document.body,{childList:!0,subtree:!0}),this.monitoringPeriodTimeout=setTimeout(()=>{this.stop()},mk)}stop(){this.monitoringPeriodTimeout&&(clearTimeout(this.monitoringPeriodTimeout),this.monitoringPeriodTimeout=null),this.observer&&(this.observer.disconnect(),this.observer=null)}get(){let e=this.flashingTextElements.map(r=>r.filter(i=>!i.isConnected||St(i.parentElement).isHidden)).filter(r=>r.length).map(r=>`<span>${r.map(i=>i.textContent).join("</span><span>")}</span>`),t=new Set(e);return Array.from(t)}stopAndGet(){return this.stop(),this.get()}includeElement(e){return!(e.getElementsByTagName("*").length>50||e.outerHTML.length>5e3)}processTextElements(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),r,i=[];for(;r=t.nextNode();)St(r.parentNode).isHidden||i.push(r);return i}};var Ri=class{static{l(this,"AlphaNumericCounter")}constructor(e){this.counter=e??"0"}increment(){let e=this.counter.length-1;for(;e>=0;){let t=this.counter[e];if(t==="9"){this.counter=this.replaceAt(this.counter,e,"a");return}else if(t==="z"){if(this.counter=this.replaceAt(this.counter,e,"0"),e===0){this.counter="1"+this.counter;return}e--}else{this.counter=this.replaceAt(this.counter,e,String.fromCharCode(t.charCodeAt(0)+1));return}}}get(){return this.counter}incrementAndGet(){return this.increment(),this.get()}getAndIncrement(){let e=this.get();return this.increment(),e}replaceAt(e,t,r){return e.substr(0,t)+r+e.substr(t+r.length)}static compare(e,t){let r=e.length,i=t.length;if(r!==i)return r-i;for(let o=0;o<r;o++){let a=e.charCodeAt(o),u=t.charCodeAt(o);if(a!==u)return a-u}return 0}};var Ks="checksum-ignore",Wl="checksum-get-more-items",zS=20,gk=.7,Bl,jS,yk=0,qS=l((n,{forceIncludeAttribute:e,forceIncludeFileInput:t,forceIncludeElements:r,limit:i})=>{n.excludedElements?.forEach(S=>{S.removeAttribute(Ks)}),n.excludedElements=new Set;let o=n.element,a=i??Math.min(Math.ceil(o.children.length*.5),o.children.length-zS),u=l(S=>e&&(S.hasAttribute(e)||Array.from(S.querySelectorAll(`[${e}]`)).length>0)||t&&S.tagName.toLowerCase()==="input"&&S.type==="file"?!0:r.includes(S),"isForceIncluded"),f=l(S=>{let w=0;if(n.elementsToKeep.includes(S))return w;let E=fd(S);E.length>=n.attributes.length&&w++;let v=E.filter(T=>n.attributes.includes(T)).length;v===n.attributes.length?w+=3:v>0&&w++;let R=hd(S).filter(T=>n.classes.includes(T)).length;return R===n.classes.length?w+=2:R>0&&w++,w},"scoreElement"),d=Array.from(o.children).filter(S=>S.tagName===n.tagName&&!u(S)).map(S=>({element:S,score:f(S)})).sort((S,w)=>w.score-S.score),{inViewportElements:p,outOfViewportElements:g}=d.reduce((S,w)=>{let{element:E}=w;return ys(Ye(E,"Element")?E:E?.parentElement)?S.inViewportElements.push(E):S.outOfViewportElements.push(E),S},{inViewportElements:[],outOfViewportElements:[]}),y=l(S=>{for(let w of S)if(n.excludedElements.add(w),n.excludedElements.size===a)return!0},"excludeElements");return y(g)||y(p),bk(n),Array.from(n.excludedElements)},"viewportReducer");function bk(n){let{excludedElements:e,element:t}=n;e.forEach(r=>{r.setAttribute(Ks,"")}),t._getmoreitemsid||(t._getmoreitemsid="gm"+yk++),n.id=t._getmoreitemsid,t.setAttribute(Wl,n.id)}l(bk,"markTemplateElements");function fd(n){return Array.from(n.attributes).filter(e=>!e.name.startsWith("checksum")).map(e=>e.name.replace(/[0-9]/g,""))}l(fd,"mapAttributes");function hd(n){return n.className?.split(" ").filter(e=>e)??[]}l(hd,"getElementClasses");function vr(n=document.body,{nodeRepetitionsThreshold:e=zS}={}){try{return console.time("bettertemplatize"),Bl=new Set,YS(n,e),console.timeEnd("bettertemplatize"),console.log("[bettertemplatize] templates found:",Array.from(Bl)),Array.from(Bl)}catch(t){return console.error("[bettertemplatize] failed during template processing:",t.message),[]}}l(vr,"bettertemplatize");function YS(n,e){Array.from(n.children).forEach(t=>{if(t instanceof SVGElement)return;let r=t.children.length;if(r>=e){let i=Array.from(t.children),o=Math.ceil(r*gk);for(let a=0;a<r;a++){let u=0,f=i.slice(0,a);for(let d=a+1;d<r&&u+r-d>=o;d++)try{if(KS(i[a],i[d])){if(u++,u>=o){Bl.add({element:t,...jS,elementsToKeep:f});return}}else f.push(i[d])}catch{return}}}YS(t,e)})}l(YS,"traverse");var vk=.8,Sk=.5,wk=.8,Ek=5;function KS(n,e,t=1){let r,i,o=l(E=>(E&&(jS={attributes:r,classes:i,tagName:n.nodeName}),E),"response");if(n.nodeType!==e.nodeType)return o(!1);if(n instanceof SVGElement&&e instanceof SVGElement||n.nodeType===Node.TEXT_NODE)return o(!0);if(n.nodeType!==Node.ELEMENT_NODE)return o(!1);let a=n,u=e;if(a.tagName.toLowerCase()!==u.tagName.toLowerCase())return o(!1);let f=fd(a),d=fd(u);if(r=f.filter(E=>d.includes(E)),r.length/Math.max(f.length,d.length)<vk)return o(!1);let p=hd(a),g=hd(u);if(i=p.filter(E=>g.includes(E)),i.length/Math.max(p.length,g.length)<Sk)return o(!1);if(t>=Ek)return o(!0);if(a.shadowRoot&&!u.shadowRoot||!a.shadowRoot&&u.shadowRoot)return o(!1);let y=Array.from(a.shadowRoot?a.shadowRoot.children:a.children),S=Array.from(u.shadowRoot?u.shadowRoot.children:u.children);if(y.length===0&&S.length===0)return o(!0);let w=0;for(let E=0;E<Math.min(y.length,S.length);E++)KS(y[E],S[E],t+1)&&w++;return w/Math.max(y.length,S.length)<wk?o(!1):o(!0)}l(KS,"areSimilar");var XS=16e3;var xk=!0,dd={markTransparentElementsAsHidden:!1,markElementsHiddenByTransparentElementAsVisible:!0},Vl=class{constructor(){this.checksumIdToRRwebIdMap={};this.flashingElementsDetector=new Hl;this.forceIncludeElements=[];this.preMapReducedHTMLSelectors=!1;this.useRrwebIdsAsChecksumIds=!1;this.excludedNodes=0;this.reducePercentage=50;this.scrollableElements={};this.defaultReduceHTMLOptions={checkElementInstanceType:!0,extraAllowedAttributes:[],initialChecksumId:void 0,forceIncludeFileInput:!1,forceIncludeAttribute:void 0,invalidateCache:!1,svgIntegration:"aria-label",includeFlashingElements:!0,onForceIncludeElement:l(()=>{},"onForceIncludeElement"),limitNodeRepetitions:50,stopFlashingElementsDetection:!1,assignChecksumIdsToAllElements:!0,assignRrwebIdsToAllElements:!0,fromTimeMachine:!1}}static{l(this,"HTMLReducer")}preprocessDocument(e=document){on("[preprocessDocument] querySelectorAllExtended");let t=de("*",e,{includeHTML:!0});an("[preprocessDocument] querySelectorAllExtended"),on("[preprocessDocument] isElementHidden");for(let r of t){if(this.shouldIgnoreElement(r))continue;let i=St(r,dd);r.setAttribute("checksum-data-visible",!i.isHidden&&!i.isTransparent?"true":"false"),!i.isHidden&&i.isTransparent&&r.setAttribute("checksum-data-transparently-visible","true"),i.isBehindTransparentElement&&r.setAttribute("checksum-data-visible-under-transparent-element","true"),i.clickOffset&&r.setAttribute("checksum-data-click-offset",`${i.clickOffset.x};${i.clickOffset.y}`),this.markScrollableElement(r)}an("[preprocessDocument] isElementHidden")}markScrollableElement(e){let{canScrollX:t,canScrollY:r,progressX:i,progressY:o}=mt.getScrollData(e);if(t&&(e.setAttribute("data-scrollable-x","true"),e.setAttribute("data-scrollable-x-progress",i.toString())),r&&(e.setAttribute("data-scrollable-y","true"),e.setAttribute("data-scrollable-y-progress",o.toString())),t||r)try{let{id:a}=this.getSessionMirror().getMeta(e);a&&(this.scrollableElements[a]={x:t?i:void 0,y:r?o:void 0})}catch(a){console.error("[markScrollableElement] Error getting rrwebId and updating scrollable elements",e,a)}}setSessionRecorder(e){this.sessionRecorder=e}markInteractableElements(e,t=document,{forceIncludeAttribute:r,forceIncludeFileInput:i}={}){on("[markInteractableElements]"),this.interactableElements=[];let o=Nn(t,e,{allowDisabled:!0,excludeCrossOriginIframes:!1}),a=l((d,p)=>(d._checksumid||(d._checksumid=p??this.checksumIdCounter.getAndIncrement()),d.setAttribute("checksumid",d._checksumid),d.setAttribute("checksuminteractable","true"),d._checksumid),"setChecksumIdForElement"),u=l((d,p=!1,g)=>{if(this.shouldIgnoreElement(d))return;let y=d.getAttribute("checksum-data-click-offset")?.split(";"),S=y&&{x:parseInt(y[0]),y:parseInt(y[1])},w=a(d,g);this.interactableElements.push({checksumId:w,element:d,forced:p,clickOffset:S})},"handleInteractableElement");o.forEach(d=>u(d));let f=l(d=>{de(d,t,{includeHTML:!0}).forEach(p=>u(p,!0))},"forceIncludeSelector");r&&f(`[${r}]`),i&&f("input[type='file']"),this.forceIncludeElements.filter(({element:d})=>d?.isConnected).forEach(({element:d,checksumid:p})=>u(d,!0,p)),console.log(`Marked ${this.interactableElements.length} interactable elements`),an("[markInteractableElements]")}truthyFilter(e){return!!e}shouldIgnoreElement(e){return e.hasAttribute(Ks)}getSessionMirror(e=!1){return e?window.checksum.timeMachine.sessionReplayer:this.sessionRecorder}generateSimplifiedDom(e,t,{extraAllowedAttributes:r=[],checkElementInstanceType:i=!0,forceIncludeAttribute:o=void 0,forceIncludeFileInput:a=!1,svgIntegration:u="aria-label",onForceIncludeElement:f=void 0,contentWindow:d=window,assignChecksumIdsToAllElements:p=!0,assignRrwebIdsToAllElements:g=!0,fromTimeMachine:y=!1}={}){if(!e)return null;let S=l((me,dt=me)=>{if(me._originalNode=dt,!Ye(me,"Element")||!Ye(dt,"Element"))return me;let ut=me,st=dt;if(p&&!st.hasAttribute("checksumid")&&(st._checksumid||(st._checksumid=this.checksumIdCounter.getAndIncrement()),ut.setAttribute("checksumid",st._checksumid),this.nonInteractableElementsFromSimplifiedDom.push({checksumId:st._checksumid,element:st})),g){let vn=this.getSessionMirror(y);if(vn){let Vt=vn.getMeta(st)?.id?.toString();Vt&&(ut.setAttribute("rrwebid",Vt),this.useRrwebIdsAsChecksumIds&&(ut.setAttribute("checksumid",Vt),ut._checksumid=Vt))}}return this.checksumIdToRRwebIdMap[st._checksumid]=parseInt(st._rrwebid),me},"processSimplifiedDOMNode"),w=l((me,dt=e)=>S(document.createTextNode(me),dt),"createTextNode"),E=l((me,dt=e)=>S(document.createElement(me),dt),"createElementNode");if(e.nodeType===Node.ELEMENT_NODE){let me=e;if(me.tagName.toLowerCase()==="head"||this.shouldIgnoreElement(me))return null}if(e.nodeType===Node.TEXT_NODE)return!e.parentElement||e.parentElement.getAttribute("checksum-data-visible")==="false"&&!e.parentElement.hasAttribute("checksumid")||e.parentElement.tagName.toLowerCase()==="body"?null:e.textContent?.trim()?w(e.textContent+" "):null;if(e.nodeType!==Node.ELEMENT_NODE||i&&!(Ye(e,"HTMLElement")||Ye(e,"SVGElement")))return null;let v=e,M=v.tagName.toLowerCase()==="iframe"&&v.contentDocument,R=ii(M?v.contentDocument.documentElement:v,{flattenShadowRootChildren:!0});t.esraSelectionRules?.limitChildren?.forEach(me=>{v.matches(me.selector)&&R.length>me.limit&&R.splice(me.limit)});let T=R.map(me=>this.generateSimplifiedDom(me,t,{extraAllowedAttributes:r,checkElementInstanceType:i,forceIncludeAttribute:o,forceIncludeFileInput:a,svgIntegration:u,onForceIncludeElement:f,contentWindow:M?v.contentWindow:d,assignChecksumIdsToAllElements:p,assignRrwebIdsToAllElements:g,fromTimeMachine:y})).filter(this.truthyFilter),N=v.getAttribute("checksum-data-visible")!=="false",U=v.hasAttribute("checksumid"),G=v.hasAttribute("role"),{customDescription:Q,customDescriptionTarget:W}=this.getElementCustomDescription(v,{enableSVGCustomDescription:!!u}),z=!!Q,re=v.hasAttribute("aria-label")||v.hasAttribute("name")||v.hasAttribute("alt"),B=v.hasAttribute(Wl)||this.forceIncludeElements.map(me=>me.element).includes(v)||!!o&&v.hasAttribute(o)||a&&v.tagName.toLowerCase()==="input"&&v.getAttribute("type")==="file",q=["form","button","input","textarea","a","table","th","tr","td","section","nav","header","footer","main","article","aside","li","ul","select","option","datalist"],k=U||N&&(G||re||z||v.matches(q.join(",")));if(!(k||B)){if(!T.length)return null;if(T.length===1&&!Ye(T[0],"Text"))return T[0]}!k&&B&&f?.(v);let X=l(()=>{if(z)switch(W){case"svg":switch(u){case"aria-label":let dt=E("svg");return dt.setAttribute("aria-label",Q),{simplifiedNode:dt,appendChildren:!1};case"text":if(v.hasAttribute("checksumid")){let st=E("div");return st.innerText=Q,{simplifiedNode:st,appendChildren:!1}}return{simplifiedNode:w(` [${Q}] `),appendChildren:!1}}}let me=v.tagName.toLowerCase()==="body"&&v.ownerDocument!==document?"div":v.tagName;return{simplifiedNode:E(me)}},"makeSimplifiedNode"),{simplifiedNode:Y,appendChildren:fe=!0}=X();if(!Ye(Y,"Element"))return Y;let Ae=Y,xe=["aria-.+","data-name","name","type","placeholder","content","value","role","icon","title","checksumid","checksuminteractable","checksum-get-more-items","checked","disabled","selected","label","required","inputmode","min","max","step","minlength","maxlength","alt","hidden","draggable","ondrop","ondragover","contenteditable","href","(data-)?test(-)?id"].concat(r),Cr=v.attributes;for(let me of Cr)for(let dt of xe)new RegExp("^"+dt+"$").test(me.name)&&Ae.setAttribute(me.name,me.value??!0);if(v.isContentEditable?Ae.setAttribute("contenteditable","true"):!["TEXTAREA","INPUT","SELECT"].includes(v.tagName)&&window.getComputedStyle(v).cursor==="text"&&Ae.setAttribute("contenteditable","cursor-text"),Ye(v,"HTMLInputElement")&&v.getAttribute("type")==="checkbox")v.checked&&Ae.setAttribute("checked","true");else if(Ye(v,"HTMLInputElement")||Ye(v,"HTMLSelectElement"))Ae.setAttribute("value",v.value);else if(Ye(v,"HTMLTextAreaElement")&&!v.childNodes.length&&v.value){let me=w(v.value);Ae.appendChild(me)}return fe&&T.forEach(me=>Ae.appendChild(me)),Ae}getElementCustomDescription(e,{enableSVGCustomDescription:t=!0}={}){return(Ye(e,"SVGElement")||e.tagName.toLowerCase()==="svg")&&t?{customDescriptionTarget:"svg",customDescription:this.getSVGDescriptionForElement(e)}:{}}getSVGDescriptionForElement(e){let t=this.findSvgElementDescriptionFromBank(e);if(t)return t;let r=e.querySelector("title");if(r)return r.textContent}findSvgElementDescriptionFromBank(e){return this.getSvgBank().find(t=>e.matches(`svg:has(${t.selector})`))?.description}getSvgBank(){return GS}restoreDom(e=document){de("*",e).forEach(r=>{r.removeAttribute("checksum-data-visible"),r.removeAttribute("checksum-data-transparently-visible"),r.removeAttribute("checksum-data-visible-under-transparent-element"),r.removeAttribute("checksumid"),r.removeAttribute("checksuminteractable"),r.removeAttribute("checksum-data-click-offset"),r.removeAttribute(Ks),r.removeAttribute(Wl),r.removeAttribute("data-scrollable-x"),r.removeAttribute("data-scrollable-y"),r.removeAttribute("data-scrollable-x-progress"),r.removeAttribute("data-scrollable-y-progress"),r.removeAttribute("rrwebid")})}removeAttribute(e){de("*",document).forEach(r=>{r.removeAttribute(e)})}async mapAndStoreSelectors(){let e={},t=new Tt;for(let{checksumId:r,element:i,clickOffset:o,selector:a,locator:u,parentFramesSelectors:f}of await t.injectSelectorsAndLocators(this.interactableElementsFromSimplifiedDom)){if(!a){console.warn("Unable to get selector for element",i);continue}let d=i;e[r]={element:d,selector:a,locator:u,clickOffset:o,parentFramesSelectors:f,innerText:d.innerText,rrwebId:this.checksumIdToRRwebIdMap[r]}}return e}shouldFurtherReduce(e){return e?e.outerHTML.length>XS:!0}async reduce(e=document,t,r={}){console.time("reduceHTML");let{initialChecksumId:i,forceIncludeAttribute:o,forceIncludeFileInput:a,invalidateCache:u,includeFlashingElements:f,limitNodeRepetitions:d,stopFlashingElementsDetection:p}=this.lastReduceHTMLOptions={...this.defaultReduceHTMLOptions,...r},g=_t.getInstance("reduce",{target:e,monitorInput:!0,invalidate:u,log:!1});if(g.hasCache())return g.get();let y=f?this.flashingElementsDetector.get():void 0;p&&this.flashingElementsDetector.stop(),this.nodeRepetitionsThreshold=d,this.reducePercentage=50,this.templateNodes=void 0,this.excludedNodes=0,this.scrollableElements={};let S=l(M=>qS(M,{forceIncludeAttribute:o,forceIncludeFileInput:a,forceIncludeElements:this.forceIncludeElements.map(R=>R.element),limit:Math.min(Math.ceil(M.element.children.length*(this.reducePercentage/100)),M.element.children.length-6)}),"templateReducer");console.log("Running pre-templatize"),this.templatize(S),console.log("Preprocessing document..."),this.preprocessDocument(e);let w;for((i||!this.checksumIdCounter)&&(this.checksumIdCounter=new Ri(i??"0")),console.log("Marking interactable elements..."),this.markInteractableElements(t,e,{forceIncludeAttribute:o,forceIncludeFileInput:a});;){if(console.log("Generating simplified DOM..."),this.nonInteractableElementsFromSimplifiedDom=[],w=this.generateSimplifiedDom(e.documentElement,t,this.lastReduceHTMLOptions),!w)throw new Error("Unable to get simplified DOM");if(this.shouldFurtherReduce(w)){if(console.log(`Will further reduce (${w.outerHTML.length})...`),!this.templatize(S)){console.log(`Exceeded maximum html reduction, stopping (html size: ${w.outerHTML.length})`);break}}else break}console.log("Simplified DOM generated, length:",w.outerHTML.length);let E=new Set(Array.from(w.querySelectorAll("[checksumid]")).map(M=>M.getAttribute("checksumid")));this.interactableElementsFromSimplifiedDom=this.interactableElements.filter(M=>E.has(M.checksumId)),console.log(`Found ${this.interactableElementsFromSimplifiedDom.length} interactable elements in simplified DOM vs ${this.interactableElements.length} in original DOM`),console.log("Restoring DOM..."),this.restoreDom(e),this.preMapReducedHTMLSelectors=xk?!1:!!t.preMapReducedHTMLSelectors,this.preMapReducedHTMLSelectors?(console.log("Mapping selectors..."),this.selectors=await this.mapAndStoreSelectors(),console.log("Done mapping selectors")):this.selectors={},this.elementsInSimplifiedDomByChecksumId=[...this.interactableElementsFromSimplifiedDom,...this.nonInteractableElementsFromSimplifiedDom].reduce((M,R)=>(M[R.checksumId]=R,M),{});let v={reducedDomHTMLElement:w,reducedHTML:w.outerHTML,currentChecksumId:this.checksumIdCounter.get(),flashingHTML:y,scrollableElements:this.scrollableElements};return g.set(v),console.timeEnd("reduceHTML"),v}templatize(e){let t=this.excludedNodes,r=l(()=>Array.from(this.templateNodes).reduce((i,o)=>i+e(o).length,0),"calcExculdedNodes");if(!this.templateNodes)this.templateNodes=vr(document.body,{nodeRepetitionsThreshold:this.nodeRepetitionsThreshold}),this.excludedNodes=r();else do{if(this.reducePercentage<98)this.reducePercentage=Math.min(this.reducePercentage+20,98),console.log("Increasing reduce percentage to",this.reducePercentage);else{if(this.nodeRepetitionsThreshold<=20)return!1;this.reducePercentage=50,this.nodeRepetitionsThreshold-=10,console.log("Reducing node repetitions threshold to",this.nodeRepetitionsThreshold),this.templateNodes=vr(document.body,{nodeRepetitionsThreshold:this.nodeRepetitionsThreshold})}this.excludedNodes=r()}while(t===this.excludedNodes);return console.log(`[templatize] ${this.excludedNodes} elements marked to ignore for ${this.templateNodes.length} templates`),!0}getMoreElementsFromTemplate(e,t){try{let r=this.templateNodes.find(d=>d.id===e);if(!r)throw new Error("Template not found");let{element:i,excludedElements:o}=r;console.log("Preprocessing template node..."),this.preprocessDocument(i),console.log("Marking template interactable elements..."),this.markInteractableElements(t,i,this.lastReduceHTMLOptions);let a=[],u=l(()=>a.map(d=>d.outerHTML).join(""),"getElementsHTML"),f=o.values();for(;u().length<XS*.5;){let d=f.next().value;if(!d)break;let p=Array.from(d.querySelectorAll("[checksumid]")).concat(d._checksumid?[d]:[]);this.interactableElements.filter(g=>p.includes(g.element)).forEach(g=>{this.elementsInSimplifiedDomByChecksumId[g.element._checksumid]=g}),a.push(this.generateSimplifiedDom(d,t,this.lastReduceHTMLOptions)),o.delete(d)}return this.restoreDom(i),{items:u(),hasMoreItems:o.size>0}}catch(r){console.error("[getMoreElementsFromTemplate] error",r);return}}async getSelectorForChecksumId(e,{forceGenerate:t=!1}={}){let r=l(d=>({selector:e,element:d?d.element:null,locator:"",parentFramesSelectors:[],invalid:!0,rrwebId:this.checksumIdToRRwebIdMap[e],clickOffset:d?.clickOffset,innerText:d?d.element.innerText:""}),"makeDefaultResult"),i=new Tt,o=this.elementsInSimplifiedDomByChecksumId[e];if(!o||!o.element.isConnected)return this.preMapReducedHTMLSelectors&&this.selectors[e]?this.selectors[e]:r(o);let{selector:a,locator:u,parentFramesSelectors:f}=await i.getSelectorAndLocator(o.element);return{...r(o),selector:a,locator:u,parentFramesSelectors:f,invalid:!1}}getElementForChecksumId(e){return this.elementsInSimplifiedDomByChecksumId[e]?.element}hasInnerTextByChecksumId(e,{maxLength:t=void 0,minLength:r=void 0}={}){if(!this.preMapReducedHTMLSelectors){let o=this.elementsInSimplifiedDomByChecksumId[e]?.element?.innerText;return!(!o||r&&o.length<r||t&&o.length>t)}return!!this.selectors[e]?.innerText}getInteractableElements(){return this.interactableElements}getInteractableElementsInReducedHTML(){return this.interactableElementsFromSimplifiedDom}startFlashingElementsDetection(){return this.flashingElementsDetector.start()}addForceIncludeElement(e){this.forceIncludeElements.push(e),e.element._checksumid=e.checksumid}};function JS(n){return n._debugSource?.fileName?n._debugSource?.fileName:""}l(JS,"getComponentpath");function ZS(n,e){if(n==="Unknown"||typeof n!="string"||n[0]!==n[0].toUpperCase()||e.type.$$typeof===Symbol.for("react.context")||e.type.$$typeof===Symbol.for("react.forward_ref")||e.type.$$typeof===Symbol.for("react.memo")||e.type.$$typeof===Symbol.for("react.profiler")||e.type.$$typeof===Symbol.for("react.suspense"))return!1;let t=JS(e);return!(/.*\/node_modules\//.test(t)||n===t||/^(?!.*src).*$/.test(t))}l(ZS,"isComponentAllowed");function pd(n,e={}){if(!n)return["",{}];let t=n.type,r=t?t.name||t:"Unknown",i="";if(ZS(r,n)){i+=`<${r}>`;let o=JS(n);e[r]=o}if(n.child){let[o,a]=pd(n.child,e);i+=o,e={...e,...a}}if(ZS(r,n)&&(i+=`</${r}>`),n.sibling){let[o,a]=pd(n.sibling,e);i+=o,e={...e,...a}}return[i,e]}l(pd,"traverseReactTree");function QS(n){let e=n._reactRootContainer?._internalRoot.current;return e||console.log("No react tree in element",n),pd(e)}l(QS,"getReactTree");var Oi=class n{static{l(this,"FrontendLogger")}static{this.overriddenMethods=["log","warn","error"]}static{this.original={}}static removePrefix(){this.overriddenMethods.forEach(e=>{n.original[e]&&(console[e]=n.original[e])})}static setPrefix(e){this.overriddenMethods.forEach(t=>{n.original[t]||(n.original[t]=console[t]),console[t]=(...r)=>{r.unshift(e),n.original[t].apply(console,r)}})}};var Ul=class{constructor(e=i=>i.map(o=>o.target),t={childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0},r={collectElement:!0}){this.filterElements=e;this.observeOptions=t;this.options=r;this.mutationEventListeners=[]}static{l(this,"MutationDetector")}addEventListener(e,t){this.mutationEventListeners.push({selector:e,listener:t})}startListening(){this.elements=[],this.observer=new MutationObserver(e=>{this.options.collectElement&&(this.elements=[...this.elements,...this.filterElements(e)]),this.mutationEventListeners.length&&e.forEach(t=>{t.addedNodes.forEach(r=>{if(r.nodeType!==Node.ELEMENT_NODE)return;let i=r;this.mutationEventListeners.forEach(o=>{i.matches(o.selector)?o.listener(i):i.querySelectorAll(o.selector).forEach(a=>{o.listener(a)})})})})}),this.observer.observe(document.body,this.observeOptions)}stopListening(){return this.observer.disconnect(),this.elements}};function ew(n){let e=n.filter(r=>r.addedNodes.length>0).reduce((r,i)=>[...r,...i.addedNodes],[]),t=n.filter(r=>r.type==="attributes"&&r.attributeName==="style"&&r.target instanceof HTMLElement&&/display\s*:\s*none/.test(r.oldValue)&&fa(r.target).visible).map(r=>r.target);return[...e,...t]}l(ew,"poppingElementsFilter");function Ck(n,e){let t=new Set;for(;n;)t.add(n),n=n.parentNode;for(;e;){if(t.has(e))return e;e=e.parentNode}return null}l(Ck,"findCommonAncestor");function md(n,e){let t=Ck(n,e),r=0,i;if(!t)return 99999;for(i=n;i&&i!==t;)r++,i=i.parentNode;for(i=e;i&&i!==t;)r++,i=i.parentNode;return r}l(md,"distanceBetweenNodes");var gd=class{constructor(){this.lastHighlights=[]}static{l(this,"ElementHighlighter")}clearHighlights(){this.lastHighlights.length&&(this.lastHighlights.forEach(e=>e.remove()),this.lastHighlights=[])}highlightElement(e,{highlightStyle:t={},textStyle:r={},mousePosition:i,text:o,textType:a="static",textPosition:u="overlap",textWidthType:f="rect",clear:d=!0,shouldFlipHighlightTextOutsideViewport:p=!0,pointerEvents:g,classNames:y=[],renderDocument:S,scroll:w=!1}={}){if(d&&this.clearHighlights(),!e)return;let E={left:0,top:0,right:0,bottom:0},v=1,M=1;if(S!==e.ownerDocument){let z=e.ownerDocument.defaultView?.frameElement;for(;z&&z.contentDocument!==S;){let re=z.getBoundingClientRect(),B=this.getScaleFromStyles(z);v*=B.scaleX,M*=B.scaleY,E.left+=re.left,E.top+=re.top,z=z.ownerDocument.defaultView?.frameElement}}let R=S??e.ownerDocument,T=pf(e),N=e.getBoundingClientRect(),U={top:N.top*M+E.top,left:N.left*v+E.left};if(!T){let z=R.defaultView?.scrollX||0,re=R.defaultView?.scrollY||0;U.left+=z,U.top+=re}let G=R.createElement("div");if(G.style.outline="2px dashed rgba(255,0,0,.75)",G.style.position=T?"fixed":"absolute",G.style.left=U.left+"px",G.style.top=U.top+"px",G.style.width=N.width*v+"px",G.style.height=N.height*M+"px",G.style.pointerEvents=g??"none",G.style.zIndex="2147483647",G.className=["checksum-dom-cache-ignore",...y].join(" "),this.mergeStyle(G,t),i){let z=R.createElement("div");if(z.style.position="absolute",z.style.left=+i.x-16+"px",z.style.top=+i.y-16+"px",z.style.color="#004DFF",z.className=["checksum-dom-cache-ignore","mouse-cross",...y].join(" "),z.style.zIndex="2147483648",!R.head.querySelector("style[role=mouse-location]")){var Q=R.head.appendChild(R.createElement("style"));Q.setAttribute("role","mouse-location"),Q.innerHTML=".mouse-cross:before, .mouse-cross:after {position: absolute;left: 15px;content: ' ';height: 33px;width: 3px;background-color: #004DFF;}.mouse-cross:before {transform: rotate(0deg);}.mouse-cross:after {transform: rotate(-90deg);}"}R.body.appendChild(z),this.lastHighlights.push(z)}let W=R.createElement("div");o&&(W.className=["checksum-dom-cache-ignore",...y].join(" "),W.innerText=o,W.style.fontSize="12px",W.style.width=f==="rect"?`${N.width}px`:"auto",W.style.background="#000000a1",W.style.color="white",W.style.padding="5px",W.style.position="absolute",W.style.pointerEvents="none",W.style.userSelect="none",u==="above"?W.style.bottom=`${N.height}px`:u==="below"&&(W.style.top=`${N.height}px`),this.mergeStyle(W,r),G.appendChild(W),G.style.pointerEvents=g??"none",a==="hover"&&(W.style.display="none",G.addEventListener("mouseover",()=>{W.style.display="block"}),G.addEventListener("mouseout",()=>{W.style.display="none"}))),R.body.appendChild(G),u==="above"&&mf(W)>0?(W.style.bottom="initial",W.style.top=`${N.height}px`):u==="below"&&gf(W)>0&&(W.style.top="initial",W.style.bottom=`${N.height}px`),this.lastHighlights.push(G),p&&this.flipHighlightTextPositionOutsideViewport(W,u,N.height),w&&new mt(e).scrollIntoView()}getScaleFromStyles(e){let t=window.getComputedStyle(e),r=t.transform;if(r.startsWith("matrix")){let i=parseFloat(r.split(",")[0].replace("matrix(",""))||1,o=parseFloat(r.split(",")[3])||1;return{scaleX:i,scaleY:o}}else if(t.scale){let i=parseFloat(t.scale)||1,o=parseFloat(t.scale)||1;return{scaleX:i,scaleY:o}}return{scaleX:1,scaleY:1}}mergeStyle(e,t){for(let r in t)e.style[r]=t[r]}flipHighlightTextPositionOutsideViewport(e,t,r){t==="above"&&mf(e)>0?(e.style.bottom="initial",e.style.top=`${r}px`):t==="below"&&gf(e)>0&&(e.style.top="initial",e.style.bottom=`${r}px`)}},Vr=new gd;function Gl(n,e){return typeof n!="string"?tw(n):`${JSON.stringify(n)}${e?"s":"i"}`}l(Gl,"escapeForTextSelector");function zl(n,e=!1){return typeof n!="string"?tw(n):`"${n.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${e?"s":"i"}`}l(zl,"escapeForAttributeSelector");function tw(n){return n.unicode||n.unicodeSets?String(n):String(n).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}l(tw,"escapeRegexForSelector");var Mk=10,Ni=Mk/2;var Tk=100,Ik=120,Ak=140,Rk=160,Ok=180,Lk=200;var N3=Tk+Ni,_3=Ik+Ni,D3=Ak+Ni,k3=Rk+Ni,P3=Ok+Ni,F3=Lk+Ni;function Li(n){let e={full:"",immediate:[]};if(!Nk(n)){let t="";if(n instanceof HTMLInputElement&&(n.type==="submit"||n.type==="button"))e={full:n.value,immediate:[n.value]};else{for(let r=n.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE?(e.full+=r.nodeValue||"",t+=r.nodeValue||""):(t&&e.immediate.push(t),t="",r.nodeType===Node.ELEMENT_NODE&&(e.full+=Li(r).full));t&&e.immediate.push(t),n.shadowRoot&&(e.full+=Li(n.shadowRoot).full)}}return e}l(Li,"elementText");function jl(n){return n.replace(/\u200b/g,"").trim().replace(/\s+/g," ")}l(jl,"normalizeWhiteSpace");function Nk(n){let e=n.ownerDocument;return n.nodeName==="SCRIPT"||n.nodeName==="NOSCRIPT"||n.nodeName==="STYLE"||e.head&&e.head.contains(n)}l(Nk,"shouldSkipForTextMatching");function Xs(n){return n.trim().replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}l(Xs,"escapeSelector");function Ur(n){let e=n.ownerDocument.defaultView;return e!==window&&!e.playwright&&(e.playwright=window.playwright),e.playwright}l(Ur,"getElementWindowPlaywright");var ql=["role","aria-label","aria-labelledby","aria-checked","checked","placeholder","title","alt","id","data-testid","data-test-id","data-test","class","id","style","href","src","path","type"];function _i(n){return typeof n=="object"&&n!==null&&n.nodeType===Node.ELEMENT_NODE}l(_i,"isElement");var Bn={NONE:"",DESCENDANT:" ",CHILD:" > "},$e={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function rw(n,e){return Object.values(n).includes(e)}l(rw,"isEnumValue");var _k="CssSelectorGenerator";function Di(n="unknown problem",...e){console.warn(`${_k}: ${n}`,...e)}l(Di,"showWarning");var Dk={selectors:[$e.id,$e.class,$e.tag,$e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function kk(n){return Array.isArray(n)?n.filter(e=>rw($e,e)):[]}l(kk,"sanitizeSelectorTypes");function yd(n){return n instanceof RegExp}l(yd,"isRegExp");function Pk(n){return["string","function"].includes(typeof n)||yd(n)}l(Pk,"isCssSelectorMatch");function nw(n){return Array.isArray(n)?n.filter(Pk):[]}l(nw,"sanitizeCssSelectorMatchList");function Fk(n){return n instanceof Node}l(Fk,"isNode");function iw(n){let e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return Fk(n)&&e.includes(n.nodeType)}l(iw,"isParentNode");function bd(n,e){if(iw(n))return n.contains(e)||Di("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),n;let t=e.getRootNode({composed:!1});return iw(t)?(t!==document&&Di("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),t):Zs(e)}l(bd,"sanitizeRoot");function sw(n){return typeof n=="number"?n:Number.POSITIVE_INFINITY}l(sw,"sanitizeMaxNumber");function ow(n,e={}){let t=Object.assign(Object.assign({},Dk),e);return{selectors:kk(t.selectors),whitelist:nw(t.whitelist),blacklist:nw(t.blacklist),root:bd(t.root,n),combineWithinSelector:!!t.combineWithinSelector,combineBetweenSelectors:!!t.combineBetweenSelectors,includeTag:!!t.includeTag,maxCombinations:sw(t.maxCombinations),maxCandidates:sw(t.maxCandidates)}}l(ow,"sanitizeOptions");function Sr(n=[]){let[e=[],...t]=n;return t.length===0?e:t.reduce((r,i)=>r.filter(o=>i.includes(o)),e)}l(Sr,"getIntersection");function Yl(n){return[].concat(...n)}l(Yl,"flattenArray");function $k(n){return n.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")}l($k,"wildcardToRegExp");function Js(n){let e=n.map(t=>{if(yd(t))return r=>t.test(r);if(typeof t=="function")return r=>{let i=t(r);return typeof i!="boolean"?(Di("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):i};if(typeof t=="string"){let r=new RegExp("^"+$k(t)+"$");return i=>r.test(i)}return Di("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(r=>r(t))}l(Js,"createPatternMatcher");function ki(n,e,t){let r=Array.from(bd(t,n[0]).querySelectorAll(e));return r.length===n.length&&n.every(i=>r.includes(i))}l(ki,"testSelector");function vd(n,e){e=e??Zs(n);let t=[],r=n;for(;_i(r)&&r!==e;)t.push(r),r=r.parentElement;return t}l(vd,"getElementParents");function aw(n,e){return Sr(n.map(t=>vd(t,e)))}l(aw,"getParents");function Zs(n){return n.ownerDocument.querySelector(":root")}l(Zs,"getRootNode");var Kl=", ",lw=new RegExp(["^$","\\s"].join("|")),cw=new RegExp(["^$"].join("|")),Xl=[$e.nthoftype,$e.tag,$e.id,$e.class,$e.attribute,$e.nthchild];var Hk=Js(["class","id","ng-*"]);function Bk({name:n}){return`[${n}]`}l(Bk,"attributeNodeToSimplifiedSelector");function Wk({name:n,value:e}){return`[${n}='${e}']`}l(Wk,"attributeNodeToSelector");function Vk({nodeName:n,nodeValue:e},t){let r=t.tagName.toLowerCase();return["input","option"].includes(r)&&n==="value"||n==="src"&&e?.startsWith("data:")?!1:!Hk(n)}l(Vk,"isValidAttributeNode");function Uk({nodeName:n,nodeValue:e}){return{name:Gr(n),value:Gr(e??void 0)}}l(Uk,"sanitizeAttributeData");function Sd(n){let e=Array.from(n.attributes).filter(t=>Vk(t,n)).map(Uk);return[...e.map(Bk),...e.map(Wk)]}l(Sd,"getElementAttributeSelectors");function uw(n){let e=n.map(Sd);return Sr(e)}l(uw,"getAttributeSelectors");function wd(n){var e;return((e=n.getAttribute("class"))!==null&&e!==void 0?e:"").trim().split(/\s+/).filter(t=>!cw.test(t)).map(t=>`.${Gr(t)}`)}l(wd,"getElementClassSelectors");function fw(n){let e=n.map(wd);return Sr(e)}l(fw,"getClassSelectors");function Ed(n){var e;let t=(e=n.getAttribute("id"))!==null&&e!==void 0?e:"",r=`#${Gr(t)}`,i=n.getRootNode({composed:!1});return!lw.test(t)&&ki([n],r,i)?[r]:[]}l(Ed,"getElementIdSelectors");function hw(n){return n.length===0||n.length>1?[]:Ed(n[0])}l(hw,"getIdSelector");function xd(n){let e=n.parentNode;if(e){let r=Array.from(e.childNodes).filter(_i).indexOf(n);if(r>-1)return[`:nth-child(${String(r+1)})`]}return[]}l(xd,"getElementNthChildSelector");function dw(n){return Sr(n.map(xd))}l(dw,"getNthChildSelector");function Cd(n){return[Gr(n.tagName.toLowerCase())]}l(Cd,"getElementTagSelectors");function Zl(n){let e=[...new Set(Yl(n.map(Cd)))];return e.length===0||e.length>1?[]:[e[0]]}l(Zl,"getTagSelector");function Md(n){let e=Zl([n])[0],t=n.parentElement;if(t){let i=Array.from(t.children).filter(o=>o.tagName.toLowerCase()===e).indexOf(n);if(i>-1)return[`${e}:nth-of-type(${String(i+1)})`]}return[]}l(Md,"getElementNthOfTypeSelector");function pw(n){return Sr(n.map(Md))}l(pw,"getNthOfTypeSelector");function*Gk(n=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let t=0,r=Td(1);for(;r.length<=n.length&&t<e;)t+=1,yield r.map(o=>n[o]),r=zk(r,n.length-1)}l(Gk,"powerSetGenerator");function Id(n=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Gk(n,{maxResults:e}))}l(Id,"getPowerSet");function zk(n=[],e=0){let t=n.length;if(t===0)return[];let r=[...n];r[t-1]+=1;for(let i=t-1;i>=0;i--)if(r[i]>e){if(i===0)return Td(t+1);r[i-1]++,r[i]=r[i-1]+1}return r[t-1]>e?Td(t+1):r}l(zk,"bumpOffsets");function Td(n=1){return Array.from(Array(n).keys())}l(Td,"generateOffsets");function mw(n={}){let e=[];return Object.entries(n).forEach(([t,r])=>{e=r.flatMap(i=>e.length===0?[{[t]:i}]:e.map(o=>Object.assign(Object.assign({},o),{[t]:i})))}),e}l(mw,"getCartesianProduct");var jk="3a".toUpperCase(),qk=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Gr(n=""){return CSS?CSS.escape(n):Yk(n)}l(Gr,"sanitizeSelectorItem");function Yk(n=""){return n.split("").map(e=>e===":"?`\\${jk} `:qk.test(e)?`\\${e}`:escape(e).replace(/%/g,"\\")).join("")}l(Yk,"legacySanitizeSelectorItem");var Kk={tag:Zl,id:hw,class:fw,attribute:uw,nthchild:dw,nthoftype:pw},Xk={tag:Cd,id:Ed,class:wd,attribute:Sd,nthchild:xd,nthoftype:Md};function gw(n,e){return Xk[e](n)}l(gw,"getElementSelectorsByType");function Zk(n,e){let t=Kk[e];return t(n)}l(Zk,"getSelectorsByType");function Jk(n=[],e,t){return n.filter(r=>t(r)||!e(r))}l(Jk,"filterSelectors");function Qk(n=[],e){return n.sort((t,r)=>{let i=e(t),o=e(r);return i&&!o?-1:!i&&o?1:0})}l(Qk,"orderSelectors");function eP(n,e,t){let r=tP(n,t),i=sP(r,t),o=Yl(i);return[...new Set(o)]}l(eP,"getAllSelectors");function tP(n,e){let{blacklist:t,whitelist:r,combineWithinSelector:i,maxCombinations:o}=e,a=Js(t),u=Js(r),f=l((d,p)=>{let g=Zk(n,p),y=Jk(g,a,u),S=Qk(y,u);return d[p]=i?Id(S,{maxResults:o}):S.map(w=>[w]),d},"reducer");return rP(e).reduce(f,{})}l(tP,"getSelectorsList");function rP(n){let{selectors:e,includeTag:t}=n,r=[...e];return t&&!r.includes("tag")&&r.push("tag"),r}l(rP,"getSelectorsToGet");function nP(n){return n.includes($e.tag)||n.includes($e.nthoftype)?[...n]:[...n,$e.tag]}l(nP,"addTagTypeIfNeeded");function iP(n){let{selectors:e,combineBetweenSelectors:t,includeTag:r,maxCandidates:i}=n,o=t?Id(e,{maxResults:i}):e.map(a=>[a]);return r?o.map(nP):o}l(iP,"combineSelectorTypes");function sP(n,e){return iP(e).map(t=>oP(t,n)).filter(t=>t.length>0)}l(sP,"getTypeCombinations");function oP(n,e){let t={};return n.forEach(i=>{let o=e[i];o&&o.length>0&&(t[i]=o)}),mw(t).map(lP)}l(oP,"constructSelectors");function aP(n,e){return e[n]?e[n].join(""):""}l(aP,"constructSelectorType");function lP(n={}){let e=[...Xl];return n[$e.tag]&&n[$e.nthoftype]&&e.splice(e.indexOf($e.tag),1),e.map(t=>aP(t,n)).join("")}l(lP,"constructSelector");function cP(n,e){return[...n.map(t=>e+Bn.DESCENDANT+t),...n.map(t=>e+Bn.CHILD+t)]}l(cP,"generateCandidateCombinations");function uP(n,e){return e===""?n:cP(n,e)}l(uP,"generateCandidates");function fP(n,e,t="",r){let i=eP(n,e,r),o=uP(i,t);for(let a of o)if(ki(n,a,e))return a;return null}l(fP,"getSelectorWithinRoot");function yw(n,e,t="",r){if(n.length===0)return null;let i=[n.length>1?n:[],...aw(n,e).map(o=>[o])];for(let o of i){let a=fP(o,e,t,r);if(a)return{foundElements:o,selector:a}}return null}l(yw,"getClosestIdentifiableParent");function bw(n){(n instanceof NodeList||n instanceof HTMLCollection)&&(n=Array.from(n));let e=(Array.isArray(n)?n:[n]).filter(_i);return[...new Set(e)]}l(bw,"sanitizeSelectorNeedle");function hP(n){return{value:n,include:!1}}l(hP,"createElementSelectorData");function vw(n,e,t=Bn.NONE){let r={};return e.forEach(i=>{Reflect.set(r,i,gw(n,i).map(hP))}),{element:n,operator:t,selectors:r}}l(vw,"createElementData");function Sw({selectors:n,operator:e}){let t=[...Xl];n[$e.tag]&&n[$e.nthoftype]&&(t=t.filter(i=>i!==$e.tag));let r="";return t.forEach(i=>{var o;((o=n[i])!==null&&o!==void 0?o:[]).forEach(({value:u,include:f})=>{f&&(r+=u)})}),e+r}l(Sw,"constructElementSelector");function dP(n){return[":root",...vd(n).reverse().map(r=>{let i=vw(r,[$e.nthchild],Bn.CHILD);return i.selectors.nthchild.forEach(o=>{o.include=!0}),i}).map(Sw)].join("")}l(dP,"getElementFallbackSelector");function ww(n){return n.map(dP).join(Kl)}l(ww,"getFallbackSelector");function Ad(n,e={}){var t;let r=bw(n),i=ow(r[0],e),o=(t=i.root)!==null&&t!==void 0?t:Zs(r[0]),a="",u=o;function f(){return yw(r,u,a,i)}l(f,"updateIdentifiableParent");let d=f();for(;d;){let{foundElements:p,selector:g}=d;if(ki(r,g,o))return g;u=p[0],a=g,d=f()}return r.length>1?r.map(p=>Ad(p,i)).join(Kl):ww(r)}l(Ad,"getCssSelector");var Qs=l(n=>new Promise(e=>setTimeout(e,n)),"awaitSleep"),xw=l(async(n,e=1e3,t)=>{if(e===null)return n;let r="guard-timed-out",i=l(async()=>(await Qs(e+1e3),r),"guard"),o=await Promise.race([n,i()]);if(typeof o=="string"&&o===r)throw typeof t=="function"?new Error(t()):new Error(t??"guardReturnTimedOut");return o},"guardReturn");var pP=!1,gn=class n{constructor(e){this.locators=[];this.elements=[];this.locators=e}static{l(this,"LocatorChain")}hasDuplicateFilters(){let e=this.locators.map(t=>t.options?.hasText).filter(t=>t);return e.length!==new Set(e).size}cloneAndAddCandidate(e){return new n([e,...this.locators.slice()])}toLocatorCandidate(){return{selector:this.getSelector(),locator:this.getLocator()}}getSelector(){return this.locators.map(e=>e.selector).join(" >> ")}getLocator(){return this.locators.map(e=>e.locator).join(".")}},yn=class n{constructor(e=document){this.rootNode=e;this.MAX_TESTING_SELECTORS=50;this.MAX_SINGLE_ELEMENT_SELECTORS=5;this.MAX_PROCESSING_TIME=15e3;this.MAX_MULTICANDIDATE_PROCESSING=5}static{l(this,"PlaywrightCustomLocatorGenerator")}async generate(e,t=[],r={}){let{isPartOfListItem:i,isForContextElement:o,useTextContent:a,addCSSSelectorGenerator:u,expandCSSKeyElements:f,bruteForceMode:d}={isPartOfListItem:!1,isForContextElement:!1,useTextContent:!0,addCSSSelectorGenerator:!0,expandCSSKeyElements:!0,bruteForceMode:!1,...r};if(Ye(e,"HTMLOptionElement")&&e.closest("select"))return this.generate(e.closest("select"),t,{isPartOfListItem:i});this.targetElement=e,this.startTimestamp=Date.now();let p=[];for(t=t.filter(y=>Array.from(document.querySelectorAll(y.selector)).includes(y.element)),f&&this.expandCSSKeyFeatures(e,t);e&&e!==this.rootNode;){await Qs(0);let y=this.getAllLocators(e,t,{useTextContent:a,bruteForceMode:d}),S=[],w=l(async E=>{if(!E.hasDuplicateFilters())try{await Qs(0);let{elements:v}=this.getLocatorBase(e).locator(E.getSelector());v?.some(M=>M===this.targetElement)&&(E.elements=v.filter(M=>mn(M)||M.constructor.name===this.targetElement.constructor.name),S.push(E))}catch(v){console.log(v,E.getSelector())}},"testCandidate");if(p.length)for(let E of y)for(let v of p)await w(v.cloneAndAddCandidate(E));else for(let E of y)await w(new gn([E]));if(S.length===0&&p.length===0){let E=e.tagName.toLowerCase();p.push(new gn([{selector:E,locator:this.getSelectorLocator(E),elements:this.getLocatorBase(e).locator(e.tagName.toLowerCase()).elements.filter(v=>mn(v))}]))}if(p.push(...S),o)return p.map(E=>E.toLocatorCandidate());if(p.length>this.MAX_TESTING_SELECTORS||p.filter(E=>E.elements.length===1).length>this.MAX_SINGLE_ELEMENT_SELECTORS||this.checkTimeout(!1))break;e=e.parentElement}if(i){let y=this.filterListItemsSelectors(p);if(y?.length)return y.map(S=>({...S.toLocatorCandidate(),isListSelector:!0}))}let g=[];try{for(let y of p)this.checkTimeout(),g.push(...y.elements.length===1?[y]:await this.reduceMultiCandidates(y))}catch(y){y instanceof sn&&console.warn("[PlaywrightCustomLocatorGenerator] Timeout error")}if(!g?.length&&(console.log("no single element selector found"),!f))return this.generate(e,t,{isPartOfListItem:i,isForContextElement:o,useTextContent:a,addCSSSelectorGenerator:!0,expandCSSKeyElements:!0});if(u){let y=await this.addCSSSelectorGenerator();y&&g.unshift(y)}if(this.rootNode===document&&a){let{selector:y,locator:S}=await new Tt().getSelectorAndLocator(this.targetElement);g.unshift(new gn([{selector:y,locator:S}]))}return g=g.concat(await this.addOptionalParentSelector(a,u,f)),Array.from(new Map(g.map(y=>[y.toLocatorCandidate().selector,y.toLocatorCandidate()])).values())}testSelector(e,t,r,i=!0){let o=Ur(t).selector(t),a=this.getLocatorBase(t).locator(o);console.log("Locator result",a);let u=l(d=>i&&(d.elements.length!==1||t!==d.element)?!1:!!d.elements.includes(t),"testResult");if(!u(a))return{valid:!1};let f={};if(r?.locatorWithVars?.length)try{let p=new Function(`{ return function(element) { ${r.variablesCode}; return this.getLocatorBase(element).locator(\`${r.locatorWithVars}\`); } }`)().call(this,t);if(console.log("Locator with vars result",p),!u(p))return{valid:!1};f={selectorWithVars:o,locatorWithVars:r.locatorWithVars}}catch(d){return console.error("Error testing selector with variables",d.message),{valid:!1}}return{valid:!0,selector:o,locator:e,...f}}async addCSSSelectorGenerator(){try{let e=this.rootNode===document?{}:{root:this.rootNode},t=await xw(new Promise(r=>{let i=Ad(this.targetElement,e);r(i)}),2e3);if(t.length<50)return new gn([{selector:t,locator:`locator('${t}')`}])}catch(e){console.error("Error getting CSS selector",e)}}async addOptionalParentSelector(e,t,r){try{let i=Ur(this.targetElement),o=i.locator(i.selector(this.targetElement)).element;if(o!==this.targetElement&&o?.contains(this.targetElement))return(await this.generate(o,[],{isPartOfListItem:!1,isForContextElement:!1,useTextContent:e,addCSSSelectorGenerator:t,expandCSSKeyElements:r})).map(({selector:a,locator:u})=>new gn([{selector:a,locator:u}]))}finally{return[]}}expandCSSKeyFeatures(e,t,r=4){try{let i=[];for(;e&&e!==this.rootNode&&i.length<r&&e!==document.documentElement;)Array.from(e.attributes).filter(({name:a,value:u})=>u.length<30&&!ql.includes(a)).forEach(a=>{try{if(i.length>r-1)return;let u=`[${a.name}${a.value?`="${a.value}"`:""}]`;try{if(!e.parentElement||e.parentElement.querySelectorAll(u).length>1)return}catch{console.warn(`Error checking selector - ${u}, continuing`);return}if(!t.some(f=>f.selector.includes(u))&&this.getLocatorBase(e).locator(u).element===e){let f={element:e,selector:u};t.push(f),i.push(f)}}catch(u){console.warn("Error processing css key feature",{name:a.name,value:a.value},u)}}),e=e.parentElement;i.length}catch(i){console.error("Error extracting CSS key features",i)}}async generateArbitraryItemListSelector(e,t=[]){console.log("generateArbitraryItemListSelector",e);try{let r=vr(document.body,{nodeRepetitionsThreshold:5});if(!r?.length)throw new Error("No templates found in the page");let i=r.find(y=>y.element.contains(e));if(!i)throw new Error("No template found for target element");console.log("Found template for target element",i);let o=await new n().generate(i.element,t,{isPartOfListItem:!1,isForContextElement:!1,useTextContent:!1});console.log("baseCustomSelectors",o);let a=o[0].selector,u=this.getSelectorLocator(a,i.element);console.log("Randomly selected baseSelector",a);let f=l(()=>{let y=[],S=new Wn,w=e;for(;w&&w!==i.element;){let E="",v=!1,M=!1,R=!1;for(;!E.length;)E=S.getSelectorPart(w,{useClasses:M,useId:v,useTag:R}),v?(M=!0,R=!0):v=!0;y.push({selector:E,element:w}),w=w.parentElement}return y},"getCSSFeatures"),d=f();console.log("cssFeatures",d);let p=(await new n(i.element).generate(e,f(),{isPartOfListItem:!0,isForContextElement:!1,useTextContent:!1})).map(y=>({...y,elements:[]})),g=p.filter(y=>(y.elements=this.getLocatorBase(e).locator(a).locator(y.selector).elements,y.elements.length>Math.ceil(i.element.children.length*.7)));return console.log("elementSelectors",p),g.map(({selector:y,locator:S})=>({selector:`${a} >> ${y}`,locator:`${u}.${S}`}))}catch(r){console.error("[findGenericItemListSelector] error",r)}}filterListItemsSelectors(e){try{let t=vr(document.body,{nodeRepetitionsThreshold:5});if(!t?.length)throw new Error("No templates found in the page");return e.filter(r=>{if(r.elements.length<2)return!1;let i=new Wn().getSmallestCommonRoot(r.elements);return!(!t.some(o=>o.element===i)||Array.from(i.children).some(o=>{r.elements.filter(a=>o.contains(a)).length>1}))})}catch(t){console.error("[filterListItemsSelectors] error",t.message)}}getLocatorBase(e){let t=Ur(e);return this.rootNode===document||this.rootNode.nodeType===9?t:t.locator(t.selector(this.rootNode))}getSelectorLocator(e,t){return Ur(t??this.targetElement).asLocator("javascript",e)}async reduceMultiCandidates(e){await Qs(0);let{elements:t}=e,r=e.getSelector().split(" >> "),i=[],o=this.getLocatorBase(this.targetElement),a=l(p=>{try{return i.push(new gn([{selector:p,locator:this.getSelectorLocator(p)}])),i.length>=this.MAX_MULTICANDIDATE_PROCESSING}catch(g){return console.error(g),!1}},"addCandidateWithSelector"),u=l(p=>e.getSelector()+(r[r.length-1]===this.targetElement.tagName.toLowerCase()?p:` >> internal:and=${mP(this.targetElement.tagName.toLowerCase()+p)}`),"addCSSFilterToLocator"),f=l(p=>o.locator(p).elements.length===1?a(p):!1,"addIfSingularAndCheckLimit");if(t.length<5){let p=t.indexOf(this.targetElement);p!==-1&&a(e.getSelector()+` >> nth=${p}`)}let d=this.targetElement.parentElement;if(t.every(p=>p.parentElement===d&&p.tagName===this.targetElement.tagName)){let p=Array.from(d.children).indexOf(this.targetElement);if(p!==-1){let g=u(`:nth-child(${p+1})`);f(g)&&a(g)}}for(let p of Array.from(this.targetElement.classList).filter(g=>!dr.includes(g))){let g=u(`.${Xs(p)}`);try{if(f(g))return i}catch(y){console.error(y)}}for(let p of Array.from(this.targetElement.attributes).filter(g=>!ql.includes(g.name))){let g=u(`[${p.name}`+(p.value?`="${p.value}"]`:"]"));try{if(f(g))return i}catch(y){console.error(y)}}return i}getAllLocators(e,t,r={}){r={exact:!0,useTextContent:!0,...r};let i=[this.getByRoleLocator(e,r),r.useTextContent?this.getByTextLocator(e,r):null,this.getByLabelLocator(e,r),this.getByPlaceholderLocator(e,r),this.getByTitleLocator(e,r),this.getByAltLocator(e,r),this.getTestIdLocator(e,r),...e===this.targetElement?[this.getInnerFeaturesLocator(e)]:[],...t.filter(o=>o.element===e).map(o=>({selector:o.selector,locator:this.getSelectorLocator(o.selector)}))].filter(o=>o);return!i.length&&r.bruteForceMode?i.concat(this.findUniqueCSSLocatorForElement(e)):i}findUniqueCSSLocatorForElement(e,t=5){let r=[],i=l(o=>(r.push([{selector:o,locator:`locator('${o}')`}]),r.length>=t),"addCandidate");for(let o of Array.from(e.attributes).filter(({name:a,value:u})=>u.length<30&&!ql.includes(a)))try{let a=`[${o.name}${o.value?`="${o.value}"`:""}]`;if(e.ownerDocument.querySelectorAll(a).length===1&&i(a))return r}catch{}for(let o of Array.from(e.classList).filter(a=>!dr.includes(a)))try{let a=`.${Xs(o)}`;if(e.ownerDocument.querySelectorAll(a).length===1&&i(a))return r}catch{}return r}getInnerFeaturesLocator(e){let t=e.tagName.toLowerCase();if(!mn(e)||["html","body","div"].includes(t))return;let r=new Pr().extract(e).filter(o=>!o.isRoot).slice(0,4).map(o=>ci(o).pop());if(r.length<2)return;let i=t+r.map(o=>`:has(${o})`).join("");return{selector:i,locator:this.getSelectorLocator(i)}}getByRoleLocator(e,t={}){try{if(!mn(e))throw new Error("Provided element is not an HTMLElement");let r={},i={button:"button",input:l(S=>S.type==="checkbox"?"checkbox":S.type==="radio"?"radio":"textbox","input"),select:"listbox",a:"link",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",li:"listitem",option:"option",textarea:"textbox",table:"table",tr:"row",th:"columnheader",td:"cell",img:"img"},o=e.tagName.toLowerCase(),a=e.getAttribute("role")||(i[o]instanceof Function?i[o](e):i[o]);if(!a)return;let u=[];if(a==="heading"&&!e.hasAttribute("aria-level")){let S=parseInt(o.charAt(1),10);u.push(["level",String(S)])}(a==="checkbox"||a==="radio")&&u.push(["checked",String(e.getAttribute("aria-checked")??e.getAttribute("checked")??"false")]);let f=l(()=>{let S=l(T=>this.limitTextLength(this.normalize(T),t.exact),"normalize"),w={text:"",exact:!1},E=e.getAttribute("aria-label")??e.getAttribute("aria-labelledby")??e.getAttribute("title");if(E)return S(E);let v=Li(e),M=jl(v.full);if(!M?.length)return w;let R=S(M);return r.hasText=R.text,R},"getAccessibleName"),{text:d,exact:p}=f();d&&d.length>0&&d.length<30&&u.push(["name",zl(d,p)]);let g=l(()=>{let S=`internal:role=${a}${u.map(([w,E])=>`[${w}=${E}]`).join("")}`;return{locator:this.getSelectorLocator(S),selector:S,options:r}},"getSelection"),y=g();if(d?.length&&p&&!this.getLocatorBase(e).locator(y.selector).elements.includes(e)){let S=u.find(w=>w[0]==="name");S&&(S[1]=zl(d,!1),y=g())}return y}catch(r){console.error("Error getting role locator",r.message)}}getByTextLocator(e,t={}){try{if(!mn(e))return;let r=jl(Li(e).full);if(!r?.length||r.length>100)return;let i={};if(Array.from(e.children).filter(u=>mn(u)).some(u=>jl(Li(u).full)===r)){i.hasText=r;let u=`${e.tagName.toLowerCase()} >> internal:has-text=${Gl(r,!1)}`;return{selector:u,locator:this.getSelectorLocator(u),options:i}}let o=l(u=>{let d="internal:text="+Gl(r,u);return{selector:d,locator:this.getSelectorLocator(d),options:i}},"getSelection"),a=o(t.exact);return t.exact&&!this.getLocatorBase(e).locator(a.selector).elements.includes(e)&&(a=o(!1)),a}catch{}}getByLabelLocator(e,t={}){try{if(!mn(e)||!["input","textarea","select"].includes(e.tagName.toLowerCase()))return;let r=l(u=>({selector:`internal:label=${Gl(u,t.exact)}`,locator:`getByLabel('${u}')`}),"respond"),i=e.getAttribute("aria-label");if(i)return r(i);let o=e.getAttribute("aria-labelledby");if(o){let u=document.getElementById(o);if(u){let f=u.innerText.trim();if(f)return r(f)}}let a=e.getAttribute("id");if(a){let u=document.querySelector(`label[for="${a}"]`);if(u){let f=u.innerText.trim();if(f)return r(f)}}}catch{}}getByPlaceholderLocator(e,t={}){if(["input","textarea"].includes(e.tagName?.toLowerCase()))return this.getByAttributeLocator(e,"placeholder",t)}getByTitleLocator(e,t={}){return this.getByAttributeLocator(e,"title",t)}getByAltLocator(e,t={}){return this.getByAttributeLocator(e,"alt",t)}getTestIdLocator(e,t={}){for(let r of["data-testid","data-test-id","data-test"])if(e.getAttribute(r))return this.getByAttributeLocator(e,r,{...t,locatorName:"getByTestId"})}getByAttributeLocator(e,t,r={}){try{if(!mn(e))return;let i=e.getAttribute(t);if(i)return{selector:`internal:attr=[${t}=${zl(i,r.exact)}]`,locator:(r.locatorName??`getBy${t.charAt(0).toUpperCase()+t.slice(1)}`)+`('${i}')`}}catch{}}normalize(e){return e.replace(/\n/g,"").replace(/[ \t]+/g," ").trim()}limitTextLength(e,t=!0,r=30){for(;e?.length>30&&e.length<100&&e.includes(" ");)e=e.split(" ").slice(0,-1).join(" "),t=!1;return{text:e,exact:t}}checkTimeout(e=!0){if(pP)return!1;if(this.MAX_PROCESSING_TIME&&Date.now()-this.startTimestamp>this.MAX_PROCESSING_TIME){if(e)throw new sn;return!0}}};function mP(n,e=!1){return`"${n.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"`}l(mP,"escapeForAndLocator");function mn(n){return Ye(n,"HTMLElement")}l(mn,"isInstanceOfHTMLElement");function Cw(n=document,e){try{let r=function(a){let u=a.nodeName.toLowerCase(),f=!1;if(["name","label","aria-label","data-testid","role"].forEach(d=>{a.hasAttribute(d)&&(u+=`[@${d}="${a.getAttribute(d)}"]`,f=!0)}),!f){let d=1,p=a.previousSibling;for(;p;)p.nodeType===Node.ELEMENT_NODE&&p.nodeName===a.nodeName&&d++,p=p.previousSibling;d>1&&(u+=`[${d}]`)}return u};var t=r;if(l(r,"getNodeIdentifier"),!n||!e||!n.contains(e))throw new Error("Child is not a descendant of the given element.");let i=[],o=e;for(;o!==n;)o.nodeType===Node.ELEMENT_NODE&&i.unshift(r(o)),o=o.parentElement;return i.join("/")}catch(r){console.error("Failed to get relative xpath",r);return}}l(Cw,"getRelativeXPath");function Mw(n,e){return[new XPathEvaluator().evaluate(e,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue].filter(i=>i instanceof HTMLElement)}l(Mw,"findElementsByXPath");var Wn=class{constructor(e){this.htmlReducer=e;this.BASE_MAX_COMPONENTS_FOR_SELECTOR_COMBINATION=13;this.MAX_SELECTORS_PER_CONTEXT_ELEMENT=10;this.innerFeaturesExtractor=new Pr;this.innerTextExtractor=new fi}static{l(this,"CompoundSelector")}filter(e,{isPartOfListItem:t=!1}={}){e.forEach(u=>{u.element=this.htmlReducer.getElementForChecksumId(u.selection.checksumid)});let r=e.splice(e.findIndex(u=>u.isTarget),1)[0],i=e.filter(u=>!!u.element&&!u.element.contains(r.element)&&!r.element.contains(u.element)&&!e.some(f=>f!==u&&(f.element===u.element||f.element.contains(u.element)))).concat(r);if(console.log(`filtered context elements, ${e.length+1} > ${i.length}`),!t)return i;let o=vr(document.body,{nodeRepetitionsThreshold:4});if(!o?.length)return[];let a=o.find(u=>u.element.contains(r.element));return a?(console.log("Found template for target element",a),i.filter(u=>a.element.contains(u.element))):[]}async generate(e,{isPartOfListItem:t=!1}={}){let r=e.filter(a=>a.isTarget)[0];if(e=this.filter(e,{isPartOfListItem:t}),e.length<2)throw new Error("Not enough elements found for the given checksum ids");if(!r?.element)throw new Error("Target element not found");let i=this.getSmallestCommonRoot(e.map(a=>a.element));if(!i)throw new Error("No common root found for the given elements");return this.extractFeaturesMetadata(e),{targetSelection:{xpath:Cw(i,r.element),cssSelectors:this.generateAllContextualSelectors(i,r.element).filter(a=>a&&a.trim().length>0),playwrightSelectors:await new yn(i).generate(r.element,[],{addCSSSelectorGenerator:!1,expandCSSKeyElements:!1}),featuresMetadata:r.featuresMetadata},contextElements:e}}async select(e,t){e.forEach(o=>{if(o.find(a=>!a||!a.isConnected))throw new Error("One or more context elements are not connected to the DOM")});let r=l((o,a)=>{try{return o.selector(a)}catch{let f=a.ownerDocument.defaultView.parent?.document?.defaultView?.playwright;if(f)try{return f.selector(a)}catch{return}return}},"getElementSelector"),i=this.getSmallestCommonParents(e).map(this.calculateElementSize).sort((o,a)=>o.size-a.size).map(o=>o.element);return t?i.map(o=>{let a=Ur(o),{element:u}=a.locator(r(a,o)).locator(t);return u?r(a,u):null}).filter(o=>o):i.map(o=>{let a=Ur(o);if(!a){console.warn("Failed getting playwright for element",o);return}return r(a,o)}).filter(o=>o)}async selectFromMetadata(e){let{contextElements:t}=e;t.forEach(i=>this.getSelectorCandidatesForContextElement(i));let r=pa(t.map(i=>i.candidatesSelectors.map((o,a)=>a)));for(let i of r){t.forEach((a,u)=>a.selector=a.candidatesSelectors[i[u]]);let o=this.getSmallestCommonParentsFromMetadata(t).map(this.calculateElementSize).sort((a,u)=>a.size-u.size).map(a=>a.element);for(let a of o){let u=this.generateTargetSelectotionHistogram(a,e.targetSelection);if(u.size>0)return Array.from(u.keys()).slice(0,20).map(d=>Ur(d).generateSelectorAndLocator(d))}}}generateTargetSelectotionHistogram(e,t){let r=new Map,i=l(o=>{o.filter(a=>a instanceof HTMLElement).forEach(a=>{r.set(a,(r.get(a)||0)+1)})},"addElementstoHistogram");if(t.xpath)try{i(Mw(e,t.xpath))}catch{}return t.cssSelectors.forEach(o=>{try{i(de(o,e))}catch{}}),new Map([...r.entries()].sort((o,a)=>a[1]-o[1]))}calculateElementSize(e){let t=e.getBoundingClientRect();return{element:e,size:t.width*t.height}}buildSelectorForContextElement(e,{useTag:t=!0,useInnerFeatures:r=!0,useClasses:i=!0,useAttributes:o=!0}){let a=t?e.featuresMetadata.tag:"";i&&e.featuresMetadata.classes.length&&(a+="."+e.featuresMetadata.classes.map(u=>u.trim().replace(/([!\"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")).join(".")),o&&(a+=Object.entries(e.featuresMetadata.attributes).map(([u,f])=>`[${u}="${f}"]`).join("")),r&&(a+=e.featuresMetadata.innerFeatures.filter(u=>!u.isRoot).map(u=>`:has(${ci(u)})`).join("")),e.selector=a}getSelectorCandidatesForContextElement(e){let t=this.buildSelectorsCombination(e.featuresMetadata);e.candidatesSelectors=[];for(let r=0;r<t.length&&e.candidatesSelectors.length<this.MAX_SELECTORS_PER_CONTEXT_ELEMENT;r++)document.querySelector(t[r])&&e.candidatesSelectors.push(t[r])}buildSelectorsCombination(e){let t=this.BASE_MAX_COMPONENTS_FOR_SELECTOR_COMBINATION,r=l(y=>{let S=[[]];for(let w=0;w<y.length;w++){let E=S.length;for(let v=0;v<E;v++)S.push(S[v].concat(y[w]))}return S},"getCombinations"),i=l(y=>y.trim().replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1"),"escapeSelector"),o=e.tag,a=e.innerFeatures.filter(y=>!y.isRoot).map(y=>`:has(${ci(y)})`).slice(0,4),u=e.classes.map(y=>`.${i(y)}`),f=Object.entries(e.attributes).map(([y,S])=>`[${y}="${i(S)}"]`),d=l(()=>a.length+1+u.length+f.length>t,"exceedsMaxLength");for(;d()&&(u.pop(),!!d());)f.pop();let p=r([...u,...f,...a]),g=p.map(y=>[o,...y]);return p.push(...g),p.map(y=>y.join("")).filter(y=>y).sort((y,S)=>S.length-y.length)}extractFeaturesMetadata(e){e.forEach(t=>{t.featuresMetadata={id:t.element.getAttribute("id")??void 0,tag:t.element.tagName.toLowerCase(),innerText:this.innerTextExtractor.extract(t.element),innerFeatures:this.innerFeaturesExtractor.extract(t.element),classes:Array.from(t.element.classList).filter(r=>!dr.includes(r))||[],attributes:Array.from(t.element.attributes).reduce((r,i)=>(["class","style","id"].includes(i.name)||(r[i.name]=i.value),r),{})}})}generateAllContextualSelectors(e,t){let r=[],i=[!0,!1];for(let a of i)for(let u of i)for(let f of i)r.push({useId:a,useClasses:u,useTag:f});let o=r.map(a=>this.createContextualSelector(e,t,a)).filter(a=>a).filter(a=>{try{let u=de(a,e);return u.length===1&&u[0]===t}catch{return!1}});return[...new Set(o)]}createContextualSelector(e,t,{useId:r=!1,useClasses:i=!0,useTag:o=!0}){if(!e||!t)return null;let a=[],u=t;for(;u&&u!==e;)a.unshift(this.getSelectorPart(u,{useId:r,useClasses:i,useTag:o})),u=u.parentElement;return u?a.join(" ").trim():null}getSelectorPart(e,{useId:t=!1,useClasses:r=!0,useTag:i=!0}){if(t&&e.id&&e.id.match(/^\D/))return`#${e.id}`;let o=i?e.tagName.toLowerCase():"";if(r&&e.className){let a=e.className.trim().split(/\s+/).filter(u=>!dr.includes(u)).map(Xs).join(".");a.length>0&&(o+="."+a)}return["name","label","aria-label","data-testid","role"].forEach(a=>{e.hasAttribute(a)&&(o+=`[${a}="${e.getAttribute(a)}"]`)}),o.trim()}getSmallestCommonRoot(e){let t=l(i=>{let o=[];for(;i;)o.push(i),i=i.parentElement;return o},"getAncestors"),r=t(e[0]);for(let i=1;i<e.length;i++){let o=t(e[i]);r=r.filter(a=>o.includes(a))}return r.length>0?r[0]:null}getSmallestCommonParentsFromMetadata(e){let t=e.map(r=>{try{let i=de(r.selector);return r.selection.type==="content"?i.filter(o=>o.textContent===r.selection.value):i}catch{return[]}});return t.some(r=>r.length===0)?[]:this.getSmallestCommonParents(t)}getSmallestCommonParents(e){let t=new Set;pa(e).forEach(o=>{let a=this.getSmallestCommonRoot(o);a&&t.add(a)});let i=Array.from(t);return i.filter(o=>!i.some(a=>o!==a&&o.contains(a)))}};var Jl=class{constructor(){this.MAX_SNIPPET_SIZE=12e3;this.MAX_LIONTAIL_SIZE=6e3;this.MAX_ATTRIBUTE_SIZE=100}static{l(this,"ParentChainReducer")}async reduce(e,t={useLionTail:!0,useChecksumIds:!0}){if(console.log("[ParentChainReducer] will reduce",e),!Ye(e,"HTMLElement")&&!Ye(e,"SVGElement"))throw new Error("Element is not an HTMLElement");return{reducedHTML:this.getAncestorsHTMLSnippet(e,t)}}getElementForChecksumId(e){return this.elementsInSimplifiedDomByChecksumId[e]}getAncestorsHTMLSnippet(e,{useLionTail:t=!0,useChecksumIds:r=!0}={}){this.elementsInSimplifiedDomByChecksumId={};let i=this.MAX_LIONTAIL_SIZE,o=this.MAX_ATTRIBUTE_SIZE,a=[],u=e;e.setAttribute("checksum-selected","true");try{for(;u;)a.push(u),u.parentNode&&u.parentNode instanceof ShadowRoot?u=u.parentNode.host:u=u.parentElement;a.reverse();let f=l(y=>{for(let S=y.attributes.length-1;S>=0;S--){let w=y.attributes[S];w.name.length+w.value.length>o&&y.removeAttribute(w.name)}return y},"normalizeNode"),d,p=new Ri;do{d=a[0].cloneNode(!1);let y=d,S=hs(d);for(let w=1;w<a.length;w++){if(t){let v=hs(a[w]).length;if(v<=i&&S.length+v<=this.MAX_SNIPPET_SIZE){let M=this.deepCloneNode(a[w],r?p:void 0);y.appendChild(M);break}}let E=f(a[w].cloneNode(a[w]===e));if(r){let v=p.getAndIncrement();E.setAttribute("checksumid",v),this.elementsInSimplifiedDomByChecksumId[v]=a[w]}y.appendChild(E),y=E}i=Math.max(i-10,0),o=Math.max(o-10,0)}while(d.outerHTML.length>this.MAX_SNIPPET_SIZE&&o>0);return this.filterNodeClasses(d),hs(d,{limitAttributeLength:!0})}catch(f){console.error("Error while getting ancestors HTML snippet",f)}finally{e.removeAttribute("checksum-selected")}}deepCloneNode(e,t){let r=e.cloneNode(!1),i=[e],o=[r];for(;i.length;){let a=i.shift(),u=o.shift();for(let f=0;f<a.childNodes.length;f++){let d=a.childNodes[f],p=d.cloneNode(!1);if(u.appendChild(p),t&&Ye(d,"HTMLElement")){let g=t.getAndIncrement();p.setAttribute("checksumid",g),this.elementsInSimplifiedDomByChecksumId[g]=d}i.push(d),o.push(p)}}return r}filterNodeClasses(e){let t=l(r=>{if("classList"in r){let i=r,o=i.classList;for(let a=0;a<o.length;a++){let u=o[a];dr.includes(u)&&i.classList.remove(u)}for(let a=0;a<i.children.length;a++)t(i.children[a])}},"filterClasses");t(e)}};var Ql=class{static{l(this,"FilesObserver")}constructor(e){this.fileInputsWithListeners=new Set,this.filesMap={},this.observer=null,this.sessionMirror=e}async getFilesByRrwebId(e){let t=this.filesMap[e]??[];try{let r=await Promise.all(t.map(async i=>({data:await gP(i),fileName:i.name})));return this.filesMap[e]=[],r}catch{console.log("Error while parsing files to base 64")}}init(){console.log("Starting observation..."),console.log(this.sessionMirror),this.observeDOMChanges(),window.addEventListener("unload",this.cleanup.bind(this))}handleFileChange(e){console.log("handleFileChange",this.sessionMirror);let t=e.target,r=Array.from(t.files||[]),i=this.sessionMirror.getMeta(t);this.filesMap[i.id]=r,console.log(`Files updated for ID: ${i.id}`,r)}addFileInputListeners(e){e.forEach(t=>{this.fileInputsWithListeners.has(t)||(t.addEventListener("change",this.handleFileChange.bind(this)),this.fileInputsWithListeners.add(t))})}observeDOMChanges(){let e=window.document,t=e.querySelectorAll('input[type="file"]');this.addFileInputListeners(t);let r=l(()=>{this.observer=new MutationObserver(o=>{o.forEach(a=>{if(a.type==="childList"){let u=a.target.querySelectorAll('input[type="file"]');this.addFileInputListeners(u)}})}),this.observer.observe(e.body,{childList:!0,subtree:!0})},"onBodyReady"),i=new MutationObserver(function(){e.body&&(i.disconnect(),r())});i.observe(e.documentElement,{childList:!0,subtree:!0})}cleanup(){console.log("Cleaning up files observer..."),this.observer&&this.observer.disconnect(),this.fileInputsWithListeners.forEach(e=>{e.removeEventListener("change",this.handleFileChange)}),this.fileInputsWithListeners.clear(),this.filesMap={}}},gP=l(n=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>{r.result?e(r.result.toString()):t(new Error("File reading failed"))},r.onerror=()=>{t(new Error("File reading failed"))},r.readAsDataURL(n)}),"convertFileToBase64");var ec=class{constructor(e){this.sessionRecorder=e}static{l(this,"NativeDialogObserver")}init(){this.overrideDialog("alert"),this.overrideDialog("confirm"),this.overrideDialog("prompt")}overrideDialog(e){let t=window[e].bind(window);window[e]=r=>{let i=t(r),o=this.determineDialogAction(i,e);return this.sessionRecorder.addCustomEvent("native-dialog-event",{dialogType:e,dialogMessage:r,dialogResult:i,dialogAction:o}),i}}determineDialogAction(e,t){if(t==="alert")return"native_accept";if(t==="confirm")return e?"native_accept":"native_dismiss";if(t==="prompt")return e?"native_accept":"native_dismiss"}};var Pi=class n{constructor({rootDocument:e=document,getRenderDocument:t=l(u=>u?.document,"getRenderDocument"),defaultView:r,topLevelInspector:i,rootDocumentForSelectorGenerator:o,eventName:a}={}){this.wasHoveredElementSelected=!1;this.selected=[];this.singleSelection=!0;this.subDocumentInspector=null;this.listening=!1;this.locatorCache=Rd.getInstance();this.onMouseOut=l(e=>{Vr.clearHighlights()},"onMouseOut");this.onMouseOver=l(async e=>{let t=e.composedPath()[0];if("getRootNode"in t){let i=t.getRootNode();if(i!==this.rootDocument){this.handleSubDocument(i,this.defaultView);return}}if(Ye(t,"HTMLIFrameElement")){this.handleSubDocument(t.contentDocument,t.contentDocument.defaultView);return}if(this.subDocumentInspector&&this.stopSubDocumentInspector(!0),!Ye(t,"HTMLElement"))return;let r=t;if(!(r===this.hoveredElement||r.matches(".element-inspector-ignore"))){Vr.clearHighlights(),this.hoveredElement&&this.hoveredElement.removeEventListener("click",this.onClick,{capture:!0});try{let{locator:i,selector:o,parentFramesSelectors:a,locatorRrwebId:u}=await this.getInspectedElementSelection(r,this.rootDocumentForSelectorGenerator);if(Vr.highlightElement(r,{text:i.replace("frameLocator('iframe').",""),textPosition:"below",textWidthType:"auto",pointerEvents:"none",classNames:["element-inspector-ignore"],renderDocument:this.getRenderDocument(this.defaultView)}),u){let f=window.checksum.timeMachine.sessionReplayer.getNodeById(u);f&&Vr.highlightElement(f,{clear:!1,pointerEvents:"none",classNames:["element-inspector-ignore"],renderDocument:this.getRenderDocument(this.defaultView)})}this.hoveredElement=r,this.hoveredElementSelection={locator:i,selector:o,parentFramesSelectors:a},this.wasHoveredElementSelected=!1,t.addEventListener("click",this.onClick,{capture:!0})}catch(i){console.error("Error inspecting element",i.message)}}},"onMouseOver");this.onClick=l(async e=>{e.stopPropagation(),e.preventDefault(),!this.wasHoveredElementSelected&&(this.wasHoveredElementSelected=!0,this.selected.push(this.hoveredElementSelection),this.singleSelection&&(this.topLevelInspector?this.topLevelInspector.stop():this.stop()),window.parent.postMessage({type:this.eventName,data:this.selected[this.selected.length-1]},"*"))},"onClick");this.handleSubDocument=l((e,t)=>{if(this.subDocumentInspector){if(this.subDocumentInspector.rootDocument===e)return!0;this.stopSubDocumentInspector(!0)}return this.subDocumentInspector=new n({rootDocument:e,defaultView:t,topLevelInspector:this.topLevelInspector??this,getRenderDocument:this.getRenderDocument,eventName:this.eventName}),this.subDocumentInspector.start({singleSelection:this.singleSelection,timestamp:this.currentTimestamp}),!0},"handleSubDocument");this.stopSubDocumentInspector=l(e=>{this.subDocumentInspector&&(this.subDocumentInspector.stop(e),this.subDocumentInspector=null)},"stopSubDocumentInspector");this.rootDocument=e,this.topLevelInspector=i,this.getRenderDocument=t,this.eventName=a,this.defaultView=r??this.getDefaultView(),this.playwrightElementSelectorGenerator=new Tt,this.rootDocumentForSelectorGenerator=o??this.getDefaultView().document}static{l(this,"ElementInspector")}getDefaultView(){let t=document.querySelector(".replayer-wrapper > iframe")?.contentDocument||null;return!t&&this.rootDocument.nodeType===Node.DOCUMENT_NODE&&(t=this.rootDocument),t||(t=document),t.defaultView}start({singleSelection:e,timestamp:t}={singleSelection:!0}){this.singleSelection=e,this.locatorCache.setTimestamp(t),this.currentTimestamp=t,this.stop(),this.cleanSelection(),this.rootDocument.addEventListener("mouseover",this.onMouseOver),this.rootDocument.addEventListener("mouseout",this.onMouseOut),this.listening=!0}stop(e=!1){this.listening&&(this.listening=!1,this.subDocumentInspector&&this.stopSubDocumentInspector(e),Vr.clearHighlights(),this.hoveredElement&&this.hoveredElement.removeEventListener("click",this.onClick,{capture:!0}),this.currentTimestamp=void 0,this.hoveredElement=null,this.wasHoveredElementSelected=!1,this.rootDocument.removeEventListener("mouseover",this.onMouseOver),e&&this.cleanSelection())}cleanSelection(){this.subDocumentInspector&&this.subDocumentInspector.cleanSelection(),this.selected=[]}consumeSelections(){if(this.subDocumentInspector)return this.subDocumentInspector.consumeSelections();let e=this.selected;return this.cleanSelection(),e}async getInspectedElementSelection(e,t){let r=this.locatorCache.getCachedLocatorForElement(e);if(!r){let{locator:i,selector:o,parentFramesSelectors:a}=await this.playwrightElementSelectorGenerator.getSelectorAndLocator(e,{rootDocument:t,ignoredIframesSelectors:[".replayer-wrapper > iframe"],flags:{origin:"element-inspector"}}).catch(d=>({locator:"",selector:"",parentFramesSelectors:[]})),u=await this.playwrightElementSelectorGenerator.selector(o,a).catch(()=>e),f=u!==e?Tw(u):void 0;r={locator:i,selector:o,parentFramesSelectors:a,locatorRrwebId:f},this.locatorCache.setCachedLocatorForElement(e,r)}return r}},Rd=class n{constructor(){this.locatorCache=new Map}static{l(this,"InspectedElementCache")}static getInstance(){return n.instance||(n.instance=new n),n.instance}setTimestamp(e){this.currentTimestamp=e}getCachedLocatorForElement(e){try{return this.currentTimestamp?this.locatorCache.get(this.getKeyForElement(e)):void 0}catch{return}}setCachedLocatorForElement(e,t){this.currentTimestamp&&this.locatorCache.set(this.getKeyForElement(e),t)}getKeyForElement(e){let t=Tw(e);if(!t)throw new Error("Can't find rrwebId for element");return`${t}_${this.currentTimestamp}`}};function Tw(n){return window.checksum.timeMachine.sessionReplayer.getMeta(n)?.id}l(Tw,"getNodeRrwebId");var Od=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Ld(n,e,t,r){n.addEventListener?n.addEventListener(e,t,r):n.attachEvent&&n.attachEvent("on".concat(e),t)}l(Ld,"addEvent");function eo(n,e,t,r){n.removeEventListener?n.removeEventListener(e,t,r):n.detachEvent&&n.detachEvent("on".concat(e),t)}l(eo,"removeEvent");function Rw(n,e){let t=e.slice(0,e.length-1);for(let r=0;r<t.length;r++)t[r]=n[t[r].toLowerCase()];return t}l(Rw,"getMods");function Ow(n){typeof n!="string"&&(n=""),n=n.replace(/\s/g,"");let e=n.split(","),t=e.lastIndexOf("");for(;t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}l(Ow,"getKeys");function yP(n,e){let t=n.length>=e.length?n:e,r=n.length>=e.length?e:n,i=!0;for(let o=0;o<t.length;o++)r.indexOf(t[o])===-1&&(i=!1);return i}l(yP,"compareArray");var ro={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":Od?173:189,"=":Od?61:187,";":Od?59:186,"'":222,"[":219,"]":221,"\\":220},Er={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},rc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},gt={16:!1,18:!1,17:!1,91:!1},et={};for(let n=1;n<20;n++)ro["f".concat(n)]=111+n;var Xe=[],to=null,Lw="all",zr=new Map,io=l(n=>ro[n.toLowerCase()]||Er[n.toLowerCase()]||n.toUpperCase().charCodeAt(0),"code"),bP=l(n=>Object.keys(ro).find(e=>ro[e]===n),"getKey"),vP=l(n=>Object.keys(Er).find(e=>Er[e]===n),"getModifier");function Nw(n){Lw=n||"all"}l(Nw,"setScope");function no(){return Lw||"all"}l(no,"getScope");function SP(){return Xe.slice(0)}l(SP,"getPressedKeyCodes");function wP(){return Xe.map(n=>bP(n)||vP(n)||String.fromCharCode(n))}l(wP,"getPressedKeyString");function EP(){let n=[];return Object.keys(et).forEach(e=>{et[e].forEach(t=>{let{key:r,scope:i,mods:o,shortcut:a}=t;n.push({scope:i,shortcut:a,mods:o,keys:r.split("+").map(u=>io(u))})})}),n}l(EP,"getAllKeyCodes");function xP(n){let e=n.target||n.srcElement,{tagName:t}=e,r=!0,i=t==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}l(xP,"filter");function CP(n){return typeof n=="string"&&(n=io(n)),Xe.indexOf(n)!==-1}l(CP,"isPressed");function MP(n,e){let t,r;n||(n=no());for(let i in et)if(Object.prototype.hasOwnProperty.call(et,i))for(t=et[i],r=0;r<t.length;)t[r].scope===n?t.splice(r,1).forEach(a=>{let{element:u}=a;return _d(u)}):r++;no()===n&&Nw(e||"all")}l(MP,"deleteScope");function TP(n){let e=n.keyCode||n.which||n.charCode,t=Xe.indexOf(e);if(t>=0&&Xe.splice(t,1),n.key&&n.key.toLowerCase()==="meta"&&Xe.splice(0,Xe.length),(e===93||e===224)&&(e=91),e in gt){gt[e]=!1;for(let r in Er)Er[r]===e&&(wr[r]=!1)}}l(TP,"clearModifier");function _w(n){if(typeof n>"u")Object.keys(et).forEach(i=>{Array.isArray(et[i])&&et[i].forEach(o=>tc(o)),delete et[i]}),_d(null);else if(Array.isArray(n))n.forEach(i=>{i.key&&tc(i)});else if(typeof n=="object")n.key&&tc(n);else if(typeof n=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];let[i,o]=t;typeof i=="function"&&(o=i,i=""),tc({key:n,scope:i,method:o,splitKey:"+"})}}l(_w,"unbind");var tc=l(n=>{let{key:e,scope:t,method:r,splitKey:i="+"}=n;Ow(e).forEach(a=>{let u=a.split(i),f=u.length,d=u[f-1],p=d==="*"?"*":io(d);if(!et[p])return;t||(t=no());let g=f>1?Rw(Er,u):[],y=[];et[p]=et[p].filter(S=>{let E=(r?S.method===r:!0)&&S.scope===t&&yP(S.mods,g);return E&&y.push(S.element),!E}),y.forEach(S=>_d(S))})},"eachUnbind");function Iw(n,e,t,r){if(e.element!==r)return;let i;if(e.scope===t||e.scope==="all"){i=e.mods.length>0;for(let o in gt)Object.prototype.hasOwnProperty.call(gt,o)&&(!gt[o]&&e.mods.indexOf(+o)>-1||gt[o]&&e.mods.indexOf(+o)===-1)&&(i=!1);(e.mods.length===0&&!gt[16]&&!gt[18]&&!gt[17]&&!gt[91]||i||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Xe),e.method(n,e)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble&&(n.cancelBubble=!0)))}}l(Iw,"eventHandler");function Aw(n,e){let t=et["*"],r=n.keyCode||n.which||n.charCode;if(!wr.filter.call(this,n))return;if((r===93||r===224)&&(r=91),Xe.indexOf(r)===-1&&r!==229&&Xe.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(u=>{let f=rc[u];n[u]&&Xe.indexOf(f)===-1?Xe.push(f):!n[u]&&Xe.indexOf(f)>-1?Xe.splice(Xe.indexOf(f),1):u==="metaKey"&&n[u]&&(Xe=Xe.filter(d=>d in rc||d===r))}),r in gt){gt[r]=!0;for(let u in Er)Er[u]===r&&(wr[u]=!0);if(!t)return}for(let u in gt)Object.prototype.hasOwnProperty.call(gt,u)&&(gt[u]=n[rc[u]]);n.getModifierState&&!(n.altKey&&!n.ctrlKey)&&n.getModifierState("AltGraph")&&(Xe.indexOf(17)===-1&&Xe.push(17),Xe.indexOf(18)===-1&&Xe.push(18),gt[17]=!0,gt[18]=!0);let i=no();if(t)for(let u=0;u<t.length;u++)t[u].scope===i&&(n.type==="keydown"&&t[u].keydown||n.type==="keyup"&&t[u].keyup)&&Iw(n,t[u],i,e);if(!(r in et))return;let o=et[r],a=o.length;for(let u=0;u<a;u++)if((n.type==="keydown"&&o[u].keydown||n.type==="keyup"&&o[u].keyup)&&o[u].key){let f=o[u],{splitKey:d}=f,p=f.key.split(d),g=[];for(let y=0;y<p.length;y++)g.push(io(p[y]));g.sort().join("")===Xe.sort().join("")&&Iw(n,f,i,e)}}l(Aw,"dispatch");function wr(n,e,t){Xe=[];let r=Ow(n),i=[],o="all",a=document,u=0,f=!1,d=!0,p="+",g=!1,y=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(f=e.keyup),e.keydown!==void 0&&(d=e.keydown),e.capture!==void 0&&(g=e.capture),typeof e.splitKey=="string"&&(p=e.splitKey),e.single===!0&&(y=!0)),typeof e=="string"&&(o=e),y&&_w(n,o);u<r.length;u++)n=r[u].split(p),i=[],n.length>1&&(i=Rw(Er,n)),n=n[n.length-1],n=n==="*"?"*":io(n),n in et||(et[n]=[]),et[n].push({keyup:f,keydown:d,scope:o,mods:i,shortcut:r[u],method:t,key:r[u],splitKey:p,element:a});if(typeof a<"u"&&window){if(!zr.has(a)){let S=l(function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Aw(E,a)},"keydownListener"),w=l(function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Aw(E,a),TP(E)},"keyupListenr");zr.set(a,{keydownListener:S,keyupListenr:w,capture:g}),Ld(a,"keydown",S,g),Ld(a,"keyup",w,g)}if(!to){let S=l(()=>{Xe=[]},"listener");to={listener:S,capture:g},Ld(window,"focus",S,g)}}}l(wr,"hotkeys");function IP(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(et).forEach(t=>{et[t].filter(i=>i.scope===e&&i.shortcut===n).forEach(i=>{i&&i.method&&i.method()})})}l(IP,"trigger");function _d(n){let e=Object.values(et).flat();if(e.findIndex(r=>{let{element:i}=r;return i===n})<0){let{keydownListener:r,keyupListenr:i,capture:o}=zr.get(n)||{};r&&i&&(eo(n,"keyup",i,o),eo(n,"keydown",r,o),zr.delete(n))}if((e.length<=0||zr.size<=0)&&(Object.keys(zr).forEach(i=>{let{keydownListener:o,keyupListenr:a,capture:u}=zr.get(i)||{};o&&a&&(eo(i,"keyup",a,u),eo(i,"keydown",o,u),zr.delete(i))}),zr.clear(),Object.keys(et).forEach(i=>delete et[i]),to)){let{listener:i,capture:o}=to;eo(window,"focus",i,o),to=null}}l(_d,"removeKeyEvent");var Nd={getPressedKeyString:wP,setScope:Nw,getScope:no,deleteScope:MP,getPressedKeyCodes:SP,getAllKeyCodes:EP,isPressed:CP,filter:xP,trigger:IP,unbind:_w,keyMap:ro,modifier:Er,modifierMap:rc};for(let n in Nd)Object.prototype.hasOwnProperty.call(Nd,n)&&(wr[n]=Nd[n]);if(typeof window<"u"){let n=window.hotkeys;wr.noConflict=e=>(e&&window.hotkeys===wr&&(window.hotkeys=n),wr),window.hotkeys=wr}var Fi=class{constructor(){this.boundShortcuts=[]}static{l(this,"KeybindingsManager")}addKeybinding(e){let t=e.key.toLowerCase();if(this.boundShortcuts.includes(t))return;this.boundShortcuts.push(t),wr(t,{capture:!0,keydown:!0},i=>{i.preventDefault(),e.callback(i)})}};var nc=class{constructor(e){this.keybindingsManager=new Fi;this.createHandler=l(e=>({handlerFunc:l(t=>{try{e.handlerFunc(t)}finally{this.stopObserver()}},"handlerFunc"),handlerType:e.handlerType}),"createHandler");this.toHaveTextHandler=l(()=>e=>{let t=e?.data?.data,r=window.prompt(`Please enter the expected text for the element:
|
|
76
|
+
or you can use record.mirror to access the mirror instance during recording.`,hb={map:{},getId(){return console.error(pi),-1},getNode(){return console.error(pi),null},removeNodeFromMap(){console.error(pi)},has(){return console.error(pi),!1},reset(){console.error(pi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(hb=new Proxy(hb,{get(n,e,t){return e==="map"&&console.error(pi),Reflect.get(n,e,t)}}));function Us(n,e,t={}){let r=null,i=0;return function(...o){let a=Date.now();!i&&t.leading===!1&&(i=a);let u=e-(a-i),f=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),i=a,n.apply(f,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,n.apply(f,o)},u))}}l(Us,"throttle");function Dl(n,e,t,r,i=window){let o=i.Object.getOwnPropertyDescriptor(n,e);return i.Object.defineProperty(n,e,r?t:{set(a){setTimeout(()=>{t.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Dl(n,e,o||{},!0)}l(Dl,"hookSetter");var gl=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(gl=l(()=>new Date().getTime(),"nowTimestamp"));function fS(n){var e,t,r,i;let o=n.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=be.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o?.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=be.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}l(fS,"getWindowScroll");function hS(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}l(hS,"getWindowHeight");function dS(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}l(dS,"getWindowWidth");function pS(n){return n?n.nodeType===n.ELEMENT_NODE?n:be.parentElement(n):null}l(pS,"closestElementOfNode");function At(n,e,t,r){if(!n)return!1;let i=pS(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(tl(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}l(At,"isBlocked");function aD(n,e){return e.getId(n)!==-1}l(aD,"isSerialized");function _f(n,e,t){return n.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(n)===Ds}l(_f,"isIgnored");function mS(n,e){if(As(n))return!1;let t=e.getId(n);if(!e.has(t))return!0;let r=be.parentNode(n);return r&&r.nodeType===n.DOCUMENT_NODE?!1:r?mS(r,e):!0}l(mS,"isAncestorRemoved");function Th(n){return!!n.changedTouches}l(Th,"legacy_isTouchEvent");function gS(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach)}l(gS,"polyfill$1");function lD(n){let e={},t=l((i,o)=>{let a={value:i,parent:o,children:[]};return e[i.node.id]=a,a},"putIntoMap"),r=[];for(let i of n){let{nextId:o,parentId:a}=i;if(o&&o in e){let u=e[o];if(u.parent){let f=u.parent.children.indexOf(u);u.parent.children.splice(f,0,t(i,u.parent))}else{let f=r.indexOf(u);r.splice(f,0,t(i,null))}continue}if(a in e){let u=e[a];u.children.push(t(i,u));continue}r.push(t(i,null))}return r}l(lD,"queueToResolveTrees");function yS(n,e){e(n.value);for(let t=n.children.length-1;t>=0;t--)yS(n.children[t],e)}l(yS,"iterateResolveTree");function Ls(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}l(Ls,"isSerializedIframe");function bS(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}l(bS,"isSerializedStylesheet");function vS(n,e){var t,r;let i=(r=(t=n.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=i.getBoundingClientRect(),a=vS(i,e),u=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}}l(vS,"getBaseDimension");function Dn(n){return n?n instanceof sr&&"shadowRoot"in n?!!n.shadowRoot:!!be.shadowRoot(n):!1}l(Dn,"hasShadowRoot");function Ts(n,e){let t=n[e[0]];return e.length===1?t:Ts(t.cssRules[e[1]].cssRules,e.slice(2))}l(Ts,"getNestedRule");function db(n){let e=[...n],t=e.pop();return{positions:e,index:t}}l(db,"getPositionsAndIndex");function cD(n){let e=new Set,t=[];for(let r=n.length;r--;){let i=n[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}l(cD,"uniqueTextMutations");var yl=class{static{l(this,"StyleSheetMirror")}constructor(){P(this,"id",1),P(this,"styleIDMap",new WeakMap),P(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function SS(n){var e;let t=null;return"getRootNode"in n&&((e=be.getRootNode(n))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&be.host(be.getRootNode(n))&&(t=be.host(be.getRootNode(n))),t}l(SS,"getShadowHost");function uD(n){let e=n,t;for(;t=SS(e);)e=t;return e}l(uD,"getRootShadowHost");function fD(n){let e=n.ownerDocument;if(!e)return!1;let t=uD(n);return be.contains(e,t)}l(fD,"shadowHostInDom");function wS(n){let e=n.ownerDocument;return e?be.contains(e,n)||fD(n):!1}l(wS,"inDom");var j=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(j||{}),V=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(V||{}),ne=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(ne||{}),Fr=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(Fr||{}),Wr=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(Wr||{}),cn=(n=>(n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n))(cn||{}),Se=(n=>(n.Start="start",n.Pause="pause",n.Resume="resume",n.Resize="resize",n.Finish="finish",n.FullsnapshotRebuilded="fullsnapshot-rebuilded",n.LoadStylesheetStart="load-stylesheet-start",n.LoadStylesheetEnd="load-stylesheet-end",n.SkipStart="skip-start",n.SkipEnd="skip-end",n.MouseInteraction="mouse-interaction",n.EventCast="event-cast",n.CustomEvent="custom-event",n.Flush="flush",n.StateChange="state-change",n.PlayBack="play-back",n.Destroy="destroy",n))(Se||{}),$r=(n=>(n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n))($r||{});function pb(n){return"__ln"in n}l(pb,"isNodeInLinkedList");var Ih=class{static{l(this,"DoubleLinkedList")}constructor(){P(this,"length",0),P(this,"head",null),P(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pb(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&pb(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},mb=l((n,e)=>`${n}@${e}`,"moveKey"),Ah=class{static{l(this,"MutationBuffer")}constructor(){P(this,"frozen",!1),P(this,"locked",!1),P(this,"texts",[]),P(this,"attributes",[]),P(this,"attributeMap",new WeakMap),P(this,"removes",[]),P(this,"mapRemoves",[]),P(this,"movedMap",{}),P(this,"addedSet",new Set),P(this,"movedSet",new Set),P(this,"droppedSet",new Set),P(this,"removesSubTreeCache",new Set),P(this,"mutationCb"),P(this,"blockClass"),P(this,"blockSelector"),P(this,"maskTextClass"),P(this,"maskTextSelector"),P(this,"inlineStylesheet"),P(this,"maskInputOptions"),P(this,"maskTextFn"),P(this,"maskInputFn"),P(this,"keepIframeSrcFn"),P(this,"recordCanvas"),P(this,"inlineImages"),P(this,"slimDOMOptions"),P(this,"dataURLOptions"),P(this,"doc"),P(this,"mirror"),P(this,"iframeManager"),P(this,"stylesheetManager"),P(this,"shadowDomManager"),P(this,"canvasManager"),P(this,"processedNodeManager"),P(this,"unattachedDoc"),P(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),P(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Ih,i=l(f=>{let d=f,p=Ds;for(;p===Ds;)d=d&&d.nextSibling,p=d&&this.mirror.getId(d);return p},"getNextId"),o=l(f=>{let d=be.parentNode(f);if(!d||!wS(f))return;let p=!1;if(f.nodeType===Node.TEXT_NODE){let w=d.tagName;if(w==="TEXTAREA")return;w==="STYLE"&&this.addedSet.has(d)&&(p=!0)}let g=As(d)?this.mirror.getId(SS(f)):this.mirror.getId(d),y=i(f);if(g===-1||y===-1)return r.addNode(f);let S=yi(f,{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:l(w=>{Ls(w,this.mirror)&&this.iframeManager.addIframe(w),bS(w,this.mirror)&&this.stylesheetManager.trackLinkElement(w),Dn(f)&&this.shadowDomManager.addShadowRoot(be.shadowRoot(f),this.doc)},"onSerialize"),onIframeLoad:l((w,E)=>{this.iframeManager.attachIframe(w,E),this.shadowDomManager.observeAttachShadow(w)},"onIframeLoad"),onStylesheetLoad:l((w,E)=>{this.stylesheetManager.attachLinkElement(w,E)},"onStylesheetLoad"),cssCaptured:p});S&&(e.push({parentId:g,nextId:y,node:S}),t.add(S.id))},"pushAdd");for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet)gb(this.removesSubTreeCache,f,this.mirror)&&!this.movedSet.has(be.parentNode(f))||o(f);for(let f of this.addedSet)!yb(this.droppedSet,f)&&!gb(this.removesSubTreeCache,f,this.mirror)||yb(this.movedSet,f)?o(f):this.droppedSet.add(f);let a=null;for(;r.length;){let f=null;if(a){let d=this.mirror.getId(be.parentNode(a.value)),p=i(a.value);d!==-1&&p!==-1&&(f=a)}if(!f){let d=r.tail;for(;d;){let p=d;if(d=d.previous,p){let g=this.mirror.getId(be.parentNode(p.value));if(i(p.value)===-1)continue;if(g!==-1){f=p;break}else{let S=p.value,w=be.parentNode(S);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let E=be.host(w);if(this.mirror.getId(E)!==-1){f=p;break}}}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}a=f.previous,r.removeNode(f.value),o(f.value)}let u={texts:this.texts.map(f=>{let d=f.node,p=be.parentNode(d);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(d),value:f.value}}).filter(f=>!t.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:d}=f;if(typeof d.style=="string"){let p=JSON.stringify(f.styleDiff),g=JSON.stringify(f._unchangedStyles);p.length<d.style.length&&(p+g).split("var(").length===d.style.split("var(").length&&(d.style=f.styleDiff)}return{id:this.mirror.getId(f.node),attributes:d}}).filter(f=>!t.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),P(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(be.childNodes(e),i=>be.textContent(i)||"").join("");t.attributes.value=Ja({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Qa(e),value:r,maskInputFn:this.maskInputFn})}),P(this,"processMutation",e=>{if(!_f(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=be.textContent(e.target);!At(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Hb(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,pS(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let a=Qa(t);i=Ja({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(At(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!$b(t.tagName,r))if(o.attributes[r]=Fb(this.doc,fn(t.tagName),fn(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(let u of Array.from(t.style)){let f=t.style.getPropertyValue(u),d=t.style.getPropertyPriority(u);f!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?d===""?o.styleDiff[u]=f:o.styleDiff[u]=[f,d]:o._unchangedStyles[u]=[f,d]}for(let u of Array.from(a.style))t.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(At(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=As(e.target)?this.mirror.getId(be.host(e.target)):this.mirror.getId(e.target);At(e.target,this.blockClass,this.blockSelector,!1)||_f(t,this.mirror,this.slimDOMOptions)||!aD(t,this.mirror)||(this.addedSet.has(t)?(Rh(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||mS(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[mb(r,i)]?Rh(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:As(e.target)&&Rs(e.target)?!0:void 0}),hD(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),P(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(_f(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[mb(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);At(e,this.blockClass,this.blockSelector,!1)||(be.childNodes(e).forEach(r=>this.genAdds(r)),Dn(e)&&be.childNodes(be.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}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 Rh(n,e){n.delete(e),be.childNodes(e).forEach(t=>Rh(n,t))}l(Rh,"deepDelete");function hD(n,e){let t=[n];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),be.childNodes(r).forEach(i=>t.push(i)))}}l(hD,"processRemoves");function gb(n,e,t){return n.size===0?!1:dD(n,e)}l(gb,"isParentRemoved");function dD(n,e,t){let r=be.parentNode(e);return r?n.has(r):!1}l(dD,"_isParentRemoved");function yb(n,e){return n.size===0?!1:ES(n,e)}l(yb,"isAncestorInSet");function ES(n,e){let t=be.parentNode(e);return t?n.has(t)?!0:ES(n,t):!1}l(ES,"_isAncestorInSet");var Ns;function pD(n){Ns=n}l(pD,"registerErrorHandler");function mD(){Ns=void 0}l(mD,"unregisterErrorHandler");var Ee=l(n=>Ns?l((...t)=>{try{return n(...t)}catch(r){if(Ns&&Ns(r)===!0)return;throw r}},"rrwebWrapped"):n,"callbackWrapper"),kn=[];function Ys(n){try{if("composedPath"in n){let e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}l(Ys,"getEventTarget");function xS(n,e){let t=new Ah;kn.push(t),t.init(n);let r=new(uS())(Ee(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}l(xS,"initMutationObserver");function gD({mousemoveCb:n,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],u,f=Us(Ee(g=>{let y=Date.now()-u;n(a.map(S=>(S.timeOffset-=y,S)),g),a=[],u=null}),o),d=Ee(Us(Ee(g=>{let y=Ys(g),{clientX:S,clientY:w}=Th(g)?g.changedTouches[0]:g;u||(u=gl()),a.push({x:S,y:w,id:r.getId(y),timeOffset:gl()-u}),f(typeof DragEvent<"u"&&g instanceof DragEvent?V.Drag:g instanceof MouseEvent?V.MouseMove:V.TouchMove)}),i,{trailing:!1})),p=[It("mousemove",d,t),It("touchmove",d,t),It("drag",d,t)];return Ee(()=>{p.forEach(g=>g())})}l(gD,"initMoveObserver");function yD({mouseInteractionCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[],f=null,d=l(p=>g=>{let y=Ys(g);if(At(y,r,i,!0))return;let S=null,w=p;if("pointerType"in g){switch(g.pointerType){case"mouse":S=Fr.Mouse;break;case"touch":S=Fr.Touch;break;case"pen":S=Fr.Pen;break}S===Fr.Touch?ne[p]===ne.MouseDown?w="TouchStart":ne[p]===ne.MouseUp&&(w="TouchEnd"):Fr.Pen}else Th(g)&&(S=Fr.Touch);S!==null?(f=S,(w.startsWith("Touch")&&S===Fr.Touch||w.startsWith("Mouse")&&S===Fr.Mouse)&&(S=null)):ne[p]===ne.Click&&(S=f,f=null);let E=Th(g)?g.changedTouches[0]:g;if(!E)return;let v=t.getId(y),{clientX:M,clientY:R}=E;Ee(n)({type:ne[w],id:v,x:M,y:R,...S!==null&&{pointerType:S}})},"getHandler");return Object.keys(ne).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=fn(p),y=d(p);if(window.PointerEvent)switch(ne[p]){case ne.MouseDown:case ne.MouseUp:g=g.replace("mouse","pointer");break;case ne.TouchStart:case ne.TouchEnd:return}u.push(It(g,y,e))}),Ee(()=>{u.forEach(p=>p())})}l(yD,"initMouseInteractionObserver");function CS({scrollCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){let a=Ee(Us(Ee(u=>{let f=Ys(u);if(!f||At(f,r,i,!0))return;let d=t.getId(f);if(f===e&&e.defaultView){let p=fS(e.defaultView);n({id:d,x:p.left,y:p.top})}else n({id:d,x:f.scrollLeft,y:f.scrollTop})}),o.scroll||100));return It("scroll",a,e)}l(CS,"initScrollObserver");function bD({viewportResizeCb:n},{win:e}){let t=-1,r=-1,i=Ee(Us(Ee(()=>{let o=hS(),a=dS();(t!==o||r!==a)&&(n({width:Number(a),height:Number(o)}),t=o,r=a)}),200));return It("resize",i,e)}l(bD,"initViewportResizeObserver");var vD=["INPUT","TEXTAREA","SELECT"],bb=new WeakMap;function SD({inputCb:n,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:f,sampling:d,userTriggeredOnInput:p}){function g(R){let T=Ys(R),N=R.isTrusted,U=T&&T.tagName;if(T&&U==="OPTION"&&(T=be.parentElement(T)),!T||!U||vD.indexOf(U)<0||At(T,r,i,!0)||T.classList.contains(o)||a&&T.matches(a))return;let G=T.value,Q=!1,W=Qa(T)||"";W==="radio"||W==="checkbox"?Q=T.checked:(u[U.toLowerCase()]||u[W])&&(G=Ja({element:T,maskInputOptions:u,tagName:U,type:W,value:G,maskInputFn:f})),y(T,p?{text:G,isChecked:Q,userTriggered:N}:{text:G,isChecked:Q});let z=T.name;W==="radio"&&z&&Q&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(re=>{if(re!==T){let B=re.value;y(re,p?{text:B,isChecked:!Q,userTriggered:!1}:{text:B,isChecked:!Q})}})}l(g,"eventHandler");function y(R,T){let N=bb.get(R);if(!N||N.text!==T.text||N.isChecked!==T.isChecked){bb.set(R,T);let U=t.getId(R);Ee(n)({...T,id:U})}}l(y,"cbWithDedup");let w=(d.input==="last"?["change"]:["input","change"]).map(R=>It(R,Ee(g),e)),E=e.defaultView;if(!E)return()=>{w.forEach(R=>R())};let v=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),M=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&w.push(...M.map(R=>Dl(R[0],R[1],{set(){Ee(g)({target:this,isTrusted:!1})}},!1,E))),Ee(()=>{w.forEach(R=>R())})}l(SD,"initInputObserver");function bl(n){let e=[];function t(r,i){if(Ua("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ua("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ua("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ua("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(a)}return i}return l(t,"recurse"),t(n,e)}l(bl,"getNestedCSSRulePositions");function ln(n,e,t){let r,i;return n?(n.ownerNode?r=e.getId(n.ownerNode):i=t.getId(n),{styleId:i,id:r}):{}}l(ln,"getIdAndStyleId");function wD({styleSheetRuleCb:n,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Ee((p,g,y)=>{let[S,w]=y,{id:E,styleId:v}=ln(g,e,t.styleMirror);return(E&&E!==-1||v&&v!==-1)&&n({id:E,styleId:v,adds:[{rule:S,index:w}]}),p.apply(g,y)})}),r.CSSStyleSheet.prototype.addRule=function(p,g,y=this.cssRules.length){let S=`${p} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[S,y])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,removes:[{index:S}]}),p.apply(g,y)})}),r.CSSStyleSheet.prototype.removeRule=function(p){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,replace:S}),p.apply(g,y)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ee((p,g,y)=>{let[S]=y,{id:w,styleId:E}=ln(g,e,t.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,replaceSync:S}),p.apply(g,y)})}));let f={};Ga("CSSGroupingRule")?f.CSSGroupingRule=r.CSSGroupingRule:(Ga("CSSMediaRule")&&(f.CSSMediaRule=r.CSSMediaRule),Ga("CSSConditionRule")&&(f.CSSConditionRule=r.CSSConditionRule),Ga("CSSSupportsRule")&&(f.CSSSupportsRule=r.CSSSupportsRule));let d={};return Object.entries(f).forEach(([p,g])=>{d[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(d[p].insertRule,{apply:Ee((y,S,w)=>{let[E,v]=w,{id:M,styleId:R}=ln(S.parentStyleSheet,e,t.styleMirror);return(M&&M!==-1||R&&R!==-1)&&n({id:M,styleId:R,adds:[{rule:E,index:[...bl(S),v||0]}]}),y.apply(S,w)})}),g.prototype.deleteRule=new Proxy(d[p].deleteRule,{apply:Ee((y,S,w)=>{let[E]=w,{id:v,styleId:M}=ln(S.parentStyleSheet,e,t.styleMirror);return(v&&v!==-1||M&&M!==-1)&&n({id:v,styleId:M,removes:[{index:[...bl(S),E]}]}),y.apply(S,w)})})}),Ee(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(f).forEach(([p,g])=>{g.prototype.insertRule=d[p].insertRule,g.prototype.deleteRule=d[p].deleteRule})})}l(wD,"initStyleSheetObserver");function MS({mirror:n,stylesheetManager:e},t){var r,i,o;let a=null;t.nodeName==="#document"?a=n.getId(t):a=n.getId(be.host(t));let u=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,f=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!f?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get(){var d;return(d=f.get)==null?void 0:d.call(this)},set(d){var p;let g=(p=f.set)==null?void 0:p.call(this,d);if(a!==null&&a!==-1)try{e.adoptStyleSheets(d,a)}catch{}return g}}),Ee(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get:f.get,set:f.set})}))}l(MS,"initAdoptedStyleSheetObserver");function ED({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ee((u,f,d)=>{var p;let[g,y,S]=d;if(t.has(g))return o.apply(f,[g,y,S]);let{id:w,styleId:E}=ln((p=f.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(w&&w!==-1||E&&E!==-1)&&n({id:w,styleId:E,set:{property:g,value:y,priority:S},index:bl(f.parentRule)}),u.apply(f,d)})});let a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ee((u,f,d)=>{var p;let[g]=d;if(t.has(g))return a.apply(f,[g]);let{id:y,styleId:S}=ln((p=f.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&n({id:y,styleId:S,remove:{property:g},index:bl(f.parentRule)}),u.apply(f,d)})}),Ee(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}l(ED,"initStyleDeclarationObserver");function xD({mediaInteractionCb:n,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){let a=Ee(f=>Us(Ee(d=>{let p=Ys(d);if(!p||At(p,e,t,!0))return;let{currentTime:g,volume:y,muted:S,playbackRate:w,loop:E}=p;n({type:f,id:r.getId(p),currentTime:g,volume:y,muted:S,playbackRate:w,loop:E})}),i.media||500)),u=[It("play",a(cn.Play),o),It("pause",a(cn.Pause),o),It("seeked",a(cn.Seeked),o),It("volumechange",a(cn.VolumeChange),o),It("ratechange",a(cn.RateChange),o)];return Ee(()=>{u.forEach(f=>f())})}l(xD,"initMediaInteractionObserver");function CD({fontCb:n,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,o=t.FontFace;t.FontFace=l(function(f,d,p){let g=new o(f,d,p);return i.set(g,{family:f,buffer:typeof d!="string",descriptors:p,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),g},"FontFace2");let a=$n(e.fonts,"add",function(u){return function(f){return setTimeout(Ee(()=>{let d=i.get(f);d&&(n(d),i.delete(f))}),0),u.apply(this,[f])}});return r.push(()=>{t.FontFace=o}),r.push(a),Ee(()=>{r.forEach(u=>u())})}l(CD,"initFontObserver");function MD(n){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=n,a=!0,u=Ee(()=>{let f=e.getSelection();if(!f||a&&f?.isCollapsed)return;a=f.isCollapsed||!1;let d=[],p=f.rangeCount||0;for(let g=0;g<p;g++){let y=f.getRangeAt(g),{startContainer:S,startOffset:w,endContainer:E,endOffset:v}=y;At(S,r,i,!0)||At(E,r,i,!0)||d.push({start:t.getId(S),startOffset:w,end:t.getId(E),endOffset:v})}o({ranges:d})});return u(),It("selectionchange",u)}l(MD,"initSelectionObserver");function TD({doc:n,customElementCb:e}){let t=n.defaultView;return!t||!t.customElements?()=>{}:$n(t.customElements,"define",function(i){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,u])}})}l(TD,"initCustomElementObserver");function ID(n,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:f,styleSheetRuleCb:d,styleDeclarationCb:p,canvasMutationCb:g,fontCb:y,selectionCb:S,customElementCb:w}=n;n.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),t(...E)},n.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},n.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),i(...E)},n.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},n.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},n.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},n.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),f(...E)},n.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),d(...E)},n.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),p(...E)},n.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},n.fontCb=(...E)=>{e.font&&e.font(...E),y(...E)},n.selectionCb=(...E)=>{e.selection&&e.selection(...E),S(...E)},n.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),w(...E)}}l(ID,"mergeHooks");function AD(n,e={}){let t=n.doc.defaultView;if(!t)return()=>{};ID(n,e);let r;n.recordDOM&&(r=xS(n,n.doc));let i=gD(n),o=yD(n),a=CS(n),u=bD(n,{win:t}),f=SD(n),d=xD(n),p=l(()=>{},"styleSheetObserver"),g=l(()=>{},"adoptedStyleSheetObserver"),y=l(()=>{},"styleDeclarationObserver"),S=l(()=>{},"fontObserver");n.recordDOM&&(p=wD(n,{win:t}),g=MS(n,n.doc),y=ED(n,{win:t}),n.collectFonts&&(S=CD(n)));let w=MD(n),E=TD(n),v=[];for(let M of n.plugins)v.push(M.observer(M.callback,t,M.options));return Ee(()=>{kn.forEach(M=>M.reset()),r?.disconnect(),i(),o(),a(),u(),f(),d(),p(),g(),y(),S(),w(),E(),v.forEach(M=>M())})}l(AD,"initObservers");function Ua(n){return typeof window[n]<"u"}l(Ua,"hasNestedCSSRule");function Ga(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}l(Ga,"canMonkeyPatchNestedCSSRule");var vl=class{static{l(this,"CrossOriginIframeMirror")}constructor(e){P(this,"iframeIdToRemoteIdMap",new WeakMap),P(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let o=r||this.getIdToRemoteIdMap(e),a=i||this.getRemoteIdToIdMap(e),u=o.get(t);return u||(u=this.generateIdFn(),o.set(t,u),a.set(u,t)),u}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let o=i.get(t);return o||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Oh=class{static{l(this,"IframeManager")}constructor(e){P(this,"iframes",new WeakMap),P(this,"crossOriginIframeMap",new WeakMap),P(this,"crossOriginIframeMirror",new vl(Pb)),P(this,"crossOriginIframeStyleMirror"),P(this,"crossOriginIframeRootIdMap",new WeakMap),P(this,"mirror"),P(this,"mutationCb"),P(this,"wrappedEmit"),P(this,"loadListener"),P(this,"stylesheetManager"),P(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case j.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:j.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case j.Meta:case j.Load:case j.DomContentLoaded:return!1;case j.Plugin:return t;case j.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case j.IncrementalSnapshot:switch(t.data.source){case V.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case V.Drag:case V.TouchMove:case V.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case V.ViewportResize:return!1;case V.MediaInteraction:case V.MouseInteraction:case V.Scroll:case V.CanvasMutation:case V.Input:return this.replaceIds(t.data,e,["id"]),t;case V.StyleSheetRule:case V.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case V.Font:return t;case V.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case V.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==$r.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},Lh=class{static{l(this,"ShadowDomManager")}constructor(e){P(this,"shadowDoms",new WeakSet),P(this,"mutationCb"),P(this,"scrollCb"),P(this,"bypassOptions"),P(this,"mirror"),P(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Rs(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=xS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(CS({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(be.host(e))),this.restoreHandlers.push(MS({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push($n(e.prototype,"attachShadow",function(i){return function(o){let a=i.call(this,o),u=be.shadowRoot(this);return u&&wS(this)&&r.addShadowRoot(u,t),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Is=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ms=0;Ms<bi.length;Ms++)Is[bi.charCodeAt(Ms)]=Ms;var Ms,RD=l(function(n){var e=new Uint8Array(n),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=bi[e[t]>>2],i+=bi[(e[t]&3)<<4|e[t+1]>>4],i+=bi[(e[t+1]&15)<<2|e[t+2]>>6],i+=bi[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},"encode"),OD=l(function(n){var e=n.length*.75,t=n.length,r,i=0,o,a,u,f;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var d=new ArrayBuffer(e),p=new Uint8Array(d);for(r=0;r<t;r+=4)o=Is[n.charCodeAt(r)],a=Is[n.charCodeAt(r+1)],u=Is[n.charCodeAt(r+2)],f=Is[n.charCodeAt(r+3)],p[i++]=o<<2|a>>4,p[i++]=(a&15)<<4|u>>2,p[i++]=(u&3)<<6|f&63;return d},"decode"),vb=new Map;function LD(n,e){let t=vb.get(n);return t||(t=new Map,vb.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}l(LD,"variableListFor$1");var TS=l((n,e,t)=>{if(!n||!(AS(n,e)||typeof n=="object"))return;let r=n.constructor.name,i=LD(t,r),o=i.indexOf(n);return o===-1&&(o=i.length,i.push(n)),o},"saveWebGLVar");function Xa(n,e,t){if(n instanceof Array)return n.map(r=>Xa(r,e,t));if(n===null)return n;if(n instanceof Float32Array||n instanceof Float64Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Uint8Array||n instanceof Uint16Array||n instanceof Int16Array||n instanceof Int8Array||n instanceof Uint8ClampedArray)return{rr_type:n.constructor.name,args:[Object.values(n)]};if(n instanceof ArrayBuffer){let r=n.constructor.name,i=RD(n);return{rr_type:r,base64:i}}else{if(n instanceof DataView)return{rr_type:n.constructor.name,args:[Xa(n.buffer,e,t),n.byteOffset,n.byteLength]};if(n instanceof HTMLImageElement){let r=n.constructor.name,{src:i}=n;return{rr_type:r,src:i}}else if(n instanceof HTMLCanvasElement){let r="HTMLImageElement",i=n.toDataURL();return{rr_type:r,src:i}}else{if(n instanceof ImageData)return{rr_type:n.constructor.name,args:[Xa(n.data,e,t),n.width,n.height]};if(AS(n,e)||typeof n=="object"){let r=n.constructor.name,i=TS(n,e,t);return{rr_type:r,index:i}}}}return n}l(Xa,"serializeArg");var IS=l((n,e,t)=>n.map(r=>Xa(r,e,t)),"serializeArgs"),AS=l((n,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>n instanceof e[i]),"isInstanceOfWebGLObject");function ND(n,e,t,r){let i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;let u=$n(e.CanvasRenderingContext2D.prototype,a,function(f){return function(...d){return At(this.canvas,t,r,!0)||setTimeout(()=>{let p=IS(d,e,this);n(this.canvas,{type:Wr["2D"],property:a,args:p})},0),f.apply(this,d)}});i.push(u)}catch{let u=Dl(e.CanvasRenderingContext2D.prototype,a,{set(f){n(this.canvas,{type:Wr["2D"],property:a,args:[f],setter:!0})}});i.push(u)}return()=>{i.forEach(a=>a())}}l(ND,"initCanvas2DMutationObserver");function _D(n){return n==="experimental-webgl"?"webgl":n}l(_D,"getNormalizedContextName");function Sb(n,e,t,r){let i=[];try{let o=$n(n.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...f){if(!At(this,e,t,!0)){let d=_D(u);if("__context"in this||(this.__context=d),r&&["webgl","webgl2"].includes(d))if(f[0]&&typeof f[0]=="object"){let p=f[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else f.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...f])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}l(Sb,"initCanvasContextObserver");function wb(n,e,t,r,i,o){let a=[],u=Object.getOwnPropertyNames(n);for(let f of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(f))try{if(typeof n[f]!="function")continue;let d=$n(n,f,function(p){return function(...g){let y=p.apply(this,g);if(TS(y,o,this),"tagName"in this.canvas&&!At(this.canvas,r,i,!0)){let S=IS(g,o,this),w={type:e,property:f,args:S};t(this.canvas,w)}return y}});a.push(d)}catch{let d=Dl(n,f,{set(p){t(this.canvas,{type:e,property:f,args:[p],setter:!0})}});a.push(d)}return a}l(wb,"patchGLPrototype");function DD(n,e,t,r){let i=[];return i.push(...wb(e.WebGLRenderingContext.prototype,Wr.WebGL,n,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...wb(e.WebGL2RenderingContext.prototype,Wr.WebGL2,n,t,r,e)),()=>{i.forEach(o=>o())}}l(DD,"initCanvasWebGLMutationObserver");var RS="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kD=l(n=>Uint8Array.from(atob(n),e=>e.charCodeAt(0)),"decodeBase64"),Eb=typeof window<"u"&&window.Blob&&new Blob([kD(RS)],{type:"text/javascript;charset=utf-8"});function PD(n){let e;try{if(e=Eb&&(window.URL||window.webkitURL).createObjectURL(Eb),!e)throw"";let t=new Worker(e,{name:n?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+RS,{name:n?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}l(PD,"WorkerWrapper");var Nh=class{static{l(this,"CanvasManager")}constructor(e){P(this,"pendingCanvasMutations",new Map),P(this,"rafStamps",{latestId:0,invokeId:null}),P(this,"mirror"),P(this,"mutationCb"),P(this,"resetObservers"),P(this,"frozen",!1),P(this,"locked",!1),P(this,"processMutation",(f,d)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(f)||this.pendingCanvasMutations.set(f,[]),this.pendingCanvasMutations.get(f).push(d)});let{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t==="all"&&this.initCanvasMutationObserver(r,i,o),a&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:u})}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(e,t,r,i,o){let a=Sb(t,r,i,!0),u=new Map,f=new PD;f.onmessage=w=>{let{id:E}=w.data;if(u.set(E,!1),!("base64"in w.data))return;let{base64:v,type:M,width:R,height:T}=w.data;this.mutationCb({id:E,type:Wr["2D"],commands:[{property:"clearRect",args:[0,0,R,T]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:v}],type:M}]},0,0]}]})};let d=1e3/e,p=0,g,y=l(()=>{let w=[];return t.document.querySelectorAll("canvas").forEach(E=>{At(E,r,i,!0)||w.push(E)}),w},"getCanvas"),S=l(w=>{if(p&&w-p<d){g=requestAnimationFrame(S);return}p=w,y().forEach(async E=>{var v;let M=this.mirror.getId(E);if(u.get(M)||E.width===0||E.height===0)return;if(u.set(M,!0),["webgl","webgl2"].includes(E.__context)){let T=E.getContext(E.__context);((v=T?.getContextAttributes())==null?void 0:v.preserveDrawingBuffer)===!1&&T.clear(T.COLOR_BUFFER_BIT)}let R=await createImageBitmap(E);f.postMessage({id:M,bitmap:R,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[R])}),g=requestAnimationFrame(S)},"takeCanvasSnapshots");g=requestAnimationFrame(S),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Sb(e,t,r,!1),o=ND(this.processMutation.bind(this),e,t,r),a=DD(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=l(t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)},"setLatestRAFTimestamp");requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(a=>{let{type:u,...f}=a;return f}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}},_h=class{static{l(this,"StylesheetManager")}constructor(e){P(this,"trackedLinkElements",new WeakSet),P(this,"mutationCb"),P(this,"adoptedStyleSheetCb"),P(this,"styleMirror",new yl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,f)=>({rule:Db(u,o.href),index:f}))})),r.styleIds.push(a)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Dh=class{static{l(this,"ProcessedNodeManager")}constructor(){P(this,"nodeMap",new WeakMap),P(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},rt,Za,Df,Sl=!1;try{if(Array.from([1],n=>n*2)[0]!==2){let n=document.createElement("iframe");document.body.appendChild(n),Array.from=((Sy=n.contentWindow)==null?void 0:Sy.Array.from)||Array.from,document.body.removeChild(n)}}catch(n){console.debug("Unable to override Array.from",n)}var ir=kb();function Zt(n={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:f="rr-mask",maskTextSelector:d=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:S,maskInputFn:w,maskTextFn:E,hooks:v,packFn:M,sampling:R={},dataURLOptions:T={},mousemoveWait:N,recordDOM:U=!0,recordCanvas:G=!1,recordCrossOriginIframes:Q=!1,recordAfter:W=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:re=!1,inlineImages:B=!1,plugins:q,keepIframeSrcFn:k=l(()=>!1,"keepIframeSrcFn"),ignoreCSSAttributes:ee=new Set([]),errorHandler:X}=n;pD(X);let Y=Q?window.parent===window:!0,fe=!1;if(!Y)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(Y&&!e)throw new Error("emit function is required");if(!Y&&!fe)return()=>{};N!==void 0&&R.mousemove===void 0&&(R.mousemove=N),ir.reset();let Ae=g===!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}:y!==void 0?y:{password:!0},xe=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all",headTitleMutations:S==="all"}:S||{};gS();let Cr,me=0,dt=l(Ce=>{for(let Je of q||[])Je.eventProcessor&&(Ce=Je.eventProcessor(Ce));return M&&!fe&&(Ce=M(Ce)),Ce},"eventProcessor");rt=l((Ce,Je)=>{var _e;let je=Ce;if(je.timestamp=gl(),(_e=kn[0])!=null&&_e.isFrozen()&&je.type!==j.FullSnapshot&&!(je.type===j.IncrementalSnapshot&&je.data.source===V.Mutation)&&kn.forEach(ot=>ot.unfreeze()),Y)e?.(dt(je),Je);else if(fe){let ot={type:"rrweb",event:dt(je),origin:window.location.origin,isCheckout:Je};window.parent.postMessage(ot,"*")}if(je.type===j.FullSnapshot)Cr=je,me=0;else if(je.type===j.IncrementalSnapshot){if(je.data.source===V.Mutation&&je.data.isAttachIframe)return;me++;let ot=r&&me>=r,Te=t&&je.timestamp-Cr.timestamp>t;(ot||Te)&&Za(!0)}},"wrappedEmit");let ut=l(Ce=>{rt({type:j.IncrementalSnapshot,data:{source:V.Mutation,...Ce}})},"wrappedMutationEmit"),st=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.Scroll,...Ce}}),"wrappedScrollEmit"),vn=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.CanvasMutation,...Ce}}),"wrappedCanvasMutationEmit"),Vt=l(Ce=>rt({type:j.IncrementalSnapshot,data:{source:V.AdoptedStyleSheet,...Ce}}),"wrappedAdoptedStyleSheetEmit"),Dt=new _h({mutationCb:ut,adoptedStyleSheetCb:Vt}),Mr=new Oh({mirror:ir,mutationCb:ut,stylesheetManager:Dt,recordCrossOriginIframes:Q,wrappedEmit:rt});for(let Ce of q||[])Ce.getMirror&&Ce.getMirror({nodeMirror:ir,crossOriginIframeMirror:Mr.crossOriginIframeMirror,crossOriginIframeStyleMirror:Mr.crossOriginIframeStyleMirror});let qr=new Dh;Df=new Nh({recordCanvas:G,mutationCb:vn,win:window,blockClass:i,blockSelector:o,mirror:ir,sampling:R.canvas,dataURLOptions:T});let Tr=new Lh({mutationCb:ut,scrollCb:st,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:d,inlineStylesheet:p,maskInputOptions:Ae,dataURLOptions:T,maskTextFn:E,maskInputFn:w,recordCanvas:G,inlineImages:B,sampling:R,slimDOMOptions:xe,iframeManager:Mr,stylesheetManager:Dt,canvasManager:Df,keepIframeSrcFn:k,processedNodeManager:qr},mirror:ir});Za=l((Ce=!1)=>{if(!U)return;rt({type:j.Meta,data:{href:window.location.href,width:dS(),height:hS()}},Ce),Dt.reset(),Tr.init(),kn.forEach(_e=>_e.lock());let Je=$R(document,{mirror:ir,blockClass:i,blockSelector:o,maskTextClass:f,maskTextSelector:d,inlineStylesheet:p,maskAllInputs:Ae,maskTextFn:E,maskInputFn:w,slimDOM:xe,dataURLOptions:T,recordCanvas:G,inlineImages:B,onSerialize:l(_e=>{Ls(_e,ir)&&Mr.addIframe(_e),bS(_e,ir)&&Dt.trackLinkElement(_e),Dn(_e)&&Tr.addShadowRoot(be.shadowRoot(_e),document)},"onSerialize"),onIframeLoad:l((_e,je)=>{Mr.attachIframe(_e,je),Tr.observeAttachShadow(_e)},"onIframeLoad"),onStylesheetLoad:l((_e,je)=>{Dt.attachLinkElement(_e,je)},"onStylesheetLoad"),keepIframeSrcFn:k});if(!Je)return console.warn("Failed to snapshot the document");rt({type:j.FullSnapshot,data:{node:Je,initialOffset:fS(window)}},Ce),kn.forEach(_e=>_e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Dt.adoptStyleSheets(document.adoptedStyleSheets,ir.getId(document))},"takeFullSnapshot$1");try{let Ce=[],Je=l(je=>{var ot;return Ee(AD)({mutationCb:ut,mousemoveCb:l((Te,ji)=>rt({type:j.IncrementalSnapshot,data:{source:ji,positions:Te}}),"mousemoveCb"),mouseInteractionCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.MouseInteraction,...Te}}),"mouseInteractionCb"),scrollCb:st,viewportResizeCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.ViewportResize,...Te}}),"viewportResizeCb"),inputCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.Input,...Te}}),"inputCb"),mediaInteractionCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.MediaInteraction,...Te}}),"mediaInteractionCb"),styleSheetRuleCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.StyleSheetRule,...Te}}),"styleSheetRuleCb"),styleDeclarationCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.StyleDeclaration,...Te}}),"styleDeclarationCb"),canvasMutationCb:vn,fontCb:l(Te=>rt({type:j.IncrementalSnapshot,data:{source:V.Font,...Te}}),"fontCb"),selectionCb:l(Te=>{rt({type:j.IncrementalSnapshot,data:{source:V.Selection,...Te}})},"selectionCb"),customElementCb:l(Te=>{rt({type:j.IncrementalSnapshot,data:{source:V.CustomElement,...Te}})},"customElementCb"),blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:f,maskTextSelector:d,maskInputOptions:Ae,inlineStylesheet:p,sampling:R,recordDOM:U,recordCanvas:G,inlineImages:B,userTriggeredOnInput:z,collectFonts:re,doc:je,maskInputFn:w,maskTextFn:E,keepIframeSrcFn:k,blockSelector:o,slimDOMOptions:xe,dataURLOptions:T,mirror:ir,iframeManager:Mr,stylesheetManager:Dt,shadowDomManager:Tr,processedNodeManager:qr,canvasManager:Df,ignoreCSSAttributes:ee,plugins:((ot=q?.filter(Te=>Te.observer))==null?void 0:ot.map(Te=>({observer:Te.observer,options:Te.options,callback:l(ji=>rt({type:j.Plugin,data:{plugin:Te.name,payload:ji}}),"callback")})))||[]},v)},"observe");Mr.addLoadListener(je=>{try{Ce.push(Je(je.contentDocument))}catch(ot){console.warn(ot)}});let _e=l(()=>{Za(),Ce.push(Je(document)),Sl=!0},"init");return document.readyState==="interactive"||document.readyState==="complete"?_e():(Ce.push(It("DOMContentLoaded",()=>{rt({type:j.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&_e()})),Ce.push(It("load",()=>{rt({type:j.Load,data:{}}),W==="load"&&_e()},window))),()=>{Ce.forEach(je=>je()),qr.destroy(),Sl=!1,mD()}}catch(Ce){console.warn(Ce)}}l(Zt,"record");Zt.addCustomEvent=(n,e)=>{if(!Sl)throw new Error("please add custom event after start recording");rt({type:j.Custom,data:{tag:n,payload:e}})};Zt.freezePage=()=>{kn.forEach(n=>n.freeze())};Zt.takeFullSnapshot=n=>{if(!Sl)throw new Error("please take full snapshot after start recording");Za(n)};Zt.mirror=ir;function OS(n){return{all:n=n||new Map,on:l(function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},"on"),off:l(function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},"off"),emit:l(function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})},"emit")}}l(OS,"mitt$1");var FD=Object.freeze(Object.defineProperty({__proto__:null,default:OS},Symbol.toStringTag,{value:"Module"}));function $D(n=window,e=document){if("scrollBehavior"in e.documentElement.style&&n.__forceSmoothScrollPolyfill__!==!0)return;let t=n.HTMLElement||n.Element,r=468,i={scroll:n.scroll||n.scrollTo,scrollBy:n.scrollBy,elementScroll:t.prototype.scroll||f,scrollIntoView:t.prototype.scrollIntoView},o=n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now;function a(M){let R=["MSIE ","Trident/","Edge/"];return new RegExp(R.join("|")).test(M)}l(a,"isMicrosoftBrowser");let u=a(n.navigator.userAgent)?1:0;function f(M,R){this.scrollLeft=M,this.scrollTop=R}l(f,"scrollElement");function d(M){return .5*(1-Math.cos(Math.PI*M))}l(d,"ease");function p(M){if(M===null||typeof M!="object"||M.behavior===void 0||M.behavior==="auto"||M.behavior==="instant")return!0;if(typeof M=="object"&&M.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+M.behavior+" is not a valid value for enumeration ScrollBehavior.")}l(p,"shouldBailOut");function g(M,R){if(R==="Y")return M.clientHeight+u<M.scrollHeight;if(R==="X")return M.clientWidth+u<M.scrollWidth}l(g,"hasScrollableSpace");function y(M,R){let T=n.getComputedStyle(M,null)["overflow"+R];return T==="auto"||T==="scroll"}l(y,"canOverflow");function S(M){let R=g(M,"Y")&&y(M,"Y"),T=g(M,"X")&&y(M,"X");return R||T}l(S,"isScrollable");function w(M){for(;M!==e.body&&S(M)===!1;)M=M.parentNode||M.host;return M}l(w,"findScrollableParent");function E(M){let R=o(),T,N,U,G=(R-M.startTime)/r;G=G>1?1:G,T=d(G),N=M.startX+(M.x-M.startX)*T,U=M.startY+(M.y-M.startY)*T,M.method.call(M.scrollable,N,U),(N!==M.x||U!==M.y)&&n.requestAnimationFrame(E.bind(n,M))}l(E,"step");function v(M,R,T){let N,U,G,Q,W=o();M===e.body?(N=n,U=n.scrollX||n.pageXOffset,G=n.scrollY||n.pageYOffset,Q=i.scroll):(N=M,U=M.scrollLeft,G=M.scrollTop,Q=f),E({scrollable:N,method:Q,startTime:W,startX:U,startY:G,x:R,y:T})}l(v,"smoothScroll"),n.scroll=n.scrollTo=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){i.scroll.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:n.scrollY||n.pageYOffset);return}v.call(n,e.body,arguments[0].left!==void 0?~~arguments[0].left:n.scrollX||n.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:n.scrollY||n.pageYOffset)}},n.scrollBy=function(){if(arguments[0]!==void 0){if(p(arguments[0])){i.scrollBy.call(n,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}v.call(n,e.body,~~arguments[0].left+(n.scrollX||n.pageXOffset),~~arguments[0].top+(n.scrollY||n.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(p(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let M=arguments[0].left,R=arguments[0].top;v.call(this,this,typeof M>"u"?this.scrollLeft:~~M,typeof R>"u"?this.scrollTop:~~R)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(p(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let M=w(this),R=M.getBoundingClientRect(),T=this.getBoundingClientRect();M!==e.body?(v.call(this,M,M.scrollLeft+T.left-R.left,M.scrollTop+T.top-R.top),n.getComputedStyle(M).position!=="fixed"&&n.scrollBy({left:R.left,top:R.top,behavior:"smooth"})):n.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}l($D,"polyfill");var kh=class{static{l(this,"Timer")}constructor(e=[],t){P(this,"timeOffset",0),P(this,"speed"),P(this,"actions"),P(this,"raf",null),P(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}};function xb(n,e){if(n.type===j.IncrementalSnapshot&&n.data.source===V.MouseMove&&n.data.positions&&n.data.positions.length){let t=n.data.positions[0].timeOffset,r=n.timestamp+t;return n.delay=r-e,r-e}return n.delay=n.timestamp-e,n.delay}l(xb,"addDelay");function Cb(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r,i,o=t.call(n),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return a}l(Cb,"t");var vi;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(vi||(vi={}));var LS={type:"xstate.init"};function kf(n){return n===void 0?[]:[].concat(n)}l(kf,"r");function mi(n){return{type:"xstate.assign",assignment:n}}l(mi,"o");function Mb(n,e){return typeof(n=typeof n=="string"&&e&&e[n]?e[n]:n)=="string"?{type:n}:typeof n=="function"?{type:n.name,exec:n}:n}l(Mb,"i");function wl(n){return function(e){return n===e}}l(wl,"a");function NS(n){return typeof n=="string"?{type:n}:n}l(NS,"u");function Tb(n,e){return{value:n,context:e,actions:[],changed:!1,matches:wl(n)}}l(Tb,"c");function Ib(n,e,t){var r=e,i=!1;return[n.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,t):Object.keys(o.assignment).forEach(function(u){a[u]=typeof o.assignment[u]=="function"?o.assignment[u](r,t):o.assignment[u]}),r=a,!1}return!0}),r,i]}l(Ib,"f");function _S(n,e){e===void 0&&(e={});var t=Cb(Ib(kf(n.states[n.initial].entry).map(function(a){return Mb(a,e.actions)}),n.context,LS),2),r=t[0],i=t[1],o={config:n,_options:e,initialState:{value:n.initial,actions:r,context:i,matches:wl(n.initial)},transition:l(function(a,u){var f,d,p=typeof a=="string"?{value:a,context:n.context}:a,g=p.value,y=p.context,S=NS(u),w=n.states[g];if(w.on){var E=kf(w.on[S.type]);try{for(var v=function(fe){var Ae=typeof Symbol=="function"&&Symbol.iterator,xe=Ae&&fe[Ae],Cr=0;if(xe)return xe.call(fe);if(fe&&typeof fe.length=="number")return{next:l(function(){return fe&&Cr>=fe.length&&(fe=void 0),{value:fe&&fe[Cr++],done:!fe}},"next")};throw new TypeError(Ae?"Object is not iterable.":"Symbol.iterator is not defined.")}(E),M=v.next();!M.done;M=v.next()){var R=M.value;if(R===void 0)return Tb(g,y);var T=typeof R=="string"?{target:R}:R,N=T.target,U=T.actions,G=U===void 0?[]:U,Q=T.cond,W=Q===void 0?function(){return!0}:Q,z=N===void 0,re=N??g,B=n.states[re];if(W(y,S)){var q=Cb(Ib((z?kf(G):[].concat(w.exit,G,B.entry).filter(function(fe){return fe})).map(function(fe){return Mb(fe,o._options.actions)}),y,S),3),k=q[0],ee=q[1],X=q[2],Y=N??g;return{value:Y,context:ee,actions:k,changed:N!==g||k.length>0||X,matches:wl(Y)}}}}catch(fe){f={error:fe}}finally{try{M&&!M.done&&(d=v.return)&&d.call(v)}finally{if(f)throw f.error}}}return Tb(g,y)},"transition")};return o}l(_S,"s");var Ab=l(function(n,e){return n.actions.forEach(function(t){var r=t.exec;return r&&r(n.context,e)})},"l");function DS(n){var e=n.initialState,t=vi.NotStarted,r=new Set,i={_machine:n,send:l(function(o){t===vi.Running&&(e=n.transition(e,o),Ab(e,NS(o)),r.forEach(function(a){return a(e)}))},"send"),subscribe:l(function(o){return r.add(o),o(e),{unsubscribe:l(function(){return r.delete(o)},"unsubscribe")}},"subscribe"),start:l(function(o){if(o){var a=typeof o=="object"?o:{context:n.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:wl(a.value)}}return t=vi.Running,Ab(e,LS),i},"start"),stop:l(function(){return t=vi.Stopped,r.clear(),i},"stop"),get state(){return e},get status(){return t}};return i}l(DS,"v");function HD(n,e){for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.type===j.Meta&&r.timestamp<=e)return n.slice(t)}return n}l(HD,"discardPriorSnapshots");function BD(n,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){let i=_S({id:"player",context:n,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:mi({lastPlayedEvent:l((o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent,"lastPlayedEvent")}),recordTimeOffset:mi((o,a)=>{let u=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(u=a.payload.timeOffset),{...o,timeOffset:u,baselineTime:o.events[0].timestamp+u}}),play(o){var a;let{timer:u,events:f,baselineTime:d,lastPlayedEvent:p}=o;u.clear();for(let w of f)xb(w,d);let g=HD(f,d),y=p?.timestamp;p?.type===j.IncrementalSnapshot&&p.data.source===V.MouseMove&&(y=p.timestamp+((a=p.data.positions[0])==null?void 0:a.timeOffset)),d<(y||0)&&r.emit(Se.PlayBack);let S=new Array;for(let w of g)if(!(y&&y<d&&(w.timestamp<=y||w===p)))if(w.timestamp<d)S.push(w);else{let E=e(w,!1);u.addAction({doAction:l(()=>{E()},"doAction"),delay:w.delay})}t(S),r.emit(Se.Flush),u.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:mi(o=>({...o,lastPlayedEvent:null})),startLive:mi({baselineTime:l((o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now()),"baselineTime")}),addEvent:mi((o,a)=>{let{baselineTime:u,timer:f,events:d}=o;if(a.type==="ADD_EVENT"){let{event:p}=a.payload;xb(p,u);let g=d.length-1;if(!d[g]||d[g].timestamp<=p.timestamp)d.push(p);else{let w=-1,E=0;for(;E<=g;){let v=Math.floor((E+g)/2);d[v].timestamp<=p.timestamp?E=v+1:g=v-1}w===-1&&(w=E),d.splice(w,0,p)}let y=p.timestamp<u,S=e(p,y);y?S():f.isActive()&&f.addAction({doAction:l(()=>{S()},"doAction"),delay:p.delay})}return{...o,events:d}})}});return DS(i)}l(BD,"createPlayerService");function WD(n){let e=_S({id:"speed",context:n,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:l((t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},"setSpeed"),recordSpeed:mi({normalSpeed:l(t=>t.timer.speed,"normalSpeed")}),restoreSpeed:l(t=>{t.timer.setSpeed(t.normalSpeed)},"restoreSpeed")}});return DS(e)}l(WD,"createSpeedService");var VD=l(n=>[`.${n} { background: currentColor }`,"noscript { display: none !important; }"],"rules"),Rb=new Map;function kS(n,e){let t=Rb.get(n);return t||(t=new Map,Rb.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}l(kS,"variableListFor");function un(n,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let i=await un(n,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;let{rr_type:i,index:o}=r;return kS(e,i)[o]}else if("args"in r){let{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map(un(n,e,t))))}else{if("base64"in r)return OD(r.base64);if("src"in r){let i=n.get(r.src);if(i)return i;{let o=new Image;return o.src=r.src,n.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){let i=await Promise.all(r.data.map(un(n,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(un(n,e,t)));return r}}l(un,"deserializeArg");function UD(n,e){try{return e===Wr.WebGL?n.getContext("webgl")||n.getContext("experimental-webgl"):n.getContext("webgl2")}catch{return null}}l(UD,"getContext");var GD=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function zD(n,e){if(!e?.constructor)return;let{name:t}=e.constructor;if(!GD.includes(t))return;let r=kS(n,t);r.includes(e)||r.push(e)}l(zD,"saveToWebGLVarMap");async function jD({mutation:n,target:e,type:t,imageMap:r,errorHandler:i}){try{let o=UD(e,t);if(!o)return;if(n.setter){o[n.property]=n.args[0];return}let a=o[n.property],u=await Promise.all(n.args.map(un(r,o))),f=a.apply(o,u);zD(o,f);let d=!1}catch(o){i(n,o)}}l(jD,"webglMutation");async function qD({event:n,mutations:e,target:t,imageMap:r,errorHandler:i}){let o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}let a=e.map(async f=>Promise.all(f.args.map(un(r,o))));(await Promise.all(a)).forEach((f,d)=>{let p=e[d];try{if(p.setter){o[p.property]=p.args[0];return}let g=o[p.property];p.property==="drawImage"&&typeof p.args[0]=="string"?(r.get(n),g.apply(o,p.args)):g.apply(o,f)}catch(g){i(p,g)}})}l(qD,"canvasMutation$1");async function Ob({event:n,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{let a=i.get(n)||e,u="commands"in a?a.commands:[a];if([Wr.WebGL,Wr.WebGL2].includes(e.type)){for(let f=0;f<u.length;f++){let d=u[f];await jD({mutation:d,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await qD({event:n,mutations:u,target:t,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}l(Ob,"canvasMutation");var Ph=class{static{l(this,"MediaManager")}constructor(e){P(this,"mediaMap",new Map),P(this,"warn"),P(this,"service"),P(this,"speedService"),P(this,"emitter"),P(this,"getCurrentTime"),P(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(Se.Start,this.start.bind(this)),this.emitter.on(Se.SkipStart,this.start.bind(this)),this.emitter.on(Se.Pause,this.pause.bind(this)),this.emitter.on(Se.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,a="duration"in t&&t.duration;if(Number.isNaN(a)){this.waitForMetadata(t);return}let u=r.currentTimeAtLastInteraction+o;t.loop&&a!==!1&&(u=u%a),t.currentTime=u}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=l(()=>{this.metadataCallbackMap.delete(e);let r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})},"onLoadedMetadata");this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){let i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:u,muted:f,volume:d,loop:p}=r;return{isPlaying:o===cn.Play||o!==cn.Pause&&(i?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:u??i?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:a??i?.playbackRate??1,volume:d??i?.volume??1,muted:f??i?.muted??e.getAttribute("muted")===null,loop:p??i?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:i,volume:o,isPlaying:a}=t,u=this.service.state.matches("paused"),f=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==f&&(e.playbackRate=f),a&&!u?e.play():e.pause()}catch(d){this.warn(`Failed to replay media interactions: ${d.message||d}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;let a=this.service.state.matches("paused"),u=o.attributes,f=!1;u.rr_mediaState?f=u.rr_mediaState==="played":f=i.getAttribute("autoplay")!==null,f&&a&&i.pause();let d=1;typeof u.rr_mediaPlaybackRate=="number"&&(d=u.rr_mediaPlaybackRate);let p=!1;typeof u.rr_mediaMuted=="boolean"?p=u.rr_mediaMuted:p=i.getAttribute("muted")!==null;let g=!1;typeof u.rr_mediaLoop=="boolean"?g=u.rr_mediaLoop:g=i.getAttribute("loop")!==null;let y=1;typeof u.rr_mediaVolume=="number"&&(y=u.rr_mediaVolume);let S=0;typeof u.rr_mediaCurrentTime=="number"&&(S=u.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:f,currentTimeAtLastInteraction:S,lastInteractionTimeOffset:t,playbackRate:d,volume:y,muted:p,loop:g}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};function za(n,e){if(n.nodeName!=="DIALOG"||n instanceof sr)return;let t=n,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),a=typeof e?.attributes.open=="string"||typeof t.getAttribute("open")=="string",u=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&u))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),a&&(u?t.showModal():t.show())}}l(za,"applyDialogToTopLevel");function YD(n,e){if(n.nodeName!=="DIALOG"||n instanceof sr)return;let t=n;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}l(YD,"removeDialogFromTopLevel");var KD=5*1e3,XD=OS||FD,Lb="[replayer]",Pf={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Nb(n){return n.type==j.IncrementalSnapshot&&(n.data.source==V.TouchMove||n.data.source==V.MouseInteraction&&n.data.type==ne.TouchStart)}l(Nb,"indicatesTouchDevice");var El=class{static{l(this,"Replayer")}constructor(e,t){if(P(this,"wrapper"),P(this,"iframe"),P(this,"service"),P(this,"speedService"),P(this,"config"),P(this,"usingVirtualDom",!1),P(this,"virtualDom",new Ii),P(this,"mouse"),P(this,"mouseTail",null),P(this,"tailPositions",[]),P(this,"emitter",XD()),P(this,"nextUserInteractionEvent"),P(this,"legacy_missingNodeRetryMap",{}),P(this,"cache",zy()),P(this,"imageMap",new Map),P(this,"canvasEventMap",new Map),P(this,"mirror",kb()),P(this,"styleMirror",new yl),P(this,"mediaManager"),P(this,"firstFullSnapshot",null),P(this,"newDocumentQueue",[]),P(this,"mousePos",null),P(this,"touchActive",null),P(this,"lastMouseDownEvent",null),P(this,"lastHoveredRootNode"),P(this,"lastSelectionData",null),P(this,"constructedStyleMutations",[]),P(this,"adoptedStyleSheets",[]),P(this,"handleResize",u=>{this.iframe.style.display="inherit";for(let f of[this.mouseTail,this.iframe])f&&(f.setAttribute("width",String(u.width)),f.setAttribute("height",String(u.height)))}),P(this,"applyEventsSynchronously",u=>{for(let f of u){switch(f.type){case j.DomContentLoaded:case j.Load:case j.Custom:continue;case j.FullSnapshot:case j.Meta:case j.Plugin:case j.IncrementalSnapshot:break}this.getCastFn(f,!0)()}}),P(this,"getCastFn",(u,f=!1)=>{let d;switch(u.type){case j.DomContentLoaded:case j.Load:break;case j.Custom:d=l(()=>{this.emitter.emit(Se.CustomEvent,u)},"castFn");break;case j.Meta:d=l(()=>this.emitter.emit(Se.Resize,{width:u.data.width,height:u.data.height}),"castFn");break;case j.FullSnapshot:d=l(()=>{var g;if(this.firstFullSnapshot){if(this.firstFullSnapshot===u){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(u,f),(g=this.iframe.contentWindow)==null||g.scrollTo(u.data.initialOffset)},"castFn");break;case j.IncrementalSnapshot:d=l(()=>{if(this.applyIncremental(u,f),!f&&(u===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let g of this.service.state.context.events)if(!(g.timestamp<=u.timestamp)&&this.isUserInteraction(g)){g.delay-u.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=g);break}if(this.nextUserInteractionEvent){let g=this.nextUserInteractionEvent.delay-u.delay,y={speed:Math.min(Math.round(g/KD),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:y}),this.emitter.emit(Se.SkipStart,y)}}},"castFn");break}return l(()=>{d&&d();for(let y of this.config.plugins||[])y.handler&&y.handler(u,f,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:u}});let g=this.service.state.context.events.length-1;if(!this.config.liveMode&&u===this.service.state.context.events[g]){let y=l(()=>{g<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Se.Finish))},"finish"),S=50;u.type===j.IncrementalSnapshot&&u.data.source===V.MouseMove&&u.data.positions.length&&(S+=Math.max(0,-u.data.positions[0].timeOffset)),setTimeout(y,S)}this.emitter.emit(Se.EventCast,u)},"wrappedCastFn")}),!t?.liveMode&&e.length<2)throw new Error("Replayer need at least 2 events.");let r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Pf,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Se.Resize,this.handleResize),this.setupDom();for(let u of this.config.plugins||[])u.getMirror&&u.getMirror({nodeMirror:this.mirror});this.emitter.on(Se.Flush,()=>{if(this.usingVirtualDom){let u={mirror:this.mirror,applyCanvas:l((f,d,p)=>{Ob({event:f,mutation:d,target:p,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},"applyCanvas"),applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:l((f,d)=>{f.source===V.StyleSheetRule?this.applyStyleSheetRule(f,d):f.source===V.StyleDeclaration&&this.applyStyleDeclaration(f,d)},"applyStyleSheetMutation"),afterAppend:l((f,d)=>{for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(f,{id:d,replayer:this})},"afterAppend")};if(this.iframe.contentDocument)try{pl(this.iframe.contentDocument,this.virtualDom,u,this.virtualDom.mirror)}catch(f){console.warn(f)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let f in this.legacy_missingNodeRetryMap)try{let d=this.legacy_missingNodeRetryMap[f],p=ml(d.node,this.mirror,this.virtualDom.mirror);pl(p,d.node,u,this.virtualDom.mirror),d.node=p}catch(d){this.warn(d)}this.constructedStyleMutations.forEach(f=>{this.applyStyleSheetMutation(f)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(f=>{this.applyAdoptedStyleSheet(f)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[u,f]=this.lastMouseDownEvent;u.dispatchEvent(f)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Se.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let i=new kh([],{speed:this.config.speed});this.service=BD({events:e.map(u=>t&&t.unpackFn?t.unpackFn(u):u).sort((u,f)=>u.timestamp-f.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(u=>{this.emitter.emit(Se.StateChange,{player:u})}),this.speedService=WD({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(Se.StateChange,{speed:u})}),this.mediaManager=new Ph({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let o=this.service.state.context.events.find(u=>u.type===j.Meta),a=this.service.state.context.events.find(u=>u.type===j.FullSnapshot);if(o){let{width:u,height:f}=o.data;setTimeout(()=>{this.emitter.emit(Se.Resize,{width:u,height:f})},0)}a&&setTimeout(()=>{var u;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(u=this.iframe.contentWindow)==null||u.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Nb)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(Se.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(Se.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(Se.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Se.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;Nb(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=zy()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&($D(this.iframe.contentWindow,this.iframe.contentDocument),gS(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],i=new Set,o=l((f,d)=>{if(f.nodeName==="DIALOG"&&i.add(f),this.collectIframeAndAttachDocument(r,f),this.mediaManager.isSupportedMediaElement(f)){let{events:p}=this.service.state.context;this.mediaManager.addMediaElements(f,e.timestamp-p[0].timestamp,this.mirror)}for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(f,{id:d,replayer:this})},"afterAppend");this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),FL(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:f,builtNode:d}of r)this.attachDocumentToIframe(f,d),this.newDocumentQueue=this.newDocumentQueue.filter(p=>p!==f);let{documentElement:a,head:u}=this.iframe.contentDocument;this.insertStyleRules(a,u),i.forEach(f=>za(f)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Se.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;let i=VD(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,lS(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:V.StyleSheetRule,adds:i.map((a,u)=>({rule:a,index:u}))})}else{let o=document.createElement("style");e.insertBefore(o,t);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,a=l((u,f)=>{u.nodeName==="DIALOG"&&o.add(u),this.collectIframeAndAttachDocument(i,u);let d=r.getMeta(u);if(d?.type===$r.Element&&d?.tagName.toUpperCase()==="HTML"){let{documentElement:p,head:g}=t.contentDocument;this.insertStyleRules(p,g)}if(!this.usingVirtualDom)for(let p of this.config.plugins||[])p.onBuild&&p.onBuild(u,{id:f,replayer:this})},"afterAppend");Os(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(t.contentDocument,e.node.id);for(let{mutationInQueue:u,builtNode:f}of i)this.attachDocumentToIframe(u,f),this.newDocumentQueue=this.newDocumentQueue.filter(d=>d!==u);o.forEach(u=>za(u))}collectIframeAndAttachDocument(e,t){if(Ls(t,this.mirror)){let r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let r=new Set,i,o=this.service.state,a=l(()=>{o=this.service.state},"stateHandler");this.emitter.on(Se.Start,a),this.emitter.on(Se.Pause,a);let u=l(()=>{this.emitter.off(Se.Start,a),this.emitter.off(Se.Pause,a)},"unsubscribe");t.querySelectorAll('link[rel="stylesheet"]').forEach(f=>{f.sheet||(r.add(f),f.addEventListener("load",()=>{r.delete(f),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Se.LoadStylesheetEnd),i&&clearTimeout(i),u())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Se.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,u()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===j.IncrementalSnapshot&&t.data.source===V.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let r=document.createElement("canvas"),i=r.getContext("2d"),o=i?.createImageData(r.width,r.height);i?.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let i=await Promise.all(e.commands.map(async o=>{let a=await Promise.all(o.args.map(un(this.imageMap,null,r)));return{...o,args:a}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:i})}else{let i=await Promise.all(e.args.map(un(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:i})}}}applyIncremental(e,t){var r,i,o;let{data:a}=e;switch(a.source){case V.Mutation:{try{this.applyMutation(a,t)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,a)}break}case V.Drag:case V.TouchMove:case V.MouseMove:if(t){let u=a.positions[a.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:a}}else a.positions.forEach(u=>{let f={doAction:l(()=>{this.moveAndHover(u.x,u.y,u.id,t,a)},"doAction"),delay:u.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(f)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case V.MouseInteraction:{if(a.id===-1)break;let u=new Event(fn(ne[a.type])),f=this.mirror.getNode(a.id);if(!f)return this.debugNodeNotFound(a,a.id);this.emitter.emit(Se.MouseInteraction,{type:a.type,target:f});let{triggerFocus:d}=this.config;switch(a.type){case ne.Blur:"blur"in f&&f.blur();break;case ne.Focus:d&&f.focus&&f.focus({preventScroll:!0});break;case ne.Click:case ne.TouchStart:case ne.TouchEnd:case ne.MouseDown:case ne.MouseUp:t?(a.type===ne.TouchStart?this.touchActive=!0:a.type===ne.TouchEnd&&(this.touchActive=!1),a.type===ne.MouseDown?this.lastMouseDownEvent=[f,u]:a.type===ne.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===ne.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,t,a),a.type===ne.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===ne.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===ne.TouchEnd?this.mouse.classList.remove("touch-active"):f.dispatchEvent(u));break;case ne.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:f.dispatchEvent(u)}break}case V.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.scrollData=a;break}this.applyScroll(a,t);break}case V.ViewportResize:this.emitter.emit(Se.Resize,{width:a.width,height:a.height});break;case V.Input:{if(a.id===-1)break;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.inputData=a;break}this.applyInput(a);break}case V.MediaInteraction:{let u=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);let f=u,{events:d}=this.service.state.context;this.mediaManager.mediaMutation({target:f,timeOffset:e.timestamp-d[0].timestamp,mutation:a});break}case V.StyleSheetRule:case V.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case V.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.canvasMutations.push({event:e,mutation:a})}else{let u=this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);Ob({event:e,mutation:a,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case V.Font:{try{let u=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(u)}catch(u){this.warn(u)}break}case V.Selection:{if(t){this.lastSelectionData=a;break}this.applySelection(a);break}case V.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,q_(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let d in this.legacy_missingNodeRetryMap)try{let p=this.legacy_missingNodeRetryMap[d],g=aS(p.node,this.virtualDom,this.mirror);g&&(p.node=g)}catch(p){this.warn(p)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(d=>r.getNode(d.id)?!0:(this.warnNodeNotFound(e,d.id),!1)),e.removes.forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return;let y=r.getNode(d.parentId);if(!y)return this.warnNodeNotFound(e,d.parentId);if(d.isShadow&&Dn(y)&&(y=y.shadowRoot),r.removeNodeFromMap(g),y)try{y.removeChild(g),this.usingVirtualDom&&g.nodeName==="#text"&&y.nodeName==="STYLE"&&((p=y.rules)==null?void 0:p.length)>0&&(y.rules=[])}catch(S){if(S instanceof DOMException)this.warn("parent could not remove child in mutation",y,g,e);else throw S}});let i={...this.legacy_missingNodeRetryMap},o=[],a=l(d=>{let p=null;return d.nextId&&(p=r.getNode(d.nextId)),d.nextId!==null&&d.nextId!==void 0&&d.nextId!==-1&&!p},"nextNotInDOM"),u=l(d=>{var p,g;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let y=r.getNode(d.parentId);if(!y)return d.node.type===$r.Document?this.newDocumentQueue.push(d):o.push(d);d.node.isShadow&&(Dn(y)||y.attachShadow({mode:"open"}),y=y.shadowRoot);let S=null,w=null;if(d.previousId&&(S=r.getNode(d.previousId)),d.nextId&&(w=r.getNode(d.nextId)),a(d))return o.push(d);if(d.node.rootId&&!r.getNode(d.node.rootId))return;let E=d.node.rootId?r.getNode(d.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ls(y,r)){this.attachDocumentToIframe(d,y);return}let v=l((T,N)=>{if(!this.usingVirtualDom){za(T);for(let U of this.config.plugins||[])U.onBuild&&U.onBuild(T,{id:N,replayer:this})}},"afterAppend"),M=Os(d.node,{doc:E,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:v});if(d.previousId===-1||d.nextId===-1){i[d.node.id]={node:M,mutation:d};return}let R=r.getMeta(y);if(R&&R.type===$r.Element&&d.node.type===$r.Text){let T=Array.isArray(y.childNodes)?y.childNodes:Array.from(y.childNodes);if(R.tagName==="textarea")for(let N of T)N.nodeType===y.TEXT_NODE&&y.removeChild(N);else if(R.tagName==="style"&&T.length===1)for(let N of T)N.nodeType===y.TEXT_NODE&&!r.hasNode(N)&&(M.textContent=N.textContent,y.removeChild(N))}else if(R?.type===$r.Document){let T=y;d.node.type===$r.DocumentType&&((p=T.childNodes[0])==null?void 0:p.nodeType)===Node.DOCUMENT_TYPE_NODE&&T.removeChild(T.childNodes[0]),M.nodeName==="HTML"&&T.documentElement&&T.removeChild(T.documentElement)}if(S&&S.nextSibling&&S.nextSibling.parentNode?y.insertBefore(M,S.nextSibling):w&&w.parentNode?y.contains(w)?y.insertBefore(M,w):y.insertBefore(M,null):y.appendChild(M),v(M,d.node.id),this.usingVirtualDom&&M.nodeName==="#text"&&y.nodeName==="STYLE"&&((g=y.rules)==null?void 0:g.length)>0&&(y.rules=[]),Ls(M,this.mirror)){let T=this.mirror.getId(M),N=this.newDocumentQueue.find(U=>U.parentId===T);N&&(this.attachDocumentToIframe(N,M),this.newDocumentQueue=this.newDocumentQueue.filter(U=>U!==N))}(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(i,y,M,d)},"appendNode");e.adds.forEach(d=>{u(d)});let f=Date.now();for(;o.length;){let d=lD(o);if(o.length=0,Date.now()-f>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}for(let p of d)r.getNode(p.value.parentId)?yS(p,y=>{u(y)}):this.debug("Drop resolve tree since there is no parent for the root node.",p)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),cD(e.texts).forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return e.removes.find(S=>S.id===d.id)?void 0:this.warnNodeNotFound(e,d.id);let y=g.parentElement;if(d.value&&y&&y.tagName==="STYLE"?g.textContent=Al(d.value,this.cache):g.textContent=d.value,this.usingVirtualDom){let S=g.parentNode;((p=S?.rules)==null?void 0:p.length)>0&&(S.rules=[])}}),e.attributes.forEach(d=>{var p;let g=r.getNode(d.id);if(!g)return e.removes.find(y=>y.id===d.id)?void 0:this.warnNodeNotFound(e,d.id);for(let y in d.attributes)if(typeof y=="string"){let S=d.attributes[y];if(S===null)g.removeAttribute(y),y==="open"&&YD(g,d);else if(typeof S=="string")try{if(y==="_cssText"&&(g.nodeName==="LINK"||g.nodeName==="STYLE"))try{let w=r.getMeta(g),E=Os({...w,attributes:{...w.attributes,...d.attributes}},{doc:g.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(w.attributes,d.attributes);let v=g.nextSibling,M=g.parentNode;if(E&&M){M.removeChild(g),M.insertBefore(E,v),r.replace(d.id,E);break}}catch{}if(y==="value"&&g.nodeName==="TEXTAREA"){let w=g;w.childNodes.forEach(v=>w.removeChild(v));let E=(p=g.ownerDocument)==null?void 0:p.createTextNode(S);E&&w.appendChild(E)}else g.setAttribute(y,S);y==="rr_open_mode"&&g.nodeName==="DIALOG"&&za(g,d)}catch(w){this.warn("An error occurred may due to the checkout feature.",w)}else if(y==="style"){let w=S,E=g;for(let v in w)if(w[v]===!1)E.style.removeProperty(v);else if(w[v]instanceof Array){let M=w[v];E.style.setProperty(v,M[0],M[1])}else{let M=w[v];E.style.setProperty(v,M)}}}})}applyScroll(e,t){var r,i;let o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);let a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(a?.type===$r.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:u})=>{let f=this.mirror.getNode(i),d=this.mirror.getNode(a);if(!f||!d)return;let p=new Range;p.setStart(f,o),p.setEnd(d,u);let g=f.ownerDocument,y=g?.getSelection();return y&&t.add(y),{range:p,selection:y}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===V.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===V.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:u,index:f})=>{try{if(Array.isArray(f)){let{positions:d,index:p}=db(f);Ts(t.cssRules,d).insertRule(u,p)}else{let d=f===void 0?void 0:Math.min(f,t.cssRules.length);t?.insertRule(u,d)}}catch{}}),(i=e.removes)==null||i.forEach(({index:u})=>{try{if(Array.isArray(u)){let{positions:f,index:d}=db(u);Ts(t.cssRules,f).deleteRule(d||0)}else t?.deleteRule(u)}catch{}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch{}if(e.replaceSync)try{(a=t.replaceSync)==null||a.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){e.set&&Ts(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ts(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(u=>{var f;let d=null,p=null;if(Dn(r)?p=((f=r.ownerDocument)==null?void 0:f.defaultView)||null:r.nodeName==="#document"&&(p=r.defaultView),!!p)try{d=new p.CSSStyleSheet,this.styleMirror.add(d,u.styleId),this.applyStyleSheetRule({source:V.StyleSheetRule,adds:u.rules},d)}catch{}});let i=10,o=0,a=l((u,f)=>{let d=f.map(p=>this.styleMirror.getStyle(p)).filter(p=>p!==null);Dn(u)?u.shadowRoot.adoptedStyleSheets=d:u.nodeName==="#document"&&(u.adoptedStyleSheets=d),d.length!==f.length&&o<i&&(setTimeout(()=>a(u,f),0+100*o),o++)},"adoptStyleSheets");a(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){let{previousId:o,nextId:a}=i,u=o&&e[o],f=a&&e[a];if(u){let{node:d,mutation:p}=u;t.insertBefore(d,r),delete e[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(e,t,d,p)}if(f){let{node:d,mutation:p}=f;t.insertBefore(d,r.nextSibling),delete e[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(e,t,d,p)}}moveAndHover(e,t,r,i,o){let a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);let u=vS(a,this.iframe),f=e*u.absoluteScale+u.x,d=t*u.absoluteScale+u.y;this.mouse.style.left=`${f}px`,this.mouse.style.top=`${d}px`,i||this.drawMouseTail({x:f,y:d}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?Pf:Object.assign({},Pf,this.config.mouseTail),a=l(()=>{if(!this.mouseTail)return;let u=this.mouseTail.getContext("2d");!u||!this.tailPositions.length||(u.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),u.beginPath(),u.lineWidth=r,u.lineCap=t,u.strokeStyle=i,u.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(f=>u.lineTo(f.x,f.y)),u.stroke())},"draw");this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(u=>u!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==j.IncrementalSnapshot?!1:e.data.source>V.Mutation&&e.data.source<=V.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Se.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Lb,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Lb,...e)}},{addCustomEvent:bU}=Zt,{freezePage:vU}=Zt,{takeFullSnapshot:SU}=Zt,ZD="0.0.3-beta.1";typeof window<"u"&&(window.checksumRRWeb={version:ZD});var FS=l(n=>{let e=l(o=>o&&(o instanceof HTMLInputElement&&/|text|email|number|password|search|tel|url/.test(o.type||"")||o instanceof HTMLTextAreaElement)?!(o.disabled||o.readOnly):!1,"isEditableInputOrTextArea"),t=l((o,a)=>{n({key:o,eventTarget:a})},"sendKeyEvent"),r=l(o=>(o.ctrlKey?"ctrl ":"")+(o.altKey?"alt ":"")+(o.shiftKey?"shift ":"")+(o.metaKey?"meta ":"")+o.key,"formatKeyProperties"),i=l(o=>{try{if(e(o.target))return;t(r(o),o.target)}catch{}},"onKeyUp");window.addEventListener("keyup",o=>{i(o)})},"startKeyboardObserver");var kl=class n{constructor(e=document,t){this.target=e;this.onEvent=t;this.monitoredTextElements=[];this.inputEnabledSelectors=["[contenteditable=true]"].join(",");this.iframeObservers=[];this.monitorInputEnabledElement=l(e=>{e.addEventListener("input",t=>{this.onEvent({text:t.target?.innerText,eventTarget:t.target})})},"monitorInputEnabledElement")}static{l(this,"ContendEditableObserver")}startObserver(){this.startIframesObserver(),this.observer=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE&&r.nodeType===Node.ELEMENT_NODE){let i=r;i.matches(this.inputEnabledSelectors)||i.isContentEditable?this.monitorInputEnabledElement(i):Array.from(de("*",i)).filter(o=>o.matches&&o.matches(this.inputEnabledSelectors)||o.isContentEditable).forEach(this.monitorInputEnabledElement)}})})}),this.observer.observe(this.target,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.startInputMonitoring()}startIframesObserver(){setInterval(()=>{de("iframe",this.target).forEach(t=>{if(this.iframeObservers.find(a=>a.iframe===t))return;let r=l(a=>{if(a.iframe.contentWindow)try{a.observer=new n(a.iframe.contentWindow.document,this.onEvent),a.observer.startObserver()}catch{}},"observeIframe"),i=t,o={iframe:i,observer:null};this.iframeObservers.push(o),i.contentWindow?r(o):i.addEventListener("load",()=>{r(o)})})},500)}startInputMonitoring(){this.monitoredTextElements=de(this.inputEnabledSelectors,this.target),this.monitoredTextElements.forEach(this.monitorInputEnabledElement)}};var Pl=class{constructor(e){this.onEvent=e;this.onURLChange=l(()=>{setTimeout(()=>{let e=window.location.href;if(e!==this.currentURL){this.currentURL=e;try{this.onEvent({url:e})}catch{}}})},"onURLChange")}static{l(this,"URLObserver")}start(){window.addEventListener("popstate",r=>{this.onURLChange()}),window.addEventListener("locationchange",r=>{this.onURLChange()}),window.addEventListener("hashchange",r=>{this.onURLChange()});let e=window.history.pushState;window.history.pushState=(...r)=>(this.onURLChange(),e.apply(window.history,r));let t=window.history.replaceState;window.history.replaceState=(...r)=>(this.onURLChange(),t.apply(window.history,r))}};var pn={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},LU={defaultMerge:pn.defaultMerge};function JD(n,e){return e}l(JD,"defaultMetaDataUpdater");function QD(n,e){return n.filter(t=>t!==void 0)}l(QD,"defaultFilterValues");var $S;(function(n){n[n.NOT=0]="NOT",n[n.RECORD=1]="RECORD",n[n.ARRAY=2]="ARRAY",n[n.SET=3]="SET",n[n.MAP=4]="MAP",n[n.OTHER=5]="OTHER"})($S||($S={}));function HS(n){return typeof n!="object"||n===null?0:Array.isArray(n)?2:rk(n)?1:n instanceof Set?3:n instanceof Map?4:5}l(HS,"getObjectType");function ek(n){let e=new Set;for(let t of n)for(let r of[...Object.keys(t),...Object.getOwnPropertySymbols(t)])e.add(r);return e}l(ek,"getKeys");function tk(n,e){return typeof n=="object"&&Object.prototype.propertyIsEnumerable.call(n,e)}l(tk,"objectHasProperty");function WS(n){let e=0,t=n[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(t===void 0)return{done:!0,value:void 0};let r=t.next();if(r.done===!0){e+=1,t=n[e]?.[Symbol.iterator]();continue}return{done:!1,value:r.value}}while(!0)}}}}}l(WS,"getIterableOfIterables");var BS=["[object Object]","[object Module]"];function rk(n){if(!BS.includes(Object.prototype.toString.call(n)))return!1;let{constructor:e}=n;if(e===void 0)return!0;let t=e.prototype;return!(t===null||typeof t!="object"||!BS.includes(Object.prototype.toString.call(t))||!t.hasOwnProperty("isPrototypeOf"))}l(rk,"isRecord");function nk(n,e,t){let r={};for(let i of ek(n)){let o=[];for(let f of n)tk(f,i)&&o.push(f[i]);if(o.length===0)continue;let a=e.metaDataUpdater(t,{key:i,parents:n}),u=US(o,e,a);u!==pn.skip&&(i==="__proto__"?Object.defineProperty(r,i,{value:u,configurable:!0,enumerable:!0,writable:!0}):r[i]=u)}return r}l(nk,"mergeRecords$1");function ik(n){return n.flat()}l(ik,"mergeArrays$1");function sk(n){return new Set(WS(n))}l(sk,"mergeSets$1");function ok(n){return new Map(WS(n))}l(ok,"mergeMaps$1");function ak(n){return n.at(-1)}l(ak,"mergeOthers$1");var Fl={mergeRecords:nk,mergeArrays:ik,mergeSets:sk,mergeMaps:ok,mergeOthers:ak};function VS(...n){return lk({})(...n)}l(VS,"deepmerge");function lk(n,e){let t=ck(n,r);function r(...i){return US(i,t,e)}return l(r,"customizedDeepmerge"),r}l(lk,"deepmergeCustom");function ck(n,e){return{defaultMergeFunctions:Fl,mergeFunctions:{...Fl,...Object.fromEntries(Object.entries(n).filter(([t,r])=>Object.hasOwn(Fl,t)).map(([t,r])=>r===!1?[t,Fl.mergeOthers]:[t,r]))},metaDataUpdater:n.metaDataUpdater??JD,deepmerge:e,useImplicitDefaultMerging:n.enableImplicitDefaultMerging??!1,filterValues:n.filterValues===!1?void 0:n.filterValues??QD,actions:pn}}l(ck,"getUtils");function US(n,e,t){let r=e.filterValues?.(n,t)??n;if(r.length===0)return;if(r.length===1)return ud(r,e,t);let i=HS(r[0]);if(i!==0&&i!==5){for(let o=1;o<r.length;o++)if(HS(r[o])!==i)return ud(r,e,t)}switch(i){case 1:return uk(r,e,t);case 2:return fk(r,e,t);case 3:return hk(r,e,t);case 4:return dk(r,e,t);default:return ud(r,e,t)}}l(US,"mergeUnknowns");function uk(n,e,t){let r=e.mergeFunctions.mergeRecords(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(n,e,t):r}l(uk,"mergeRecords");function fk(n,e,t){let r=e.mergeFunctions.mergeArrays(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(n):r}l(fk,"mergeArrays");function hk(n,e,t){let r=e.mergeFunctions.mergeSets(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(n):r}l(hk,"mergeSets");function dk(n,e,t){let r=e.mergeFunctions.mergeMaps(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(n):r}l(dk,"mergeMaps");function ud(n,e,t){let r=e.mergeFunctions.mergeOthers(n,e,t);return r===pn.defaultMerge||e.useImplicitDefaultMerging&&r===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(n):r}l(ud,"mergeOthers");var pk={sampling:{mousemove:!1},userTriggeredOnInput:!0,maskInputOptions:{password:!1}},$l=class{constructor(e,t={}){this.eventHandler=e;this.options=t;this.logNativeMutationObserver=!1;this.stopRRWebRecording=l(()=>{},"stopRRWebRecording");this.start=l(()=>{console.log("[VTG-DEBUG] SessionRecorder.start() - starting recording with options",this.options),this.stopRRWebRecording=Zt({...this.options,emit:l((e,t)=>{console.log(`[VTG-DEBUG] SessionRecorder - emitting event: type=${e.type}, timestamp=${e.timestamp}, isCheckout=${t}`),this.eventHandler(e,t)},"emit")}),console.log("[VTG-DEBUG] SessionRecorder.start() - rrweb recording started"),this.logNativeMutationObserver&&this.selfObserve(),this.startURLObserver(),this.startKeyboardObserver(),this.startContentEditableObserver(),console.log("[VTG-DEBUG] SessionRecorder.start() - all observers started")},"start");this.stop=l(()=>{this.stopRRWebRecording()},"stop");this.startURLObserver=l(()=>{this.urlObserver=new Pl(({url:e})=>{let t={url:e};this.addCustomEvent("url-change",t)}),this.urlObserver.start()},"startURLObserver");this.startContentEditableObserver=l(()=>{this.contentEditableObserver=new kl(document,({text:e,eventTarget:t})=>{let r={text:e,id:this.tryGetMetaFromEventTarget(t)?.id};this.addCustomEvent("contenteditable-input",r)}),this.contentEditableObserver.startObserver()},"startContentEditableObserver");this.startKeyboardObserver=l(()=>{FS(({key:e,eventTarget:t})=>{let r={key:e,id:this.tryGetMetaFromEventTarget(t)?.id};this.addCustomEvent("key-stroke",r)})},"startKeyboardObserver");this.addCustomEvent=l((e,t)=>{Zt.addCustomEvent(e,t)},"addCustomEvent");this.tryGetMetaFromEventTarget=l(e=>{try{return this.getMeta(e)}catch{}},"tryGetMetaFromEventTarget");this.selfObserve=l(()=>{let e=document.getElementsByTagName("body"),t={attributes:!0,childList:!0,subtree:!0},r=l((o,a)=>{for(let u of o)u.type==="childList"?console.log("A child node has been added or removed.",u):u.type==="attributes"&&console.log(`The ${u.attributeName} attribute was modified.`,u)},"callback");new MutationObserver(r).observe(e[0],t)},"selfObserve");this.getNodeById=l(e=>Zt.mirror.getNode(e),"getNodeById");this.getMeta=l(e=>Zt.mirror.getMeta(e),"getMeta");this.eventHandler=e,this.options=VS(pk,t)}static{l(this,"SessionRecorder")}};var GS=[{selector:'path[d="M17.5 13V15.6667C17.5 16.0203 17.3361 16.3594 17.0444 16.6095C16.7527 16.8595 16.357 17 15.9444 17H5.05556C4.643 17 4.24733 16.8595 3.95561 16.6095C3.66389 16.3594 3.5 16.0203 3.5 15.6667V13"] + path[d="M14.6673 6.92057L10.5007 2.75391L6.33398 6.92057"] + path[d="M10.5 2.75391V12.7539"]',description:"export button"},{selector:'path[d="M16.0893 13.1868C16.6838 12.7754 17.1321 12.1858 17.3697 11.503C17.6072 10.8202 17.6216 10.0796 17.4107 9.38816C17.1999 8.69667 16.7748 8.09007 16.1968 7.65594C15.6187 7.2218 14.9177 6.9826 14.1948 6.97285H12.8308C12.6017 6.20011 12.1996 5.48973 11.6549 4.89565C11.1102 4.30157 10.4374 3.83943 9.68735 3.54431C8.93734 3.24918 8.12995 3.12885 7.32648 3.19244C6.52301 3.25603 5.7446 3.50187 5.05036 3.9113C4.35612 4.32072 3.7643 4.88297 3.31985 5.55533C2.8754 6.22769 2.59001 6.99248 2.48535 7.79164C2.38068 8.59079 2.4595 9.40329 2.71582 10.1674C2.97214 10.9316 3.39921 11.6272 3.96461 12.2016"] + path[d="M10.0273 10.0039V16.8241"] + path[d="M13.0585 13.0351L10.0273 10.0039L6.99609 13.0351"]',description:"import button"},{selector:'path[d="M20.4696 21.5303C20.7625 21.8232 21.2373 21.8232 21.5302 21.5303C21.8231 21.2374 21.8231 20.7626 21.5302 20.4697L20.4696 21.5303ZM17.1802 16.1197C16.8873 15.8268 16.4125 15.8268 16.1196 16.1197C15.8267 16.4126 15.8267 16.8874 16.1196 17.1803L17.1802 16.1197ZM18.25 11C18.25 15.0041 15.0041 18.25 11 18.25V19.75C15.8325 19.75 19.75 15.8325 19.75 11H18.25ZM11 18.25C6.99594 18.25 3.75 15.0041 3.75 11H2.25C2.25 15.8325 6.16751 19.75 11 19.75V18.25ZM3.75 11C3.75 6.99594 6.99594 3.75 11 3.75V2.25C6.16751 2.25 2.25 6.16751 2.25 11H3.75ZM11 3.75C15.0041 3.75 18.25 6.99594 18.25 11H19.75C19.75 6.16751 15.8325 2.25 11 2.25V3.75ZM21.5302 20.4697L17.1802 16.1197L16.1196 17.1803L20.4696 21.5303L21.5302 20.4697Z"]',description:"search"},{selector:'path[d="M3.75 10H16.875"] + path[d="M8.125 5L3.125 10L8.125 15"]',description:"back"},{selector:'path[d="M3.33301 8H12.6663"] + path[d="M8 3.33331L12.6667 7.99998L8 12.6666"]',description:"forward"},{selector:'path[d="M10 4.16667V15.8333"] + path[d="M4.16699 10H15.8337"]',description:"new or Add button"},{selector:'path[d="M10 10.75C10.4142 10.75 10.75 10.4142 10.75 10C10.75 9.58579 10.4142 9.25 10 9.25C9.58579 9.25 9.25 9.58579 9.25 10C9.25 10.4142 9.58579 10.75 10 10.75Z"] + path[d="M15.833 10.75C16.2472 10.75 16.583 10.4142 16.583 10C16.583 9.58579 16.2472 9.25 15.833 9.25C15.4188 9.25 15.083 9.58579 15.083 10C15.083 10.4142 15.4188 10.75 15.833 10.75Z"] + path[d="M4.16699 10.75C4.58121 10.75 4.91699 10.4142 4.91699 10C4.91699 9.58579 4.58121 9.25 4.16699 9.25C3.75278 9.25 3.41699 9.58579 3.41699 10C3.41699 10.4142 3.75278 10.75 4.16699 10.75Z"]',description:"open menu"},{selector:'path[d="M10 4.16667V15.8333"] + path[d="M4.16699 10H15.8337"]',description:"add filter"},{selector:'path[d="M15 5L5 15"] + path[d="M5 5L15 15"]',description:"close or remove"},{selector:'path[d="M4 6L8 10L12 6"]',description:"open or close dropdown"},{selector:'path[d="M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5Z"] + path[d="M12.5 7.5L7.5 12.5"] + path[d="M7.5 7.5L12.5 12.5"]',description:"clear input"},{selector:'path[d="M3.33301 5.49054H4.81449H16.6663"] + path[d="M7.14286 5.49999V3.99999C7.14286 3.60216 7.29337 3.22063 7.56128 2.93932C7.82919 2.65802 8.19255 2.49998 8.57143 2.49998H11.4286C11.8075 2.49998 12.1708 2.65802 12.4387 2.93932C12.7066 3.22063 12.8571 3.60216 12.8571 3.99999V5.49999M15 5.49999V16C15 16.3978 14.8495 16.7793 14.5816 17.0607C14.3137 17.342 13.9503 17.5 13.5714 17.5H6.42857C6.04969 17.5 5.68633 17.342 5.41842 17.0607C5.15051 16.7793 5 16.3978 5 16V5.49999H15Z"] + path[d="M8.33203 9.23726V13.4039"] + path[d="M11.666 9.23726V13.4039"]',description:"delete"},{selector:'path[d="M13.3334 4L6.00008 11.3333L2.66675 8"]',description:"checked"},{selector:'path[d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"]',description:"downward-pointing arrow"},{selector:'path[d="M18.0893 3.08926C18.4147 2.76382 18.4147 2.23618 18.0893 1.91074C17.7638 1.58531 17.2362 1.58531 16.9107 1.91074L18.0893 3.08926ZM9.41074 9.41074L8.82149 10L10 11.1785L10.5893 10.5893L9.41074 9.41074ZM16.9107 1.91074L9.41074 9.41074L10.5893 10.5893L18.0893 3.08926L16.9107 1.91074Z"] + path[d="M17.5 2.5L12.25 17.5L9.25 10.75L2.5 7.75L17.5 2.5Z"]',description:"send"}];var mk=5*60*1e3,Hl=class{constructor(){this.flashingTextElements=[]}static{l(this,"FlashingElementsDetector")}start(){this.stop(),this.flashingTextElements=[],this.observer=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.length>0&&t.addedNodes.forEach(r=>{r instanceof HTMLElement&&this.includeElement(r)&&setTimeout(()=>{this.flashingTextElements.push(this.processTextElements(r))},1e3)})})}),this.observer.observe(document.body,{childList:!0,subtree:!0}),this.monitoringPeriodTimeout=setTimeout(()=>{this.stop()},mk)}stop(){this.monitoringPeriodTimeout&&(clearTimeout(this.monitoringPeriodTimeout),this.monitoringPeriodTimeout=null),this.observer&&(this.observer.disconnect(),this.observer=null)}get(){let e=this.flashingTextElements.map(r=>r.filter(i=>!i.isConnected||St(i.parentElement).isHidden)).filter(r=>r.length).map(r=>`<span>${r.map(i=>i.textContent).join("</span><span>")}</span>`),t=new Set(e);return Array.from(t)}stopAndGet(){return this.stop(),this.get()}includeElement(e){return!(e.getElementsByTagName("*").length>50||e.outerHTML.length>5e3)}processTextElements(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),r,i=[];for(;r=t.nextNode();)St(r.parentNode).isHidden||i.push(r);return i}};var Ri=class{static{l(this,"AlphaNumericCounter")}constructor(e){this.counter=e??"0"}increment(){let e=this.counter.length-1;for(;e>=0;){let t=this.counter[e];if(t==="9"){this.counter=this.replaceAt(this.counter,e,"a");return}else if(t==="z"){if(this.counter=this.replaceAt(this.counter,e,"0"),e===0){this.counter="1"+this.counter;return}e--}else{this.counter=this.replaceAt(this.counter,e,String.fromCharCode(t.charCodeAt(0)+1));return}}}get(){return this.counter}incrementAndGet(){return this.increment(),this.get()}getAndIncrement(){let e=this.get();return this.increment(),e}replaceAt(e,t,r){return e.substr(0,t)+r+e.substr(t+r.length)}static compare(e,t){let r=e.length,i=t.length;if(r!==i)return r-i;for(let o=0;o<r;o++){let a=e.charCodeAt(o),u=t.charCodeAt(o);if(a!==u)return a-u}return 0}};var Ks="checksum-ignore",Wl="checksum-get-more-items",zS=20,gk=.7,Bl,jS,yk=0,qS=l((n,{forceIncludeAttribute:e,forceIncludeFileInput:t,forceIncludeElements:r,limit:i})=>{n.excludedElements?.forEach(S=>{S.removeAttribute(Ks)}),n.excludedElements=new Set;let o=n.element,a=i??Math.min(Math.ceil(o.children.length*.5),o.children.length-zS),u=l(S=>e&&(S.hasAttribute(e)||Array.from(S.querySelectorAll(`[${e}]`)).length>0)||t&&S.tagName.toLowerCase()==="input"&&S.type==="file"?!0:r.includes(S),"isForceIncluded"),f=l(S=>{let w=0;if(n.elementsToKeep.includes(S))return w;let E=fd(S);E.length>=n.attributes.length&&w++;let v=E.filter(T=>n.attributes.includes(T)).length;v===n.attributes.length?w+=3:v>0&&w++;let R=hd(S).filter(T=>n.classes.includes(T)).length;return R===n.classes.length?w+=2:R>0&&w++,w},"scoreElement"),d=Array.from(o.children).filter(S=>S.tagName===n.tagName&&!u(S)).map(S=>({element:S,score:f(S)})).sort((S,w)=>w.score-S.score),{inViewportElements:p,outOfViewportElements:g}=d.reduce((S,w)=>{let{element:E}=w;return ys(Ye(E,"Element")?E:E?.parentElement)?S.inViewportElements.push(E):S.outOfViewportElements.push(E),S},{inViewportElements:[],outOfViewportElements:[]}),y=l(S=>{for(let w of S)if(n.excludedElements.add(w),n.excludedElements.size===a)return!0},"excludeElements");return y(g)||y(p),bk(n),Array.from(n.excludedElements)},"viewportReducer");function bk(n){let{excludedElements:e,element:t}=n;e.forEach(r=>{r.setAttribute(Ks,"")}),t._getmoreitemsid||(t._getmoreitemsid="gm"+yk++),n.id=t._getmoreitemsid,t.setAttribute(Wl,n.id)}l(bk,"markTemplateElements");function fd(n){return Array.from(n.attributes).filter(e=>!e.name.startsWith("checksum")).map(e=>e.name.replace(/[0-9]/g,""))}l(fd,"mapAttributes");function hd(n){return n.className?.split(" ").filter(e=>e)??[]}l(hd,"getElementClasses");function vr(n=document.body,{nodeRepetitionsThreshold:e=zS}={}){try{return console.time("bettertemplatize"),Bl=new Set,YS(n,e),console.timeEnd("bettertemplatize"),console.log("[bettertemplatize] templates found:",Array.from(Bl)),Array.from(Bl)}catch(t){return console.error("[bettertemplatize] failed during template processing:",t.message),[]}}l(vr,"bettertemplatize");function YS(n,e){Array.from(n.children).forEach(t=>{if(t instanceof SVGElement)return;let r=t.children.length;if(r>=e){let i=Array.from(t.children),o=Math.ceil(r*gk);for(let a=0;a<r;a++){let u=0,f=i.slice(0,a);for(let d=a+1;d<r&&u+r-d>=o;d++)try{if(KS(i[a],i[d])){if(u++,u>=o){Bl.add({element:t,...jS,elementsToKeep:f});return}}else f.push(i[d])}catch{return}}}YS(t,e)})}l(YS,"traverse");var vk=.8,Sk=.5,wk=.8,Ek=5;function KS(n,e,t=1){let r,i,o=l(E=>(E&&(jS={attributes:r,classes:i,tagName:n.nodeName}),E),"response");if(n.nodeType!==e.nodeType)return o(!1);if(n instanceof SVGElement&&e instanceof SVGElement||n.nodeType===Node.TEXT_NODE)return o(!0);if(n.nodeType!==Node.ELEMENT_NODE)return o(!1);let a=n,u=e;if(a.tagName.toLowerCase()!==u.tagName.toLowerCase())return o(!1);let f=fd(a),d=fd(u);if(r=f.filter(E=>d.includes(E)),r.length/Math.max(f.length,d.length)<vk)return o(!1);let p=hd(a),g=hd(u);if(i=p.filter(E=>g.includes(E)),i.length/Math.max(p.length,g.length)<Sk)return o(!1);if(t>=Ek)return o(!0);if(a.shadowRoot&&!u.shadowRoot||!a.shadowRoot&&u.shadowRoot)return o(!1);let y=Array.from(a.shadowRoot?a.shadowRoot.children:a.children),S=Array.from(u.shadowRoot?u.shadowRoot.children:u.children);if(y.length===0&&S.length===0)return o(!0);let w=0;for(let E=0;E<Math.min(y.length,S.length);E++)KS(y[E],S[E],t+1)&&w++;return w/Math.max(y.length,S.length)<wk?o(!1):o(!0)}l(KS,"areSimilar");var XS=16e3;var xk=!0,dd={markTransparentElementsAsHidden:!1,markElementsHiddenByTransparentElementAsVisible:!0},Vl=class{constructor(){this.checksumIdToRRwebIdMap={};this.flashingElementsDetector=new Hl;this.forceIncludeElements=[];this.preMapReducedHTMLSelectors=!1;this.useRrwebIdsAsChecksumIds=!1;this.excludedNodes=0;this.reducePercentage=50;this.scrollableElements={};this.defaultReduceHTMLOptions={checkElementInstanceType:!0,extraAllowedAttributes:[],initialChecksumId:void 0,forceIncludeFileInput:!1,forceIncludeAttribute:void 0,invalidateCache:!1,svgIntegration:"aria-label",includeFlashingElements:!0,onForceIncludeElement:l(()=>{},"onForceIncludeElement"),limitNodeRepetitions:50,stopFlashingElementsDetection:!1,assignChecksumIdsToAllElements:!0,assignRrwebIdsToAllElements:!0,fromTimeMachine:!1}}static{l(this,"HTMLReducer")}preprocessDocument(e=document){on("[preprocessDocument] querySelectorAllExtended");let t=de("*",e,{includeHTML:!0});an("[preprocessDocument] querySelectorAllExtended"),on("[preprocessDocument] isElementHidden");for(let r of t){if(this.shouldIgnoreElement(r))continue;let i=St(r,dd);r.setAttribute("checksum-data-visible",!i.isHidden&&!i.isTransparent?"true":"false"),!i.isHidden&&i.isTransparent&&r.setAttribute("checksum-data-transparently-visible","true"),i.isBehindTransparentElement&&r.setAttribute("checksum-data-visible-under-transparent-element","true"),i.clickOffset&&r.setAttribute("checksum-data-click-offset",`${i.clickOffset.x};${i.clickOffset.y}`),this.markScrollableElement(r)}an("[preprocessDocument] isElementHidden")}markScrollableElement(e){let{canScrollX:t,canScrollY:r,progressX:i,progressY:o}=mt.getScrollData(e);if(t&&(e.setAttribute("data-scrollable-x","true"),e.setAttribute("data-scrollable-x-progress",i.toString())),r&&(e.setAttribute("data-scrollable-y","true"),e.setAttribute("data-scrollable-y-progress",o.toString())),t||r)try{let{id:a}=this.getSessionMirror().getMeta(e);a&&(this.scrollableElements[a]={x:t?i:void 0,y:r?o:void 0})}catch(a){console.error("[markScrollableElement] Error getting rrwebId and updating scrollable elements",e,a)}}setSessionRecorder(e){this.sessionRecorder=e}markInteractableElements(e,t=document,{forceIncludeAttribute:r,forceIncludeFileInput:i}={}){on("[markInteractableElements]"),this.interactableElements=[];let o=Nn(t,e,{allowDisabled:!0,excludeCrossOriginIframes:!1}),a=l((d,p)=>(d._checksumid||(d._checksumid=p??this.checksumIdCounter.getAndIncrement()),d.setAttribute("checksumid",d._checksumid),d.setAttribute("checksuminteractable","true"),d._checksumid),"setChecksumIdForElement"),u=l((d,p=!1,g)=>{if(this.shouldIgnoreElement(d))return;let y=d.getAttribute("checksum-data-click-offset")?.split(";"),S=y&&{x:parseInt(y[0]),y:parseInt(y[1])},w=a(d,g);this.interactableElements.push({checksumId:w,element:d,forced:p,clickOffset:S})},"handleInteractableElement");o.forEach(d=>u(d));let f=l(d=>{de(d,t,{includeHTML:!0}).forEach(p=>u(p,!0))},"forceIncludeSelector");r&&f(`[${r}]`),i&&f("input[type='file']"),this.forceIncludeElements.filter(({element:d})=>d?.isConnected).forEach(({element:d,checksumid:p})=>u(d,!0,p)),console.log(`Marked ${this.interactableElements.length} interactable elements`),an("[markInteractableElements]")}truthyFilter(e){return!!e}shouldIgnoreElement(e){return e.hasAttribute(Ks)}getSessionMirror(e=!1){return e?window.checksum.timeMachine.sessionReplayer:this.sessionRecorder}generateSimplifiedDom(e,t,{extraAllowedAttributes:r=[],checkElementInstanceType:i=!0,forceIncludeAttribute:o=void 0,forceIncludeFileInput:a=!1,svgIntegration:u="aria-label",onForceIncludeElement:f=void 0,contentWindow:d=window,assignChecksumIdsToAllElements:p=!0,assignRrwebIdsToAllElements:g=!0,fromTimeMachine:y=!1}={}){if(!e)return null;let S=l((me,dt=me)=>{if(me._originalNode=dt,!Ye(me,"Element")||!Ye(dt,"Element"))return me;let ut=me,st=dt;if(p&&!st.hasAttribute("checksumid")&&(st._checksumid||(st._checksumid=this.checksumIdCounter.getAndIncrement()),ut.setAttribute("checksumid",st._checksumid),this.nonInteractableElementsFromSimplifiedDom.push({checksumId:st._checksumid,element:st})),g){let vn=this.getSessionMirror(y);if(vn){let Vt=vn.getMeta(st)?.id?.toString();Vt&&(ut.setAttribute("rrwebid",Vt),this.useRrwebIdsAsChecksumIds&&(ut.setAttribute("checksumid",Vt),ut._checksumid=Vt))}}return this.checksumIdToRRwebIdMap[st._checksumid]=parseInt(st._rrwebid),me},"processSimplifiedDOMNode"),w=l((me,dt=e)=>S(document.createTextNode(me),dt),"createTextNode"),E=l((me,dt=e)=>S(document.createElement(me),dt),"createElementNode");if(e.nodeType===Node.ELEMENT_NODE){let me=e;if(me.tagName.toLowerCase()==="head"||this.shouldIgnoreElement(me))return null}if(e.nodeType===Node.TEXT_NODE)return!e.parentElement||e.parentElement.getAttribute("checksum-data-visible")==="false"&&!e.parentElement.hasAttribute("checksumid")||e.parentElement.tagName.toLowerCase()==="body"?null:e.textContent?.trim()?w(e.textContent+" "):null;if(e.nodeType!==Node.ELEMENT_NODE||i&&!(Ye(e,"HTMLElement")||Ye(e,"SVGElement")))return null;let v=e,M=v.tagName.toLowerCase()==="iframe"&&v.contentDocument,R=ii(M?v.contentDocument.documentElement:v,{flattenShadowRootChildren:!0});t.esraSelectionRules?.limitChildren?.forEach(me=>{v.matches(me.selector)&&R.length>me.limit&&R.splice(me.limit)});let T=R.map(me=>this.generateSimplifiedDom(me,t,{extraAllowedAttributes:r,checkElementInstanceType:i,forceIncludeAttribute:o,forceIncludeFileInput:a,svgIntegration:u,onForceIncludeElement:f,contentWindow:M?v.contentWindow:d,assignChecksumIdsToAllElements:p,assignRrwebIdsToAllElements:g,fromTimeMachine:y})).filter(this.truthyFilter),N=v.getAttribute("checksum-data-visible")!=="false",U=v.hasAttribute("checksumid"),G=v.hasAttribute("role"),{customDescription:Q,customDescriptionTarget:W}=this.getElementCustomDescription(v,{enableSVGCustomDescription:!!u}),z=!!Q,re=v.hasAttribute("aria-label")||v.hasAttribute("name")||v.hasAttribute("alt"),B=v.hasAttribute(Wl)||this.forceIncludeElements.map(me=>me.element).includes(v)||!!o&&v.hasAttribute(o)||a&&v.tagName.toLowerCase()==="input"&&v.getAttribute("type")==="file",q=["form","button","input","textarea","a","table","th","tr","td","section","nav","header","footer","main","article","aside","li","ul","select","option","datalist"],k=U||N&&(G||re||z||v.matches(q.join(",")));if(!(k||B)){if(!T.length)return null;if(T.length===1&&!Ye(T[0],"Text"))return T[0]}!k&&B&&f?.(v);let X=l(()=>{if(z)switch(W){case"svg":switch(u){case"aria-label":let dt=E("svg");return dt.setAttribute("aria-label",Q),{simplifiedNode:dt,appendChildren:!1};case"text":if(v.hasAttribute("checksumid")){let st=E("div");return st.innerText=Q,{simplifiedNode:st,appendChildren:!1}}return{simplifiedNode:w(` [${Q}] `),appendChildren:!1}}}let me=v.tagName.toLowerCase()==="body"&&v.ownerDocument!==document?"div":v.tagName;return{simplifiedNode:E(me)}},"makeSimplifiedNode"),{simplifiedNode:Y,appendChildren:fe=!0}=X();if(!Ye(Y,"Element"))return Y;let Ae=Y,xe=["aria-.+","data-name","name","type","placeholder","content","value","role","icon","title","checksumid","checksuminteractable","checksum-get-more-items","checked","disabled","selected","label","required","inputmode","min","max","step","minlength","maxlength","alt","hidden","draggable","ondrop","ondragover","contenteditable","href","(data-)?test(-)?id"].concat(r),Cr=v.attributes;for(let me of Cr)for(let dt of xe)new RegExp("^"+dt+"$").test(me.name)&&Ae.setAttribute(me.name,me.value??!0);if(v.isContentEditable?Ae.setAttribute("contenteditable","true"):!["TEXTAREA","INPUT","SELECT"].includes(v.tagName)&&window.getComputedStyle(v).cursor==="text"&&Ae.setAttribute("contenteditable","cursor-text"),Ye(v,"HTMLInputElement")&&v.getAttribute("type")==="checkbox")v.checked&&Ae.setAttribute("checked","true");else if(Ye(v,"HTMLInputElement")||Ye(v,"HTMLSelectElement"))Ae.setAttribute("value",v.value);else if(Ye(v,"HTMLTextAreaElement")&&!v.childNodes.length&&v.value){let me=w(v.value);Ae.appendChild(me)}return fe&&T.forEach(me=>Ae.appendChild(me)),Ae}getElementCustomDescription(e,{enableSVGCustomDescription:t=!0}={}){return(Ye(e,"SVGElement")||e.tagName.toLowerCase()==="svg")&&t?{customDescriptionTarget:"svg",customDescription:this.getSVGDescriptionForElement(e)}:{}}getSVGDescriptionForElement(e){let t=this.findSvgElementDescriptionFromBank(e);if(t)return t;let r=e.querySelector("title");if(r)return r.textContent}findSvgElementDescriptionFromBank(e){return this.getSvgBank().find(t=>e.matches(`svg:has(${t.selector})`))?.description}getSvgBank(){return GS}restoreDom(e=document){de("*",e).forEach(r=>{r.removeAttribute("checksum-data-visible"),r.removeAttribute("checksum-data-transparently-visible"),r.removeAttribute("checksum-data-visible-under-transparent-element"),r.removeAttribute("checksumid"),r.removeAttribute("checksuminteractable"),r.removeAttribute("checksum-data-click-offset"),r.removeAttribute(Ks),r.removeAttribute(Wl),r.removeAttribute("data-scrollable-x"),r.removeAttribute("data-scrollable-y"),r.removeAttribute("data-scrollable-x-progress"),r.removeAttribute("data-scrollable-y-progress"),r.removeAttribute("rrwebid")})}removeAttribute(e){de("*",document).forEach(r=>{r.removeAttribute(e)})}async mapAndStoreSelectors(){let e={},t=new Tt;for(let{checksumId:r,element:i,clickOffset:o,selector:a,locator:u,parentFramesSelectors:f}of await t.injectSelectorsAndLocators(this.interactableElementsFromSimplifiedDom)){if(!a){console.warn("Unable to get selector for element",i);continue}let d=i;e[r]={element:d,selector:a,locator:u,clickOffset:o,parentFramesSelectors:f,innerText:d.innerText,rrwebId:this.checksumIdToRRwebIdMap[r]}}return e}shouldFurtherReduce(e){return e?e.outerHTML.length>XS:!0}async reduce(e=document,t,r={}){console.time("reduceHTML");let{initialChecksumId:i,forceIncludeAttribute:o,forceIncludeFileInput:a,invalidateCache:u,includeFlashingElements:f,limitNodeRepetitions:d,stopFlashingElementsDetection:p}=this.lastReduceHTMLOptions={...this.defaultReduceHTMLOptions,...r},g=_t.getInstance("reduce",{target:e,monitorInput:!0,invalidate:u,log:!1});if(g.hasCache())return g.get();let y=f?this.flashingElementsDetector.get():void 0;p&&this.flashingElementsDetector.stop(),this.nodeRepetitionsThreshold=d,this.reducePercentage=50,this.templateNodes=void 0,this.excludedNodes=0,this.scrollableElements={};let S=l(M=>qS(M,{forceIncludeAttribute:o,forceIncludeFileInput:a,forceIncludeElements:this.forceIncludeElements.map(R=>R.element),limit:Math.min(Math.ceil(M.element.children.length*(this.reducePercentage/100)),M.element.children.length-6)}),"templateReducer");console.log("Running pre-templatize"),this.templatize(S),console.log("Preprocessing document..."),this.preprocessDocument(e);let w;for((i||!this.checksumIdCounter)&&(this.checksumIdCounter=new Ri(i??"0")),console.log("Marking interactable elements..."),this.markInteractableElements(t,e,{forceIncludeAttribute:o,forceIncludeFileInput:a});;){if(console.log("Generating simplified DOM..."),this.nonInteractableElementsFromSimplifiedDom=[],w=this.generateSimplifiedDom(e.documentElement,t,this.lastReduceHTMLOptions),!w)throw new Error("Unable to get simplified DOM");if(this.shouldFurtherReduce(w)){if(console.log(`Will further reduce (${w.outerHTML.length})...`),!this.templatize(S)){console.log(`Exceeded maximum html reduction, stopping (html size: ${w.outerHTML.length})`);break}}else break}console.log("Simplified DOM generated, length:",w.outerHTML.length);let E=new Set(Array.from(w.querySelectorAll("[checksumid]")).map(M=>M.getAttribute("checksumid")));this.interactableElementsFromSimplifiedDom=this.interactableElements.filter(M=>E.has(M.checksumId)),console.log(`Found ${this.interactableElementsFromSimplifiedDom.length} interactable elements in simplified DOM vs ${this.interactableElements.length} in original DOM`),console.log("Restoring DOM..."),this.restoreDom(e),this.preMapReducedHTMLSelectors=xk?!1:!!t.preMapReducedHTMLSelectors,this.preMapReducedHTMLSelectors?(console.log("Mapping selectors..."),this.selectors=await this.mapAndStoreSelectors(),console.log("Done mapping selectors")):this.selectors={},this.elementsInSimplifiedDomByChecksumId=[...this.interactableElementsFromSimplifiedDom,...this.nonInteractableElementsFromSimplifiedDom].reduce((M,R)=>(M[R.checksumId]=R,M),{});let v={reducedDomHTMLElement:w,reducedHTML:w.outerHTML,currentChecksumId:this.checksumIdCounter.get(),flashingHTML:y,scrollableElements:this.scrollableElements};return g.set(v),console.timeEnd("reduceHTML"),v}templatize(e){let t=this.excludedNodes,r=l(()=>Array.from(this.templateNodes).reduce((i,o)=>i+e(o).length,0),"calcExculdedNodes");if(!this.templateNodes)this.templateNodes=vr(document.body,{nodeRepetitionsThreshold:this.nodeRepetitionsThreshold}),this.excludedNodes=r();else do{if(this.reducePercentage<98)this.reducePercentage=Math.min(this.reducePercentage+20,98),console.log("Increasing reduce percentage to",this.reducePercentage);else{if(this.nodeRepetitionsThreshold<=20)return!1;this.reducePercentage=50,this.nodeRepetitionsThreshold-=10,console.log("Reducing node repetitions threshold to",this.nodeRepetitionsThreshold),this.templateNodes=vr(document.body,{nodeRepetitionsThreshold:this.nodeRepetitionsThreshold})}this.excludedNodes=r()}while(t===this.excludedNodes);return console.log(`[templatize] ${this.excludedNodes} elements marked to ignore for ${this.templateNodes.length} templates`),!0}getMoreElementsFromTemplate(e,t){try{let r=this.templateNodes.find(d=>d.id===e);if(!r)throw new Error("Template not found");let{element:i,excludedElements:o}=r;console.log("Preprocessing template node..."),this.preprocessDocument(i),console.log("Marking template interactable elements..."),this.markInteractableElements(t,i,this.lastReduceHTMLOptions);let a=[],u=l(()=>a.map(d=>d.outerHTML).join(""),"getElementsHTML"),f=o.values();for(;u().length<XS*.5;){let d=f.next().value;if(!d)break;let p=Array.from(d.querySelectorAll("[checksumid]")).concat(d._checksumid?[d]:[]);this.interactableElements.filter(g=>p.includes(g.element)).forEach(g=>{this.elementsInSimplifiedDomByChecksumId[g.element._checksumid]=g}),a.push(this.generateSimplifiedDom(d,t,this.lastReduceHTMLOptions)),o.delete(d)}return this.restoreDom(i),{items:u(),hasMoreItems:o.size>0}}catch(r){console.error("[getMoreElementsFromTemplate] error",r);return}}async getSelectorForChecksumId(e,{forceGenerate:t=!1}={}){let r=l(d=>({selector:e,element:d?d.element:null,locator:"",parentFramesSelectors:[],invalid:!0,rrwebId:this.checksumIdToRRwebIdMap[e],clickOffset:d?.clickOffset,innerText:d?d.element.innerText:""}),"makeDefaultResult"),i=new Tt,o=this.elementsInSimplifiedDomByChecksumId[e];if(!o||!o.element.isConnected)return this.preMapReducedHTMLSelectors&&this.selectors[e]?this.selectors[e]:r(o);let{selector:a,locator:u,parentFramesSelectors:f}=await i.getSelectorAndLocator(o.element);return{...r(o),selector:a,locator:u,parentFramesSelectors:f,invalid:!1}}getElementForChecksumId(e){return this.elementsInSimplifiedDomByChecksumId[e]?.element}hasInnerTextByChecksumId(e,{maxLength:t=void 0,minLength:r=void 0}={}){if(!this.preMapReducedHTMLSelectors){let o=this.elementsInSimplifiedDomByChecksumId[e]?.element?.innerText;return!(!o||r&&o.length<r||t&&o.length>t)}return!!this.selectors[e]?.innerText}getInteractableElements(){return this.interactableElements}getInteractableElementsInReducedHTML(){return this.interactableElementsFromSimplifiedDom}startFlashingElementsDetection(){return this.flashingElementsDetector.start()}addForceIncludeElement(e){this.forceIncludeElements.push(e),e.element._checksumid=e.checksumid}};function JS(n){return n._debugSource?.fileName?n._debugSource?.fileName:""}l(JS,"getComponentpath");function ZS(n,e){if(n==="Unknown"||typeof n!="string"||n[0]!==n[0].toUpperCase()||e.type.$$typeof===Symbol.for("react.context")||e.type.$$typeof===Symbol.for("react.forward_ref")||e.type.$$typeof===Symbol.for("react.memo")||e.type.$$typeof===Symbol.for("react.profiler")||e.type.$$typeof===Symbol.for("react.suspense"))return!1;let t=JS(e);return!(/.*\/node_modules\//.test(t)||n===t||/^(?!.*src).*$/.test(t))}l(ZS,"isComponentAllowed");function pd(n,e={}){if(!n)return["",{}];let t=n.type,r=t?t.name||t:"Unknown",i="";if(ZS(r,n)){i+=`<${r}>`;let o=JS(n);e[r]=o}if(n.child){let[o,a]=pd(n.child,e);i+=o,e={...e,...a}}if(ZS(r,n)&&(i+=`</${r}>`),n.sibling){let[o,a]=pd(n.sibling,e);i+=o,e={...e,...a}}return[i,e]}l(pd,"traverseReactTree");function QS(n){let e=n._reactRootContainer?._internalRoot.current;return e||console.log("No react tree in element",n),pd(e)}l(QS,"getReactTree");var Oi=class n{static{l(this,"FrontendLogger")}static{this.overriddenMethods=["log","warn","error"]}static{this.original={}}static removePrefix(){this.overriddenMethods.forEach(e=>{n.original[e]&&(console[e]=n.original[e])})}static setPrefix(e){this.overriddenMethods.forEach(t=>{n.original[t]||(n.original[t]=console[t]),console[t]=(...r)=>{r.unshift(e),n.original[t].apply(console,r)}})}};var Ul=class{constructor(e=i=>i.map(o=>o.target),t={childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0},r={collectElement:!0}){this.filterElements=e;this.observeOptions=t;this.options=r;this.mutationEventListeners=[]}static{l(this,"MutationDetector")}addEventListener(e,t){this.mutationEventListeners.push({selector:e,listener:t})}startListening(){this.elements=[],this.observer=new MutationObserver(e=>{this.options.collectElement&&(this.elements=[...this.elements,...this.filterElements(e)]),this.mutationEventListeners.length&&e.forEach(t=>{t.addedNodes.forEach(r=>{if(r.nodeType!==Node.ELEMENT_NODE)return;let i=r;this.mutationEventListeners.forEach(o=>{i.matches(o.selector)?o.listener(i):i.querySelectorAll(o.selector).forEach(a=>{o.listener(a)})})})})}),this.observer.observe(document.body,this.observeOptions)}stopListening(){return this.observer.disconnect(),this.elements}};function ew(n){let e=n.filter(r=>r.addedNodes.length>0).reduce((r,i)=>[...r,...i.addedNodes],[]),t=n.filter(r=>r.type==="attributes"&&r.attributeName==="style"&&r.target instanceof HTMLElement&&/display\s*:\s*none/.test(r.oldValue)&&fa(r.target).visible).map(r=>r.target);return[...e,...t]}l(ew,"poppingElementsFilter");function Ck(n,e){let t=new Set;for(;n;)t.add(n),n=n.parentNode;for(;e;){if(t.has(e))return e;e=e.parentNode}return null}l(Ck,"findCommonAncestor");function md(n,e){let t=Ck(n,e),r=0,i;if(!t)return 99999;for(i=n;i&&i!==t;)r++,i=i.parentNode;for(i=e;i&&i!==t;)r++,i=i.parentNode;return r}l(md,"distanceBetweenNodes");var gd=class{constructor(){this.lastHighlights=[]}static{l(this,"ElementHighlighter")}clearHighlights(){this.lastHighlights.length&&(this.lastHighlights.forEach(e=>e.remove()),this.lastHighlights=[])}highlightElement(e,{highlightStyle:t={},textStyle:r={},mousePosition:i,text:o,textType:a="static",textPosition:u="overlap",textWidthType:f="rect",clear:d=!0,shouldFlipHighlightTextOutsideViewport:p=!0,pointerEvents:g,classNames:y=[],renderDocument:S,scroll:w=!1}={}){if(d&&this.clearHighlights(),!e)return;let E={left:0,top:0,right:0,bottom:0},v=1,M=1;if(S!==e.ownerDocument){let z=e.ownerDocument.defaultView?.frameElement;for(;z&&z.contentDocument!==S;){let re=z.getBoundingClientRect(),B=this.getScaleFromStyles(z);v*=B.scaleX,M*=B.scaleY,E.left+=re.left,E.top+=re.top,z=z.ownerDocument.defaultView?.frameElement}}let R=S??e.ownerDocument,T=pf(e),N=e.getBoundingClientRect(),U={top:N.top*M+E.top,left:N.left*v+E.left};if(!T){let z=R.defaultView?.scrollX||0,re=R.defaultView?.scrollY||0;U.left+=z,U.top+=re}let G=R.createElement("div");if(G.style.outline="2px dashed rgba(255,0,0,.75)",G.style.position=T?"fixed":"absolute",G.style.left=U.left+"px",G.style.top=U.top+"px",G.style.width=N.width*v+"px",G.style.height=N.height*M+"px",G.style.pointerEvents=g??"none",G.style.zIndex="2147483647",G.className=["checksum-dom-cache-ignore",...y].join(" "),this.mergeStyle(G,t),i){let z=R.createElement("div");if(z.style.position="absolute",z.style.left=+i.x-16+"px",z.style.top=+i.y-16+"px",z.style.color="#004DFF",z.className=["checksum-dom-cache-ignore","mouse-cross",...y].join(" "),z.style.zIndex="2147483648",!R.head.querySelector("style[role=mouse-location]")){var Q=R.head.appendChild(R.createElement("style"));Q.setAttribute("role","mouse-location"),Q.innerHTML=".mouse-cross:before, .mouse-cross:after {position: absolute;left: 15px;content: ' ';height: 33px;width: 3px;background-color: #004DFF;}.mouse-cross:before {transform: rotate(0deg);}.mouse-cross:after {transform: rotate(-90deg);}"}R.body.appendChild(z),this.lastHighlights.push(z)}let W=R.createElement("div");o&&(W.className=["checksum-dom-cache-ignore",...y].join(" "),W.innerText=o,W.style.fontSize="12px",W.style.width=f==="rect"?`${N.width}px`:"auto",W.style.background="#000000a1",W.style.color="white",W.style.padding="5px",W.style.position="absolute",W.style.pointerEvents="none",W.style.userSelect="none",u==="above"?W.style.bottom=`${N.height}px`:u==="below"&&(W.style.top=`${N.height}px`),this.mergeStyle(W,r),G.appendChild(W),G.style.pointerEvents=g??"none",a==="hover"&&(W.style.display="none",G.addEventListener("mouseover",()=>{W.style.display="block"}),G.addEventListener("mouseout",()=>{W.style.display="none"}))),R.body.appendChild(G),u==="above"&&mf(W)>0?(W.style.bottom="initial",W.style.top=`${N.height}px`):u==="below"&&gf(W)>0&&(W.style.top="initial",W.style.bottom=`${N.height}px`),this.lastHighlights.push(G),p&&this.flipHighlightTextPositionOutsideViewport(W,u,N.height),w&&new mt(e).scrollIntoView()}getScaleFromStyles(e){let t=window.getComputedStyle(e),r=t.transform;if(r.startsWith("matrix")){let i=parseFloat(r.split(",")[0].replace("matrix(",""))||1,o=parseFloat(r.split(",")[3])||1;return{scaleX:i,scaleY:o}}else if(t.scale){let i=parseFloat(t.scale)||1,o=parseFloat(t.scale)||1;return{scaleX:i,scaleY:o}}return{scaleX:1,scaleY:1}}mergeStyle(e,t){for(let r in t)e.style[r]=t[r]}flipHighlightTextPositionOutsideViewport(e,t,r){t==="above"&&mf(e)>0?(e.style.bottom="initial",e.style.top=`${r}px`):t==="below"&&gf(e)>0&&(e.style.top="initial",e.style.bottom=`${r}px`)}},Vr=new gd;function Gl(n,e){return typeof n!="string"?tw(n):`${JSON.stringify(n)}${e?"s":"i"}`}l(Gl,"escapeForTextSelector");function zl(n,e=!1){return typeof n!="string"?tw(n):`"${n.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${e?"s":"i"}`}l(zl,"escapeForAttributeSelector");function tw(n){return n.unicode||n.unicodeSets?String(n):String(n).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}l(tw,"escapeRegexForSelector");var Mk=10,Ni=Mk/2;var Tk=100,Ik=120,Ak=140,Rk=160,Ok=180,Lk=200;var N3=Tk+Ni,_3=Ik+Ni,D3=Ak+Ni,k3=Rk+Ni,P3=Ok+Ni,F3=Lk+Ni;function Li(n){let e={full:"",immediate:[]};if(!Nk(n)){let t="";if(n instanceof HTMLInputElement&&(n.type==="submit"||n.type==="button"))e={full:n.value,immediate:[n.value]};else{for(let r=n.firstChild;r;r=r.nextSibling)r.nodeType===Node.TEXT_NODE?(e.full+=r.nodeValue||"",t+=r.nodeValue||""):(t&&e.immediate.push(t),t="",r.nodeType===Node.ELEMENT_NODE&&(e.full+=Li(r).full));t&&e.immediate.push(t),n.shadowRoot&&(e.full+=Li(n.shadowRoot).full)}}return e}l(Li,"elementText");function jl(n){return n.replace(/\u200b/g,"").trim().replace(/\s+/g," ")}l(jl,"normalizeWhiteSpace");function Nk(n){let e=n.ownerDocument;return n.nodeName==="SCRIPT"||n.nodeName==="NOSCRIPT"||n.nodeName==="STYLE"||e.head&&e.head.contains(n)}l(Nk,"shouldSkipForTextMatching");function Xs(n){return n.trim().replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}l(Xs,"escapeSelector");function Ur(n){let e=n.ownerDocument.defaultView;return e!==window&&!e.playwright&&(e.playwright=window.playwright),e.playwright}l(Ur,"getElementWindowPlaywright");var ql=["role","aria-label","aria-labelledby","aria-checked","checked","placeholder","title","alt","id","data-testid","data-test-id","data-test","class","id","style","href","src","path","type"];function _i(n){return typeof n=="object"&&n!==null&&n.nodeType===Node.ELEMENT_NODE}l(_i,"isElement");var Bn={NONE:"",DESCENDANT:" ",CHILD:" > "},$e={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function rw(n,e){return Object.values(n).includes(e)}l(rw,"isEnumValue");var _k="CssSelectorGenerator";function Di(n="unknown problem",...e){console.warn(`${_k}: ${n}`,...e)}l(Di,"showWarning");var Dk={selectors:[$e.id,$e.class,$e.tag,$e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function kk(n){return Array.isArray(n)?n.filter(e=>rw($e,e)):[]}l(kk,"sanitizeSelectorTypes");function yd(n){return n instanceof RegExp}l(yd,"isRegExp");function Pk(n){return["string","function"].includes(typeof n)||yd(n)}l(Pk,"isCssSelectorMatch");function nw(n){return Array.isArray(n)?n.filter(Pk):[]}l(nw,"sanitizeCssSelectorMatchList");function Fk(n){return n instanceof Node}l(Fk,"isNode");function iw(n){let e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return Fk(n)&&e.includes(n.nodeType)}l(iw,"isParentNode");function bd(n,e){if(iw(n))return n.contains(e)||Di("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),n;let t=e.getRootNode({composed:!1});return iw(t)?(t!==document&&Di("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),t):Zs(e)}l(bd,"sanitizeRoot");function sw(n){return typeof n=="number"?n:Number.POSITIVE_INFINITY}l(sw,"sanitizeMaxNumber");function ow(n,e={}){let t=Object.assign(Object.assign({},Dk),e);return{selectors:kk(t.selectors),whitelist:nw(t.whitelist),blacklist:nw(t.blacklist),root:bd(t.root,n),combineWithinSelector:!!t.combineWithinSelector,combineBetweenSelectors:!!t.combineBetweenSelectors,includeTag:!!t.includeTag,maxCombinations:sw(t.maxCombinations),maxCandidates:sw(t.maxCandidates)}}l(ow,"sanitizeOptions");function Sr(n=[]){let[e=[],...t]=n;return t.length===0?e:t.reduce((r,i)=>r.filter(o=>i.includes(o)),e)}l(Sr,"getIntersection");function Yl(n){return[].concat(...n)}l(Yl,"flattenArray");function $k(n){return n.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")}l($k,"wildcardToRegExp");function Js(n){let e=n.map(t=>{if(yd(t))return r=>t.test(r);if(typeof t=="function")return r=>{let i=t(r);return typeof i!="boolean"?(Di("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):i};if(typeof t=="string"){let r=new RegExp("^"+$k(t)+"$");return i=>r.test(i)}return Di("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(r=>r(t))}l(Js,"createPatternMatcher");function ki(n,e,t){let r=Array.from(bd(t,n[0]).querySelectorAll(e));return r.length===n.length&&n.every(i=>r.includes(i))}l(ki,"testSelector");function vd(n,e){e=e??Zs(n);let t=[],r=n;for(;_i(r)&&r!==e;)t.push(r),r=r.parentElement;return t}l(vd,"getElementParents");function aw(n,e){return Sr(n.map(t=>vd(t,e)))}l(aw,"getParents");function Zs(n){return n.ownerDocument.querySelector(":root")}l(Zs,"getRootNode");var Kl=", ",lw=new RegExp(["^$","\\s"].join("|")),cw=new RegExp(["^$"].join("|")),Xl=[$e.nthoftype,$e.tag,$e.id,$e.class,$e.attribute,$e.nthchild];var Hk=Js(["class","id","ng-*"]);function Bk({name:n}){return`[${n}]`}l(Bk,"attributeNodeToSimplifiedSelector");function Wk({name:n,value:e}){return`[${n}='${e}']`}l(Wk,"attributeNodeToSelector");function Vk({nodeName:n,nodeValue:e},t){let r=t.tagName.toLowerCase();return["input","option"].includes(r)&&n==="value"||n==="src"&&e?.startsWith("data:")?!1:!Hk(n)}l(Vk,"isValidAttributeNode");function Uk({nodeName:n,nodeValue:e}){return{name:Gr(n),value:Gr(e??void 0)}}l(Uk,"sanitizeAttributeData");function Sd(n){let e=Array.from(n.attributes).filter(t=>Vk(t,n)).map(Uk);return[...e.map(Bk),...e.map(Wk)]}l(Sd,"getElementAttributeSelectors");function uw(n){let e=n.map(Sd);return Sr(e)}l(uw,"getAttributeSelectors");function wd(n){var e;return((e=n.getAttribute("class"))!==null&&e!==void 0?e:"").trim().split(/\s+/).filter(t=>!cw.test(t)).map(t=>`.${Gr(t)}`)}l(wd,"getElementClassSelectors");function fw(n){let e=n.map(wd);return Sr(e)}l(fw,"getClassSelectors");function Ed(n){var e;let t=(e=n.getAttribute("id"))!==null&&e!==void 0?e:"",r=`#${Gr(t)}`,i=n.getRootNode({composed:!1});return!lw.test(t)&&ki([n],r,i)?[r]:[]}l(Ed,"getElementIdSelectors");function hw(n){return n.length===0||n.length>1?[]:Ed(n[0])}l(hw,"getIdSelector");function xd(n){let e=n.parentNode;if(e){let r=Array.from(e.childNodes).filter(_i).indexOf(n);if(r>-1)return[`:nth-child(${String(r+1)})`]}return[]}l(xd,"getElementNthChildSelector");function dw(n){return Sr(n.map(xd))}l(dw,"getNthChildSelector");function Cd(n){return[Gr(n.tagName.toLowerCase())]}l(Cd,"getElementTagSelectors");function Zl(n){let e=[...new Set(Yl(n.map(Cd)))];return e.length===0||e.length>1?[]:[e[0]]}l(Zl,"getTagSelector");function Md(n){let e=Zl([n])[0],t=n.parentElement;if(t){let i=Array.from(t.children).filter(o=>o.tagName.toLowerCase()===e).indexOf(n);if(i>-1)return[`${e}:nth-of-type(${String(i+1)})`]}return[]}l(Md,"getElementNthOfTypeSelector");function pw(n){return Sr(n.map(Md))}l(pw,"getNthOfTypeSelector");function*Gk(n=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let t=0,r=Td(1);for(;r.length<=n.length&&t<e;)t+=1,yield r.map(o=>n[o]),r=zk(r,n.length-1)}l(Gk,"powerSetGenerator");function Id(n=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Gk(n,{maxResults:e}))}l(Id,"getPowerSet");function zk(n=[],e=0){let t=n.length;if(t===0)return[];let r=[...n];r[t-1]+=1;for(let i=t-1;i>=0;i--)if(r[i]>e){if(i===0)return Td(t+1);r[i-1]++,r[i]=r[i-1]+1}return r[t-1]>e?Td(t+1):r}l(zk,"bumpOffsets");function Td(n=1){return Array.from(Array(n).keys())}l(Td,"generateOffsets");function mw(n={}){let e=[];return Object.entries(n).forEach(([t,r])=>{e=r.flatMap(i=>e.length===0?[{[t]:i}]:e.map(o=>Object.assign(Object.assign({},o),{[t]:i})))}),e}l(mw,"getCartesianProduct");var jk="3a".toUpperCase(),qk=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Gr(n=""){return CSS?CSS.escape(n):Yk(n)}l(Gr,"sanitizeSelectorItem");function Yk(n=""){return n.split("").map(e=>e===":"?`\\${jk} `:qk.test(e)?`\\${e}`:escape(e).replace(/%/g,"\\")).join("")}l(Yk,"legacySanitizeSelectorItem");var Kk={tag:Zl,id:hw,class:fw,attribute:uw,nthchild:dw,nthoftype:pw},Xk={tag:Cd,id:Ed,class:wd,attribute:Sd,nthchild:xd,nthoftype:Md};function gw(n,e){return Xk[e](n)}l(gw,"getElementSelectorsByType");function Zk(n,e){let t=Kk[e];return t(n)}l(Zk,"getSelectorsByType");function Jk(n=[],e,t){return n.filter(r=>t(r)||!e(r))}l(Jk,"filterSelectors");function Qk(n=[],e){return n.sort((t,r)=>{let i=e(t),o=e(r);return i&&!o?-1:!i&&o?1:0})}l(Qk,"orderSelectors");function eP(n,e,t){let r=tP(n,t),i=sP(r,t),o=Yl(i);return[...new Set(o)]}l(eP,"getAllSelectors");function tP(n,e){let{blacklist:t,whitelist:r,combineWithinSelector:i,maxCombinations:o}=e,a=Js(t),u=Js(r),f=l((d,p)=>{let g=Zk(n,p),y=Jk(g,a,u),S=Qk(y,u);return d[p]=i?Id(S,{maxResults:o}):S.map(w=>[w]),d},"reducer");return rP(e).reduce(f,{})}l(tP,"getSelectorsList");function rP(n){let{selectors:e,includeTag:t}=n,r=[...e];return t&&!r.includes("tag")&&r.push("tag"),r}l(rP,"getSelectorsToGet");function nP(n){return n.includes($e.tag)||n.includes($e.nthoftype)?[...n]:[...n,$e.tag]}l(nP,"addTagTypeIfNeeded");function iP(n){let{selectors:e,combineBetweenSelectors:t,includeTag:r,maxCandidates:i}=n,o=t?Id(e,{maxResults:i}):e.map(a=>[a]);return r?o.map(nP):o}l(iP,"combineSelectorTypes");function sP(n,e){return iP(e).map(t=>oP(t,n)).filter(t=>t.length>0)}l(sP,"getTypeCombinations");function oP(n,e){let t={};return n.forEach(i=>{let o=e[i];o&&o.length>0&&(t[i]=o)}),mw(t).map(lP)}l(oP,"constructSelectors");function aP(n,e){return e[n]?e[n].join(""):""}l(aP,"constructSelectorType");function lP(n={}){let e=[...Xl];return n[$e.tag]&&n[$e.nthoftype]&&e.splice(e.indexOf($e.tag),1),e.map(t=>aP(t,n)).join("")}l(lP,"constructSelector");function cP(n,e){return[...n.map(t=>e+Bn.DESCENDANT+t),...n.map(t=>e+Bn.CHILD+t)]}l(cP,"generateCandidateCombinations");function uP(n,e){return e===""?n:cP(n,e)}l(uP,"generateCandidates");function fP(n,e,t="",r){let i=eP(n,e,r),o=uP(i,t);for(let a of o)if(ki(n,a,e))return a;return null}l(fP,"getSelectorWithinRoot");function yw(n,e,t="",r){if(n.length===0)return null;let i=[n.length>1?n:[],...aw(n,e).map(o=>[o])];for(let o of i){let a=fP(o,e,t,r);if(a)return{foundElements:o,selector:a}}return null}l(yw,"getClosestIdentifiableParent");function bw(n){(n instanceof NodeList||n instanceof HTMLCollection)&&(n=Array.from(n));let e=(Array.isArray(n)?n:[n]).filter(_i);return[...new Set(e)]}l(bw,"sanitizeSelectorNeedle");function hP(n){return{value:n,include:!1}}l(hP,"createElementSelectorData");function vw(n,e,t=Bn.NONE){let r={};return e.forEach(i=>{Reflect.set(r,i,gw(n,i).map(hP))}),{element:n,operator:t,selectors:r}}l(vw,"createElementData");function Sw({selectors:n,operator:e}){let t=[...Xl];n[$e.tag]&&n[$e.nthoftype]&&(t=t.filter(i=>i!==$e.tag));let r="";return t.forEach(i=>{var o;((o=n[i])!==null&&o!==void 0?o:[]).forEach(({value:u,include:f})=>{f&&(r+=u)})}),e+r}l(Sw,"constructElementSelector");function dP(n){return[":root",...vd(n).reverse().map(r=>{let i=vw(r,[$e.nthchild],Bn.CHILD);return i.selectors.nthchild.forEach(o=>{o.include=!0}),i}).map(Sw)].join("")}l(dP,"getElementFallbackSelector");function ww(n){return n.map(dP).join(Kl)}l(ww,"getFallbackSelector");function Ad(n,e={}){var t;let r=bw(n),i=ow(r[0],e),o=(t=i.root)!==null&&t!==void 0?t:Zs(r[0]),a="",u=o;function f(){return yw(r,u,a,i)}l(f,"updateIdentifiableParent");let d=f();for(;d;){let{foundElements:p,selector:g}=d;if(ki(r,g,o))return g;u=p[0],a=g,d=f()}return r.length>1?r.map(p=>Ad(p,i)).join(Kl):ww(r)}l(Ad,"getCssSelector");var Qs=l(n=>new Promise(e=>setTimeout(e,n)),"awaitSleep"),xw=l(async(n,e=1e3,t)=>{if(e===null)return n;let r="guard-timed-out",i=l(async()=>(await Qs(e+1e3),r),"guard"),o=await Promise.race([n,i()]);if(typeof o=="string"&&o===r)throw typeof t=="function"?new Error(t()):new Error(t??"guardReturnTimedOut");return o},"guardReturn");var pP=!1,gn=class n{constructor(e){this.locators=[];this.elements=[];this.locators=e}static{l(this,"LocatorChain")}hasDuplicateFilters(){let e=this.locators.map(t=>t.options?.hasText).filter(t=>t);return e.length!==new Set(e).size}cloneAndAddCandidate(e){return new n([e,...this.locators.slice()])}toLocatorCandidate(){return{selector:this.getSelector(),locator:this.getLocator()}}getSelector(){return this.locators.map(e=>e.selector).join(" >> ")}getLocator(){return this.locators.map(e=>e.locator).join(".")}},yn=class n{constructor(e=document){this.rootNode=e;this.MAX_TESTING_SELECTORS=50;this.MAX_SINGLE_ELEMENT_SELECTORS=5;this.MAX_PROCESSING_TIME=15e3;this.MAX_MULTICANDIDATE_PROCESSING=5}static{l(this,"PlaywrightCustomLocatorGenerator")}async generate(e,t=[],r={}){let{isPartOfListItem:i,isForContextElement:o,useTextContent:a,addCSSSelectorGenerator:u,expandCSSKeyElements:f,bruteForceMode:d}={isPartOfListItem:!1,isForContextElement:!1,useTextContent:!0,addCSSSelectorGenerator:!0,expandCSSKeyElements:!0,bruteForceMode:!1,...r};if(Ye(e,"HTMLOptionElement")&&e.closest("select"))return this.generate(e.closest("select"),t,{isPartOfListItem:i});this.targetElement=e,this.startTimestamp=Date.now();let p=[];for(t=t.filter(y=>Array.from(document.querySelectorAll(y.selector)).includes(y.element)),f&&this.expandCSSKeyFeatures(e,t);e&&e!==this.rootNode;){await Qs(0);let y=this.getAllLocators(e,t,{useTextContent:a,bruteForceMode:d}),S=[],w=l(async E=>{if(!E.hasDuplicateFilters())try{await Qs(0);let{elements:v}=this.getLocatorBase(e).locator(E.getSelector());v?.some(M=>M===this.targetElement)&&(E.elements=v.filter(M=>mn(M)||M.constructor.name===this.targetElement.constructor.name),S.push(E))}catch(v){console.log(v,E.getSelector())}},"testCandidate");if(p.length)for(let E of y)for(let v of p)await w(v.cloneAndAddCandidate(E));else for(let E of y)await w(new gn([E]));if(S.length===0&&p.length===0){let E=e.tagName.toLowerCase();p.push(new gn([{selector:E,locator:this.getSelectorLocator(E),elements:this.getLocatorBase(e).locator(e.tagName.toLowerCase()).elements.filter(v=>mn(v))}]))}if(p.push(...S),o)return p.map(E=>E.toLocatorCandidate());if(p.length>this.MAX_TESTING_SELECTORS||p.filter(E=>E.elements.length===1).length>this.MAX_SINGLE_ELEMENT_SELECTORS||this.checkTimeout(!1))break;e=e.parentElement}if(i){let y=this.filterListItemsSelectors(p);if(y?.length)return y.map(S=>({...S.toLocatorCandidate(),isListSelector:!0}))}let g=[];try{for(let y of p)this.checkTimeout(),g.push(...y.elements.length===1?[y]:await this.reduceMultiCandidates(y))}catch(y){y instanceof sn&&console.warn("[PlaywrightCustomLocatorGenerator] Timeout error")}if(!g?.length&&(console.log("no single element selector found"),!f))return this.generate(e,t,{isPartOfListItem:i,isForContextElement:o,useTextContent:a,addCSSSelectorGenerator:!0,expandCSSKeyElements:!0});if(u){let y=await this.addCSSSelectorGenerator();y&&g.unshift(y)}if(this.rootNode===document&&a){let{selector:y,locator:S}=await new Tt().getSelectorAndLocator(this.targetElement);g.unshift(new gn([{selector:y,locator:S}]))}return g=g.concat(await this.addOptionalParentSelector(a,u,f)),Array.from(new Map(g.map(y=>[y.toLocatorCandidate().selector,y.toLocatorCandidate()])).values())}testSelector(e,t,r,i=!0){let o=Ur(t).selector(t),a=this.getLocatorBase(t).locator(o);console.log("Locator result",a);let u=l(d=>i&&(d.elements.length!==1||t!==d.element)?!1:!!d.elements.includes(t),"testResult");if(!u(a))return{valid:!1};let f={};if(r?.locatorWithVars?.length)try{let p=new Function(`{ return function(element) { ${r.variablesCode}; return this.getLocatorBase(element).locator(\`${r.locatorWithVars}\`); } }`)().call(this,t);if(console.log("Locator with vars result",p),!u(p))return{valid:!1};f={selectorWithVars:o,locatorWithVars:r.locatorWithVars}}catch(d){return console.error("Error testing selector with variables",d.message),{valid:!1}}return{valid:!0,selector:o,locator:e,...f}}async addCSSSelectorGenerator(){try{let e=this.rootNode===document?{}:{root:this.rootNode},t=await xw(new Promise(r=>{let i=Ad(this.targetElement,e);r(i)}),2e3);if(t.length<50)return new gn([{selector:t,locator:`locator('${t}')`}])}catch(e){console.error("Error getting CSS selector",e)}}async addOptionalParentSelector(e,t,r){try{let i=Ur(this.targetElement),o=i.locator(i.selector(this.targetElement)).element;if(o!==this.targetElement&&o?.contains(this.targetElement))return(await this.generate(o,[],{isPartOfListItem:!1,isForContextElement:!1,useTextContent:e,addCSSSelectorGenerator:t,expandCSSKeyElements:r})).map(({selector:a,locator:u})=>new gn([{selector:a,locator:u}]))}finally{return[]}}expandCSSKeyFeatures(e,t,r=4){try{let i=[];for(;e&&e!==this.rootNode&&i.length<r&&e!==document.documentElement;)Array.from(e.attributes).filter(({name:a,value:u})=>u.length<30&&!ql.includes(a)).forEach(a=>{try{if(i.length>r-1)return;let u=`[${a.name}${a.value?`="${a.value}"`:""}]`;try{if(!e.parentElement||e.parentElement.querySelectorAll(u).length>1)return}catch{console.warn(`Error checking selector - ${u}, continuing`);return}if(!t.some(f=>f.selector.includes(u))&&this.getLocatorBase(e).locator(u).element===e){let f={element:e,selector:u};t.push(f),i.push(f)}}catch(u){console.warn("Error processing css key feature",{name:a.name,value:a.value},u)}}),e=e.parentElement;i.length}catch(i){console.error("Error extracting CSS key features",i)}}async generateArbitraryItemListSelector(e,t=[]){console.log("generateArbitraryItemListSelector",e);try{let r=vr(document.body,{nodeRepetitionsThreshold:5});if(!r?.length)throw new Error("No templates found in the page");let i=r.find(y=>y.element.contains(e));if(!i)throw new Error("No template found for target element");console.log("Found template for target element",i);let o=await new n().generate(i.element,t,{isPartOfListItem:!1,isForContextElement:!1,useTextContent:!1});console.log("baseCustomSelectors",o);let a=o[0].selector,u=this.getSelectorLocator(a,i.element);console.log("Randomly selected baseSelector",a);let f=l(()=>{let y=[],S=new Wn,w=e;for(;w&&w!==i.element;){let E="",v=!1,M=!1,R=!1;for(;!E.length;)E=S.getSelectorPart(w,{useClasses:M,useId:v,useTag:R}),v?(M=!0,R=!0):v=!0;y.push({selector:E,element:w}),w=w.parentElement}return y},"getCSSFeatures"),d=f();console.log("cssFeatures",d);let p=(await new n(i.element).generate(e,f(),{isPartOfListItem:!0,isForContextElement:!1,useTextContent:!1})).map(y=>({...y,elements:[]})),g=p.filter(y=>(y.elements=this.getLocatorBase(e).locator(a).locator(y.selector).elements,y.elements.length>Math.ceil(i.element.children.length*.7)));return console.log("elementSelectors",p),g.map(({selector:y,locator:S})=>({selector:`${a} >> ${y}`,locator:`${u}.${S}`}))}catch(r){console.error("[findGenericItemListSelector] error",r)}}filterListItemsSelectors(e){try{let t=vr(document.body,{nodeRepetitionsThreshold:5});if(!t?.length)throw new Error("No templates found in the page");return e.filter(r=>{if(r.elements.length<2)return!1;let i=new Wn().getSmallestCommonRoot(r.elements);return!(!t.some(o=>o.element===i)||Array.from(i.children).some(o=>{r.elements.filter(a=>o.contains(a)).length>1}))})}catch(t){console.error("[filterListItemsSelectors] error",t.message)}}getLocatorBase(e){let t=Ur(e);return this.rootNode===document||this.rootNode.nodeType===9?t:t.locator(t.selector(this.rootNode))}getSelectorLocator(e,t){return Ur(t??this.targetElement).asLocator("javascript",e)}async reduceMultiCandidates(e){await Qs(0);let{elements:t}=e,r=e.getSelector().split(" >> "),i=[],o=this.getLocatorBase(this.targetElement),a=l(p=>{try{return i.push(new gn([{selector:p,locator:this.getSelectorLocator(p)}])),i.length>=this.MAX_MULTICANDIDATE_PROCESSING}catch(g){return console.error(g),!1}},"addCandidateWithSelector"),u=l(p=>e.getSelector()+(r[r.length-1]===this.targetElement.tagName.toLowerCase()?p:` >> internal:and=${mP(this.targetElement.tagName.toLowerCase()+p)}`),"addCSSFilterToLocator"),f=l(p=>o.locator(p).elements.length===1?a(p):!1,"addIfSingularAndCheckLimit");if(t.length<5){let p=t.indexOf(this.targetElement);p!==-1&&a(e.getSelector()+` >> nth=${p}`)}let d=this.targetElement.parentElement;if(t.every(p=>p.parentElement===d&&p.tagName===this.targetElement.tagName)){let p=Array.from(d.children).indexOf(this.targetElement);if(p!==-1){let g=u(`:nth-child(${p+1})`);f(g)&&a(g)}}for(let p of Array.from(this.targetElement.classList).filter(g=>!dr.includes(g))){let g=u(`.${Xs(p)}`);try{if(f(g))return i}catch(y){console.error(y)}}for(let p of Array.from(this.targetElement.attributes).filter(g=>!ql.includes(g.name))){let g=u(`[${p.name}`+(p.value?`="${p.value}"]`:"]"));try{if(f(g))return i}catch(y){console.error(y)}}return i}getAllLocators(e,t,r={}){r={exact:!0,useTextContent:!0,...r};let i=[this.getByRoleLocator(e,r),r.useTextContent?this.getByTextLocator(e,r):null,this.getByLabelLocator(e,r),this.getByPlaceholderLocator(e,r),this.getByTitleLocator(e,r),this.getByAltLocator(e,r),this.getTestIdLocator(e,r),...e===this.targetElement?[this.getInnerFeaturesLocator(e)]:[],...t.filter(o=>o.element===e).map(o=>({selector:o.selector,locator:this.getSelectorLocator(o.selector)}))].filter(o=>o);return!i.length&&r.bruteForceMode?i.concat(this.findUniqueCSSLocatorForElement(e)):i}findUniqueCSSLocatorForElement(e,t=5){let r=[],i=l(o=>(r.push([{selector:o,locator:`locator('${o}')`}]),r.length>=t),"addCandidate");for(let o of Array.from(e.attributes).filter(({name:a,value:u})=>u.length<30&&!ql.includes(a)))try{let a=`[${o.name}${o.value?`="${o.value}"`:""}]`;if(e.ownerDocument.querySelectorAll(a).length===1&&i(a))return r}catch{}for(let o of Array.from(e.classList).filter(a=>!dr.includes(a)))try{let a=`.${Xs(o)}`;if(e.ownerDocument.querySelectorAll(a).length===1&&i(a))return r}catch{}return r}getInnerFeaturesLocator(e){let t=e.tagName.toLowerCase();if(!mn(e)||["html","body","div"].includes(t))return;let r=new Pr().extract(e).filter(o=>!o.isRoot).slice(0,4).map(o=>ci(o).pop());if(r.length<2)return;let i=t+r.map(o=>`:has(${o})`).join("");return{selector:i,locator:this.getSelectorLocator(i)}}getByRoleLocator(e,t={}){try{if(!mn(e))throw new Error("Provided element is not an HTMLElement");let r={},i={button:"button",input:l(S=>S.type==="checkbox"?"checkbox":S.type==="radio"?"radio":"textbox","input"),select:"listbox",a:"link",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",li:"listitem",option:"option",textarea:"textbox",table:"table",tr:"row",th:"columnheader",td:"cell",img:"img"},o=e.tagName.toLowerCase(),a=e.getAttribute("role")||(i[o]instanceof Function?i[o](e):i[o]);if(!a)return;let u=[];if(a==="heading"&&!e.hasAttribute("aria-level")){let S=parseInt(o.charAt(1),10);u.push(["level",String(S)])}(a==="checkbox"||a==="radio")&&u.push(["checked",String(e.getAttribute("aria-checked")??e.getAttribute("checked")??"false")]);let f=l(()=>{let S=l(T=>this.limitTextLength(this.normalize(T),t.exact),"normalize"),w={text:"",exact:!1},E=e.getAttribute("aria-label")??e.getAttribute("aria-labelledby")??e.getAttribute("title");if(E)return S(E);let v=Li(e),M=jl(v.full);if(!M?.length)return w;let R=S(M);return r.hasText=R.text,R},"getAccessibleName"),{text:d,exact:p}=f();d&&d.length>0&&d.length<30&&u.push(["name",zl(d,p)]);let g=l(()=>{let S=`internal:role=${a}${u.map(([w,E])=>`[${w}=${E}]`).join("")}`;return{locator:this.getSelectorLocator(S),selector:S,options:r}},"getSelection"),y=g();if(d?.length&&p&&!this.getLocatorBase(e).locator(y.selector).elements.includes(e)){let S=u.find(w=>w[0]==="name");S&&(S[1]=zl(d,!1),y=g())}return y}catch(r){console.error("Error getting role locator",r.message)}}getByTextLocator(e,t={}){try{if(!mn(e))return;let r=jl(Li(e).full);if(!r?.length||r.length>100)return;let i={};if(Array.from(e.children).filter(u=>mn(u)).some(u=>jl(Li(u).full)===r)){i.hasText=r;let u=`${e.tagName.toLowerCase()} >> internal:has-text=${Gl(r,!1)}`;return{selector:u,locator:this.getSelectorLocator(u),options:i}}let o=l(u=>{let d="internal:text="+Gl(r,u);return{selector:d,locator:this.getSelectorLocator(d),options:i}},"getSelection"),a=o(t.exact);return t.exact&&!this.getLocatorBase(e).locator(a.selector).elements.includes(e)&&(a=o(!1)),a}catch{}}getByLabelLocator(e,t={}){try{if(!mn(e)||!["input","textarea","select"].includes(e.tagName.toLowerCase()))return;let r=l(u=>({selector:`internal:label=${Gl(u,t.exact)}`,locator:`getByLabel('${u}')`}),"respond"),i=e.getAttribute("aria-label");if(i)return r(i);let o=e.getAttribute("aria-labelledby");if(o){let u=document.getElementById(o);if(u){let f=u.innerText.trim();if(f)return r(f)}}let a=e.getAttribute("id");if(a){let u=document.querySelector(`label[for="${a}"]`);if(u){let f=u.innerText.trim();if(f)return r(f)}}}catch{}}getByPlaceholderLocator(e,t={}){if(["input","textarea"].includes(e.tagName?.toLowerCase()))return this.getByAttributeLocator(e,"placeholder",t)}getByTitleLocator(e,t={}){return this.getByAttributeLocator(e,"title",t)}getByAltLocator(e,t={}){return this.getByAttributeLocator(e,"alt",t)}getTestIdLocator(e,t={}){for(let r of["data-testid","data-test-id","data-test"])if(e.getAttribute(r))return this.getByAttributeLocator(e,r,{...t,locatorName:"getByTestId"})}getByAttributeLocator(e,t,r={}){try{if(!mn(e))return;let i=e.getAttribute(t);if(i)return{selector:`internal:attr=[${t}=${zl(i,r.exact)}]`,locator:(r.locatorName??`getBy${t.charAt(0).toUpperCase()+t.slice(1)}`)+`('${i}')`}}catch{}}normalize(e){return e.replace(/\n/g,"").replace(/[ \t]+/g," ").trim()}limitTextLength(e,t=!0,r=30){for(;e?.length>30&&e.length<100&&e.includes(" ");)e=e.split(" ").slice(0,-1).join(" "),t=!1;return{text:e,exact:t}}checkTimeout(e=!0){if(pP)return!1;if(this.MAX_PROCESSING_TIME&&Date.now()-this.startTimestamp>this.MAX_PROCESSING_TIME){if(e)throw new sn;return!0}}};function mP(n,e=!1){return`"${n.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"`}l(mP,"escapeForAndLocator");function mn(n){return Ye(n,"HTMLElement")}l(mn,"isInstanceOfHTMLElement");function Cw(n=document,e){try{let r=function(a){let u=a.nodeName.toLowerCase(),f=!1;if(["name","label","aria-label","data-testid","role"].forEach(d=>{a.hasAttribute(d)&&(u+=`[@${d}="${a.getAttribute(d)}"]`,f=!0)}),!f){let d=1,p=a.previousSibling;for(;p;)p.nodeType===Node.ELEMENT_NODE&&p.nodeName===a.nodeName&&d++,p=p.previousSibling;d>1&&(u+=`[${d}]`)}return u};var t=r;if(l(r,"getNodeIdentifier"),!n||!e||!n.contains(e))throw new Error("Child is not a descendant of the given element.");let i=[],o=e;for(;o!==n;)o.nodeType===Node.ELEMENT_NODE&&i.unshift(r(o)),o=o.parentElement;return i.join("/")}catch(r){console.error("Failed to get relative xpath",r);return}}l(Cw,"getRelativeXPath");function Mw(n,e){return[new XPathEvaluator().evaluate(e,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue].filter(i=>i instanceof HTMLElement)}l(Mw,"findElementsByXPath");var Wn=class{constructor(e){this.htmlReducer=e;this.BASE_MAX_COMPONENTS_FOR_SELECTOR_COMBINATION=13;this.MAX_SELECTORS_PER_CONTEXT_ELEMENT=10;this.innerFeaturesExtractor=new Pr;this.innerTextExtractor=new fi}static{l(this,"CompoundSelector")}filter(e,{isPartOfListItem:t=!1}={}){e.forEach(u=>{u.element=this.htmlReducer.getElementForChecksumId(u.selection.checksumid)});let r=e.splice(e.findIndex(u=>u.isTarget),1)[0],i=e.filter(u=>!!u.element&&!u.element.contains(r.element)&&!r.element.contains(u.element)&&!e.some(f=>f!==u&&(f.element===u.element||f.element.contains(u.element)))).concat(r);if(console.log(`filtered context elements, ${e.length+1} > ${i.length}`),!t)return i;let o=vr(document.body,{nodeRepetitionsThreshold:4});if(!o?.length)return[];let a=o.find(u=>u.element.contains(r.element));return a?(console.log("Found template for target element",a),i.filter(u=>a.element.contains(u.element))):[]}async generate(e,{isPartOfListItem:t=!1}={}){let r=e.filter(a=>a.isTarget)[0];if(e=this.filter(e,{isPartOfListItem:t}),e.length<2)throw new Error("Not enough elements found for the given checksum ids");if(!r?.element)throw new Error("Target element not found");let i=this.getSmallestCommonRoot(e.map(a=>a.element));if(!i)throw new Error("No common root found for the given elements");return this.extractFeaturesMetadata(e),{targetSelection:{xpath:Cw(i,r.element),cssSelectors:this.generateAllContextualSelectors(i,r.element).filter(a=>a&&a.trim().length>0),playwrightSelectors:await new yn(i).generate(r.element,[],{addCSSSelectorGenerator:!1,expandCSSKeyElements:!1}),featuresMetadata:r.featuresMetadata},contextElements:e}}async select(e,t){e.forEach(o=>{if(o.find(a=>!a||!a.isConnected))throw new Error("One or more context elements are not connected to the DOM")});let r=l((o,a)=>{try{return o.selector(a)}catch{let f=a.ownerDocument.defaultView.parent?.document?.defaultView?.playwright;if(f)try{return f.selector(a)}catch{return}return}},"getElementSelector"),i=this.getSmallestCommonParents(e).map(this.calculateElementSize).sort((o,a)=>o.size-a.size).map(o=>o.element);return t?i.map(o=>{let a=Ur(o),{element:u}=a.locator(r(a,o)).locator(t);return u?r(a,u):null}).filter(o=>o):i.map(o=>{let a=Ur(o);if(!a){console.warn("Failed getting playwright for element",o);return}return r(a,o)}).filter(o=>o)}async selectFromMetadata(e){let{contextElements:t}=e;t.forEach(i=>this.getSelectorCandidatesForContextElement(i));let r=pa(t.map(i=>i.candidatesSelectors.map((o,a)=>a)));for(let i of r){t.forEach((a,u)=>a.selector=a.candidatesSelectors[i[u]]);let o=this.getSmallestCommonParentsFromMetadata(t).map(this.calculateElementSize).sort((a,u)=>a.size-u.size).map(a=>a.element);for(let a of o){let u=this.generateTargetSelectotionHistogram(a,e.targetSelection);if(u.size>0)return Array.from(u.keys()).slice(0,20).map(d=>Ur(d).generateSelectorAndLocator(d))}}}generateTargetSelectotionHistogram(e,t){let r=new Map,i=l(o=>{o.filter(a=>a instanceof HTMLElement).forEach(a=>{r.set(a,(r.get(a)||0)+1)})},"addElementstoHistogram");if(t.xpath)try{i(Mw(e,t.xpath))}catch{}return t.cssSelectors.forEach(o=>{try{i(de(o,e))}catch{}}),new Map([...r.entries()].sort((o,a)=>a[1]-o[1]))}calculateElementSize(e){let t=e.getBoundingClientRect();return{element:e,size:t.width*t.height}}buildSelectorForContextElement(e,{useTag:t=!0,useInnerFeatures:r=!0,useClasses:i=!0,useAttributes:o=!0}){let a=t?e.featuresMetadata.tag:"";i&&e.featuresMetadata.classes.length&&(a+="."+e.featuresMetadata.classes.map(u=>u.trim().replace(/([!\"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")).join(".")),o&&(a+=Object.entries(e.featuresMetadata.attributes).map(([u,f])=>`[${u}="${f}"]`).join("")),r&&(a+=e.featuresMetadata.innerFeatures.filter(u=>!u.isRoot).map(u=>`:has(${ci(u)})`).join("")),e.selector=a}getSelectorCandidatesForContextElement(e){let t=this.buildSelectorsCombination(e.featuresMetadata);e.candidatesSelectors=[];for(let r=0;r<t.length&&e.candidatesSelectors.length<this.MAX_SELECTORS_PER_CONTEXT_ELEMENT;r++)document.querySelector(t[r])&&e.candidatesSelectors.push(t[r])}buildSelectorsCombination(e){let t=this.BASE_MAX_COMPONENTS_FOR_SELECTOR_COMBINATION,r=l(y=>{let S=[[]];for(let w=0;w<y.length;w++){let E=S.length;for(let v=0;v<E;v++)S.push(S[v].concat(y[w]))}return S},"getCombinations"),i=l(y=>y.trim().replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1"),"escapeSelector"),o=e.tag,a=e.innerFeatures.filter(y=>!y.isRoot).map(y=>`:has(${ci(y)})`).slice(0,4),u=e.classes.map(y=>`.${i(y)}`),f=Object.entries(e.attributes).map(([y,S])=>`[${y}="${i(S)}"]`),d=l(()=>a.length+1+u.length+f.length>t,"exceedsMaxLength");for(;d()&&(u.pop(),!!d());)f.pop();let p=r([...u,...f,...a]),g=p.map(y=>[o,...y]);return p.push(...g),p.map(y=>y.join("")).filter(y=>y).sort((y,S)=>S.length-y.length)}extractFeaturesMetadata(e){e.forEach(t=>{t.featuresMetadata={id:t.element.getAttribute("id")??void 0,tag:t.element.tagName.toLowerCase(),innerText:this.innerTextExtractor.extract(t.element),innerFeatures:this.innerFeaturesExtractor.extract(t.element),classes:Array.from(t.element.classList).filter(r=>!dr.includes(r))||[],attributes:Array.from(t.element.attributes).reduce((r,i)=>(["class","style","id"].includes(i.name)||(r[i.name]=i.value),r),{})}})}generateAllContextualSelectors(e,t){let r=[],i=[!0,!1];for(let a of i)for(let u of i)for(let f of i)r.push({useId:a,useClasses:u,useTag:f});let o=r.map(a=>this.createContextualSelector(e,t,a)).filter(a=>a).filter(a=>{try{let u=de(a,e);return u.length===1&&u[0]===t}catch{return!1}});return[...new Set(o)]}createContextualSelector(e,t,{useId:r=!1,useClasses:i=!0,useTag:o=!0}){if(!e||!t)return null;let a=[],u=t;for(;u&&u!==e;)a.unshift(this.getSelectorPart(u,{useId:r,useClasses:i,useTag:o})),u=u.parentElement;return u?a.join(" ").trim():null}getSelectorPart(e,{useId:t=!1,useClasses:r=!0,useTag:i=!0}){if(t&&e.id&&e.id.match(/^\D/))return`#${e.id}`;let o=i?e.tagName.toLowerCase():"";if(r&&e.className){let a=e.className.trim().split(/\s+/).filter(u=>!dr.includes(u)).map(Xs).join(".");a.length>0&&(o+="."+a)}return["name","label","aria-label","data-testid","role"].forEach(a=>{e.hasAttribute(a)&&(o+=`[${a}="${e.getAttribute(a)}"]`)}),o.trim()}getSmallestCommonRoot(e){let t=l(i=>{let o=[];for(;i;)o.push(i),i=i.parentElement;return o},"getAncestors"),r=t(e[0]);for(let i=1;i<e.length;i++){let o=t(e[i]);r=r.filter(a=>o.includes(a))}return r.length>0?r[0]:null}getSmallestCommonParentsFromMetadata(e){let t=e.map(r=>{try{let i=de(r.selector);return r.selection.type==="content"?i.filter(o=>o.textContent===r.selection.value):i}catch{return[]}});return t.some(r=>r.length===0)?[]:this.getSmallestCommonParents(t)}getSmallestCommonParents(e){let t=new Set;pa(e).forEach(o=>{let a=this.getSmallestCommonRoot(o);a&&t.add(a)});let i=Array.from(t);return i.filter(o=>!i.some(a=>o!==a&&o.contains(a)))}};var Jl=class{constructor(){this.MAX_SNIPPET_SIZE=12e3;this.MAX_LIONTAIL_SIZE=6e3;this.MAX_ATTRIBUTE_SIZE=100}static{l(this,"ParentChainReducer")}async reduce(e,t={useLionTail:!0,useChecksumIds:!0}){if(console.log("[ParentChainReducer] will reduce",e),!Ye(e,"HTMLElement")&&!Ye(e,"SVGElement"))throw new Error("Element is not an HTMLElement");return{reducedHTML:this.getAncestorsHTMLSnippet(e,t)}}getElementForChecksumId(e){return this.elementsInSimplifiedDomByChecksumId[e]}getAncestorsHTMLSnippet(e,{useLionTail:t=!0,useChecksumIds:r=!0}={}){this.elementsInSimplifiedDomByChecksumId={};let i=this.MAX_LIONTAIL_SIZE,o=this.MAX_ATTRIBUTE_SIZE,a=[],u=e;e.setAttribute("checksum-selected","true");try{for(;u;)a.push(u),u.parentNode&&u.parentNode instanceof ShadowRoot?u=u.parentNode.host:u=u.parentElement;a.reverse();let f=l(y=>{for(let S=y.attributes.length-1;S>=0;S--){let w=y.attributes[S];w.name.length+w.value.length>o&&y.removeAttribute(w.name)}return y},"normalizeNode"),d,p=new Ri;do{d=a[0].cloneNode(!1);let y=d,S=hs(d);for(let w=1;w<a.length;w++){if(t){let v=hs(a[w]).length;if(v<=i&&S.length+v<=this.MAX_SNIPPET_SIZE){let M=this.deepCloneNode(a[w],r?p:void 0);y.appendChild(M);break}}let E=f(a[w].cloneNode(a[w]===e));if(r){let v=p.getAndIncrement();E.setAttribute("checksumid",v),this.elementsInSimplifiedDomByChecksumId[v]=a[w]}y.appendChild(E),y=E}i=Math.max(i-10,0),o=Math.max(o-10,0)}while(d.outerHTML.length>this.MAX_SNIPPET_SIZE&&o>0);return this.filterNodeClasses(d),hs(d,{limitAttributeLength:!0})}catch(f){console.error("Error while getting ancestors HTML snippet",f)}finally{e.removeAttribute("checksum-selected")}}deepCloneNode(e,t){let r=e.cloneNode(!1),i=[e],o=[r];for(;i.length;){let a=i.shift(),u=o.shift();for(let f=0;f<a.childNodes.length;f++){let d=a.childNodes[f],p=d.cloneNode(!1);if(u.appendChild(p),t&&Ye(d,"HTMLElement")){let g=t.getAndIncrement();p.setAttribute("checksumid",g),this.elementsInSimplifiedDomByChecksumId[g]=d}i.push(d),o.push(p)}}return r}filterNodeClasses(e){let t=l(r=>{if("classList"in r){let i=r,o=i.classList;for(let a=0;a<o.length;a++){let u=o[a];dr.includes(u)&&i.classList.remove(u)}for(let a=0;a<i.children.length;a++)t(i.children[a])}},"filterClasses");t(e)}};var Ql=class{static{l(this,"FilesObserver")}constructor(e){this.fileInputsWithListeners=new Set,this.filesMap={},this.observer=null,this.sessionMirror=e}async getFilesByRrwebId(e){let t=this.filesMap[e]??[];try{let r=await Promise.all(t.map(async i=>({data:await gP(i),fileName:i.name})));return this.filesMap[e]=[],r}catch{console.log("Error while parsing files to base 64")}}init(){console.log("Starting observation..."),console.log(this.sessionMirror),this.observeDOMChanges(),window.addEventListener("unload",this.cleanup.bind(this))}handleFileChange(e){console.log("handleFileChange",this.sessionMirror);let t=e.target,r=Array.from(t.files||[]),i=this.sessionMirror.getMeta(t);this.filesMap[i.id]=r,console.log(`Files updated for ID: ${i.id}`,r)}addFileInputListeners(e){e.forEach(t=>{this.fileInputsWithListeners.has(t)||(t.addEventListener("change",this.handleFileChange.bind(this)),this.fileInputsWithListeners.add(t))})}observeDOMChanges(){let e=window.document,t=e.querySelectorAll('input[type="file"]');this.addFileInputListeners(t);let r=l(()=>{this.observer=new MutationObserver(o=>{o.forEach(a=>{if(a.type==="childList"){let u=a.target.querySelectorAll('input[type="file"]');this.addFileInputListeners(u)}})}),this.observer.observe(e.body,{childList:!0,subtree:!0})},"onBodyReady"),i=new MutationObserver(function(){e.body&&(i.disconnect(),r())});i.observe(e.documentElement,{childList:!0,subtree:!0})}cleanup(){console.log("Cleaning up files observer..."),this.observer&&this.observer.disconnect(),this.fileInputsWithListeners.forEach(e=>{e.removeEventListener("change",this.handleFileChange)}),this.fileInputsWithListeners.clear(),this.filesMap={}}},gP=l(n=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>{r.result?e(r.result.toString()):t(new Error("File reading failed"))},r.onerror=()=>{t(new Error("File reading failed"))},r.readAsDataURL(n)}),"convertFileToBase64");var ec=class{constructor(e){this.sessionRecorder=e}static{l(this,"NativeDialogObserver")}init(){this.overrideDialog("alert"),this.overrideDialog("confirm"),this.overrideDialog("prompt")}overrideDialog(e){let t=window[e].bind(window);window[e]=r=>{let i=t(r),o=this.determineDialogAction(i,e);return this.sessionRecorder.addCustomEvent("native-dialog-event",{dialogType:e,dialogMessage:r,dialogResult:i,dialogAction:o}),i}}determineDialogAction(e,t){if(t==="alert")return"native_accept";if(t==="confirm")return e?"native_accept":"native_dismiss";if(t==="prompt")return e?"native_accept":"native_dismiss"}};var Pi=class n{constructor({rootDocument:e=document,getRenderDocument:t=l(u=>u?.document,"getRenderDocument"),defaultView:r,topLevelInspector:i,rootDocumentForSelectorGenerator:o,eventName:a}={}){this.wasHoveredElementSelected=!1;this.selected=[];this.singleSelection=!0;this.subDocumentInspector=null;this.listening=!1;this.locatorCache=Rd.getInstance();this.onMouseOut=l(e=>{Vr.clearHighlights()},"onMouseOut");this.onMouseOver=l(async e=>{let t=e.composedPath()[0];if("getRootNode"in t){let i=t.getRootNode();if(i!==this.rootDocument){this.handleSubDocument(i,this.defaultView);return}}if(Ye(t,"HTMLIFrameElement")){this.handleSubDocument(t.contentDocument,t.contentDocument.defaultView);return}if(this.subDocumentInspector&&this.stopSubDocumentInspector(!0),!Ye(t,"HTMLElement"))return;let r=t;if(!(r===this.hoveredElement||r.matches(".element-inspector-ignore"))){Vr.clearHighlights(),this.hoveredElement&&this.hoveredElement.removeEventListener("click",this.onClick,{capture:!0});try{let{locator:i,selector:o,parentFramesSelectors:a,locatorRrwebId:u}=await this.getInspectedElementSelection(r,this.rootDocumentForSelectorGenerator);if(Vr.highlightElement(r,{text:i.replace("frameLocator('iframe').",""),textPosition:"below",textWidthType:"auto",pointerEvents:"none",classNames:["element-inspector-ignore"],renderDocument:this.getRenderDocument(this.defaultView)}),u){let f=window.checksum.timeMachine.sessionReplayer.getNodeById(u);f&&Vr.highlightElement(f,{clear:!1,pointerEvents:"none",classNames:["element-inspector-ignore"],renderDocument:this.getRenderDocument(this.defaultView)})}this.hoveredElement=r,this.hoveredElementSelection={locator:i,selector:o,parentFramesSelectors:a},this.wasHoveredElementSelected=!1,t.addEventListener("click",this.onClick,{capture:!0})}catch(i){console.error("Error inspecting element",i.message)}}},"onMouseOver");this.onClick=l(async e=>{e.stopPropagation(),e.preventDefault(),!this.wasHoveredElementSelected&&(this.wasHoveredElementSelected=!0,this.selected.push(this.hoveredElementSelection),this.singleSelection&&(this.topLevelInspector?this.topLevelInspector.stop():this.stop()),window.parent.postMessage({type:this.eventName,data:this.selected[this.selected.length-1]},"*"))},"onClick");this.handleSubDocument=l((e,t)=>{if(this.subDocumentInspector){if(this.subDocumentInspector.rootDocument===e)return!0;this.stopSubDocumentInspector(!0)}return this.subDocumentInspector=new n({rootDocument:e,defaultView:t,topLevelInspector:this.topLevelInspector??this,getRenderDocument:this.getRenderDocument,eventName:this.eventName}),this.subDocumentInspector.start({singleSelection:this.singleSelection,timestamp:this.currentTimestamp}),!0},"handleSubDocument");this.stopSubDocumentInspector=l(e=>{this.subDocumentInspector&&(this.subDocumentInspector.stop(e),this.subDocumentInspector=null)},"stopSubDocumentInspector");this.rootDocument=e,this.topLevelInspector=i,this.getRenderDocument=t,this.eventName=a,this.defaultView=r??this.getDefaultView(),this.playwrightElementSelectorGenerator=new Tt,this.rootDocumentForSelectorGenerator=o??this.getDefaultView().document}static{l(this,"ElementInspector")}getDefaultView(){let t=document.querySelector(".replayer-wrapper > iframe")?.contentDocument||null;return!t&&this.rootDocument.nodeType===Node.DOCUMENT_NODE&&(t=this.rootDocument),t||(t=document),t.defaultView}start({singleSelection:e,timestamp:t}={singleSelection:!0}){this.singleSelection=e,this.locatorCache.setTimestamp(t),this.currentTimestamp=t,this.stop(),this.cleanSelection(),this.rootDocument.addEventListener("mouseover",this.onMouseOver),this.rootDocument.addEventListener("mouseout",this.onMouseOut),this.listening=!0}stop(e=!1){this.listening&&(this.listening=!1,this.subDocumentInspector&&this.stopSubDocumentInspector(e),Vr.clearHighlights(),this.hoveredElement&&this.hoveredElement.removeEventListener("click",this.onClick,{capture:!0}),this.currentTimestamp=void 0,this.hoveredElement=null,this.wasHoveredElementSelected=!1,this.rootDocument.removeEventListener("mouseover",this.onMouseOver),e&&this.cleanSelection())}cleanSelection(){this.subDocumentInspector&&this.subDocumentInspector.cleanSelection(),this.selected=[]}consumeSelections(){if(this.subDocumentInspector)return this.subDocumentInspector.consumeSelections();let e=this.selected;return this.cleanSelection(),e}async getInspectedElementSelection(e,t){let r=this.locatorCache.getCachedLocatorForElement(e);if(!r){let{locator:i,selector:o,parentFramesSelectors:a}=await this.playwrightElementSelectorGenerator.getSelectorAndLocator(e,{rootDocument:t,ignoredIframesSelectors:[".replayer-wrapper > iframe"],flags:{origin:"element-inspector"}}).catch(d=>({locator:"",selector:"",parentFramesSelectors:[]})),u=await this.playwrightElementSelectorGenerator.selector(o,a).catch(()=>e),f=u!==e?Tw(u):void 0;r={locator:i,selector:o,parentFramesSelectors:a,locatorRrwebId:f},this.locatorCache.setCachedLocatorForElement(e,r)}return r}},Rd=class n{constructor(){this.locatorCache=new Map}static{l(this,"InspectedElementCache")}static getInstance(){return n.instance||(n.instance=new n),n.instance}setTimestamp(e){this.currentTimestamp=e}getCachedLocatorForElement(e){try{return this.currentTimestamp?this.locatorCache.get(this.getKeyForElement(e)):void 0}catch{return}}setCachedLocatorForElement(e,t){this.currentTimestamp&&this.locatorCache.set(this.getKeyForElement(e),t)}getKeyForElement(e){let t=Tw(e);if(!t)throw new Error("Can't find rrwebId for element");return`${t}_${this.currentTimestamp}`}};function Tw(n){return window.checksum.timeMachine.sessionReplayer.getMeta(n)?.id}l(Tw,"getNodeRrwebId");var Od=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Ld(n,e,t,r){n.addEventListener?n.addEventListener(e,t,r):n.attachEvent&&n.attachEvent("on".concat(e),t)}l(Ld,"addEvent");function eo(n,e,t,r){n.removeEventListener?n.removeEventListener(e,t,r):n.detachEvent&&n.detachEvent("on".concat(e),t)}l(eo,"removeEvent");function Rw(n,e){let t=e.slice(0,e.length-1);for(let r=0;r<t.length;r++)t[r]=n[t[r].toLowerCase()];return t}l(Rw,"getMods");function Ow(n){typeof n!="string"&&(n=""),n=n.replace(/\s/g,"");let e=n.split(","),t=e.lastIndexOf("");for(;t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}l(Ow,"getKeys");function yP(n,e){let t=n.length>=e.length?n:e,r=n.length>=e.length?e:n,i=!0;for(let o=0;o<t.length;o++)r.indexOf(t[o])===-1&&(i=!1);return i}l(yP,"compareArray");var ro={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":Od?173:189,"=":Od?61:187,";":Od?59:186,"'":222,"[":219,"]":221,"\\":220},Er={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},rc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},gt={16:!1,18:!1,17:!1,91:!1},et={};for(let n=1;n<20;n++)ro["f".concat(n)]=111+n;var Xe=[],to=null,Lw="all",zr=new Map,io=l(n=>ro[n.toLowerCase()]||Er[n.toLowerCase()]||n.toUpperCase().charCodeAt(0),"code"),bP=l(n=>Object.keys(ro).find(e=>ro[e]===n),"getKey"),vP=l(n=>Object.keys(Er).find(e=>Er[e]===n),"getModifier");function Nw(n){Lw=n||"all"}l(Nw,"setScope");function no(){return Lw||"all"}l(no,"getScope");function SP(){return Xe.slice(0)}l(SP,"getPressedKeyCodes");function wP(){return Xe.map(n=>bP(n)||vP(n)||String.fromCharCode(n))}l(wP,"getPressedKeyString");function EP(){let n=[];return Object.keys(et).forEach(e=>{et[e].forEach(t=>{let{key:r,scope:i,mods:o,shortcut:a}=t;n.push({scope:i,shortcut:a,mods:o,keys:r.split("+").map(u=>io(u))})})}),n}l(EP,"getAllKeyCodes");function xP(n){let e=n.target||n.srcElement,{tagName:t}=e,r=!0,i=t==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}l(xP,"filter");function CP(n){return typeof n=="string"&&(n=io(n)),Xe.indexOf(n)!==-1}l(CP,"isPressed");function MP(n,e){let t,r;n||(n=no());for(let i in et)if(Object.prototype.hasOwnProperty.call(et,i))for(t=et[i],r=0;r<t.length;)t[r].scope===n?t.splice(r,1).forEach(a=>{let{element:u}=a;return _d(u)}):r++;no()===n&&Nw(e||"all")}l(MP,"deleteScope");function TP(n){let e=n.keyCode||n.which||n.charCode,t=Xe.indexOf(e);if(t>=0&&Xe.splice(t,1),n.key&&n.key.toLowerCase()==="meta"&&Xe.splice(0,Xe.length),(e===93||e===224)&&(e=91),e in gt){gt[e]=!1;for(let r in Er)Er[r]===e&&(wr[r]=!1)}}l(TP,"clearModifier");function _w(n){if(typeof n>"u")Object.keys(et).forEach(i=>{Array.isArray(et[i])&&et[i].forEach(o=>tc(o)),delete et[i]}),_d(null);else if(Array.isArray(n))n.forEach(i=>{i.key&&tc(i)});else if(typeof n=="object")n.key&&tc(n);else if(typeof n=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];let[i,o]=t;typeof i=="function"&&(o=i,i=""),tc({key:n,scope:i,method:o,splitKey:"+"})}}l(_w,"unbind");var tc=l(n=>{let{key:e,scope:t,method:r,splitKey:i="+"}=n;Ow(e).forEach(a=>{let u=a.split(i),f=u.length,d=u[f-1],p=d==="*"?"*":io(d);if(!et[p])return;t||(t=no());let g=f>1?Rw(Er,u):[],y=[];et[p]=et[p].filter(S=>{let E=(r?S.method===r:!0)&&S.scope===t&&yP(S.mods,g);return E&&y.push(S.element),!E}),y.forEach(S=>_d(S))})},"eachUnbind");function Iw(n,e,t,r){if(e.element!==r)return;let i;if(e.scope===t||e.scope==="all"){i=e.mods.length>0;for(let o in gt)Object.prototype.hasOwnProperty.call(gt,o)&&(!gt[o]&&e.mods.indexOf(+o)>-1||gt[o]&&e.mods.indexOf(+o)===-1)&&(i=!1);(e.mods.length===0&&!gt[16]&&!gt[18]&&!gt[17]&&!gt[91]||i||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Xe),e.method(n,e)===!1&&(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation&&n.stopPropagation(),n.cancelBubble&&(n.cancelBubble=!0)))}}l(Iw,"eventHandler");function Aw(n,e){let t=et["*"],r=n.keyCode||n.which||n.charCode;if(!wr.filter.call(this,n))return;if((r===93||r===224)&&(r=91),Xe.indexOf(r)===-1&&r!==229&&Xe.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(u=>{let f=rc[u];n[u]&&Xe.indexOf(f)===-1?Xe.push(f):!n[u]&&Xe.indexOf(f)>-1?Xe.splice(Xe.indexOf(f),1):u==="metaKey"&&n[u]&&(Xe=Xe.filter(d=>d in rc||d===r))}),r in gt){gt[r]=!0;for(let u in Er)Er[u]===r&&(wr[u]=!0);if(!t)return}for(let u in gt)Object.prototype.hasOwnProperty.call(gt,u)&&(gt[u]=n[rc[u]]);n.getModifierState&&!(n.altKey&&!n.ctrlKey)&&n.getModifierState("AltGraph")&&(Xe.indexOf(17)===-1&&Xe.push(17),Xe.indexOf(18)===-1&&Xe.push(18),gt[17]=!0,gt[18]=!0);let i=no();if(t)for(let u=0;u<t.length;u++)t[u].scope===i&&(n.type==="keydown"&&t[u].keydown||n.type==="keyup"&&t[u].keyup)&&Iw(n,t[u],i,e);if(!(r in et))return;let o=et[r],a=o.length;for(let u=0;u<a;u++)if((n.type==="keydown"&&o[u].keydown||n.type==="keyup"&&o[u].keyup)&&o[u].key){let f=o[u],{splitKey:d}=f,p=f.key.split(d),g=[];for(let y=0;y<p.length;y++)g.push(io(p[y]));g.sort().join("")===Xe.sort().join("")&&Iw(n,f,i,e)}}l(Aw,"dispatch");function wr(n,e,t){Xe=[];let r=Ow(n),i=[],o="all",a=document,u=0,f=!1,d=!0,p="+",g=!1,y=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(f=e.keyup),e.keydown!==void 0&&(d=e.keydown),e.capture!==void 0&&(g=e.capture),typeof e.splitKey=="string"&&(p=e.splitKey),e.single===!0&&(y=!0)),typeof e=="string"&&(o=e),y&&_w(n,o);u<r.length;u++)n=r[u].split(p),i=[],n.length>1&&(i=Rw(Er,n)),n=n[n.length-1],n=n==="*"?"*":io(n),n in et||(et[n]=[]),et[n].push({keyup:f,keydown:d,scope:o,mods:i,shortcut:r[u],method:t,key:r[u],splitKey:p,element:a});if(typeof a<"u"&&window){if(!zr.has(a)){let S=l(function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Aw(E,a)},"keydownListener"),w=l(function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Aw(E,a),TP(E)},"keyupListenr");zr.set(a,{keydownListener:S,keyupListenr:w,capture:g}),Ld(a,"keydown",S,g),Ld(a,"keyup",w,g)}if(!to){let S=l(()=>{Xe=[]},"listener");to={listener:S,capture:g},Ld(window,"focus",S,g)}}}l(wr,"hotkeys");function IP(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(et).forEach(t=>{et[t].filter(i=>i.scope===e&&i.shortcut===n).forEach(i=>{i&&i.method&&i.method()})})}l(IP,"trigger");function _d(n){let e=Object.values(et).flat();if(e.findIndex(r=>{let{element:i}=r;return i===n})<0){let{keydownListener:r,keyupListenr:i,capture:o}=zr.get(n)||{};r&&i&&(eo(n,"keyup",i,o),eo(n,"keydown",r,o),zr.delete(n))}if((e.length<=0||zr.size<=0)&&(Object.keys(zr).forEach(i=>{let{keydownListener:o,keyupListenr:a,capture:u}=zr.get(i)||{};o&&a&&(eo(i,"keyup",a,u),eo(i,"keydown",o,u),zr.delete(i))}),zr.clear(),Object.keys(et).forEach(i=>delete et[i]),to)){let{listener:i,capture:o}=to;eo(window,"focus",i,o),to=null}}l(_d,"removeKeyEvent");var Nd={getPressedKeyString:wP,setScope:Nw,getScope:no,deleteScope:MP,getPressedKeyCodes:SP,getAllKeyCodes:EP,isPressed:CP,filter:xP,trigger:IP,unbind:_w,keyMap:ro,modifier:Er,modifierMap:rc};for(let n in Nd)Object.prototype.hasOwnProperty.call(Nd,n)&&(wr[n]=Nd[n]);if(typeof window<"u"){let n=window.hotkeys;wr.noConflict=e=>(e&&window.hotkeys===wr&&(window.hotkeys=n),wr),window.hotkeys=wr}var Fi=class{constructor(){this.boundShortcuts=[]}static{l(this,"KeybindingsManager")}addKeybinding(e){let t=e.key.toLowerCase();if(this.boundShortcuts.includes(t))return;this.boundShortcuts.push(t),wr(t,{capture:!0,keydown:!0},i=>{i.preventDefault(),e.callback(i)})}};var nc=class{constructor(e){this.keybindingsManager=new Fi;this.createHandler=l(e=>({handlerFunc:l(t=>{try{e.handlerFunc(t)}finally{this.stopObserver()}},"handlerFunc"),handlerType:e.handlerType}),"createHandler");this.toHaveTextHandler=l(()=>e=>{let t=e?.data?.data,r=window.prompt(`Please enter the expected text for the element:
|
|
77
77
|
${t.locator}`);r!==null&&this.sessionRecorder.addCustomEvent("assertion",{matcher:`toHaveText("${r}")`,locator:t.locator})},"toHaveTextHandler");this.toBeVisibleHandler=l(()=>e=>{let t=e?.data?.data;this.sessionRecorder.addCustomEvent("assertion",{matcher:"toBeVisible()",locator:t.locator})},"toBeVisibleHandler");this.sessionRecorder=e}static{l(this,"AssertionsObserver")}init(){this.keybindingsManager.addKeybinding({key:"ctrl+\u2318+a",callback:l(()=>this.toggleObserver({handlerFunc:this.toHaveTextHandler(),handlerType:"toHaveText"}),"callback")}),this.keybindingsManager.addKeybinding({key:"ctrl+\u2318+s",callback:l(()=>this.toggleObserver({handlerFunc:this.toBeVisibleHandler(),handlerType:"toBeVisible"}),"callback")}),this.keybindingsManager.addKeybinding({key:"esc",callback:l(e=>{this.activeHandler&&(e.stopPropagation(),this.cleanUpHandler())},"callback")})}toggleObserver(e){if(this.activeHandler){this.cleanUpHandler();return}let t=this.createHandler(e);this.activeHandler=t,this.startObserver(),window.addEventListener("message",t.handlerFunc,{once:!0})}cleanUpHandler(){this.activeHandler&&(window.removeEventListener("message",this.activeHandler.handlerFunc),this.stopObserver(),this.activeHandler=null)}isInspectorActive(){return!!this.elementInspector}enableEventsFilter(){this.sessionRecorder.addCustomEvent("filter",{filter:{only:[{type:j.Custom,tag:"assertion"}],exclude:[]}})}disableEventsFilter(){this.sessionRecorder.addCustomEvent("filter",{filter:{only:[],exclude:[]}})}startObserver(){this.elementInspector=new Pi({rootDocument:window.document}),this.elementInspector.start(),this.enableEventsFilter()}stopObserver(){this.isInspectorActive()&&(this.elementInspector.stop(),this.elementInspector=null,this.disableEventsFilter(),this.cleanUpHandler())}};var ic=class{constructor(e){this.keybindingsManager=new Fi;this.lastMousePosition={x:0,y:0};this.sessionRecorder=e,this.listenForMouseMove()}static{l(this,"ActionsObserver")}init(){this.keybindingsManager.addKeybinding({key:"ctrl+\u2318+h",callback:l(async()=>{try{await this.handleImmediateHover()}catch(e){console.error("[ActionsObserver] calling handleImmediateHover:",e)}},"callback")})}listenForMouseMove(){try{document.addEventListener("mousemove",e=>{try{this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}catch(t){console.error("[ActionsObserver] mousemove event listener error:",t)}})}catch(e){console.error("[ActionsObserver] listenForMouseMove error:",e)}}async handleImmediateHover(){let e=document.elementFromPoint(this.lastMousePosition.x,this.lastMousePosition.y);if(!e)return;let t=new Tt,{locator:r}=await t.getSelectorAndLocator(e);r&&(this.sessionRecorder.addCustomEvent("hover",{locator:r}),this.highlightElement(e))}highlightElement(e){let t=e;if(!t.style)return;let r=t.style.backgroundColor,i=t.style.transition;t.style.transition="background-color 0.3s ease",t.style.backgroundColor="rgba(255, 255, 0, 0.3)",setTimeout(()=>{t.style.backgroundColor=r,t.style.transition=i},500)}cleanUpHandler(){this.activeHandler&&(window.removeEventListener("message",this.activeHandler.handlerFunc),this.stopObserver(),this.activeHandler=null)}isInspectorActive(){return!!this.elementInspector}stopObserver(){this.isInspectorActive()&&(this.elementInspector.stop(),this.elementInspector=null,this.cleanUpHandler())}};var sc=class{constructor(e){this.sessionRecorder=e}static{l(this,"BlobObserver")}init(){this.overrideCreateObjectURL()}overrideCreateObjectURL(){let e=URL.createObjectURL.bind(URL);URL.createObjectURL=t=>{let r=e(t);return!this.sessionRecorder||!t||typeof t.arrayBuffer!="function"||t.arrayBuffer().then(i=>{let o=new Uint8Array(i),a=Array.from(o);this.sessionRecorder.addCustomEvent("blob-data",{blobData:a,mimeType:t.type,originalUrl:r})}).catch(i=>{console.warn("Failed to process blob data for recording:",i)}),r}}};var AP="$checksum",oc=class{constructor(){this.testIdCounter=0;this.initialized=!1;Oi.setPrefix(AP),this.elementSelector=new Tt,this.htmlReducer=new Vl,this.parentChainReducer=new Jl,this.compoundSelector=new Wn(this.htmlReducer)}static{l(this,"ChecksumTestGenerator")}getCompoundSelector(){return this.compoundSelector}betterTemplatizr(e){return vr(e)}async buildCustomPlaywrightSelectors(e,t=[],r={},i=document){typeof e=="string"&&(e=this.htmlReducer.getElementForChecksumId(e));let o=t.map(a=>({...a,element:this.parentChainReducer.getElementForChecksumId(a.checksumId)})).filter(({element:a})=>!!a);return await new yn(i).generate(e,o,{isPartOfListItem:!1,isForContextElement:!1,addCSSSelectorGenerator:!0,expandCSSKeyElements:!0,...r})}async buildArbitraryListItem(e){return typeof e=="string"&&(e=this.htmlReducer.getElementForChecksumId(e)),new yn().generateArbitraryItemListSelector(e)}testElementSelector(e,t,r,i=!0){let o=typeof t=="string"?this.htmlReducer.getElementForChecksumId(t):t;return o?new yn().testSelector(e,o,r,i):(console.error("Element not found",t),{valid:!1,error:"Element not found"})}async getParentChainHTML(e,t=!0,r=!0){return typeof e=="string"&&(e=this.htmlReducer.getElementForChecksumId(e)),(await this.parentChainReducer.reduce(e,{useLionTail:t,useChecksumIds:r})).reducedHTML}init(e,t={},{sessionRecorder:r=!0,filesObserver:i=!1,assertionsObserver:o=!1,actionsObserver:a=!1,nativeDialogObserver:u=!1,blobObserver:f=!0}={}){this.appSpecificRules=e,this.config=t,!this.initialized&&(this.initialized=!0,r&&(this.sessionMirror=new $l((d,p)=>{d.isCheckout=p,window.checksumSendBroadcastMessage?.("rrweb",[d]),this.lastRrwebEventTimestamp=d.timestamp},t.recordOptions)),i&&(this.filesObserver=new Ql(this.sessionMirror),this.filesObserver.init()),o&&(this.assertionsObserver=new nc(this.sessionMirror),this.assertionsObserver.init()),a&&(this.actionsObserver=new ic(this.sessionMirror),this.actionsObserver.init()),u&&(this.nativeDialogObserver=new ec(this.sessionMirror),this.nativeDialogObserver.init()),f&&(this.blobObserver=new sc(this.sessionMirror),this.blobObserver.init()),this.sessionMirror&&(this.sessionMirror.start(),this.htmlReducer.setSessionRecorder(this.sessionMirror)),_n.limitChildren=this.appSpecificRules?.esraSelectionRules?.limitChildren??[],_n.timeout=this.config.esraTimeout,this.config.showFrontendLogs?Oi.removePrefix():this.config.logPrefix?.length&&Oi.setPrefix(this.config.logPrefix))}getElementSelector(){return this.elementSelector}getLastSelectionLogs(){return this.currentESRASelector?this.currentESRASelector.getLastSelectionLogs():{}}getBestMatchingElementSimilarityScore(e){return this.currentESRASelector=new _n(e),this.currentESRASelector.selectOne().score}async extractESRAMetadata(e){return new nr(document).extract(e).toMetadata()}async select(e,t){return await this.elementSelector.selector(e,t)}async getSelectionDataForSelector(e,t){try{let r=await this.elementSelector.selector(e,t);if(!r)return console.warn("could not find element for selector: "+e),null;let{locator:i}=await this.elementSelector.getSelectorAndLocator(r,{testIdSelector:this.appSpecificRules?.esraSelectionRules?.testIdSelector}),o=await this.extractESRAMetadata(r);return{generatedLocator:i,esraMetadata:o,selector:e,parentFramesSelectors:t}}catch(r){console.log("getMetadataForSelector exception",r);return}}async getMatchingElementSelectionData(e,{minSelectionScore:t,cachedSelector:r,staticMetadata:i}={minSelectionScore:.3},o=!1){try{let a,u,f;if(r&&(console.log("Trying to locate using cached selector",r),a=await this.elementSelector.selector(r)),!a){console.log("Trying to locate using ESRA",e),da(i)&&console.log("and static data",i),this.currentESRASelector=new _n(e,i);let p=this.currentESRASelector.selectOne({minSelectionScore:t});p.score>=t?(a=p.candidate,u=p.score,f=p.clickOffset):console.log("Best matching element was below threshold",p)}if(console.log(a?[`Located with score ${u}`,a]:"Element not located"),!a)return;o&&new mt(a).scrollIntoView(),this.highlightElement(a);let d=await this.makeMatchingElementSelectionData(a,u);return f&&(d.clickOffset=f),d}catch(a){console.log("getMatchingElementSelectionData exception",a);return}}getAllInteractableElementsForLastSelectQuery(){let e=this.currentESRASelector.getFinalCandidates();return Promise.all(e.map(async t=>({esraMetadata:t.esraMetadata,selectionData:await this.makeMatchingElementSelectionData(t.candidate,t.score)})))}async getInteractableElementsRaw(){return Nn()}async getInteractableElements(){let e=Nn(),t=new nr(document);return Promise.all(e.map(async r=>{let i=t.extract(r).toMetadata(),o=await this.makeMatchingElementSelectionData(r);return{esraMetadata:i,selectionData:o}}))}getCurrentESRASelector(){return this.currentESRASelector}startFlashingElementsDetection(){return this.htmlReducer.startFlashingElementsDetection()}async reduceHTML(e={},t={},r=document){let i=await this.htmlReducer.reduce(r,{...this.appSpecificRules,...e},t);if(this.lastRrwebEventTimestamp&&(i.lastRRwebEvent={timestamp:this.lastRrwebEventTimestamp}),t.extractESRAForInterpretationRequiredElements){console.log("Extracting ESRA for interpretation required elements...");let o=this.htmlReducer.getInteractableElementsInReducedHTML();i.elementsForNodeInterpretation=o.reduce((a,{checksumId:u,element:f})=>{if(!(f instanceof HTMLElement)||f.innerText?.trim().length)return a;let p=new nr(document).extract(f).toMetadata();return[...a,{checksumId:u,esraMetadata:p}]},[]),console.log("Done with ESRA extraction for interpretation required elements")}return i}getMoreItemsForTemplate(e,t={}){return this.htmlReducer.getMoreElementsFromTemplate(e,{...this.appSpecificRules,...t})}displayInterpretationForElements(e){this.clearHighlights(),this.htmlReducer.getInteractableElements().forEach(({checksumId:r,element:i})=>{let o=e[r];if(o){if(!i.isConnected){console.log(`Element ${r} is not connected to the DOM, skipping display`);return}this.highlightElement(i,{text:o,textType:"hover",clear:!1,textStyle:{width:"120px"}})}})}async overlayInteractableElementsWithChecksumId({reduceBeforeRender:e=!1,mode:t="full",textPosition:r=t==="tag"?"above":void 0,shouldFlipHighlightTextOutsideViewport:i=!0,scrollIntoView:o=!1,checksumId:a}={}){this.clearHighlights(),e&&await this.reduceHTML();let u=l((d,p,g)=>{if(!p.isConnected){console.log(`Element ${d} is not connected to the DOM, skipping display`);return}let{width:y,height:S}=p.getBoundingClientRect();if(y<=0||S<=0)return;function w(R){switch(t){case"tag":return{background:R,width:"initial",left:"-2px",border:`3px dashed ${R}`,"font-weight":"bold"};case"full":return{background:"black",height:"100%"}}}l(w,"getTextStyleByMode");function E(R){let T=["red","gold","green","steelBlue","orange","hotPink","darkViolet","brown"];return R?T[R%T.length]:"red"}l(E,"getColor");let v=E(g);function M(){switch(t){case"tag":return{outline:`3px dashed ${v}`};case"full":return{outline:"none"};case"selected":return{outline:"6px dashed red",opacity:"0.7"}}}l(M,"getHighlightStyle"),this.highlightElement(p,{text:d,clear:!1,highlightStyle:M(),...r?{textPosition:r}:{},textStyle:w(v),shouldFlipHighlightTextOutsideViewport:i})},"overlayElement");if(t==="selected"&&a){let d=await this.getElementForChecksumId(a);u(null,d,0);return}this.htmlReducer.getInteractableElementsInReducedHTML().filter(d=>!St(d.element,{...dd,scrollIntoView:o}).isHidden).forEach(({checksumId:d,element:p},g)=>{u(d,p,g)})}async getElementForChecksumId(e){return this.htmlReducer.getElementForChecksumId(e)}async getSelectorForChecksumId(e){let t=await this.htmlReducer.getSelectorForChecksumId(e),{element:r,innerText:i,...o}=t;return o}hasInnerTextByChecksumId(e){return this.htmlReducer.hasInnerTextByChecksumId(e)}async getSelectorByPosition(e,t){let r=document.elementFromPoint(e,t),{selector:i,locator:o,parentFramesSelectors:a}=await this.elementSelector.getSelectorAndLocator(r);return{selector:i,locator:o,parentFramesSelectors:a}}isInput(e){let t=de(e);if(t.length)return["input","textarea"].includes(t[0].tagName.toLowerCase())}querySelectorExtended(e){return de(e)}getReactTree(e){return QS(e)}isHidden(e,t){return St(e,t)}showGrid(){this.removeGrid();let e=document.createElement("style");e.id="checksum_grid_style",e.innerHTML=`
|
|
78
78
|
.checksum_grid {
|
|
79
79
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAJ1JREFUaEPtksEJgDAUxX73H1oRxAECkSrppacXaNI1M8f84Kz7Idf95XP0kM3yVWSzIFORikgG+lqSWIytCFYnDSsiicXYimB10rAikliMrQhWJw0rIonF2IpgddKwIpJYjK0IVicNKyKJxdiKYHXSsCKSWIytCFYnDSsiicXYimB10rAikliMrQhWJw0rIonF2IpgddLwKSLx38Oej8ZiASoSUGMAAAAASUVORK5CYII=");
|
|
@@ -115,7 +115,7 @@ Data: ${JSON.stringify(a)}`:u}static getCallerInfo(){let r=(new Error().stack?.s
|
|
|
115
115
|
`),t=u.length-a):t+=u.length,f&&d!=="start"){let p=f.parent||{raws:{}};(!(f.type==="decl"||f.type==="atrule"&&!f.nodes)||f!==p.last||p.raws.semicolon)&&(f.source&&f.source.end?(i.source=this.sourcePath(f),i.original.line=f.source.end.line,i.original.column=f.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Sc(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Sc(pE(r,this.mapOpts.annotation)));let i=dE(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new r$(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Xw){let r=Xw(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;mE==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},gE=s$,o$=Ac,rp=class extends o${static{l(this,"Comment")}constructor(e){super(e),this.type="comment"}},Lc=rp;rp.default=rp;var{isClean:yE,my:bE}=po,vE=Rc,SE=Lc,a$=Ac,wE,hp,dp,EE;function xE(n){return n.map(e=>(e.nodes&&(e.nodes=xE(e.nodes)),delete e.source,e))}l(xE,"cleanSource");function CE(n){if(n[yE]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)CE(e)}l(CE,"markDirtyUp");var jr=class ME extends a${static{l(this,"Container")}append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):t==="every"||t==="some"?r=>e[t]((i,...o)=>r(i.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let u of o)this.proxyOf.nodes.splice(r,0,u);let a;for(let u in this.indexes)a=this.indexes[u],r<=a&&(this.indexes[u]=a+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=xE(wE(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new vE(e)]}else if(e.selector)e=[new hp(e)];else if(e.name)e=[new dp(e)];else if(e.text)e=[new SE(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[bE]||ME.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[yE]&&CE(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(o){throw t.addToError(o)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};jr.registerParse=n=>{wE=n};jr.registerRule=n=>{hp=n};jr.registerAtRule=n=>{dp=n};jr.registerRoot=n=>{EE=n};var Un=jr;jr.default=jr;jr.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,dp.prototype):n.type==="rule"?Object.setPrototypeOf(n,hp.prototype):n.type==="decl"?Object.setPrototypeOf(n,vE.prototype):n.type==="comment"?Object.setPrototypeOf(n,SE.prototype):n.type==="root"&&Object.setPrototypeOf(n,EE.prototype),n[bE]=!0,n.nodes&&n.nodes.forEach(e=>{jr.rebuild(e)})};var l$=Un,TE,IE,co=class extends l${static{l(this,"Document")}constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new TE(new IE,this,e).stringify()}};co.registerLazyResult=n=>{TE=n};co.registerProcessor=n=>{IE=n};var pp=co;co.default=co;var np=class{static{l(this,"Warning")}constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},AE=np;np.default=np;var c$=AE,ip=class{static{l(this,"Result")}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new c$(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},mp=ip;ip.default=ip;var Ud=39,Zw=34,hc=92,Jw=47,dc=10,oo=32,pc=12,mc=9,gc=13,u$=91,f$=93,h$=40,d$=41,p$=123,m$=125,g$=59,y$=42,b$=58,v$=64,yc=/[\t\n\f\r "#'()/;[\\\]{}]/g,bc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S$=/.[\r\n"'(/\\]/,Qw=/[\da-f]/i,w$=l(function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,o,a,u,f,d,p,g,y,S,w,E=r.length,v=0,M=[],R=[];function T(){return v}l(T,"position");function N(W){throw e.error("Unclosed "+W,v)}l(N,"unclosed");function U(){return R.length===0&&v>=E}l(U,"endOfFile");function G(W){if(R.length)return R.pop();if(v>=E)return;let z=W?W.ignoreUnclosed:!1;switch(o=r.charCodeAt(v),o){case dc:case oo:case mc:case gc:case pc:{a=v;do a+=1,o=r.charCodeAt(a);while(o===oo||o===dc||o===mc||o===gc||o===pc);w=["space",r.slice(v,a)],v=a-1;break}case u$:case f$:case p$:case m$:case b$:case g$:case d$:{let re=String.fromCharCode(o);w=[re,re,v];break}case h$:{if(y=M.length?M.pop()[1]:"",S=r.charCodeAt(v+1),y==="url"&&S!==Ud&&S!==Zw&&S!==oo&&S!==dc&&S!==mc&&S!==pc&&S!==gc){a=v;do{if(p=!1,a=r.indexOf(")",a+1),a===-1)if(i||z){a=v;break}else N("bracket");for(g=a;r.charCodeAt(g-1)===hc;)g-=1,p=!p}while(p);w=["brackets",r.slice(v,a+1),v,a],v=a}else a=r.indexOf(")",v+1),f=r.slice(v,a+1),a===-1||S$.test(f)?w=["(","(",v]:(w=["brackets",f,v,a],v=a);break}case Ud:case Zw:{u=o===Ud?"'":'"',a=v;do{if(p=!1,a=r.indexOf(u,a+1),a===-1)if(i||z){a=v+1;break}else N("string");for(g=a;r.charCodeAt(g-1)===hc;)g-=1,p=!p}while(p);w=["string",r.slice(v,a+1),v,a],v=a;break}case v$:{yc.lastIndex=v+1,yc.test(r),yc.lastIndex===0?a=r.length-1:a=yc.lastIndex-2,w=["at-word",r.slice(v,a+1),v,a],v=a;break}case hc:{for(a=v,d=!0;r.charCodeAt(a+1)===hc;)a+=1,d=!d;if(o=r.charCodeAt(a+1),d&&o!==Jw&&o!==oo&&o!==dc&&o!==mc&&o!==gc&&o!==pc&&(a+=1,Qw.test(r.charAt(a)))){for(;Qw.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===oo&&(a+=1)}w=["word",r.slice(v,a+1),v,a],v=a;break}default:{o===Jw&&r.charCodeAt(v+1)===y$?(a=r.indexOf("*/",v+2)+1,a===0&&(i||z?a=r.length:N("comment")),w=["comment",r.slice(v,a+1),v,a],v=a):(bc.lastIndex=v+1,bc.test(r),bc.lastIndex===0?a=r.length-1:a=bc.lastIndex-2,w=["word",r.slice(v,a+1),v,a],M.push(w),v=a);break}}return v++,w}l(G,"nextToken");function Q(W){R.push(W)}return l(Q,"back"),{back:Q,endOfFile:U,nextToken:G,position:T}},"tokenizer"),RE=Un,xc=class extends RE{static{l(this,"AtRule")}constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},gp=xc;xc.default=xc;RE.registerAtRule(xc);var OE=Un,LE,NE,Ui=class extends OE{static{l(this,"Root")}constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of i)o.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new LE(new NE,this,e).stringify()}};Ui.registerLazyResult=n=>{LE=n};Ui.registerProcessor=n=>{NE=n};var mo=Ui;Ui.default=Ui;OE.registerRoot(Ui);var uo={comma(n){return uo.split(n,[","],!0)},space(n){let e=[" ",`
|
|
116
116
|
`," "];return uo.split(n,e)},split(n,e,t){let r=[],i="",o=!1,a=0,u=!1,f="",d=!1;for(let p of n)d?d=!1:p==="\\"?d=!0:u?p===f&&(u=!1):p==='"'||p==="'"?(u=!0,f=p):p==="("?a+=1:p===")"?a>0&&(a-=1):a===0&&e.includes(p)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=p;return(t||i!=="")&&r.push(i.trim()),r}},_E=uo;uo.default=uo;var DE=Un,E$=_E,Cc=class extends DE{static{l(this,"Rule")}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return E$.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}},yp=Cc;Cc.default=Cc;DE.registerRule(Cc);var x$=Rc,C$=w$,M$=Lc,T$=gp,I$=mo,eE=yp,tE={empty:!0,space:!0};function A$(n){for(let e=n.length-1;e>=0;e--){let t=n[e],r=t[3]||t[2];if(r)return r}}l(A$,"findLastWithPosition");var R$=class{static{l(this,"Parser")}constructor(e){this.input=e,this.root=new I$,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new T$;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,o,a=!1,u=!1,f=[],d=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?d.push(r==="("?")":"]"):r==="{"&&d.length>0?d.push("}"):r===d[d.length-1]&&d.pop(),d.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){u=!0;break}else if(r==="}"){if(f.length>0){for(o=f.length-1,i=f[o];i&&i[0]==="space";)i=f[--o];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else f.push(e);else f.push(e);if(this.tokenizer.endOfFile()){a=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(f),f.length?(t.raws.afterName=this.spacesAndCommentsFromStart(f),this.raw(t,"params",f),a&&(e=f[f.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),u&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let o=t-1;o>=0&&(i=e[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,o;for(let[a,u]of e.entries()){if(r=u,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return a}o=r}return!1}comment(e){let t=new M$;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=C$(this.input)}decl(e,t){let r=new x$;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||A$(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let d=e[0][0];if(d===":"||d==="space"||d==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],u;for(;e.length&&(u=e[0][0],!(u!=="space"&&u!=="comment"));)a.push(e.shift());this.precheckMissedSemicolon(e);for(let d=e.length-1;d>=0;d--){if(o=e[d],o[1].toLowerCase()==="!important"){r.important=!0;let p=this.stringFrom(e,d);p=this.spacesFromEnd(e)+p,p!==" !important"&&(r.raws.important=p);break}else if(o[1].toLowerCase()==="important"){let p=e.slice(0),g="";for(let y=d;y>0;y--){let S=p[y][0];if(g.trim().indexOf("!")===0&&S!=="space")break;g=p.pop()[1]+g}g.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=g,e=p)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(d=>d[0]!=="space"&&d[0]!=="comment")&&(r.raws.between+=a.map(d=>d[1]).join(""),a=[]),this.raw(r,"value",a.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new eE;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,o=null,a=[],u=e[1].startsWith("--"),f=[],d=e;for(;d;){if(r=d[0],f.push(d),r==="("||r==="[")o||(o=d),a.push(r==="("?")":"]");else if(u&&i&&r==="{")o||(o=d),a.push("}");else if(a.length===0)if(r===";")if(i){this.decl(f,u);return}else break;else if(r==="{"){this.rule(f);return}else if(r==="}"){this.tokenizer.back(f.pop()),t=!0;break}else r===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));d=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(o),t&&i){if(!u)for(;f.length&&(d=f[f.length-1][0],!(d!=="space"&&d!=="comment"));)this.tokenizer.back(f.pop());this.decl(f,u)}else this.unknownWord(f)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let o,a,u=r.length,f="",d=!0,p,g;for(let y=0;y<u;y+=1)o=r[y],a=o[0],a==="space"&&y===u-1&&!i?d=!1:a==="comment"?(g=r[y-1]?r[y-1][0]:"empty",p=r[y+1]?r[y+1][0]:"empty",!tE[g]&&!tE[p]?f.slice(-1)===","?d=!1:f+=o[1]:d=!1):f+=o[1];if(!d){let y=r.reduce((S,w)=>S+w[1],"");e.raws[t]={raw:y,value:f}}e[t]=f}rule(e){e.pop();let t=new eE;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},O$=R$,L$=Un,N$=O$,_$=Oc;function Mc(n,e){let t=new _$(n,e),r=new N$(t);try{r.parse()}catch(i){throw i}return r.root}l(Mc,"parse$3");var bp=Mc;Mc.default=Mc;L$.registerParse(Mc);var{isClean:xr,my:D$}=po,k$=gE,P$=Ic,F$=Un,$$=pp;var rE=mp,H$=bp,B$=mo,W$={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},V$={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},U$={Once:!0,postcssPlugin:!0,prepare:!0},Gi=0;function ao(n){return typeof n=="object"&&typeof n.then=="function"}l(ao,"isPromise");function kE(n){let e=!1,t=W$[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Gi,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Gi,t+"Exit"]:[t,t+"Exit"]}l(kE,"getEvents");function nE(n){let e;return n.type==="document"?e=["Document",Gi,"DocumentExit"]:n.type==="root"?e=["Root",Gi,"RootExit"]:e=kE(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}l(nE,"toStack");function sp(n){return n[xr]=!1,n.nodes&&n.nodes.forEach(e=>sp(e)),n}l(sp,"cleanMarks");var op={},zi=class PE{static{l(this,"LazyResult")}constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=sp(t);else if(t instanceof PE||t instanceof rE)i=sp(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=H$;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(t,r)}catch(a){this.processed=!0,this.error=a}i&&!i[D$]&&F$.rebuild(i)}this.result=new rE(e,i,r),this.helpers={...op,postcss:op,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=l((t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])},"add");for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!V$[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!U$[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ao(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xr];){e[xr]=!0;let t=[nE(e)];for(;t.length>0;){let r=this.visitTick(t);if(ao(r))try{await r}catch(i){let o=t[t.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ao(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=P$;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new k$(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(ao(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xr];)e[xr]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(t,this.helpers)}catch(a){throw this.handleError(a,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(ao(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[a,u]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=a;try{return u(r.toProxy(),this.helpers)}catch(f){throw this.handleError(f,r)}}if(t.iterator!==0){let a=t.iterator,u;for(;u=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!u[xr]){u[xr]=!0,e.push(nE(u));return}t.iterator=0,delete r.indexes[a]}let o=t.events;for(;t.eventIndex<o.length;){let a=o[t.eventIndex];if(t.eventIndex+=1,a===Gi){r.nodes&&r.nodes.length&&(r[xr]=!0,t.iterator=r.getIterator());return}else if(this.listeners[a]){t.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[xr]=!0;let t=kE(e);for(let r of t)if(r===Gi)e.nodes&&e.each(i=>{i[xr]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};zi.registerPostcss=n=>{op=n};var FE=zi;zi.default=zi;B$.registerLazyResult(zi);$$.registerLazyResult(zi);var G$=gE,z$=Ic;var j$=bp,q$=mp,ap=class{static{l(this,"NoWorkResult")}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,o=z$;this.result=new q$(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get(){return a.root}});let u=new G$(o,i,this._opts,t);if(u.isMap()){let[f,d]=u.generate();f&&(this.result.css=f),d&&(this.result.map=d)}else u.clearAnnotation(),this.result.css=u.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=j$;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},Y$=ap;ap.default=ap;var K$=Y$,X$=FE,Z$=pp,J$=mo,fo=class{static{l(this,"Processor")}constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new K$(this,e,t):new X$(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Q$=fo;fo.default=fo;J$.registerProcessor(fo);Z$.registerProcessor(fo);var eH=Rc,tH=fE,rH=Lc,nH=gp,iH=Oc,sH=mo,oH=yp;function ho(n,e){if(Array.isArray(n))return n.map(i=>ho(i));let{inputs:t,...r}=n;if(t){e=[];for(let i of t){let o={...i,__proto__:iH.prototype};o.map&&(o.map={...o.map,__proto__:tH.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(i=>ho(i,e))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new sH(r);if(r.type==="decl")return new eH(r);if(r.type==="rule")return new oH(r);if(r.type==="comment")return new rH(r);if(r.type==="atrule")return new nH(r);throw new Error("Unknown node type: "+n.type)}l(ho,"fromJSON$1");var aH=ho;ho.default=ho;var lH=fp,$E=Rc,cH=FE,uH=Un,vp=Q$,fH=Ic,hH=aH,HE=pp,dH=AE,BE=Lc,WE=gp,pH=mp,mH=Oc,gH=bp,yH=_E,VE=yp,UE=mo,bH=Ac;function Ne(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new vp(n)}l(Ne,"postcss");Ne.plugin=l(function(e,t){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
117
117
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
118
|
-
https://www.w3ctech.com/topic/2226`));let u=t(...a);return u.postcssPlugin=e,u.postcssVersion=new vp().version,u}l(i,"creator");let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,u,f){return Ne([i(f)]).process(a,u)},i},"plugin");Ne.stringify=fH;Ne.parse=gH;Ne.fromJSON=hH;Ne.list=yH;Ne.comment=n=>new BE(n);Ne.atRule=n=>new WE(n);Ne.decl=n=>new $E(n);Ne.rule=n=>new VE(n);Ne.root=n=>new UE(n);Ne.document=n=>new HE(n);Ne.CssSyntaxError=lH;Ne.Declaration=$E;Ne.Container=uH;Ne.Processor=vp;Ne.Document=HE;Ne.Comment=BE;Ne.Warning=dH;Ne.AtRule=WE;Ne.Result=pH;Ne.Input=mH;Ne.Rule=VE;Ne.Root=UE;Ne.Node=bH;cH.registerPostcss(Ne);var vH=Ne;Ne.default=Ne;var Ze=LF(vH);Ze.stringify;Ze.fromJSON;Ze.plugin;Ze.parse;Ze.list;Ze.document;Ze.comment;Ze.atRule;Ze.rule;Ze.decl;Ze.root;Ze.CssSyntaxError;Ze.Declaration;Ze.Container;Ze.Processor;Ze.Document;Ze.Comment;Ze.Warning;Ze.AtRule;Ze.Result;Ze.Input;Ze.Rule;Ze.Root;Ze.Node;var Nc=class{constructor(e){this.timeMachine=e;this.seekbarMin=Date.now();this.seekbarMax=Date.now();this.seekBar=null;this.label=null}static{l(this,"TimeMachineSeeker")}open(){this.removeExistingSeekbar(),this.updateTimestampRange(),this.createSeekbar()}removeExistingSeekbar(){let e=document.getElementById("time-machine-seekbar");e&&e.remove()}updateTimestampRange(){this.seekbarMax=Date.now(),console.log("Creating seekbar with min/max timestamp",this.seekbarMin,this.seekbarMax),console.log("Current timestamp",this.timeMachine.getCurrentTimestamp())}createSeekbar(){let e=this.createContainer();this.seekBar=this.createSeekBar(),this.label=this.createLabel();let t=this.createRefreshButton();this.setupEventListeners(),e.appendChild(this.seekBar),e.appendChild(this.label),e.appendChild(t),document.body.appendChild(e)}createContainer(){let e=document.createElement("div");return e.id="time-machine-seekbar",Object.assign(e.style,{position:"absolute",width:"90%",bottom:"0",background:"white",opacity:"0.75",display:"flex",justifyContent:"center",alignItems:"center",padding:"10px",margin:"0 20px",gap:"10px"}),e}createSeekBar(){let e=document.createElement("input");return e.type="range",e.min="0",e.max="100",e.step="1",e.value="100",e.style.flexGrow="1",e}createLabel(){let e=document.createElement("span");return e.textContent=this.formatTimestamp(this.seekbarMax),e}createRefreshButton(){let e=document.createElement("button");return e.textContent="Refresh",e.addEventListener("click",()=>{this.open()}),e}setupEventListeners(){if(!this.seekBar||!this.label)return;let e=l(()=>{let t=parseFloat(this.seekBar.value)/100,r=this.getTimestamp(t);console.log("Seeking to timestamp",r),this.label.textContent=this.formatTimestamp(r),this.timeMachine.goBack(r)},"handleSeek");this.seekBar.addEventListener("input",e),this.seekBar.addEventListener("change",e)}getTimestamp(e){let t=Math.round(this.seekbarMin+e*(this.seekbarMax-this.seekbarMin));return Math.max(this.seekbarMin,Math.min(this.seekbarMax,t))}formatTimestamp(e){let t=Math.max(0,Math.floor((e-this.seekbarMin)/1e3)),r=Math.floor(t/60),i=t%60;return`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}};var _c=class extends lc{constructor(){super({enableInteract:!0});this.shouldHandleEvents=!0;this.name="timeMachine";this.rrwebSnapshot=aE}static{l(this,"TimeMachine")}setEventHandlers(t,r=!0){this.shouldHandleEvents=r,super.setEventHandlers(t)}async handleEvents(t){try{t=t.filter(r=>r.timestamp>=(this.lastSeenTimestamp?this.lastSeenTimestamp:0)),t.length&&(this.lastSeenTimestamp=t[t.length-1].timestamp);for(let r of t)await this.eventProcessor.processEvent(r,this.shouldHandleEvents),await this.skipEvents([r])}catch(r){console.error(r)}}setShouldHandleEvents(t){this.shouldHandleEvents=t}async goBack(t){return t?this.sessionReplayer.goBack(t):this.goLive()}getElementByRRwebId(t){return this.sessionReplayer.getNodeById(t)}goLive(){return this.sessionReplayer.goLive()}getCurrentTimestamp(){return this.sessionReplayer.getCurrentTimestamp()}getFirstEventTimestamp(){return this.sessionReplayer.getFirstEventTimestamp()}subscribeToEventCast(t,r,i){this.sessionReplayer.subscribeTo(t,r,i)}isConnected(){return this.sessionReplayer.isConnected()}unsubscribeFromEventCast(t){this.sessionReplayer.unsubscribeFrom(t)}openSeekbar(){this.seeker||(this.seeker=new Nc(this)),this.seeker.open()}};var GE=l(({locator:n,parentFramesSelectors:e=[]})=>e.reverse().reduce((t,r)=>`frameLocator('${r}').${t}`,n),"getNestedFramesSelection");var jE=aa(uf());var Dc=class{constructor(){this.esraExtractors=[];this.playwrightSelector=new Tt}static{l(this,"TimeMachineElementSelection")}async getSelector(e,{extractPlaywrightSelector:t=!0,extractEsraMetadata:r=!0,rootDocument:i=document}={}){if(!e)return null;let o={};if(r)try{console.log("extracting ESRA metadata...");let a=this.getESRAExtractor(e).extract(e);o.esraMetadata=a.toMetadata(),console.log("ESRA metadata extraction complete")}catch(a){console.error("Failed to extract ESRA metadata",a)}if(t){let{selector:a,locator:u,parentFramesSelectors:f}=await this.playwrightSelector.getSelectorAndLocator(e,{ignoredIframesSelectors:[".replayer-wrapper > iframe"],rootDocument:i,flags:{originFlag:"timemachine"}});o.playwrightSelector=a,o.playwrightLocator=u,o.playwrightParentFramesSelectors=f}return o}getESRAExtractor(e){let t=e.ownerDocument;if(!t)throw console.warn("Node does not have an owner document",e),new Error("Node does not have an owner document");let r=this.esraExtractors.find(o=>o.isSameDocument(t));if(r)return r;let i=new nr(t);return this.esraExtractors.push(i),i}};var kc=class n{static{l(this,"SequenceMatcher")}findSequence(e,t,r){for(let i=0;i<=e.length-t.length;i++){let o=this.findMatch(i,e,t,r);if(o!==null)return o}return null}findMatch(e,t,r,i){let o={},a=[];for(let u=0;u<r.length;u++){let f=t[e+u],d=r[u];if(!this.matchItem(d,f,o,i??f))return null;a.push(f)}return{items:a,token_values:o}}matchItem(e,t,r,i){if(Array.isArray(e)&&Array.isArray(t))return this.matchArray(e,t,r,i);if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null){for(let o in e){let a=e[o],u=t[o];if(typeof a=="string"&&a.startsWith("$")){if(r[a]===void 0)r[a]={value:u,item:i};else if(r[a].value!==u)return!1}else if(typeof a=="object"&&a!==null){if(!this.matchItem(a,u,r,i))return!1}else if(a!==u)return!1}return!0}else return e===t}matchArray(e,t,r,i){for(let o=0;o<=t.length-e.length;o++){let a=t.slice(o,o+e.length),u=this.findSequence(a,e,i);if(u){for(let f in u.token_values)if(r[f]===void 0)r[f]={value:u.token_values[f].value,item:i};else if(r[f].value!==u.token_values[f].value)return!1;return!0}}return!1}runExample(){let e=[{x:"banana",id:"1gf3",class:"fruit",index:"3",details:{a:1,b:2,nested:{key:"value1"}},arr:[{a:3,b:2},{a:1,b:2}]},{y:"apple",id:"4gs2",class:"fruit",parentIndex:"3",index:"7",details:{a:1,b:2,nested:{key:"value1"}}}],t=[{class:"$1",index:"$2",details:{a:1,b:"$3",nested:{key:"$4"}},arr:[{a:1,b:"$5"}]},{class:"$1",parentIndex:"$2",details:{a:1,b:"$3",nested:{key:"$4"}}}],i=new n().findSequence(e,t);console.log(i)}};var yt=[];for(Pc=0;Pc<256;++Pc)yt.push((Pc+256).toString(16).slice(1));var Pc;function zE(n,e=0){return(yt[n[e+0]]+yt[n[e+1]]+yt[n[e+2]]+yt[n[e+3]]+"-"+yt[n[e+4]]+yt[n[e+5]]+"-"+yt[n[e+6]]+yt[n[e+7]]+"-"+yt[n[e+8]]+yt[n[e+9]]+"-"+yt[n[e+10]]+yt[n[e+11]]+yt[n[e+12]]+yt[n[e+13]]+yt[n[e+14]]+yt[n[e+15]]).toLowerCase()}l(zE,"unsafeStringify");var Fc,SH=new Uint8Array(16);function Sp(){if(!Fc&&(Fc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Fc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fc(SH)}l(Sp,"rng");var wH=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wp={randomUUID:wH};function EH(n,e,t){if(wp.randomUUID&&!e&&!n)return wp.randomUUID();n=n||{};var r=n.random||(n.rng||Sp)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var i=0;i<16;++i)e[t+i]=r[i];return e}return zE(r)}l(EH,"v4");var go=EH;var xH=!1,$c=class extends $i{constructor(t){super();this.onStep=t;this.events=[];this.previousEvent=null;this.steps=[];this.lastInteractionEventIndex=0;this.sequences=[];this.sequenceMatcher=new kc;this.inputFilter=void 0;this.clickFilter=void 0;this.releasePendingInputAction=l(()=>{this.log("releasePendingInputAction",this.inputFilter),clearTimeout(this.inputFilter.timeout),this.addStep({step:this.inputFilter.action,type:"action"}),this.inputFilter=void 0},"releasePendingInputAction");this.lastMouseDown=void 0;this.hasUndefinedFocus=!1;this.releasePendingClickActions=l((t=!0)=>{this.log("releasePendingClickActions",Date.now(),{addInteractions:t},this.clickFilter),this.clickFilter&&clearTimeout(this.clickFilter.timeout),t&&this.clickFilter.actions.forEach(r=>this.addStep({step:r,type:"action"})),this.clickFilter=void 0},"releasePendingClickActions");this.dragAndDropSequence={events:[{type:j.IncrementalSnapshot,data:{source:V.MouseInteraction,type:ne.MouseDown}},{type:j.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:"$dropzoneId",node:{id:"$draggableId"}}],removes:[{id:"$draggableId"}]}}],handler:l(async({token_values:{$dropzoneId:t,$draggableId:r},items:i})=>{let o=r.value,{selector:a}=await this.getNodeAndSelector(o,{timestamp:r.item.timestamp,revert:!1});if(!a)return;let u=t.value,{selector:f}=await this.getNodeAndSelector(u,{timestamp:t.item.timestamp});if(f)return console.log("Drag and drop",a.playwrightLocator,f.playwrightLocator),[this.makePageAction("drag_and_drop",i[0],a,{dropTarget:{selector:f.playwrightSelector,locator:f.playwrightLocator,parentFramesSelectors:f.playwrightParentFramesSelectors,esraMetadata:f.esraMetadata,rrwebId:u}})]},"handler")};this.maxNumberOfGetNodeRetries=3;this.elementSelector=new Dc,this.buildSequences()}static{l(this,"VisualTestGenerationTimeMachineEventHandlers")}log(...t){xH&&console.log(...t)}setSessionReplayer(){let t=window.parent.document.createElement("div");t.classList.add("live-tm"),t.style.display="none",window.parent.document.body.appendChild(t),this.sessionReplayer=new Bi({enableInteract:!1,root:t,onlyLive:!0}),this.sessionReplayer.start({firstEventTimestamp:Date.now()})}getSteps(t=0){return this.steps.slice(t)}async preEvent(t){this.inputFilter&&Vn(t)&&!this.isConsecutiveInputEvent(t)&&this.releasePendingInputAction(),this.clickFilter&&Vn(t)&&await this.isConsecutiveCheckboxInputEvent(t)&&this.releasePendingClickActions(!1),this.clickFilter&&Vn(t)&&!this.isConsecutiveMouseInteractionEvent(t)&&this.releasePendingClickActions(),this.events.push(t)}async postEvent(t,r,i=!0){this.sessionReplayer.fastForward([t]),this.previousEvent=t}async handleInput(t,r,i=!1){if(this.inputFilter){this.inputFilter.action.fillValue=t.text,this.inputFilter.timeout=this.setInputWaitTimeout();return}if(!t.userTriggered)return;let{node:o,selector:a}=await this.getNodeAndSelector(t.id);if(!o||!a)return;let u=this.makePageAction(this.getInputEventCode(o,t),r,a);if(u.rrwebId=t.id,u.eventCode==="input"){u.timestamp=this.previousEvent?.timestamp??r.timestamp,u.fillValue=t.text,this.inputFilter={action:u,nodeId:t.id,contenteditable:i,timeout:this.setInputWaitTimeout()};return}u.eventCode==="selectoption"&&(u.fillValue=t.text),u.eventCode==="upload_files"&&(u.files=[],u.files.push(t.text.split("\\").pop())),this.addStep({step:u,type:"action"})}isConsecutiveInputEvent(t){return this.inputFilter?this.inputFilter.contenteditable?t.type===j.Custom&&t.data.tag==="contenteditable-input"&&t.data.payload.id===this.inputFilter.nodeId:t.type===j.IncrementalSnapshot&&t.data.source===V.Input&&t.data.id===this.inputFilter.nodeId&&!!t.data.userTriggered:!1}setInputWaitTimeout(){return this.inputFilter?.timeout&&clearTimeout(this.inputFilter.timeout),setTimeout(this.releasePendingInputAction,1e3)}handleContentEditableInput(t,r){this.handleInput({userTriggered:!0,id:t.id,text:t.text,isChecked:!1,source:V.Input},r,!0)}handleNativeDialog(t,r){try{let{dialogAction:i,dialogType:o,dialogResult:a,dialogMessage:u}=t,f={dialogResult:a,dialogType:o,dialogMessage:u},d=this.makePageAction(i,r,{},{nativeDialog:f});this.addStep({step:d,type:"action"})}catch(i){console.error("handleNativeDialog",i)}}handleRecordAssertion(t,r){this.addStep({step:this.makeAssertion(t,r),type:"assertion"})}handleRecordHover(t,r){try{let i=this.makePageAction("hover",r,{playwrightLocator:t.locator});this.addStep({step:i,type:"action"})}catch(i){console.error("handleRecordHover",i)}}handleKeyStroke(t,r){}async handleMouseDown(t,r){let{selector:i}=await this.getNodeAndSelector(t.id);this.lastMouseDown={selector:i,data:t,event:r}}handleFocus(t,r){this.hasUndefinedFocus=t.id===-1}async handleClick(t,r){try{if(t.x===void 0||t.y===void 0)return;if(this.lastMouseDown&&this.lastMouseDown.data.id!==t.id&&this.hasUndefinedFocus){let a=this.makePageAction("click",this.lastMouseDown.event,this.lastMouseDown.selector);this.addStep({step:a,type:"action"});return}let{selector:i}=await this.getNodeAndSelector(t.id);if(!i)return;let o=this.makePageAction("click",r,i);if(this.log("handleClick",Date.now(),o),this.clickFilter){this.log("handleClick","adding to filter"),this.clickFilter.actions.push(o);return}this.clickFilter={actions:[o],nodeId:t.id,timeout:this.setClickWaitTimeout()}}finally{this.hasUndefinedFocus=!1,this.lastMouseDown=void 0}}isConsecutiveMouseInteractionEvent(t){return this.clickFilter?t.type===j.IncrementalSnapshot&&t.data.source===V.MouseInteraction&&t.data.id===this.clickFilter.nodeId:!1}async isConsecutiveCheckboxInputEvent(t){if(!this.clickFilter)return!1;let r=l(async i=>{let{node:o}=await this.getNodeAndSelector(this.clickFilter.nodeId);return["check","uncheck"].includes(this.getInputEventCode(o,i))},"isCheckboxInput");return t.type===j.IncrementalSnapshot&&t.data.source===V.Input&&t.data.userTriggered&&t.data.id===this.clickFilter.nodeId&&await r(t.data)}setClickWaitTimeout(){return this.clickFilter?.timeout&&clearTimeout(this.clickFilter.timeout),this.log("setClickWaitTimeout",Date.now()),setTimeout(this.releasePendingClickActions,600)}async handleDblClick(t,r){if(t.x===void 0||t.y===void 0)return;let{selector:i}=await this.getNodeAndSelector(t.id),o=this.makePageAction("double_click",r,i);this.log("handleDblClick",o),this.addStep({step:o,type:"action"}),this.releasePendingClickActions(!1)}buildSequences(){this.sequences.push(this.dragAndDropSequence)}async performSequenceSearch(){let t=this.events.slice(this.lastInteractionEventIndex);for(let r of this.sequences){let i=this.sequenceMatcher.findSequence(t,r.events);if(i){let o=await r.handler(i);o&&o.forEach(a=>this.addStep({step:a,type:"action"}))}}await this.sessionReplayer.goLive()}addStep(t){t.type==="action"&&!t.step.id&&(t.step.id=go()),this.steps.push(t),this.lastInteractionEventIndex=this.events.length,this.log("addStep",t),this.onStep?.(t)}makeAssertion(t,r){return{matcher:t.matcher,locator:t.locator,thought:t.thought,timestamp:r.timestamp,id:t?.id||go()}}makePageAction(t,r,i,o={}){return console.log("making action with ts",r.timestamp,Date.now()-r.timestamp),{eventCode:t,selector:i.playwrightSelector,locator:GE({locator:i.playwrightLocator,parentFramesSelectors:i.playwrightParentFramesSelectors}),esraMetadata:i.esraMetadata,pageId:void 0,timestamp:r.timestamp,id:o?.id||go(),rrwebId:r.data?.id,...o,parentFramesSelectors:[]}}async getNodeById(t,{retriesLeft:r=this.maxNumberOfGetNodeRetries,useCompoundInteractableDetection:i=!0}={}){if(!r)return console.error("no node"),null;let o=this.sessionReplayer.getNodeById(t);return o?i?wa(o,[]):o:(await(0,jE.default)(100*(this.maxNumberOfGetNodeRetries-r+1)),this.getNodeById(t,{retriesLeft:r-1,useCompoundInteractableDetection:i}))}getInputEventCode(t,r){if(t.tagName.toLowerCase()==="select")return"selectoption";switch(t.getAttribute("type")){case"file":return"upload_files";case"checkbox":case"radio":return r.isChecked?"check":"uncheck";case"text":default:return"input"}}async getNodeAndSelector(t,{timestamp:r,revert:i=!0}={}){r&&await this.sessionReplayer.goBack(r);let o=await this.getNodeById(t);if(!o)return{};let a=await this.elementSelector.getSelector(o,{extractEsraMetadata:!1,rootDocument:this.sessionReplayer.getIframeDocument()});return a?(r&&i&&await this.sessionReplayer.goLive(),{node:o,selector:a}):{node:o}}};var Hc=class{constructor(e){this.timeMachine=e;this.sendRecordedSteps=!1;this.onNewRecordedStep=l(e=>{this.sendRecordedSteps&&window.parent.postMessage({type:"new-recorded-step",data:[e]})},"onNewRecordedStep");this.eventHandlers=new $c(this.onNewRecordedStep)}static{l(this,"VisualTestGenerator")}init(){this.timeMachine.setEventHandlers(this.eventHandlers,!0)}setSendRecordedSteps(e){this.sendRecordedSteps=e}startInspector({singleSelection:e=!0,rootDocument:t,timestamp:r,eventName:i}){this.stopInspector();let o=l(a=>a.top.document.querySelector("iframe.time-machine-iframe").contentDocument,"getRenderDocument");this.elementInspector=new Pi({rootDocument:t??this.getRRwebReplayerDocument(),getRenderDocument:o,rootDocumentForSelectorGenerator:this.getRRwebReplayerDocument(),eventName:i}),this.elementInspector.start({singleSelection:e,timestamp:r})}getRRwebReplayerDocument(){return document.querySelector(".replayer-wrapper > iframe").contentDocument}stopInspector(){this.elementInspector?.stop()}consumeSelections(){return this.elementInspector.consumeSelections()}};(function(){let n=Element.prototype.addEventListener;Element.prototype.addEventListener=function(e,t,r){n.call(this,e,t,r),this._checksum_eventListenerList||(this._checksum_eventListenerList={}),this._checksum_eventListenerList[e]||(this._checksum_eventListenerList[e]=[]),this._checksum_eventListenerList[e].push(t)}})();if(!window.checksum){let n=new oc,e=new _c,t=new Hc(e);window.checksum={testGenerator:n,timeMachine:e,visualTestGenerator:t},window.checksumRRWeb&&console.log(`Using forked rrweb@${window.checksumRRWeb.version}`)}})();
|
|
118
|
+
https://www.w3ctech.com/topic/2226`));let u=t(...a);return u.postcssPlugin=e,u.postcssVersion=new vp().version,u}l(i,"creator");let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,u,f){return Ne([i(f)]).process(a,u)},i},"plugin");Ne.stringify=fH;Ne.parse=gH;Ne.fromJSON=hH;Ne.list=yH;Ne.comment=n=>new BE(n);Ne.atRule=n=>new WE(n);Ne.decl=n=>new $E(n);Ne.rule=n=>new VE(n);Ne.root=n=>new UE(n);Ne.document=n=>new HE(n);Ne.CssSyntaxError=lH;Ne.Declaration=$E;Ne.Container=uH;Ne.Processor=vp;Ne.Document=HE;Ne.Comment=BE;Ne.Warning=dH;Ne.AtRule=WE;Ne.Result=pH;Ne.Input=mH;Ne.Rule=VE;Ne.Root=UE;Ne.Node=bH;cH.registerPostcss(Ne);var vH=Ne;Ne.default=Ne;var Ze=LF(vH);Ze.stringify;Ze.fromJSON;Ze.plugin;Ze.parse;Ze.list;Ze.document;Ze.comment;Ze.atRule;Ze.rule;Ze.decl;Ze.root;Ze.CssSyntaxError;Ze.Declaration;Ze.Container;Ze.Processor;Ze.Document;Ze.Comment;Ze.Warning;Ze.AtRule;Ze.Result;Ze.Input;Ze.Rule;Ze.Root;Ze.Node;var Nc=class{constructor(e){this.timeMachine=e;this.seekbarMin=Date.now();this.seekbarMax=Date.now();this.seekBar=null;this.label=null}static{l(this,"TimeMachineSeeker")}open(){this.removeExistingSeekbar(),this.updateTimestampRange(),this.createSeekbar()}removeExistingSeekbar(){let e=document.getElementById("time-machine-seekbar");e&&e.remove()}updateTimestampRange(){this.seekbarMax=Date.now(),console.log("Creating seekbar with min/max timestamp",this.seekbarMin,this.seekbarMax),console.log("Current timestamp",this.timeMachine.getCurrentTimestamp())}createSeekbar(){let e=this.createContainer();this.seekBar=this.createSeekBar(),this.label=this.createLabel();let t=this.createRefreshButton();this.setupEventListeners(),e.appendChild(this.seekBar),e.appendChild(this.label),e.appendChild(t),document.body.appendChild(e)}createContainer(){let e=document.createElement("div");return e.id="time-machine-seekbar",Object.assign(e.style,{position:"absolute",width:"90%",bottom:"0",background:"white",opacity:"0.75",display:"flex",justifyContent:"center",alignItems:"center",padding:"10px",margin:"0 20px",gap:"10px"}),e}createSeekBar(){let e=document.createElement("input");return e.type="range",e.min="0",e.max="100",e.step="1",e.value="100",e.style.flexGrow="1",e}createLabel(){let e=document.createElement("span");return e.textContent=this.formatTimestamp(this.seekbarMax),e}createRefreshButton(){let e=document.createElement("button");return e.textContent="Refresh",e.addEventListener("click",()=>{this.open()}),e}setupEventListeners(){if(!this.seekBar||!this.label)return;let e=l(()=>{let t=parseFloat(this.seekBar.value)/100,r=this.getTimestamp(t);console.log("Seeking to timestamp",r),this.label.textContent=this.formatTimestamp(r),this.timeMachine.goBack(r)},"handleSeek");this.seekBar.addEventListener("input",e),this.seekBar.addEventListener("change",e)}getTimestamp(e){let t=Math.round(this.seekbarMin+e*(this.seekbarMax-this.seekbarMin));return Math.max(this.seekbarMin,Math.min(this.seekbarMax,t))}formatTimestamp(e){let t=Math.max(0,Math.floor((e-this.seekbarMin)/1e3)),r=Math.floor(t/60),i=t%60;return`${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`}};var _c=class extends lc{constructor(){super({enableInteract:!0});this.shouldHandleEvents=!0;this.name="timeMachine";this.rrwebSnapshot=aE}static{l(this,"TimeMachine")}setEventHandlers(t,r=!0){this.shouldHandleEvents=r,super.setEventHandlers(t)}async handleEvents(t){try{t=t.filter(r=>r.timestamp>=(this.lastSeenTimestamp?this.lastSeenTimestamp:0)),t.length&&(this.lastSeenTimestamp=t[t.length-1].timestamp);for(let r of t)await this.eventProcessor.processEvent(r,this.shouldHandleEvents),await this.skipEvents([r])}catch(r){console.error(r)}}setShouldHandleEvents(t){this.shouldHandleEvents=t}async goBack(t){return t?this.sessionReplayer.goBack(t):this.goLive()}getElementByRRwebId(t){return this.sessionReplayer.getNodeById(t)}goLive(){return this.sessionReplayer.goLive()}getCurrentTimestamp(){return this.sessionReplayer.getCurrentTimestamp()}getFirstEventTimestamp(){return this.sessionReplayer.getFirstEventTimestamp()}subscribeToEventCast(t,r,i){this.sessionReplayer.subscribeTo(t,r,i)}isConnected(){return this.sessionReplayer.isConnected()}unsubscribeFromEventCast(t){this.sessionReplayer.unsubscribeFrom(t)}openSeekbar(){this.seeker||(this.seeker=new Nc(this)),this.seeker.open()}};var GE=l(({locator:n,parentFramesSelectors:e=[]})=>e.reverse().reduce((t,r)=>`frameLocator('${r}').${t}`,n),"getNestedFramesSelection");var jE=aa(uf());var Dc=class{constructor(){this.esraExtractors=[];this.playwrightSelector=new Tt}static{l(this,"TimeMachineElementSelection")}async getSelector(e,{extractPlaywrightSelector:t=!0,extractEsraMetadata:r=!0,rootDocument:i=document}={}){if(!e)return null;let o={};if(r)try{console.log("extracting ESRA metadata...");let a=this.getESRAExtractor(e).extract(e);o.esraMetadata=a.toMetadata(),console.log("ESRA metadata extraction complete")}catch(a){console.error("Failed to extract ESRA metadata",a)}if(t){let{selector:a,locator:u,parentFramesSelectors:f}=await this.playwrightSelector.getSelectorAndLocator(e,{ignoredIframesSelectors:[".replayer-wrapper > iframe"],rootDocument:i,flags:{originFlag:"timemachine"}});o.playwrightSelector=a,o.playwrightLocator=u,o.playwrightParentFramesSelectors=f}return o}getESRAExtractor(e){let t=e.ownerDocument;if(!t)throw console.warn("Node does not have an owner document",e),new Error("Node does not have an owner document");let r=this.esraExtractors.find(o=>o.isSameDocument(t));if(r)return r;let i=new nr(t);return this.esraExtractors.push(i),i}};var kc=class n{static{l(this,"SequenceMatcher")}findSequence(e,t,r){for(let i=0;i<=e.length-t.length;i++){let o=this.findMatch(i,e,t,r);if(o!==null)return o}return null}findMatch(e,t,r,i){let o={},a=[];for(let u=0;u<r.length;u++){let f=t[e+u],d=r[u];if(!this.matchItem(d,f,o,i??f))return null;a.push(f)}return{items:a,token_values:o}}matchItem(e,t,r,i){if(Array.isArray(e)&&Array.isArray(t))return this.matchArray(e,t,r,i);if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null){for(let o in e){let a=e[o],u=t[o];if(typeof a=="string"&&a.startsWith("$")){if(r[a]===void 0)r[a]={value:u,item:i};else if(r[a].value!==u)return!1}else if(typeof a=="object"&&a!==null){if(!this.matchItem(a,u,r,i))return!1}else if(a!==u)return!1}return!0}else return e===t}matchArray(e,t,r,i){for(let o=0;o<=t.length-e.length;o++){let a=t.slice(o,o+e.length),u=this.findSequence(a,e,i);if(u){for(let f in u.token_values)if(r[f]===void 0)r[f]={value:u.token_values[f].value,item:i};else if(r[f].value!==u.token_values[f].value)return!1;return!0}}return!1}runExample(){let e=[{x:"banana",id:"1gf3",class:"fruit",index:"3",details:{a:1,b:2,nested:{key:"value1"}},arr:[{a:3,b:2},{a:1,b:2}]},{y:"apple",id:"4gs2",class:"fruit",parentIndex:"3",index:"7",details:{a:1,b:2,nested:{key:"value1"}}}],t=[{class:"$1",index:"$2",details:{a:1,b:"$3",nested:{key:"$4"}},arr:[{a:1,b:"$5"}]},{class:"$1",parentIndex:"$2",details:{a:1,b:"$3",nested:{key:"$4"}}}],i=new n().findSequence(e,t);console.log(i)}};var yt=[];for(Pc=0;Pc<256;++Pc)yt.push((Pc+256).toString(16).slice(1));var Pc;function zE(n,e=0){return(yt[n[e+0]]+yt[n[e+1]]+yt[n[e+2]]+yt[n[e+3]]+"-"+yt[n[e+4]]+yt[n[e+5]]+"-"+yt[n[e+6]]+yt[n[e+7]]+"-"+yt[n[e+8]]+yt[n[e+9]]+"-"+yt[n[e+10]]+yt[n[e+11]]+yt[n[e+12]]+yt[n[e+13]]+yt[n[e+14]]+yt[n[e+15]]).toLowerCase()}l(zE,"unsafeStringify");var Fc,SH=new Uint8Array(16);function Sp(){if(!Fc&&(Fc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Fc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fc(SH)}l(Sp,"rng");var wH=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wp={randomUUID:wH};function EH(n,e,t){if(wp.randomUUID&&!e&&!n)return wp.randomUUID();n=n||{};var r=n.random||(n.rng||Sp)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var i=0;i<16;++i)e[t+i]=r[i];return e}return zE(r)}l(EH,"v4");var go=EH;var xH=!1,$c=class extends $i{constructor(t){super();this.onStep=t;this.events=[];this.previousEvent=null;this.steps=[];this.lastInteractionEventIndex=0;this.sequences=[];this.sequenceMatcher=new kc;this.inputFilter=void 0;this.clickFilter=void 0;this.releasePendingInputAction=l(()=>{this.log("releasePendingInputAction",this.inputFilter),clearTimeout(this.inputFilter.timeout),this.addStep({step:this.inputFilter.action,type:"action"}),this.inputFilter=void 0},"releasePendingInputAction");this.lastMouseDown=void 0;this.hasUndefinedFocus=!1;this.releasePendingClickActions=l((t=!0)=>{this.log("releasePendingClickActions",Date.now(),{addInteractions:t},this.clickFilter),this.clickFilter&&clearTimeout(this.clickFilter.timeout),t&&this.clickFilter.actions.forEach(r=>this.addStep({step:r,type:"action"})),this.clickFilter=void 0},"releasePendingClickActions");this.dragAndDropSequence={events:[{type:j.IncrementalSnapshot,data:{source:V.MouseInteraction,type:ne.MouseDown}},{type:j.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:"$dropzoneId",node:{id:"$draggableId"}}],removes:[{id:"$draggableId"}]}}],handler:l(async({token_values:{$dropzoneId:t,$draggableId:r},items:i})=>{let o=r.value,{selector:a}=await this.getNodeAndSelector(o,{timestamp:r.item.timestamp,revert:!1});if(!a)return;let u=t.value,{selector:f}=await this.getNodeAndSelector(u,{timestamp:t.item.timestamp});if(f)return console.log("Drag and drop",a.playwrightLocator,f.playwrightLocator),[this.makePageAction("drag_and_drop",i[0],a,{dropTarget:{selector:f.playwrightSelector,locator:f.playwrightLocator,parentFramesSelectors:f.playwrightParentFramesSelectors,esraMetadata:f.esraMetadata,rrwebId:u}})]},"handler")};this.maxNumberOfGetNodeRetries=3;this.elementSelector=new Dc,this.buildSequences()}static{l(this,"VisualTestGenerationTimeMachineEventHandlers")}log(...t){xH&&console.log(...t)}setSessionReplayer(){let t=window.parent.document.createElement("div");t.classList.add("live-tm"),t.style.display="none",window.parent.document.body.appendChild(t),this.sessionReplayer=new Bi({enableInteract:!1,root:t,onlyLive:!0}),this.sessionReplayer.start({firstEventTimestamp:Date.now()})}getSteps(t=0){return this.steps.slice(t)}async preEvent(t){this.inputFilter&&Vn(t)&&!this.isConsecutiveInputEvent(t)&&this.releasePendingInputAction(),this.clickFilter&&Vn(t)&&await this.isConsecutiveCheckboxInputEvent(t)&&this.releasePendingClickActions(!1),this.clickFilter&&Vn(t)&&!this.isConsecutiveMouseInteractionEvent(t)&&this.releasePendingClickActions(),this.events.push(t)}async postEvent(t,r,i=!0){this.sessionReplayer.fastForward([t]),this.previousEvent=t}async handleInput(t,r,i=!1){if(this.inputFilter){this.inputFilter.action.fillValue=t.text,this.inputFilter.timeout=this.setInputWaitTimeout();return}if(!t.userTriggered)return;let{node:o,selector:a}=await this.getNodeAndSelector(t.id);if(!o||!a)return;let u=this.makePageAction(this.getInputEventCode(o,t),r,a);if(u.rrwebId=t.id,u.eventCode==="input"){u.timestamp=this.previousEvent?.timestamp??r.timestamp,u.fillValue=t.text,this.inputFilter={action:u,nodeId:t.id,contenteditable:i,timeout:this.setInputWaitTimeout()};return}u.eventCode==="selectoption"&&(u.fillValue=t.text),u.eventCode==="upload_files"&&(u.files=[],u.files.push(t.text.split("\\").pop())),this.addStep({step:u,type:"action"})}isConsecutiveInputEvent(t){return this.inputFilter?this.inputFilter.contenteditable?t.type===j.Custom&&t.data.tag==="contenteditable-input"&&t.data.payload.id===this.inputFilter.nodeId:t.type===j.IncrementalSnapshot&&t.data.source===V.Input&&t.data.id===this.inputFilter.nodeId&&!!t.data.userTriggered:!1}setInputWaitTimeout(){return this.inputFilter?.timeout&&clearTimeout(this.inputFilter.timeout),setTimeout(this.releasePendingInputAction,1e3)}handleContentEditableInput(t,r){this.handleInput({userTriggered:!0,id:t.id,text:t.text,isChecked:!1,source:V.Input},r,!0)}handleNativeDialog(t,r){try{let{dialogAction:i,dialogType:o,dialogResult:a,dialogMessage:u}=t,f={dialogResult:a,dialogType:o,dialogMessage:u},d=this.makePageAction(i,r,{},{nativeDialog:f});this.addStep({step:d,type:"action"})}catch(i){console.error("handleNativeDialog",i)}}handleRecordAssertion(t,r){this.addStep({step:this.makeAssertion(t,r),type:"assertion"})}handleRecordHover(t,r){try{let i=this.makePageAction("hover",r,{playwrightLocator:t.locator});this.addStep({step:i,type:"action"})}catch(i){console.error("handleRecordHover",i)}}handleKeyStroke(t,r){}async handleMouseDown(t,r){let{selector:i}=await this.getNodeAndSelector(t.id);this.lastMouseDown={selector:i,data:t,event:r}}handleFocus(t,r){this.hasUndefinedFocus=t.id===-1}async handleClick(t,r){try{if(t.x===void 0||t.y===void 0)return;if(this.lastMouseDown&&this.lastMouseDown.data.id!==t.id&&this.hasUndefinedFocus){let a=this.makePageAction("click",this.lastMouseDown.event,this.lastMouseDown.selector);this.addStep({step:a,type:"action"});return}let{selector:i}=await this.getNodeAndSelector(t.id);if(!i)return;let o=this.makePageAction("click",r,i);if(this.log("handleClick",Date.now(),o),this.clickFilter){this.log("handleClick","adding to filter"),this.clickFilter.actions.push(o);return}this.clickFilter={actions:[o],nodeId:t.id,timeout:this.setClickWaitTimeout()}}finally{this.hasUndefinedFocus=!1,this.lastMouseDown=void 0}}isConsecutiveMouseInteractionEvent(t){return this.clickFilter?t.type===j.IncrementalSnapshot&&t.data.source===V.MouseInteraction&&t.data.id===this.clickFilter.nodeId:!1}async isConsecutiveCheckboxInputEvent(t){if(!this.clickFilter)return!1;let r=l(async i=>{let{node:o}=await this.getNodeAndSelector(this.clickFilter.nodeId);return["check","uncheck"].includes(this.getInputEventCode(o,i))},"isCheckboxInput");return t.type===j.IncrementalSnapshot&&t.data.source===V.Input&&t.data.userTriggered&&t.data.id===this.clickFilter.nodeId&&await r(t.data)}setClickWaitTimeout(){return this.clickFilter?.timeout&&clearTimeout(this.clickFilter.timeout),this.log("setClickWaitTimeout",Date.now()),setTimeout(this.releasePendingClickActions,600)}async handleDblClick(t,r){if(t.x===void 0||t.y===void 0)return;let{selector:i}=await this.getNodeAndSelector(t.id),o=this.makePageAction("double_click",r,i);this.log("handleDblClick",o),this.addStep({step:o,type:"action"}),this.releasePendingClickActions(!1)}buildSequences(){this.sequences.push(this.dragAndDropSequence)}async performSequenceSearch(){let t=this.events.slice(this.lastInteractionEventIndex);for(let r of this.sequences){let i=this.sequenceMatcher.findSequence(t,r.events);if(i){let o=await r.handler(i);o&&o.forEach(a=>this.addStep({step:a,type:"action"}))}}await this.sessionReplayer.goLive()}addStep(t){t.type==="action"&&!t.step.id&&(t.step.id=go()),this.steps.push(t),this.lastInteractionEventIndex=this.events.length,this.log("addStep",t),this.onStep?.(t)}makeAssertion(t,r){return{matcher:t.matcher,locator:t.locator,thought:t.thought,timestamp:r.timestamp,id:t?.id||go()}}makePageAction(t,r,i,o={}){return console.log("making action with ts",r.timestamp,Date.now()-r.timestamp),{eventCode:t,selector:i.playwrightSelector,locator:GE({locator:i.playwrightLocator,parentFramesSelectors:i.playwrightParentFramesSelectors}),esraMetadata:i.esraMetadata,pageId:void 0,timestamp:r.timestamp,id:o?.id||go(),rrwebId:r.data?.id,...o,parentFramesSelectors:[]}}async getNodeById(t,{retriesLeft:r=this.maxNumberOfGetNodeRetries,useCompoundInteractableDetection:i=!0}={}){if(!r)return console.error("no node"),null;let o=this.sessionReplayer.getNodeById(t);return o?i?wa(o,[]):o:(await(0,jE.default)(100*(this.maxNumberOfGetNodeRetries-r+1)),this.getNodeById(t,{retriesLeft:r-1,useCompoundInteractableDetection:i}))}getInputEventCode(t,r){if(t.tagName.toLowerCase()==="select")return"selectoption";switch(t.getAttribute("type")){case"file":return"upload_files";case"checkbox":case"radio":return r.isChecked?"check":"uncheck";case"text":default:return"input"}}async getNodeAndSelector(t,{timestamp:r,revert:i=!0}={}){r&&await this.sessionReplayer.goBack(r);let o=await this.getNodeById(t);if(!o)return{};let a=await this.elementSelector.getSelector(o,{extractEsraMetadata:!1,rootDocument:this.sessionReplayer.getIframeDocument()});return a?(r&&i&&await this.sessionReplayer.goLive(),{node:o,selector:a}):{node:o}}};var Hc=class{constructor(e){this.timeMachine=e;this.sendRecordedSteps=!1;this.onNewRecordedStep=l(e=>{this.sendRecordedSteps&&window.parent.postMessage({type:"new-recorded-step",data:[e]})},"onNewRecordedStep");this.eventHandlers=new $c(this.onNewRecordedStep)}static{l(this,"VisualTestGenerator")}init(){this.timeMachine.setEventHandlers(this.eventHandlers,!0)}setSendRecordedSteps(e){this.sendRecordedSteps=e}startInspector({singleSelection:e=!0,rootDocument:t,timestamp:r,eventName:i}){this.stopInspector();let o=l(a=>a.top.document.querySelector("iframe.time-machine-iframe").contentDocument,"getRenderDocument");this.elementInspector=new Pi({rootDocument:t??this.getRRwebReplayerDocument(),getRenderDocument:o,rootDocumentForSelectorGenerator:this.getRRwebReplayerDocument(),eventName:i}),this.elementInspector.start({singleSelection:e,timestamp:r})}getRRwebReplayerDocument(){return document.querySelector(".replayer-wrapper > iframe").contentDocument}stopInspector(){this.elementInspector?.stop()}consumeSelections(){return this.elementInspector.consumeSelections()}};l(function(){let e=window.onerror;window.onerror=function(t,r,i,o,a){return typeof t=="string"&&t.includes("addBinding")&&t.includes("undefined")?!0:e?e.call(this,t,r,i,o,a):!1}},"suppressPlaywrightBindingErrors")();l(function(){let e=Element.prototype.addEventListener;Element.prototype.addEventListener=function(t,r,i){e.call(this,t,r,i),this._checksum_eventListenerList||(this._checksum_eventListenerList={}),this._checksum_eventListenerList[t]||(this._checksum_eventListenerList[t]=[]),this._checksum_eventListenerList[t].push(r)}},"trackEventListeners")();if(!window.checksum){console.log("[VTG-DEBUG] webdriver-entry-points.ts - initializing checksum interface"),console.log("[VTG-DEBUG] checksumSendBroadcastMessage exists:",typeof window.checksumSendBroadcastMessage),console.log("[VTG-DEBUG] checksumSendMessage exists:",typeof window.checksumSendMessage);let n=new oc,e=new _c,t=new Hc(e);window.checksum={testGenerator:n,timeMachine:e,visualTestGenerator:t},console.log("[VTG-DEBUG] webdriver-entry-points.ts - checksum interface initialized")}})();
|
|
119
119
|
/*! Bundled license information:
|
|
120
120
|
|
|
121
121
|
lodash/lodash.js:
|