@highlight-run/rrweb 2.0.0-lambda.4 → 2.0.0-lambda.7

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.
@@ -0,0 +1,192 @@
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrweb", [], f);} else if ("object" == typeof exports) {exports["rrweb"] = f();} else {g["rrweb"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
2
+ "use strict";var na=Object.defineProperty,oa=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var pt=Object.getOwnPropertySymbols;var ts=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable;var es=(e,t,r)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L=(e,t)=>{for(var r in t||(t={}))ts.call(t,r)&&es(e,r,t[r]);if(pt)for(var r of pt(t))rs.call(t,r)&&es(e,r,t[r]);return e},se=(e,t)=>oa(e,aa(t));var mt=(e,t)=>{var r={};for(var s in e)ts.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&pt)for(var s of pt(e))t.indexOf(s)<0&&rs.call(e,s)&&(r[s]=e[s]);return r};var la=Object.defineProperty,ua=(e,t,r)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N=(e,t,r)=>ua(e,typeof t!="symbol"?t+"":t,r),is;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var ca=Object.defineProperty,ha=(e,t,r)=>t in e?ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ss=(e,t,r)=>ha(e,typeof t!="symbol"?t+"":t,r),B=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(B||{});const gt=new Map,ns=new WeakSet;function os(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Xn(e){if(ns.has(e))return;ns.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const l=gt.get(e);l&&(l.cancelled=!0);const h=()=>{s.length===2&&os(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(os(r)&&!r.complete){const d={cancelled:!1};gt.set(e,d);const p=()=>{d.cancelled||(gt.delete(e),h())},m=()=>{if(!d.cancelled){gt.delete(e);try{h()}catch(c){}}};r.onload=p,r.onerror=m}else h()}}const as={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ls={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},yt={},Qn={},fa=()=>!!globalThis.Zone;function wi(e){if(yt[e])return yt[e];const t=globalThis[e],r=t.prototype,s=e in as?as[e]:void 0,l=!!(s&&s.every(p=>{var m,c;return!!((c=(m=Object.getOwnPropertyDescriptor(r,p))==null?void 0:m.get)!=null&&c.toString().includes("[native code]"))})),h=e in ls?ls[e]:void 0,d=!!(h&&h.every(p=>{var m;return typeof r[p]=="function"&&((m=r[p])==null?void 0:m.toString().includes("[native code]"))}));if(l&&d&&!fa())return yt[e]=t.prototype,t.prototype;try{const p=document.createElement("iframe");p.style.display="none",document.body.appendChild(p);const m=p.contentWindow;if(!m)return t.prototype;const c=m[e].prototype;if(!c)return p.remove(),r;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(p.classList.add("rr-block"),p.setAttribute("__rrwebUntaintedMutationObserver",""),Qn[e]=()=>p.remove()):p.remove(),yt[e]=c}catch(p){return r}}const ir={};function Ie(e,t,r){var s;const l=`${e}.${String(r)}`;if(ir[l])return ir[l].call(t);const h=wi(e),d=(s=Object.getOwnPropertyDescriptor(h,r))==null?void 0:s.get;return d?(ir[l]=d,d.call(t)):t[r]}const sr={};function Zn(e,t,r){const s=`${e}.${String(r)}`;if(sr[s])return sr[s].bind(t);const h=wi(e)[r];return typeof h!="function"?t[r]:(sr[s]=h,h.bind(t))}function da(e){return Ie("Node",e,"ownerDocument")}function pa(e){return Ie("Node",e,"childNodes")}function ma(e){return Ie("Node",e,"parentNode")}function ga(e){return Ie("Node",e,"parentElement")}function ya(e){return Ie("Node",e,"textContent")}function wa(e,t){return Zn("Node",e,"contains")(t)}function ba(e){return Zn("Node",e,"getRootNode")()}function va(e){return!e||!("host"in e)?null:Ie("ShadowRoot",e,"host")}function Sa(e){return e.styleSheets}function Ca(e){return!e||!("shadowRoot"in e)?null:Ie("Element",e,"shadowRoot")}function Ea(e,t){return Ie("Element",e,"querySelector")(t)}function xa(e,t){return Ie("Element",e,"querySelectorAll")(t)}function Ra(){var e;return[wi("MutationObserver").constructor,(e=Qn.MutationObserver)!=null?e:(()=>{})]}let Kn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Kn=()=>new Date().getTime());function Ma(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],l=r(s);return typeof l=="function"&&(l.prototype=l.prototype||{},Object.defineProperties(l,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=l,()=>{e[t]=s}}catch(s){return()=>{}}}const ae={ownerDocument:da,childNodes:pa,parentNode:ma,parentElement:ga,textContent:ya,contains:wa,getRootNode:ba,host:va,styleSheets:Sa,shadowRoot:Ca,querySelector:Ea,querySelectorAll:xa,nowTimestamp:Kn,mutationObserverCtor:Ra,patch:Ma,wrapCanvasContextDrawImage:Xn};function bi(e){return e.nodeType===e.ELEMENT_NODE}function it(e){const t=e&&"host"in e&&"mode"in e&&ae.host(e)||null;return!!(t&&"shadowRoot"in t&&ae.shadowRoot(t)===e)}function st(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ia(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Na(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function hi(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const s=Array.from(t,l=>eo(l,r)).join("");return Ia(s)}catch(t){return null}}function eo(e,t){if(Ta(e)){let r;try{r=hi(e.styleSheet)||Na(e)}catch(s){r=e.cssText}return e.styleSheet.href?Pt(r,e.styleSheet.href):r}else{let r=e.cssText;return Aa(e)&&e.selectorText.includes(":")&&(r=Oa(r)),t?Pt(r,t):r}}function Oa(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Ta(e){return"styleSheet"in e}function Aa(e){return"selectorText"in e}class vi{constructor(){ss(this,"idNodeMap",new Map),ss(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const l=this.nodeMetaMap.get(s);l&&this.nodeMetaMap.set(r,l)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function to(){return new vi}function _t({element:e,maskInputOptions:t,tagName:r,type:s,value:l,overwriteRecord:h,maskInputFn:d}){let p=l||"";return io({maskInputOptions:t,tagName:r,type:s,overwriteRecord:h})&&(d?p=d(p,e):p="*".repeat(p.length)),p}function Be(e){return e.toLowerCase()}const us="__rrweb_original__";function Da(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let s=0;s<e.width;s+=r)for(let l=0;l<e.height;l+=r){const h=t.getImageData,d=us in h?h[us]:h;if(new Uint32Array(d.call(t,s,l,Math.min(r,e.width-s),Math.min(r,e.height-l)).data.buffer).some(m=>m!==0))return!1}return!0}function _a(e,t){return!e||!t||e.type!==t.type?!1:e.type===B.Document?e.compatMode===t.compatMode:e.type===B.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===B.Comment||e.type===B.Text||e.type===B.CDATA?e.textContent===t.textContent:e.type===B.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function kt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Be(t):null}function Si(e,t){var h;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(d){return null}const s=/\.([0-9a-z]+)(?:$)/i,l=r.pathname.match(s);return(h=l==null?void 0:l[1])!=null?h:null}function ka(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const Pa=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,La=/^(?:[a-z+]+:)?\/\//i,Fa=/^www\..*/i,Ba=/^(data:)([^,]*),(.*)/i;function Pt(e,t){return(e||"").replace(Pa,(r,s,l,h,d,p)=>{const m=l||d||p,c=s||h||"";if(!m)return r;if(La.test(m)||Fa.test(m))return`url(${c}${m}${c})`;if(Ba.test(m))return`url(${c}${m}${c})`;if(m[0]==="/")return`url(${c}${ka(t)+m}${c})`;const a=m.split("#")[0],o=m.substring(a.length),n=t.split("#")[0].split("/"),i=a.split("/");n.pop();for(const u of i)u!=="."&&(u===".."?n.pop():n.push(u));return`url(${c}${n.join("/")}${o}${c})`})}function wt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ua(e,t,r=!1){const s=Array.from(t.childNodes),l=[];let h=0;if(s.length>1&&e&&typeof e=="string"){let d=wt(e,r);const p=d.length/e.length;for(let m=1;m<s.length;m++)if(s[m].textContent&&typeof s[m].textContent=="string"){const c=wt(s[m].textContent,r),a=100;let o=3;for(;o<c.length&&(c[o].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,o),1)!==-1);o++);for(;o<c.length;o++){let n=c.substring(0,o),i=d.split(n),u=-1;if(i.length===2)u=i[0].length;else if(i.length>2&&i[0]===""&&s[m-1].textContent!=="")u=d.indexOf(n,1);else if(i.length===1){if(n=n.substring(0,n.length-1),i=d.split(n),i.length<=1)return l.push(e),l;o=a+1}else o===c.length-1&&(u=d.indexOf(n));if(i.length>=2&&o>a){const f=s[m-1].textContent;if(f&&typeof f=="string"){const g=wt(f).length;u=d.indexOf(n,g)}u===-1&&(u=i[0].length)}if(u!==-1){let f=Math.floor(u/p);for(;f>0&&f<e.length;){if(h+=1,h>50*s.length)return l.push(e),l;const g=wt(e.substring(0,f),r);if(g.length===u){l.push(e.substring(0,f)),e=e.substring(f),d=d.substring(u);break}else g.length<u?f+=Math.max(1,Math.floor((u-g.length)/p)):f-=Math.max(1,Math.floor((g.length-u)*p))}break}}}}return l.push(e),l}function Wa(e,t){return Ua(e,t).join("/* rr_split */")}function Ci(e){return e=e.replace(/[^ -~]+/g,""),e=(e==null?void 0:e.split(" ").map(t=>t?Math.random().toString(20).substring(2,t.length+2):"").join(" "))||"",e}function fi(e){return e==="img"||e==="video"||e==="audio"||e==="source"}const $a=new RegExp(/[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/),za=new RegExp(/[0-9]{9,16}/),Va=new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/),ja=new RegExp(/[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/),qa=new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/),Ga=new RegExp(/[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/),Ha=new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/),Ya=[$a,za,Va,ja,qa,Ga,Ha];function ro(e){return e?Ya.some(t=>t.test(e)):!1}const io=({maskInputOptions:e,tagName:t,type:r,overwriteRecord:s})=>{const l=r&&r.toLowerCase();return s!=="true"&&(!!e[t.toLowerCase()]||!!(l&&e[l]))};let Ja=1;const Xa=new RegExp("[^a-z0-9-_:]"),lt=-2;function so(){return Ja++}function Qa(e){if(e instanceof HTMLFormElement)return"form";const t=Be(e.tagName);return Xa.test(t)?"div":t}let Ve,cs;const Za=/^[^ \t\n\r\u000c]+/,Ka=/^[, \t\n\r\u000c]+/;function el(e,t){if(t.trim()==="")return t;let r=0;function s(h){let d;const p=h.exec(t.substring(r));return p?(d=p[0],r+=d.length,d):""}const l=[];for(;s(Ka),!(r>=t.length);){let h=s(Za);if(h.slice(-1)===",")h=Ge(e,h.substring(0,h.length-1)),l.push(h);else{let d="";h=Ge(e,h);let p=!1;for(;;){const m=t.charAt(r);if(m===""){l.push((h+d).trim());break}else if(p)m===")"&&(p=!1);else if(m===","){r+=1,l.push((h+d).trim());break}else m==="("&&(p=!0);d+=m,r+=1}}}return l.join(", ")}const hs=new WeakMap;function Ge(e,t){return!t||t.trim()===""?t:Ei(e,t)}function tl(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ei(e,t){let r=hs.get(e);if(r||(r=e.createElement("a"),hs.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function no(e,t,r,s){return s&&(r==="src"||r==="href"&&!(t==="use"&&s[0]==="#")||r==="xlink:href"&&s[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Ge(e,s):r==="srcset"?el(e,s):r==="style"?Pt(s,Ei(e)):t==="object"&&r==="data"?Ge(e,s):s)}function oo(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function fs(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const l=e.classList[s];if(t.test(l))return!0}if(r)return e.matches(r)}catch(s){}return!1}function Lt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Lt(ae.parentNode(e),t,r):!1;for(let s=e.classList.length;s--;){const l=e.classList[s];if(t.test(l))return!0}return r?Lt(ae.parentNode(e),t,r):!1}function ao(e,t,r,s){let l;if(bi(e)){if(l=e,!ae.childNodes(l).length)return!1}else{if(ae.parentElement(e)===null)return!1;l=ae.parentElement(e)}try{if(typeof t=="string"){if(s){if(l.closest(`.${t}`))return!0}else if(l.classList.contains(t))return!0}else if(Lt(l,t,s))return!0;if(r){if(s){if(l.closest(r))return!0}else if(l.matches(r))return!0}}catch(h){}return!1}function rl(e,t,r){const s=e.contentWindow;if(!s)return;let l=!1,h;try{h=s.document.readyState}catch(p){return}if(h!=="complete"){const p=setTimeout(()=>{l||(t(),l=!0)},r);e.addEventListener("load",()=>{clearTimeout(p),l=!0,t()});return}const d="about:blank";if(s.location.href!==d||e.src===d||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function il(e,t,r){let s=!1,l;try{l=e.sheet}catch(d){return}if(l)return;const h=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(h),s=!0,t()})}function sl(e,t){const{doc:r,mirror:s,blockClass:l,blockSelector:h,needsMask:d,inlineStylesheet:p,maskInputOptions:m={},maskTextClass:c,maskTextFn:a,maskInputFn:o,dataURLOptions:n={},inlineImages:i,inlineVideos:u,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:S=!1,cssCaptured:y=!1,privacySetting:b}=t,E=nl(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return al(e,{doc:r,blockClass:l,blockSelector:h,inlineStylesheet:p,maskInputOptions:m,maskInputFn:o,maskTextClass:c,dataURLOptions:n,inlineImages:i,inlineVideos:u,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:S,privacySetting:b,rootId:E});case e.TEXT_NODE:return ol(e,{doc:r,needsMask:d,maskTextFn:a,privacySetting:b,rootId:E,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:B.Comment,textContent:ae.textContent(e)||"",rootId:E};default:return!1}}function nl(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function ol(e,t){var r;const{needsMask:s,maskTextFn:l,privacySetting:h,rootId:d,cssCaptured:p}=t,m=ae.parentNode(e),c=m&&m.tagName;let a="";const o=c==="STYLE"?!0:void 0,n=c==="SCRIPT"?!0:void 0;n?a="SCRIPT_PLACEHOLDER":p||(a=ae.textContent(e),o&&a&&(a=Pt(a,Ei(t.doc)))),!o&&!n&&a&&s&&(a=l?l(a,ae.parentElement(e)):a.replace(/[\S]/g,"*"));const i=h==="strict",u=(r=e.parentElement)==null?void 0:r.getAttribute("data-hl-record"),f=h==="default"&&ro(a);return(i||f)&&!u&&c&&!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(c)&&a&&(a=Ci(a)),{type:B.Text,textContent:a||"",rootId:d}}function al(e,t){const{doc:r,blockClass:s,blockSelector:l,inlineStylesheet:h,maskInputOptions:d={},maskInputFn:p,maskTextClass:m,dataURLOptions:c={},inlineImages:a,inlineVideos:o,recordCanvas:n,keepIframeSrcFn:i,newlyAddedElement:u=!1,privacySetting:f,rootId:g}=t;let S=fs(e,s,l);const y=fs(e,m,null),b=f==="strict";let E=Qa(e),v={};const w=e.attributes.length;for(let R=0;R<w;R++){const x=e.attributes[R];oo(E,x.name,x.value)||(v[x.name]=no(r,E,Be(x.name),x.value))}if(E==="link"&&h){const R=Array.from(r.styleSheets).find(A=>A.href===e.href);let x=null;R&&(x=hi(R)),x&&(delete v.rel,delete v.href,v._cssText=x)}if(E==="style"&&e.sheet){let R=hi(e.sheet);R&&(e.childNodes.length>1&&(R=Wa(R,e)),v._cssText=R)}if(["input","textarea","select"].includes(E)){const R=e.value,x=e.checked;v.type!=="radio"&&v.type!=="checkbox"&&v.type!=="submit"&&v.type!=="button"&&R?v.value=_t({element:e,type:kt(e),tagName:E,value:R,overwriteRecord:e.getAttribute("data-hl-record"),maskInputOptions:d,maskInputFn:p}):x&&(v.checked=x)}if(E==="option"&&(e.selected&&!d.select?v.selected=!0:delete v.selected),E==="dialog"&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),E==="canvas"&&n){if(e.__context==="2d")Da(e);else if(!("__context"in e)){const R=e.toDataURL(c.type,c.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;const A=x.toDataURL(c.type,c.quality);R!==A&&(v.rr_dataURL=R)}}if(E==="img"&&a&&!S&&!y&&!b){Ve||(Ve=r.createElement("canvas"),cs=Ve.getContext("2d"));const R=e,x=R.currentSrc||R.getAttribute("src")||"<unknown-src>",A=R.crossOrigin,T=()=>{R.removeEventListener("load",T);try{Ve.width=R.naturalWidth,Ve.height=R.naturalHeight,cs.drawImage(R,0,0),v.rr_dataURL=Ve.toDataURL(c.type,c.quality)}catch(G){if(R.crossOrigin!=="anonymous"){R.crossOrigin="anonymous",R.complete&&R.naturalWidth!==0?T():R.addEventListener("load",T);return}else console.warn(`Cannot inline img src=${x}! Error: ${G}`)}R.crossOrigin==="anonymous"&&(A?v.crossOrigin=A:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?T():R.addEventListener("load",T)}if(["audio","video"].includes(E)){const R=v;R.rr_mediaState=e.paused?"paused":"played",R.rr_mediaCurrentTime=e.currentTime,R.rr_mediaPlaybackRate=e.playbackRate,R.rr_mediaMuted=e.muted,R.rr_mediaLoop=e.loop,R.rr_mediaVolume=e.volume}if(u||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop)),S||y||b&&fi(E)){const{width:R,height:x}=e.getBoundingClientRect();v={class:v.class,rr_width:`${R}px`,rr_height:`${x}px`}}b&&fi(E)&&(S=!0),E==="iframe"&&!i(v.src)&&(e.contentDocument||(v.rr_src=v.src),delete v.src);let C;try{customElements.get(E)&&(C=!0)}catch(R){}const M=R=>{const{width:x,height:A}=R.getBoundingClientRect();v={width:x,height:A,rr_width:`${x}px`,rr_height:`${A}px`,rr_inlined_video:!0,class:v.class,style:v.style},E="canvas";const T=r.createElement("canvas");T.width=e.width,T.height=e.height,v.rr_dataURL=T.toDataURL(c.type,c.quality)};if(E==="video"){const R=e;a&&(R.src===""||R.src.indexOf("blob:")!==-1)&&M(R),o&&R.src!==""&&R.src.indexOf("blob:")===-1&&M(R)}return{type:B.Element,tagName:E,attributes:v,childNodes:[],isSVG:tl(e)||void 0,needBlock:S,needMask:y,rootId:g,isCustom:C}}function J(e){return e==null?"":e.toLowerCase()}function lo(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function ll(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Si(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||J(e.attributes.name)==="application-name"||J(e.attributes.rel)==="icon"||J(e.attributes.rel)==="apple-touch-icon"||J(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||J(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(J(e.attributes.name)==="robots"||J(e.attributes.name)==="googlebot"||J(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(J(e.attributes.name)==="author"||J(e.attributes.name)==="generator"||J(e.attributes.name)==="framework"||J(e.attributes.name)==="publisher"||J(e.attributes.name)==="progid"||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(J(e.attributes.name)==="google-site-verification"||J(e.attributes.name)==="yandex-verification"||J(e.attributes.name)==="csrf-token"||J(e.attributes.name)==="p:domain_verify"||J(e.attributes.name)==="verify-v1"||J(e.attributes.name)==="verification"||J(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function He(e,t){const{doc:r,mirror:s,blockClass:l,blockSelector:h,maskTextClass:d,maskTextSelector:p,skipChild:m=!1,inlineStylesheet:c=!0,maskInputOptions:a={},maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:u={},inlineImages:f=!1,inlineVideos:g=!1,recordCanvas:S=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:E=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:M=!1,cssCaptured:R=!1,privacySetting:x}=t;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;A||(A=ao(e,d,p,A===void 0));const G=sl(e,{doc:r,mirror:s,blockClass:l,blockSelector:h,needsMask:A,inlineStylesheet:c,maskInputOptions:a,maskTextClass:d,maskTextFn:o,maskInputFn:n,dataURLOptions:u,inlineImages:f,inlineVideos:g,recordCanvas:S,keepIframeSrcFn:C,newlyAddedElement:M,cssCaptured:R,privacySetting:x});if(!G)return console.warn(e,"not serialized"),null;let X;s.hasNode(e)?X=s.getId(e):ll(G,i)||!T&&G.type===B.Text&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?X=lt:X=so();const I=Object.assign(G,{id:X});if(s.add(e,I),X===lt)return null;y&&y(e);let ne=!m,P=x,j=x==="strict";if(I.type===B.Element){if(ne=ne&&!I.needBlock,j||(j=!!I.needBlock||!!I.needMask),P=j?"strict":P,j&&fi(I.tagName)){const Z=e.cloneNode();Z.src="",s.add(Z,I)}delete I.needBlock,delete I.needMask;const F=ae.shadowRoot(e);F&&st(F)&&(I.isShadowHost=!0)}if((I.type===B.Document||I.type===B.Element)&&ne){i.headWhitespace&&I.type===B.Element&&I.tagName==="head"&&(T=!1);const F={doc:r,mirror:s,blockClass:l,blockSelector:h,needsMask:A,maskTextClass:d,maskTextSelector:p,skipChild:m,inlineStylesheet:c,maskInputOptions:a,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:u,inlineImages:f,inlineVideos:g,recordCanvas:S,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:E,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:C,cssCaptured:!1,privacySetting:P};if(!(I.type===B.Element&&I.tagName==="textarea"&&I.attributes.value!==void 0)){I.type===B.Element&&I.attributes._cssText!==void 0&&typeof I.attributes._cssText=="string"&&(F.cssCaptured=!0);for(const ue of Array.from(ae.childNodes(e))){const O=He(ue,F);O&&I.childNodes.push(O)}}let Z=null;if(bi(e)&&(Z=ae.shadowRoot(e)))for(const ue of Array.from(ae.childNodes(Z))){const O=He(ue,F);O&&(st(Z)&&(O.isShadow=!0),I.childNodes.push(O))}}const H=ae.parentNode(e);return H&&it(H)&&st(H)&&(I.isShadow=!0),I.type===B.Element&&I.tagName==="iframe"&&rl(e,()=>{const F=e.contentDocument;if(F&&b){const Z=He(F,{doc:F,mirror:s,blockClass:l,blockSelector:h,needsMask:A,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:c,maskInputOptions:a,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:u,inlineImages:f,inlineVideos:g,recordCanvas:S,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:E,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:C,privacySetting:x});Z&&b(e,Z)}},E),I.type===B.Element&&I.tagName==="link"&&typeof I.attributes.rel=="string"&&(I.attributes.rel==="stylesheet"||I.attributes.rel==="preload"&&typeof I.attributes.href=="string"&&Si(I.attributes.href)==="css")&&il(e,()=>{if(v){const F=He(e,{doc:r,mirror:s,blockClass:l,blockSelector:h,needsMask:A,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:c,maskInputOptions:a,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:u,inlineImages:f,inlineVideos:g,recordCanvas:S,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:E,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:C,privacySetting:x});F&&v(e,F)}},w),I}function ul(e,t){const{mirror:r=new vi,blockClass:s="highlight-block",blockSelector:l=null,maskTextClass:h="highlight-mask",maskTextSelector:d=null,inlineStylesheet:p=!0,inlineImages:m=!1,inlineVideos:c=!1,recordCanvas:a=!1,maskAllInputs:o=!1,maskTextFn:n,maskInputFn:i,slimDOM:u=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:E,stylesheetLoadTimeout:v,keepIframeSrcFn:w=()=>!1,privacySetting:C="default"}=t||{},M=o===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:o===!1?{password:!0}:o,R=lo(u);return He(e,{doc:e,mirror:r,blockClass:s,blockSelector:l,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:M,maskTextFn:n,maskInputFn:i,slimDOMOptions:R,dataURLOptions:f,inlineImages:m,inlineVideos:c,recordCanvas:a,preserveWhiteSpace:g,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:E,stylesheetLoadTimeout:v,keepIframeSrcFn:w,newlyAddedElement:!1,privacySetting:C})}const cl=/(max|min)-device-(width|height)/,ds=new RegExp(cl.source,"g"),hl={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ds)&&(e.params=e.params.replace(ds,"$1-$2"))}}}},fl={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,
3
+ `+r.replace(/:hover/g,".\\:hover"))}))}}}};function dl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var l=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,l.get?l:{enumerable:!0,get:function(){return e[s]}})}),r}var bt={exports:{}},ps;function ml(){if(ps)return bt.exports;ps=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return bt.exports=t(),bt.exports.createColors=t,bt.exports}const gl={},yl=Object.freeze(Object.defineProperty({__proto__:null,default:gl},Symbol.toStringTag,{value:"Module"})),we=pl(yl);var nr,ms;function xi(){if(ms)return nr;ms=1;let e=ml(),t=we;class r extends Error{constructor(l,h,d,p,m,c){super(l),this.name="CssSyntaxError",this.reason=l,m&&(this.file=m),p&&(this.source=p),c&&(this.plugin=c),typeof h!="undefined"&&typeof d!="undefined"&&(typeof h=="number"?(this.line=h,this.column=d):(this.line=h.line,this.column=h.column,this.endLine=d.line,this.endColumn=d.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(l){if(!this.source)return"";let h=this.source;l==null&&(l=e.isColorSupported);let d=i=>i,p=i=>i,m=i=>i;if(l){let{bold:i,gray:u,red:f}=e.createColors(!0);p=g=>i(f(g)),d=g=>u(g),t&&(m=g=>t(g))}let c=h.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,c.length),n=String(o).length;return c.slice(a,o).map((i,u)=>{let f=a+1+u,g=" "+(" "+f).slice(-n)+" | ";if(f===this.line){if(i.length>160){let y=20,b=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),v=i.slice(b,E),w=d(g.replace(/\d/g," "))+i.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return p(">")+d(g)+m(v)+`
4
+ `+w+p("^")}let S=d(g.replace(/\d/g," "))+i.slice(0,this.column-1).replace(/[^\t]/g," ");return p(">")+d(g)+m(i)+`
5
+ `+S+p("^")}return" "+d(g)+m(i)}).join(`
6
+ `)}toString(){let l=this.showSourceCode();return l&&(l=`
7
+
8
+ `+l+`
9
+ `),this.name+": "+this.message+l}}return nr=r,r.default=r,nr}var or,gs;function uo(){if(gs)return or;gs=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function r(c){return typeof c!="string"||!c.includes("<")?c:c.replace(e,"\\3c $2").replace(t,"\\3c $2")}const s={after:`
10
+ `,beforeClose:`
11
+ `,beforeComment:`
12
+ `,beforeDecl:`
13
+ `,beforeOpen:" ",beforeRule:`
14
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function l(c){return c[0].toUpperCase()+c.slice(1)}function h(c,a){let o="@"+a.name,n=a.params?c.rawValue(a,"params"):"";return typeof a.raws.afterName!="undefined"?o+=a.raws.afterName:n&&(o+=" "),o+n}function d(c,a,o){let n=o.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let u=c.raw(o,"semicolon"),f=o.type==="document";for(let g=n.length-1;g>=0;g--)a.push({document:f,node:n[g],semicolon:i!==g||u})}function p(c,a,o,n){let i=c.raw(o,"between","beforeOpen");c.builder(r(n+i)+"{",o,"start");let u=o.nodes&&o.nodes.length,f=()=>{let g=u?c.raw(o,"after"):c.raw(o,"after","emptyBody");g&&c.builder(r(g)),c.builder("}",o,"end"),o.type==="rule"&&o.raws.ownSemicolon&&c.builder(r(o.raws.ownSemicolon),o,"end")};u?(a.push(f),d(c,a,o)):f()}class m{constructor(a){this.builder=a}atrule(a,o){let n=h(this,a);if(a.nodes)this.block(a,n);else{let i=(a.raws.between||"")+(o?";":"");this.builder(r(n+i),a)}}beforeAfter(a,o){let n;a.type==="decl"?n=this.raw(a,null,"beforeDecl"):a.type==="comment"?n=this.raw(a,null,"beforeComment"):o==="before"?n=this.raw(a,null,"beforeRule"):n=this.raw(a,null,"beforeClose");let i=a.parent,u=0;for(;i&&i.type!=="root";)u+=1,i=i.parent;if(n.includes(`
15
+ `)){let f=this.raw(a,null,"indent");if(f.length)for(let g=0;g<u;g++)n+=f}return n}block(a,o){let n=this.raw(a,"between","beforeOpen");this.builder(r(o+n)+"{",a,"start");let i;a.nodes&&a.nodes.length?(this.body(a),i=this.raw(a,"after")):i=this.raw(a,"after","emptyBody"),i&&this.builder(r(i)),this.builder("}",a,"end")}body(a){let o=m.prototype,n=["atrule","block","body","rule","stringify"].every(u=>this[u]===o[u]),i=[];for(d(this,i,a);i.length>0;){let u=i.pop();if(typeof u=="function"){u();continue}let f=u.node,g=this.raw(f,"before");g&&this.builder(u.document?g:r(g)),n&&f.type==="rule"?p(this,i,f,this.rawValue(f,"selector")):n&&f.type==="atrule"&&f.nodes?p(this,i,f,h(this,f)):this.stringify(f,u.semicolon)}}comment(a){let o=this.raw(a,"left","commentLeft"),n=this.raw(a,"right","commentRight");this.builder(r("/*"+o+a.text+n+"*/"),a)}decl(a,o){let n=a.raws,i=this.raw(a,"between","colon"),u=a.prop+i+this.rawValue(a,"value");a.important&&(u+=n.important||" !important"),o&&(u+=";"),this.builder(r(u),a)}document(a){this.body(a)}raw(a,o,n){let i;if(n||(n=o),o&&(i=a.raws[o],typeof i!="undefined"))return i;let u=a.parent;if(n==="before"&&(!u||u.type==="root"&&u.first===a||u&&u.type==="document"))return"";if(!u)return s[n];let f=a.root(),g=f.rawCache||(f.rawCache={});if(typeof g[n]!="undefined")return g[n];if(n==="before"||n==="after")return this.beforeAfter(a,n);{let S="raw"+l(n);this[S]?i=this[S](f,a):f.walk(y=>{if(i=y.raws[o],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=s[n]),g[n]=i,i}rawBeforeClose(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after!="undefined")return o=n.raws.after,o.includes(`
16
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawBeforeComment(a,o){let n;return a.walkComments(i=>{if(typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
17
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n=="undefined"?n=this.raw(o,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(a,o){let n;return a.walkDecls(i=>{if(typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
18
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n=="undefined"?n=this.raw(o,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(a){let o;return a.walk(n=>{if(n.type!=="decl"&&(o=n.raws.between,typeof o!="undefined"))return!1}),o}rawBeforeRule(a){let o;return a.walk(n=>{if(n.nodes&&(n.parent!==a||a.first!==n)&&typeof n.raws.before!="undefined")return o=n.raws.before,o.includes(`
19
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawColon(a){let o;return a.walkDecls(n=>{if(typeof n.raws.between!="undefined")return o=n.raws.between.replace(/[^\s:]/g,""),!1}),o}rawEmptyBody(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length===0&&(o=n.raws.after,typeof o!="undefined"))return!1}),o}rawIndent(a){if(a.raws.indent)return a.raws.indent;let o;return a.walk(n=>{let i=n.parent;if(i&&i!==a&&i.parent&&i.parent===a&&typeof n.raws.before!="undefined"){let u=n.raws.before.split(`
20
+ `);return o=u[u.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(o=n.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(a,o){let n=a[o],i=a.raws[o];return i&&i.value===n?i.raw:n}root(a){if(this.body(a),a.raws.after){let o=a.raws.after,n=a.parent&&a.parent.type==="document";this.builder(n?o:r(o))}}rule(a){this.block(a,this.rawValue(a,"selector")),a.raws.ownSemicolon&&this.builder(r(a.raws.ownSemicolon),a,"end")}stringify(a,o){if(!this[a.type])throw new Error("Unknown AST node type "+a.type+". Maybe you need to change PostCSS stringifier.");this[a.type](a,o)}}return or=m,m.default=m,or}var ar,ys;function Vt(){if(ys)return ar;ys=1;let e=uo();function t(r,s){new e(s).stringify(r)}return ar=t,t.default=t,ar}var vt={},ws;function Ri(){return ws||(ws=1,vt.isClean=Symbol("isClean"),vt.my=Symbol("my")),vt}var lr,bs;function jt(){if(bs)return lr;bs=1;let e=xi(),t=uo(),r=Vt(),{isClean:s,my:l}=Ri();function h(m,c){let a=new m.constructor,o=[[m,a,c]];for(;o.length>0;){let[n,i,u]=o.pop();for(let f in n){if(!Object.prototype.hasOwnProperty.call(n,f)||f==="proxyCache")continue;let g=n[f],S=typeof g;if(f==="parent"&&S==="object")u&&(i[f]=u);else if(f==="source")i[f]=g;else if(Array.isArray(g)){let y=[];i[f]=y;for(let b of g){let E=new b.constructor;y.push(E),o.push([b,E,i])}}else{if(S==="object"&&g!==null){let y=new g.constructor;o.push([g,y,void 0]),g=y}i[f]=g}}}return a}function d(m,c){if(c&&typeof c.offset!="undefined")return c.offset;let a=1,o=1,n=0;for(let i=0;i<m.length;i++){if(o===c.line&&a===c.column){n=i;break}m[i]===`
21
+ `?(a=1,o+=1):a+=1}return n}class p{get proxyOf(){return this}constructor(c={}){this.raws={},this[s]=!1,this[l]=!0;for(let a of Object.keys(c))if(a!=="__proto__")if(a==="nodes"){this.nodes=[];for(let o of c[a])typeof o.clone=="function"&&o.parent?this.append(o.clone()):this.append(o)}else this[a]=c[a]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\n\s{4}at /.test(c.stack)){let a=this.source;c.stack=c.stack.replace(/\n\s{4}at /,`$&${a.input.from}:${a.start.line}:${a.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let a in c)this[a]=c[a];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let a=h(this);for(let o in c)a[o]=c[o];return a}cloneAfter(c={}){let a=this.clone(c);return this.parent.insertAfter(this,a),a}cloneBefore(c={}){let a=this.clone(c);return this.parent.insertBefore(this,a),a}error(c,a={}){if(this.source){let{end:o,start:n}=this.rangeBy(a);return this.source.input.error(c,{column:n.column,line:n.line},{column:o.column,line:o.line},a)}return new e(c)}getProxyProcessor(){return{get(c,a){return a==="proxyOf"?c:a==="root"?()=>c.root().toProxy():c[a]},set(c,a,o){return c[a]===o||(c[a]=o,(a==="prop"||a==="value"||a==="name"||a==="params"||a==="important"||a==="text")&&c.markDirty()),!0}}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let c=this;for(;c=c.parent;)c[s]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c={}){let a="document"in this.source.input?this.source.input.document:this.source.input.css,o={column:this.source.start.column,line:this.source.start.line,offset:d(a,this.source.start)};if(c.index)o=this.positionInside(c.index);else if(c.word){let i=a.slice(d(a,this.source.start),d(a,this.source.end)).indexOf(c.word);i!==-1&&(o=this.positionInside(i))}return o}positionInside(c){let a=this.source.start.column,o=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=d(n,this.source.start),u=i+c;for(let f=i;f<u;f++)n[f]===`
22
+ `?(a=1,o+=1):a+=1;return{column:a,line:o,offset:u}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c={}){let a="document"in this.source.input?this.source.input.document:this.source.input.css,o={column:this.source.start.column,line:this.source.start.line,offset:d(a,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:d(a,this.source.end)+1}:{column:o.column+1,line:o.line,offset:o.offset+1};if(c.word){let u=a.slice(d(a,this.source.start),d(a,this.source.end)).indexOf(c.word);u!==-1&&(o=this.positionInside(u),n=this.positionInside(u+c.word.length))}else c.start?o={column:c.start.column,line:c.start.line,offset:d(a,c.start)}:typeof c.index=="number"&&(o=this.positionInside(c.index)),c.end?n={column:c.end.column,line:c.end.line,offset:d(a,c.end)}:typeof c.endIndex=="number"?n=this.positionInside(c.endIndex):typeof c.index=="number"&&(n=this.positionInside(c.index+1));return(n.line<o.line||n.line===o.line&&n.column<=o.column)&&(n={column:o.column+1,line:o.line,offset:o.offset+1}),{end:n,start:o}}raw(c,a){return new t().raw(this,c,a)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let a=this,o=!1;for(let n of c)n===this?o=!0:o?(this.parent.insertAfter(a,n),a=n):this.parent.insertBefore(a,n);o||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,a){let o=a==null;a=a||new Map;let n=[],i=[[this,n,0]];for(let f=0;f<i.length;f++){let[g,S,y]=i[f],b={};S[y]=b;for(let E in g){if(!Object.prototype.hasOwnProperty.call(g,E)||E==="parent"||E==="proxyCache")continue;let v=g[E];if(Array.isArray(v)){let w=[];b[E]=w;for(let C=0;C<v.length;C++){let M=v[C];typeof M=="object"&&M.toJSON?M.toJSON===p.prototype.toJSON?i.push([M,w,C]):w[C]=M.toJSON(null,a):w[C]=M}}else if(typeof v=="object"&&v.toJSON)v.toJSON===p.prototype.toJSON?i.push([v,b,E]):b[E]=v.toJSON(null,a);else if(E==="source"){if(v==null)continue;let w=a.get(v.input);w==null&&(w=a.size,a.set(v.input,w)),b[E]={end:v.end,inputId:w,start:v.start}}else b[E]=v}}let u=n[0];return o&&(u.inputs=[...a.keys()].map(f=>f.toJSON())),u}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=r){c.stringify&&(c=c.stringify);let a="";return c(this,o=>{a+=o}),a}warn(c,a,o={}){let n={node:this};for(let i in o)n[i]=o[i];return c.warn(a,n)}}return lr=p,p.default=p,lr}var ur,vs;function qt(){if(vs)return ur;vs=1;let e=jt();class t extends e{constructor(s){super(s),this.type="comment"}}return ur=t,t.default=t,ur}var cr,Ss;function Gt(){if(Ss)return cr;Ss=1;let e=jt();class t extends e{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(L({},s),{value:String(s.value)})),super(s),this.type="decl"}}return cr=t,t.default=t,cr}var hr,Cs;function Ue(){if(Cs)return hr;Cs=1;let e=qt(),t=Gt(),r=jt(),{isClean:s,my:l}=Ri(),h,d,p,m;function c(n){let i=n.slice();for(;i.length>0;){let u=i.pop();if(delete u.source,u.nodes){u.nodes=u.nodes.slice();for(let f of u.nodes)i.push(f)}}return n.slice()}function a(n){let i=[n];for(;i.length>0;){let u=i.pop();if(u[s]=!1,u.proxyOf.nodes)for(let f of u.proxyOf.nodes)i.push(f)}}class o extends r{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]}append(...i){for(let u of i){let f=this.normalize(u,this.last);for(let g of f)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(i){let u=[this];for(;u.length>0;){let f=u.pop();if(f!==this&&f.cleanRaws!==o.prototype.cleanRaws){f.cleanRaws(i);continue}if(r.prototype.cleanRaws.call(f,i),f.nodes)for(let g of f.nodes)u.push(g)}}each(i){if(!this.proxyOf.nodes)return;let u=this.getIterator(),f,g;for(;this.indexes[u]<this.proxyOf.nodes.length&&(f=this.indexes[u],g=i(this.proxyOf.nodes[f],f),g!==!1);)this.indexes[u]+=1;return delete this.indexes[u],g}every(i){return this.nodes.every(i)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let i=this.lastEach;return this.indexes[i]=0,i}getProxyProcessor(){return{get(i,u){return u==="proxyOf"?i:i[u]?u==="each"||typeof u=="string"&&u.startsWith("walk")?(...f)=>i[u](...f.map(g=>typeof g=="function"?(S,y)=>g(S.toProxy(),y):g)):u==="every"||u==="some"?f=>i[u]((g,...S)=>f(g.toProxy(),...S)):u==="root"?()=>i.root().toProxy():u==="nodes"?i.nodes.map(f=>f.toProxy()):u==="first"||u==="last"?i[u].toProxy():i[u]:i[u]},set(i,u,f){return i[u]===f||(i[u]=f,(u==="name"||u==="params"||u==="selector")&&i.markDirty()),!0}}}index(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))}insertAfter(i,u){let f=this.index(i),g=this.normalize(u,this.proxyOf.nodes[f]).reverse();f=this.index(i);for(let y of g)this.proxyOf.nodes.splice(f+1,0,y);let S;for(let y in this.indexes)S=this.indexes[y],f<S&&(this.indexes[y]=S+g.length);return this.markDirty(),this}insertBefore(i,u){let f=this.index(i),g=f===0?"prepend":!1,S=this.normalize(u,this.proxyOf.nodes[f],g).reverse();f=this.index(i);for(let b of S)this.proxyOf.nodes.splice(f,0,b);let y;for(let b in this.indexes)y=this.indexes[b],f<=y&&(this.indexes[b]=y+S.length);return this.markDirty(),this}normalize(i,u){if(typeof i=="string")i=c(d(i).nodes);else if(typeof i=="undefined")i=[];else if(Array.isArray(i)){i=i.slice(0);for(let g of i)g.parent&&g.parent.removeChild(g,"ignore")}else if(i.type==="root"&&this.type!=="document"){i=i.nodes.slice(0);for(let g of i)g.parent&&g.parent.removeChild(g,"ignore")}else if(i.type)i=[i];else if(i.prop){if(typeof i.value=="undefined")throw new Error("Value field is missed in node creation");typeof i.value!="string"&&(i.value=String(i.value)),i=[new t(i)]}else if(i.selector||i.selectors)i=[new m(i)];else if(i.name)i=[new h(i)];else if(i.text)i=[new e(i)];else throw new Error("Unknown node type in node creation");return i.map(g=>(g[l]||o.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[s]&&a(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&u&&typeof u.raws.before!="undefined"&&(g.raws.before=u.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...i){i=i.reverse();for(let u of i){let f=this.normalize(u,this.first,"prepend").reverse();for(let g of f)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+f.length}return this.markDirty(),this}push(i){return i.parent=this,this.proxyOf.nodes.push(i),this}removeAll(){for(let i of this.proxyOf.nodes)i.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(i){i=this.index(i),this.proxyOf.nodes[i].parent=void 0,this.proxyOf.nodes.splice(i,1);let u;for(let f in this.indexes)u=this.indexes[f],u>=i&&(this.indexes[f]=u-1);return this.markDirty(),this}replaceValues(i,u,f){return f||(f=u,u={}),this.walkDecls(g=>{u.props&&!u.props.includes(g.prop)||u.fast&&!g.value.includes(u.fast)||(g.value=g.value.replace(i,f))}),this.markDirty(),this}some(i){return this.nodes.some(i)}walk(i){if(!this.proxyOf.nodes)return;let u=[{iterator:this.getIterator(),node:this.proxyOf}];for(;u.length>0;){let{iterator:f,node:g}=u[u.length-1],S=g.indexes[f];if(S>=g.proxyOf.nodes.length){delete g.indexes[f],u.pop();let E=u[u.length-1];E&&(E.node.indexes[E.iterator]+=1);continue}let y=g.proxyOf.nodes[S],b;try{b=i(y,S)}catch(E){throw y.addToError(E)}if(b===!1){for(let E of u)delete E.node.indexes[E.iterator];return!1}y.walk&&y.proxyOf.nodes?u.push({iterator:y.getIterator(),node:y}):g.indexes[f]+=1}}walkAtRules(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="atrule"&&i.test(f.name))return u(f,g)}):this.walk((f,g)=>{if(f.type==="atrule"&&f.name===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="atrule")return u(f,g)}))}walkComments(i){return this.walk((u,f)=>{if(u.type==="comment")return i(u,f)})}walkDecls(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="decl"&&i.test(f.prop))return u(f,g)}):this.walk((f,g)=>{if(f.type==="decl"&&f.prop===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="decl")return u(f,g)}))}walkRules(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="rule"&&i.test(f.selector))return u(f,g)}):this.walk((f,g)=>{if(f.type==="rule"&&f.selector===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="rule")return u(f,g)}))}}return o.registerParse=n=>{d=n},o.registerRule=n=>{m=n},o.registerAtRule=n=>{h=n},o.registerRoot=n=>{p=n},hr=o,o.default=o,o.rebuild=n=>{let i=[n];for(;i.length>0;){let u=i.pop();if(u.type==="atrule"?Object.setPrototypeOf(u,h.prototype):u.type==="rule"?Object.setPrototypeOf(u,m.prototype):u.type==="decl"?Object.setPrototypeOf(u,t.prototype):u.type==="comment"?Object.setPrototypeOf(u,e.prototype):u.type==="root"&&Object.setPrototypeOf(u,p.prototype),u[l]=!0,u.nodes)for(let f of u.nodes)i.push(f)}},hr}var fr,Es;function Mi(){if(Es)return fr;Es=1;let e=Ue();class t extends e{constructor(s){super(s),this.type="atrule"}append(...s){return this.proxyOf.nodes||(this.nodes=[]),super.append(...s)}prepend(...s){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...s)}}return fr=t,t.default=t,e.registerAtRule(t),fr}var dr,xs;function Ii(){if(xs)return dr;xs=1;let e=Ue(),t,r;class s extends e{constructor(h){super(L({type:"document"},h)),this.nodes||(this.nodes=[])}toResult(h={}){return new t(new r,this,h).stringify()}}return s.registerLazyResult=l=>{t=l},s.registerProcessor=l=>{r=l},dr=s,s.default=s,dr}var pr,Rs;function wl(){if(Rs)return pr;Rs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return pr={nanoid:(s=21)=>{let l="",h=s|0;for(;h-- >0;)l+=e[Math.random()*64|0];return l},customAlphabet:(s,l=21)=>(h=l)=>{let d="",p=h|0;for(;p-- >0;)d+=s[Math.random()*s.length|0];return d}},pr}var mr,Ms;function co(){if(Ms)return mr;Ms=1;let{existsSync:e,readFileSync:t}=we,{dirname:r,isAbsolute:s,join:l,relative:h,sep:d}=we,{SourceMapConsumer:p,SourceMapGenerator:m}=we;function c(o){return Buffer?Buffer.from(o,"base64").toString():window.atob(o)}class a{constructor(n,i){if(i.map===!1)return;i.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(n),this.inline=this.startWith(this.annotation,"data:");let u=i.map?i.map.prev:void 0,f=this.loadMap(i.from,u);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),f&&(this.text=f)}consumer(){return this.consumerCache||(this.consumerCache=new p(this.json||this.text)),this.consumerCache}decodeInline(n){let i=/^data:application\/json;charset=utf-?8;base64,/,u=/^data:application\/json;base64,/,f=/^data:application\/json;charset=utf-?8,/,g=/^data:application\/json,/,S=n.match(f)||n.match(g);if(S)return decodeURIComponent(n.substr(S[0].length));let y=n.match(i)||n.match(u);if(y)return c(n.substr(y[0].length));let b=n.slice(22);throw b=b.slice(0,b.indexOf(",")),new Error("Unsupported source map encoding "+b)}getAnnotationURL(n){return n.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(n){return typeof n!="object"?!1:typeof n.mappings=="string"||typeof n._mappings=="string"||Array.isArray(n.sections)}loadAnnotation(n){let i=n.match(/\/\*\s*# sourceMappingURL=/g);if(!i)return;let u=n.lastIndexOf(i.pop()),f=n.indexOf("*/",u);u>-1&&f>-1&&(this.annotation=this.getAnnotationURL(n.substring(u,f)))}loadFile(n,i,u){if(!u&&!this.unsafeMap){if(!/\.map$/i.test(n))return;if(i){let f=h(r(i),n);if(f===".."||f.startsWith(".."+d)||s(f))return}}if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(n,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let u=i(n);if(u){let f=this.loadFile(u,n,!0);if(!f)throw new Error("Unable to load previous source map: "+u.toString());return f}}else{if(i instanceof p)return m.fromSourceMap(i).toString();if(i instanceof m)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let u=this.annotation;n&&(u=l(r(n),u));let f=this.loadFile(u,n,!1);if(f)try{this.json=JSON.parse(f.replace(/^\)]}'[^\n]*\n/,""))}catch(g){return}return f}}}startWith(n,i){return n?n.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return mr=a,a.default=a,mr}var gr,Is;function Ht(){if(Is)return gr;Is=1;let{nanoid:e}=wl(),{isAbsolute:t,resolve:r}=we,{SourceMapConsumer:s,SourceMapGenerator:l}=we,{fileURLToPath:h,pathToFileURL:d}=we,p=xi(),m=co(),c=we,a=Symbol("lineToIndexCache"),o=!!(s&&l),n=!!(r&&t);function i(f){if(f[a])return f[a];let g=f.css.split(`
23
+ `),S=new Array(g.length),y=0;for(let b=0,E=g.length;b<E;b++)S[b]=y,y+=g[b].length+1;return f[a]=S,S}class u{get from(){return this.file||this.id}constructor(g,S={}){if(g===null||typeof g=="undefined"||typeof g=="object"&&!g.toString)throw new Error(`PostCSS received ${g} instead of CSS string`);if(this.css=g.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,S.document&&(this.document=S.document.toString()),S.from&&(!n||/^\w+:\/\//.test(S.from)||t(S.from)?this.file=S.from:this.file=r(S.from)),n&&o){let y=new m(this.css,S);if(y.text){this.map=y;let b=y.consumer().file;!this.file&&b&&(this.file=this.mapResolve(b))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,S,y,b={}){let E,v,w,C,M;if(S&&typeof S=="object"){let x=S,A=y;if(typeof x.offset=="number"){C=x.offset;let T=this.fromOffset(C);S=T.line,y=T.col}else S=x.line,y=x.column,C=this.fromLineAndColumn(S,y);if(typeof A.offset=="number"){w=A.offset;let T=this.fromOffset(w);v=T.line,E=T.col}else v=A.line,E=A.column,w=this.fromLineAndColumn(A.line,A.column)}else if(y)C=this.fromLineAndColumn(S,y);else{C=S;let x=this.fromOffset(C);S=x.line,y=x.col}let R=this.origin(S,y,v,E);return R?M=new p(g,R.endLine===void 0?R.line:{column:R.column,line:R.line},R.endLine===void 0?R.column:{column:R.endColumn,line:R.endLine},R.source,R.file,b.plugin):M=new p(g,v===void 0?S:{column:y,line:S},v===void 0?y:{column:E,line:v},this.css,this.file,b.plugin),M.input={column:y,endColumn:E,endLine:v,endOffset:w,line:S,offset:C,source:this.css},this.file&&(d&&(M.input.url=d(this.file).toString()),M.input.file=this.file),M}fromLineAndColumn(g,S){return i(this)[g-1]+S-1}fromOffset(g){let S=i(this),y=S[S.length-1],b=0;if(g>=y)b=S.length-1;else{let E=S.length-2,v;for(;b<E;)if(v=b+(E-b>>1),g<S[v])E=v-1;else if(g>=S[v+1])b=v+1;else{b=v;break}}return{col:g-S[b]+1,line:b+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,S,y,b){if(!this.map)return!1;let E=this.map.consumer(),v=E.originalPositionFor({column:S-1,line:g});if(!v.source)return!1;let w;if(typeof y=="number"){let x=E.originalPositionFor({column:b-1,line:y});x.source&&(w=x)}let C;t(v.source)?C=d(v.source):C=new URL(v.source,this.map.consumer().sourceRoot||d(this.map.mapFile));let M={column:v.column+1,endColumn:w&&w.column+1,endLine:w&&w.line,line:v.line,url:C.toString()};if(C.protocol==="file:")if(h)M.file=h(C);else throw new Error("file: protocol is not available in this PostCSS build");let R=E.sourceContentFor(v.source);return R&&(M.source=R),M}toJSON(){let g={};for(let S of["hasBOM","css","file","id"])this[S]!=null&&(g[S]=this[S]);return this.map&&(g.map=L({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return gr=u,u.default=u,c&&c.registerInput&&c.registerInput(u),gr}var yr,Ns;function ut(){if(Ns)return yr;Ns=1;let e=Ue(),t,r;class s extends e{constructor(h){super(h),this.type="root",this.nodes||(this.nodes=[])}normalize(h,d,p){let m=new Set;for(let a of Array.isArray(h)?h:[h])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before!="undefined"&&m.add(a.raws);let c=super.normalize(h);if(d){if(p==="prepend")this.nodes.length>1?d.raws.before=this.nodes[1].raws.before:delete d.raws.before;else if(this.first!==d)for(let a of c)m.has(a.raws)||(a.raws.before=d.raws.before)}return c}removeChild(h,d){let p=this.index(h);return!d&&p===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[p].raws.before),super.removeChild(h)}toResult(h={}){return new t(new r,this,h).stringify()}}return s.registerLazyResult=l=>{t=l},s.registerProcessor=l=>{r=l},yr=s,s.default=s,e.registerRoot(s),yr}var wr,Os;function ho(){if(Os)return wr;Os=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
24
+ `," "];return e.split(t,r)},split(t,r,s){let l=[],h="",d=!1,p=0,m=!1,c="",a=!1;for(let o of t)a?a=!1:o==="\\"?a=!0:m?o===c&&(m=!1):o==='"'||o==="'"?(m=!0,c=o):o==="("?p+=1:o===")"?p>0&&(p-=1):p===0&&r.includes(o)&&(d=!0),d?(h!==""&&l.push(h.trim()),h="",d=!1):h+=o;return(s||h!=="")&&l.push(h.trim()),l}};return wr=e,e.default=e,wr}var br,Ts;function Ni(){if(Ts)return br;Ts=1;let e=Ue(),t=ho();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(l){let h=this.selector?this.selector.match(/,\s*/):null,d=h?h[0]:","+this.raw("between","beforeOpen");this.selector=l.join(d)}constructor(l){super(l),this.type="rule",this.nodes||(this.nodes=[])}}return br=r,r.default=r,e.registerRule(r),br}var vr,As;function bl(){if(As)return vr;As=1;let e=Mi(),t=qt(),r=Gt(),s=Ht(),l=co(),h=ut(),d=Ni();function p(a,o){return a.inputs?a.inputs.map(n=>{let i=se(L({},n),{__proto__:s.prototype});return i.map&&(i.map=se(L({},i.map),{__proto__:l.prototype})),i}):o}function m(a,o,n){let i=L({},a);if(delete i.inputs,delete i.nodes,i.source){let f=i.source,{inputId:g}=f,S=mt(f,["inputId"]);i.source=S,g!=null&&(i.source.input=o[g])}let u;if(i.type==="root")u=new h(i);else if(i.type==="decl")u=new r(i);else if(i.type==="rule")u=new d(i);else if(i.type==="comment")u=new t(i);else if(i.type==="atrule")u=new e(i);else throw new Error("Unknown node type: "+a.type);if(n){u.nodes=n;for(let g of n)g.parent=u}return u}function c(a,o){if(Array.isArray(a))return a.map(u=>c(u));let n,i=[{childIndex:0,children:[],inputs:p(a,o),json:a}];for(;i.length>0;){let u=i[i.length-1],f=u.json.nodes;if(f&&u.childIndex<f.length){let S=f[u.childIndex];u.childIndex+=1,i.push({childIndex:0,children:[],inputs:p(S,u.inputs),json:S});continue}i.pop();let g=m(u.json,u.inputs,f?u.children:void 0);i.length>0?i[i.length-1].children.push(g):n=g}return n}return vr=c,c.default=c,vr}var Sr,Ds;function fo(){if(Ds)return Sr;Ds=1;let{dirname:e,relative:t,resolve:r,sep:s}=we,{SourceMapConsumer:l,SourceMapGenerator:h}=we,{pathToFileURL:d}=we,p=Ht(),m=!!(l&&h),c=!!(e&&r&&t&&s);class a{constructor(n,i,u,f){this.stringify=n,this.mapOpts=u.map||{},this.root=i,this.opts=u,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;this.isInline()?n="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?n=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?n=this.mapOpts.annotation(this.opts.to,this.root):n=this.outputFile()+".map";let i=`
25
+ `;this.css.includes(`\r
26
+ `)&&(i=`\r
27
+ `),this.css+=i+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let i=this.toUrl(this.path(n.file)),u=n.root||e(n.file),f;this.mapOpts.sourcesContent===!1?(f=new l(n.text),f.sourcesContent&&(f.sourcesContent=null)):f=n.consumer(),this.map.applySourceMap(f,i,this.toUrl(this.path(u)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let n;for(let i=this.root.nodes.length-1;i>=0;i--)n=this.root.nodes[i],n.type==="comment"&&n.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(i)}else if(this.css){let n;for(;(n=this.css.lastIndexOf("/*#"))!==-1;){let i=this.css.indexOf("*/",n+3);if(i===-1)break;for(;n>0&&this.css[n-1]===`
28
+ `;)n--;this.css=this.css.slice(0,n)+this.css.slice(i+2)}}}}generate(){if(this.clearAnnotation(),c&&m&&this.isMap())return this.generateMap();{let n="";return this.stringify(this.root,i=>{n+=i}),[n]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let n=this.previous()[0].consumer();n.file=this.outputFile(),this.map=h.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new h({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new h({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,i=1,u="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(y,b,E)=>{if(this.css+=y,b&&E!=="end"&&(f.generated.line=n,f.generated.column=i-1,b.source&&b.source.start?(f.source=this.sourcePath(b),f.original.line=b.source.start.line,f.original.column=b.source.start.column-1,this.map.addMapping(f)):(f.source=u,f.original.line=1,f.original.column=0,this.map.addMapping(f))),S=y.match(/\n/g),S?(n+=S.length,g=y.lastIndexOf(`
29
+ `),i=y.length-g):i+=y.length,b&&E!=="start"){let v=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==v.last||v.raws.semicolon)&&(b.source&&b.source.end?(f.source=this.sourcePath(b),f.original.line=b.source.end.line,f.original.column=b.source.end.column-1,f.generated.line=n,f.generated.column=i-2,this.map.addMapping(f)):(f.source=u,f.original.line=1,f.original.column=0,f.generated.line=n,f.generated.column=i-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(n=>n.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let n=this.mapOpts.annotation;return typeof n!="undefined"&&n!==!0?!1:this.previous().length?this.previous().some(i=>i.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(n=>n.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute||n.charCodeAt(0)===60||/^\w+:\/\//.test(n))return n;let i=this.memoizedPaths.get(n);if(i)return i;let u=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(u=e(r(u,this.mapOpts.annotation)));let f=t(u,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(n=>{if(n.source&&n.source.input.map){let i=n.source.input.map;this.previousMaps.includes(i)||this.previousMaps.push(i)}});else{let n=new p(this.originalCSS,this.opts);n.map&&this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk(i=>{if(i.source){let u=i.source.input.from;if(u&&!n[u]){n[u]=!0;let f=this.usesFileUrls?this.toFileUrl(u):this.toUrl(this.path(u));this.map.setSourceContent(f,i.source.input.css)}}});else if(this.css){let i=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(i,this.css)}}sourcePath(n){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(n.source.input.from):this.toUrl(this.path(n.source.input.from))}toBase64(n){return Buffer?Buffer.from(n).toString("base64"):window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let i=this.memoizedFileURLs.get(n);if(i)return i;if(d){let u=d(n).toString();return this.memoizedFileURLs.set(n,u),u}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let i=this.memoizedURLs.get(n);if(i)return i;s==="\\"&&(n=n.replace(/\\/g,"/"));let u=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,u),u}}return Sr=a,Sr}var Cr,_s;function vl(){if(_s)return Cr;_s=1;const e=39,t=34,r=92,s=47,l=10,h=32,d=12,p=9,m=13,c=91,a=93,o=40,n=41,i=123,u=125,f=59,g=42,S=58,y=64,b=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,v=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return Cr=function(M,R={}){let x=M.css.valueOf(),A=R.ignoreErrors,T,G,X,I,ne,P,j,H,F,Z,ue=x.length,O=0,Se=[],ce=[],Te=-1;function Ae(){return O}function Ce(ie){throw M.error("Unclosed "+ie,O)}function ze(){return ce.length===0&&O>=ue}function tt(ie){if(ce.length)return ce.pop();if(O>=ue)return;let me=ie?ie.ignoreUnclosed:!1;switch(T=x.charCodeAt(O),T){case l:case h:case p:case m:case d:{I=O;do I+=1,T=x.charCodeAt(I);while(T===h||T===l||T===p||T===m||T===d);P=["space",x.slice(O,I)],O=I-1;break}case c:case a:case i:case u:case S:case f:case n:{let de=String.fromCharCode(T);P=[de,de,O];break}case o:{if(Z=Se.length?Se.pop()[1]:"",F=x.charCodeAt(O+1),Z==="url"&&F!==e&&F!==t&&F!==h&&F!==l&&F!==p&&F!==d&&F!==m){I=O;do{if(j=!1,I=x.indexOf(")",I+1),I===-1)if(A||me){I=O;break}else Ce("bracket");for(H=I;x.charCodeAt(H-1)===r;)H-=1,j=!j}while(j);P=["brackets",x.slice(O,I+1),O,I],O=I}else O<=Te?P=["(","(",O]:(I=x.indexOf(")",O+1),G=x.slice(O,I+1),I===-1||v.test(G)?(Te=I===-1?ue:I,P=["(","(",O]):(P=["brackets",G,O,I],O=I));break}case e:case t:{ne=T===e?"'":'"',I=O;do{if(j=!1,I=x.indexOf(ne,I+1),I===-1)if(A||me){I=O+1;break}else Ce("string");for(H=I;x.charCodeAt(H-1)===r;)H-=1,j=!j}while(j);P=["string",x.slice(O,I+1),O,I],O=I;break}case y:{b.lastIndex=O+1,b.test(x),b.lastIndex===0?I=x.length-1:I=b.lastIndex-2,P=["at-word",x.slice(O,I+1),O,I],O=I;break}case r:{for(I=O,X=!0;x.charCodeAt(I+1)===r;)I+=1,X=!X;if(T=x.charCodeAt(I+1),X&&T!==s&&T!==h&&T!==l&&T!==p&&T!==m&&T!==d&&(I+=1,w.test(x.charAt(I)))){for(;w.test(x.charAt(I+1));)I+=1;x.charCodeAt(I+1)===h&&(I+=1)}P=["word",x.slice(O,I+1),O,I],O=I;break}default:{T===s&&x.charCodeAt(O+1)===g?(I=x.indexOf("*/",O+2)+1,I===0&&(A||me?I=x.length:Ce("comment")),P=["comment",x.slice(O,I+1),O,I],O=I):(E.lastIndex=O+1,E.test(x),E.lastIndex===0?I=x.length-1:I=E.lastIndex-2,P=["word",x.slice(O,I+1),O,I],Se.push(P),O=I);break}}return O++,P}function pe(ie){ce.push(ie)}return{back:pe,endOfFile:ze,nextToken:tt,position:Ae}},Cr}var Er,ks;function Sl(){if(ks)return Er;ks=1;let e=Mi(),t=qt(),r=Gt(),s=ut(),l=Ni(),h=vl();const d={empty:!0,space:!0};function p(a){for(let o=a.length-1;o>=0;o--){let n=a[o],i=n[3]||n[2];if(i)return i}}function m(a,o,n){let i="";for(let u=o;u<n;u++)i+=a[u][1];return i}class c{constructor(o){this.input=o,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:o,start:{column:1,line:1,offset:0}}}atrule(o){let n=new e;n.name=o[1].slice(1),n.name===""&&this.unnamedAtrule(n,o),this.init(n,o[2]);let i,u,f,g=!1,S=!1,y=[],b=[];for(;!this.tokenizer.endOfFile();){if(o=this.tokenizer.nextToken(),i=o[0],i==="("||i==="["?b.push(i==="("?")":"]"):i==="{"&&b.length>0?b.push("}"):i===b[b.length-1]&&b.pop(),b.length===0)if(i===";"){n.source.end=this.getPosition(o[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){S=!0;break}else if(i==="}"){if(y.length>0){for(f=y.length-1,u=y[f];u&&u[0]==="space";)u=y[--f];u&&(n.source.end=this.getPosition(u[3]||u[2]),n.source.end.offset++)}this.end(o);break}else y.push(o);else y.push(o);if(this.tokenizer.endOfFile()){g=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(n.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(n,"params",y),g&&(o=y[y.length-1],n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),S&&(n.nodes=[],this.current=n)}checkMissedSemicolon(o){let n=this.colon(o);if(n===!1)return;let i=0,u;for(let f=n-1;f>=0&&(u=o[f],!(u[0]!=="space"&&(i+=1,i===2)));f--);throw this.input.error("Missed semicolon",u[0]==="word"?u[3]+1:u[2])}colon(o){let n=0,i,u,f;for(let[g,S]of o.entries()){if(u=S,f=u[0],f==="("&&(n+=1),f===")"&&(n-=1),n===0&&f===":")if(!i)this.doubleColon(u);else{if(i[0]==="word"&&i[1]==="progid")continue;return g}i=u}return!1}comment(o){let n=new t;this.init(n,o[2]),n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++;let i=o[1].slice(2,-2);if(!i.trim())n.text="",n.raws.left=i,n.raws.right="";else{let u=i.match(/^(\s*)([^]*\S)(\s*)$/);n.text=u[2],n.raws.left=u[1],n.raws.right=u[3]}}createTokenizer(){this.tokenizer=h(this.input)}decl(o,n){let i=new r;this.init(i,o[0][2]);let u=o[o.length-1];u[0]===";"&&(this.semicolon=!0,o.pop()),i.source.end=this.getPosition(u[3]||u[2]||p(o)),i.source.end.offset++;let f=0;for(;o[f][0]!=="word";)f===o.length-1&&this.unknownWord([o[f]]),f++;i.raws.before+=m(o,0,f),i.source.start=this.getPosition(o[f][2]);let g=f;for(;f<o.length;){let w=o[f][0];if(w===":"||w==="space"||w==="comment")break;f++}i.prop=m(o,g,f);let S=f,y;for(;f<o.length&&(y=o[f],f++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);i.raws.between=m(o,S,f),(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let b=f;for(;f<o.length;){let w=o[f][0];if(w!=="space"&&w!=="comment")break;f++}let E=o.slice(b,f);o=o.slice(f),this.precheckMissedSemicolon(o);for(let w=o.length-1;w>=0;w--){if(y=o[w],y[1].toLowerCase()==="!important"){i.important=!0;let C=this.stringFrom(o,w);C=this.spacesFromEnd(o)+C,C!==" !important"&&(i.raws.important=C);break}else if(y[1].toLowerCase()==="important"){let C=o.slice(0),M="";for(let R=w;R>0;R--){let x=C[R][0];if(M.trim().startsWith("!")&&x!=="space")break;M=C.pop()[1]+M}M.trim().startsWith("!")&&(i.important=!0,i.raws.important=M,o=C)}if(y[0]!=="space"&&y[0]!=="comment")break}o.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(i.raws.between+=E.map(w=>w[1]).join(""),E=[]),this.raw(i,"value",E.concat(o),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(o)}doubleColon(o){throw this.input.error("Double colon",{offset:o[2]},{offset:o[2]+o[1].length})}emptyRule(o){let n=new l;this.init(n,o[2]),n.selector="",n.raws.between="",this.current=n}end(o){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(o[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(o)}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(o){if(this.spaces+=o[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(o[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(o){let n=this.input.fromOffset(o);return{column:n.col,line:n.line,offset:o}}init(o,n){this.current.push(o),o.source={input:this.input,start:this.getPosition(n)},o.raws.before=this.spaces,this.spaces="",o.type!=="comment"&&(this.semicolon=!1)}other(o){let n=!1,i=null,u=!1,f=null,g=[],S=o[1].startsWith("--"),y=[],b=o;for(;b;){if(i=b[0],y.push(b),i==="("||i==="[")f||(f=b),g.push(i==="("?")":"]");else if(S&&u&&i==="{")f||(f=b),g.push("}");else if(g.length===0)if(i===";")if(u){this.decl(y,S);return}else break;else if(i==="{"){this.rule(y);return}else if(i==="}"){this.tokenizer.back(y.pop()),n=!0;break}else i===":"&&(u=!0);else i===g[g.length-1]&&(g.pop(),g.length===0&&(f=null));b=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),g.length>0&&this.unclosedBracket(f),n&&u){if(!S)for(;y.length&&(b=y[y.length-1][0],!(b!=="space"&&b!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,S)}else this.unknownWord(y)}parse(){let o;for(;!this.tokenizer.endOfFile();)switch(o=this.tokenizer.nextToken(),o[0]){case"space":this.spaces+=o[1];break;case";":this.freeSemicolon(o);break;case"}":this.end(o);break;case"comment":this.comment(o);break;case"at-word":this.atrule(o);break;case"{":this.emptyRule(o);break;default:this.other(o);break}this.endFile()}precheckMissedSemicolon(){}raw(o,n,i,u){let f,g,S=i.length,y="",b=!0,E,v;for(let w=0;w<S;w+=1)f=i[w],g=f[0],g==="space"&&w===S-1&&!u?b=!1:g==="comment"?(v=i[w-1]?i[w-1][0]:"empty",E=i[w+1]?i[w+1][0]:"empty",!d[v]&&!d[E]?y.slice(-1)===","?b=!1:y+=f[1]:b=!1):y+=f[1];if(!b){let w=i.reduce((C,M)=>C+M[1],"");o.raws[n]={raw:w,value:y}}o[n]=y}rule(o){o.pop();let n=new l;this.init(n,o[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(o),this.raw(n,"selector",o),this.current=n}spacesAndCommentsFromEnd(o){let n,i="";for(;o.length&&(n=o[o.length-1][0],!(n!=="space"&&n!=="comment"));)i=o.pop()[1]+i;return i}spacesAndCommentsFromStart(o){let n,i="";for(;o.length&&(n=o[0][0],!(n!=="space"&&n!=="comment"));)i+=o.shift()[1];return i}spacesFromEnd(o){let n,i="";for(;o.length&&(n=o[o.length-1][0],n==="space");)i=o.pop()[1]+i;return i}stringFrom(o,n){let i="";for(let u=n;u<o.length;u++)i+=o[u][1];return o.splice(n,o.length-n),i}unclosedBlock(){let o=this.current.source.start;throw this.input.error("Unclosed block",o.line,o.column)}unclosedBracket(o){throw this.input.error("Unclosed bracket",{offset:o[2]},{offset:o[2]+1})}unexpectedClose(o){throw this.input.error("Unexpected }",{offset:o[2]},{offset:o[2]+1})}unknownWord(o){throw this.input.error("Unknown word "+o[0][1],{offset:o[0][2]},{offset:o[0][2]+o[0][1].length})}unnamedAtrule(o,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}}return Er=c,Er}var xr,Ps;function Oi(){if(Ps)return xr;Ps=1;let e=Ue(),t=Ht(),r=Sl();function s(l,h){let d=new t(l,h),p=new r(d);try{p.parse()}catch(m){throw m}return p.root}return xr=s,s.default=s,e.registerParse(s),xr}var Rr,Ls;function po(){if(Ls)return Rr;Ls=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let l=s.node.rangeBy(s);this.line=l.start.line,this.column=l.start.column,this.endLine=l.end.line,this.endColumn=l.end.column}for(let l in s)this[l]=s[l]}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}}return Rr=e,e.default=e,Rr}var Mr,Fs;function Ti(){if(Fs)return Mr;Fs=1;let e=po();class t{get content(){return this.css}constructor(s,l,h){this.processor=s,this.messages=[],this.root=l,this.opts=h,this.css="",this.map=void 0}toString(){return this.css}warn(s,l={}){l.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(l.plugin=this.lastPlugin.postcssPlugin);let h=new e(s,l);return this.messages.push(h),h}warnings(){return this.messages.filter(s=>s.type==="warning")}}return Mr=t,t.default=t,Mr}var Ir,Bs;function mo(){if(Bs)return Ir;Bs=1;let e={};return Ir=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Ir}var Nr,Us;function go(){if(Us)return Nr;Us=1;let e=Ue(),t=Ii(),r=fo(),s=Oi(),l=Ti(),h=ut(),d=Vt(),{isClean:p,my:m}=Ri(),c=mo();const a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},o={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},n={Once:!0,postcssPlugin:!0,prepare:!0},i=0;function u(E){return typeof E=="object"&&typeof E.then=="function"}function f(E){let v=!1,w=a[E.type];return E.type==="decl"?v=E.prop.toLowerCase():E.type==="atrule"&&(v=E.name.toLowerCase()),v&&E.append?[w,w+"-"+v,i,w+"Exit",w+"Exit-"+v]:v?[w,w+"-"+v,w+"Exit",w+"Exit-"+v]:E.append?[w,i,w+"Exit"]:[w,w+"Exit"]}function g(E){let v;return E.type==="document"?v=["Document",i,"DocumentExit"]:E.type==="root"?v=["Root",i,"RootExit"]:v=f(E),{eventIndex:0,events:v,iterator:0,node:E,visitorIndex:0,visitors:[]}}function S(E){let v=[E];for(;v.length>0;){let w=v.pop();if(w[p]=!1,w.nodes)for(let C of w.nodes)v.push(C)}return E}let y={};class b{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"}constructor(v,w,C){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=S(w);else if(w instanceof b||w instanceof l)M=S(w.root),w.map&&(typeof C.map=="undefined"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=w.map);else{let R=s;C.syntax&&(R=C.syntax.parse),C.parser&&(R=C.parser),R.parse&&(R=R.parse);try{M=R(w,C)}catch(x){this.processed=!0,this.error=x}M&&!M[m]&&e.rebuild(M)}this.result=new l(v,M,C),this.helpers=se(L({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(R=>typeof R=="object"&&R.prepare?L(L({},R),R.prepare(this.result)):R)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,w){let C=this.result.lastPlugin;try{w&&w.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=C.postcssPlugin,v.setMessage()):C.postcssVersion}catch(M){console&&console.error&&console.error(M)}return v}prepareVisitors(){this.listeners={};let v=(w,C,M)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([w,M])};for(let w of this.plugins)if(typeof w=="object")for(let C in w){if(!o[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!n[C])if(typeof w[C]=="object")for(let M in w[C])M==="*"?v(w,C,w[C][M]):v(w,C+"-"+M.toLowerCase(),w[C][M]);else typeof w[C]=="function"&&v(w,C,w[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let w=this.plugins[v],C=this.runOnRoot(w);if(u(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[p];){v[p]=!0;let w=[g(v)];for(;w.length>0;){let C=this.visitTick(w);if(u(C))try{await C}catch(M){let R=w[w.length-1].node;throw this.handleError(M,R)}}}if(this.listeners.OnceExit)for(let[w,C]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(v.type==="document"){let M=v.nodes.map(R=>C(R,this.helpers));await Promise.all(M)}else await C(v,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(C=>v.Once(C,this.helpers));return u(w[0])?Promise.all(w):w}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,w=d;v.syntax&&(w=v.syntax.stringify),v.stringifier&&(w=v.stringifier),w.stringify&&(w=w.stringify);let C=this.result.root.source;if(v.map===void 0&&!(C&&C.input&&C.input.map)){let x="";return w(this.result.root,A=>{x+=A}),this.result.css=x,this.result}let R=new r(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 v of this.plugins){let w=this.runOnRoot(v);if(u(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[p];)v[p]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let w of v.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,w){return this.async().then(v,w)}toString(){return this.css}visitSync(v,w){for(let[C,M]of v){this.result.lastPlugin=C;let R;try{R=M(w,this.helpers)}catch(x){throw this.handleError(x,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(u(R))throw this.getAsyncError()}}visitTick(v){let w=v[v.length-1],{node:C,visitors:M}=w;if(C.type!=="root"&&C.type!=="document"&&!C.parent){v.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[x,A]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=x;try{return A(C.toProxy(),this.helpers)}catch(T){throw this.handleError(T,C)}}if(w.iterator!==0){let x=w.iterator,A;for(;A=C.nodes[C.indexes[x]];)if(C.indexes[x]+=1,!A[p]){A[p]=!0,v.push(g(A));return}w.iterator=0,delete C.indexes[x]}let R=w.events;for(;w.eventIndex<R.length;){let x=R[w.eventIndex];if(w.eventIndex+=1,x===i){C.nodes&&C.nodes.length&&(C[p]=!0,w.iterator=C.getIterator());return}else if(this.listeners[x]){w.visitors=this.listeners[x];return}}v.pop()}walkSync(v){v[p]=!0;let w=[{eventIndex:0,events:f(v),iterator:0,node:v}];for(;w.length>0;){let C=w[w.length-1],M=C.node;if(C.iterator!==0){let R=C.iterator,x,A=!1;for(;x=M.nodes[M.indexes[R]];)if(M.indexes[R]+=1,!x[p]){x[p]=!0,w.push({eventIndex:0,events:f(x),iterator:0,node:x}),A=!0;break}if(A)continue;C.iterator=0,delete M.indexes[R]}if(C.eventIndex<C.events.length){let R=C.events[C.eventIndex];if(C.eventIndex+=1,R===i)M.nodes&&M.nodes.length&&(C.iterator=M.getIterator());else{let x=this.listeners[R];x&&this.visitSync(x,M.toProxy())&&w.pop()}continue}w.pop()}}warnings(){return this.sync().warnings()}}return b.registerPostcss=E=>{y=E},Nr=b,b.default=b,h.registerLazyResult(b),t.registerLazyResult(b),Nr}var Or,Ws;function Cl(){if(Ws)return Or;Ws=1;let e=fo(),t=Oi(),r=Ti(),s=Vt(),l=mo();class h{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 p,m=t;try{p=m(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(p,m,c){m=m.toString(),this.stringified=!1,this._processor=p,this._css=m,this._opts=c,this._map=void 0;let a=s;this.result=new r(this._processor,void 0,this._opts),this.result.css=m;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(a,void 0,this._opts,m);if(n.isMap()){let[i,u]=n.generate();i&&(this.result.css=i),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,m){return this.async().then(p,m)}toString(){return this._css}warnings(){return[]}}return Or=h,h.default=h,Or}var Tr,$s;function El(){if($s)return Tr;$s=1;let e=Ii(),t=go(),r=Cl(),s=ut();class l{constructor(d=[]){this.version="8.5.19",this.plugins=this.normalize(d)}normalize(d){let p=[];for(let m of d)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))p=p.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)p.push(m);else if(typeof m=="function")p.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return p}process(d,p={}){return!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax?new r(this,d,p):new t(this,d,p)}use(d){return this.plugins=this.plugins.concat(this.normalize([d])),this}}return Tr=l,l.default=l,s.registerProcessor(l),e.registerProcessor(l),Tr}var Ar,zs;function xl(){if(zs)return Ar;zs=1;let e=Mi(),t=qt(),r=Ue(),s=xi(),l=Gt(),h=Ii(),d=bl(),p=Ht(),m=go(),c=ho(),a=jt(),o=Oi(),n=El(),i=Ti(),u=ut(),f=Ni(),g=Vt(),S=po();function y(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new n(b)}return y.plugin=function(E,v){let w=!1;function C(...R){console&&console.warn&&!w&&(w=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:
30
+ 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:
31
+ https://www.w3ctech.com/topic/2226`));let x=v(...R);return x.postcssPlugin=E,x.postcssVersion=new n().version,x}let M;return Object.defineProperty(C,"postcss",{get(){return M||(M=C()),M}}),C.process=function(R,x,A){return y([C(A)]).process(R,x)},C},y.stringify=g,y.parse=o,y.fromJSON=d,y.list=c,y.comment=b=>new t(b),y.atRule=b=>new e(b),y.decl=b=>new l(b),y.rule=b=>new f(b),y.root=b=>new u(b),y.document=b=>new h(b),y.CssSyntaxError=s,y.Declaration=l,y.Container=r,y.Processor=n,y.Document=h,y.Comment=t,y.Warning=S,y.AtRule=e,y.Result=i,y.Input=p,y.Rule=f,y.Root=u,y.Node=a,m.registerPostcss(y),Ar=y,y.default=y,Ar}var Rl=xl();const Q=dl(Rl);Q.stringify;Q.fromJSON;Q.plugin;Q.parse;Q.list;Q.document;Q.comment;Q.atRule;Q.rule;Q.decl;Q.root;Q.CssSyntaxError;Q.Declaration;Q.Container;Q.Processor;Q.Document;Q.Comment;Q.Warning;Q.AtRule;Q.Result;Q.Input;Q.Rule;Q.Root;Q.Node;const Vs={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Ml(e){const t=String(e.tagName).toLowerCase();let r=Vs[t]?Vs[t]:e.tagName;return t==="link"&&e.attributes._cssText&&(r="style"),r}function Yt(e,t){const r=t==null?void 0:t.stylesWithHoverClass.get(e);if(r)return r;let s=e;try{s=Q([hl,fl]).process(e).css}catch(l){console.warn("Failed to adapt css for replay",l)}return t==null||t.stylesWithHoverClass.set(e,s),s}function js(){return{stylesWithHoverClass:new Map}}const Il="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",qs="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",yo=new WeakSet;function Nl(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;const t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function Ol(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(yo.has(e.doc)&&Nl(t.frameElement)))throw new Error(Il)}function Tl(e,t,r,s){const l=[];for(const m of e.childNodes)m.type===B.Text&&l.push(m);const h=t.split("/* rr_split */");for(;h.length>1&&h.length>l.length;)h.splice(-2,2,h.slice(-2).join(""));let d="";r&&(d=Yt(h.join(""),s));let p=0;for(let m=0;m<l.length&&m!==h.length;m++){const c=l[m];if(!r)c.textContent=h[m];else if(m<h.length-1){let a=p,o=h[m+1].length;o=Math.min(o,30);let n=!1;for(;o>2;o--){const i=h[m+1].substring(0,o),u=d.substring(p).indexOf(i);if(n=u!==-1,n){a+=u;break}}n||(a+=h[m].length),c.textContent=d.substring(p,a),p=a}else c.textContent=d.substring(p)}}function Al(e,t,r,s){const{doc:l,hackCss:h,cache:d}=s;e.childNodes.length?Tl(e,r,h,d):(h&&(r=Yt(r,d)),t.appendChild(l.createTextNode(r)))}function Dl(e,t){var r;const{doc:s,hackCss:l,cache:h}=t;switch(e.type){case B.Document:return s.implementation.createDocument(null,"",null);case B.DocumentType:return s.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case B.Element:{const d=Ml(e);let p;e.isSVG?p=s.createElementNS("http://www.w3.org/2000/svg",d):(e.isCustom&&((r=s.defaultView)!=null&&r.customElements)&&!s.defaultView.customElements.get(e.tagName)&&s.defaultView.customElements.define(e.tagName,class extends s.defaultView.HTMLElement{}),p=s.createElement(d));const m={};for(const c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let a=e.attributes[c];if(!(d==="option"&&c==="selected"&&a===!1)&&a!==null){if(a===!0&&(a=""),c.startsWith("rr_")){m[c]=a;continue}if(typeof a=="string"){if(d==="style"&&c==="_cssText"){Al(e,p,a,t);continue}else if(d==="textarea"&&c==="value"){p.appendChild(s.createTextNode(a));try{e.childNodes=[]}catch(o){console.warn(`Highlight failed to set rrweb text area child nodes ${String(o)}`)}continue}}try{if(e.isSVG&&c==="xlink:href")p.setAttributeNS("http://www.w3.org/1999/xlink",c,a.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")p.setAttribute("_"+c,a.toString());else if(d==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){p.setAttribute("csp-content",a.toString());continue}else d==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||d==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Si(e.attributes.href)==="js"||(d==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?p.setAttribute("rrweb-original-srcset",e.attributes.srcset):p.setAttribute(c,a.toString()))}catch(o){}}}for(const c in m){const a=m[c];if(d==="canvas"&&c==="rr_dataURL"){const o=s.createElement("img");o.src=a.toString();const n=p.getContext("2d");n&&(Xn(n),n.drawImage(o,0,0)),p.RRNodeType&&(p.rr_dataURL=a.toString())}else if(d==="img"&&c==="rr_dataURL"){const o=p;o.currentSrc.startsWith("data:")||(o.setAttribute("rrweb-original-src",e.attributes.src),o.src=a.toString())}if(c==="rr_width")p.style.setProperty("width",a.toString());else if(c==="rr_height")p.style.setProperty("height",a.toString());else if(c==="rr_mediaCurrentTime"&&typeof a=="number")p.currentTime=a;else if(c==="rr_mediaState")switch(a){case"played":p.play().catch(o=>console.warn("media playback error",o));break;case"paused":p.pause();break}else c==="rr_mediaPlaybackRate"&&typeof a=="number"?p.playbackRate=a:c==="rr_mediaMuted"&&typeof a=="boolean"?p.muted=a:c==="rr_mediaLoop"&&typeof a=="boolean"?p.loop=a:c==="rr_mediaVolume"&&typeof a=="number"?p.volume=a:c==="rr_open_mode"&&p.setAttribute("rr_open_mode",a)}if(e.isShadowHost)if(!p.shadowRoot)p.attachShadow({mode:"open"});else for(;p.shadowRoot.firstChild;)p.shadowRoot.removeChild(p.shadowRoot.firstChild);return p}case B.Text:return e.isStyle&&l?s.createTextNode(Yt(e.textContent,h)):s.createTextNode(e.textContent);case B.CDATA:return s.createCDATASection(e.textContent);case B.Comment:return s.createComment(e.textContent);default:return null}}function nt(e,t){const{doc:r,mirror:s,skipChild:l=!1,hackCss:h=!0,afterAppend:d,cache:p,cspContent:m}=t;if(s.has(e.id)){const a=s.getNode(e.id),o=s.getMeta(a);if(_a(o,e))return s.getNode(e.id)}let c=Dl(e,{doc:r,hackCss:h,cache:p});if(!c)return null;if(e.rootId&&s.getNode(e.rootId)!==r&&s.replace(e.rootId,r),e.type===B.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==B.DocumentType&&(e.childNodes[0].type===B.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),c=r),s.add(c,e),(e.type===B.Document||e.type===B.Element)&&!l)for(const a of e.childNodes){const o=nt(a,{doc:r,mirror:s,skipChild:!1,hackCss:h,afterAppend:d,cache:p});if(!o){console.warn("Failed to rebuild",a);continue}if(a.isShadow&&bi(c)&&c.shadowRoot)c.shadowRoot.appendChild(o);else if(e.type===B.Document&&a.type==B.Element){const n=o;m&&Pl(n,m,r);let i=null;n.childNodes.forEach(u=>{u.nodeName==="BODY"&&(i=u)}),i?(n.removeChild(i),c.appendChild(o),n.appendChild(i)):c.appendChild(o)}else c.appendChild(o);d&&d(o,a.id)}return c}function _l(e,t){function r(s){t(s)}for(const s of e.getIds())e.has(s)&&r(e.getNode(s))}function kl(e,t){const r=t.getMeta(e);if((r==null?void 0:r.type)!==B.Element)return;const s=e;for(const l in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,l)&&l.startsWith("rr_")))continue;const h=r.attributes[l];l==="rr_scrollLeft"&&(s.scrollLeft=h),l==="rr_scrollTop"&&(s.scrollTop=h)}}function Pl(e,t,r){let s=e.querySelector("head");s||(s=r.createElement("head"),e.insertBefore(s,e.firstChild));const l=r.createElement("meta");l.setAttribute("http-equiv","Content-Security-Policy"),l.setAttribute("content",t),s.insertBefore(l,s.firstChild)}function Ll(e,t){Ol(t);const{doc:r,onVisit:s,hackCss:l=!0,afterAppend:h,cache:d,mirror:p=new vi,cspContent:m}=t,c=nt(e,{doc:r,mirror:p,skipChild:!1,hackCss:l,afterAppend:h,cache:d,cspContent:m});return _l(p,a=>{s&&s(a),kl(a,p)}),c}function Fl(e){var t;if(!e.root.isConnected)throw new Error(qs);const r=e.root.ownerDocument.createElement("iframe");for(const[l,h]of Object.entries(e.iframeAttributes||{}))l!=="sandbox"&&r.setAttribute(l,h);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);const s=r.contentDocument;if(!s||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(qs);return yo.add(s),r}var Bl=Object.defineProperty,Ul=(e,t,r)=>t in e?Bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t,r)=>Ul(e,typeof t!="symbol"?t+"":t,r),Wl=Object.defineProperty,$l=(e,t,r)=>t in e?Wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gs=(e,t,r)=>$l(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();let zl=class{constructor(){Gs(this,"idNodeMap",new Map),Gs(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const l=this.nodeMetaMap.get(s);l&&this.nodeMetaMap.set(r,l)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Vl(){return new zl}function jl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ql(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var l=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,l.get?l:{enumerable:!0,get:function(){return e[s]}})}),r}var St={exports:{}},Hs;function Gl(){if(Hs)return St.exports;Hs=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return St.exports=t(),St.exports.createColors=t,St.exports}const Hl={},Yl=Object.freeze(Object.defineProperty({__proto__:null,default:Hl},Symbol.toStringTag,{value:"Module"})),be=ql(Yl);var Dr,Ys;function Ai(){if(Ys)return Dr;Ys=1;let e=Gl(),t=be;class r extends Error{constructor(l,h,d,p,m,c){super(l),this.name="CssSyntaxError",this.reason=l,m&&(this.file=m),p&&(this.source=p),c&&(this.plugin=c),typeof h!="undefined"&&typeof d!="undefined"&&(typeof h=="number"?(this.line=h,this.column=d):(this.line=h.line,this.column=h.column,this.endLine=d.line,this.endColumn=d.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(l){if(!this.source)return"";let h=this.source;l==null&&(l=e.isColorSupported);let d=i=>i,p=i=>i,m=i=>i;if(l){let{bold:i,gray:u,red:f}=e.createColors(!0);p=g=>i(f(g)),d=g=>u(g),t&&(m=g=>t(g))}let c=h.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,c.length),n=String(o).length;return c.slice(a,o).map((i,u)=>{let f=a+1+u,g=" "+(" "+f).slice(-n)+" | ";if(f===this.line){if(i.length>160){let y=20,b=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),v=i.slice(b,E),w=d(g.replace(/\d/g," "))+i.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return p(">")+d(g)+m(v)+`
32
+ `+w+p("^")}let S=d(g.replace(/\d/g," "))+i.slice(0,this.column-1).replace(/[^\t]/g," ");return p(">")+d(g)+m(i)+`
33
+ `+S+p("^")}return" "+d(g)+m(i)}).join(`
34
+ `)}toString(){let l=this.showSourceCode();return l&&(l=`
35
+
36
+ `+l+`
37
+ `),this.name+": "+this.message+l}}return Dr=r,r.default=r,Dr}var _r,Js;function wo(){if(Js)return _r;Js=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function r(c){return typeof c!="string"||!c.includes("<")?c:c.replace(e,"\\3c $2").replace(t,"\\3c $2")}const s={after:`
38
+ `,beforeClose:`
39
+ `,beforeComment:`
40
+ `,beforeDecl:`
41
+ `,beforeOpen:" ",beforeRule:`
42
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function l(c){return c[0].toUpperCase()+c.slice(1)}function h(c,a){let o="@"+a.name,n=a.params?c.rawValue(a,"params"):"";return typeof a.raws.afterName!="undefined"?o+=a.raws.afterName:n&&(o+=" "),o+n}function d(c,a,o){let n=o.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let u=c.raw(o,"semicolon"),f=o.type==="document";for(let g=n.length-1;g>=0;g--)a.push({document:f,node:n[g],semicolon:i!==g||u})}function p(c,a,o,n){let i=c.raw(o,"between","beforeOpen");c.builder(r(n+i)+"{",o,"start");let u=o.nodes&&o.nodes.length,f=()=>{let g=u?c.raw(o,"after"):c.raw(o,"after","emptyBody");g&&c.builder(r(g)),c.builder("}",o,"end"),o.type==="rule"&&o.raws.ownSemicolon&&c.builder(r(o.raws.ownSemicolon),o,"end")};u?(a.push(f),d(c,a,o)):f()}class m{constructor(a){this.builder=a}atrule(a,o){let n=h(this,a);if(a.nodes)this.block(a,n);else{let i=(a.raws.between||"")+(o?";":"");this.builder(r(n+i),a)}}beforeAfter(a,o){let n;a.type==="decl"?n=this.raw(a,null,"beforeDecl"):a.type==="comment"?n=this.raw(a,null,"beforeComment"):o==="before"?n=this.raw(a,null,"beforeRule"):n=this.raw(a,null,"beforeClose");let i=a.parent,u=0;for(;i&&i.type!=="root";)u+=1,i=i.parent;if(n.includes(`
43
+ `)){let f=this.raw(a,null,"indent");if(f.length)for(let g=0;g<u;g++)n+=f}return n}block(a,o){let n=this.raw(a,"between","beforeOpen");this.builder(r(o+n)+"{",a,"start");let i;a.nodes&&a.nodes.length?(this.body(a),i=this.raw(a,"after")):i=this.raw(a,"after","emptyBody"),i&&this.builder(r(i)),this.builder("}",a,"end")}body(a){let o=m.prototype,n=["atrule","block","body","rule","stringify"].every(u=>this[u]===o[u]),i=[];for(d(this,i,a);i.length>0;){let u=i.pop();if(typeof u=="function"){u();continue}let f=u.node,g=this.raw(f,"before");g&&this.builder(u.document?g:r(g)),n&&f.type==="rule"?p(this,i,f,this.rawValue(f,"selector")):n&&f.type==="atrule"&&f.nodes?p(this,i,f,h(this,f)):this.stringify(f,u.semicolon)}}comment(a){let o=this.raw(a,"left","commentLeft"),n=this.raw(a,"right","commentRight");this.builder(r("/*"+o+a.text+n+"*/"),a)}decl(a,o){let n=a.raws,i=this.raw(a,"between","colon"),u=a.prop+i+this.rawValue(a,"value");a.important&&(u+=n.important||" !important"),o&&(u+=";"),this.builder(r(u),a)}document(a){this.body(a)}raw(a,o,n){let i;if(n||(n=o),o&&(i=a.raws[o],typeof i!="undefined"))return i;let u=a.parent;if(n==="before"&&(!u||u.type==="root"&&u.first===a||u&&u.type==="document"))return"";if(!u)return s[n];let f=a.root(),g=f.rawCache||(f.rawCache={});if(typeof g[n]!="undefined")return g[n];if(n==="before"||n==="after")return this.beforeAfter(a,n);{let S="raw"+l(n);this[S]?i=this[S](f,a):f.walk(y=>{if(i=y.raws[o],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=s[n]),g[n]=i,i}rawBeforeClose(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after!="undefined")return o=n.raws.after,o.includes(`
44
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawBeforeComment(a,o){let n;return a.walkComments(i=>{if(typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
45
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n=="undefined"?n=this.raw(o,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(a,o){let n;return a.walkDecls(i=>{if(typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
46
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n=="undefined"?n=this.raw(o,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(a){let o;return a.walk(n=>{if(n.type!=="decl"&&(o=n.raws.between,typeof o!="undefined"))return!1}),o}rawBeforeRule(a){let o;return a.walk(n=>{if(n.nodes&&(n.parent!==a||a.first!==n)&&typeof n.raws.before!="undefined")return o=n.raws.before,o.includes(`
47
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawColon(a){let o;return a.walkDecls(n=>{if(typeof n.raws.between!="undefined")return o=n.raws.between.replace(/[^\s:]/g,""),!1}),o}rawEmptyBody(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length===0&&(o=n.raws.after,typeof o!="undefined"))return!1}),o}rawIndent(a){if(a.raws.indent)return a.raws.indent;let o;return a.walk(n=>{let i=n.parent;if(i&&i!==a&&i.parent&&i.parent===a&&typeof n.raws.before!="undefined"){let u=n.raws.before.split(`
48
+ `);return o=u[u.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(a){let o;return a.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(o=n.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(a,o){let n=a[o],i=a.raws[o];return i&&i.value===n?i.raw:n}root(a){if(this.body(a),a.raws.after){let o=a.raws.after,n=a.parent&&a.parent.type==="document";this.builder(n?o:r(o))}}rule(a){this.block(a,this.rawValue(a,"selector")),a.raws.ownSemicolon&&this.builder(r(a.raws.ownSemicolon),a,"end")}stringify(a,o){if(!this[a.type])throw new Error("Unknown AST node type "+a.type+". Maybe you need to change PostCSS stringifier.");this[a.type](a,o)}}return _r=m,m.default=m,_r}var kr,Xs;function Jt(){if(Xs)return kr;Xs=1;let e=wo();function t(r,s){new e(s).stringify(r)}return kr=t,t.default=t,kr}var Ct={},Qs;function Di(){return Qs||(Qs=1,Ct.isClean=Symbol("isClean"),Ct.my=Symbol("my")),Ct}var Pr,Zs;function Xt(){if(Zs)return Pr;Zs=1;let e=Ai(),t=wo(),r=Jt(),{isClean:s,my:l}=Di();function h(m,c){let a=new m.constructor,o=[[m,a,c]];for(;o.length>0;){let[n,i,u]=o.pop();for(let f in n){if(!Object.prototype.hasOwnProperty.call(n,f)||f==="proxyCache")continue;let g=n[f],S=typeof g;if(f==="parent"&&S==="object")u&&(i[f]=u);else if(f==="source")i[f]=g;else if(Array.isArray(g)){let y=[];i[f]=y;for(let b of g){let E=new b.constructor;y.push(E),o.push([b,E,i])}}else{if(S==="object"&&g!==null){let y=new g.constructor;o.push([g,y,void 0]),g=y}i[f]=g}}}return a}function d(m,c){if(c&&typeof c.offset!="undefined")return c.offset;let a=1,o=1,n=0;for(let i=0;i<m.length;i++){if(o===c.line&&a===c.column){n=i;break}m[i]===`
49
+ `?(a=1,o+=1):a+=1}return n}class p{get proxyOf(){return this}constructor(c={}){this.raws={},this[s]=!1,this[l]=!0;for(let a of Object.keys(c))if(a!=="__proto__")if(a==="nodes"){this.nodes=[];for(let o of c[a])typeof o.clone=="function"&&o.parent?this.append(o.clone()):this.append(o)}else this[a]=c[a]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\n\s{4}at /.test(c.stack)){let a=this.source;c.stack=c.stack.replace(/\n\s{4}at /,`$&${a.input.from}:${a.start.line}:${a.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let a in c)this[a]=c[a];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let a=h(this);for(let o in c)a[o]=c[o];return a}cloneAfter(c={}){let a=this.clone(c);return this.parent.insertAfter(this,a),a}cloneBefore(c={}){let a=this.clone(c);return this.parent.insertBefore(this,a),a}error(c,a={}){if(this.source){let{end:o,start:n}=this.rangeBy(a);return this.source.input.error(c,{column:n.column,line:n.line},{column:o.column,line:o.line},a)}return new e(c)}getProxyProcessor(){return{get(c,a){return a==="proxyOf"?c:a==="root"?()=>c.root().toProxy():c[a]},set(c,a,o){return c[a]===o||(c[a]=o,(a==="prop"||a==="value"||a==="name"||a==="params"||a==="important"||a==="text")&&c.markDirty()),!0}}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let c=this;for(;c=c.parent;)c[s]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c={}){let a="document"in this.source.input?this.source.input.document:this.source.input.css,o={column:this.source.start.column,line:this.source.start.line,offset:d(a,this.source.start)};if(c.index)o=this.positionInside(c.index);else if(c.word){let i=a.slice(d(a,this.source.start),d(a,this.source.end)).indexOf(c.word);i!==-1&&(o=this.positionInside(i))}return o}positionInside(c){let a=this.source.start.column,o=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=d(n,this.source.start),u=i+c;for(let f=i;f<u;f++)n[f]===`
50
+ `?(a=1,o+=1):a+=1;return{column:a,line:o,offset:u}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c={}){let a="document"in this.source.input?this.source.input.document:this.source.input.css,o={column:this.source.start.column,line:this.source.start.line,offset:d(a,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:d(a,this.source.end)+1}:{column:o.column+1,line:o.line,offset:o.offset+1};if(c.word){let u=a.slice(d(a,this.source.start),d(a,this.source.end)).indexOf(c.word);u!==-1&&(o=this.positionInside(u),n=this.positionInside(u+c.word.length))}else c.start?o={column:c.start.column,line:c.start.line,offset:d(a,c.start)}:typeof c.index=="number"&&(o=this.positionInside(c.index)),c.end?n={column:c.end.column,line:c.end.line,offset:d(a,c.end)}:typeof c.endIndex=="number"?n=this.positionInside(c.endIndex):typeof c.index=="number"&&(n=this.positionInside(c.index+1));return(n.line<o.line||n.line===o.line&&n.column<=o.column)&&(n={column:o.column+1,line:o.line,offset:o.offset+1}),{end:n,start:o}}raw(c,a){return new t().raw(this,c,a)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let a=this,o=!1;for(let n of c)n===this?o=!0:o?(this.parent.insertAfter(a,n),a=n):this.parent.insertBefore(a,n);o||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,a){let o=a==null;a=a||new Map;let n=[],i=[[this,n,0]];for(let f=0;f<i.length;f++){let[g,S,y]=i[f],b={};S[y]=b;for(let E in g){if(!Object.prototype.hasOwnProperty.call(g,E)||E==="parent"||E==="proxyCache")continue;let v=g[E];if(Array.isArray(v)){let w=[];b[E]=w;for(let C=0;C<v.length;C++){let M=v[C];typeof M=="object"&&M.toJSON?M.toJSON===p.prototype.toJSON?i.push([M,w,C]):w[C]=M.toJSON(null,a):w[C]=M}}else if(typeof v=="object"&&v.toJSON)v.toJSON===p.prototype.toJSON?i.push([v,b,E]):b[E]=v.toJSON(null,a);else if(E==="source"){if(v==null)continue;let w=a.get(v.input);w==null&&(w=a.size,a.set(v.input,w)),b[E]={end:v.end,inputId:w,start:v.start}}else b[E]=v}}let u=n[0];return o&&(u.inputs=[...a.keys()].map(f=>f.toJSON())),u}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=r){c.stringify&&(c=c.stringify);let a="";return c(this,o=>{a+=o}),a}warn(c,a,o={}){let n={node:this};for(let i in o)n[i]=o[i];return c.warn(a,n)}}return Pr=p,p.default=p,Pr}var Lr,Ks;function Qt(){if(Ks)return Lr;Ks=1;let e=Xt();class t extends e{constructor(s){super(s),this.type="comment"}}return Lr=t,t.default=t,Lr}var Fr,en;function Zt(){if(en)return Fr;en=1;let e=Xt();class t extends e{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(L({},s),{value:String(s.value)})),super(s),this.type="decl"}}return Fr=t,t.default=t,Fr}var Br,tn;function We(){if(tn)return Br;tn=1;let e=Qt(),t=Zt(),r=Xt(),{isClean:s,my:l}=Di(),h,d,p,m;function c(n){let i=n.slice();for(;i.length>0;){let u=i.pop();if(delete u.source,u.nodes){u.nodes=u.nodes.slice();for(let f of u.nodes)i.push(f)}}return n.slice()}function a(n){let i=[n];for(;i.length>0;){let u=i.pop();if(u[s]=!1,u.proxyOf.nodes)for(let f of u.proxyOf.nodes)i.push(f)}}class o extends r{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]}append(...i){for(let u of i){let f=this.normalize(u,this.last);for(let g of f)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(i){let u=[this];for(;u.length>0;){let f=u.pop();if(f!==this&&f.cleanRaws!==o.prototype.cleanRaws){f.cleanRaws(i);continue}if(r.prototype.cleanRaws.call(f,i),f.nodes)for(let g of f.nodes)u.push(g)}}each(i){if(!this.proxyOf.nodes)return;let u=this.getIterator(),f,g;for(;this.indexes[u]<this.proxyOf.nodes.length&&(f=this.indexes[u],g=i(this.proxyOf.nodes[f],f),g!==!1);)this.indexes[u]+=1;return delete this.indexes[u],g}every(i){return this.nodes.every(i)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let i=this.lastEach;return this.indexes[i]=0,i}getProxyProcessor(){return{get(i,u){return u==="proxyOf"?i:i[u]?u==="each"||typeof u=="string"&&u.startsWith("walk")?(...f)=>i[u](...f.map(g=>typeof g=="function"?(S,y)=>g(S.toProxy(),y):g)):u==="every"||u==="some"?f=>i[u]((g,...S)=>f(g.toProxy(),...S)):u==="root"?()=>i.root().toProxy():u==="nodes"?i.nodes.map(f=>f.toProxy()):u==="first"||u==="last"?i[u].toProxy():i[u]:i[u]},set(i,u,f){return i[u]===f||(i[u]=f,(u==="name"||u==="params"||u==="selector")&&i.markDirty()),!0}}}index(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))}insertAfter(i,u){let f=this.index(i),g=this.normalize(u,this.proxyOf.nodes[f]).reverse();f=this.index(i);for(let y of g)this.proxyOf.nodes.splice(f+1,0,y);let S;for(let y in this.indexes)S=this.indexes[y],f<S&&(this.indexes[y]=S+g.length);return this.markDirty(),this}insertBefore(i,u){let f=this.index(i),g=f===0?"prepend":!1,S=this.normalize(u,this.proxyOf.nodes[f],g).reverse();f=this.index(i);for(let b of S)this.proxyOf.nodes.splice(f,0,b);let y;for(let b in this.indexes)y=this.indexes[b],f<=y&&(this.indexes[b]=y+S.length);return this.markDirty(),this}normalize(i,u){if(typeof i=="string")i=c(d(i).nodes);else if(typeof i=="undefined")i=[];else if(Array.isArray(i)){i=i.slice(0);for(let g of i)g.parent&&g.parent.removeChild(g,"ignore")}else if(i.type==="root"&&this.type!=="document"){i=i.nodes.slice(0);for(let g of i)g.parent&&g.parent.removeChild(g,"ignore")}else if(i.type)i=[i];else if(i.prop){if(typeof i.value=="undefined")throw new Error("Value field is missed in node creation");typeof i.value!="string"&&(i.value=String(i.value)),i=[new t(i)]}else if(i.selector||i.selectors)i=[new m(i)];else if(i.name)i=[new h(i)];else if(i.text)i=[new e(i)];else throw new Error("Unknown node type in node creation");return i.map(g=>(g[l]||o.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[s]&&a(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&u&&typeof u.raws.before!="undefined"&&(g.raws.before=u.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...i){i=i.reverse();for(let u of i){let f=this.normalize(u,this.first,"prepend").reverse();for(let g of f)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+f.length}return this.markDirty(),this}push(i){return i.parent=this,this.proxyOf.nodes.push(i),this}removeAll(){for(let i of this.proxyOf.nodes)i.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(i){i=this.index(i),this.proxyOf.nodes[i].parent=void 0,this.proxyOf.nodes.splice(i,1);let u;for(let f in this.indexes)u=this.indexes[f],u>=i&&(this.indexes[f]=u-1);return this.markDirty(),this}replaceValues(i,u,f){return f||(f=u,u={}),this.walkDecls(g=>{u.props&&!u.props.includes(g.prop)||u.fast&&!g.value.includes(u.fast)||(g.value=g.value.replace(i,f))}),this.markDirty(),this}some(i){return this.nodes.some(i)}walk(i){if(!this.proxyOf.nodes)return;let u=[{iterator:this.getIterator(),node:this.proxyOf}];for(;u.length>0;){let{iterator:f,node:g}=u[u.length-1],S=g.indexes[f];if(S>=g.proxyOf.nodes.length){delete g.indexes[f],u.pop();let E=u[u.length-1];E&&(E.node.indexes[E.iterator]+=1);continue}let y=g.proxyOf.nodes[S],b;try{b=i(y,S)}catch(E){throw y.addToError(E)}if(b===!1){for(let E of u)delete E.node.indexes[E.iterator];return!1}y.walk&&y.proxyOf.nodes?u.push({iterator:y.getIterator(),node:y}):g.indexes[f]+=1}}walkAtRules(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="atrule"&&i.test(f.name))return u(f,g)}):this.walk((f,g)=>{if(f.type==="atrule"&&f.name===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="atrule")return u(f,g)}))}walkComments(i){return this.walk((u,f)=>{if(u.type==="comment")return i(u,f)})}walkDecls(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="decl"&&i.test(f.prop))return u(f,g)}):this.walk((f,g)=>{if(f.type==="decl"&&f.prop===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="decl")return u(f,g)}))}walkRules(i,u){return u?i instanceof RegExp?this.walk((f,g)=>{if(f.type==="rule"&&i.test(f.selector))return u(f,g)}):this.walk((f,g)=>{if(f.type==="rule"&&f.selector===i)return u(f,g)}):(u=i,this.walk((f,g)=>{if(f.type==="rule")return u(f,g)}))}}return o.registerParse=n=>{d=n},o.registerRule=n=>{m=n},o.registerAtRule=n=>{h=n},o.registerRoot=n=>{p=n},Br=o,o.default=o,o.rebuild=n=>{let i=[n];for(;i.length>0;){let u=i.pop();if(u.type==="atrule"?Object.setPrototypeOf(u,h.prototype):u.type==="rule"?Object.setPrototypeOf(u,m.prototype):u.type==="decl"?Object.setPrototypeOf(u,t.prototype):u.type==="comment"?Object.setPrototypeOf(u,e.prototype):u.type==="root"&&Object.setPrototypeOf(u,p.prototype),u[l]=!0,u.nodes)for(let f of u.nodes)i.push(f)}},Br}var Ur,rn;function _i(){if(rn)return Ur;rn=1;let e=We();class t extends e{constructor(s){super(s),this.type="atrule"}append(...s){return this.proxyOf.nodes||(this.nodes=[]),super.append(...s)}prepend(...s){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...s)}}return Ur=t,t.default=t,e.registerAtRule(t),Ur}var Wr,sn;function ki(){if(sn)return Wr;sn=1;let e=We(),t,r;class s extends e{constructor(h){super(L({type:"document"},h)),this.nodes||(this.nodes=[])}toResult(h={}){return new t(new r,this,h).stringify()}}return s.registerLazyResult=l=>{t=l},s.registerProcessor=l=>{r=l},Wr=s,s.default=s,Wr}var $r,nn;function Jl(){if(nn)return $r;nn=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return $r={nanoid:(s=21)=>{let l="",h=s|0;for(;h-- >0;)l+=e[Math.random()*64|0];return l},customAlphabet:(s,l=21)=>(h=l)=>{let d="",p=h|0;for(;p-- >0;)d+=s[Math.random()*s.length|0];return d}},$r}var zr,on;function bo(){if(on)return zr;on=1;let{existsSync:e,readFileSync:t}=be,{dirname:r,isAbsolute:s,join:l,relative:h,sep:d}=be,{SourceMapConsumer:p,SourceMapGenerator:m}=be;function c(o){return Buffer?Buffer.from(o,"base64").toString():window.atob(o)}class a{constructor(n,i){if(i.map===!1)return;i.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(n),this.inline=this.startWith(this.annotation,"data:");let u=i.map?i.map.prev:void 0,f=this.loadMap(i.from,u);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),f&&(this.text=f)}consumer(){return this.consumerCache||(this.consumerCache=new p(this.json||this.text)),this.consumerCache}decodeInline(n){let i=/^data:application\/json;charset=utf-?8;base64,/,u=/^data:application\/json;base64,/,f=/^data:application\/json;charset=utf-?8,/,g=/^data:application\/json,/,S=n.match(f)||n.match(g);if(S)return decodeURIComponent(n.substr(S[0].length));let y=n.match(i)||n.match(u);if(y)return c(n.substr(y[0].length));let b=n.slice(22);throw b=b.slice(0,b.indexOf(",")),new Error("Unsupported source map encoding "+b)}getAnnotationURL(n){return n.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(n){return typeof n!="object"?!1:typeof n.mappings=="string"||typeof n._mappings=="string"||Array.isArray(n.sections)}loadAnnotation(n){let i=n.match(/\/\*\s*# sourceMappingURL=/g);if(!i)return;let u=n.lastIndexOf(i.pop()),f=n.indexOf("*/",u);u>-1&&f>-1&&(this.annotation=this.getAnnotationURL(n.substring(u,f)))}loadFile(n,i,u){if(!u&&!this.unsafeMap){if(!/\.map$/i.test(n))return;if(i){let f=h(r(i),n);if(f===".."||f.startsWith(".."+d)||s(f))return}}if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(n,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let u=i(n);if(u){let f=this.loadFile(u,n,!0);if(!f)throw new Error("Unable to load previous source map: "+u.toString());return f}}else{if(i instanceof p)return m.fromSourceMap(i).toString();if(i instanceof m)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let u=this.annotation;n&&(u=l(r(n),u));let f=this.loadFile(u,n,!1);if(f)try{this.json=JSON.parse(f.replace(/^\)]}'[^\n]*\n/,""))}catch(g){return}return f}}}startWith(n,i){return n?n.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return zr=a,a.default=a,zr}var Vr,an;function Kt(){if(an)return Vr;an=1;let{nanoid:e}=Jl(),{isAbsolute:t,resolve:r}=be,{SourceMapConsumer:s,SourceMapGenerator:l}=be,{fileURLToPath:h,pathToFileURL:d}=be,p=Ai(),m=bo(),c=be,a=Symbol("lineToIndexCache"),o=!!(s&&l),n=!!(r&&t);function i(f){if(f[a])return f[a];let g=f.css.split(`
51
+ `),S=new Array(g.length),y=0;for(let b=0,E=g.length;b<E;b++)S[b]=y,y+=g[b].length+1;return f[a]=S,S}class u{get from(){return this.file||this.id}constructor(g,S={}){if(g===null||typeof g=="undefined"||typeof g=="object"&&!g.toString)throw new Error(`PostCSS received ${g} instead of CSS string`);if(this.css=g.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,S.document&&(this.document=S.document.toString()),S.from&&(!n||/^\w+:\/\//.test(S.from)||t(S.from)?this.file=S.from:this.file=r(S.from)),n&&o){let y=new m(this.css,S);if(y.text){this.map=y;let b=y.consumer().file;!this.file&&b&&(this.file=this.mapResolve(b))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,S,y,b={}){let E,v,w,C,M;if(S&&typeof S=="object"){let x=S,A=y;if(typeof x.offset=="number"){C=x.offset;let T=this.fromOffset(C);S=T.line,y=T.col}else S=x.line,y=x.column,C=this.fromLineAndColumn(S,y);if(typeof A.offset=="number"){w=A.offset;let T=this.fromOffset(w);v=T.line,E=T.col}else v=A.line,E=A.column,w=this.fromLineAndColumn(A.line,A.column)}else if(y)C=this.fromLineAndColumn(S,y);else{C=S;let x=this.fromOffset(C);S=x.line,y=x.col}let R=this.origin(S,y,v,E);return R?M=new p(g,R.endLine===void 0?R.line:{column:R.column,line:R.line},R.endLine===void 0?R.column:{column:R.endColumn,line:R.endLine},R.source,R.file,b.plugin):M=new p(g,v===void 0?S:{column:y,line:S},v===void 0?y:{column:E,line:v},this.css,this.file,b.plugin),M.input={column:y,endColumn:E,endLine:v,endOffset:w,line:S,offset:C,source:this.css},this.file&&(d&&(M.input.url=d(this.file).toString()),M.input.file=this.file),M}fromLineAndColumn(g,S){return i(this)[g-1]+S-1}fromOffset(g){let S=i(this),y=S[S.length-1],b=0;if(g>=y)b=S.length-1;else{let E=S.length-2,v;for(;b<E;)if(v=b+(E-b>>1),g<S[v])E=v-1;else if(g>=S[v+1])b=v+1;else{b=v;break}}return{col:g-S[b]+1,line:b+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,S,y,b){if(!this.map)return!1;let E=this.map.consumer(),v=E.originalPositionFor({column:S-1,line:g});if(!v.source)return!1;let w;if(typeof y=="number"){let x=E.originalPositionFor({column:b-1,line:y});x.source&&(w=x)}let C;t(v.source)?C=d(v.source):C=new URL(v.source,this.map.consumer().sourceRoot||d(this.map.mapFile));let M={column:v.column+1,endColumn:w&&w.column+1,endLine:w&&w.line,line:v.line,url:C.toString()};if(C.protocol==="file:")if(h)M.file=h(C);else throw new Error("file: protocol is not available in this PostCSS build");let R=E.sourceContentFor(v.source);return R&&(M.source=R),M}toJSON(){let g={};for(let S of["hasBOM","css","file","id"])this[S]!=null&&(g[S]=this[S]);return this.map&&(g.map=L({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return Vr=u,u.default=u,c&&c.registerInput&&c.registerInput(u),Vr}var jr,ln;function ct(){if(ln)return jr;ln=1;let e=We(),t,r;class s extends e{constructor(h){super(h),this.type="root",this.nodes||(this.nodes=[])}normalize(h,d,p){let m=new Set;for(let a of Array.isArray(h)?h:[h])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before!="undefined"&&m.add(a.raws);let c=super.normalize(h);if(d){if(p==="prepend")this.nodes.length>1?d.raws.before=this.nodes[1].raws.before:delete d.raws.before;else if(this.first!==d)for(let a of c)m.has(a.raws)||(a.raws.before=d.raws.before)}return c}removeChild(h,d){let p=this.index(h);return!d&&p===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[p].raws.before),super.removeChild(h)}toResult(h={}){return new t(new r,this,h).stringify()}}return s.registerLazyResult=l=>{t=l},s.registerProcessor=l=>{r=l},jr=s,s.default=s,e.registerRoot(s),jr}var qr,un;function vo(){if(un)return qr;un=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
52
+ `," "];return e.split(t,r)},split(t,r,s){let l=[],h="",d=!1,p=0,m=!1,c="",a=!1;for(let o of t)a?a=!1:o==="\\"?a=!0:m?o===c&&(m=!1):o==='"'||o==="'"?(m=!0,c=o):o==="("?p+=1:o===")"?p>0&&(p-=1):p===0&&r.includes(o)&&(d=!0),d?(h!==""&&l.push(h.trim()),h="",d=!1):h+=o;return(s||h!=="")&&l.push(h.trim()),l}};return qr=e,e.default=e,qr}var Gr,cn;function Pi(){if(cn)return Gr;cn=1;let e=We(),t=vo();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(l){let h=this.selector?this.selector.match(/,\s*/):null,d=h?h[0]:","+this.raw("between","beforeOpen");this.selector=l.join(d)}constructor(l){super(l),this.type="rule",this.nodes||(this.nodes=[])}}return Gr=r,r.default=r,e.registerRule(r),Gr}var Hr,hn;function Xl(){if(hn)return Hr;hn=1;let e=_i(),t=Qt(),r=Zt(),s=Kt(),l=bo(),h=ct(),d=Pi();function p(a,o){return a.inputs?a.inputs.map(n=>{let i=se(L({},n),{__proto__:s.prototype});return i.map&&(i.map=se(L({},i.map),{__proto__:l.prototype})),i}):o}function m(a,o,n){let i=L({},a);if(delete i.inputs,delete i.nodes,i.source){let f=i.source,{inputId:g}=f,S=mt(f,["inputId"]);i.source=S,g!=null&&(i.source.input=o[g])}let u;if(i.type==="root")u=new h(i);else if(i.type==="decl")u=new r(i);else if(i.type==="rule")u=new d(i);else if(i.type==="comment")u=new t(i);else if(i.type==="atrule")u=new e(i);else throw new Error("Unknown node type: "+a.type);if(n){u.nodes=n;for(let g of n)g.parent=u}return u}function c(a,o){if(Array.isArray(a))return a.map(u=>c(u));let n,i=[{childIndex:0,children:[],inputs:p(a,o),json:a}];for(;i.length>0;){let u=i[i.length-1],f=u.json.nodes;if(f&&u.childIndex<f.length){let S=f[u.childIndex];u.childIndex+=1,i.push({childIndex:0,children:[],inputs:p(S,u.inputs),json:S});continue}i.pop();let g=m(u.json,u.inputs,f?u.children:void 0);i.length>0?i[i.length-1].children.push(g):n=g}return n}return Hr=c,c.default=c,Hr}var Yr,fn;function So(){if(fn)return Yr;fn=1;let{dirname:e,relative:t,resolve:r,sep:s}=be,{SourceMapConsumer:l,SourceMapGenerator:h}=be,{pathToFileURL:d}=be,p=Kt(),m=!!(l&&h),c=!!(e&&r&&t&&s);class a{constructor(n,i,u,f){this.stringify=n,this.mapOpts=u.map||{},this.root=i,this.opts=u,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;this.isInline()?n="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?n=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?n=this.mapOpts.annotation(this.opts.to,this.root):n=this.outputFile()+".map";let i=`
53
+ `;this.css.includes(`\r
54
+ `)&&(i=`\r
55
+ `),this.css+=i+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let i=this.toUrl(this.path(n.file)),u=n.root||e(n.file),f;this.mapOpts.sourcesContent===!1?(f=new l(n.text),f.sourcesContent&&(f.sourcesContent=null)):f=n.consumer(),this.map.applySourceMap(f,i,this.toUrl(this.path(u)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let n;for(let i=this.root.nodes.length-1;i>=0;i--)n=this.root.nodes[i],n.type==="comment"&&n.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(i)}else if(this.css){let n;for(;(n=this.css.lastIndexOf("/*#"))!==-1;){let i=this.css.indexOf("*/",n+3);if(i===-1)break;for(;n>0&&this.css[n-1]===`
56
+ `;)n--;this.css=this.css.slice(0,n)+this.css.slice(i+2)}}}}generate(){if(this.clearAnnotation(),c&&m&&this.isMap())return this.generateMap();{let n="";return this.stringify(this.root,i=>{n+=i}),[n]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let n=this.previous()[0].consumer();n.file=this.outputFile(),this.map=h.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new h({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new h({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,i=1,u="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(y,b,E)=>{if(this.css+=y,b&&E!=="end"&&(f.generated.line=n,f.generated.column=i-1,b.source&&b.source.start?(f.source=this.sourcePath(b),f.original.line=b.source.start.line,f.original.column=b.source.start.column-1,this.map.addMapping(f)):(f.source=u,f.original.line=1,f.original.column=0,this.map.addMapping(f))),S=y.match(/\n/g),S?(n+=S.length,g=y.lastIndexOf(`
57
+ `),i=y.length-g):i+=y.length,b&&E!=="start"){let v=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==v.last||v.raws.semicolon)&&(b.source&&b.source.end?(f.source=this.sourcePath(b),f.original.line=b.source.end.line,f.original.column=b.source.end.column-1,f.generated.line=n,f.generated.column=i-2,this.map.addMapping(f)):(f.source=u,f.original.line=1,f.original.column=0,f.generated.line=n,f.generated.column=i-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(n=>n.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let n=this.mapOpts.annotation;return typeof n!="undefined"&&n!==!0?!1:this.previous().length?this.previous().some(i=>i.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(n=>n.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute||n.charCodeAt(0)===60||/^\w+:\/\//.test(n))return n;let i=this.memoizedPaths.get(n);if(i)return i;let u=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(u=e(r(u,this.mapOpts.annotation)));let f=t(u,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(n=>{if(n.source&&n.source.input.map){let i=n.source.input.map;this.previousMaps.includes(i)||this.previousMaps.push(i)}});else{let n=new p(this.originalCSS,this.opts);n.map&&this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk(i=>{if(i.source){let u=i.source.input.from;if(u&&!n[u]){n[u]=!0;let f=this.usesFileUrls?this.toFileUrl(u):this.toUrl(this.path(u));this.map.setSourceContent(f,i.source.input.css)}}});else if(this.css){let i=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(i,this.css)}}sourcePath(n){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(n.source.input.from):this.toUrl(this.path(n.source.input.from))}toBase64(n){return Buffer?Buffer.from(n).toString("base64"):window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let i=this.memoizedFileURLs.get(n);if(i)return i;if(d){let u=d(n).toString();return this.memoizedFileURLs.set(n,u),u}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let i=this.memoizedURLs.get(n);if(i)return i;s==="\\"&&(n=n.replace(/\\/g,"/"));let u=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,u),u}}return Yr=a,Yr}var Jr,dn;function Ql(){if(dn)return Jr;dn=1;const e=39,t=34,r=92,s=47,l=10,h=32,d=12,p=9,m=13,c=91,a=93,o=40,n=41,i=123,u=125,f=59,g=42,S=58,y=64,b=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,v=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return Jr=function(M,R={}){let x=M.css.valueOf(),A=R.ignoreErrors,T,G,X,I,ne,P,j,H,F,Z,ue=x.length,O=0,Se=[],ce=[],Te=-1;function Ae(){return O}function Ce(ie){throw M.error("Unclosed "+ie,O)}function ze(){return ce.length===0&&O>=ue}function tt(ie){if(ce.length)return ce.pop();if(O>=ue)return;let me=ie?ie.ignoreUnclosed:!1;switch(T=x.charCodeAt(O),T){case l:case h:case p:case m:case d:{I=O;do I+=1,T=x.charCodeAt(I);while(T===h||T===l||T===p||T===m||T===d);P=["space",x.slice(O,I)],O=I-1;break}case c:case a:case i:case u:case S:case f:case n:{let de=String.fromCharCode(T);P=[de,de,O];break}case o:{if(Z=Se.length?Se.pop()[1]:"",F=x.charCodeAt(O+1),Z==="url"&&F!==e&&F!==t&&F!==h&&F!==l&&F!==p&&F!==d&&F!==m){I=O;do{if(j=!1,I=x.indexOf(")",I+1),I===-1)if(A||me){I=O;break}else Ce("bracket");for(H=I;x.charCodeAt(H-1)===r;)H-=1,j=!j}while(j);P=["brackets",x.slice(O,I+1),O,I],O=I}else O<=Te?P=["(","(",O]:(I=x.indexOf(")",O+1),G=x.slice(O,I+1),I===-1||v.test(G)?(Te=I===-1?ue:I,P=["(","(",O]):(P=["brackets",G,O,I],O=I));break}case e:case t:{ne=T===e?"'":'"',I=O;do{if(j=!1,I=x.indexOf(ne,I+1),I===-1)if(A||me){I=O+1;break}else Ce("string");for(H=I;x.charCodeAt(H-1)===r;)H-=1,j=!j}while(j);P=["string",x.slice(O,I+1),O,I],O=I;break}case y:{b.lastIndex=O+1,b.test(x),b.lastIndex===0?I=x.length-1:I=b.lastIndex-2,P=["at-word",x.slice(O,I+1),O,I],O=I;break}case r:{for(I=O,X=!0;x.charCodeAt(I+1)===r;)I+=1,X=!X;if(T=x.charCodeAt(I+1),X&&T!==s&&T!==h&&T!==l&&T!==p&&T!==m&&T!==d&&(I+=1,w.test(x.charAt(I)))){for(;w.test(x.charAt(I+1));)I+=1;x.charCodeAt(I+1)===h&&(I+=1)}P=["word",x.slice(O,I+1),O,I],O=I;break}default:{T===s&&x.charCodeAt(O+1)===g?(I=x.indexOf("*/",O+2)+1,I===0&&(A||me?I=x.length:Ce("comment")),P=["comment",x.slice(O,I+1),O,I],O=I):(E.lastIndex=O+1,E.test(x),E.lastIndex===0?I=x.length-1:I=E.lastIndex-2,P=["word",x.slice(O,I+1),O,I],Se.push(P),O=I);break}}return O++,P}function pe(ie){ce.push(ie)}return{back:pe,endOfFile:ze,nextToken:tt,position:Ae}},Jr}var Xr,pn;function Zl(){if(pn)return Xr;pn=1;let e=_i(),t=Qt(),r=Zt(),s=ct(),l=Pi(),h=Ql();const d={empty:!0,space:!0};function p(a){for(let o=a.length-1;o>=0;o--){let n=a[o],i=n[3]||n[2];if(i)return i}}function m(a,o,n){let i="";for(let u=o;u<n;u++)i+=a[u][1];return i}class c{constructor(o){this.input=o,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:o,start:{column:1,line:1,offset:0}}}atrule(o){let n=new e;n.name=o[1].slice(1),n.name===""&&this.unnamedAtrule(n,o),this.init(n,o[2]);let i,u,f,g=!1,S=!1,y=[],b=[];for(;!this.tokenizer.endOfFile();){if(o=this.tokenizer.nextToken(),i=o[0],i==="("||i==="["?b.push(i==="("?")":"]"):i==="{"&&b.length>0?b.push("}"):i===b[b.length-1]&&b.pop(),b.length===0)if(i===";"){n.source.end=this.getPosition(o[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){S=!0;break}else if(i==="}"){if(y.length>0){for(f=y.length-1,u=y[f];u&&u[0]==="space";)u=y[--f];u&&(n.source.end=this.getPosition(u[3]||u[2]),n.source.end.offset++)}this.end(o);break}else y.push(o);else y.push(o);if(this.tokenizer.endOfFile()){g=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(n.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(n,"params",y),g&&(o=y[y.length-1],n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),S&&(n.nodes=[],this.current=n)}checkMissedSemicolon(o){let n=this.colon(o);if(n===!1)return;let i=0,u;for(let f=n-1;f>=0&&(u=o[f],!(u[0]!=="space"&&(i+=1,i===2)));f--);throw this.input.error("Missed semicolon",u[0]==="word"?u[3]+1:u[2])}colon(o){let n=0,i,u,f;for(let[g,S]of o.entries()){if(u=S,f=u[0],f==="("&&(n+=1),f===")"&&(n-=1),n===0&&f===":")if(!i)this.doubleColon(u);else{if(i[0]==="word"&&i[1]==="progid")continue;return g}i=u}return!1}comment(o){let n=new t;this.init(n,o[2]),n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++;let i=o[1].slice(2,-2);if(!i.trim())n.text="",n.raws.left=i,n.raws.right="";else{let u=i.match(/^(\s*)([^]*\S)(\s*)$/);n.text=u[2],n.raws.left=u[1],n.raws.right=u[3]}}createTokenizer(){this.tokenizer=h(this.input)}decl(o,n){let i=new r;this.init(i,o[0][2]);let u=o[o.length-1];u[0]===";"&&(this.semicolon=!0,o.pop()),i.source.end=this.getPosition(u[3]||u[2]||p(o)),i.source.end.offset++;let f=0;for(;o[f][0]!=="word";)f===o.length-1&&this.unknownWord([o[f]]),f++;i.raws.before+=m(o,0,f),i.source.start=this.getPosition(o[f][2]);let g=f;for(;f<o.length;){let w=o[f][0];if(w===":"||w==="space"||w==="comment")break;f++}i.prop=m(o,g,f);let S=f,y;for(;f<o.length&&(y=o[f],f++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);i.raws.between=m(o,S,f),(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let b=f;for(;f<o.length;){let w=o[f][0];if(w!=="space"&&w!=="comment")break;f++}let E=o.slice(b,f);o=o.slice(f),this.precheckMissedSemicolon(o);for(let w=o.length-1;w>=0;w--){if(y=o[w],y[1].toLowerCase()==="!important"){i.important=!0;let C=this.stringFrom(o,w);C=this.spacesFromEnd(o)+C,C!==" !important"&&(i.raws.important=C);break}else if(y[1].toLowerCase()==="important"){let C=o.slice(0),M="";for(let R=w;R>0;R--){let x=C[R][0];if(M.trim().startsWith("!")&&x!=="space")break;M=C.pop()[1]+M}M.trim().startsWith("!")&&(i.important=!0,i.raws.important=M,o=C)}if(y[0]!=="space"&&y[0]!=="comment")break}o.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(i.raws.between+=E.map(w=>w[1]).join(""),E=[]),this.raw(i,"value",E.concat(o),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(o)}doubleColon(o){throw this.input.error("Double colon",{offset:o[2]},{offset:o[2]+o[1].length})}emptyRule(o){let n=new l;this.init(n,o[2]),n.selector="",n.raws.between="",this.current=n}end(o){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(o[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(o)}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(o){if(this.spaces+=o[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(o[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(o){let n=this.input.fromOffset(o);return{column:n.col,line:n.line,offset:o}}init(o,n){this.current.push(o),o.source={input:this.input,start:this.getPosition(n)},o.raws.before=this.spaces,this.spaces="",o.type!=="comment"&&(this.semicolon=!1)}other(o){let n=!1,i=null,u=!1,f=null,g=[],S=o[1].startsWith("--"),y=[],b=o;for(;b;){if(i=b[0],y.push(b),i==="("||i==="[")f||(f=b),g.push(i==="("?")":"]");else if(S&&u&&i==="{")f||(f=b),g.push("}");else if(g.length===0)if(i===";")if(u){this.decl(y,S);return}else break;else if(i==="{"){this.rule(y);return}else if(i==="}"){this.tokenizer.back(y.pop()),n=!0;break}else i===":"&&(u=!0);else i===g[g.length-1]&&(g.pop(),g.length===0&&(f=null));b=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),g.length>0&&this.unclosedBracket(f),n&&u){if(!S)for(;y.length&&(b=y[y.length-1][0],!(b!=="space"&&b!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,S)}else this.unknownWord(y)}parse(){let o;for(;!this.tokenizer.endOfFile();)switch(o=this.tokenizer.nextToken(),o[0]){case"space":this.spaces+=o[1];break;case";":this.freeSemicolon(o);break;case"}":this.end(o);break;case"comment":this.comment(o);break;case"at-word":this.atrule(o);break;case"{":this.emptyRule(o);break;default:this.other(o);break}this.endFile()}precheckMissedSemicolon(){}raw(o,n,i,u){let f,g,S=i.length,y="",b=!0,E,v;for(let w=0;w<S;w+=1)f=i[w],g=f[0],g==="space"&&w===S-1&&!u?b=!1:g==="comment"?(v=i[w-1]?i[w-1][0]:"empty",E=i[w+1]?i[w+1][0]:"empty",!d[v]&&!d[E]?y.slice(-1)===","?b=!1:y+=f[1]:b=!1):y+=f[1];if(!b){let w=i.reduce((C,M)=>C+M[1],"");o.raws[n]={raw:w,value:y}}o[n]=y}rule(o){o.pop();let n=new l;this.init(n,o[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(o),this.raw(n,"selector",o),this.current=n}spacesAndCommentsFromEnd(o){let n,i="";for(;o.length&&(n=o[o.length-1][0],!(n!=="space"&&n!=="comment"));)i=o.pop()[1]+i;return i}spacesAndCommentsFromStart(o){let n,i="";for(;o.length&&(n=o[0][0],!(n!=="space"&&n!=="comment"));)i+=o.shift()[1];return i}spacesFromEnd(o){let n,i="";for(;o.length&&(n=o[o.length-1][0],n==="space");)i=o.pop()[1]+i;return i}stringFrom(o,n){let i="";for(let u=n;u<o.length;u++)i+=o[u][1];return o.splice(n,o.length-n),i}unclosedBlock(){let o=this.current.source.start;throw this.input.error("Unclosed block",o.line,o.column)}unclosedBracket(o){throw this.input.error("Unclosed bracket",{offset:o[2]},{offset:o[2]+1})}unexpectedClose(o){throw this.input.error("Unexpected }",{offset:o[2]},{offset:o[2]+1})}unknownWord(o){throw this.input.error("Unknown word "+o[0][1],{offset:o[0][2]},{offset:o[0][2]+o[0][1].length})}unnamedAtrule(o,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}}return Xr=c,Xr}var Qr,mn;function Li(){if(mn)return Qr;mn=1;let e=We(),t=Kt(),r=Zl();function s(l,h){let d=new t(l,h),p=new r(d);try{p.parse()}catch(m){throw m}return p.root}return Qr=s,s.default=s,e.registerParse(s),Qr}var Zr,gn;function Co(){if(gn)return Zr;gn=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let l=s.node.rangeBy(s);this.line=l.start.line,this.column=l.start.column,this.endLine=l.end.line,this.endColumn=l.end.column}for(let l in s)this[l]=s[l]}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}}return Zr=e,e.default=e,Zr}var Kr,yn;function Fi(){if(yn)return Kr;yn=1;let e=Co();class t{get content(){return this.css}constructor(s,l,h){this.processor=s,this.messages=[],this.root=l,this.opts=h,this.css="",this.map=void 0}toString(){return this.css}warn(s,l={}){l.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(l.plugin=this.lastPlugin.postcssPlugin);let h=new e(s,l);return this.messages.push(h),h}warnings(){return this.messages.filter(s=>s.type==="warning")}}return Kr=t,t.default=t,Kr}var ei,wn;function Eo(){if(wn)return ei;wn=1;let e={};return ei=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},ei}var ti,bn;function xo(){if(bn)return ti;bn=1;let e=We(),t=ki(),r=So(),s=Li(),l=Fi(),h=ct(),d=Jt(),{isClean:p,my:m}=Di(),c=Eo();const a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},o={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},n={Once:!0,postcssPlugin:!0,prepare:!0},i=0;function u(E){return typeof E=="object"&&typeof E.then=="function"}function f(E){let v=!1,w=a[E.type];return E.type==="decl"?v=E.prop.toLowerCase():E.type==="atrule"&&(v=E.name.toLowerCase()),v&&E.append?[w,w+"-"+v,i,w+"Exit",w+"Exit-"+v]:v?[w,w+"-"+v,w+"Exit",w+"Exit-"+v]:E.append?[w,i,w+"Exit"]:[w,w+"Exit"]}function g(E){let v;return E.type==="document"?v=["Document",i,"DocumentExit"]:E.type==="root"?v=["Root",i,"RootExit"]:v=f(E),{eventIndex:0,events:v,iterator:0,node:E,visitorIndex:0,visitors:[]}}function S(E){let v=[E];for(;v.length>0;){let w=v.pop();if(w[p]=!1,w.nodes)for(let C of w.nodes)v.push(C)}return E}let y={};class b{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"}constructor(v,w,C){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=S(w);else if(w instanceof b||w instanceof l)M=S(w.root),w.map&&(typeof C.map=="undefined"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=w.map);else{let R=s;C.syntax&&(R=C.syntax.parse),C.parser&&(R=C.parser),R.parse&&(R=R.parse);try{M=R(w,C)}catch(x){this.processed=!0,this.error=x}M&&!M[m]&&e.rebuild(M)}this.result=new l(v,M,C),this.helpers=se(L({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(R=>typeof R=="object"&&R.prepare?L(L({},R),R.prepare(this.result)):R)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,w){let C=this.result.lastPlugin;try{w&&w.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=C.postcssPlugin,v.setMessage()):C.postcssVersion}catch(M){console&&console.error&&console.error(M)}return v}prepareVisitors(){this.listeners={};let v=(w,C,M)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([w,M])};for(let w of this.plugins)if(typeof w=="object")for(let C in w){if(!o[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!n[C])if(typeof w[C]=="object")for(let M in w[C])M==="*"?v(w,C,w[C][M]):v(w,C+"-"+M.toLowerCase(),w[C][M]);else typeof w[C]=="function"&&v(w,C,w[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let w=this.plugins[v],C=this.runOnRoot(w);if(u(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[p];){v[p]=!0;let w=[g(v)];for(;w.length>0;){let C=this.visitTick(w);if(u(C))try{await C}catch(M){let R=w[w.length-1].node;throw this.handleError(M,R)}}}if(this.listeners.OnceExit)for(let[w,C]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(v.type==="document"){let M=v.nodes.map(R=>C(R,this.helpers));await Promise.all(M)}else await C(v,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(C=>v.Once(C,this.helpers));return u(w[0])?Promise.all(w):w}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,w=d;v.syntax&&(w=v.syntax.stringify),v.stringifier&&(w=v.stringifier),w.stringify&&(w=w.stringify);let C=this.result.root.source;if(v.map===void 0&&!(C&&C.input&&C.input.map)){let x="";return w(this.result.root,A=>{x+=A}),this.result.css=x,this.result}let R=new r(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 v of this.plugins){let w=this.runOnRoot(v);if(u(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[p];)v[p]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let w of v.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,w){return this.async().then(v,w)}toString(){return this.css}visitSync(v,w){for(let[C,M]of v){this.result.lastPlugin=C;let R;try{R=M(w,this.helpers)}catch(x){throw this.handleError(x,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(u(R))throw this.getAsyncError()}}visitTick(v){let w=v[v.length-1],{node:C,visitors:M}=w;if(C.type!=="root"&&C.type!=="document"&&!C.parent){v.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[x,A]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=x;try{return A(C.toProxy(),this.helpers)}catch(T){throw this.handleError(T,C)}}if(w.iterator!==0){let x=w.iterator,A;for(;A=C.nodes[C.indexes[x]];)if(C.indexes[x]+=1,!A[p]){A[p]=!0,v.push(g(A));return}w.iterator=0,delete C.indexes[x]}let R=w.events;for(;w.eventIndex<R.length;){let x=R[w.eventIndex];if(w.eventIndex+=1,x===i){C.nodes&&C.nodes.length&&(C[p]=!0,w.iterator=C.getIterator());return}else if(this.listeners[x]){w.visitors=this.listeners[x];return}}v.pop()}walkSync(v){v[p]=!0;let w=[{eventIndex:0,events:f(v),iterator:0,node:v}];for(;w.length>0;){let C=w[w.length-1],M=C.node;if(C.iterator!==0){let R=C.iterator,x,A=!1;for(;x=M.nodes[M.indexes[R]];)if(M.indexes[R]+=1,!x[p]){x[p]=!0,w.push({eventIndex:0,events:f(x),iterator:0,node:x}),A=!0;break}if(A)continue;C.iterator=0,delete M.indexes[R]}if(C.eventIndex<C.events.length){let R=C.events[C.eventIndex];if(C.eventIndex+=1,R===i)M.nodes&&M.nodes.length&&(C.iterator=M.getIterator());else{let x=this.listeners[R];x&&this.visitSync(x,M.toProxy())&&w.pop()}continue}w.pop()}}warnings(){return this.sync().warnings()}}return b.registerPostcss=E=>{y=E},ti=b,b.default=b,h.registerLazyResult(b),t.registerLazyResult(b),ti}var ri,vn;function Kl(){if(vn)return ri;vn=1;let e=So(),t=Li(),r=Fi(),s=Jt(),l=Eo();class h{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 p,m=t;try{p=m(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(p,m,c){m=m.toString(),this.stringified=!1,this._processor=p,this._css=m,this._opts=c,this._map=void 0;let a=s;this.result=new r(this._processor,void 0,this._opts),this.result.css=m;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(a,void 0,this._opts,m);if(n.isMap()){let[i,u]=n.generate();i&&(this.result.css=i),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,m){return this.async().then(p,m)}toString(){return this._css}warnings(){return[]}}return ri=h,h.default=h,ri}var ii,Sn;function eu(){if(Sn)return ii;Sn=1;let e=ki(),t=xo(),r=Kl(),s=ct();class l{constructor(d=[]){this.version="8.5.19",this.plugins=this.normalize(d)}normalize(d){let p=[];for(let m of d)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))p=p.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)p.push(m);else if(typeof m=="function")p.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return p}process(d,p={}){return!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax?new r(this,d,p):new t(this,d,p)}use(d){return this.plugins=this.plugins.concat(this.normalize([d])),this}}return ii=l,l.default=l,s.registerProcessor(l),e.registerProcessor(l),ii}var si,Cn;function tu(){if(Cn)return si;Cn=1;let e=_i(),t=Qt(),r=We(),s=Ai(),l=Zt(),h=ki(),d=Xl(),p=Kt(),m=xo(),c=vo(),a=Xt(),o=Li(),n=eu(),i=Fi(),u=ct(),f=Pi(),g=Jt(),S=Co();function y(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new n(b)}return y.plugin=function(E,v){let w=!1;function C(...R){console&&console.warn&&!w&&(w=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:
58
+ 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:
59
+ https://www.w3ctech.com/topic/2226`));let x=v(...R);return x.postcssPlugin=E,x.postcssVersion=new n().version,x}let M;return Object.defineProperty(C,"postcss",{get(){return M||(M=C()),M}}),C.process=function(R,x,A){return y([C(A)]).process(R,x)},C},y.stringify=g,y.parse=o,y.fromJSON=d,y.list=c,y.comment=b=>new t(b),y.atRule=b=>new e(b),y.decl=b=>new l(b),y.rule=b=>new f(b),y.root=b=>new u(b),y.document=b=>new h(b),y.CssSyntaxError=s,y.Declaration=l,y.Container=r,y.Processor=n,y.Document=h,y.Comment=t,y.Warning=S,y.AtRule=e,y.Result=i,y.Input=p,y.Rule=f,y.Root=u,y.Node=a,m.registerPostcss(y),si=y,y.default=y,si}var ru=tu();const K=jl(ru);K.stringify;K.fromJSON;K.plugin;K.parse;K.list;K.document;K.comment;K.atRule;K.rule;K.decl;K.root;K.CssSyntaxError;K.Declaration;K.Container;K.Processor;K.Document;K.Comment;K.Warning;K.AtRule;K.Result;K.Input;K.Rule;K.Root;K.Node;var W=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(W||{});function iu(e){const t={},r=/;(?![^(]*\))/g,s=/:(.+)/,l=/\/\*.*?\*\//g;return e.replace(l,"").split(r).forEach(function(h){if(h){const d=h.split(s);d.length>1&&(t[di(d[0].trim())]=d[1].trim())}}),t}function En(e){const t=[];for(const r in e){const s=e[r];if(typeof s!="string")continue;const l=au(r);t.push(`${l}: ${s};`)}return t.join(" ")}const su=/-([a-z])/g,nu=/^--[a-zA-Z0-9-]+$/,di=e=>nu.test(e)?e:e.replace(su,(t,r)=>r?r.toUpperCase():""),ou=/\B([A-Z])/g,au=e=>e.replace(ou,"-$1").toLowerCase();class ve{constructor(...t){D(this,"parentElement",null),D(this,"parentNode",null),D(this,"ownerDocument"),D(this,"firstChild",null),D(this,"lastChild",null),D(this,"previousSibling",null),D(this,"nextSibling",null),D(this,"ELEMENT_NODE",1),D(this,"TEXT_NODE",3),D(this,"nodeType"),D(this,"nodeName"),D(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof ve){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class Bi extends ve{constructor(...t){super(t),D(this,"nodeType",9),D(this,"nodeName","#document"),D(this,"compatMode","CSS1Compat"),D(this,"RRNodeType",W.Document),D(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===W.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const r=t.RRNodeType;if((r===W.Element||r===W.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=Ui(this,t);return s.parentElement=null,s}insertBefore(t,r){const s=t.RRNodeType;if((s===W.Element||s===W.DocumentType)&&this.childNodes.some(h=>h.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const l=Oo(this,t,r);return l.parentElement=null,l}removeChild(t){return To(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const s=this.createDocumentType("html",r,"");this.open(),this.appendChild(s)}}createDocument(t,r,s){return new Bi}createDocumentType(t,r,s){const l=new Ro(t,r,s);return l.ownerDocument=this,l}createElement(t){const r=new er(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){const r=new Mo(t);return r.ownerDocument=this,r}createComment(t){const r=new Io(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new No(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}}class Ro extends ve{constructor(t,r,s){super(),D(this,"nodeType",10),D(this,"RRNodeType",W.DocumentType),D(this,"name"),D(this,"publicId"),D(this,"systemId"),D(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=s,this.nodeName=t}toString(){return"RRDocumentType"}}class er extends ve{constructor(t){super(),D(this,"nodeType",1),D(this,"RRNodeType",W.Element),D(this,"tagName"),D(this,"attributes",{}),D(this,"shadowRoot",null),D(this,"scrollLeft"),D(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new cu(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?iu(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(s,l,h)=>{if(r.test(s))return;const d=di(s);l?t[d]=l:delete t[d],h==="important"&&(t[d]+=" !important"),this.attributes.style=En(t)},t.removeProperty=s=>{if(r.test(s))return"";const l=di(s),h=t[l]||"";return delete t[l],this.attributes.style=En(t),h},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,s){this.setAttribute(r,s)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Ui(this,t)}insertBefore(t,r){return Oo(this,t,r)}removeChild(t){return To(this,t)}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}class lu extends er{constructor(){super(...arguments),D(this,"currentTime"),D(this,"volume"),D(this,"paused"),D(this,"muted"),D(this,"playbackRate"),D(this,"loop")}attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class uu extends er{constructor(){super(...arguments),D(this,"tagName","DIALOG"),D(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")}}class Mo extends ve{constructor(t){super(),D(this,"nodeType",3),D(this,"nodeName","#text"),D(this,"RRNodeType",W.Text),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class Io extends ve{constructor(t){super(),D(this,"nodeType",8),D(this,"nodeName","#comment"),D(this,"RRNodeType",W.Comment),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class No extends ve{constructor(t){super(),D(this,"nodeName","#cdata-section"),D(this,"nodeType",4),D(this,"RRNodeType",W.CDATA),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class cu{constructor(t,r){if(D(this,"onChange"),D(this,"classes",[]),D(this,"add",(...s)=>{for(const l of s){const h=String(l);this.classes.indexOf(h)>=0||this.classes.push(h)}this.onChange&&this.onChange(this.classes.join(" "))}),D(this,"remove",(...s)=>{this.classes=this.classes.filter(l=>s.indexOf(l)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const s=t.trim().split(/\s+/);this.classes.push(...s)}this.onChange=r}}function Ui(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Oo(e,t,r){if(!r)return Ui(e,t);if(r.parentNode!==e)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 t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function To(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var fe=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(fe||{});const Et=new Map,xn=new WeakSet;function Rn(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Ao(e){if(xn.has(e))return;xn.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const l=Et.get(e);l&&(l.cancelled=!0);const h=()=>{s.length===2&&Rn(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(Rn(r)&&!r.complete){const d={cancelled:!1};Et.set(e,d);const p=()=>{d.cancelled||(Et.delete(e),h())},m=()=>{if(!d.cancelled){Et.delete(e);try{h()}catch(c){}}};r.onload=p,r.onerror=m}else h()}}Date.now().toString();const pi={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},hu={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"};let Ee=null;function Ft(e,t,r,s=t.mirror||t.ownerDocument.mirror){e=fu(e,t,r,s),Do(e,t,r,s),du(e,t,r)}function fu(e,t,r,s){var l;if(r.afterAppend&&!Ee&&(Ee=new WeakSet,setTimeout(()=>{Ee=null},0)),!Wi(e,t)){const h=Bt(t,r.mirror,s);(l=e.parentNode)==null||l.replaceChild(h,e),e=h}switch(t.RRNodeType){case W.Document:{if(!je(e,t,r.mirror,s)){const h=s.getMeta(t);h&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,h),Ee==null||Ee.add(e))}break}case W.Element:{const h=e,d=t;switch(d.tagName){case"IFRAME":{const p=e.contentDocument;if(!p)break;Ft(p,t.contentDocument,r,s);break}}d.shadowRoot&&(h.shadowRoot||h.attachShadow({mode:"open"}),Do(h.shadowRoot,d.shadowRoot,r,s)),pu(h,d,s);break}}return e}function du(e,t,r){var s;switch(t.RRNodeType){case W.Document:{const l=t.scrollData;l&&r.applyScroll(l,!0);break}case W.Element:{const l=e,h=t;switch(h.scrollData&&r.applyScroll(h.scrollData,!0),h.inputData&&r.applyInput(h.inputData),h.tagName){case"AUDIO":case"VIDEO":{const d=e,p=h;p.paused!==void 0&&(p.paused?d.pause():d.play()),p.muted!==void 0&&(d.muted=p.muted),p.volume!==void 0&&(d.volume=p.volume),p.currentTime!==void 0&&(d.currentTime=p.currentTime),p.playbackRate!==void 0&&(d.playbackRate=p.playbackRate),p.loop!==void 0&&(d.loop=p.loop);break}case"CANVAS":{const d=t;if(d.rr_dataURL!==null){const p=document.createElement("img");p.src=d.rr_dataURL;const m=l.getContext("2d");m&&(Ao(m),m.drawImage(p,0,0))}d.canvasMutations.forEach(p=>r.applyCanvas(p.event,p.mutation,e));break}case"STYLE":{const d=l.sheet;d&&t.rules.forEach(p=>r.applyStyleSheetMutation(p,d));break}case"DIALOG":{const d=l,p=h,m=d.open,c=d.matches("dialog:modal"),a=p.open,o=p.isModal,n=c!==o,i=m!==a;if((n||m&&i)&&d.close(),a&&(i||n))try{o?d.showModal():d.show()}catch(u){console.warn(u)}break}}break}case W.Text:case W.Comment:case W.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}Ee!=null&&Ee.has(e)&&(Ee.delete(e),(s=r.afterAppend)==null||s.call(r,e,r.mirror.getId(e)))}function pu(e,t,r){const s=e.attributes,l=t.attributes;for(const h in l){const d=l[h],p=r.getMeta(t);if(p!=null&&p.isSVG&&pi[h])e.setAttributeNS(pi[h],h,d);else if(t.tagName==="CANVAS"&&h==="rr_dataURL"){const m=document.createElement("img");m.src=d;const c=e.getContext("2d");c&&(Ao(c),c.drawImage(m,0,0))}else{if(t.tagName==="IFRAME"&&h==="srcdoc")continue;try{e.setAttribute(h,d)}catch(m){console.warn(m)}}}for(const{name:h}of Array.from(s))h in l||e.removeAttribute(h);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Do(e,t,r,s){const l=Array.from(e.childNodes),h=t.childNodes;if(l.length===0&&h.length===0)return;let d=0,p=l.length-1,m=0,c=h.length-1,a=l[d],o=l[p],n=h[m],i=h[c],u,f;for(;d<=p&&m<=c;)if(a===void 0)a=l[++d];else if(o===void 0)o=l[--p];else if(je(a,n,r.mirror,s))a=l[++d],n=h[++m];else if(je(o,i,r.mirror,s))o=l[--p],i=h[--c];else if(je(a,i,r.mirror,s)){try{e.insertBefore(a,o.nextSibling)}catch(y){console.warn(y)}a=l[++d],i=h[--c]}else if(je(o,n,r.mirror,s)){try{e.insertBefore(o,a)}catch(y){console.warn(y)}o=l[--p],n=h[++m]}else{if(!u){u={};for(let b=d;b<=p;b++){const E=l[b];E&&r.mirror.hasNode(E)&&(u[r.mirror.getId(E)]=b)}}f=u[s.getId(n)];const y=l[f];if(f!==void 0&&y&&je(y,n,r.mirror,s)){try{e.insertBefore(y,a)}catch(b){console.warn(b)}l[f]=void 0}else{const b=Bt(n,r.mirror,s);e.nodeName==="#document"&&a&&(b.nodeType===b.DOCUMENT_TYPE_NODE&&a.nodeType===a.DOCUMENT_TYPE_NODE||b.nodeType===b.ELEMENT_NODE&&a.nodeType===a.ELEMENT_NODE)&&(e.removeChild(a),r.mirror.removeNodeFromMap(a),a=l[++d]);try{e.insertBefore(b,a||null)}catch(E){console.warn(E)}}n=h[++m]}if(d>p){const y=h[c+1];let b=null;for(y&&(b=r.mirror.getNode(s.getId(y)));m<=c;++m){const E=Bt(h[m],r.mirror,s);try{e.insertBefore(E,b)}catch(v){console.warn(v)}}}else if(m>c)for(;d<=p;d++){const y=l[d];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(b){console.warn(b)}}let g=e.firstChild,S=t.firstChild;for(;g!==null&&S!==null;)Ft(g,S,r,s),g=g.nextSibling,S=S.nextSibling}function Bt(e,t,r){const s=r.getId(e),l=r.getMeta(e);let h=null;if(s>-1&&(h=t.getNode(s)),h!==null&&Wi(h,e))return h;switch(e.RRNodeType){case W.Document:h=new Document;break;case W.DocumentType:h=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case W.Element:{let d=e.tagName.toLowerCase();d=hu[d]||d,l&&"isSVG"in l&&(l!=null&&l.isSVG)?h=document.createElementNS(pi.svg,d):h=document.createElement(e.tagName);break}case W.Text:h=document.createTextNode(e.data);break;case W.Comment:h=document.createComment(e.data);break;case W.CDATA:h=document.createCDATASection(e.data);break}l&&t.add(h,L({},l));try{Ee==null||Ee.add(h)}catch(d){}return h}function Wi(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function je(e,t,r,s){const l=r.getId(e),h=s.getId(t);return l===-1||l!==h?!1:Wi(e,t)}class et extends Bi{constructor(t){super(),D(this,"UNSERIALIZED_STARTING_ID",-2),D(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),D(this,"mirror",Mu()),D(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,s){return new et}createDocumentType(t,r,s){const l=new mu(t,r,s);return l.ownerDocument=this,l}createElement(t){const r=t.toUpperCase();let s;switch(r){case"AUDIO":case"VIDEO":s=new gu(r);break;case"IFRAME":s=new vu(r,this.mirror);break;case"CANVAS":s=new wu(r);break;case"STYLE":s=new bu(r);break;case"DIALOG":s=new yu(r);break;default:s=new tr(r);break}return s.ownerDocument=this,s}createComment(t){const r=new Cu(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Eu(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Su(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const mu=Ro;class tr extends er{constructor(){super(...arguments),D(this,"inputData",null),D(this,"scrollData",null)}}class gu extends lu{}class yu extends uu{}class wu extends tr{constructor(){super(...arguments),D(this,"rr_dataURL",null),D(this,"canvasMutations",[])}getContext(){return null}}class bu extends tr{constructor(){super(...arguments),D(this,"rules",[])}}class vu extends tr{constructor(t,r){super(t),D(this,"contentDocument",new et),this.contentDocument.mirror=r}}const Su=Mo,Cu=Io,Eu=No;function xu(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function _o(e,t,r,s){let l;switch(e.nodeType){case fe.DOCUMENT_NODE:s&&s.nodeName==="IFRAME"?l=s.contentDocument:(l=t,l.compatMode=e.compatMode);break;case fe.DOCUMENT_TYPE_NODE:{const d=e;l=t.createDocumentType(d.name,d.publicId,d.systemId);break}case fe.ELEMENT_NODE:{const d=e,p=xu(d);l=t.createElement(p);const m=l;for(const{name:c,value:a}of Array.from(d.attributes))m.attributes[c]=a;d.scrollLeft&&(m.scrollLeft=d.scrollLeft),d.scrollTop&&(m.scrollTop=d.scrollTop);break}case fe.TEXT_NODE:l=t.createTextNode(e.textContent||"");break;case fe.CDATA_SECTION_NODE:l=t.createCDATASection(e.data);break;case fe.COMMENT_NODE:l=t.createComment(e.textContent||"");break;case fe.DOCUMENT_FRAGMENT_NODE:l=s.attachShadow({mode:"open"});break;default:return null}let h=r.getMeta(e);return t instanceof et&&(h||(h=ko(l,t.unserializedId),r.add(e,h)),t.mirror.add(l,L({},h))),l}function Ru(e,t=Vl(),r=new et){function s(l,h){const d=_o(l,r,t,h);if(d!==null)if((h==null?void 0:h.nodeName)!=="IFRAME"&&l.nodeType!==fe.DOCUMENT_FRAGMENT_NODE&&(h==null||h.appendChild(d),d.parentNode=h,d.parentElement=h),l.nodeName==="IFRAME"){const p=l.contentDocument;p&&s(p,d)}else(l.nodeType===fe.DOCUMENT_NODE||l.nodeType===fe.ELEMENT_NODE||l.nodeType===fe.DOCUMENT_FRAGMENT_NODE)&&(l.nodeType===fe.ELEMENT_NODE&&l.shadowRoot&&s(l.shadowRoot,d),l.childNodes.forEach(p=>s(p,d)))}return s(e,null),r}function Mu(){return new Iu}class Iu{constructor(){D(this,"idNodeMap",new Map),D(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const l=this.nodeMetaMap.get(s);l&&this.nodeMetaMap.set(r,l)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ko(e,t){switch(e.RRNodeType){case W.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case W.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case W.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case W.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const xt=new Map,Mn=new WeakSet;function In(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Po(e){if(Mn.has(e))return;Mn.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const l=xt.get(e);l&&(l.cancelled=!0);const h=()=>{s.length===2&&In(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(In(r)&&!r.complete){const d={cancelled:!1};xt.set(e,d);const p=()=>{d.cancelled||(xt.delete(e),h())},m=()=>{if(!d.cancelled){xt.delete(e);try{h()}catch(c){}}};r.onload=p,r.onerror=m}else h()}}const Nn={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},On={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rt={},Lo={},Nu=()=>!!globalThis.Zone;function $i(e){if(Rt[e])return Rt[e];const t=globalThis[e],r=t.prototype,s=e in Nn?Nn[e]:void 0,l=!!(s&&s.every(p=>{var m,c;return!!((c=(m=Object.getOwnPropertyDescriptor(r,p))==null?void 0:m.get)!=null&&c.toString().includes("[native code]"))})),h=e in On?On[e]:void 0,d=!!(h&&h.every(p=>{var m;return typeof r[p]=="function"&&((m=r[p])==null?void 0:m.toString().includes("[native code]"))}));if(l&&d&&!Nu())return Rt[e]=t.prototype,t.prototype;try{const p=document.createElement("iframe");p.style.display="none",document.body.appendChild(p);const m=p.contentWindow;if(!m)return t.prototype;const c=m[e].prototype;if(!c)return p.remove(),r;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(p.classList.add("rr-block"),p.setAttribute("__rrwebUntaintedMutationObserver",""),Lo[e]=()=>p.remove()):p.remove(),Rt[e]=c}catch(p){return r}}const ni={};function Ne(e,t,r){var s;const l=`${e}.${String(r)}`;if(ni[l])return ni[l].call(t);const h=$i(e),d=(s=Object.getOwnPropertyDescriptor(h,r))==null?void 0:s.get;return d?(ni[l]=d,d.call(t)):t[r]}const oi={};function Fo(e,t,r){const s=`${e}.${String(r)}`;if(oi[s])return oi[s].bind(t);const h=$i(e)[r];return typeof h!="function"?t[r]:(oi[s]=h,h.bind(t))}function Ou(e){return Ne("Node",e,"ownerDocument")}function Tu(e){return Ne("Node",e,"childNodes")}function Au(e){return Ne("Node",e,"parentNode")}function Du(e){return Ne("Node",e,"parentElement")}function _u(e){return Ne("Node",e,"textContent")}function ku(e,t){return Fo("Node",e,"contains")(t)}function Pu(e){return Fo("Node",e,"getRootNode")()}function Lu(e){return!e||!("host"in e)?null:Ne("ShadowRoot",e,"host")}function Fu(e){return e.styleSheets}function Bu(e){return!e||!("shadowRoot"in e)?null:Ne("Element",e,"shadowRoot")}function Uu(e,t){return Ne("Element",e,"querySelector")(t)}function Wu(e,t){return Ne("Element",e,"querySelectorAll")(t)}function Bo(){var e;return[$i("MutationObserver").constructor,(e=Lo.MutationObserver)!=null?e:(()=>{})]}let Ze=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ze=()=>new Date().getTime());function $e(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],l=r(s);return typeof l=="function"&&(l.prototype=l.prototype||{},Object.defineProperties(l,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=l,()=>{e[t]=s}}catch(s){return()=>{}}}const U={ownerDocument:Ou,childNodes:Tu,parentNode:Au,parentElement:Du,textContent:_u,contains:ku,getRootNode:Pu,host:Lu,styleSheets:Fu,shadowRoot:Bu,querySelector:Uu,querySelectorAll:Wu,nowTimestamp:Ze,mutationObserverCtor:Bo,patch:$e,wrapCanvasContextDrawImage:Po};function le(e,t,r=document){const s={capture:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const qe=`Please stop import mirror directly. Instead of that,\r
60
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
61
+ or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(qe),-1},getNode(){return console.error(qe),null},removeNodeFromMap(){console.error(qe)},has(){return console.error(qe),!1},reset(){console.error(qe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(e,t,r){return t==="map"&&console.error(qe),Reflect.get(e,t,r)}}));function Ke(e,t,r={}){let s=null,l=0;return function(...h){const d=Date.now();!l&&r.leading===!1&&(l=d);const p=t-(d-l),m=this;p<=0||p>t?(s&&(clearTimeout(s),s=null),l=d,e.apply(m,h)):!s&&r.trailing!==!1&&(s=setTimeout(()=>{l=r.leading===!1?0:Date.now(),s=null,e.apply(m,h)},p))}}function ht(e,t,r,s,l=window){const h=l.Object.getOwnPropertyDescriptor(e,t);return l.Object.defineProperty(e,t,s?r:{set(d){setTimeout(()=>{r.set.call(this,d)},0),h&&h.set&&h.set.call(this,d)}}),()=>ht(e,t,h||{},!0)}function zi(e){var t,r,s,l;const h=e.document;return{left:h.scrollingElement?h.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:h.documentElement.scrollLeft||(h==null?void 0:h.body)&&((t=U.parentElement(h.body))==null?void 0:t.scrollLeft)||((r=h==null?void 0:h.body)==null?void 0:r.scrollLeft)||0,top:h.scrollingElement?h.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(h==null?void 0:h.documentElement.scrollTop)||(h==null?void 0:h.body)&&((s=U.parentElement(h.body))==null?void 0:s.scrollTop)||((l=h==null?void 0:h.body)==null?void 0:l.scrollTop)||0}}function Vi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ji(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function qi(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}const Uo=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch(t){return!1}return!1};function oe(e,t,r,s){if(!e)return!1;const l=qi(e);if(!l)return!1;try{if(typeof t=="string"){if(l.classList.contains(t)||s&&l.closest("."+t)!==null)return!0}else if(Lt(l,t,s))return!0}catch(h){}return!!(r&&(l.matches(r)||s&&l.closest(r)!==null))}function Wo(e,t){return t.getId(e)!==-1}function Tt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===lt}function Gi(e,t){if(it(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=U.parentNode(e);return s&&s.nodeType===e.DOCUMENT_NODE?!1:s?Gi(s,t):!0}function Ut(e){return!!e.changedTouches}function Hi(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function $o(e){const t={},r=(l,h)=>{const d={value:l,parent:h,children:[]};return t[l.node.id]=d,d},s=[];for(const l of e){const{nextId:h,parentId:d}=l;if(h&&h in t){const p=t[h];if(p.parent){const m=p.parent.children.indexOf(p);p.parent.children.splice(m,0,r(l,p.parent))}else{const m=s.indexOf(p);s.splice(m,0,r(l,null))}continue}if(d in t){const p=t[d];p.children.push(r(l,p));continue}s.push(r(l,null))}return s}function Yi(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Yi(e.children[r],t)}function Qe(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ji(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Xi(e,t){var r,s;const l=(s=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:s.frameElement;if(!l||l===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const h=l.getBoundingClientRect(),d=Xi(l,t),p=h.height/l.clientHeight;return{x:h.x*d.relativeScale+d.x,y:h.y*d.relativeScale+d.y,relativeScale:p,absoluteScale:d.absoluteScale*p}}function ke(e){return e?e instanceof ve&&"shadowRoot"in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}function Ye(e,t){const r=e==null?void 0:e[t[0]];return r?t.length===1?r:Ye(r.cssRules,t.slice(1)):null}function mi(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function zo(e){const t=new Set,r=[];for(let s=e.length;s--;){const l=e[s];t.has(l.id)||(r.push(l),t.add(l.id))}return r}class Qi{constructor(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let s;return r===void 0?s=this.id++:s=r,this.styleIDMap.set(t,s),this.idStyleMap.set(s,t),s}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Zi(e){var t;let r=null;return"getRootNode"in e&&((t=U.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(r=U.host(U.getRootNode(e))),r}function Vo(e){let t=e,r;for(;r=Zi(t);)t=r;return t}function jo(e){const t=U.ownerDocument(e);if(!t)return!1;const r=Vo(e);return U.contains(t,r)}function Ki(e){const t=U.ownerDocument(e);return t?U.contains(t,e)||jo(e):!1}const $u=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Qi,get _mirror(){return exports.mirror},closestElementOfNode:qi,getBaseDimension:Xi,getNestedRule:Ye,getPositionsAndIndex:mi,getRootShadowHost:Vo,getShadowHost:Zi,getWindowHeight:Vi,getWindowScroll:zi,getWindowWidth:ji,hasShadowRoot:ke,hookSetter:ht,inDom:Ki,isAncestorRemoved:Gi,isBlocked:oe,isCanvasNode:Uo,isIgnored:Tt,isSerialized:Wo,isSerializedIframe:Qe,isSerializedStylesheet:Ji,iterateResolveTree:Yi,legacy_isTouchEvent:Ut,get nowTimestamp(){return Ze},on:le,polyfill:Hi,queueToResolveTrees:$o,shadowHostInDom:jo,throttle:Ke,uniqueTextMutations:zo},Symbol.toStringTag,{value:"Module"}));var k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(k||{}),_=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(_||{}),V=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(V||{}),xe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(xe||{}),Me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Me||{}),_e=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(_e||{}),$=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))($||{}),Re=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Re||{});function Tn(e){return"__ln"in e}class zu{constructor(){N(this,"length",0),N(this,"head",null),N(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let s=0;s<t;s++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Tn(t.previousSibling)){const s=t.previousSibling.__ln.next;r.next=s,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,s&&(s.previous=r)}else if(t.nextSibling&&Tn(t.nextSibling)&&t.nextSibling.__ln.previous){const s=t.nextSibling.__ln.previous;r.previous=s,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,s&&(s.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const An=(e,t)=>`${e}@${t}`;class Vu{constructor(){N(this,"frozen",!1),N(this,"locked",!1),N(this,"texts",[]),N(this,"attributes",[]),N(this,"attributeMap",new WeakMap),N(this,"removes",[]),N(this,"mapRemoves",[]),N(this,"movedMap",{}),N(this,"addedSet",new Set),N(this,"movedSet",new Set),N(this,"droppedSet",new Set),N(this,"removesSubTreeCache",new Set),N(this,"mutationCb"),N(this,"blockClass"),N(this,"blockSelector"),N(this,"maskTextClass"),N(this,"maskTextSelector"),N(this,"inlineStylesheet"),N(this,"maskInputOptions"),N(this,"maskTextFn"),N(this,"maskInputFn"),N(this,"keepIframeSrcFn"),N(this,"recordCanvas"),N(this,"inlineImages"),N(this,"inlineVideos"),N(this,"privacySetting"),N(this,"slimDOMOptions"),N(this,"dataURLOptions"),N(this,"doc"),N(this,"mirror"),N(this,"iframeManager"),N(this,"stylesheetManager"),N(this,"shadowDomManager"),N(this,"canvasManager"),N(this,"processedNodeManager"),N(this,"unattachedDoc"),N(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),N(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,s=new zu,l=m=>{let c=m,a=lt;for(;a===lt;)c=c&&c.nextSibling,a=c&&this.mirror.getId(c);return a},h=m=>{const c=U.parentNode(m);if(!c||!Ki(m))return;let a=!1;if(m.nodeType===Node.TEXT_NODE){const u=c.tagName;if(u==="TEXTAREA")return;u==="STYLE"&&this.addedSet.has(c)&&(a=!0)}const o=it(c)?this.mirror.getId(Zi(m)):this.mirror.getId(c),n=l(m);if(o===-1||n===-1)return s.addNode(m);const i=He(m,{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,inlineVideos:this.inlineVideos,privacySetting:this.privacySetting,onSerialize:u=>{Qe(u,this.mirror)&&this.iframeManager.addIframe(u),Ji(u,this.mirror)&&this.stylesheetManager.trackLinkElement(u),ke(m)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(m),this.doc)},onIframeLoad:(u,f)=>{this.iframeManager.attachIframe(u,f),this.shadowDomManager.observeAttachShadow(u)},onStylesheetLoad:(u,f)=>{this.stylesheetManager.attachLinkElement(u,f)},cssCaptured:a});i&&(t.push({parentId:o,nextId:n,node:i}),r.add(i.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const m of this.movedSet)Dn(this.removesSubTreeCache,m,this.mirror)&&!this.movedSet.has(U.parentNode(m))||h(m);for(const m of this.addedSet)!_n(this.droppedSet,m)&&!Dn(this.removesSubTreeCache,m,this.mirror)||_n(this.movedSet,m)?h(m):this.droppedSet.add(m);let d=null;for(;s.length;){let m=null;if(d){const c=this.mirror.getId(U.parentNode(d.value)),a=l(d.value);c!==-1&&a!==-1&&(m=d)}if(!m){let c=s.tail;for(;c;){const a=c;if(c=c.previous,a){const o=this.mirror.getId(U.parentNode(a.value));if(l(a.value)===-1)continue;if(o!==-1){m=a;break}else{const i=a.value,u=U.parentNode(i);if(u&&u.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const f=U.host(u);if(this.mirror.getId(f)!==-1){m=a;break}}}}}}if(!m){for(;s.head;)s.removeNode(s.head.value);break}d=m.previous,s.removeNode(m.value),h(m.value)}const p={texts:this.texts.map(m=>{var c,a;const o=m.node,n=U.parentNode(o);n&&n.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(n);let i=m.value;const u=this.privacySetting==="strict",f=this.privacySetting==="default"&&ro(i),g=(a=(c=m.node)==null?void 0:c.parentElement)==null?void 0:a.getAttribute("data-hl-record");return(u||f)&&!g&&i&&(i=Ci(i)),{id:this.mirror.getId(o),value:i}}).filter(m=>!r.has(m.id)).filter(m=>this.mirror.has(m.id)),attributes:this.attributes.map(m=>{const{attributes:c}=m;if(typeof c.style=="string"){const a=JSON.stringify(m.styleDiff),o=JSON.stringify(m._unchangedStyles);a.length<c.style.length&&(a+o).split("var(").length===c.style.split("var(").length&&(c.style=m.styleDiff)}return{id:this.mirror.getId(m.node),attributes:c}}).filter(m=>!r.has(m.id)).filter(m=>this.mirror.has(m.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.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(p))}),N(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));const s=Array.from(U.childNodes(t),l=>U.textContent(l)||"").join("");r.attributes.value=_t({overwriteRecord:null,element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kt(t),value:s,maskInputFn:this.maskInputFn})}),N(this,"processMutation",t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=U.textContent(t.target);!oe(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:ao(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,qi(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let s=t.attributeName,l=t.target.getAttribute(s);if(s==="value"){const d=kt(r);l=_t({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:d,value:l,overwriteRecord:r.getAttribute("data-hl-record"),maskInputFn:this.maskInputFn})}if(oe(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let h=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(l))if(!r.contentDocument)s="rr_src";else return;if(h||(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(h),this.attributeMap.set(t.target,h)),s==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!oo(r.tagName,s)){if(t.target.tagName==="INPUT"){const p=t.target;if(p.type==="password"){h.attributes.value="*".repeat(p.value.length);break}}if(h.attributes[s]=no(this.doc,Be(r.tagName),Be(s),l),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(m){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");t.oldValue&&p.setAttribute("style",t.oldValue);for(const m of Array.from(r.style)){const c=r.style.getPropertyValue(m),a=r.style.getPropertyPriority(m);c!==p.style.getPropertyValue(m)||a!==p.style.getPropertyPriority(m)?a===""?h.styleDiff[m]=c:h.styleDiff[m]=[c,a]:h._unchangedStyles[m]=[c,a]}for(const m of Array.from(p.style))r.style.getPropertyValue(m)===""&&(h.styleDiff[m]=!1)}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?h.attributes.rr_open_mode="modal":h.attributes.rr_open_mode="non-modal")}break}case"childList":{if(oe(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const s=this.mirror.getId(r),l=it(t.target)?this.mirror.getId(U.host(t.target)):this.mirror.getId(t.target);oe(t.target,this.blockClass,this.blockSelector,!1)||Tt(r,this.mirror,this.slimDOMOptions)||!Wo(r,this.mirror)||(this.addedSet.has(r)?(gi(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||Gi(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[An(s,l)]?gi(this.movedSet,r):(this.removes.push({parentId:l,id:s,isShadow:it(t.target)&&st(t.target)?!0:void 0}),ju(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),N(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let s=null;r&&this.mirror.hasNode(r)&&(s=this.mirror.getId(r)),s&&s!==-1&&(this.movedMap[An(this.mirror.getId(t),s)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass,this.blockSelector,!1)||(U.childNodes(t).forEach(s=>this.genAdds(s)),ke(t)&&U.childNodes(U.shadowRoot(t)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","inlineVideos","privacySetting","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function gi(e,t){e.delete(t),U.childNodes(t).forEach(r=>gi(e,r))}function ju(e,t){const r=[e];for(;r.length;){const s=r.pop();t.has(s)||(t.add(s),U.childNodes(s).forEach(l=>r.push(l)))}}function Dn(e,t,r){return e.size===0?!1:qu(e,t)}function qu(e,t,r){const s=U.parentNode(t);return s?e.has(s):!1}function _n(e,t){return e.size===0?!1:qo(e,t)}function qo(e,t){const r=U.parentNode(t);return r?e.has(r)?!0:qo(e,r):!1}let ot;function Gu(e){ot=e}function Hu(){ot=void 0}const z=e=>ot?((...r)=>{try{return e(...r)}catch(s){if(ot&&ot(s)===!0)return;throw s}}):e,Fe=[];function ft(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Go(e,t){const r=new Vu;Fe.push(r),r.init(e);const[s,l]=Bo(),h=new s(z(r.processMutations.bind(r)));return h.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[h,l]}function Yu({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(t.mousemove===!1)return()=>{};const l=typeof t.mousemove=="number"?t.mousemove:50,h=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let d=[],p;const m=Ke(z(o=>{const n=Date.now()-p;e(d.map(i=>(i.timeOffset-=n,i)),o),d=[],p=null}),h),c=z(Ke(z(o=>{const n=ft(o),{clientX:i,clientY:u}=Ut(o)?o.changedTouches[0]:o;p||(p=Ze()),d.push({x:i,y:u,id:s.getId(n),timeOffset:Ze()-p}),m(typeof DragEvent!="undefined"&&o instanceof DragEvent?_.Drag:o instanceof MouseEvent?_.MouseMove:_.TouchMove)}),l,{trailing:!1})),a=[le("mousemove",c,r),le("touchmove",c,r),le("drag",c,r)];return z(()=>{a.forEach(o=>o())})}function Ju({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:l,sampling:h}){if(h.mouseInteraction===!1)return()=>{};const d=h.mouseInteraction===!0||h.mouseInteraction===void 0?{}:h.mouseInteraction,p=[];let m=null;const c=a=>o=>{const n=ft(o);if(oe(n,s,l,!0)||Uo(n))return;let i=null,u=a;if("pointerType"in o){switch(o.pointerType){case"mouse":i=xe.Mouse;break;case"touch":i=xe.Touch;break;case"pen":i=xe.Pen;break}i===xe.Touch?V[a]===V.MouseDown?u="TouchStart":V[a]===V.MouseUp&&(u="TouchEnd"):xe.Pen}else Ut(o)&&(i=xe.Touch);i!==null?(m=i,(u.startsWith("Touch")&&i===xe.Touch||u.startsWith("Mouse")&&i===xe.Mouse)&&(i=null)):V[a]===V.Click&&(i=m,m=null);const f=Ut(o)?o.changedTouches[0]:o;if(!f)return;const g=r.getId(n),{clientX:S,clientY:y}=f;z(e)(L({type:V[u],id:g,x:S,y},i!==null&&{pointerType:i}))};return Object.keys(V).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&d[a]!==!1).forEach(a=>{let o=Be(a);const n=c(a);if(window.PointerEvent)switch(V[a]){case V.MouseDown:case V.MouseUp:o=o.replace("mouse","pointer");break;case V.TouchStart:case V.TouchEnd:return}p.push(le(o,n,t))}),z(()=>{p.forEach(a=>a())})}function Ho({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:l,sampling:h}){const d=z(Ke(z(p=>{const m=ft(p);if(!m||oe(m,s,l,!0))return;const c=r.getId(m);if(m===t&&t.defaultView){const a=zi(t.defaultView);e({id:c,x:a.left,y:a.top})}else e({id:c,x:m.scrollLeft,y:m.scrollTop})}),h.scroll||100));return le("scroll",d,t)}function Xu({viewportResizeCb:e},{win:t}){let r=-1,s=-1;const l=z(Ke(z(()=>{const h=Vi(),d=ji();(r!==h||s!==d)&&(e({width:Number(d),height:Number(h)}),r=h,s=d)}),200));return le("resize",l,t)}const Qu=["INPUT","TEXTAREA","SELECT"],kn=new WeakMap;function Zu({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:l,ignoreClass:h,ignoreSelector:d,maskInputOptions:p,maskInputFn:m,sampling:c,userTriggeredOnInput:a}){function o(y){let b=ft(y);const E=y.isTrusted,v=b&&b.tagName;if(b&&v==="OPTION"&&(b=U.parentElement(b)),!b||!v||Qu.indexOf(v)<0||oe(b,s,l,!0)||b.classList.contains(h)||d&&b.matches(d))return;let w=b.value,C=!1;const M=kt(b)||"",R=b.getAttribute("data-hl-record");M==="radio"||M==="checkbox"?C=b.checked:io({maskInputOptions:p,type:M,tagName:v,overwriteRecord:R})&&(w=_t({element:b,maskInputOptions:p,tagName:v,type:M,value:w,overwriteRecord:R,maskInputFn:m})),n(b,a?{text:w,isChecked:C,userTriggered:E}:{text:w,isChecked:C});const x=b.name;M==="radio"&&x&&C&&t.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(A=>{if(A!==b){const T=A.value;n(A,a?{text:T,isChecked:!C,userTriggered:!1}:{text:T,isChecked:!C})}})}function n(y,b){const E=kn.get(y);if(!E||E.text!==b.text||E.isChecked!==b.isChecked){kn.set(y,b);const v=r.getId(y);z(e)(se(L({},b),{id:v}))}}const u=(c.input==="last"?["change"]:["input","change"]).map(y=>le(y,z(o),t)),f=t.defaultView;if(!f)return()=>{u.forEach(y=>y())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),S=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&u.push(...S.map(y=>ht(y[0],y[1],{set(){z(o)({target:this,isTrusted:!1})}},!1,f))),z(()=>{u.forEach(y=>y())})}function Wt(e){const t=[];function r(s,l){if(Mt("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Mt("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Mt("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Mt("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const d=Array.from(s.parentRule.cssRules).indexOf(s);return l.unshift(d),r(s.parentRule,l)}else if(s.parentStyleSheet){const d=Array.from(s.parentStyleSheet.cssRules).indexOf(s);l.unshift(d)}return l}return r(e,t)}function De(e,t,r){let s,l;return e?(e.ownerNode?s=t.getId(e.ownerNode):l=r.getId(e),{styleId:l,id:s}):{}}function Ku({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const l=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(l,{apply:z((a,o,n)=>{const[i,u]=n,{id:f,styleId:g}=De(o,t,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&e({id:f,styleId:g,adds:[{rule:i,index:u}]}),a.apply(o,n)})}),s.CSSStyleSheet.prototype.addRule=function(a,o,n=this.cssRules.length){const i=`${a} { ${o} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:z((a,o,n)=>{const[i]=n,{id:u,styleId:f}=De(o,t,r.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,removes:[{index:i}]}),a.apply(o,n)})}),s.CSSStyleSheet.prototype.removeRule=function(a){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[a])};let d;s.CSSStyleSheet.prototype.replace&&(d=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(d,{apply:z((a,o,n)=>{const[i]=n,{id:u,styleId:f}=De(o,t,r.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,replace:i}),a.apply(o,n)})}));let p;s.CSSStyleSheet.prototype.replaceSync&&(p=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(p,{apply:z((a,o,n)=>{const[i]=n,{id:u,styleId:f}=De(o,t,r.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,replaceSync:i}),a.apply(o,n)})}));const m={};It("CSSGroupingRule")?m.CSSGroupingRule=s.CSSGroupingRule:(It("CSSMediaRule")&&(m.CSSMediaRule=s.CSSMediaRule),It("CSSConditionRule")&&(m.CSSConditionRule=s.CSSConditionRule),It("CSSSupportsRule")&&(m.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(m).forEach(([a,o])=>{c[a]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[a].insertRule,{apply:z((n,i,u)=>{const[f,g]=u,{id:S,styleId:y}=De(i.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||y&&y!==-1)&&e({id:S,styleId:y,adds:[{rule:f,index:[...Wt(i),g||0]}]}),n.apply(i,u)})}),o.prototype.deleteRule=new Proxy(c[a].deleteRule,{apply:z((n,i,u)=>{const[f]=u,{id:g,styleId:S}=De(i.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...Wt(i),f]}]}),n.apply(i,u)})})}),z(()=>{s.CSSStyleSheet.prototype.insertRule=l,s.CSSStyleSheet.prototype.deleteRule=h,d&&(s.CSSStyleSheet.prototype.replace=d),p&&(s.CSSStyleSheet.prototype.replaceSync=p),Object.entries(m).forEach(([a,o])=>{o.prototype.insertRule=c[a].insertRule,o.prototype.deleteRule=c[a].deleteRule})})}function Yo({mirror:e,stylesheetManager:t},r){var s,l,h;let d=null;r.nodeName==="#document"?d=e.getId(r):d=e.getId(U.host(r));const p=r.nodeName==="#document"?(s=r.defaultView)==null?void 0:s.Document:(h=(l=r.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.ShadowRoot,m=p!=null&&p.prototype?Object.getOwnPropertyDescriptor(p==null?void 0:p.prototype,"adoptedStyleSheets"):void 0;return d===null||d===-1||!p||!m?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:m.configurable,enumerable:m.enumerable,get(){var c;return(c=m.get)==null?void 0:c.call(this)},set(c){var a;const o=(a=m.set)==null?void 0:a.call(this,c);if(d!==null&&d!==-1)try{t.adoptStyleSheets(c,d)}catch(n){}return o}}),z(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:m.configurable,enumerable:m.enumerable,get:m.get,set:m.set})}))}function ec({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:l}){const h=l.CSSStyleDeclaration.prototype.setProperty;l.CSSStyleDeclaration.prototype.setProperty=new Proxy(h,{apply:z((p,m,c)=>{var a;const[o,n,i]=c;if(r.has(o))return h.apply(m,[o,n,i]);const{id:u,styleId:f}=De((a=m.parentRule)==null?void 0:a.parentStyleSheet,t,s.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,set:{property:o,value:n,priority:i},index:Wt(m.parentRule)}),p.apply(m,c)})});const d=l.CSSStyleDeclaration.prototype.removeProperty;return l.CSSStyleDeclaration.prototype.removeProperty=new Proxy(d,{apply:z((p,m,c)=>{var a;const[o]=c;if(r.has(o))return d.apply(m,[o]);const{id:n,styleId:i}=De((a=m.parentRule)==null?void 0:a.parentStyleSheet,t,s.styleMirror);return(n&&n!==-1||i&&i!==-1)&&e({id:n,styleId:i,remove:{property:o},index:Wt(m.parentRule)}),p.apply(m,c)})}),z(()=>{l.CSSStyleDeclaration.prototype.setProperty=h,l.CSSStyleDeclaration.prototype.removeProperty=d})}function tc({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:l,doc:h}){const d=z(m=>Ke(z(c=>{const a=ft(c);if(!a||oe(a,t,r,!0))return;const{currentTime:o,volume:n,muted:i,playbackRate:u,loop:f}=a;e({type:m,id:s.getId(a),currentTime:o,volume:n,muted:i,playbackRate:u,loop:f})}),l.media||500)),p=[le("play",d(_e.Play),h),le("pause",d(_e.Pause),h),le("seeked",d(_e.Seeked),h),le("volumechange",d(_e.VolumeChange),h),le("ratechange",d(_e.RateChange),h)];return z(()=>{p.forEach(m=>m())})}function rc({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],l=new WeakMap,h=r.FontFace;r.FontFace=function(m,c,a){const o=new h(m,c,a);return l.set(o,{family:m,buffer:typeof c!="string",descriptors:a,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),o};const d=$e(t.fonts,"add",function(p){return function(m){return setTimeout(z(()=>{const c=l.get(m);c&&(e(c),l.delete(m))}),0),p.apply(this,[m])}});return s.push(()=>{r.FontFace=h}),s.push(d),z(()=>{s.forEach(p=>p())})}function ic(e){const{doc:t,mirror:r,blockClass:s,blockSelector:l,selectionCb:h}=e;let d=!0;const p=z(()=>{const m=t.getSelection();if(!m||d&&(m!=null&&m.isCollapsed))return;d=m.isCollapsed||!1;const c=[],a=m.rangeCount||0;for(let o=0;o<a;o++){const n=m.getRangeAt(o),{startContainer:i,startOffset:u,endContainer:f,endOffset:g}=n;oe(i,s,l,!0)||oe(f,s,l,!0)||c.push({start:r.getId(i),startOffset:u,end:r.getId(f),endOffset:g})}h({ranges:c})});return p(),le("selectionchange",p)}function sc({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:$e(r.customElements,"define",function(l){return function(h,d,p){try{t({define:{name:h}})}catch(m){console.warn(`Custom element callback failed for ${h}`)}return l.apply(this,[h,d,p])}})}function nc(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:l,scrollCb:h,viewportResizeCb:d,inputCb:p,mediaInteractionCb:m,styleSheetRuleCb:c,styleDeclarationCb:a,canvasMutationCb:o,fontCb:n,selectionCb:i,customElementCb:u}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),s(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),l(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),h(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),d(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),p(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),m(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),a(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),o(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),n(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),i(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),u(...f)}}function oc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};nc(e,t);let s,l=()=>{};e.recordDOM&&([s,l]=Go(e,e.doc));const h=Yu(e),d=Ju(e),p=Ho(e),m=Xu(e,{win:r}),c=Zu(e),a=tc(e);let o=()=>{},n=()=>{},i=()=>{},u=()=>{};e.recordDOM&&(o=Ku(e,{win:r}),n=Yo(e,e.doc),i=ec(e,{win:r}),e.collectFonts&&(u=rc(e)));const f=ic(e),g=sc(e),S=[];for(const y of e.plugins)S.push(y.observer(y.callback,r,y.options));return z(()=>{Fe.forEach(y=>y.reset()),s==null||s.disconnect(),l(),h(),d(),p(),m(),c(),a(),o(),n(),i(),u(),f(),g(),S.forEach(y=>y())})}function Mt(e){return typeof window[e]!="undefined"}function It(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pn{constructor(t){N(this,"iframeIdToRemoteIdMap",new WeakMap),N(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,s,l){const h=s||this.getIdToRemoteIdMap(t),d=l||this.getRemoteIdToIdMap(t);let p=h.get(r);return p||(p=this.generateIdFn(),h.set(r,p),d.set(p,r)),p}getIds(t,r){const s=this.getIdToRemoteIdMap(t),l=this.getRemoteIdToIdMap(t);return r.map(h=>this.getId(t,h,s,l))}getRemoteId(t,r,s){const l=s||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const h=l.get(r);return h||-1}getRemoteIds(t,r){const s=this.getRemoteIdToIdMap(t);return r.map(l=>this.getRemoteId(t,l,s))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class ac{constructor(t){N(this,"iframes",new WeakMap),N(this,"crossOriginIframeMap",new WeakMap),N(this,"crossOriginIframeMirror",new Pn(so)),N(this,"crossOriginIframeStyleMirror"),N(this,"crossOriginIframeRootIdMap",new WeakMap),N(this,"mirror"),N(this,"mutationCb"),N(this,"wrappedEmit"),N(this,"loadListener"),N(this,"stylesheetManager"),N(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var s,l;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(l=this.loadListener)==null||l.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin)return;const s=t.source;if(!s)return;const l=this.crossOriginIframeMap.get(s);if(!l)return;const h=this.transformCrossOriginEvent(l,r.data.event);h&&this.wrappedEmit(h,r.data.isCheckout)}transformCrossOriginEvent(t,r){var s;switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const l=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,l),this.patchRootIdOnNode(r.data.node,l),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:_.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case _.Mutation:return r.data.adds.forEach(l=>{this.replaceIds(l,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(l.node,t);const h=this.crossOriginIframeRootIdMap.get(t);h&&this.patchRootIdOnNode(l.node,h)}),r.data.removes.forEach(l=>{this.replaceIds(l,t,["parentId","id"])}),r.data.attributes.forEach(l=>{this.replaceIds(l,t,["id"])}),r.data.texts.forEach(l=>{this.replaceIds(l,t,["id"])}),r;case _.Drag:case _.TouchMove:case _.MouseMove:return r.data.positions.forEach(l=>{this.replaceIds(l,t,["id"])}),r;case _.ViewportResize:return!1;case _.MediaInteraction:case _.MouseInteraction:case _.Scroll:case _.CanvasMutation:case _.Input:return this.replaceIds(r.data,t,["id"]),r;case _.StyleSheetRule:case _.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case _.Font:return r;case _.Selection:return r.data.ranges.forEach(l=>{this.replaceIds(l,t,["start","end"])}),r;case _.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(s=r.data.styles)==null||s.forEach(l=>{this.replaceStyleIds(l,t,["styleId"])}),r}}return!1}replace(t,r,s,l){for(const h of l)!Array.isArray(r[h])&&typeof r[h]!="number"||(Array.isArray(r[h])?r[h]=t.getIds(s,r[h]):r[h]=t.getId(s,r[h]));return r}replaceIds(t,r,s){return this.replace(this.crossOriginIframeMirror,t,r,s)}replaceStyleIds(t,r,s){return this.replace(this.crossOriginIframeStyleMirror,t,r,s)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(s=>{this.replaceIdOnNode(s,r)})}patchRootIdOnNode(t,r){t.type!==Re.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(s=>{this.patchRootIdOnNode(s,r)})}}class lc{constructor(t){N(this,"shadowDoms",new WeakSet),N(this,"mutationCb"),N(this,"scrollCb"),N(this,"bypassOptions"),N(this,"mirror"),N(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!st(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const[s]=Go(se(L({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Ho(se(L({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(U.host(t))),this.restoreHandlers.push(Yo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const s=this;this.restoreHandlers.push($e(t.prototype,"attachShadow",function(l){return function(h){const d=l.call(this,h),p=U.shadowRoot(this);return p&&Ki(this)&&s.addShadowRoot(p,r),d}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Nt=0;Nt<Je.length;Nt++)rt[Je.charCodeAt(Nt)]=Nt;var uc=function(e){var t=new Uint8Array(e),r,s=t.length,l="";for(r=0;r<s;r+=3)l+=Je[t[r]>>2],l+=Je[(t[r]&3)<<4|t[r+1]>>4],l+=Je[(t[r+1]&15)<<2|t[r+2]>>6],l+=Je[t[r+2]&63];return s%3===2?l=l.substring(0,l.length-1)+"=":s%3===1&&(l=l.substring(0,l.length-2)+"=="),l},cc=function(e){var t=e.length*.75,r=e.length,s,l=0,h,d,p,m;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),a=new Uint8Array(c);for(s=0;s<r;s+=4)h=rt[e.charCodeAt(s)],d=rt[e.charCodeAt(s+1)],p=rt[e.charCodeAt(s+2)],m=rt[e.charCodeAt(s+3)],a[l++]=h<<2|d>>4,a[l++]=(d&15)<<4|p>>2,a[l++]=(p&3)<<6|m&63;return c};const Ln=new Map;function hc(e,t){let r=Ln.get(e);return r||(r=new Map,Ln.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Jo=(e,t,r)=>{if(!e||!(Qo(e,t)||typeof e=="object"))return;const s=e.constructor.name,l=hc(r,s);let h=l.indexOf(e);return h===-1&&(h=l.length,l.push(e)),h};function At(e,t,r){if(e instanceof Array)return e.map(s=>At(s,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const s=e.constructor.name,l=uc(e);return{rr_type:s,base64:l}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[At(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const s=e.constructor.name,{src:l}=e;return{rr_type:s,src:l}}else if(e instanceof HTMLCanvasElement){const s="HTMLImageElement",l=e.toDataURL();return{rr_type:s,src:l}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[At(e.data,t,r),e.width,e.height]};if(Qo(e,t)||typeof e=="object"){const s=e.constructor.name,l=Jo(e,t,r);return{rr_type:s,index:l}}}}return e}const Xo=(e,t,r)=>e.map(s=>At(s,t,r)),Qo=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(l=>typeof t[l]=="function").find(l=>e instanceof t[l]);function fc(e,t,r,s){const l=[],h=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const d of h)try{if(typeof t.CanvasRenderingContext2D.prototype[d]!="function")continue;const p=$e(t.CanvasRenderingContext2D.prototype,d,function(m){return function(...c){return oe(this.canvas,r,s,!0)||setTimeout(()=>{const a=Xo(c,t,this);e(this.canvas,{type:Me["2D"],property:d,args:a})},0),m.apply(this,c)}});l.push(p)}catch(p){const m=ht(t.CanvasRenderingContext2D.prototype,d,{set(c){e(this.canvas,{type:Me["2D"],property:d,args:[c],setter:!0})}});l.push(m)}return()=>{l.forEach(d=>d())}}function dc(e){return e==="experimental-webgl"?"webgl":e}function Fn(e,t,r,s){const l=[];try{const h=$e(e.HTMLCanvasElement.prototype,"getContext",function(d){return function(p,...m){if(!oe(this,t,r,!0)){const c=dc(p);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(m[0]&&typeof m[0]=="object"){const a=m[0];a.preserveDrawingBuffer||(a.preserveDrawingBuffer=!0)}else m.splice(0,1,{preserveDrawingBuffer:!0})}return d.apply(this,[p,...m])}});l.push(h)}catch(h){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{l.forEach(h=>h())}}function Bn(e,t,r,s,l,h){const d=[],p=Object.getOwnPropertyNames(e);for(const m of p)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(m))try{if(typeof e[m]!="function")continue;const c=$e(e,m,function(a){return function(...o){const n=a.apply(this,o);if(Jo(n,h,this),"tagName"in this.canvas&&!oe(this.canvas,s,l,!0)){const i=Xo(o,h,this),u={type:t,property:m,args:i};r(this.canvas,u)}return n}});d.push(c)}catch(c){const a=ht(e,m,{set(o){r(this.canvas,{type:t,property:m,args:[o],setter:!0})}});d.push(a)}return d}function pc(e,t,r,s){const l=[];return typeof t.WebGLRenderingContext!="undefined"&&l.push(...Bn(t.WebGLRenderingContext.prototype,Me.WebGL,e,r,s,t)),typeof t.WebGL2RenderingContext!="undefined"&&l.push(...Bn(t.WebGL2RenderingContext.prototype,Me.WebGL2,e,r,s,t)),()=>{l.forEach(h=>h())}}const Zo=`(function() {
62
+ "use strict";
63
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
64
+ var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
65
+ for (var i = 0; i < chars.length; i++) {
66
+ lookup[chars.charCodeAt(i)] = i;
67
+ }
68
+ var encode = function(arraybuffer) {
69
+ var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
70
+ for (i2 = 0; i2 < len; i2 += 3) {
71
+ base64 += chars[bytes[i2] >> 2];
72
+ base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
73
+ base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
74
+ base64 += chars[bytes[i2 + 2] & 63];
75
+ }
76
+ if (len % 3 === 2) {
77
+ base64 = base64.substring(0, base64.length - 1) + "=";
78
+ } else if (len % 3 === 1) {
79
+ base64 = base64.substring(0, base64.length - 2) + "==";
80
+ }
81
+ return base64;
82
+ };
83
+ const lastBlobMap = /* @__PURE__ */ new Map();
84
+ const transparentBlobMap = /* @__PURE__ */ new Map();
85
+ async function getTransparentBlobFor(width, height, dataURLOptions) {
86
+ const id = \`\${width}-\${height}\`;
87
+ if ("OffscreenCanvas" in globalThis) {
88
+ if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
89
+ const offscreen = new OffscreenCanvas(width, height);
90
+ offscreen.getContext("2d");
91
+ const blob = await offscreen.convertToBlob(dataURLOptions);
92
+ const arrayBuffer = await blob.arrayBuffer();
93
+ const base64 = encode(arrayBuffer);
94
+ transparentBlobMap.set(id, base64);
95
+ return base64;
96
+ } else {
97
+ return "";
98
+ }
99
+ }
100
+ const worker = self;
101
+ let logDebug = false;
102
+ const debug = (...args) => {
103
+ if (logDebug) {
104
+ console.debug(...args);
105
+ }
106
+ };
107
+ worker.onmessage = async function(e) {
108
+ logDebug = !!e.data.logDebug;
109
+ if ("OffscreenCanvas" in globalThis) {
110
+ const { id, bitmap, width, height, dx, dy, dw, dh, dataURLOptions } = e.data;
111
+ const transparentBase64 = getTransparentBlobFor(
112
+ width,
113
+ height,
114
+ dataURLOptions
115
+ );
116
+ const offscreen = new OffscreenCanvas(width, height);
117
+ const ctx = offscreen.getContext("2d");
118
+ ctx.drawImage(bitmap, 0, 0, width, height);
119
+ bitmap.close();
120
+ const blob = await offscreen.convertToBlob(dataURLOptions);
121
+ const type = blob.type;
122
+ const arrayBuffer = await blob.arrayBuffer();
123
+ const base64 = encode(arrayBuffer);
124
+ if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
125
+ debug("[highlight-worker] canvas bitmap is transparent", {
126
+ id,
127
+ base64
128
+ });
129
+ lastBlobMap.set(id, base64);
130
+ return worker.postMessage({ id, status: "transparent" });
131
+ }
132
+ if (lastBlobMap.get(id) === base64) {
133
+ debug("[highlight-worker] canvas bitmap is unchanged", {
134
+ id,
135
+ base64
136
+ });
137
+ }
138
+ const msg = {
139
+ id,
140
+ type,
141
+ base64,
142
+ width,
143
+ height,
144
+ dx,
145
+ dy,
146
+ dw,
147
+ dh
148
+ };
149
+ debug("[highlight-worker] canvas bitmap processed", msg);
150
+ worker.postMessage(msg);
151
+ lastBlobMap.set(id, base64);
152
+ } else {
153
+ debug("[highlight-worker] no offscreencanvas support", {
154
+ id: e.data.id
155
+ });
156
+ return worker.postMessage({ id: e.data.id, status: "unsupported" });
157
+ }
158
+ };
159
+ })();
160
+ //# sourceMappingURL=image-bitmap-data-url-worker-DwtK8A0z.js.map
161
+ `,Un=typeof self!="undefined"&&self.Blob&&new Blob([Zo],{type:"text/javascript;charset=utf-8"});function mc(e){let t;try{if(t=Un&&(self.URL||self.webkitURL).createObjectURL(Un),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zo),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class gc{constructor(t){N(this,"pendingCanvasMutations",new Map),N(this,"rafStamps",{latestId:0,invokeId:null}),N(this,"mirror"),N(this,"logger"),N(this,"worker"),N(this,"snapshotInProgressMap",new Map),N(this,"lastSnapshotTime",new Map),N(this,"options"),N(this,"mutationCb"),N(this,"resetObservers"),N(this,"frozen",!1),N(this,"locked",!1),N(this,"processMutation",(o,n)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(o)||this.pendingCanvasMutations.set(o,[]),this.pendingCanvasMutations.get(o).push(n)});const{sampling:r,win:s,blockClass:l,blockSelector:h,recordCanvas:d,recordLocalVideos:p,recordRemoteVideos:m,initialSnapshotDelay:c,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.logger=t.logger,this.worker=new mc,this.worker.onmessage=o=>{const{id:n}=o.data;if(this.snapshotInProgressMap.set(n,!1),!("base64"in o.data)){this.debug(null,"canvas worker received empty message",{id:n,data:o.data,status:o.data.status});return}const{base64:i,type:u,dx:f,dy:g,dw:S,dh:y}=o.data,b={id:n,type:Me["2D"],commands:[{property:"clearRect",args:[f,g,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:u}]},f,g,S,y]}]};this.debug(null,"canvas worker recording mutation",b),this.mutationCb(b)},this.options=t,d&&r==="all"?(this.debug(null,"initializing canvas mutation observer",{sampling:r}),this.initCanvasMutationObserver(s,l,h)):d&&typeof r=="number"&&(this.debug(null,"initializing canvas fps observer",{sampling:r}),this.initCanvasFPSObserver(p,m,r,s,l,h,{initialSnapshotDelay:c,dataURLOptions:a},t.resizeFactor,t.maxSnapshotDimension))}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}debug(t,...r){if(!this.logger)return;const s=this.mirror.getId(t);let l="[highlight-canvas-manager]";t&&(l=`[highlight-canvas] [id:${s}]`,t.tagName.toLowerCase()==="canvas"&&(l+=` [ctx:${t.__context}]`)),this.logger.debug(l,t,...r)}async snapshot(t){var r;const s=this.mirror.getId(t);if(this.snapshotInProgressMap.get(s)){this.debug(t,"snapshotting already in progress for",s);return}const l=1e3/(typeof this.options.samplingManual=="number"?this.options.samplingManual:1),h=this.lastSnapshotTime.get(s);if(!(h&&new Date().getTime()-h<l)){if(this.debug(t,"starting snapshotting"),t.width===0||t.height===0){this.debug(t,"not yet ready",{width:t.width,height:t.height});return}this.lastSnapshotTime.set(s,new Date().getTime()),this.snapshotInProgressMap.set(s,!0);try{if(this.options.clearWebGLBuffer!==!1&&["webgl","webgl2"].includes(t.__context)){const a=t.getContext(t.__context);((r=a==null?void 0:a.getContextAttributes())==null?void 0:r.preserveDrawingBuffer)===!1&&(a.clear(a.COLOR_BUFFER_BIT),this.debug(t,"cleared webgl canvas to load it into memory",{attributes:a==null?void 0:a.getContextAttributes()}))}if(t.width===0||t.height===0){this.debug(t,"not yet ready",{width:t.width,height:t.height});return}let d=this.options.resizeFactor||1;if(this.options.maxSnapshotDimension){const a=Math.max(t.width,t.height);d=Math.min(d,this.options.maxSnapshotDimension/a)}const p=t.width*d,m=t.height*d,c=await createImageBitmap(t,{resizeWidth:p,resizeHeight:m});this.debug(t,"created image bitmap",{width:c.width,height:c.height}),this.worker.postMessage({id:s,bitmap:c,width:p,height:m,dx:0,dy:0,dw:t.width,dh:t.height,dataURLOptions:this.options.dataURLOptions,logDebug:!!this.logger},[c]),this.debug(t,"sent message")}catch(d){this.debug(t,"failed to snapshot",d)}finally{this.snapshotInProgressMap.set(s,!1)}}}initCanvasFPSObserver(t,r,s,l,h,d,p,m,c){const a=Fn(l,h,d,!0),o=1e3/s;let n=0,i;const u=new Map,f=(b,E)=>{const v=[];b.querySelectorAll(E).forEach(M=>v.push(M));const w=document.createNodeIterator(b,Node.ELEMENT_NODE);let C;for(;C=w.nextNode();)C!=null&&C.shadowRoot&&v.push(...f(C.shadowRoot,E));return v},g=b=>{const E=[];return f(l.document,"canvas").forEach(v=>{if(!oe(v,h,d,!0)){this.debug(v,"discovered canvas"),E.push(v);const w=this.mirror.getId(v);u.has(w)||u.set(w,b)}}),E},S=b=>{const E=[];return(t||r)&&f(l.document,"video").forEach(v=>{if(!(!r&&v.src!==""&&v.src.indexOf("blob:")===-1)&&!(!t&&(v.src===""||v.src.indexOf("blob:")!==-1))&&!oe(v,h,d,!0)){E.push(v);const w=this.mirror.getId(v);u.has(w)||u.set(w,b)}}),E},y=async b=>{if(n&&b-n<o){i=requestAnimationFrame(w=>void y(w));return}n=b;const E=w=>{const C=this.mirror.getId(w),M=u.get(C),R=!p.initialSnapshotDelay||b-M>p.initialSnapshotDelay;return this.debug(w,{delay:p.initialSnapshotDelay,delta:b-M,hadLoadingTime:R}),R},v=[];v.push(...g(b).filter(E).map(w=>this.snapshot(w))),v.push(...S(b).filter(E).map(async w=>{this.debug(w,"starting video snapshotting");const C=this.mirror.getId(w);if(this.snapshotInProgressMap.get(C)){this.debug(w,"video snapshotting already in progress for",C);return}this.snapshotInProgressMap.set(C,!0);try{const{width:M,height:R}=w.getBoundingClientRect(),{actualWidth:x,actualHeight:A}={actualWidth:w.videoWidth,actualHeight:w.videoHeight},T=Math.max(x,A);if(T===0){this.debug(w,"not yet ready",{width:w.width,height:w.height,actualWidth:x,actualHeight:A,boxWidth:M,boxHeight:R});return}let G=m||1;c&&(G=Math.min(G,c/T));const X=x*G,I=A*G,ne=await createImageBitmap(w,{resizeWidth:X,resizeHeight:I}),P=Math.max(M,R)/T,j=x*P,H=A*P,F=(M-j)/2,Z=(R-H)/2;this.debug(w,"created image bitmap",{actualWidth:x,actualHeight:A,boxWidth:M,boxHeight:R,outputWidth:j,outputHeight:H,resizeWidth:X,resizeHeight:I,scale:G,outputScale:P,offsetX:F,offsetY:Z}),this.worker.postMessage({id:C,bitmap:ne,width:X,height:I,dx:F,dy:Z,dw:j,dh:H,dataURLOptions:p.dataURLOptions,logDebug:!!this.logger},[ne]),this.debug(w,"send message")}catch(M){this.debug(w,"failed to snapshot",M)}finally{this.snapshotInProgressMap.set(C,!1)}})),await Promise.all(v).catch(console.error),i=requestAnimationFrame(w=>void y(w))};i=requestAnimationFrame(b=>void y(b)),this.resetObservers=()=>{a(),i&&cancelAnimationFrame(i)}}initCanvasMutationObserver(t,r,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const l=Fn(t,r,s,!1),h=fc(this.processMutation.bind(this),t,r,s),d=pc(this.processMutation.bind(this),t,r,s);this.resetObservers=()=>{l(),h(),d()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;const l=s.map(d=>{const c=d,{type:p}=c;return mt(c,["type"])}),{type:h}=s[0];this.mutationCb({id:r,type:h,commands:l}),this.pendingCanvasMutations.delete(t)}}class yc{constructor(t){N(this,"trackedLinkElements",new WeakSet),N(this,"mutationCb"),N(this,"adoptedStyleSheetCb"),N(this,"styleMirror",new Qi),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const s={id:r,styleIds:[]},l=[];for(const h of t){let d;this.styleMirror.has(h)?d=this.styleMirror.getId(h):(d=this.styleMirror.add(h),l.push({styleId:d,rules:Array.from(h.rules||CSSRule,(p,m)=>({rule:eo(p,h.href),index:m}))})),s.styleIds.push(d)}l.length>0&&(s.styles=l),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class wc{constructor(){N(this,"nodeMap",new WeakMap),N(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(l=>l!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let re,Dt,at,$t=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((is=e.contentWindow)==null?void 0:is.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ye=to();function Oe(e={}){var t;const{emit:r,checkoutEveryNms:s,checkoutEveryNth:l,blockClass:h="highlight-block",blockSelector:d=null,ignoreClass:p="highlight-ignore",ignoreSelector:m=null,maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:o=!0,maskAllInputs:n,maskInputOptions:i,slimDOMOptions:u,maskInputFn:f,maskTextFn:g=Ci,hooks:S,packFn:y,sampling:b={},mousemoveWait:E,recordDOM:v=!0,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:R=!1,collectFonts:x=!1,inlineImages:A=!1,inlineVideos:T=!1,plugins:G,keepIframeSrcFn:X=()=>!1,privacySetting:I="default",ignoreCSSAttributes:ne=new Set([]),errorHandler:P,logger:j}=e,H=L(L({},e.dataURLOptions),typeof((t=e.sampling)==null?void 0:t.canvas)=="object"?e.sampling.canvas.dataURLOptions:void 0);Gu(P);const F=C?window.parent===window:!0;let Z=!1;if(!F)try{window.parent.document&&(Z=!1)}catch(q){Z=!0}if(F&&!r)throw new Error("emit function is required");if(!F&&!Z)return()=>{};E!==void 0&&b.mousemove===void 0&&(b.mousemove=E),ye.reset();const ue=n===!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}:i!==void 0?i:{password:!0},O=lo(u);Hi();let Se,ce=0;const Te=q=>{for(const ge of G||[])ge.eventProcessor&&(q=ge.eventProcessor(q));return y&&!Z&&(q=y(q)),q};re=(q,ge)=>{var ee;const te=q;if(te.timestamp=Ze(),(ee=Fe[0])!=null&&ee.isFrozen()&&te.type!==k.FullSnapshot&&!(te.type===k.IncrementalSnapshot&&te.data.source===_.Mutation)&&Fe.forEach(he=>he.unfreeze()),F)r==null||r(Te(te),ge);else if(Z){const he={type:"rrweb",event:Te(te),origin:window.location.origin,isCheckout:ge};window.parent.postMessage(he,"*")}if(te.type===k.FullSnapshot)Se=te,ce=0;else if(te.type===k.IncrementalSnapshot){if(te.data.source===_.Mutation&&te.data.isAttachIframe)return;ce++;const he=l&&ce>=l,Y=s&&te.timestamp-Se.timestamp>s;(he||Y)&&Dt(!0)}};const Ae=q=>{re({type:k.IncrementalSnapshot,data:L({source:_.Mutation},q)})},Ce=q=>re({type:k.IncrementalSnapshot,data:L({source:_.Scroll},q)}),ze=q=>re({type:k.IncrementalSnapshot,data:L({source:_.CanvasMutation},q)}),tt=q=>re({type:k.IncrementalSnapshot,data:L({source:_.AdoptedStyleSheet},q)}),pe=new yc({mutationCb:Ae,adoptedStyleSheetCb:tt}),ie=new ac({mirror:ye,mutationCb:Ae,stylesheetManager:pe,recordCrossOriginIframes:C,wrappedEmit:re});for(const q of G||[])q.getMirror&&q.getMirror({nodeMirror:ye,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});const me=new wc,de=typeof(b==null?void 0:b.canvas)=="object"?b.canvas:{fps:b==null?void 0:b.canvas};at=new gc({recordCanvas:w,recordLocalVideos:A,recordRemoteVideos:T,mutationCb:ze,win:window,blockClass:h,blockSelector:d,mirror:ye,sampling:de.fps,samplingManual:de.fpsManual,clearWebGLBuffer:de.clearWebGLBuffer,initialSnapshotDelay:de.initialSnapshotDelay,dataURLOptions:H,resizeFactor:de.resizeFactor,maxSnapshotDimension:de.maxSnapshotDimension,logger:j});const dt=new lc({mutationCb:Ae,scrollCb:Ce,bypassOptions:{blockClass:h,blockSelector:d,maskTextClass:c,maskTextSelector:a,inlineStylesheet:o,maskInputOptions:ue,dataURLOptions:H,maskTextFn:g,maskInputFn:f,recordCanvas:w,inlineImages:A,inlineVideos:T,privacySetting:I,sampling:b,slimDOMOptions:O,iframeManager:ie,stylesheetManager:pe,canvasManager:at,keepIframeSrcFn:X,processedNodeManager:me},mirror:ye});Dt=(q=!1)=>{if(!v)return;re({type:k.Meta,data:{href:window.location.href,width:ji(),height:Vi()}},q),pe.reset(),dt.init(),Fe.forEach(ee=>ee.lock());const ge=ul(document,{mirror:ye,blockClass:h,blockSelector:d,maskTextClass:c,maskTextSelector:a,inlineStylesheet:o,maskAllInputs:ue,maskTextFn:g,maskInputFn:f,slimDOM:O,dataURLOptions:H,recordCanvas:w,inlineImages:A,inlineVideos:T,privacySetting:I,onSerialize:ee=>{Qe(ee,ye)&&ie.addIframe(ee),Ji(ee,ye)&&pe.trackLinkElement(ee),ke(ee)&&dt.addShadowRoot(U.shadowRoot(ee),document)},onIframeLoad:(ee,te)=>{ie.attachIframe(ee,te),dt.observeAttachShadow(ee)},onStylesheetLoad:(ee,te)=>{pe.attachLinkElement(ee,te)},keepIframeSrcFn:X});if(!ge)return console.warn("Failed to snapshot the document");re({type:k.FullSnapshot,data:{node:ge,initialOffset:zi(window)}},q),Fe.forEach(ee=>ee.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,ye.getId(document))};try{const q=[],ge=te=>{var he;return z(oc)({mutationCb:Ae,mousemoveCb:(Y,rr)=>re({type:k.IncrementalSnapshot,data:{source:rr,positions:Y}}),mouseInteractionCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.MouseInteraction},Y)}),scrollCb:Ce,viewportResizeCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.ViewportResize},Y)}),inputCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.Input},Y)}),mediaInteractionCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.MediaInteraction},Y)}),styleSheetRuleCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.StyleSheetRule},Y)}),styleDeclarationCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.StyleDeclaration},Y)}),canvasMutationCb:ze,fontCb:Y=>re({type:k.IncrementalSnapshot,data:L({source:_.Font},Y)}),selectionCb:Y=>{re({type:k.IncrementalSnapshot,data:L({source:_.Selection},Y)})},customElementCb:Y=>{re({type:k.IncrementalSnapshot,data:L({source:_.CustomElement},Y)})},blockClass:h,ignoreClass:p,ignoreSelector:m,maskTextClass:c,maskTextSelector:a,maskInputOptions:ue,inlineStylesheet:o,sampling:b,recordDOM:v,recordCanvas:w,inlineImages:A,inlineVideos:T,userTriggeredOnInput:R,collectFonts:x,doc:te,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:X,blockSelector:d,slimDOMOptions:O,dataURLOptions:H,mirror:ye,iframeManager:ie,stylesheetManager:pe,shadowDomManager:dt,processedNodeManager:me,canvasManager:at,ignoreCSSAttributes:ne,privacySetting:I,plugins:((he=G==null?void 0:G.filter(Y=>Y.observer))==null?void 0:he.map(Y=>({observer:Y.observer,options:Y.options,callback:rr=>re({type:k.Plugin,data:{plugin:Y.name,payload:rr}})})))||[]},S)};ie.addLoadListener(te=>{try{q.push(ge(te.contentDocument))}catch(he){console.warn(he)}});const ee=()=>{Dt(),q.push(ge(document)),$t=!0};return["interactive","complete"].includes(document.readyState)?ee():(q.push(le("DOMContentLoaded",()=>{re({type:k.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ee()})),q.push(le("load",()=>{re({type:k.Load,data:{}}),M==="load"&&ee()},window))),()=>{q.forEach(te=>{try{te()}catch(he){String(he).toLowerCase().includes("cross-origin")||console.warn(he)}}),me.destroy(),$t=!1,Hu()}}catch(q){console.warn(q)}}Oe.addCustomEvent=(e,t)=>{$t&&re({type:k.Custom,data:{tag:e,payload:t}})};Oe.freezePage=()=>{Fe.forEach(e=>e.freeze())};Oe.takeFullSnapshot=e=>{if(!$t)throw new Error("please take full snapshot after start recording");Dt(e)};Oe.snapshotCanvas=async e=>{if(!at)throw new Error("canvas manager is not initialized");await at.snapshot(e)};Oe.mirror=ye;function Ko(e){return{all:e=e||new Map,on:function(t,r){var s=e.get(t);s?s.push(r):e.set(t,[r])},off:function(t,r){var s=e.get(t);s&&(r?s.splice(s.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var s=e.get(t);s&&s.slice().map(function(l){l(r)}),(s=e.get("*"))&&s.slice().map(function(l){l(t,r)})}}}const bc=Object.freeze(Object.defineProperty({__proto__:null,default:Ko},Symbol.toStringTag,{value:"Module"}));function vc(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,l={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||m,scrollIntoView:r.prototype.scrollIntoView},h=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function d(S){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(S)}const p=d(e.navigator.userAgent)?1:0;function m(S,y){this.scrollLeft=S,this.scrollTop=y}function c(S){return .5*(1-Math.cos(Math.PI*S))}function a(S){if(S===null||typeof S!="object"||S.behavior===void 0||S.behavior==="auto"||S.behavior==="instant")return!0;if(typeof S=="object"&&S.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+S.behavior+" is not a valid value for enumeration ScrollBehavior.")}function o(S,y){if(y==="Y")return S.clientHeight+p<S.scrollHeight;if(y==="X")return S.clientWidth+p<S.scrollWidth}function n(S,y){const b=e.getComputedStyle(S,null)["overflow"+y];return b==="auto"||b==="scroll"}function i(S){const y=o(S,"Y")&&n(S,"Y"),b=o(S,"X")&&n(S,"X");return y||b}function u(S){for(;S!==t.body&&i(S)===!1;)S=S.parentNode||S.host;return S}function f(S){const y=h();let b,E,v,w=(y-S.startTime)/s;w=w>1?1:w,b=c(w),E=S.startX+(S.x-S.startX)*b,v=S.startY+(S.y-S.startY)*b,S.method.call(S.scrollable,E,v),(E!==S.x||v!==S.y)&&e.requestAnimationFrame(f.bind(e,S))}function g(S,y,b){let E,v,w,C;const M=h();S===t.body?(E=e,v=e.scrollX||e.pageXOffset,w=e.scrollY||e.pageYOffset,C=l.scroll):(E=S,v=S.scrollLeft,w=S.scrollTop,C=m),f({scrollable:E,method:C,startTime:M,startX:v,startY:w,x:y,y:b})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(a(arguments[0])===!0){l.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(a(arguments[0])){l.scrollBy.call(e,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}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(a(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");l.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}const S=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof S=="undefined"?this.scrollLeft:~~S,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(a(arguments[0])===!0){l.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})}},r.prototype.scrollIntoView=function(){if(a(arguments[0])===!0){l.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const S=u(this),y=S.getBoundingClientRect(),b=this.getBoundingClientRect();S!==t.body?(g.call(this,S,S.scrollLeft+b.left-y.left,S.scrollTop+b.top-y.top),e.getComputedStyle(S).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}class Sc{constructor(t=[],r){N(this,"timeOffset",0),N(this,"speed"),N(this,"actions"),N(this,"raf",null),N(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const s=this.findActionIndex(t);this.actions.splice(s,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){const r=this.raf===!0;this.actions.length=0,this.actions=[...t],r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.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(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,s=this.actions.length-1;for(;r<=s;){const l=Math.floor((r+s)/2);if(this.actions[l].delay<t.delay)r=l+1;else if(this.actions[l].delay>t.delay)s=l-1;else return l+1}return r}}function ai(e,t){if(e.type===k.IncrementalSnapshot&&e.data.source===_.MouseMove&&e.data.positions&&e.data.positions.length){const r=e.data.positions[0].timeOffset,s=e.timestamp+r;return e.delay=s-t,s-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
162
+ Copyright (c) Microsoft Corporation.
163
+
164
+ Permission to use, copy, modify, and/or distribute this software for any
165
+ purpose with or without fee is hereby granted.
166
+
167
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
168
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
169
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
170
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
171
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
172
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
173
+ PERFORMANCE OF THIS SOFTWARE.
174
+ ***************************************************************************** */function Wn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s,l,h=r.call(e),d=[];try{for(;(t===void 0||t-- >0)&&!(s=h.next()).done;)d.push(s.value)}catch(p){l={error:p}}finally{try{s&&!s.done&&(r=h.return)&&r.call(h)}finally{if(l)throw l.error}}return d}var Xe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Xe||(Xe={}));var ea={type:"xstate.init"};function li(e){return e===void 0?[]:[].concat(e)}function Le(e){return{type:"xstate.assign",assignment:e}}function $n(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function zt(e){return function(t){return e===t}}function ta(e){return typeof e=="string"?{type:e}:e}function zn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:zt(e)}}function Vn(e,t,r){var s=t,l=!1;return[e.filter((function(h){if(h.type==="xstate.assign"){l=!0;var d=Object.assign({},s);return typeof h.assignment=="function"?d=h.assignment(s,r):Object.keys(h.assignment).forEach((function(p){d[p]=typeof h.assignment[p]=="function"?h.assignment[p](s,r):h.assignment[p]})),s=d,!1}return!0})),s,l]}function ra(e,t){t===void 0&&(t={});var r=Wn(Vn(li(e.states[e.initial].entry).map((function(d){return $n(d,t.actions)})),e.context,ea),2),s=r[0],l=r[1],h={config:e,_options:t,initialState:{value:e.initial,actions:s,context:l,matches:zt(e.initial)},transition:function(d,p){var m,c,a=typeof d=="string"?{value:d,context:e.context}:d,o=a.value,n=a.context,i=ta(p),u=e.states[o];if(u.on){var f=li(u.on[i.type]);try{for(var g=(function(P){var j=typeof Symbol=="function"&&Symbol.iterator,H=j&&P[j],F=0;if(H)return H.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&F>=P.length&&(P=void 0),{value:P&&P[F++],done:!P}}};throw new TypeError(j?"Object is not iterable.":"Symbol.iterator is not defined.")})(f),S=g.next();!S.done;S=g.next()){var y=S.value;if(y===void 0)return zn(o,n);var b=typeof y=="string"?{target:y}:y,E=b.target,v=b.actions,w=v===void 0?[]:v,C=b.cond,M=C===void 0?function(){return!0}:C,R=E===void 0,x=E!=null?E:o,A=e.states[x];if(M(n,i)){var T=Wn(Vn((R?li(w):[].concat(u.exit,w,A.entry).filter((function(P){return P}))).map((function(P){return $n(P,h._options.actions)})),n,i),3),G=T[0],X=T[1],I=T[2],ne=E!=null?E:o;return{value:ne,context:X,actions:G,changed:E!==o||G.length>0||I,matches:zt(ne)}}}}catch(P){m={error:P}}finally{try{S&&!S.done&&(c=g.return)&&c.call(g)}finally{if(m)throw m.error}}}return zn(o,n)}};return h}var jn=function(e,t){return e.actions.forEach((function(r){var s=r.exec;return s&&s(e.context,t)}))};function ia(e){var t=e.initialState,r=Xe.NotStarted,s=new Set,l={_machine:e,send:function(h){r===Xe.Running&&(t=e.transition(t,h),jn(t,ta(h)),s.forEach((function(d){return d(t)})))},subscribe:function(h){return s.add(h),h(t),{unsubscribe:function(){return s.delete(h)}}},start:function(h){if(h){var d=typeof h=="object"?h:{context:e.config.context,value:h};t={value:d.value,actions:[],context:d.context,matches:zt(d.value)}}return r=Xe.Running,jn(t,ea),l},stop:function(){return r=Xe.Stopped,s.clear(),l},get state(){return t},get status(){return r}};return l}function Cc(e,t){for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type===k.Meta&&s.timestamp<=t)return e.slice(r)}return e}function Ec(e,{getCastFn:t,applyEventsSynchronously:r,emitter:s}){const l=ra({id:"player",context:e,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"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},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"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Le({lastPlayedEvent:(h,d)=>d.type==="CAST_EVENT"?d.payload.event:h.lastPlayedEvent}),recordTimeOffset:Le((h,d)=>{let p=h.timeOffset;return"payload"in d&&"timeOffset"in d.payload&&(p=d.payload.timeOffset),se(L({},h),{timeOffset:p,baselineTime:h.events[0].timestamp+p})}),play(h){var d;const{timer:p,events:m,baselineTime:c,lastPlayedEvent:a}=h;p.clear();for(const u of m)ai(u,c);const o=Cc(m,c);let n=a==null?void 0:a.timestamp;(a==null?void 0:a.type)===k.IncrementalSnapshot&&a.data.source===_.MouseMove&&(n=a.timestamp+((d=a.data.positions[0])==null?void 0:d.timeOffset)),c<(n||0)&&s.emit($.PlayBack);const i=new Array;for(const u of o)if(!(n&&n<c&&(u.timestamp<=n||u===a)))if(u.timestamp<c)i.push(u);else{const f=t(u,!1);p.addAction({doAction:()=>{f()},delay:u.delay})}r(i),s.emit($.Flush),p.start()},pause(h){h.timer.clear()},resetLastPlayedEvent:Le(h=>se(L({},h),{lastPlayedEvent:null})),startLive:Le({baselineTime:(h,d)=>(h.timer.start(),d.type==="TO_LIVE"&&d.payload.baselineTime?d.payload.baselineTime:Date.now())}),replaceEvents:Le((h,d)=>{if(d.type!=="REPLACE_EVENTS")return h;const{events:p,timer:m,baselineTime:c}=h,{events:a}=d.payload;if(a.length===0)return h;p.length=0;const o=[],n=m.timeOffset+c;for(const i of a)ai(i,c),p.push(i),i.timestamp>=n&&o.push({doAction:t(i,!1),delay:i.delay});return m.isActive()&&m.replaceActions(o),se(L({},h),{events:p})}),addEvent:Le((h,d)=>{const{baselineTime:p,timer:m,events:c}=h;if(d.type==="ADD_EVENT"){const{event:a}=d.payload;ai(a,p);let o=c.length-1;if(!c[o]||c[o].timestamp<=a.timestamp)c.push(a);else{let u=-1,f=0;for(;f<=o;){const g=Math.floor((f+o)/2);c[g].timestamp<=a.timestamp?f=g+1:o=g-1}u===-1&&(u=f),c.splice(u,0,a)}const n=a.timestamp<p,i=t(a,n);n?i():m.isActive()&&m.addAction({doAction:()=>{i()},delay:a.delay})}return se(L({},h),{events:c})})}});return ia(l)}function xc(e){const t=ra({id:"speed",context:e,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:(r,s)=>{"payload"in s&&r.timer.setSpeed(s.payload.speed)},recordSpeed:Le({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return ia(t)}const Rc=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`],qn=new Map;function sa(e,t){let r=qn.get(e);return r||(r=new Map,qn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Pe(e,t,r){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(r&&(r.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){const l=await Pe(e,t,r)(s.args);return await createImageBitmap.apply(null,l)}else if("index"in s){if(r||t===null)return s;const{rr_type:l,index:h}=s;return sa(t,l)[h]}else if("args"in s){const{rr_type:l,args:h}=s,d=window[l];return new d(...await Promise.all(h.map(Pe(e,t,r))))}else{if("base64"in s)return cc(s.base64);if("src"in s){const l=e.get(s.src);if(l)return l;{const h=new Image;return h.src=s.src,e.set(s.src,h),h}}else if("data"in s&&s.rr_type==="Blob"){const l=await Promise.all(s.data.map(Pe(e,t,r)));return new Blob(l,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(Pe(e,t,r)));return s}}function Mc(e,t){try{return t===Me.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(r){return null}}const Ic=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Nc(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Ic.includes(r))return;const s=sa(e,r);s.includes(t)||s.push(t)}async function Oc({mutation:e,target:t,type:r,imageMap:s,errorHandler:l}){try{const h=Mc(t,r);if(!h)return;if(e.setter){h[e.property]=e.args[0];return}const d=h[e.property],p=await Promise.all(e.args.map(Pe(s,h))),m=d.apply(h,p);Nc(h,m);const c=!1}catch(h){l(e,h)}}async function Tc({event:e,mutations:t,target:r,imageMap:s,errorHandler:l}){const h=r.getContext("2d");if(!h){l(t[0],new Error("Canvas context is null"));return}Po(h);const d=t.map(async m=>Promise.all(m.args.map(Pe(s,h))));(await Promise.all(d)).forEach((m,c)=>{const a=t[c];try{if(a.setter){h[a.property]=a.args[0];return}const o=h[a.property];a.property==="drawImage"&&typeof a.args[0]=="string"?(s.get(e),o.apply(h,a.args)):o.apply(h,m)}catch(o){l(a,o)}})}async function yi({event:e,mutation:t,target:r,imageMap:s,canvasEventMap:l,errorHandler:h}){try{const d=l.get(e)||t,p="commands"in d?d.commands:[d];if([Me.WebGL,Me.WebGL2].includes(t.type)){for(let m=0;m<p.length;m++){const c=p[m];await Oc({mutation:c,type:t.type,target:r,imageMap:s,errorHandler:h})}return}await Tc({event:e,mutations:p,target:r,imageMap:s,errorHandler:h})}catch(d){h(t,d)}}class Ac{constructor(t){N(this,"mediaMap",new Map),N(this,"warn"),N(this,"service"),N(this,"speedService"),N(this,"emitter"),N(this,"getCurrentTime"),N(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on($.Start,this.start.bind(this)),this.emitter.on($.SkipStart,this.start.bind(this)),this.emitter.on($.Pause,this.pause.bind(this)),this.emitter.on($.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((r,s)=>{this.syncTargetWithState(s),t.pause&&s.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:r,mediaState:s}){if(s.isPlaying){const h=(t-s.lastInteractionTimeOffset)/1e3*s.playbackRate,d="duration"in r&&r.duration;if(Number.isNaN(d)){this.waitForMetadata(r);return}let p=s.currentTimeAtLastInteraction+h;r.loop&&d!==!1&&(p=p%d),r.currentTime=p}else r.pause(),r.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const r=()=>{this.metadataCallbackMap.delete(t);const s=this.mediaMap.get(t);s&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:s})};this.metadataCallbackMap.set(t,r),t.addEventListener("loadedmetadata",r,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:r,mutation:s}){var i,u,f,g,S;const l=this.mediaMap.get(t),{type:h,playbackRate:d,currentTime:p,muted:m,volume:c,loop:a}=s;return{isPlaying:h===_e.Play||h!==_e.Pause&&((l==null?void 0:l.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(i=p!=null?p:l==null?void 0:l.currentTimeAtLastInteraction)!=null?i:0,lastInteractionTimeOffset:r,playbackRate:(u=d!=null?d:l==null?void 0:l.playbackRate)!=null?u:1,volume:(f=c!=null?c:l==null?void 0:l.volume)!=null?f:1,muted:(g=m!=null?m:l==null?void 0:l.muted)!=null?g:t.getAttribute("muted")===null,loop:(S=a!=null?a:l==null?void 0:l.loop)!=null?S:t.getAttribute("loop")===null}}syncTargetWithState(t){const r=this.mediaMap.get(t);if(!r)return;const{muted:s,loop:l,volume:h,isPlaying:d}=r,p=this.service.state.matches("paused"),m=r.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:r}),t.volume!==h&&(t.volume=h),t.muted=s,t.loop=l,t.playbackRate!==m&&(t.playbackRate=m),d&&!p?t.play():t.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(t,r,s){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;const l=t,h=s.getMeta(l);if(!h||!("attributes"in h))return;const d=this.service.state.matches("paused"),p=h.attributes;let m=!1;p.rr_mediaState?m=p.rr_mediaState==="played":m=l.getAttribute("autoplay")!==null,m&&d&&l.pause();let c=1;typeof p.rr_mediaPlaybackRate=="number"&&(c=p.rr_mediaPlaybackRate);let a=!1;typeof p.rr_mediaMuted=="boolean"?a=p.rr_mediaMuted:a=l.getAttribute("muted")!==null;let o=!1;typeof p.rr_mediaLoop=="boolean"?o=p.rr_mediaLoop:o=l.getAttribute("loop")!==null;let n=1;typeof p.rr_mediaVolume=="number"&&(n=p.rr_mediaVolume);let i=0;typeof p.rr_mediaCurrentTime=="number"&&(i=p.rr_mediaCurrentTime),this.mediaMap.set(l,{isPlaying:m,currentTimeAtLastInteraction:i,lastInteractionTimeOffset:r,playbackRate:c,volume:n,muted:a,loop:o}),this.syncTargetWithState(l)}mediaMutation({target:t,timeOffset:r,mutation:s}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:r,mutation:s})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}}function Ot(e,t){if(e.nodeName!=="DIALOG"||e instanceof ve)return;const r=e,s=r.open,l=s&&r.matches("dialog:modal"),h=r.getAttribute("rr_open_mode"),d=typeof(t==null?void 0:t.attributes.open)=="string"||typeof r.getAttribute("open")=="string",p=h==="modal";if(!(s&&!(l&&h==="non-modal"||!l&&p))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}s&&r.close(),d&&(p?r.showModal():r.show())}}function Dc(e,t){if(e.nodeName!=="DIALOG"||e instanceof ve)return;const r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}const Gn=5*1e3,Hn=1*1e3,Yn=3600*1e3,_c=Ko||bc,Jn="[replayer]",ui={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ci(e){return e.type==k.IncrementalSnapshot&&(e.data.source==_.TouchMove||e.data.source==_.MouseInteraction&&e.data.type==V.TouchStart)}class kc{constructor(t,r){if(N(this,"wrapper"),N(this,"iframe"),N(this,"UNSAFE_replayCanvas",!1),N(this,"service"),N(this,"speedService"),N(this,"config"),N(this,"usingVirtualDom",!1),N(this,"virtualDom",new et),N(this,"mouse"),N(this,"mouseTail",null),N(this,"tailPositions",[]),N(this,"emitter",_c()),N(this,"nextUserInteractionEvent"),N(this,"activityIntervals",[]),N(this,"inactiveEndTimestamp"),N(this,"legacy_missingNodeRetryMap",{}),N(this,"cache",js()),N(this,"imageMap",new Map),N(this,"canvasEventMap",new Map),N(this,"mirror",to()),N(this,"styleMirror",new Qi),N(this,"mediaManager"),N(this,"firstFullSnapshot",null),N(this,"newDocumentQueue",[]),N(this,"mousePos",null),N(this,"touchActive",null),N(this,"lastMouseDownEvent",null),N(this,"lastHoveredRootNode"),N(this,"lastSelectionData",null),N(this,"constructedStyleMutations",[]),N(this,"adoptedStyleSheets",[]),N(this,"handleResize",p=>{this.iframe.style.display="inherit";for(const m of[this.mouseTail,this.iframe])m&&(m.setAttribute("width",String(p.width)),m.setAttribute("height",String(p.height)))}),N(this,"applyEventsSynchronously",p=>{for(const m of p){switch(m.type){case k.DomContentLoaded:case k.Load:case k.Custom:continue;case k.FullSnapshot:case k.Meta:case k.Plugin:case k.IncrementalSnapshot:break}this.getCastFn(m,!0)()}}),N(this,"getCastFn",(p,m=!1)=>{let c;switch(p.type){case k.DomContentLoaded:case k.Load:break;case k.Custom:c=()=>{this.emitter.emit($.CustomEvent,p)};break;case k.Meta:c=()=>this.emitter.emit($.Resize,{width:p.data.width,height:p.data.height});break;case k.FullSnapshot:c=()=>{var o;if(this.firstFullSnapshot){if(this.firstFullSnapshot===p){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(p,m),(o=this.iframe.contentWindow)==null||o.scrollTo(p.data.initialOffset)};break;case k.IncrementalSnapshot:c=()=>{if(this.applyIncremental(p,m),!m&&(this.handleInactivity(p.timestamp),p===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=p.timestamp)&&this.isUserInteraction(o)){o.delay-p.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-p.delay,n={speed:Math.min(Math.round(o/Gn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:n}),this.emitter.emit($.SkipStart,n)}}};break}return()=>{c&&c();for(const n of this.config.plugins||[])n.handler&&n.handler(p,m,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:p}});const o=this.service.state.context.events.length-1;if(!this.config.liveMode&&p===this.service.state.context.events[o]){const n=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit($.Finish))};let i=50;p.type===k.IncrementalSnapshot&&p.data.source===_.MouseMove&&p.data.positions.length&&(i+=Math.max(0,-p.data.positions[0].timeOffset)),setTimeout(n,i)}this.emitter.emit($.EventCast,p)}}),!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const s={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ui,useVirtualDom:!0,logger:console,inactiveThreshold:.02,inactiveSkipTime:Gn};this.config=Object.assign({},s,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on($.Resize,this.handleResize),this.setupDom();for(const p of this.config.plugins||[])p.getMirror&&p.getMirror({nodeMirror:this.mirror});this.emitter.on($.Flush,()=>{if(this.usingVirtualDom){const p={mirror:this.mirror,applyCanvas:(m,c,a)=>{yi({event:m,mutation:c,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(m,c)=>{m.source===_.StyleSheetRule?this.applyStyleSheetRule(m,c):m.source===_.StyleDeclaration&&this.applyStyleDeclaration(m,c)},afterAppend:(m,c)=>{for(const a of this.config.plugins||[])a.onBuild&&a.onBuild(m,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Ft(this.iframe.contentDocument,this.virtualDom,p,this.virtualDom.mirror)}catch(m){console.warn(m)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const m in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[m],a=Bt(c.node,this.mirror,this.virtualDom.mirror);Ft(a,c.node,p,this.virtualDom.mirror),c.node=a}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(m=>{this.applyStyleSheetMutation(m)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(m=>{this.applyAdoptedStyleSheet(m)}),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){const[p,m]=this.lastMouseDownEvent;p.dispatchEvent(m)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on($.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const l=new Sc([],{speed:this.config.speed});this.service=Ec({events:t.map(p=>r&&r.unpackFn?r.unpackFn(p):p).sort((p,m)=>p.timestamp-m.timestamp),timer:l,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(p=>{this.emitter.emit($.StateChange,{player:p})}),this.speedService=xc({normalSpeed:-1,timer:l}),this.speedService.start(),this.speedService.subscribe(p=>{this.emitter.emit($.StateChange,{speed:p})}),this.mediaManager=new Ac({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const h=this.service.state.context.events.find(p=>p.type===k.Meta),d=this.service.state.context.events.find(p=>p.type===k.FullSnapshot);if(h){const{width:p,height:m}=h.data;setTimeout(()=>{this.emitter.emit($.Resize,{width:p,height:m})},0)}d&&setTimeout(()=>{var p;this.firstFullSnapshot||(this.firstFullSnapshot=d,this.rebuildFullSnapshot(d),(p=this.iframe.contentWindow)==null||p.scrollTo(d.data.initialOffset))},1),this.service.state.context.events.find(ci)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail!="undefined"&&(t.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"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),s=[{timestamp:r.startTime},...this.service.state.context.events.filter(d=>this.isUserInteraction(d)),{timestamp:r.endTime}];for(let d=1;d<s.length;d++){const p=s[d-1],m=s[d];m.timestamp-p.timestamp>this.config.inactivePeriodThreshold?t.push({startTime:p.timestamp,endTime:m.timestamp,duration:m.timestamp-p.timestamp,active:!1}):t.push({startTime:p.timestamp,endTime:m.timestamp,duration:m.timestamp-p.timestamp,active:!0})}const l=[];let h=t[0];for(let d=1;d<t.length;d++)t[d].active!=t[d-1].active&&(l.push({startTime:h.startTime,endTime:t[d-1].endTime,duration:t[d-1].endTime-h.startTime,active:t[d-1].active}),h=t[d]);h&&t.length>0&&l.push({startTime:h.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-h.startTime,active:t[t.length-1].active}),h=l[0];for(let d=1;d<l.length;d++)(!l[d].active&&l[d].duration>this.config.inactiveThreshold*r.totalTime||!l[d-1].active&&l[d-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:h.startTime,endTime:l[d-1].endTime,duration:l[d-1].endTime-h.startTime,active:l[d-1].active}),h=l[d]);h&&l.length>0&&this.activityIntervals.push({startTime:h.startTime,endTime:l[l.length-1].endTime,duration:l[l.length-1].endTime-h.startTime,active:l[l.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,s;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(s=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit($.Start)}pause(t){var r,s;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(s=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit($.Pause)}resume(t=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit($.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit($.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;ci(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(ci(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events: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=js()}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.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=Fl({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(vc(this.iframe.contentWindow,this.iframe.contentDocument),Hi(this.iframe.contentWindow))}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const s of this.getActivityIntervals())if(t>=s.startTime&&t<s.endTime&&!s.active){this.inactiveEndTimestamp=s.endTime;break}if(this.inactiveEndTimestamp){const s=this.inactiveEndTimestamp-t,l={speed:s/Yn*this.config.inactiveSkipTime<Hn?s/Hn:Math.round(Math.max(s,Yn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:l}),this.emitter.emit($.SkipStart,l)}}}rebuildFullSnapshot(t,r=!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={};const s=[],l=new Set,h=(m,c)=>{if(m.nodeName==="DIALOG"&&l.add(m),this.collectIframeAndAttachDocument(s,m),this.mediaManager.isSupportedMediaElement(m)){const{events:a}=this.service.state.context;this.mediaManager.addMediaElements(m,t.timestamp-a[0].timestamp,this.mirror)}for(const a of this.config.plugins||[])a.onBuild&&a.onBuild(m,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.newDocumentQueue=[],Ll(t.data.node,{doc:this.iframe.contentDocument,afterAppend:h,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas,cspContent:this.config.cspContent}),h(this.iframe.contentDocument,t.data.node.id);for(const{mutationInQueue:m,builtNode:c}of s)this.attachDocumentToIframe(m,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==m);const{documentElement:d,head:p}=this.iframe.contentDocument;this.insertStyleRules(d,p),l.forEach(m=>Ot(m)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit($.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var s;const l=Rc(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&l.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!l.length)if(this.usingVirtualDom){const h=this.virtualDom.createElement("style");this.virtualDom.mirror.add(h,ko(h,this.virtualDom.unserializedId)),t.insertBefore(h,r),h.rules.push({source:_.StyleSheetRule,adds:l.map((d,p)=>({rule:d,index:p}))})}else{const h=document.createElement("style");t.insertBefore(h,r);for(let d=0;d<l.length;d++)(s=h.sheet)==null||s.insertRule(l[d],d)}}attachDocumentToIframe(t,r){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,l=[],h=new Set,d=(p,m)=>{p.nodeName==="DIALOG"&&h.add(p),this.collectIframeAndAttachDocument(l,p);const c=s.getMeta(p);if((c==null?void 0:c.type)===Re.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:a,head:o}=r.contentDocument;this.insertStyleRules(a,o)}if(!this.usingVirtualDom)for(const a of this.config.plugins||[])a.onBuild&&a.onBuild(p,{id:m,replayer:this})};nt(t.node,{doc:r.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:d,cache:this.cache}),d(r.contentDocument,t.node.id);for(const{mutationInQueue:p,builtNode:m}of l)this.attachDocumentToIframe(p,m),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==p);h.forEach(p=>Ot(p))}collectIframeAndAttachDocument(t,r){if(Qe(r,this.mirror)){const s=this.newDocumentQueue.find(l=>l.parentId===this.mirror.getId(r));s&&t.push({mutationInQueue:s,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const s=new Set;let l,h=this.service.state;const d=()=>{h=this.service.state};this.emitter.on($.Start,d),this.emitter.on($.Pause,d);const p=()=>{this.emitter.off($.Start,d),this.emitter.off($.Pause,d)};r.querySelectorAll('link[rel="stylesheet"]').forEach(m=>{m.sheet||(s.add(m),m.addEventListener("load",()=>{s.delete(m),s.size===0&&l!==-1&&(h.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit($.LoadStylesheetEnd),l&&clearTimeout(l),p())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit($.LoadStylesheetStart),l=setTimeout(()=>{h.matches("playing")&&this.play(this.getCurrentTime()),l=-1,p()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const r of this.service.state.context.events)r.type===k.IncrementalSnapshot&&r.data.source===_.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(l=>{this.preloadImages(l,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const s=document.createElement("canvas"),l=s.getContext("2d"),h=l==null?void 0:l.createImageData(s.width,s.height);l==null||l.putImageData(h,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){const s={isUnchanged:!0};if("commands"in t){const l=await Promise.all(t.commands.map(async h=>{const d=await Promise.all(h.args.map(Pe(this.imageMap,null,s)));return se(L({},h),{args:d})}));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(L({},t),{commands:l}))}else{const l=await Promise.all(t.args.map(Pe(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(L({},t),{args:l}))}}}applyIncremental(t,r){var s,l,h;const{data:d}=t;switch(d.source){case _.Mutation:{try{this.applyMutation(d,r)}catch(p){this.warn(`Exception in mutation ${p.message||p}`,d)}break}case _.Drag:case _.TouchMove:case _.MouseMove:if(r){const p=d.positions[d.positions.length-1];this.mousePos={x:p.x,y:p.y,id:p.id,debugData:d}}else d.positions.forEach(p=>{const m={doAction:()=>{this.moveAndHover(p.x,p.y,p.id,r,d)},delay:p.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(m)}),this.timer.addAction({doAction(){},delay:t.delay-((s=d.positions[0])==null?void 0:s.timeOffset)});break;case _.MouseInteraction:{if(d.id===-1)break;const p=new Event(Be(V[d.type])),m=this.mirror.getNode(d.id);if(!m)return this.debugNodeNotFound(d,d.id);this.emitter.emit($.MouseInteraction,{type:d.type,target:m});const{triggerFocus:c}=this.config;switch(d.type){case V.Blur:"blur"in m&&m.blur();break;case V.Focus:c&&m.focus&&m.focus({preventScroll:!0});break;case V.Click:case V.TouchStart:case V.TouchEnd:case V.MouseDown:case V.MouseUp:r?(d.type===V.TouchStart?this.touchActive=!0:d.type===V.TouchEnd&&(this.touchActive=!1),d.type===V.MouseDown?this.lastMouseDownEvent=[m,p]:d.type===V.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:d.x||0,y:d.y||0,id:d.id,debugData:d}):(d.type===V.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(d.x||0,d.y||0,d.id,r,d),d.type===V.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):d.type===V.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):d.type===V.TouchEnd?this.mouse.classList.remove("touch-active"):m.dispatchEvent(p));break;case V.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:m.dispatchEvent(p)}break}case _.Scroll:{if(d.id===-1)break;if(this.usingVirtualDom){const p=this.virtualDom.mirror.getNode(d.id);if(!p)return this.debugNodeNotFound(d,d.id);p.scrollData=d;break}this.applyScroll(d,r);break}case _.ViewportResize:this.emitter.emit($.Resize,{width:d.width,height:d.height});break;case _.Input:{if(d.id===-1)break;if(this.usingVirtualDom){const p=this.virtualDom.mirror.getNode(d.id);if(!p)return this.debugNodeNotFound(d,d.id);p.inputData=d;break}this.applyInput(d);break}case _.MediaInteraction:{const p=this.usingVirtualDom?this.virtualDom.mirror.getNode(d.id):this.mirror.getNode(d.id);if(!p)return this.debugNodeNotFound(d,d.id);const m=p,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:m,timeOffset:t.timestamp-c[0].timestamp,mutation:d});break}case _.StyleSheetRule:case _.StyleDeclaration:{this.usingVirtualDom?d.styleId?this.constructedStyleMutations.push(d):d.id&&((l=this.virtualDom.mirror.getNode(d.id))==null||l.rules.push(d)):this.applyStyleSheetMutation(d);break}case _.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const p=this.virtualDom.mirror.getNode(d.id);if(!p)return this.debugNodeNotFound(d,d.id);p.canvasMutations.push({event:t,mutation:d})}else{const p=this.mirror.getNode(d.id);if(!p)return this.debugNodeNotFound(d,d.id);yi({event:t,mutation:d,target:p,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case _.Font:{try{const p=new FontFace(d.family,d.buffer?new Uint8Array(JSON.parse(d.fontSource)):d.fontSource,d.descriptors);(h=this.iframe.contentDocument)==null||h.fonts.add(p)}catch(p){this.warn(p)}break}case _.Selection:{if(r){this.lastSelectionData=d;break}this.applySelection(d);break}case _.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(d):this.applyAdoptedStyleSheet(d);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Ru(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const a=this.legacy_missingNodeRetryMap[c],o=_o(a.node,this.virtualDom,this.mirror);o&&(a.node=o)}catch(a){this.warn(a)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(t,c.id),!1)),t.removes.forEach(c=>{var a;const o=s.getNode(c.id);if(!o)return;let n=s.getNode(c.parentId);if(!n)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&ke(n)&&(n=n.shadowRoot),s.removeNodeFromMap(o),n)try{n.removeChild(o),this.usingVirtualDom&&o.nodeName==="#text"&&n.nodeName==="STYLE"&&((a=n.rules)==null?void 0:a.length)>0&&(n.rules=[])}catch(i){if(i instanceof DOMException)this.warn("parent could not remove child in mutation",n,o,t);else throw i}});const l=L({},this.legacy_missingNodeRetryMap),h=[],d=c=>{let a=null;return c.nextId&&(a=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!a},p=c=>{var a,o;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let n=s.getNode(c.parentId);if(!n)return c.node.type===Re.Document?this.newDocumentQueue.push(c):h.push(c);c.node.isShadow&&(ke(n)||n.attachShadow({mode:"open"}),n=n.shadowRoot);let i=null,u=null;if(c.previousId&&(i=s.getNode(c.previousId)),c.nextId&&(u=s.getNode(c.nextId)),d(c))return h.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const f=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(n,s)){this.attachDocumentToIframe(c,n);return}const g=(b,E)=>{if(!this.usingVirtualDom){Ot(b);for(const v of this.config.plugins||[])v.onBuild&&v.onBuild(b,{id:E,replayer:this})}},S=nt(c.node,{doc:f,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){l[c.node.id]={node:S,mutation:c};return}const y=s.getMeta(n);if(y&&y.type===Re.Element&&c.node.type===Re.Text){const b=Array.isArray(n.childNodes)?n.childNodes:Array.from(n.childNodes);if(y.tagName==="textarea")for(const E of b)E.nodeType===n.TEXT_NODE&&n.removeChild(E);else if(y.tagName==="style"&&b.length===1)for(const E of b)E.nodeType===n.TEXT_NODE&&!s.hasNode(E)&&(S.textContent=E.textContent,n.removeChild(E))}else if((y==null?void 0:y.type)===Re.Document){const b=n;c.node.type===Re.DocumentType&&((a=b.childNodes[0])==null?void 0:a.nodeType)===Node.DOCUMENT_TYPE_NODE&&b.removeChild(b.childNodes[0]),S.nodeName==="HTML"&&b.documentElement&&b.removeChild(b.documentElement)}if(i&&i.nextSibling&&i.nextSibling.parentNode?n.insertBefore(S,i.nextSibling):u&&u.parentNode?n.contains(u)?n.insertBefore(S,u):n.insertBefore(S,null):n.appendChild(S),g(S,c.node.id),this.usingVirtualDom&&S.nodeName==="#text"&&n.nodeName==="STYLE"&&((o=n.rules)==null?void 0:o.length)>0&&(n.rules=[]),Qe(S,this.mirror)){const b=this.mirror.getId(S),E=this.newDocumentQueue.find(v=>v.parentId===b);E&&(this.attachDocumentToIframe(E,S),this.newDocumentQueue=this.newDocumentQueue.filter(v=>v!==E))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(l,n,S,c)};t.adds.forEach(c=>{p(c)});const m=Date.now();for(;h.length;){const c=$o(h);if(h.length=0,Date.now()-m>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const a of c)s.getNode(a.value.parentId)?Yi(a,n=>{p(n)}):this.debug("Drop resolve tree since there is no parent for the root node.",a)}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),zo(t.texts).forEach(c=>{var a;const o=s.getNode(c.id);if(!o)return t.removes.find(i=>i.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);const n=o.parentElement;if(c.value&&n&&n.tagName==="STYLE"?o.textContent=Yt(c.value,this.cache):o.textContent=c.value,this.usingVirtualDom){const i=o.parentNode;((a=i==null?void 0:i.rules)==null?void 0:a.length)>0&&(i.rules=[])}}),t.attributes.forEach(c=>{var a;const o=s.getNode(c.id);if(!o)return t.removes.find(n=>n.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(const n in c.attributes)if(typeof n=="string"){const i=c.attributes[n];if(i===null)o.removeAttribute(n),n==="open"&&Dc(o,c);else if(typeof i=="string")try{if(n==="_cssText"&&(o.nodeName==="LINK"||o.nodeName==="STYLE"))try{const u=s.getMeta(o),f=nt(se(L({},u),{attributes:L(L({},u.attributes),c.attributes)}),{doc:o.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(u.attributes,c.attributes);const g=o.nextSibling,S=o.parentNode;if(f&&S){S.removeChild(o),S.insertBefore(f,g),s.replace(c.id,f);break}}catch(u){}if(n==="value"&&o.nodeName==="TEXTAREA"){const u=o;u.childNodes.forEach(g=>u.removeChild(g));const f=(a=o.ownerDocument)==null?void 0:a.createTextNode(i);f&&u.appendChild(f)}else o.setAttribute(n,i);n==="rr_open_mode"&&o.nodeName==="DIALOG"&&Ot(o,c)}catch(u){this.warn("An error occurred may due to the checkout feature.",u)}else if(n==="style"){const u=i,f=o;for(const g in u)if(u[g]===!1)f.style.removeProperty(g);else if(u[g]instanceof Array){const S=u[g];f.style.setProperty(g,S[0],S[1])}else{const S=u[g];f.style.setProperty(g,S)}}}})}applyScroll(t,r){var s,l;const h=this.mirror.getNode(t.id);if(!h)return this.debugNodeNotFound(t,t.id);const d=this.mirror.getMeta(h);if(h===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if((d==null?void 0:d.type)===Re.Document)(l=h.defaultView)==null||l.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{h.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch(p){}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch(s){}}applySelection(t){try{const r=new Set,s=t.ranges.map(({start:l,startOffset:h,end:d,endOffset:p})=>{const m=this.mirror.getNode(l),c=this.mirror.getNode(d);if(!m||!c)return;const a=new Range;a.setStart(m,h),a.setEnd(c,p);const o=m.ownerDocument,n=o==null?void 0:o.getSelection();return n&&r.add(n),{range:a,selection:n}});r.forEach(l=>l.removeAllRanges()),s.forEach(l=>{var h;return l&&((h=l.selection)==null?void 0:h.addRange(l.range))})}catch(r){}}applyStyleSheetMutation(t){var r;let s=null;t.styleId?s=this.styleMirror.getStyle(t.styleId):t.id&&(s=((r=this.mirror.getNode(t.id))==null?void 0:r.sheet)||null),s&&(t.source===_.StyleSheetRule?this.applyStyleSheetRule(t,s):t.source===_.StyleDeclaration&&this.applyStyleDeclaration(t,s))}applyStyleSheetRule(t,r){var s,l,h,d;if((s=t.adds)==null||s.forEach(({rule:p,index:m})=>{try{if(Array.isArray(m)){const{positions:c,index:a}=mi(m),o=Ye(r.cssRules,c);o==null||o.insertRule(p,a)}else{const c=m===void 0?void 0:Math.min(m,r.cssRules.length);r==null||r.insertRule(p,c)}}catch(c){}}),(l=t.removes)==null||l.forEach(({index:p})=>{try{if(Array.isArray(p)){const{positions:m,index:c}=mi(p),a=Ye(r.cssRules,m);a==null||a.deleteRule(c||0)}else r==null||r.deleteRule(p)}catch(m){}}),typeof t.replace=="string")try{(h=r.replace)==null||h.call(r,t.replace)}catch(p){}if(typeof t.replaceSync=="string")try{(d=r.replaceSync)==null||d.call(r,t.replaceSync)}catch(p){}}applyStyleDeclaration(t,r){if(t.set){const s=Ye(r.rules,t.index);s!=null&&s.style&&s.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){const s=Ye(r.rules,t.index);s!=null&&s.style&&s.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;const s=this.mirror.getNode(t.id);if(!s)return;(r=t.styles)==null||r.forEach(p=>{var m;let c=null,a=null;if(ke(s)?a=((m=s.ownerDocument)==null?void 0:m.defaultView)||null:s.nodeName==="#document"&&(a=s.defaultView),!!a)try{c=new a.CSSStyleSheet,this.styleMirror.add(c,p.styleId),this.applyStyleSheetRule({source:_.StyleSheetRule,adds:p.rules},c)}catch(o){}});const l=10;let h=0;const d=(p,m)=>{const c=m.map(a=>this.styleMirror.getStyle(a)).filter(a=>a!==null);ke(p)?p.shadowRoot.adoptedStyleSheets=c:p.nodeName==="#document"&&(p.adoptedStyleSheets=c),c.length!==m.length&&h<l&&(setTimeout(()=>d(p,m),0+100*h),h++)};d(s,t.styleIds)}legacy_resolveMissingNode(t,r,s,l){const{previousId:h,nextId:d}=l,p=h&&t[h],m=d&&t[d];if(p){const{node:c,mutation:a}=p;r.insertBefore(c,s),delete t[a.node.id],delete this.legacy_missingNodeRetryMap[a.node.id],(a.previousId||a.nextId)&&this.legacy_resolveMissingNode(t,r,c,a)}if(m){const{node:c,mutation:a}=m;r.insertBefore(c,s.nextSibling),delete t[a.node.id],delete this.legacy_missingNodeRetryMap[a.node.id],(a.previousId||a.nextId)&&this.legacy_resolveMissingNode(t,r,c,a)}}moveAndHover(t,r,s,l,h){const d=this.mirror.getNode(s);if(!d)return this.debugNodeNotFound(h,s);const p=Xi(d,this.iframe),m=t*p.absoluteScale+p.x,c=r*p.absoluteScale+p.y;this.mouse.style.left=`${m}px`,this.mouse.style.top=`${c}px`,l||this.drawMouseTail({x:m,y:c}),this.hoverElements(d)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:s,strokeStyle:l,duration:h}=this.config.mouseTail===!0?ui:Object.assign({},ui,this.config.mouseTail),d=()=>{if(!this.mouseTail)return;const p=this.mouseTail.getContext("2d");!p||!this.tailPositions.length||(p.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),p.beginPath(),p.lineWidth=s,p.lineCap=r,p.strokeStyle=l,p.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(m=>p.lineTo(m.x,m.y)),p.stroke())};this.tailPositions.push(t),d(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(p=>p!==t),d()},h/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(l=>{l.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let s=t;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(t){return t.type!==k.IncrementalSnapshot?!1:t.data.source>_.Mutation&&t.data.source<=_.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit($.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(`Node with id '${r}' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(Jn,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(Jn,...t)}}const{addCustomEvent:Pc}=Oe,{freezePage:Lc}=Oe,{takeFullSnapshot:Fc}=Oe;exports.EventType=k;exports.IncrementalSource=_;exports.MouseInteractions=V;exports.Replayer=kc;exports.ReplayerEvents=$;exports.addCustomEvent=Pc;exports.canvasMutation=yi;exports.freezePage=Lc;exports.record=Oe;exports.takeFullSnapshot=Fc;exports.utils=$u;
175
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
176
+ var __cp = (to, from, except, desc) => {
177
+ if ((from && typeof from === "object") || typeof from === "function") {
178
+ for (let key of Object.getOwnPropertyNames(from)) {
179
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
180
+ Object.defineProperty(to, key, {
181
+ get: () => from[key],
182
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
183
+ });
184
+ }
185
+ }
186
+ return to;
187
+ };
188
+ module.exports = __cp(module.exports, exports);
189
+ }
190
+ return module.exports;
191
+ }))
192
+ //# sourceMappingURL=rrweb.umd.min.cjs.map