@highlight-run/rrweb 2.0.0-lambda.5 → 2.0.0-lambda.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,74 +1,164 @@
1
- (function (g, f) {
2
- if ("object" == typeof exports && "object" == typeof module) {
3
- module.exports = f();
4
- } else if ("function" == typeof define && define.amd) {
5
- define("rrweb", [], f);
6
- } else if ("object" == typeof exports) {
7
- exports["rrweb"] = f();
8
- } else {
9
- g["rrweb"] = f();
10
- }
11
- }(this, () => {
12
- var exports = {};
13
- var module = { exports };
14
- "use strict";var Tl=Object.defineProperty,Dl=Object.defineProperties;var _l=Object.getOwnPropertyDescriptors;var zt=Object.getOwnPropertySymbols;var Ji=Object.prototype.hasOwnProperty,Ki=Object.prototype.propertyIsEnumerable;var Xi=(s,e,t)=>e in s?Tl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,O=(s,e)=>{for(var t in e||(e={}))Ji.call(e,t)&&Xi(s,t,e[t]);if(zt)for(var t of zt(e))Ki.call(e,t)&&Xi(s,t,e[t]);return s},te=(s,e)=>Dl(s,_l(e));var je=(s,e)=>{var t={};for(var r in s)Ji.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&zt)for(var r of zt(s))e.indexOf(r)<0&&Ki.call(s,r)&&(t[r]=s[r]);return t};var kl=Object.defineProperty,Ll=(s,e,t)=>e in s?kl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>Ll(s,typeof e!="symbol"?e+"":e,t),Qi;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Pl=Object.defineProperty,$l=(s,e,t)=>e in s?Pl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,qi=(s,e,t)=>$l(s,typeof e!="symbol"?e+"":e,t),L=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(L||{});const Vt=new Map,en=new WeakSet;function tn(s){return s!==null&&typeof s=="object"&&"complete"in s&&"naturalWidth"in s&&"naturalHeight"in s&&"src"in s&&"onload"in s}function So(s){if(en.has(s))return;en.add(s);const e=s.drawImage.bind(s);s.drawImage=function(t,...r){const i=Vt.get(s);i&&(i.cancelled=!0);const n=()=>{r.length===2&&tn(t)&&r.push(t.naturalWidth||t.width,t.naturalHeight||t.height),e(t,...r)};if(tn(t)&&!t.complete){const o={cancelled:!1};Vt.set(s,o);const l=()=>{o.cancelled||(Vt.delete(s),n())},a=()=>{if(!o.cancelled){Vt.delete(s);try{n()}catch(c){}}};t.onload=l,t.onerror=a}else n()}}const rn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Gt={},Fl=()=>!!globalThis.Zone;function si(s){if(Gt[s])return Gt[s];const e=globalThis[s],t=e.prototype,r=s in rn?rn[s]:void 0,i=!!(r&&r.every(l=>{var a,c;return!!((c=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&c.toString().includes("[native code]"))})),n=s in sn?sn[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Fl())return Gt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const c=a[s].prototype;return document.body.removeChild(l),c?Gt[s]=c:t}catch(l){return t}}const is={};function ke(s,e,t){var r;const i=`${s}.${String(t)}`;if(is[i])return is[i].call(e);const n=si(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(is[i]=o,o.call(e)):e[t]}const ns={};function Co(s,e,t){const r=`${s}.${String(t)}`;if(ns[r])return ns[r].bind(e);const n=si(s)[t];return typeof n!="function"?e[t]:(ns[r]=n,n.bind(e))}function Bl(s){return ke("Node",s,"childNodes")}function Wl(s){return ke("Node",s,"parentNode")}function Ul(s){return ke("Node",s,"parentElement")}function zl(s){return ke("Node",s,"textContent")}function Vl(s,e){return Co("Node",s,"contains")(e)}function Gl(s){return Co("Node",s,"getRootNode")()}function jl(s){return!s||!("host"in s)?null:ke("ShadowRoot",s,"host")}function Hl(s){return s.styleSheets}function Yl(s){return!s||!("shadowRoot"in s)?null:ke("Element",s,"shadowRoot")}function Zl(s,e){return ke("Element",s,"querySelector")(e)}function Xl(s,e){return ke("Element",s,"querySelectorAll")(e)}function Jl(){return si("MutationObserver").constructor}function Kl(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}const ne={childNodes:Bl,parentNode:Wl,parentElement:Ul,textContent:zl,contains:Vl,getRootNode:Gl,host:jl,styleSheets:Hl,shadowRoot:Yl,querySelector:Zl,querySelectorAll:Xl,mutationObserver:Jl,patch:Kl,wrapCanvasContextDrawImage:So};function ii(s){return s.nodeType===s.ELEMENT_NODE}function yt(s){const e=s&&"host"in s&&"mode"in s&&ne.host(s)||null;return!!(e&&"shadowRoot"in e&&ne.shadowRoot(e)===s)}function wt(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Ql(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function ql(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function vs(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>Io(i,t)).join("");return Ql(r)}catch(e){return null}}function Io(s,e){if(tc(s)){let t;try{t=vs(s.styleSheet)||ql(s)}catch(r){t=s.cssText}return s.styleSheet.href?Er(t,s.styleSheet.href):t}else{let t=s.cssText;return rc(s)&&s.selectorText.includes(":")&&(t=ec(t)),e?Er(t,e):t}}function ec(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function tc(s){return"styleSheet"in s}function rc(s){return"selectorText"in s}class ni{constructor(){qi(this,"idNodeMap",new Map),qi(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Eo(){return new ni}function Cr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,overwriteRecord:n,maskInputFn:o}){let l=i||"";return Mo({maskInputOptions:e,tagName:t,type:r,overwriteRecord:n})&&(o?l=o(l,s):l="*".repeat(l.length)),l}function Ue(s){return s.toLowerCase()}const nn="__rrweb_original__";function sc(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const n=e.getImageData,o=nn in n?n[nn]:n;if(new Uint32Array(o.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function ic(s,e){return!s||!e||s.type!==e.type?!1:s.type===L.Document?s.compatMode===e.compatMode:s.type===L.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===L.Comment||s.type===L.Text||s.type===L.CDATA?s.textContent===e.textContent:s.type===L.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function Ir(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Ue(e):null}function oi(s,e){var n;let t;try{t=new URL(s,e!=null?e:window.location.href)}catch(o){return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(n=i==null?void 0:i[1])!=null?n:null}function nc(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const oc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ac=/^(?:[a-z+]+:)?\/\//i,lc=/^www\..*/i,cc=/^(data:)([^,]*),(.*)/i;function Er(s,e){return(s||"").replace(oc,(t,r,i,n,o,l)=>{const a=i||o||l,c=r||n||"";if(!a)return t;if(ac.test(a)||lc.test(a))return`url(${c}${a}${c})`;if(cc.test(a))return`url(${c}${a}${c})`;if(a[0]==="/")return`url(${c}${nc(e)+a}${c})`;const u=e.split("/"),h=a.split("/");u.pop();for(const f of h)f!=="."&&(f===".."?u.pop():u.push(f));return`url(${c}${u.join("/")}${c})`})}function jt(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function uc(s,e,t=!1){const r=Array.from(e.childNodes),i=[];let n=0;if(r.length>1&&s&&typeof s=="string"){let o=jt(s,t);const l=o.length/s.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&typeof r[a].textContent=="string"){const c=jt(r[a].textContent,t),u=100;let h=3;for(;h<c.length&&(c[h].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,h),1)!==-1);h++);for(;h<c.length;h++){let f=c.substring(0,h),d=o.split(f),m=-1;if(d.length===2)m=d[0].length;else if(d.length>2&&d[0]===""&&r[a-1].textContent!=="")m=o.indexOf(f,1);else if(d.length===1){if(f=f.substring(0,f.length-1),d=o.split(f),d.length<=1)return i.push(s),i;h=u+1}else h===c.length-1&&(m=o.indexOf(f));if(d.length>=2&&h>u){const g=r[a-1].textContent;if(g&&typeof g=="string"){const p=jt(g).length;m=o.indexOf(f,p)}m===-1&&(m=d[0].length)}if(m!==-1){let g=Math.floor(m/l);for(;g>0&&g<s.length;){if(n+=1,n>50*r.length)return i.push(s),i;const p=jt(s.substring(0,g),t);if(p.length===m){i.push(s.substring(0,g)),s=s.substring(g),o=o.substring(m);break}else p.length<m?g+=Math.max(1,Math.floor((m-p.length)/l)):g-=Math.max(1,Math.floor((p.length-m)*l))}break}}}}return i.push(s),i}function hc(s,e){return uc(s,e).join("/* rr_split */")}function ai(s){return s=s.replace(/[^ -~]+/g,""),s=(s==null?void 0:s.split(" ").map(e=>e?Math.random().toString(20).substring(2,e.length+2):"").join(" "))||"",s}function Ss(s){return s==="img"||s==="video"||s==="audio"||s==="source"}const fc=new RegExp(/[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/),dc=new RegExp(/[0-9]{9,16}/),pc=new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/),mc=new RegExp(/[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/),gc=new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/),yc=new RegExp(/[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/),wc=new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/),bc=[fc,dc,pc,mc,gc,yc,wc];function xo(s){return s?bc.some(e=>e.test(s)):!1}const Mo=({maskInputOptions:s,tagName:e,type:t,overwriteRecord:r})=>{const i=t&&t.toLowerCase();return r!=="true"&&(!!s[e.toLowerCase()]||!!(i&&s[i]))};let vc=1;const Sc=new RegExp("[^a-z0-9-_:]"),Ct=-2;function Ro(){return vc++}function Cc(s){if(s instanceof HTMLFormElement)return"form";const e=Ue(s.tagName);return Sc.test(e)?"div":e}let He,on;const Ic=/^[^ \t\n\r\u000c]+/,Ec=/^[, \t\n\r\u000c]+/;function xc(s,e){if(e.trim()==="")return e;let t=0;function r(n){let o;const l=n.exec(e.substring(t));return l?(o=l[0],t+=o.length,o):""}const i=[];for(;r(Ec),!(t>=e.length);){let n=r(Ic);if(n.slice(-1)===",")n=Xe(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Xe(s,n);let l=!1;for(;;){const a=e.charAt(t);if(a===""){i.push((n+o).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,i.push((n+o).trim());break}else a==="("&&(l=!0);o+=a,t+=1}}}return i.join(", ")}const an=new WeakMap;function Xe(s,e){return!e||e.trim()===""?e:li(s,e)}function Mc(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function li(s,e){let t=an.get(s);if(t||(t=s.createElement("a"),an.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Ao(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Xe(s,r):t==="srcset"?xc(s,r):t==="style"?Er(r,li(s)):e==="object"&&t==="data"?Xe(s,r):r)}function No(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function ln(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch(r){}return!1}function xr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?xr(ne.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?xr(ne.parentNode(s),e,t):!1}function Oo(s,e,t,r){let i;if(ii(s)){if(i=s,!ne.childNodes(i).length)return!1}else{if(ne.parentElement(s)===null)return!1;i=ne.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(xr(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch(n){}return!1}function Rc(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch(l){return}if(n!=="complete"){const l=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Ac(s,e,t){let r=!1,i;try{i=s.sheet}catch(o){return}if(i)return;const n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Nc(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextClass:c,maskTextFn:u,maskInputFn:h,dataURLOptions:f={},inlineImages:d,inlineVideos:m,recordCanvas:g,keepIframeSrcFn:p,newlyAddedElement:y=!1,cssCaptured:v=!1,privacySetting:b}=e,S=Oc(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:L.Document,childNodes:[],compatMode:s.compatMode}:{type:L.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:L.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:S};case s.ELEMENT_NODE:return Dc(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:h,maskTextClass:c,dataURLOptions:f,inlineImages:d,inlineVideos:m,recordCanvas:g,keepIframeSrcFn:p,newlyAddedElement:y,privacySetting:b,rootId:S});case s.TEXT_NODE:return Tc(s,{doc:t,needsMask:o,maskTextFn:u,privacySetting:b,rootId:S,cssCaptured:v});case s.CDATA_SECTION_NODE:return{type:L.CDATA,textContent:"",rootId:S};case s.COMMENT_NODE:return{type:L.Comment,textContent:ne.textContent(s)||"",rootId:S};default:return!1}}function Oc(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function Tc(s,e){var t;const{needsMask:r,maskTextFn:i,privacySetting:n,rootId:o,cssCaptured:l}=e,a=ne.parentNode(s),c=a&&a.tagName;let u="";const h=c==="STYLE"?!0:void 0,f=c==="SCRIPT"?!0:void 0;f?u="SCRIPT_PLACEHOLDER":l||(u=ne.textContent(s),h&&u&&(u=Er(u,li(e.doc)))),!h&&!f&&u&&r&&(u=i?i(u,ne.parentElement(s)):u.replace(/[\S]/g,"*"));const d=n==="strict",m=(t=s.parentElement)==null?void 0:t.getAttribute("data-hl-record"),g=n==="default"&&xo(u);return(d||g)&&!m&&c&&!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(c)&&u&&(u=ai(u)),{type:L.Text,textContent:u||"",rootId:o}}function Dc(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,maskTextClass:a,dataURLOptions:c={},inlineImages:u,inlineVideos:h,recordCanvas:f,keepIframeSrcFn:d,newlyAddedElement:m=!1,privacySetting:g,rootId:p}=e;let y=ln(s,r,i);const v=ln(s,a,null),b=g==="strict";let S=Cc(s),C={};const R=s.attributes.length;for(let I=0;I<R;I++){const x=s.attributes[I];No(S,x.name,x.value)||(C[x.name]=Ao(t,S,Ue(x.name),x.value))}if(S==="link"&&n){const I=Array.from(t.styleSheets).find(W=>W.href===s.href);let x=null;I&&(x=vs(I)),x&&(delete C.rel,delete C.href,C._cssText=x)}if(S==="style"&&s.sheet){let I=vs(s.sheet);I&&(s.childNodes.length>1&&(I=hc(I,s)),C._cssText=I)}if(S==="input"||S==="textarea"||S==="select"){const I=s.value,x=s.checked;C.type!=="radio"&&C.type!=="checkbox"&&C.type!=="submit"&&C.type!=="button"&&I?C.value=Cr({element:s,type:Ir(s),tagName:S,value:I,overwriteRecord:s.getAttribute("data-hl-record"),maskInputOptions:o,maskInputFn:l}):x&&(C.checked=x)}if(S==="option"&&(s.selected&&!o.select?C.selected=!0:delete C.selected),S==="dialog"&&s.open&&(C.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),S==="canvas"&&f){if(s.__context==="2d")sc(s);else if(!("__context"in s)){const I=s.toDataURL(c.type,c.quality),x=t.createElement("canvas");x.width=s.width,x.height=s.height;const W=x.toDataURL(c.type,c.quality);I!==W&&(C.rr_dataURL=I)}}if(S==="img"&&u&&!y&&!v&&!b){He||(He=t.createElement("canvas"),on=He.getContext("2d"));const I=s,x=I.currentSrc||I.getAttribute("src")||"<unknown-src>",W=I.crossOrigin,j=()=>{I.removeEventListener("load",j);try{He.width=I.naturalWidth,He.height=I.naturalHeight,on.drawImage(I,0,0),C.rr_dataURL=He.toDataURL(c.type,c.quality)}catch(ee){if(I.crossOrigin!=="anonymous"){I.crossOrigin="anonymous",I.complete&&I.naturalWidth!==0?j():I.addEventListener("load",j);return}else console.warn(`Cannot inline img src=${x}! Error: ${ee}`)}I.crossOrigin==="anonymous"&&(W?C.crossOrigin=W:I.removeAttribute("crossorigin"))};I.complete&&I.naturalWidth!==0?j():I.addEventListener("load",j)}if(S==="audio"||S==="video"){const I=C;I.rr_mediaState=s.paused?"paused":"played",I.rr_mediaCurrentTime=s.currentTime,I.rr_mediaPlaybackRate=s.playbackRate,I.rr_mediaMuted=s.muted,I.rr_mediaLoop=s.loop,I.rr_mediaVolume=s.volume}if(m||(s.scrollLeft&&(C.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(C.rr_scrollTop=s.scrollTop)),y||v||b&&Ss(S)){const{width:I,height:x}=s.getBoundingClientRect();C={class:C.class,rr_width:`${I}px`,rr_height:`${x}px`}}b&&Ss(S)&&(y=!0),S==="iframe"&&!d(C.src)&&(s.contentDocument||(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch(I){}const D=I=>{const{width:x,height:W}=I.getBoundingClientRect();C={width:x,height:W,rr_width:`${x}px`,rr_height:`${W}px`,rr_inlined_video:!0,class:C.class,style:C.style},S="canvas";const j=t.createElement("canvas");j.width=s.width,j.height=s.height,C.rr_dataURL=j.toDataURL(c.type,c.quality)};if(S==="video"){const I=s;u&&(I.src===""||I.src.indexOf("blob:")!==-1)&&D(I),h&&I.src!==""&&I.src.indexOf("blob:")===-1&&D(I)}return{type:L.Element,tagName:S,attributes:C,childNodes:[],isSVG:Mc(s)||void 0,needBlock:y,needMask:v,rootId:p,isCustom:T}}function Y(s){return s==null?"":s.toLowerCase()}function _c(s,e){if(e.comment&&s.type===L.Comment)return!0;if(s.type===L.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&oi(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(Y(s.attributes.name).match(/^msapplication-tile(image|color)$/)||Y(s.attributes.name)==="application-name"||Y(s.attributes.rel)==="icon"||Y(s.attributes.rel)==="apple-touch-icon"||Y(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&Y(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Y(s.attributes.property).match(/^(og|twitter|fb):/)||Y(s.attributes.name).match(/^(og|twitter):/)||Y(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Y(s.attributes.name)==="robots"||Y(s.attributes.name)==="googlebot"||Y(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Y(s.attributes.name)==="author"||Y(s.attributes.name)==="generator"||Y(s.attributes.name)==="framework"||Y(s.attributes.name)==="publisher"||Y(s.attributes.name)==="progid"||Y(s.attributes.property).match(/^article:/)||Y(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Y(s.attributes.name)==="google-site-verification"||Y(s.attributes.name)==="yandex-verification"||Y(s.attributes.name)==="csrf-token"||Y(s.attributes.name)==="p:domain_verify"||Y(s.attributes.name)==="verify-v1"||Y(s.attributes.name)==="verification"||Y(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Je(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m={},inlineImages:g=!1,inlineVideos:p=!1,recordCanvas:y=!1,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:S=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:D=!1,cssCaptured:I=!1,privacySetting:x}=e;let{needsMask:W}=e,{preserveWhiteSpace:j=!0}=e;W||(W=Oo(s,o,l,W===void 0));const ee=Nc(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:W,inlineStylesheet:c,maskInputOptions:u,maskTextClass:o,maskTextFn:h,maskInputFn:f,dataURLOptions:m,inlineImages:g,inlineVideos:p,recordCanvas:y,keepIframeSrcFn:T,newlyAddedElement:D,cssCaptured:I,privacySetting:x});if(!ee)return console.warn(s,"not serialized"),null;let ae;r.hasNode(s)?ae=r.getId(s):_c(ee,d)||!j&&ee.type===L.Text&&!ee.textContent.replace(/^\s+|\s+$/gm,"").length?ae=Ct:ae=Ro();const A=Object.assign(ee,{id:ae});if(r.add(s,A),ae===Ct)return null;v&&v(s);let ce=!a,ue=x,se=x==="strict";if(A.type===L.Element){if(ce=ce&&!A.needBlock,se||(se=!!A.needBlock||!!A.needMask),ue=se?"strict":ue,se&&Ss(A.tagName)){const ie=s.cloneNode();ie.src="",r.add(ie,A)}delete A.needBlock,delete A.needMask;const J=ne.shadowRoot(s);J&&wt(J)&&(A.isShadowHost=!0)}if((A.type===L.Document||A.type===L.Element)&&ce){d.headWhitespace&&A.type===L.Element&&A.tagName==="head"&&(j=!1);const J={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:W,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:g,inlineVideos:p,recordCanvas:y,preserveWhiteSpace:j,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:T,cssCaptured:!1,privacySetting:ue};if(!(A.type===L.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===L.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(J.cssCaptured=!0);for(const Pe of Array.from(ne.childNodes(s))){const Ne=Je(Pe,J);Ne&&A.childNodes.push(Ne)}}let ie=null;if(ii(s)&&(ie=ne.shadowRoot(s)))for(const Pe of Array.from(ne.childNodes(ie))){const Ne=Je(Pe,J);Ne&&(wt(ie)&&(Ne.isShadow=!0),A.childNodes.push(Ne))}}const he=ne.parentNode(s);return he&&yt(he)&&wt(he)&&(A.isShadow=!0),A.type===L.Element&&A.tagName==="iframe"&&Rc(s,()=>{const J=s.contentDocument;if(J&&b){const ie=Je(J,{doc:J,mirror:r,blockClass:i,blockSelector:n,needsMask:W,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:g,inlineVideos:p,recordCanvas:y,preserveWhiteSpace:j,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:T,privacySetting:x});ie&&b(s,ie)}},S),A.type===L.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&oi(A.attributes.href)==="css")&&Ac(s,()=>{if(C){const J=Je(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:W,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:f,slimDOMOptions:d,dataURLOptions:m,inlineImages:g,inlineVideos:p,recordCanvas:y,preserveWhiteSpace:j,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:T,privacySetting:x});J&&C(s,J)}},R),A}function kc(s,e){const{mirror:t=new ni,blockClass:r="highlight-block",blockSelector:i=null,maskTextClass:n="highlight-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,inlineVideos:c=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:f,maskInputFn:d,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:p,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:R=()=>!1,privacySetting:T="default"}=e||{};return Je(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!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}:h===!1?{password:!0}:h,maskTextFn:f,maskInputFn:d,slimDOMOptions:m||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m||{},dataURLOptions:g,inlineImages:a,inlineVideos:c,recordCanvas:u,preserveWhiteSpace:p,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:R,newlyAddedElement:!1,privacySetting:T})}const Lc=/(max|min)-device-(width|height)/,cn=new RegExp(Lc.source,"g"),Pc={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(cn)&&(s.params=s.params.replace(cn,"$1-$2"))}}}},$c={postcssPlugin:"postcss-hover-classes",prepare:function(){const s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
15
- `+t.replace(/:hover/g,".\\:hover"))}))}}}};function Fc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Bc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var ci={exports:{}},_=String,To=function(){return{isColorSupported:!1,reset:_,bold:_,dim:_,italic:_,underline:_,inverse:_,hidden:_,strikethrough:_,black:_,red:_,green:_,yellow:_,blue:_,magenta:_,cyan:_,white:_,gray:_,bgBlack:_,bgRed:_,bgGreen:_,bgYellow:_,bgBlue:_,bgMagenta:_,bgCyan:_,bgWhite:_,blackBright:_,redBright:_,greenBright:_,yellowBright:_,blueBright:_,magentaBright:_,cyanBright:_,whiteBright:_,bgBlackBright:_,bgRedBright:_,bgGreenBright:_,bgYellowBright:_,bgBlueBright:_,bgMagentaBright:_,bgCyanBright:_,bgWhiteBright:_}};ci.exports=To();ci.exports.createColors=To;var Wc=ci.exports;const Uc={},zc=Object.freeze(Object.defineProperty({__proto__:null,default:Uc},Symbol.toStringTag,{value:"Module"})),pe=Bc(zc);let un=Wc,hn=pe,Cs=class Do extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Do)}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(e){if(!this.source)return"";let t=this.source;e==null&&(e=un.isColorSupported);let r=u=>u,i=u=>u,n=u=>u;if(e){let{bold:u,gray:h,red:f}=un.createColors(!0);i=d=>u(f(d)),r=d=>h(d),hn&&(n=d=>hn(d))}let o=t.split(/\r?\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;return o.slice(l,a).map((u,h)=>{let f=l+1+h,d=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let g=20,p=Math.max(0,this.column-g),y=Math.max(this.column+g,this.endColumn+g),v=u.slice(p,y),b=r(d.replace(/\d/g," "))+u.slice(0,Math.min(this.column-1,g-1)).replace(/[^\t]/g," ");return i(">")+r(d)+n(v)+`
16
- `+b+i("^")}let m=r(d.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(d)+n(u)+`
17
- `+m+i("^")}return" "+r(d)+n(u)}).join(`
18
- `)}toString(){let e=this.showSourceCode();return e&&(e=`
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 da=Object.defineProperty,pa=Object.defineProperties;var ma=Object.getOwnPropertyDescriptors;var pt=Object.getOwnPropertySymbols;var os=Object.prototype.hasOwnProperty,as=Object.prototype.propertyIsEnumerable;var ns=(e,t,r)=>t in e?da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L=(e,t)=>{for(var r in t||(t={}))os.call(t,r)&&ns(e,r,t[r]);if(pt)for(var r of pt(t))as.call(t,r)&&ns(e,r,t[r]);return e},se=(e,t)=>pa(e,ma(t));var mt=(e,t)=>{var r={};for(var s in e)os.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&&as.call(e,s)&&(r[s]=e[s]);return r};var ga=Object.defineProperty,ya=(e,t,r)=>t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t,r)=>ya(e,typeof t!="symbol"?t+"":t,r),ls;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var wa=Object.defineProperty,va=(e,t,r)=>t in e?wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,us=(e,t,r)=>va(e,typeof t!="symbol"?t+"":t,r),U=(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))(U||{});const gt=new Map,cs=new WeakSet;function hs(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function to(e){if(cs.has(e))return;cs.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const a=gt.get(e);a&&(a.cancelled=!0);const u=()=>{s.length===2&&hs(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(hs(r)&&!r.complete){const c={cancelled:!1};gt.set(e,c);const f=()=>{c.cancelled||(gt.delete(e),u())},m=()=>{if(!c.cancelled){gt.delete(e);try{u()}catch(d){}}};r.onload=f,r.onerror=m}else u()}}const fs={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ds={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},yt={},ro={},ba=()=>!!globalThis.Zone;function Ei(e){if(yt[e])return yt[e];const t=globalThis[e],r=t.prototype,s=e in fs?fs[e]:void 0,a=!!(s&&s.every(f=>{var m,d;return!!((d=(m=Object.getOwnPropertyDescriptor(r,f))==null?void 0:m.get)!=null&&d.toString().includes("[native code]"))})),u=e in ds?ds[e]:void 0,c=!!(u&&u.every(f=>{var m;return typeof r[f]=="function"&&((m=r[f])==null?void 0:m.toString().includes("[native code]"))}));if(a&&c&&!ba())return yt[e]=t.prototype,t.prototype;try{const f=document.createElement("iframe");f.style.display="none",document.body.appendChild(f);const m=f.contentWindow;if(!m)return t.prototype;const d=m[e].prototype;if(!d)return f.remove(),r;const p=navigator.userAgent;return p.includes("Safari")&&!p.includes("Chrome")?(f.classList.add("rr-block"),f.setAttribute("__rrwebUntaintedMutationObserver",""),ro[e]=()=>f.remove()):f.remove(),yt[e]=d}catch(f){return r}}const nr={};function Ie(e,t,r){var s;const a=`${e}.${String(r)}`;if(nr[a])return nr[a].call(t);const u=Ei(e),c=(s=Object.getOwnPropertyDescriptor(u,r))==null?void 0:s.get;return c?(nr[a]=c,c.call(t)):t[r]}const or={};function io(e,t,r){const s=`${e}.${String(r)}`;if(or[s])return or[s].bind(t);const u=Ei(e)[r];return typeof u!="function"?t[r]:(or[s]=u,u.bind(t))}function Sa(e){return Ie("Node",e,"ownerDocument")}function Ca(e){return Ie("Node",e,"childNodes")}function Ea(e){return Ie("Node",e,"parentNode")}function xa(e){return Ie("Node",e,"parentElement")}function Ra(e){return Ie("Node",e,"textContent")}function Ma(e,t){return io("Node",e,"contains")(t)}function Ia(e){return io("Node",e,"getRootNode")()}function Oa(e){return!e||!("host"in e)?null:Ie("ShadowRoot",e,"host")}function Na(e){return e.styleSheets}function Ta(e){return!e||!("shadowRoot"in e)?null:Ie("Element",e,"shadowRoot")}function Da(e,t){return Ie("Element",e,"querySelector")(t)}function Aa(e,t){return Ie("Element",e,"querySelectorAll")(t)}function _a(){var e;return[Ei("MutationObserver").constructor,(e=ro.MutationObserver)!=null?e:(()=>{})]}let so=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(so=()=>new Date().getTime());function ka(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],a=r(s);return typeof a=="function"&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=a,()=>{e[t]=s}}catch(s){return()=>{}}}const ae={ownerDocument:Sa,childNodes:Ca,parentNode:Ea,parentElement:xa,textContent:Ra,contains:Ma,getRootNode:Ia,host:Oa,styleSheets:Na,shadowRoot:Ta,querySelector:Da,querySelectorAll:Aa,nowTimestamp:so,mutationObserverCtor:_a,patch:ka,wrapCanvasContextDrawImage:to};function xi(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 Pa(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 La(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 pi(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,a=>no(a,r)).join("");return Pa(s)}catch(t){return null}}function no(e,t){if(Ba(e)){let r;try{r=pi(e.styleSheet)||La(e)}catch(s){r=e.cssText}return e.styleSheet.href?Pt(r,e.styleSheet.href):r}else{let r=e.cssText;return Ua(e)&&e.selectorText.includes(":")&&(r=Fa(r)),t?Pt(r,t):r}}function Fa(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Ba(e){return"styleSheet"in e}function Ua(e){return"selectorText"in e}class Ri{constructor(){us(this,"idNodeMap",new Map),us(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 a=this.nodeMetaMap.get(s);a&&this.nodeMetaMap.set(r,a)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function oo(){return new Ri}function _t({element:e,maskInputOptions:t,tagName:r,type:s,value:a,overwriteRecord:u,maskInputFn:c}){let f=a||"";return lo({maskInputOptions:t,tagName:r,type:s,overwriteRecord:u})&&(c?f=c(f,e):f="*".repeat(f.length)),f}function We(e){return e.toLowerCase()}const ps="__rrweb_original__";function Wa(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let s=0;s<e.width;s+=r)for(let a=0;a<e.height;a+=r){const u=t.getImageData,c=ps in u?u[ps]:u;if(new Uint32Array(c.call(t,s,a,Math.min(r,e.width-s),Math.min(r,e.height-a)).data.buffer).some(m=>m!==0))return!1}return!0}function $a(e,t){return!e||!t||e.type!==t.type?!1:e.type===U.Document?e.compatMode===t.compatMode:e.type===U.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===U.Comment||e.type===U.Text||e.type===U.CDATA?e.textContent===t.textContent:e.type===U.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?We(t):null}function Mi(e,t){var u;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(c){return null}const s=/\.([0-9a-z]+)(?:$)/i,a=r.pathname.match(s);return(u=a==null?void 0:a[1])!=null?u:null}function za(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const ja=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Va=/^(?:[a-z+]+:)?\/\//i,qa=/^www\..*/i,Ga=/^(data:)([^,]*),(.*)/i;function Pt(e,t){return(e||"").replace(ja,(r,s,a,u,c,f)=>{const m=a||c||f,d=s||u||"";if(!m)return r;if(Va.test(m)||qa.test(m))return`url(${d}${m}${d})`;if(Ga.test(m))return`url(${d}${m}${d})`;if(m[0]==="/")return`url(${d}${za(t)+m}${d})`;const p=m.split("#")[0],o=m.substring(p.length),n=t.split("#")[0].split("/"),i=p.split("/");n.pop();for(const l of i)l!=="."&&(l===".."?n.pop():n.push(l));return`url(${d}${n.join("/")}${o}${d})`})}function wt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ha(e,t,r=!1){const s=Array.from(t.childNodes),a=[];let u=0;if(s.length>1&&e&&typeof e=="string"){let c=wt(e,r);const f=c.length/e.length;for(let m=1;m<s.length;m++)if(s[m].textContent&&typeof s[m].textContent=="string"){const d=wt(s[m].textContent,r),p=100;let o=3;for(;o<d.length&&(d[o].match(/[a-zA-Z0-9]/)||d.indexOf(d.substring(0,o),1)!==-1);o++);for(;o<d.length;o++){let n=d.substring(0,o),i=c.split(n),l=-1;if(i.length===2)l=i[0].length;else if(i.length>2&&i[0]===""&&s[m-1].textContent!=="")l=c.indexOf(n,1);else if(i.length===1){if(n=n.substring(0,n.length-1),i=c.split(n),i.length<=1)return a.push(e),a;o=p+1}else o===d.length-1&&(l=c.indexOf(n));if(i.length>=2&&o>p){const h=s[m-1].textContent;if(h&&typeof h=="string"){const g=wt(h).length;l=c.indexOf(n,g)}l===-1&&(l=i[0].length)}if(l!==-1){let h=Math.floor(l/f);for(;h>0&&h<e.length;){if(u+=1,u>50*s.length)return a.push(e),a;const g=wt(e.substring(0,h),r);if(g.length===l){a.push(e.substring(0,h)),e=e.substring(h),c=c.substring(l);break}else g.length<l?h+=Math.max(1,Math.floor((l-g.length)/f)):h-=Math.max(1,Math.floor((g.length-l)*f))}break}}}}return a.push(e),a}function Ya(e,t){return Ha(e,t).join("/* rr_split */")}function Ii(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 mi(e){return e==="img"||e==="video"||e==="audio"||e==="source"}const Ja=new RegExp(/[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/),Xa=new RegExp(/[0-9]{9,16}/),Qa=new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/),Za=new RegExp(/[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/),Ka=new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/),el=new RegExp(/[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/),tl=new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/),rl=[Ja,Xa,Qa,Za,Ka,el,tl];function ao(e){return e?rl.some(t=>t.test(e)):!1}const lo=({maskInputOptions:e,tagName:t,type:r,overwriteRecord:s})=>{const a=r&&r.toLowerCase();return s!=="true"&&(!!e[t.toLowerCase()]||!!(a&&e[a]))};let il=1;const sl=new RegExp("[^a-z0-9-_:]"),lt=-2;function uo(){return il++}function nl(e){if(e instanceof HTMLFormElement)return"form";const t=We(e.tagName);return sl.test(t)?"div":t}let je,ms;const ol=/^[^ \t\n\r\u000c]+/,al=/^[, \t\n\r\u000c]+/;function ll(e,t){if(t.trim()==="")return t;let r=0;function s(u){let c;const f=u.exec(t.substring(r));return f?(c=f[0],r+=c.length,c):""}const a=[];for(;s(al),!(r>=t.length);){let u=s(ol);if(u.slice(-1)===",")u=Ge(e,u.substring(0,u.length-1)),a.push(u);else{let c="";u=Ge(e,u);let f=!1;for(;;){const m=t.charAt(r);if(m===""){a.push((u+c).trim());break}else if(f)m===")"&&(f=!1);else if(m===","){r+=1,a.push((u+c).trim());break}else m==="("&&(f=!0);c+=m,r+=1}}}return a.join(", ")}const gs=new WeakMap;function Ge(e,t){return!t||t.trim()===""?t:Oi(e,t)}function ul(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Oi(e,t){let r=gs.get(e);if(r||(r=e.createElement("a"),gs.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function co(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"?ll(e,s):r==="style"?Pt(s,Oi(e)):t==="object"&&r==="data"?Ge(e,s):s)}function ho(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function ys(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const a=e.classList[s];if(t.test(a))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 a=e.classList[s];if(t.test(a))return!0}return r?Lt(ae.parentNode(e),t,r):!1}function fo(e,t,r,s){let a;if(xi(e)){if(a=e,!ae.childNodes(a).length)return!1}else{if(ae.parentElement(e)===null)return!1;a=ae.parentElement(e)}try{if(typeof t=="string"){if(s){if(a.closest(`.${t}`))return!0}else if(a.classList.contains(t))return!0}else if(Lt(a,t,s))return!0;if(r){if(s){if(a.closest(r))return!0}else if(a.matches(r))return!0}}catch(u){}return!1}function cl(e,t,r){const s=e.contentWindow;if(!s)return;let a=!1,u;try{u=s.document.readyState}catch(f){return}if(u!=="complete"){const f=setTimeout(()=>{a||(t(),a=!0)},r);e.addEventListener("load",()=>{clearTimeout(f),a=!0,t()});return}const c="about:blank";if(s.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function hl(e,t,r){let s=!1,a;try{a=e.sheet}catch(c){return}if(a)return;const u=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),s=!0,t()})}function fl(e,t){const{doc:r,mirror:s,blockClass:a,blockSelector:u,needsMask:c,inlineStylesheet:f,maskInputOptions:m={},maskTextClass:d,maskTextFn:p,maskInputFn:o,dataURLOptions:n={},inlineImages:i,inlineVideos:l,recordCanvas:h,keepIframeSrcFn:g,newlyAddedElement:b=!1,cssCaptured:y=!1,privacySetting:v}=t,E=dl(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:U.Document,childNodes:[],compatMode:e.compatMode}:{type:U.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:U.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return ml(e,{doc:r,blockClass:a,blockSelector:u,inlineStylesheet:f,maskInputOptions:m,maskInputFn:o,maskTextClass:d,dataURLOptions:n,inlineImages:i,inlineVideos:l,recordCanvas:h,keepIframeSrcFn:g,newlyAddedElement:b,privacySetting:v,rootId:E});case e.TEXT_NODE:return pl(e,{doc:r,needsMask:c,maskTextFn:p,privacySetting:v,rootId:E,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:U.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:U.Comment,textContent:ae.textContent(e)||"",rootId:E};default:return!1}}function dl(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function pl(e,t){var r;const{needsMask:s,maskTextFn:a,privacySetting:u,rootId:c,cssCaptured:f}=t,m=ae.parentNode(e),d=m&&m.tagName;let p="";const o=d==="STYLE"?!0:void 0,n=d==="SCRIPT"?!0:void 0;n?p="SCRIPT_PLACEHOLDER":f||(p=ae.textContent(e),o&&p&&(p=Pt(p,Oi(t.doc)))),!o&&!n&&p&&s&&(p=a?a(p,ae.parentElement(e)):p.replace(/[\S]/g,"*"));const i=u==="strict",l=(r=e.parentElement)==null?void 0:r.getAttribute("data-hl-record"),h=u==="default"&&ao(p);return(i||h)&&!l&&d&&!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(d)&&p&&(p=Ii(p)),{type:U.Text,textContent:p||"",rootId:c}}function ml(e,t){const{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:u,maskInputOptions:c={},maskInputFn:f,maskTextClass:m,dataURLOptions:d={},inlineImages:p,inlineVideos:o,recordCanvas:n,keepIframeSrcFn:i,newlyAddedElement:l=!1,privacySetting:h,rootId:g}=t;let b=ys(e,s,a);const y=ys(e,m,null),v=h==="strict";let E=nl(e),S={};const w=e.attributes.length;for(let R=0;R<w;R++){const x=e.attributes[R];ho(E,x.name,x.value)||(S[x.name]=co(r,E,We(x.name),x.value))}if(E==="link"&&u){const R=Array.from(r.styleSheets).find(D=>D.href===e.href);let x=null;R&&(x=pi(R)),x&&(delete S.rel,delete S.href,S._cssText=x)}if(E==="style"&&e.sheet){let R=pi(e.sheet);R&&(e.childNodes.length>1&&(R=Ya(R,e)),S._cssText=R)}if(["input","textarea","select"].includes(E)){const R=e.value,x=e.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&R?S.value=_t({element:e,type:kt(e),tagName:E,value:R,overwriteRecord:e.getAttribute("data-hl-record"),maskInputOptions:c,maskInputFn:f}):x&&(S.checked=x)}if(E==="option"&&(e.selected&&!c.select?S.selected=!0:delete S.selected),E==="dialog"&&e.open&&(S.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),E==="canvas"&&n){if(e.__context==="2d")Wa(e);else if(!("__context"in e)){const R=e.toDataURL(d.type,d.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height;const D=x.toDataURL(d.type,d.quality);R!==D&&(S.rr_dataURL=R)}}if(E==="img"&&p&&!b&&!y&&!v){je||(je=r.createElement("canvas"),ms=je.getContext("2d"));const R=e,x=R.currentSrc||R.getAttribute("src")||"<unknown-src>",D=R.crossOrigin,T=()=>{R.removeEventListener("load",T);try{je.width=R.naturalWidth,je.height=R.naturalHeight,ms.drawImage(R,0,0),S.rr_dataURL=je.toDataURL(d.type,d.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"&&(D?S.crossOrigin=D:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?T():R.addEventListener("load",T)}if(["audio","video"].includes(E)){const R=S;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(l||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),b||y||v&&mi(E)){const{width:R,height:x}=e.getBoundingClientRect();S={class:S.class,rr_width:`${R}px`,rr_height:`${x}px`}}v&&mi(E)&&(b=!0),E==="iframe"&&!i(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src);let C;try{customElements.get(E)&&(C=!0)}catch(R){}const M=R=>{const{width:x,height:D}=R.getBoundingClientRect();S={width:x,height:D,rr_width:`${x}px`,rr_height:`${D}px`,rr_inlined_video:!0,class:S.class,style:S.style},E="canvas";const T=r.createElement("canvas");T.width=e.width,T.height=e.height,S.rr_dataURL=T.toDataURL(d.type,d.quality)};if(E==="video"){const R=e;p&&(R.src===""||R.src.indexOf("blob:")!==-1)&&M(R),o&&R.src!==""&&R.src.indexOf("blob:")===-1&&M(R)}return{type:U.Element,tagName:E,attributes:S,childNodes:[],isSVG:ul(e)||void 0,needBlock:b,needMask:y,rootId:g,isCustom:C}}function J(e){return e==null?"":e.toLowerCase()}function po(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 gl(e,t){if(t.comment&&e.type===U.Comment)return!0;if(e.type===U.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"&&Mi(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:a,blockSelector:u,maskTextClass:c,maskTextSelector:f,skipChild:m=!1,inlineStylesheet:d=!0,maskInputOptions:p={},maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l={},inlineImages:h=!1,inlineVideos:g=!1,recordCanvas:b=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:M=!1,cssCaptured:R=!1,privacySetting:x}=t;let{needsMask:D}=t,{preserveWhiteSpace:T=!0}=t;D||(D=fo(e,c,f,D===void 0));const G=fl(e,{doc:r,mirror:s,blockClass:a,blockSelector:u,needsMask:D,inlineStylesheet:d,maskInputOptions:p,maskTextClass:c,maskTextFn:o,maskInputFn:n,dataURLOptions:l,inlineImages:h,inlineVideos:g,recordCanvas:b,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):gl(G,i)||!T&&G.type===U.Text&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?X=lt:X=uo();const I=Object.assign(G,{id:X});if(s.add(e,I),X===lt)return null;y&&y(e);let ne=!m,P=x,V=x==="strict";if(I.type===U.Element){if(ne=ne&&!I.needBlock,V||(V=!!I.needBlock||!!I.needMask),P=V?"strict":P,V&&mi(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===U.Document||I.type===U.Element)&&ne){i.headWhitespace&&I.type===U.Element&&I.tagName==="head"&&(T=!1);const F={doc:r,mirror:s,blockClass:a,blockSelector:u,needsMask:D,maskTextClass:c,maskTextSelector:f,skipChild:m,inlineStylesheet:d,maskInputOptions:p,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:h,inlineVideos:g,recordCanvas:b,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:C,cssCaptured:!1,privacySetting:P};if(!(I.type===U.Element&&I.tagName==="textarea"&&I.attributes.value!==void 0)){I.type===U.Element&&I.attributes._cssText!==void 0&&typeof I.attributes._cssText=="string"&&(F.cssCaptured=!0);for(const ue of Array.from(ae.childNodes(e))){const N=He(ue,F);N&&I.childNodes.push(N)}}let Z=null;if(xi(e)&&(Z=ae.shadowRoot(e)))for(const ue of Array.from(ae.childNodes(Z))){const N=He(ue,F);N&&(st(Z)&&(N.isShadow=!0),I.childNodes.push(N))}}const H=ae.parentNode(e);return H&&it(H)&&st(H)&&(I.isShadow=!0),I.type===U.Element&&I.tagName==="iframe"&&cl(e,()=>{const F=e.contentDocument;if(F&&v){const Z=He(F,{doc:F,mirror:s,blockClass:a,blockSelector:u,needsMask:D,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:h,inlineVideos:g,recordCanvas:b,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:C,privacySetting:x});Z&&v(e,Z)}},E),I.type===U.Element&&I.tagName==="link"&&typeof I.attributes.rel=="string"&&(I.attributes.rel==="stylesheet"||I.attributes.rel==="preload"&&typeof I.attributes.href=="string"&&Mi(I.attributes.href)==="css")&&hl(e,()=>{if(S){const F=He(e,{doc:r,mirror:s,blockClass:a,blockSelector:u,needsMask:D,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:o,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:h,inlineVideos:g,recordCanvas:b,preserveWhiteSpace:T,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:C,privacySetting:x});F&&S(e,F)}},w),I}function yl(e,t){const{mirror:r=new Ri,blockClass:s="highlight-block",blockSelector:a=null,maskTextClass:u="highlight-mask",maskTextSelector:c=null,inlineStylesheet:f=!0,inlineImages:m=!1,inlineVideos:d=!1,recordCanvas:p=!1,maskAllInputs:o=!1,maskTextFn:n,maskInputFn:i,slimDOM:l=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:E,stylesheetLoadTimeout:S,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=po(l);return He(e,{doc:e,mirror:r,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:M,maskTextFn:n,maskInputFn:i,slimDOMOptions:R,dataURLOptions:h,inlineImages:m,inlineVideos:d,recordCanvas:p,preserveWhiteSpace:g,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:w,newlyAddedElement:!1,privacySetting:C})}const wl=/(max|min)-device-(width|height)/,ws=new RegExp(wl.source,"g"),vl={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ws)&&(e.params=e.params.replace(ws,"$1-$2"))}}}},bl={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 Sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Cl(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 a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),r}var vt={exports:{}},vs;function El(){if(vs)return vt.exports;vs=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 vt.exports=t(),vt.exports.createColors=t,vt.exports}const xl={},Rl=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"})),we=Cl(Rl);var ar,bs;function Ni(){if(bs)return ar;bs=1;let e=El(),t=we;class r extends Error{constructor(a,u,c,f,m,d){super(a),this.name="CssSyntaxError",this.reason=a,m&&(this.file=m),f&&(this.source=f),d&&(this.plugin=d),typeof u!="undefined"&&typeof c!="undefined"&&(typeof u=="number"?(this.line=u,this.column=c):(this.line=u.line,this.column=u.column,this.endLine=c.line,this.endColumn=c.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(a){if(!this.source)return"";let u=this.source;a==null&&(a=e.isColorSupported);let c=i=>i,f=i=>i,m=i=>i;if(a){let{bold:i,gray:l,red:h}=e.createColors(!0);f=g=>i(h(g)),c=g=>l(g),t&&(m=g=>t(g))}let d=u.split(/\r?\n/),p=Math.max(this.line-3,0),o=Math.min(this.line+2,d.length),n=String(o).length;return d.slice(p,o).map((i,l)=>{let h=p+1+l,g=" "+(" "+h).slice(-n)+" | ";if(h===this.line){if(i.length>160){let y=20,v=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),S=i.slice(v,E),w=c(g.replace(/\d/g," "))+i.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return f(">")+c(g)+m(S)+`
4
+ `+w+f("^")}let b=c(g.replace(/\d/g," "))+i.slice(0,this.column-1).replace(/[^\t]/g," ");return f(">")+c(g)+m(i)+`
5
+ `+b+f("^")}return" "+c(g)+m(i)}).join(`
6
+ `)}toString(){let a=this.showSourceCode();return a&&(a=`
19
7
 
20
- `+e+`
21
- `),this.name+": "+this.message+e}};var ui=Cs;Cs.default=Cs;const fn={after:`
8
+ `+a+`
9
+ `),this.name+": "+this.message+a}}return ar=r,r.default=r,ar}var lr,Ss;function mo(){if(Ss)return lr;Ss=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g,r=/[\t\n\f\r "#'()/;[\\\]{}]/;function s(p){return typeof p!="string"||!p.includes("<")?p:p.replace(e,"\\3c $2").replace(t,"\\3c $2")}const a={after:`
22
10
  `,beforeClose:`
23
11
  `,beforeComment:`
24
12
  `,beforeDecl:`
25
13
  `,beforeOpen:" ",beforeRule:`
26
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Vc(s){return s[0].toUpperCase()+s.slice(1)}let Is=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
27
- `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i!="undefined"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return fn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]!="undefined")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Vc(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=fn[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after!="undefined")return t=r.raws.after,t.includes(`
28
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(`
29
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(`
30
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before!="undefined")return t=r.raws.before,t.includes(`
31
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between!="undefined")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before!="undefined"){let n=r.raws.before.split(`
32
- `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t!="undefined"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var _o=Is;Is.default=Is;let Gc=_o;function Es(s,e){new Gc(e).stringify(s)}var Wr=Es;Es.default=Es;var Dt={};Dt.isClean=Symbol("isClean");Dt.my=Symbol("my");let jc=ui,Hc=_o,Yc=Wr,{isClean:ut,my:Zc}=Dt;function xs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>xs(o,t)):(n==="object"&&i!==null&&(i=xs(i)),t[r]=i)}return t}function Se(s,e){if(e&&typeof e.offset!="undefined")return e.offset;let t=1,r=1,i=0;for(let n=0;n<s.length;n++){if(r===e.line&&t===e.column){i=n;break}s[n]===`
33
- `?(t=1,r+=1):t+=1}return i}let Ms=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[ut]=!1,this[Zc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=xs(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new jc(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[ut]=!0}markDirty(){if(this[ut]){this[ut]=!1;let e=this;for(;e=e.parent;)e[ut]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(Se(r,this.source.start),Se(r,this.source.end)).indexOf(e.word);n!==-1&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,n=Se(i,this.source.start),o=n+e;for(let l=n;l<o;l++)i[l]===`
34
- `?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Se(t,this.source.start)},i=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:Se(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let o=t.slice(Se(t,this.source.start),Se(t,this.source.end)).indexOf(e.word);o!==-1&&(r=this.positionInside(o),i=this.positionInside(o+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:Se(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line,offset:Se(t,e.end)}:typeof e.endIndex=="number"?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(e,t){return new Hc().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){if(l==null)continue;let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Yc){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r={}){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}};var Ur=Ms;Ms.default=Ms;let Xc=Ur,Rs=class extends Xc{constructor(e){super(e),this.type="comment"}};var zr=Rs;Rs.default=Rs;let Jc=Ur,As=class extends Jc{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=te(O({},e),{value:String(e.value)})),super(e),this.type="decl"}};var Vr=As;As.default=As;let ko=zr,Lo=Vr,Kc=Ur,{isClean:Po,my:$o}=Dt,hi,Fo,Bo,fi;function Wo(s){return s.map(e=>(e.nodes&&(e.nodes=Wo(e.nodes)),delete e.source,e))}function Uo(s){if(s[Po]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Uo(e)}let xe=class zo extends Kc{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(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Wo(Fo(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Lo(e)]}else if(e.selector||e.selectors)e=[new fi(e)];else if(e.name)e=[new hi(e)];else if(e.text)e=[new ko(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[$o]||zo.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Po]&&Uo(i),i.raws||(i.raws={}),typeof i.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}};xe.registerParse=s=>{Fo=s};xe.registerRule=s=>{fi=s};xe.registerAtRule=s=>{hi=s};xe.registerRoot=s=>{Bo=s};var ze=xe;xe.default=xe;xe.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,hi.prototype):s.type==="rule"?Object.setPrototypeOf(s,fi.prototype):s.type==="decl"?Object.setPrototypeOf(s,Lo.prototype):s.type==="comment"?Object.setPrototypeOf(s,ko.prototype):s.type==="root"&&Object.setPrototypeOf(s,Bo.prototype),s[$o]=!0,s.nodes&&s.nodes.forEach(e=>{xe.rebuild(e)})};let Vo=ze,Mr=class extends Vo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var di=Mr;Mr.default=Mr;Vo.registerAtRule(Mr);let Qc=ze,Go,jo,It=class extends Qc{constructor(e){super(O({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new Go(new jo,this,e).stringify()}};It.registerLazyResult=s=>{Go=s};It.registerProcessor=s=>{jo=s};var pi=It;It.default=It;let qc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",eu=(s=21)=>{let e="",t=s|0;for(;t--;)e+=qc[Math.random()*64|0];return e};var tu={nanoid:eu};let{existsSync:ru,readFileSync:su}=pe,{dirname:os,join:iu}=pe,{SourceMapConsumer:dn,SourceMapGenerator:pn}=pe;function nu(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Ns=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=os(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new dn(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,o=e.match(i)||e.match(n);if(o)return decodeURIComponent(e.substr(o[0].length));let l=e.match(t)||e.match(r);if(l)return nu(e.substr(l[0].length));let a=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=os(e),ru(e))return this.mapFile=e,su(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof dn)return pn.fromSourceMap(t).toString();if(t instanceof pn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=iu(os(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Ho=Ns;Ns.default=Ns;let{nanoid:ou}=tu,{isAbsolute:Os,resolve:Ts}=pe,{SourceMapConsumer:au,SourceMapGenerator:lu}=pe,{fileURLToPath:mn,pathToFileURL:Ht}=pe,gn=ui,cu=Ho,as=pe,ls=Symbol("lineToIndexCache"),uu=!!(au&&lu),yn=!!(Ts&&Os);function wn(s){if(s[ls])return s[ls];let e=s.css.split(`
35
- `),t=new Array(e.length),r=0;for(let i=0,n=e.length;i<n;i++)t[i]=r,r+=e[i].length+1;return s[ls]=t,t}let Rr=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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,t.document&&(this.document=t.document.toString()),t.from&&(!yn||/^\w+:\/\//.test(t.from)||Os(t.from)?this.file=t.from:this.file=Ts(t.from)),yn&&uu){let r=new cu(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+ou(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l,a,c;if(t&&typeof t=="object"){let h=t,f=r;if(typeof h.offset=="number"){a=h.offset;let d=this.fromOffset(a);t=d.line,r=d.col}else t=h.line,r=h.column,a=this.fromLineAndColumn(t,r);if(typeof f.offset=="number"){l=f.offset;let d=this.fromOffset(l);o=d.line,n=d.col}else o=f.line,n=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)a=this.fromLineAndColumn(t,r);else{a=t;let h=this.fromOffset(a);t=h.line,r=h.col}let u=this.origin(t,r,o,n);return u?c=new gn(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):c=new gn(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:n,line:o},this.css,this.file,i.plugin),c.input={column:r,endColumn:n,endLine:o,endOffset:l,line:t,offset:a,source:this.css},this.file&&(Ht&&(c.input.url=Ht(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,t){return wn(this)[e-1]+t-1}fromOffset(e){let t=wn(this),r=t[t.length-1],i=0;if(e>=r)i=t.length-1;else{let n=t.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<t[o])n=o-1;else if(e>=t[o+1])i=o+1;else{i=o;break}}return{col:e-t[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ts(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Os(o.source)?a=Ht(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||Ht(this.map.mapFile));let c={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(mn)c.file=mn(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(c.source=u),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map=O({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var Gr=Rr;Rr.default=Rr;as&&as.registerInput&&as.registerInput(Rr);let Yo=ze,Zo,Xo,tt=class extends Yo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Zo(new Xo,this,e).stringify()}};tt.registerLazyResult=s=>{Zo=s};tt.registerProcessor=s=>{Xo=s};var _t=tt;tt.default=tt;Yo.registerRoot(tt);let Et={comma(s){return Et.split(s,[","],!0)},space(s){let e=[" ",`
36
- `," "];return Et.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",c=!1;for(let u of s)c?c=!1:u==="\\"?c=!0:l?u===a&&(l=!1):u==='"'||u==="'"?(l=!0,a=u):u==="("?o+=1:u===")"?o>0&&(o-=1):o===0&&e.includes(u)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=u;return(t||i!=="")&&r.push(i.trim()),r}};var Jo=Et;Et.default=Et;let Ko=ze,hu=Jo,Ar=class extends Ko{get selectors(){return hu.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var mi=Ar;Ar.default=Ar;Ko.registerRule(Ar);let fu=di,du=zr,pu=Vr,mu=Gr,gu=Ho,yu=_t,wu=mi;function xt(s,e){if(Array.isArray(s))return s.map(o=>xt(o));let i=s,{inputs:t}=i,r=je(i,["inputs"]);if(t){e=[];for(let o of t){let l=te(O({},o),{__proto__:mu.prototype});l.map&&(l.map=te(O({},l.map),{__proto__:gu.prototype})),e.push(l)}}if(r.nodes&&(r.nodes=s.nodes.map(o=>xt(o,e))),r.source){let n=r.source,{inputId:o}=n,l=je(n,["inputId"]);r.source=l,o!=null&&(r.source.input=e[o])}if(r.type==="root")return new yu(r);if(r.type==="decl")return new pu(r);if(r.type==="rule")return new wu(r);if(r.type==="comment")return new du(r);if(r.type==="atrule")return new fu(r);throw new Error("Unknown node type: "+s.type)}var bu=xt;xt.default=xt;let{dirname:mr,relative:Qo,resolve:qo,sep:ea}=pe,{SourceMapConsumer:ta,SourceMapGenerator:gr}=pe,{pathToFileURL:bn}=pe,vu=Gr,Su=!!(ta&&gr),Cu=!!(mr&&qo&&Qo&&ea),Iu=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
14
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function u(p){return p[0].toUpperCase()+p.slice(1)}function c(p,o){let n="@"+o.name,i=o.params?p.rawValue(o,"params"):"",l=o.raws.afterName;return typeof l=="undefined"?l=i?" ":"":l===""&&i&&!r.test(i[0])&&(l=" "),n+l+i}function f(p,o,n){let i=n.nodes,l=i.length-1;for(;l>0&&i[l].type==="comment";)l-=1;let h=p.raw(n,"semicolon"),g=n.type==="document";for(let b=i.length-1;b>=0;b--){let y=i[b],v=l!==b||h;!v&&b<i.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&y.prop.startsWith("--"))&&(v=!0),o.push({document:g,node:y,semicolon:v})}}function m(p,o,n,i){let l=p.raw(n,"between","beforeOpen");p.builder(s(i+l)+"{",n,"start");let h=n.nodes&&n.nodes.length,g=()=>{let b=h?p.raw(n,"after"):p.raw(n,"after","emptyBody");b&&p.builder(s(b)),p.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&p.builder(s(n.raws.ownSemicolon),n,"end")};h?(o.push(g),f(p,o,n)):g()}class d{constructor(o){this.builder=o}atrule(o,n){let i=c(this,o);if(o.nodes)this.block(o,i);else{let l=(o.raws.between||"")+(n?";":"");this.builder(s(i+l),o)}}beforeAfter(o,n){let i;o.type==="decl"?i=this.raw(o,null,"beforeDecl"):o.type==="comment"?i=this.raw(o,null,"beforeComment"):n==="before"?i=this.raw(o,null,"beforeRule"):i=this.raw(o,null,"beforeClose");let l=o.parent,h=0;for(;l&&l.type!=="root";)h+=1,l=l.parent;if(i.includes(`
15
+ `)){let g=this.raw(o,null,"indent");if(g.length)for(let b=0;b<h;b++)i+=g}return i}block(o,n){let i=this.raw(o,"between","beforeOpen");this.builder(s(n+i)+"{",o,"start");let l;o.nodes&&o.nodes.length?(this.body(o),l=this.raw(o,"after")):l=this.raw(o,"after","emptyBody"),l&&this.builder(s(l)),this.builder("}",o,"end")}body(o){let n=d.prototype,i=["atrule","block","body","rule","stringify"].every(h=>this[h]===n[h]),l=[];for(f(this,l,o);l.length>0;){let h=l.pop();if(typeof h=="function"){h();continue}let g=h.node,b=this.raw(g,"before");b&&this.builder(h.document?b:s(b)),i&&g.type==="rule"?m(this,l,g,this.rawValue(g,"selector")):i&&g.type==="atrule"&&g.nodes?m(this,l,g,c(this,g)):this.stringify(g,h.semicolon)}}comment(o){let n=this.raw(o,"left","commentLeft"),i=this.raw(o,"right","commentRight");this.builder(s("/*"+n+o.text+i+"*/"),o)}decl(o,n){let i=o.raws,l=this.raw(o,"between","colon"),h=o.prop+l+this.rawValue(o,"value");o.important&&(h+=i.important||" !important"),n&&(h+=";"),this.builder(s(h),o)}document(o){this.body(o)}raw(o,n,i){let l;if(i||(i=n),n&&(l=o.raws[n],typeof l!="undefined"))return l;let h=o.parent;if(i==="before"&&(!h||h.type==="root"&&h.first===o||h&&h.type==="document"))return"";if(!h)return a[i];let g=o.root(),b=g.rawCache||(g.rawCache={});if(typeof b[i]!="undefined")return b[i];if(i==="before"||i==="after")return this.beforeAfter(o,i);{let y="raw"+u(i);this[y]?l=this[y](g,o):g.walk(v=>{if(l=v.raws[n],typeof l!="undefined")return!1})}return typeof l=="undefined"&&(l=a[i]),b[i]=l,l}rawBeforeClose(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after!="undefined")return n=i.raws.after,n.includes(`
16
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(o,n){let i;return o.walkComments(l=>{if(typeof l.raws.before!="undefined")return i=l.raws.before,i.includes(`
17
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(o,n){let i;return o.walkDecls(l=>{if(typeof l.raws.before!="undefined")return i=l.raws.before,i.includes(`
18
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(o){let n;return o.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n!="undefined"))return!1}),n}rawBeforeRule(o){let n;return o.walk(i=>{if(i.nodes&&(i.parent!==o||o.first!==i)&&typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
19
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(o){let n;return o.walkDecls(i=>{if(typeof i.raws.between!="undefined")return n=i.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n!="undefined"))return!1}),n}rawIndent(o){if(o.raws.indent)return o.raws.indent;let n;return o.walk(i=>{let l=i.parent;if(l&&l!==o&&l.parent&&l.parent===o&&typeof i.raws.before!="undefined"){let h=i.raws.before.split(`
20
+ `);return n=h[h.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n!="undefined"))return!1}),n}rawValue(o,n){let i=o[n],l=o.raws[n];return l&&l.value===i?l.raw:i}root(o){if(o.source&&o.source.input.hasBOM&&this.builder("\uFEFF",o,"start"),this.body(o),o.raws.after){let n=o.raws.after,i=o.parent&&o.parent.type==="document";this.builder(i?n:s(n))}}rule(o){this.block(o,this.rawValue(o,"selector")),o.raws.ownSemicolon&&this.builder(s(o.raws.ownSemicolon),o,"end")}stringify(o,n){if(!this[o.type])throw new Error("Unknown AST node type "+o.type+". Maybe you need to change PostCSS stringifier.");this[o.type](o,n)}}return lr=d,d.default=d,lr}var ur,Cs;function jt(){if(Cs)return ur;Cs=1;let e=mo();function t(r,s){new e(s).stringify(r)}return ur=t,t.default=t,ur}var bt={},Es;function Vt(){return Es||(Es=1,bt.isClean=Symbol("isClean"),bt.my=Symbol("my")),bt}var cr,xs;function qt(){if(xs)return cr;xs=1;let e=Ni(),t=mo(),r=jt(),{isClean:s,my:a}=Vt();function u(m,d){let p=new m.constructor,o=[[m,p,d]];for(;o.length>0;){let[n,i,l]=o.pop();for(let h in n){if(!Object.prototype.hasOwnProperty.call(n,h)||h==="proxyCache")continue;let g=n[h],b=typeof g;if(h==="parent"&&b==="object")l&&(i[h]=l);else if(h==="source")i[h]=g;else if(Array.isArray(g)){let y=[];i[h]=y;for(let v of g){let E=new v.constructor;y.push(E),o.push([v,E,i])}}else{if(b==="object"&&g!==null){let y=new g.constructor;o.push([g,y,void 0]),g=y}i[h]=g}}}return p}function c(m,d){if(d&&typeof d.offset!="undefined")return d.offset;let p=1,o=1,n=0;for(let i=0;i<m.length;i++){if(o===d.line&&p===d.column){n=i;break}m[i]===`
21
+ `?(p=1,o+=1):p+=1}return n}class f{get proxyOf(){return this}constructor(d={}){this.raws={},this[s]=!1,this[a]=!0;for(let p of Object.keys(d))if(p!=="__proto__")if(p==="nodes"){this.nodes=[];for(let o of d[p])typeof o.clone=="function"&&o.parent?this.append(o.clone()):this.append(o)}else this[p]=d[p]}addToError(d){if(d.postcssNode=this,d.stack&&this.source&&/\n\s{4}at /.test(d.stack)){let p=this.source;d.stack=d.stack.replace(/\n\s{4}at /,`$&${p.input.from}:${p.start.line}:${p.start.column}$&`)}return d}after(d){return this.parent.insertAfter(this,d),this}assign(d={}){for(let p in d)this[p]=d[p];return this}before(d){return this.parent.insertBefore(this,d),this}cleanRaws(d){delete this.raws.before,delete this.raws.after,d||delete this.raws.between}clone(d={}){let p=u(this);for(let o in d)p[o]=d[o];return p}cloneAfter(d={}){let p=this.clone(d);return this.parent.insertAfter(this,p),p}cloneBefore(d={}){let p=this.clone(d);return this.parent.insertBefore(this,p),p}error(d,p={}){if(this.source){let{end:o,start:n}=this.rangeBy(p);return this.source.input.error(d,{column:n.column,line:n.line},{column:o.column,line:o.line},p)}return new e(d)}getProxyProcessor(){return{get(d,p){return p==="proxyOf"?d:p==="root"?()=>d.root().toProxy():d[p]},set(d,p,o){return d[p]===o||(d[p]=o,(p==="prop"||p==="value"||p==="name"||p==="params"||p==="important"||p==="text")&&d.markDirty()),!0}}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let d=this;for(;d=d.parent;)d[s]=!1}}next(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d+1]}positionBy(d={}){let p="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:c(p,this.source.start)};if(d.index)o=this.positionInside(d.index);else if(d.word){let i=p.slice(c(p,this.source.start),c(p,this.source.end)).indexOf(d.word);i!==-1&&(o=this.positionInside(i))}return o}positionInside(d){let p=this.source.start.column,o=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=c(n,this.source.start),l=i+d;for(let h=i;h<l;h++)n[h]===`
22
+ `?(p=1,o+=1):p+=1;return{column:p,line:o,offset:l}}prev(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d-1]}rangeBy(d={}){let p="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:c(p,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:c(p,this.source.end)+1}:{column:o.column+1,line:o.line,offset:o.offset+1};if(d.word){let l=p.slice(c(p,this.source.start),c(p,this.source.end)).indexOf(d.word);l!==-1&&(o=this.positionInside(l),n=this.positionInside(l+d.word.length))}else d.start?o={column:d.start.column,line:d.start.line,offset:c(p,d.start)}:typeof d.index=="number"&&(o=this.positionInside(d.index)),d.end?n={column:d.end.column,line:d.end.line,offset:c(p,d.end)}:typeof d.endIndex=="number"?n=this.positionInside(d.endIndex):typeof d.index=="number"&&(n=this.positionInside(d.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(d,p){return new t().raw(this,d,p)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...d){if(this.parent){let p=this,o=!1;for(let n of d)n===this?o=!0:o?(this.parent.insertAfter(p,n),p=n):this.parent.insertBefore(p,n);o||this.remove()}return this}root(){let d=this;for(;d.parent&&d.parent.type!=="document";)d=d.parent;return d}toJSON(d,p){let o=p==null;p=p||new Map;let n=[],i=[[this,n,0]];for(let h=0;h<i.length;h++){let[g,b,y]=i[h],v={};b[y]=v;for(let E in g){if(!Object.prototype.hasOwnProperty.call(g,E)||E==="parent"||E==="proxyCache")continue;let S=g[E];if(Array.isArray(S)){let w=[];v[E]=w;for(let C=0;C<S.length;C++){let M=S[C];typeof M=="object"&&M.toJSON?M.toJSON===f.prototype.toJSON?i.push([M,w,C]):w[C]=M.toJSON(null,p):w[C]=M}}else if(typeof S=="object"&&S.toJSON)S.toJSON===f.prototype.toJSON?i.push([S,v,E]):v[E]=S.toJSON(null,p);else if(E==="source"){if(S==null)continue;let w=p.get(S.input);w==null&&(w=p.size,p.set(S.input,w)),v[E]={end:S.end,inputId:w,start:S.start}}else v[E]=S}}let l=n[0];return o&&(l.inputs=[...p.keys()].map(h=>h.toJSON())),l}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(d=r){d.stringify&&(d=d.stringify);let p="";return d(this,o=>{p+=o}),p}warn(d,p,o={}){let n={node:this};for(let i in o)n[i]=o[i];return d.warn(p,n)}}return cr=f,f.default=f,cr}var hr,Rs;function Gt(){if(Rs)return hr;Rs=1;let e=qt();class t extends e{constructor(s){super(s),this.type="comment"}}return hr=t,t.default=t,hr}var fr,Ms;function Ht(){if(Ms)return fr;Ms=1;let e=qt();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 dr,Is;function Le(){if(Is)return dr;Is=1;let e=Gt(),t=Ht(),r=qt(),{isClean:s,my:a}=Vt(),u,c,f,m;function d(n){let i=n.slice();for(;i.length>0;){let l=i.pop();if(delete l.source,l.nodes){l.nodes=l.nodes.slice();for(let h of l.nodes)i.push(h)}}return n.slice()}function p(n){let i=[n];for(;i.length>0;){let l=i.pop();if(l[s]=!1,l.proxyOf.nodes)for(let h of l.proxyOf.nodes)i.push(h)}}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 l of i){let h=this.normalize(l,this.last);for(let g of h)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(i){let l=[this];for(;l.length>0;){let h=l.pop();if(h!==this&&h.cleanRaws!==o.prototype.cleanRaws){h.cleanRaws(i);continue}if(r.prototype.cleanRaws.call(h,i),h.nodes)for(let g of h.nodes)l.push(g)}}each(i){if(!this.proxyOf.nodes)return;let l=this.getIterator(),h,g;for(;this.indexes[l]<this.proxyOf.nodes.length&&(h=this.indexes[l],g=i(this.proxyOf.nodes[h],h),g!==!1);)this.indexes[l]+=1;return delete this.indexes[l],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,l){return l==="proxyOf"?i:i[l]?l==="each"||typeof l=="string"&&l.startsWith("walk")?(...h)=>i[l](...h.map(g=>typeof g=="function"?(b,y)=>g(b.toProxy(),y):g)):l==="every"||l==="some"?h=>i[l]((g,...b)=>h(g.toProxy(),...b)):l==="root"?()=>i.root().toProxy():l==="nodes"?i.nodes.map(h=>h.toProxy()):l==="first"||l==="last"?i[l].toProxy():i[l]:i[l]},set(i,l,h){return i[l]===h||(i[l]=h,(l==="name"||l==="params"||l==="selector")&&i.markDirty()),!0}}}index(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))}insertAfter(i,l){let h=this.index(i),g=this.normalize(l,this.proxyOf.nodes[h]).reverse();h=this.index(i);for(let y of g)this.proxyOf.nodes.splice(h+1,0,y);let b;for(let y in this.indexes)b=this.indexes[y],h<b&&(this.indexes[y]=b+g.length);return this.markDirty(),this}insertBefore(i,l){let h=this.index(i),g=h===0?"prepend":!1,b=this.normalize(l,this.proxyOf.nodes[h],g).reverse();h=this.index(i);for(let v of b)this.proxyOf.nodes.splice(h,0,v);let y;for(let v in this.indexes)y=this.indexes[v],h<=y&&(this.indexes[v]=y+b.length);return this.markDirty(),this}normalize(i,l){if(typeof i=="string")i=d(c(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 u(i)];else if(i.text)i=[new e(i)];else throw new Error("Unknown node type in node creation");return i.map(g=>(g[a]||o.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[s]&&p(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&l&&typeof l.raws.before!="undefined"&&(g.raws.before=l.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...i){i=i.reverse();for(let l of i){let h=this.normalize(l,this.first,"prepend").reverse();for(let g of h)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+h.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 l;for(let h in this.indexes)l=this.indexes[h],l>=i&&(this.indexes[h]=l-1);return this.markDirty(),this}replaceValues(i,l,h){return h||(h=l,l={}),this.walkDecls(g=>{l.props&&!l.props.includes(g.prop)||l.fast&&!g.value.includes(l.fast)||(g.value=g.value.replace(i,h))}),this.markDirty(),this}some(i){return this.nodes.some(i)}walk(i){if(!this.proxyOf.nodes)return;let l=[{iterator:this.getIterator(),node:this.proxyOf}];for(;l.length>0;){let{iterator:h,node:g}=l[l.length-1],b=g.indexes[h];if(b>=g.proxyOf.nodes.length){delete g.indexes[h],l.pop();let E=l[l.length-1];E&&(E.node.indexes[E.iterator]+=1);continue}let y=g.proxyOf.nodes[b],v;try{v=i(y,b)}catch(E){throw y.addToError(E)}if(v===!1){for(let E of l)delete E.node.indexes[E.iterator];return!1}y.walk&&y.proxyOf.nodes?l.push({iterator:y.getIterator(),node:y}):g.indexes[h]+=1}}walkAtRules(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="atrule"&&i.test(h.name))return l(h,g)}):this.walk((h,g)=>{if(h.type==="atrule"&&h.name===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="atrule")return l(h,g)}))}walkComments(i){return this.walk((l,h)=>{if(l.type==="comment")return i(l,h)})}walkDecls(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="decl"&&i.test(h.prop))return l(h,g)}):this.walk((h,g)=>{if(h.type==="decl"&&h.prop===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="decl")return l(h,g)}))}walkRules(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="rule"&&i.test(h.selector))return l(h,g)}):this.walk((h,g)=>{if(h.type==="rule"&&h.selector===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="rule")return l(h,g)}))}}return o.registerParse=n=>{c=n},o.registerRule=n=>{m=n},o.registerAtRule=n=>{u=n},o.registerRoot=n=>{f=n},dr=o,o.default=o,o.rebuild=n=>{let i=[n];for(;i.length>0;){let l=i.pop();if(l.type==="atrule"?Object.setPrototypeOf(l,u.prototype):l.type==="rule"?Object.setPrototypeOf(l,m.prototype):l.type==="decl"?Object.setPrototypeOf(l,t.prototype):l.type==="comment"?Object.setPrototypeOf(l,e.prototype):l.type==="root"&&Object.setPrototypeOf(l,f.prototype),l[a]=!0,l.nodes)for(let h of l.nodes)i.push(h)}},dr}var pr,Os;function Ti(){if(Os)return pr;Os=1;let e=Le();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 pr=t,t.default=t,e.registerAtRule(t),pr}var mr,Ns;function Di(){if(Ns)return mr;Ns=1;let e=Le(),t,r;class s extends e{constructor(u){super(L({type:"document"},u)),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new r,this,u).stringify()}}return s.registerLazyResult=a=>{t=a},s.registerProcessor=a=>{r=a},mr=s,s.default=s,mr}var gr,Ts;function Ml(){if(Ts)return gr;Ts=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return gr={nanoid:(s=21)=>{let a="",u=s|0;for(;u-- >0;)a+=e[Math.random()*64|0];return a},customAlphabet:(s,a=21)=>(u=a)=>{let c="",f=u|0;for(;f-- >0;)c+=s[Math.random()*s.length|0];return c}},gr}var yr,Ds;function go(){if(Ds)return yr;Ds=1;let{existsSync:e,readFileSync:t}=we,{dirname:r,isAbsolute:s,join:a,relative:u,sep:c}=we,{SourceMapConsumer:f,SourceMapGenerator:m}=we;function d(o){return Buffer?Buffer.from(o,"base64").toString():window.atob(o)}class p{constructor(n,i){if(i.map===!1)return;i.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(n),this.inline=this.startWith(this.annotation,"data:");let l=i.map?i.map.prev:void 0,h=this.loadMap(i.from,l);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new f(this.json||this.text)),this.consumerCache}decodeInline(n){let i=/^data:application\/json;charset=utf-?8;base64,/,l=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,g=/^data:application\/json,/,b=n.match(h)||n.match(g);if(b)return decodeURIComponent(n.substr(b[0].length));let y=n.match(i)||n.match(l);if(y)return d(n.substr(y[0].length));let v=n.slice(22);throw v=v.slice(0,v.indexOf(",")),new Error("Unsupported source map encoding "+v)}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 l=n.lastIndexOf(i.pop()),h=n.indexOf("*/",l);l>-1&&h>-1&&(this.annotation=this.getAnnotationURL(n.substring(l,h)))}loadFile(n,i,l){if(!l&&!this.unsafeMap){if(!/\.map$/i.test(n)||!i)return;let h=u(r(i),n);if(h===".."||h.startsWith(".."+c)||s(h))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 l=i(n);if(l){let h=this.loadFile(l,n,!0);if(!h)throw new Error("Unable to load previous source map: "+l.toString());return h}}else{if(i instanceof f)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 l=this.annotation;n&&(l=a(r(n),l));let h=this.loadFile(l,n,!1);if(h)try{this.json=JSON.parse(h.replace(/^\)]}'[^\n]*\n/,""))}catch(g){return}return h}}}startWith(n,i){return n?n.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return yr=p,p.default=p,yr}var wr,As;function Yt(){if(As)return wr;As=1;let{nanoid:e}=Ml(),{isAbsolute:t,resolve:r}=we,{SourceMapConsumer:s,SourceMapGenerator:a}=we,{fileURLToPath:u,pathToFileURL:c}=we,f=Ni(),m=go(),d=we,p=Symbol("lineToIndexCache"),o=!!(s&&a),n=!!(r&&t);function i(h){if(h[p])return h[p];let g=h.css.split(`
23
+ `),b=new Array(g.length),y=0;for(let v=0,E=g.length;v<E;v++)b[v]=y,y+=g[v].length+1;return h[p]=b,b}class l{get from(){return this.file||this.id}constructor(g,b={}){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,b.document&&(this.document=b.document.toString()),b.from&&(!n||/^\w+:\/\//.test(b.from)||t(b.from)?this.file=b.from:this.file=r(b.from)),n&&o){let y=new m(this.css,b);if(y.text){this.map=y;let v=y.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,b,y,v={}){let E,S,w,C,M;if(b&&typeof b=="object"){let x=b,D=y;if(typeof x.offset=="number"){C=x.offset;let T=this.fromOffset(C);b=T.line,y=T.col}else b=x.line,y=x.column,C=this.fromLineAndColumn(b,y);if(typeof D.offset=="number"){w=D.offset;let T=this.fromOffset(w);S=T.line,E=T.col}else S=D.line,E=D.column,w=this.fromLineAndColumn(D.line,D.column)}else if(y)C=this.fromLineAndColumn(b,y);else{C=b;let x=this.fromOffset(C);b=x.line,y=x.col}let R=this.origin(b,y,S,E);return R?M=new f(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,v.plugin):M=new f(g,S===void 0?b:{column:y,line:b},S===void 0?y:{column:E,line:S},this.css,this.file,v.plugin),M.input={column:y,endColumn:E,endLine:S,endOffset:w,line:b,offset:C,source:this.css},this.file&&(c&&(M.input.url=c(this.file).toString()),M.input.file=this.file),M}fromLineAndColumn(g,b){return i(this)[g-1]+b-1}fromOffset(g){let b=i(this),y=b[b.length-1],v=0;if(g>=y)v=b.length-1;else{let E=b.length-2,S;for(;v<E;)if(S=v+(E-v>>1),g<b[S])E=S-1;else if(g>=b[S+1])v=S+1;else{v=S;break}}return{col:g-b[v]+1,line:v+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,b,y,v){if(!this.map)return!1;let E=this.map.consumer(),S=E.originalPositionFor({column:b-1,line:g});if(!S.source)return!1;let w;if(typeof y=="number"){let x=E.originalPositionFor({column:v-1,line:y});x.source&&(w=x)}let C;t(S.source)?C=c(S.source):C=new URL(S.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let M={column:S.column+1,endColumn:w&&w.column+1,endLine:w&&w.line,line:S.line,url:C.toString()};if(C.protocol==="file:")if(u)M.file=u(C);else throw new Error("file: protocol is not available in this PostCSS build");let R=E.sourceContentFor(S.source);return R&&(M.source=R),M}toJSON(){let g={};for(let b of["hasBOM","css","file","id"])this[b]!=null&&(g[b]=this[b]);return this.map&&(g.map=L({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return wr=l,l.default=l,d&&d.registerInput&&d.registerInput(l),wr}var vr,_s;function ut(){if(_s)return vr;_s=1;let e=Le(),t,r;class s extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,c,f){let m=new Set;for(let p of Array.isArray(u)?u:[u])p&&typeof p=="object"&&!p.parent&&p.raws&&typeof p.raws.before!="undefined"&&m.add(p.raws);let d=super.normalize(u);if(c){if(f==="prepend")this.nodes.length>1?c.raws.before=this.nodes[1].raws.before:delete c.raws.before;else if(this.first!==c)for(let p of d)m.has(p.raws)||(p.raws.before=c.raws.before)}return d}removeChild(u,c){let f=this.index(u);return!c&&f===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[f].raws.before),super.removeChild(u)}toResult(u={}){return new t(new r,this,u).stringify()}}return s.registerLazyResult=a=>{t=a},s.registerProcessor=a=>{r=a},vr=s,s.default=s,e.registerRoot(s),vr}var br,ks;function yo(){if(ks)return br;ks=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
24
+ `," "];return e.split(t,r)},split(t,r,s){if(!t)return[];let a=[],u="",c=!1,f=0,m=!1,d="",p=!1;for(let o of t)p?p=!1:o==="\\"?p=!0:m?o===d&&(m=!1):o==='"'||o==="'"?(m=!0,d=o):o==="("?f+=1:o===")"?f>0&&(f-=1):f===0&&r.includes(o)&&(c=!0),c?(u!==""&&a.push(u.trim()),u="",c=!1):u+=o;return(s||u!=="")&&a.push(u.trim()),a}};return br=e,e.default=e,br}var Sr,Ps;function Ai(){if(Ps)return Sr;Ps=1;let e=Le(),t=yo();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(a){let u=this.selector?this.selector.match(/,\s*/):null,c=u?u[0]:","+this.raw("between","beforeOpen");this.selector=a.join(c)}constructor(a){super(a),this.type="rule",this.nodes||(this.nodes=[])}}return Sr=r,r.default=r,e.registerRule(r),Sr}var Cr,Ls;function Il(){if(Ls)return Cr;Ls=1;let e=Ti(),t=Gt(),r=Ht(),s=Yt(),a=go(),u=ut(),c=Ai();function f(p,o){return p.inputs?p.inputs.map(n=>{let i=se(L({},n),{__proto__:s.prototype});return i.map&&(i.map=se(L({},i.map),{__proto__:a.prototype})),i}):o}function m(p,o,n){let i=L({},p);if(delete i.inputs,delete i.nodes,i.source){let h=i.source,{inputId:g}=h,b=mt(h,["inputId"]);i.source=b,g!=null&&(i.source.input=o[g])}let l;if(i.type==="root")l=new u(i);else if(i.type==="decl")l=new r(i);else if(i.type==="rule")l=new c(i);else if(i.type==="comment")l=new t(i);else if(i.type==="atrule")l=new e(i);else throw new Error("Unknown node type: "+p.type);if(n){l.nodes=n;for(let g of n)g.parent=l}return l}function d(p,o){if(Array.isArray(p))return p.map(l=>d(l));let n,i=[{childIndex:0,children:[],inputs:f(p,o),json:p}];for(;i.length>0;){let l=i[i.length-1],h=l.json.nodes;if(h&&l.childIndex<h.length){let b=h[l.childIndex];l.childIndex+=1,i.push({childIndex:0,children:[],inputs:f(b,l.inputs),json:b});continue}i.pop();let g=m(l.json,l.inputs,h?l.children:void 0);i.length>0?i[i.length-1].children.push(g):n=g}return n}return Cr=d,d.default=d,Cr}var Er,Fs;function wo(){if(Fs)return Er;Fs=1;let{dirname:e,relative:t,resolve:r,sep:s}=we,{SourceMapConsumer:a,SourceMapGenerator:u}=we,{pathToFileURL:c}=we,f=Yt(),m=!!(a&&u),d=!!(e&&r&&t&&s);class p{constructor(n,i,l,h){this.stringify=n,this.mapOpts=l.map||{},this.root=i,this.opts=l,this.css=h,this.originalCSS=h,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=`
37
25
  `;this.css.includes(`\r
38
- `)&&(t=`\r
39
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||mr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new ta(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Cu&&Su&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=gr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gr({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 gr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=l.match(/\n/g),o?(e+=o.length,n=l.lastIndexOf(`
40
- `),t=l.length-n):t+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?mr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=mr(qo(r,this.mapOpts.annotation)));let i=Qo(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new vu(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(bn){let r=bn(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;ea==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var ra=Iu;const cs=39,vn=34,Yt=92,Sn=47,Zt=10,ht=32,Xt=12,Jt=9,Kt=13,Eu=91,xu=93,Mu=40,Ru=41,Au=123,Nu=125,Ou=59,Tu=42,Du=58,_u=64,Qt=/[\t\n\f\r "#'()/;[\\\]{}]/g,qt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ku=/.[\r\n"'(/\\]/,Cn=/[\da-f]/i;var Lu=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,c,u,h,f,d,m,g=r.length,p=0,y=[],v=[];function b(){return p}function S(D){throw e.error("Unclosed "+D,p)}function C(){return v.length===0&&p>=g}function R(D){if(v.length)return v.pop();if(p>=g)return;let I=D?D.ignoreUnclosed:!1;switch(n=r.charCodeAt(p),n){case Zt:case ht:case Jt:case Kt:case Xt:{a=p;do a+=1,n=r.charCodeAt(a);while(n===ht||n===Zt||n===Jt||n===Kt||n===Xt);u=["space",r.slice(p,a)],p=a-1;break}case Eu:case xu:case Au:case Nu:case Du:case Ou:case Ru:{let x=String.fromCharCode(n);u=[x,x,p];break}case Mu:{if(m=y.length?y.pop()[1]:"",d=r.charCodeAt(p+1),m==="url"&&d!==cs&&d!==vn&&d!==ht&&d!==Zt&&d!==Jt&&d!==Xt&&d!==Kt){a=p;do{if(h=!1,a=r.indexOf(")",a+1),a===-1)if(i||I){a=p;break}else S("bracket");for(f=a;r.charCodeAt(f-1)===Yt;)f-=1,h=!h}while(h);u=["brackets",r.slice(p,a+1),p,a],p=a}else a=r.indexOf(")",p+1),o=r.slice(p,a+1),a===-1||ku.test(o)?u=["(","(",p]:(u=["brackets",o,p,a],p=a);break}case cs:case vn:{c=n===cs?"'":'"',a=p;do{if(h=!1,a=r.indexOf(c,a+1),a===-1)if(i||I){a=p+1;break}else S("string");for(f=a;r.charCodeAt(f-1)===Yt;)f-=1,h=!h}while(h);u=["string",r.slice(p,a+1),p,a],p=a;break}case _u:{Qt.lastIndex=p+1,Qt.test(r),Qt.lastIndex===0?a=r.length-1:a=Qt.lastIndex-2,u=["at-word",r.slice(p,a+1),p,a],p=a;break}case Yt:{for(a=p,l=!0;r.charCodeAt(a+1)===Yt;)a+=1,l=!l;if(n=r.charCodeAt(a+1),l&&n!==Sn&&n!==ht&&n!==Zt&&n!==Jt&&n!==Kt&&n!==Xt&&(a+=1,Cn.test(r.charAt(a)))){for(;Cn.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===ht&&(a+=1)}u=["word",r.slice(p,a+1),p,a],p=a;break}default:{n===Sn&&r.charCodeAt(p+1)===Tu?(a=r.indexOf("*/",p+2)+1,a===0&&(i||I?a=r.length:S("comment")),u=["comment",r.slice(p,a+1),p,a],p=a):(qt.lastIndex=p+1,qt.test(r),qt.lastIndex===0?a=r.length-1:a=qt.lastIndex-2,u=["word",r.slice(p,a+1),p,a],y.push(u),p=a);break}}return p++,u}function T(D){v.push(D)}return{back:T,endOfFile:C,nextToken:R,position:b}};let Pu=di,$u=zr,Fu=Vr,Bu=_t,In=mi,Wu=Lu;const En={empty:!0,space:!0};function Uu(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let zu=class{constructor(e){this.input=e,this.root=new Bu,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Pu;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(i=l,n=i[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return o}r=i}return!1}comment(e){let t=new $u;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Wu(this.input)}decl(e,t){let r=new Fu;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Uu(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(n=e[c],n[1].toLowerCase()==="!important"){r.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(r.raws.important=u);break}else if(n[1].toLowerCase()==="important"){let u=e.slice(0),h="";for(let f=c;f>0;f--){let d=u[f][0];if(h.trim().startsWith("!")&&d!=="space")break;h=u.pop()[1]+h}h.trim().startsWith("!")&&(r.important=!0,r.raws.important=h,e=u)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(r.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new In;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(r=c[0],a.push(c),r==="("||r==="[")n||(n=c),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=c),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",c=!0,u,h;for(let f=0;f<l;f+=1)n=r[f],o=n[0],o==="space"&&f===l-1&&!i?c=!1:o==="comment"?(h=r[f-1]?r[f-1][0]:"empty",u=r[f+1]?r[f+1][0]:"empty",!En[h]&&!En[u]?a.slice(-1)===","?c=!1:a+=n[1]:c=!1):a+=n[1];if(!c){let f=r.reduce((d,m)=>d+m[1],"");e.raws[t]={raw:f,value:a}}e[t]=a}rule(e){e.pop();let t=new In;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var Vu=zu;let Gu=ze,ju=Gr,Hu=Vu;function Nr(s,e){let t=new ju(s,e),r=new Hu(t);try{r.parse()}catch(i){throw i}return r.root}var gi=Nr;Nr.default=Nr;Gu.registerParse(Nr);let Ds=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var sa=Ds;Ds.default=Ds;let Yu=sa,_s=class{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Yu(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}};var yi=_s;_s.default=_s;let Zu=ze,Xu=pi,Ju=ra,Ku=gi,xn=yi,Qu=_t,qu=Wr,{isClean:we,my:eh}=Dt;const th={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rh={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},sh={Once:!0,postcssPlugin:!0,prepare:!0},rt=0;function ft(s){return typeof s=="object"&&typeof s.then=="function"}function ia(s){let e=!1,t=th[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,rt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,rt,t+"Exit"]:[t,t+"Exit"]}function Mn(s){let e;return s.type==="document"?e=["Document",rt,"DocumentExit"]:s.type==="root"?e=["Root",rt,"RootExit"]:e=ia(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function ks(s){return s[we]=!1,s.nodes&&s.nodes.forEach(e=>ks(e)),s}let Ls={},st=class na{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(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=ks(t);else if(t instanceof na||t instanceof xn)i=ks(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Ku;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[eh]&&Zu.rebuild(i)}this.result=new xn(e,i,r),this.helpers=te(O({},Ls),{postcss:Ls,result:this.result}),this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?O(O({},n),n.prepare(this.result)):n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!rh[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sh[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ft(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[we];){e[we]=!0;let t=[Mn(e)];for(;t.length>0;){let r=this.visitTick(t);if(ft(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ft(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=qu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Ju(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(ft(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[we];)e[we]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(ft(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[we]){l[we]=!0,e.push(Mn(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===rt){r.nodes&&r.nodes.length&&(r[we]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[we]=!0;let t=ia(e);for(let r of t)if(r===rt)e.nodes&&e.each(i=>{i[we]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};st.registerPostcss=s=>{Ls=s};var oa=st;st.default=st;Qu.registerLazyResult(st);Xu.registerLazyResult(st);let ih=ra,nh=gi;const oh=yi;let ah=Wr;let Ps=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=nh;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=ah;this.result=new oh(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new ih(n,i,this._opts,t);if(l.isMap()){let[a,c]=l.generate();a&&(this.result.css=a),c&&(this.result.map=c)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};var lh=Ps;Ps.default=Ps;let ch=pi,uh=oa,hh=lh,fh=_t,Mt=class{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new hh(this,e,t):new uh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var dh=Mt;Mt.default=Mt;fh.registerProcessor(Mt);ch.registerProcessor(Mt);let aa=di,la=zr,ph=ze,mh=ui,ca=Vr,ua=pi,gh=bu,yh=Gr,wh=oa,bh=Jo,vh=Ur,Sh=gi,wi=dh,Ch=yi,ha=_t,fa=mi,Ih=Wr,Eh=sa;function V(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new wi(s)}V.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
41
- 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:
42
- https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new wi().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return V([i(a)]).process(o,l)},i};V.stringify=Ih;V.parse=Sh;V.fromJSON=gh;V.list=bh;V.comment=s=>new la(s);V.atRule=s=>new aa(s);V.decl=s=>new ca(s);V.rule=s=>new fa(s);V.root=s=>new ha(s);V.document=s=>new ua(s);V.CssSyntaxError=mh;V.Declaration=ca;V.Container=ph;V.Processor=wi;V.Document=ua;V.Comment=la;V.Warning=Eh;V.AtRule=aa;V.Result=Ch;V.Input=yh;V.Rule=fa;V.Root=ha;V.Node=vh;wh.registerPostcss(V);var xh=V;V.default=V;const Z=Fc(xh);Z.stringify;Z.fromJSON;Z.plugin;Z.parse;Z.list;Z.document;Z.comment;Z.atRule;Z.rule;Z.decl;Z.root;Z.CssSyntaxError;Z.Declaration;Z.Container;Z.Processor;Z.Document;Z.Comment;Z.Warning;Z.AtRule;Z.Result;Z.Input;Z.Rule;Z.Root;Z.Node;const Rn={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 Mh(s){let e=Rn[s.tagName]?Rn[s.tagName]:s.tagName;return e==="link"&&s.attributes._cssText&&(e="style"),e}function jr(s,e){const t=e==null?void 0:e.stylesWithHoverClass.get(s);if(t)return t;let r=s;try{r=Z([Pc,$c]).process(s).css}catch(i){console.warn("Failed to adapt css for replay",i)}return e==null||e.stylesWithHoverClass.set(s,r),r}function An(){return{stylesWithHoverClass:new Map}}function Rh(s,e,t,r){const i=[];for(const a of s.childNodes)a.type===L.Text&&i.push(a);const n=e.split("/* rr_split */");for(;n.length>1&&n.length>i.length;)n.splice(-2,2,n.slice(-2).join(""));let o="";t&&(o=jr(n.join(""),r));let l=0;for(let a=0;a<i.length&&a!==n.length;a++){const c=i[a];if(!t)c.textContent=n[a];else if(a<n.length-1){let u=l,h=n[a+1].length;h=Math.min(h,30);let f=!1;for(;h>2;h--){const d=n[a+1].substring(0,h),m=o.substring(l).indexOf(d);if(f=m!==-1,f){u+=m;break}}f||(u+=n[a].length),c.textContent=o.substring(l,u),l=u}else c.textContent=o.substring(l)}}function Ah(s,e,t,r){const{doc:i,hackCss:n,cache:o}=r;s.childNodes.length?Rh(s,t,n,o):(n&&(t=jr(t,o)),e.appendChild(i.createTextNode(t)))}function Nh(s,e){var t;const{doc:r,hackCss:i,cache:n}=e;switch(s.type){case L.Document:return r.implementation.createDocument(null,"",null);case L.DocumentType:return r.implementation.createDocumentType(s.name||"html",s.publicId,s.systemId);case L.Element:{const o=Mh(s);let l;s.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",o):(s.isCustom&&((t=r.defaultView)!=null&&t.customElements)&&!r.defaultView.customElements.get(s.tagName)&&r.defaultView.customElements.define(s.tagName,class extends r.defaultView.HTMLElement{}),l=r.createElement(o));const a={};for(const c in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,c))continue;let u=s.attributes[c];if(!(o==="option"&&c==="selected"&&u===!1)&&u!==null){if(u===!0&&(u=""),c.startsWith("rr_")){a[c]=u;continue}if(typeof u=="string"){if(o==="style"&&c==="_cssText"){Ah(s,l,u,e);continue}else if(o==="textarea"&&c==="value"){l.appendChild(r.createTextNode(u));try{s.childNodes=[]}catch(h){console.warn(`Highlight failed to set rrweb text area child nodes ${h}`)}continue}}try{if(s.isSVG&&c==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",c,u.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")l.setAttribute("_"+c,u.toString());else if(o==="meta"&&s.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){l.setAttribute("csp-content",u.toString());continue}else o==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||o==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&oi(s.attributes.href)==="js"||(o==="img"&&s.attributes.srcset&&s.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",s.attributes.srcset):l.setAttribute(c,u.toString()))}catch(h){}}}for(const c in a){const u=a[c];if(o==="canvas"&&c==="rr_dataURL"){const h=r.createElement("img");h.src=u.toString();const f=l.getContext("2d");f&&(So(f),f.drawImage(h,0,0)),l.RRNodeType&&(l.rr_dataURL=u.toString())}else if(o==="img"&&c==="rr_dataURL"){const h=l;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",s.attributes.src),h.src=u.toString())}if(c==="rr_width")l.style.setProperty("width",u.toString());else if(c==="rr_height")l.style.setProperty("height",u.toString());else if(c==="rr_mediaCurrentTime"&&typeof u=="number")l.currentTime=u;else if(c==="rr_mediaState")switch(u){case"played":l.play().catch(h=>console.warn("media playback error",h));break;case"paused":l.pause();break}else c==="rr_mediaPlaybackRate"&&typeof u=="number"?l.playbackRate=u:c==="rr_mediaMuted"&&typeof u=="boolean"?l.muted=u:c==="rr_mediaLoop"&&typeof u=="boolean"?l.loop=u:c==="rr_mediaVolume"&&typeof u=="number"?l.volume=u:c==="rr_open_mode"&&l.setAttribute("rr_open_mode",u)}if(s.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case L.Text:return s.isStyle&&i?r.createTextNode(jr(s.textContent,n)):r.createTextNode(s.textContent);case L.CDATA:return r.createCDATASection(s.textContent);case L.Comment:return r.createComment(s.textContent);default:return null}}function bt(s,e){const{doc:t,mirror:r,skipChild:i=!1,hackCss:n=!0,afterAppend:o,cache:l}=e;if(r.has(s.id)){const c=r.getNode(s.id),u=r.getMeta(c);if(ic(u,s))return r.getNode(s.id)}let a=Nh(s,{doc:t,hackCss:n,cache:l});if(!a)return null;if(s.rootId&&r.getNode(s.rootId)!==t&&r.replace(s.rootId,t),s.type===L.Document&&(t.close(),t.open(),s.compatMode==="BackCompat"&&s.childNodes&&s.childNodes[0].type!==L.DocumentType&&(s.childNodes[0].type===L.Element&&"xmlns"in s.childNodes[0].attributes&&s.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),a=t),r.add(a,s),(s.type===L.Document||s.type===L.Element)&&!i)for(const c of s.childNodes){const u=bt(c,{doc:t,mirror:r,skipChild:!1,hackCss:n,afterAppend:o,cache:l});if(!u){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&ii(a)&&a.shadowRoot)a.shadowRoot.appendChild(u);else if(s.type===L.Document&&c.type==L.Element){const h=u;let f=null;h.childNodes.forEach(d=>{d.nodeName==="BODY"&&(f=d)}),f?(h.removeChild(f),a.appendChild(u),h.appendChild(f)):a.appendChild(u)}else a.appendChild(u);o&&o(u,c.id)}return a}function Oh(s,e){function t(r){e(r)}for(const r of s.getIds())s.has(r)&&t(s.getNode(r))}function Th(s,e){const t=e.getMeta(s);if((t==null?void 0:t.type)!==L.Element)return;const r=s;for(const i in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,i)&&i.startsWith("rr_")))continue;const n=t.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=n),i==="rr_scrollTop"&&(r.scrollTop=n)}}function Dh(s,e){const{doc:t,onVisit:r,hackCss:i=!0,afterAppend:n,cache:o,mirror:l=new ni}=e,a=bt(s,{doc:t,mirror:l,skipChild:!1,hackCss:i,afterAppend:n,cache:o});return Oh(l,c=>{r&&r(c),Th(c,l)}),a}var _h=Object.defineProperty,kh=(s,e,t)=>e in s?_h(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,E=(s,e,t)=>kh(s,typeof e!="symbol"?e+"":e,t),Lh=Object.defineProperty,Ph=(s,e,t)=>e in s?Lh(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Nn=(s,e,t)=>Ph(s,typeof e!="symbol"?e+"":e,t);let $h=class{constructor(){Nn(this,"idNodeMap",new Map),Nn(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Fh(){return new $h}function Bh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Wh(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var bi={exports:{}},k=String,da=function(){return{isColorSupported:!1,reset:k,bold:k,dim:k,italic:k,underline:k,inverse:k,hidden:k,strikethrough:k,black:k,red:k,green:k,yellow:k,blue:k,magenta:k,cyan:k,white:k,gray:k,bgBlack:k,bgRed:k,bgGreen:k,bgYellow:k,bgBlue:k,bgMagenta:k,bgCyan:k,bgWhite:k,blackBright:k,redBright:k,greenBright:k,yellowBright:k,blueBright:k,magentaBright:k,cyanBright:k,whiteBright:k,bgBlackBright:k,bgRedBright:k,bgGreenBright:k,bgYellowBright:k,bgBlueBright:k,bgMagentaBright:k,bgCyanBright:k,bgWhiteBright:k}};bi.exports=da();bi.exports.createColors=da;var Uh=bi.exports;const zh={},Vh=Object.freeze(Object.defineProperty({__proto__:null,default:zh},Symbol.toStringTag,{value:"Module"})),me=Wh(Vh);let On=Uh,Tn=me,$s=class pa extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,pa)}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(e){if(!this.source)return"";let t=this.source;e==null&&(e=On.isColorSupported);let r=u=>u,i=u=>u,n=u=>u;if(e){let{bold:u,gray:h,red:f}=On.createColors(!0);i=d=>u(f(d)),r=d=>h(d),Tn&&(n=d=>Tn(d))}let o=t.split(/\r?\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;return o.slice(l,a).map((u,h)=>{let f=l+1+h,d=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let g=20,p=Math.max(0,this.column-g),y=Math.max(this.column+g,this.endColumn+g),v=u.slice(p,y),b=r(d.replace(/\d/g," "))+u.slice(0,Math.min(this.column-1,g-1)).replace(/[^\t]/g," ");return i(">")+r(d)+n(v)+`
43
- `+b+i("^")}let m=r(d.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(d)+n(u)+`
44
- `+m+i("^")}return" "+r(d)+n(u)}).join(`
45
- `)}toString(){let e=this.showSourceCode();return e&&(e=`
26
+ `)&&(i=`\r
27
+ `),this.css+=i+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let i=this.toUrl(this.path(n.file)),l=n.root||e(n.file),h;this.mapOpts.sourcesContent===!1?(h=new a(n.text),h.sourcesContent&&(h.sourcesContent=null)):h=n.consumer(),this.map.applySourceMap(h,i,this.toUrl(this.path(l)))}}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(),d&&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=u.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new u({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 u({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,i=1,l="<no source>",h={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(y,v,E)=>{if(this.css+=y,v&&E!=="end"&&(h.generated.line=n,h.generated.column=i-1,v.source&&v.source.start?(h.source=this.sourcePath(v),h.original.line=v.source.start.line,h.original.column=v.source.start.column-1,this.map.addMapping(h)):(h.source=l,h.original.line=1,h.original.column=0,this.map.addMapping(h))),b=y.match(/\n/g),b?(n+=b.length,g=y.lastIndexOf(`
29
+ `),i=y.length-g):i+=y.length,v&&E!=="start"){let S=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==S.last||S.raws.semicolon)&&(v.source&&v.source.end?(h.source=this.sourcePath(v),h.original.line=v.source.end.line,h.original.column=v.source.end.column-1,h.generated.line=n,h.generated.column=i-2,this.map.addMapping(h)):(h.source=l,h.original.line=1,h.original.column=0,h.generated.line=n,h.generated.column=i-1,this.map.addMapping(h)))}})}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 l=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(l=e(r(l,this.mapOpts.annotation)));let h=t(l,n);return this.memoizedPaths.set(n,h),h}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 f(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 l=i.source.input.from;if(l&&!n[l]){n[l]=!0;let h=this.usesFileUrls?this.toFileUrl(l):this.toUrl(this.path(l));this.map.setSourceContent(h,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(c){let l=c(n).toString();return this.memoizedFileURLs.set(n,l),l}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 l=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,l),l}}return Er=p,Er}var xr,Bs;function Ol(){if(Bs)return xr;Bs=1;const e=39,t=34,r=92,s=47,a=10,u=32,c=12,f=9,m=13,d=91,p=93,o=40,n=41,i=123,l=125,h=59,g=42,b=58,y=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return xr=function(M,R={}){let x=M.css.valueOf(),D=R.ignoreErrors,T,G,X,I,ne,P,V,H,F,Z,ue=x.length,N=0,Se=[],ce=[],Te=-1;function De(){return N}function Ce(ie){throw M.error("Unclosed "+ie,N)}function ze(){return ce.length===0&&N>=ue}function tt(ie){if(ce.length)return ce.pop();if(N>=ue)return;let me=ie?ie.ignoreUnclosed:!1;switch(T=x.charCodeAt(N),T){case a:case u:case f:case m:case c:{I=N;do I+=1,T=x.charCodeAt(I);while(T===u||T===a||T===f||T===m||T===c);P=["space",x.slice(N,I)],N=I-1;break}case d:case p:case i:case l:case b:case h:case n:{let de=String.fromCharCode(T);P=[de,de,N];break}case o:{if(Z=Se.length?Se.pop()[1]:"",F=x.charCodeAt(N+1),Z==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==f&&F!==c&&F!==m){I=N;do{if(V=!1,I=x.indexOf(")",I+1),I===-1)if(D||me){I=N;break}else Ce("bracket");for(H=I;x.charCodeAt(H-1)===r;)H-=1,V=!V}while(V);P=["brackets",x.slice(N,I+1),N,I],N=I}else N<=Te?P=["(","(",N]:(I=x.indexOf(")",N+1),G=x.slice(N,I+1),I===-1||S.test(G)?(Te=I===-1?ue:I,P=["(","(",N]):(P=["brackets",G,N,I],N=I));break}case e:case t:{ne=T===e?"'":'"',I=N;do{if(V=!1,I=x.indexOf(ne,I+1),I===-1)if(D||me){I=N+1;break}else Ce("string");for(H=I;x.charCodeAt(H-1)===r;)H-=1,V=!V}while(V);P=["string",x.slice(N,I+1),N,I],N=I;break}case y:{v.lastIndex=N+1,v.test(x),v.lastIndex===0?I=x.length-1:I=v.lastIndex-2,P=["at-word",x.slice(N,I+1),N,I],N=I;break}case r:{for(I=N,X=!0;x.charCodeAt(I+1)===r;)I+=1,X=!X;if(T=x.charCodeAt(I+1),X&&T!==s&&T!==u&&T!==a&&T!==f&&T!==m&&T!==c&&(I+=1,w.test(x.charAt(I)))){for(;w.test(x.charAt(I+1));)I+=1;x.charCodeAt(I+1)===u&&(I+=1)}P=["word",x.slice(N,I+1),N,I],N=I;break}default:{T===s&&x.charCodeAt(N+1)===g?(I=x.indexOf("*/",N+2)+1,I===0&&(D||me?I=x.length:Ce("comment")),P=["comment",x.slice(N,I+1),N,I],N=I):(E.lastIndex=N+1,E.test(x),E.lastIndex===0?I=x.length-1:I=E.lastIndex-2,P=["word",x.slice(N,I+1),N,I],Se.push(P),N=I);break}}return N++,P}function pe(ie){ce.push(ie)}return{back:pe,endOfFile:ze,nextToken:tt,position:De}},xr}var Rr,Us;function Nl(){if(Us)return Rr;Us=1;let e=Ti(),t=Gt(),r=Ht(),s=ut(),a=Ai(),u=Ol();const c={empty:!0,space:!0};function f(p){for(let o=p.length-1;o>=0;o--){let n=p[o],i=n[3]||n[2];if(i)return i}}function m(p,o,n){let i="";for(let l=o;l<n;l++)i+=p[l][1];return i}class d{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,l,h,g=!1,b=!1,y=[],v=[];for(;!this.tokenizer.endOfFile();){if(o=this.tokenizer.nextToken(),i=o[0],i==="("||i==="["?v.push(i==="("?")":"]"):i==="{"&&v.length>0?v.push("}"):i===v[v.length-1]&&v.pop(),v.length===0)if(i===";"){n.source.end=this.getPosition(o[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){b=!0;break}else if(i==="}"){if(y.length>0){for(h=y.length-1,l=y[h];l&&l[0]==="space";)l=y[--h];l&&(n.source.end=this.getPosition(l[3]||l[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=""),b&&(n.nodes=[],this.current=n)}checkMissedSemicolon(o){let n=this.colon(o);if(n===!1)return;let i=0,l;for(let h=n-1;h>=0&&(l=o[h],!(l[0]!=="space"&&(i+=1,i===2)));h--);throw this.input.error("Missed semicolon",l[0]==="word"?l[3]+1:l[2])}colon(o){let n=0,i,l,h;for(let[g,b]of o.entries()){if(l=b,h=l[0],h==="("&&(n+=1),h===")"&&(n-=1),n===0&&h===":")if(!i)this.doubleColon(l);else{if(i[0]==="word"&&i[1]==="progid")continue;return g}i=l}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 l=i.match(/^(\s*)([^]*\S)(\s*)$/);n.text=l[2],n.raws.left=l[1],n.raws.right=l[3]}}createTokenizer(){this.tokenizer=u(this.input)}decl(o,n){let i=new r;this.init(i,o[0][2]);let l=o[o.length-1];l[0]===";"&&(this.semicolon=!0,o.pop()),i.source.end=this.getPosition(l[3]||l[2]||f(o)),i.source.end.offset++;let h=0;for(;o[h][0]!=="word";)h===o.length-1&&this.unknownWord([o[h]]),h++;i.raws.before+=m(o,0,h),i.source.start=this.getPosition(o[h][2]);let g=h;for(;h<o.length;){let w=o[h][0];if(w===":"||w==="space"||w==="comment")break;h++}i.prop=m(o,g,h);let b=h,y;for(;h<o.length&&(y=o[h],h++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);i.raws.between=m(o,b,h),(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let v=h;for(;h<o.length;){let w=o[h][0];if(w!=="space"&&w!=="comment")break;h++}let E=o.slice(v,h);o=o.slice(h),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 a;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,l=!1,h=null,g=[],b=o[1].startsWith("--"),y=[],v=o;for(;v;){if(i=v[0],y.push(v),i==="("||i==="[")h||(h=v),g.push(i==="("?")":"]");else if(b&&l&&i==="{")h||(h=v),g.push("}");else if(g.length===0)if(i===";")if(l){this.decl(y,b);return}else break;else if(i==="{"){this.rule(y);return}else if(i==="}"){this.tokenizer.back(y.pop()),n=!0;break}else i===":"&&(l=!0);else i===g[g.length-1]&&(g.pop(),g.length===0&&(h=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),g.length>0&&this.unclosedBracket(h),n&&l){if(!b)for(;y.length&&(v=y[y.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,b)}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,l){let h,g,b=i.length,y="",v=!0,E,S;for(let w=0;w<b;w+=1)h=i[w],g=h[0],g==="space"&&w===b-1&&!l?v=!1:g==="comment"?(S=i[w-1]?i[w-1][0]:"empty",E=i[w+1]?i[w+1][0]:"empty",!c[S]&&!c[E]?y.slice(-1)===","?v=!1:y+=h[1]:v=!1):y+=h[1];if(!v){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 a;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 l=n;l<o.length;l++)i+=o[l][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 Rr=d,Rr}var Mr,Ws;function _i(){if(Ws)return Mr;Ws=1;let e=Le(),t=Yt(),r=Nl();function s(a,u){let c=new t(a,u),f=new r(c);try{f.parse()}catch(m){throw m}return f.root}return Mr=s,s.default=s,e.registerParse(s),Mr}var Ir,$s;function vo(){if($s)return Ir;$s=1;let e=Le(),{my:t}=Vt();class r{constructor(a,u={}){if(this.type="warning",this.text=a,u.node&&u.node.source){u.node[t]||e.rebuild(u.node);let c=u.node.rangeBy(u);this.line=c.start.line,this.column=c.start.column,this.endLine=c.end.line,this.endColumn=c.end.column}for(let c in u)this[c]=u[c]}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 Ir=r,r.default=r,Ir}var Or,zs;function ki(){if(zs)return Or;zs=1;let e=vo();class t{get content(){return this.css}constructor(s,a,u){this.processor=s,this.messages=[],this.root=a,this.opts=u,this.css="",this.map=void 0}toString(){return this.css}warn(s,a={}){a.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(a.plugin=this.lastPlugin.postcssPlugin);let u=new e(s,a);return this.messages.push(u),u}warnings(){return this.messages.filter(s=>s.type==="warning")}}return Or=t,t.default=t,Or}var Nr,js;function bo(){if(js)return Nr;js=1;let e={};return Nr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Nr}var Tr,Vs;function So(){if(Vs)return Tr;Vs=1;let e=Le(),t=Di(),r=wo(),s=_i(),a=ki(),u=ut(),c=jt(),{isClean:f,my:m}=Vt(),d=bo();const p={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 l(E){return typeof E=="object"&&typeof E.then=="function"}function h(E){let S=!1,w=p[E.type];return E.type==="decl"?S=E.prop.toLowerCase():E.type==="atrule"&&(S=E.name.toLowerCase()),S&&E.append?[w,w+"-"+S,i,w+"Exit",w+"Exit-"+S]:S?[w,w+"-"+S,w+"Exit",w+"Exit-"+S]:E.append?[w,i,w+"Exit"]:[w,w+"Exit"]}function g(E){let S;return E.type==="document"?S=["Document",i,"DocumentExit"]:E.type==="root"?S=["Root",i,"RootExit"]:S=h(E),{eventIndex:0,events:S,iterator:0,node:E,visitorIndex:0,visitors:[]}}function b(E){let S=[E];for(;S.length>0;){let w=S.pop();if(w[f]=!1,w.nodes)for(let C of w.nodes)S.push(C)}return E}let y={};class v{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(S,w,C){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=b(w);else if(w instanceof v||w instanceof a)M=b(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 a(S,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(S){return this.async().catch(S)}finally(S){return this.async().then(S,S)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(S,w){let C=this.result.lastPlugin;try{w&&w.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=C.postcssPlugin,S.setMessage()):C.postcssVersion}catch(M){console&&console.error&&console.error(M)}return S}prepareVisitors(){this.listeners={};let S=(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==="*"?S(w,C,w[C][M]):S(w,C+"-"+M.toLowerCase(),w[C][M]);else typeof w[C]=="function"&&S(w,C,w[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let w=this.plugins[S],C=this.runOnRoot(w);if(l(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[f];){S[f]=!0;let w=[g(S)];for(;w.length>0;){let C=this.visitTick(w);if(l(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(S.type==="document"){let M=S.nodes.map(R=>C(R,this.helpers));await Promise.all(M)}else await C(S,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(S){this.result.lastPlugin=S;try{if(typeof S=="object"&&S.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(C=>S.Once(C,this.helpers));return l(w[0])?Promise.all(w):w}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(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 S=this.result.opts,w=c;S.syntax&&(w=S.syntax.stringify),S.stringifier&&(w=S.stringifier),w.stringify&&(w=w.stringify);let C=this.result.root.source;if(S.map===void 0&&!(C&&C.input&&C.input.map)){let x="";return w(this.result.root,D=>{x+=D}),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 S of this.plugins){let w=this.runOnRoot(S);if(l(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[f];)S[f]=!0,this.walkSync(S);if(this.listeners.OnceExit)if(S.type==="document")for(let w of S.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,w){return this.async().then(S,w)}toString(){return this.css}visitSync(S,w){for(let[C,M]of S){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(l(R))throw this.getAsyncError()}}visitTick(S){let w=S[S.length-1],{node:C,visitors:M}=w;if(C.type!=="root"&&C.type!=="document"&&!C.parent){S.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[x,D]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=x;try{return D(C.toProxy(),this.helpers)}catch(T){throw this.handleError(T,C)}}if(w.iterator!==0){let x=w.iterator;w.descending&&(w.descending=!1,C.indexes[x]+=1);let D;for(;D=C.nodes[C.indexes[x]];){if(!D[f]){D[f]=!0,w.descending=!0,S.push(g(D));return}C.indexes[x]+=1}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[f]=!0,w.iterator=C.getIterator());return}else if(this.listeners[x]){w.visitors=this.listeners[x];return}}S.pop()}walkSync(S){S[f]=!0;let w=[{eventIndex:0,events:h(S),iterator:0,node:S}];for(;w.length>0;){let C=w[w.length-1],M=C.node;if(C.iterator!==0){let R=C.iterator;C.descending&&(C.descending=!1,M.indexes[R]+=1);let x,D=!1;for(;x=M.nodes[M.indexes[R]];){if(!x[f]){x[f]=!0,C.descending=!0,w.push({eventIndex:0,events:h(x),iterator:0,node:x}),D=!0;break}M.indexes[R]+=1}if(D)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 v.registerPostcss=E=>{y=E},Tr=v,v.default=v,u.registerLazyResult(v),t.registerLazyResult(v),Tr}var Dr,qs;function Tl(){if(qs)return Dr;qs=1;let e=wo(),t=_i(),r=ki(),s=jt(),a=bo();class u{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 f,m=t;try{f=m(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=f,f}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(f,m,d){m=m.toString(),this.stringified=!1,this._processor=f,this._css=m,this._opts=d,this._map=void 0;let p=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(p,void 0,this._opts,m);if(n.isMap()){let[i,l]=n.generate();i&&(this.result.css=i),l&&(this.result.map=l)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(f){return this.async().catch(f)}finally(f){return this.async().then(f,f)}sync(){if(this.error)throw this.error;return this.result}then(f,m){return this.async().then(f,m)}toString(){return this._css}warnings(){return[]}}return Dr=u,u.default=u,Dr}var Ar,Gs;function Dl(){if(Gs)return Ar;Gs=1;let e=Di(),t=So(),r=Tl(),s=ut();class a{constructor(c=[]){this.version="8.5.25",this.plugins=this.normalize(c)}normalize(c){let f=[];for(let m of c)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))f=f.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)f.push(m);else if(typeof m=="function")f.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return f}process(c,f={}){return!this.plugins.length&&!f.parser&&!f.stringifier&&!f.syntax?new r(this,c,f):new t(this,c,f)}use(c){return this.plugins=this.plugins.concat(this.normalize([c])),this}}return Ar=a,a.default=a,s.registerProcessor(a),e.registerProcessor(a),Ar}var _r,Hs;function Al(){if(Hs)return _r;Hs=1;let e=Ti(),t=Gt(),r=Le(),s=Ni(),a=Ht(),u=Di(),c=Il(),f=Yt(),m=So(),d=yo(),p=qt(),o=_i(),n=Dl(),i=ki(),l=ut(),h=Ai(),g=jt(),b=vo();function y(...v){return v.length===1&&Array.isArray(v[0])&&(v=v[0]),new n(v)}return y.plugin=function(E,S){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=S(...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,D){return y([C(D)]).process(R,x)},C},y.stringify=g,y.parse=o,y.fromJSON=c,y.list=d,y.comment=v=>new t(v),y.atRule=v=>new e(v),y.decl=v=>new a(v),y.rule=v=>new h(v),y.root=v=>new l(v),y.document=v=>new u(v),y.CssSyntaxError=s,y.Declaration=a,y.Container=r,y.Processor=n,y.Document=u,y.Comment=t,y.Warning=b,y.AtRule=e,y.Result=i,y.Input=f,y.Rule=h,y.Root=l,y.Node=p,m.registerPostcss(y),_r=y,y.default=y,_r}var _l=Al();const Q=Sl(_l);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 Ys={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 kl(e){const t=String(e.tagName).toLowerCase();let r=Ys[t]?Ys[t]:e.tagName;return t==="link"&&e.attributes._cssText&&(r="style"),r}function Jt(e,t){const r=t==null?void 0:t.stylesWithHoverClass.get(e);if(r)return r;let s=e;try{s=Q([vl,bl]).process(e).css}catch(a){console.warn("Failed to adapt css for replay",a)}return t==null||t.stylesWithHoverClass.set(e,s),s}function Js(){return{stylesWithHoverClass:new Map}}const Pl="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.",Xs="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",Co=new WeakSet;function Ll(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 Fl(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(Co.has(e.doc)&&Ll(t.frameElement)))throw new Error(Pl)}function Bl(e,t,r,s){const a=[];for(const m of e.childNodes)m.type===U.Text&&a.push(m);const u=t.split("/* rr_split */");for(;u.length>1&&u.length>a.length;)u.splice(-2,2,u.slice(-2).join(""));let c="";r&&(c=Jt(u.join(""),s));let f=0;for(let m=0;m<a.length&&m!==u.length;m++){const d=a[m];if(!r)d.textContent=u[m];else if(m<u.length-1){let p=f,o=u[m+1].length;o=Math.min(o,30);let n=!1;for(;o>2;o--){const i=u[m+1].substring(0,o),l=c.substring(f).indexOf(i);if(n=l!==-1,n){p+=l;break}}n||(p+=u[m].length),d.textContent=c.substring(f,p),f=p}else d.textContent=c.substring(f)}}function Ul(e,t,r,s){const{doc:a,hackCss:u,cache:c}=s;e.childNodes.length?Bl(e,r,u,c):(u&&(r=Jt(r,c)),t.appendChild(a.createTextNode(r)))}function Wl(e,t){var r;const{doc:s,hackCss:a,cache:u}=t;switch(e.type){case U.Document:return s.implementation.createDocument(null,"",null);case U.DocumentType:return s.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case U.Element:{const c=kl(e);let f;e.isSVG?f=s.createElementNS("http://www.w3.org/2000/svg",c):(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{}),f=s.createElement(c));const m={};for(const d in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))continue;let p=e.attributes[d];if(!(c==="option"&&d==="selected"&&p===!1)&&p!==null){if(p===!0&&(p=""),d.startsWith("rr_")){m[d]=p;continue}if(typeof p=="string"){if(c==="style"&&d==="_cssText"){Ul(e,f,p,t);continue}else if(c==="textarea"&&d==="value"){f.appendChild(s.createTextNode(p));try{e.childNodes=[]}catch(o){console.warn(`Highlight failed to set rrweb text area child nodes ${String(o)}`)}continue}}try{if(e.isSVG&&d==="xlink:href")f.setAttributeNS("http://www.w3.org/1999/xlink",d,p.toString());else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")f.setAttribute("_"+d,p.toString());else if(c==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content"){f.setAttribute("csp-content",p.toString());continue}else c==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||c==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Mi(e.attributes.href)==="js"||(c==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?f.setAttribute("rrweb-original-srcset",e.attributes.srcset):f.setAttribute(d,p.toString()))}catch(o){}}}for(const d in m){const p=m[d];if(c==="canvas"&&d==="rr_dataURL"){const o=s.createElement("img");o.src=p.toString();const n=f.getContext("2d");n&&(to(n),n.drawImage(o,0,0)),f.RRNodeType&&(f.rr_dataURL=p.toString())}else if(c==="img"&&d==="rr_dataURL"){const o=f;o.currentSrc.startsWith("data:")||(o.setAttribute("rrweb-original-src",e.attributes.src),o.src=p.toString())}if(d==="rr_width")f.style.setProperty("width",p.toString());else if(d==="rr_height")f.style.setProperty("height",p.toString());else if(d==="rr_mediaCurrentTime"&&typeof p=="number")f.currentTime=p;else if(d==="rr_mediaState")switch(p){case"played":f.play().catch(o=>console.warn("media playback error",o));break;case"paused":f.pause();break}else d==="rr_mediaPlaybackRate"&&typeof p=="number"?f.playbackRate=p:d==="rr_mediaMuted"&&typeof p=="boolean"?f.muted=p:d==="rr_mediaLoop"&&typeof p=="boolean"?f.loop=p:d==="rr_mediaVolume"&&typeof p=="number"?f.volume=p:d==="rr_open_mode"&&f.setAttribute("rr_open_mode",p)}if(e.isShadowHost)if(!f.shadowRoot)f.attachShadow({mode:"open"});else for(;f.shadowRoot.firstChild;)f.shadowRoot.removeChild(f.shadowRoot.firstChild);return f}case U.Text:return e.isStyle&&a?s.createTextNode(Jt(e.textContent,u)):s.createTextNode(e.textContent);case U.CDATA:return s.createCDATASection(e.textContent);case U.Comment:return s.createComment(e.textContent);default:return null}}function nt(e,t){const{doc:r,mirror:s,skipChild:a=!1,hackCss:u=!0,afterAppend:c,cache:f,cspContent:m}=t;if(s.has(e.id)){const p=s.getNode(e.id),o=s.getMeta(p);if($a(o,e))return s.getNode(e.id)}let d=Wl(e,{doc:r,hackCss:u,cache:f});if(!d)return null;if(e.rootId&&s.getNode(e.rootId)!==r&&s.replace(e.rootId,r),e.type===U.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==U.DocumentType&&(e.childNodes[0].type===U.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" "">')),d=r),s.add(d,e),(e.type===U.Document||e.type===U.Element)&&!a)for(const p of e.childNodes){const o=nt(p,{doc:r,mirror:s,skipChild:!1,hackCss:u,afterAppend:c,cache:f});if(!o){console.warn("Failed to rebuild",p);continue}if(p.isShadow&&xi(d)&&d.shadowRoot)d.shadowRoot.appendChild(o);else if(e.type===U.Document&&p.type==U.Element){const n=o;m&&jl(n,m,r);let i=null;n.childNodes.forEach(l=>{l.nodeName==="BODY"&&(i=l)}),i?(n.removeChild(i),d.appendChild(o),n.appendChild(i)):d.appendChild(o)}else d.appendChild(o);c&&c(o,p.id)}return d}function $l(e,t){function r(s){t(s)}for(const s of e.getIds())e.has(s)&&r(e.getNode(s))}function zl(e,t){const r=t.getMeta(e);if((r==null?void 0:r.type)!==U.Element)return;const s=e;for(const a in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,a)&&a.startsWith("rr_")))continue;const u=r.attributes[a];a==="rr_scrollLeft"&&(s.scrollLeft=u),a==="rr_scrollTop"&&(s.scrollTop=u)}}function jl(e,t,r){let s=e.querySelector("head");s||(s=r.createElement("head"),e.insertBefore(s,e.firstChild));const a=r.createElement("meta");a.setAttribute("http-equiv","Content-Security-Policy"),a.setAttribute("content",t),s.insertBefore(a,s.firstChild)}function Vl(e,t){Fl(t);const{doc:r,onVisit:s,hackCss:a=!0,afterAppend:u,cache:c,mirror:f=new Ri,cspContent:m}=t,d=nt(e,{doc:r,mirror:f,skipChild:!1,hackCss:a,afterAppend:u,cache:c,cspContent:m});return $l(f,p=>{s&&s(p),zl(p,f)}),d}function ql(e){var t;if(!e.root.isConnected)throw new Error(Xs);const r=e.root.ownerDocument.createElement("iframe");for(const[a,u]of Object.entries(e.iframeAttributes||{}))a!=="sandbox"&&r.setAttribute(a,u);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(Xs);return Co.add(s),r}var Gl=Object.defineProperty,Hl=(e,t,r)=>t in e?Gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t,r)=>Hl(e,typeof t!="symbol"?t+"":t,r),Yl=Object.defineProperty,Jl=(e,t,r)=>t in e?Yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qs=(e,t,r)=>Jl(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();let Xl=class{constructor(){Qs(this,"idNodeMap",new Map),Qs(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 a=this.nodeMetaMap.get(s);a&&this.nodeMetaMap.set(r,a)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ql(){return new Xl}function Zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kl(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 a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),r}var St={exports:{}},Zs;function eu(){if(Zs)return St.exports;Zs=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 tu={},ru=Object.freeze(Object.defineProperty({__proto__:null,default:tu},Symbol.toStringTag,{value:"Module"})),ve=Kl(ru);var kr,Ks;function Pi(){if(Ks)return kr;Ks=1;let e=eu(),t=ve;class r extends Error{constructor(a,u,c,f,m,d){super(a),this.name="CssSyntaxError",this.reason=a,m&&(this.file=m),f&&(this.source=f),d&&(this.plugin=d),typeof u!="undefined"&&typeof c!="undefined"&&(typeof u=="number"?(this.line=u,this.column=c):(this.line=u.line,this.column=u.column,this.endLine=c.line,this.endColumn=c.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(a){if(!this.source)return"";let u=this.source;a==null&&(a=e.isColorSupported);let c=i=>i,f=i=>i,m=i=>i;if(a){let{bold:i,gray:l,red:h}=e.createColors(!0);f=g=>i(h(g)),c=g=>l(g),t&&(m=g=>t(g))}let d=u.split(/\r?\n/),p=Math.max(this.line-3,0),o=Math.min(this.line+2,d.length),n=String(o).length;return d.slice(p,o).map((i,l)=>{let h=p+1+l,g=" "+(" "+h).slice(-n)+" | ";if(h===this.line){if(i.length>160){let y=20,v=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),S=i.slice(v,E),w=c(g.replace(/\d/g," "))+i.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return f(">")+c(g)+m(S)+`
32
+ `+w+f("^")}let b=c(g.replace(/\d/g," "))+i.slice(0,this.column-1).replace(/[^\t]/g," ");return f(">")+c(g)+m(i)+`
33
+ `+b+f("^")}return" "+c(g)+m(i)}).join(`
34
+ `)}toString(){let a=this.showSourceCode();return a&&(a=`
46
35
 
47
- `+e+`
48
- `),this.name+": "+this.message+e}};var vi=$s;$s.default=$s;const Dn={after:`
36
+ `+a+`
37
+ `),this.name+": "+this.message+a}}return kr=r,r.default=r,kr}var Pr,en;function Eo(){if(en)return Pr;en=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g,r=/[\t\n\f\r "#'()/;[\\\]{}]/;function s(p){return typeof p!="string"||!p.includes("<")?p:p.replace(e,"\\3c $2").replace(t,"\\3c $2")}const a={after:`
49
38
  `,beforeClose:`
50
39
  `,beforeComment:`
51
40
  `,beforeDecl:`
52
41
  `,beforeOpen:" ",beforeRule:`
53
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Gh(s){return s[0].toUpperCase()+s.slice(1)}let Fs=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
54
- `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i!="undefined"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Dn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]!="undefined")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Gh(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=Dn[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after!="undefined")return t=r.raws.after,t.includes(`
55
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(`
56
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(`
57
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before!="undefined")return t=r.raws.before,t.includes(`
58
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between!="undefined")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before!="undefined"){let n=r.raws.before.split(`
59
- `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t!="undefined"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var ma=Fs;Fs.default=Fs;let jh=ma;function Bs(s,e){new jh(e).stringify(s)}var Hr=Bs;Bs.default=Bs;var kt={};kt.isClean=Symbol("isClean");kt.my=Symbol("my");let Hh=vi,Yh=ma,Zh=Hr,{isClean:dt,my:Xh}=kt;function Ws(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Ws(o,t)):(n==="object"&&i!==null&&(i=Ws(i)),t[r]=i)}return t}function Ce(s,e){if(e&&typeof e.offset!="undefined")return e.offset;let t=1,r=1,i=0;for(let n=0;n<s.length;n++){if(r===e.line&&t===e.column){i=n;break}s[n]===`
60
- `?(t=1,r+=1):t+=1}return i}let Us=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[dt]=!1,this[Xh]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Ws(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Hh(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[dt]=!0}markDirty(){if(this[dt]){this[dt]=!1;let e=this;for(;e=e.parent;)e[dt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(Ce(r,this.source.start),Ce(r,this.source.end)).indexOf(e.word);n!==-1&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,n=Ce(i,this.source.start),o=n+e;for(let l=n;l<o;l++)i[l]===`
61
- `?(t=1,r+=1):t+=1;return{column:t,line:r,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Ce(t,this.source.start)},i=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:Ce(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let o=t.slice(Ce(t,this.source.start),Ce(t,this.source.end)).indexOf(e.word);o!==-1&&(r=this.positionInside(o),i=this.positionInside(o+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:Ce(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line,offset:Ce(t,e.end)}:typeof e.endIndex=="number"?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(e,t){return new Yh().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){if(l==null)continue;let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Zh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r={}){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}};var Yr=Us;Us.default=Us;let Jh=Yr,zs=class extends Jh{constructor(e){super(e),this.type="comment"}};var Zr=zs;zs.default=zs;let Kh=Yr,Vs=class extends Kh{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=te(O({},e),{value:String(e.value)})),super(e),this.type="decl"}};var Xr=Vs;Vs.default=Vs;let ga=Zr,ya=Xr,Qh=Yr,{isClean:wa,my:ba}=kt,Si,va,Sa,Ci;function Ca(s){return s.map(e=>(e.nodes&&(e.nodes=Ca(e.nodes)),delete e.source,e))}function Ia(s){if(s[wa]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Ia(e)}let Me=class Ea extends Qh{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(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ca(va(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ya(e)]}else if(e.selector||e.selectors)e=[new Ci(e)];else if(e.name)e=[new Si(e)];else if(e.text)e=[new ga(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[ba]||Ea.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[wa]&&Ia(i),i.raws||(i.raws={}),typeof i.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}};Me.registerParse=s=>{va=s};Me.registerRule=s=>{Ci=s};Me.registerAtRule=s=>{Si=s};Me.registerRoot=s=>{Sa=s};var Ve=Me;Me.default=Me;Me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Si.prototype):s.type==="rule"?Object.setPrototypeOf(s,Ci.prototype):s.type==="decl"?Object.setPrototypeOf(s,ya.prototype):s.type==="comment"?Object.setPrototypeOf(s,ga.prototype):s.type==="root"&&Object.setPrototypeOf(s,Sa.prototype),s[ba]=!0,s.nodes&&s.nodes.forEach(e=>{Me.rebuild(e)})};let xa=Ve,Or=class extends xa{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Ii=Or;Or.default=Or;xa.registerAtRule(Or);let qh=Ve,Ma,Ra,Rt=class extends qh{constructor(e){super(O({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new Ma(new Ra,this,e).stringify()}};Rt.registerLazyResult=s=>{Ma=s};Rt.registerProcessor=s=>{Ra=s};var Ei=Rt;Rt.default=Rt;let ef="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",tf=(s=21)=>{let e="",t=s|0;for(;t--;)e+=ef[Math.random()*64|0];return e};var rf={nanoid:tf};let{existsSync:sf,readFileSync:nf}=me,{dirname:us,join:of}=me,{SourceMapConsumer:_n,SourceMapGenerator:kn}=me;function af(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Gs=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=us(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new _n(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,o=e.match(i)||e.match(n);if(o)return decodeURIComponent(e.substr(o[0].length));let l=e.match(t)||e.match(r);if(l)return af(e.substr(l[0].length));let a=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=us(e),sf(e))return this.mapFile=e,nf(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof _n)return kn.fromSourceMap(t).toString();if(t instanceof kn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=of(us(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Aa=Gs;Gs.default=Gs;let{nanoid:lf}=rf,{isAbsolute:js,resolve:Hs}=me,{SourceMapConsumer:cf,SourceMapGenerator:uf}=me,{fileURLToPath:Ln,pathToFileURL:er}=me,Pn=vi,hf=Aa,hs=me,fs=Symbol("lineToIndexCache"),ff=!!(cf&&uf),$n=!!(Hs&&js);function Fn(s){if(s[fs])return s[fs];let e=s.css.split(`
62
- `),t=new Array(e.length),r=0;for(let i=0,n=e.length;i<n;i++)t[i]=r,r+=e[i].length+1;return s[fs]=t,t}let Tr=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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,t.document&&(this.document=t.document.toString()),t.from&&(!$n||/^\w+:\/\//.test(t.from)||js(t.from)?this.file=t.from:this.file=Hs(t.from)),$n&&ff){let r=new hf(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+lf(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l,a,c;if(t&&typeof t=="object"){let h=t,f=r;if(typeof h.offset=="number"){a=h.offset;let d=this.fromOffset(a);t=d.line,r=d.col}else t=h.line,r=h.column,a=this.fromLineAndColumn(t,r);if(typeof f.offset=="number"){l=f.offset;let d=this.fromOffset(l);o=d.line,n=d.col}else o=f.line,n=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)a=this.fromLineAndColumn(t,r);else{a=t;let h=this.fromOffset(a);t=h.line,r=h.col}let u=this.origin(t,r,o,n);return u?c=new Pn(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):c=new Pn(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:n,line:o},this.css,this.file,i.plugin),c.input={column:r,endColumn:n,endLine:o,endOffset:l,line:t,offset:a,source:this.css},this.file&&(er&&(c.input.url=er(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,t){return Fn(this)[e-1]+t-1}fromOffset(e){let t=Fn(this),r=t[t.length-1],i=0;if(e>=r)i=t.length-1;else{let n=t.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<t[o])n=o-1;else if(e>=t[o+1])i=o+1;else{i=o;break}}return{col:e-t[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Hs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;js(o.source)?a=er(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||er(this.map.mapFile));let c={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Ln)c.file=Ln(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(c.source=u),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map=O({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var Jr=Tr;Tr.default=Tr;hs&&hs.registerInput&&hs.registerInput(Tr);let Na=Ve,Oa,Ta,it=class extends Na{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Oa(new Ta,this,e).stringify()}};it.registerLazyResult=s=>{Oa=s};it.registerProcessor=s=>{Ta=s};var Lt=it;it.default=it;Na.registerRoot(it);let At={comma(s){return At.split(s,[","],!0)},space(s){let e=[" ",`
63
- `," "];return At.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",c=!1;for(let u of s)c?c=!1:u==="\\"?c=!0:l?u===a&&(l=!1):u==='"'||u==="'"?(l=!0,a=u):u==="("?o+=1:u===")"?o>0&&(o-=1):o===0&&e.includes(u)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=u;return(t||i!=="")&&r.push(i.trim()),r}};var Da=At;At.default=At;let _a=Ve,df=Da,Dr=class extends _a{get selectors(){return df.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var xi=Dr;Dr.default=Dr;_a.registerRule(Dr);let pf=Ii,mf=Zr,gf=Xr,yf=Jr,wf=Aa,bf=Lt,vf=xi;function Nt(s,e){if(Array.isArray(s))return s.map(o=>Nt(o));let i=s,{inputs:t}=i,r=je(i,["inputs"]);if(t){e=[];for(let o of t){let l=te(O({},o),{__proto__:yf.prototype});l.map&&(l.map=te(O({},l.map),{__proto__:wf.prototype})),e.push(l)}}if(r.nodes&&(r.nodes=s.nodes.map(o=>Nt(o,e))),r.source){let n=r.source,{inputId:o}=n,l=je(n,["inputId"]);r.source=l,o!=null&&(r.source.input=e[o])}if(r.type==="root")return new bf(r);if(r.type==="decl")return new gf(r);if(r.type==="rule")return new vf(r);if(r.type==="comment")return new mf(r);if(r.type==="atrule")return new pf(r);throw new Error("Unknown node type: "+s.type)}var Sf=Nt;Nt.default=Nt;let{dirname:yr,relative:ka,resolve:La,sep:Pa}=me,{SourceMapConsumer:$a,SourceMapGenerator:wr}=me,{pathToFileURL:Bn}=me,Cf=Jr,If=!!($a&&wr),Ef=!!(yr&&La&&ka&&Pa),xf=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
42
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function u(p){return p[0].toUpperCase()+p.slice(1)}function c(p,o){let n="@"+o.name,i=o.params?p.rawValue(o,"params"):"",l=o.raws.afterName;return typeof l=="undefined"?l=i?" ":"":l===""&&i&&!r.test(i[0])&&(l=" "),n+l+i}function f(p,o,n){let i=n.nodes,l=i.length-1;for(;l>0&&i[l].type==="comment";)l-=1;let h=p.raw(n,"semicolon"),g=n.type==="document";for(let b=i.length-1;b>=0;b--){let y=i[b],v=l!==b||h;!v&&b<i.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&y.prop.startsWith("--"))&&(v=!0),o.push({document:g,node:y,semicolon:v})}}function m(p,o,n,i){let l=p.raw(n,"between","beforeOpen");p.builder(s(i+l)+"{",n,"start");let h=n.nodes&&n.nodes.length,g=()=>{let b=h?p.raw(n,"after"):p.raw(n,"after","emptyBody");b&&p.builder(s(b)),p.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&p.builder(s(n.raws.ownSemicolon),n,"end")};h?(o.push(g),f(p,o,n)):g()}class d{constructor(o){this.builder=o}atrule(o,n){let i=c(this,o);if(o.nodes)this.block(o,i);else{let l=(o.raws.between||"")+(n?";":"");this.builder(s(i+l),o)}}beforeAfter(o,n){let i;o.type==="decl"?i=this.raw(o,null,"beforeDecl"):o.type==="comment"?i=this.raw(o,null,"beforeComment"):n==="before"?i=this.raw(o,null,"beforeRule"):i=this.raw(o,null,"beforeClose");let l=o.parent,h=0;for(;l&&l.type!=="root";)h+=1,l=l.parent;if(i.includes(`
43
+ `)){let g=this.raw(o,null,"indent");if(g.length)for(let b=0;b<h;b++)i+=g}return i}block(o,n){let i=this.raw(o,"between","beforeOpen");this.builder(s(n+i)+"{",o,"start");let l;o.nodes&&o.nodes.length?(this.body(o),l=this.raw(o,"after")):l=this.raw(o,"after","emptyBody"),l&&this.builder(s(l)),this.builder("}",o,"end")}body(o){let n=d.prototype,i=["atrule","block","body","rule","stringify"].every(h=>this[h]===n[h]),l=[];for(f(this,l,o);l.length>0;){let h=l.pop();if(typeof h=="function"){h();continue}let g=h.node,b=this.raw(g,"before");b&&this.builder(h.document?b:s(b)),i&&g.type==="rule"?m(this,l,g,this.rawValue(g,"selector")):i&&g.type==="atrule"&&g.nodes?m(this,l,g,c(this,g)):this.stringify(g,h.semicolon)}}comment(o){let n=this.raw(o,"left","commentLeft"),i=this.raw(o,"right","commentRight");this.builder(s("/*"+n+o.text+i+"*/"),o)}decl(o,n){let i=o.raws,l=this.raw(o,"between","colon"),h=o.prop+l+this.rawValue(o,"value");o.important&&(h+=i.important||" !important"),n&&(h+=";"),this.builder(s(h),o)}document(o){this.body(o)}raw(o,n,i){let l;if(i||(i=n),n&&(l=o.raws[n],typeof l!="undefined"))return l;let h=o.parent;if(i==="before"&&(!h||h.type==="root"&&h.first===o||h&&h.type==="document"))return"";if(!h)return a[i];let g=o.root(),b=g.rawCache||(g.rawCache={});if(typeof b[i]!="undefined")return b[i];if(i==="before"||i==="after")return this.beforeAfter(o,i);{let y="raw"+u(i);this[y]?l=this[y](g,o):g.walk(v=>{if(l=v.raws[n],typeof l!="undefined")return!1})}return typeof l=="undefined"&&(l=a[i]),b[i]=l,l}rawBeforeClose(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after!="undefined")return n=i.raws.after,n.includes(`
44
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(o,n){let i;return o.walkComments(l=>{if(typeof l.raws.before!="undefined")return i=l.raws.before,i.includes(`
45
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(o,n){let i;return o.walkDecls(l=>{if(typeof l.raws.before!="undefined")return i=l.raws.before,i.includes(`
46
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(o){let n;return o.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n!="undefined"))return!1}),n}rawBeforeRule(o){let n;return o.walk(i=>{if(i.nodes&&(i.parent!==o||o.first!==i)&&typeof i.raws.before!="undefined")return n=i.raws.before,n.includes(`
47
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(o){let n;return o.walkDecls(i=>{if(typeof i.raws.between!="undefined")return n=i.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n!="undefined"))return!1}),n}rawIndent(o){if(o.raws.indent)return o.raws.indent;let n;return o.walk(i=>{let l=i.parent;if(l&&l!==o&&l.parent&&l.parent===o&&typeof i.raws.before!="undefined"){let h=i.raws.before.split(`
48
+ `);return n=h[h.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(o){let n;return o.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n!="undefined"))return!1}),n}rawValue(o,n){let i=o[n],l=o.raws[n];return l&&l.value===i?l.raw:i}root(o){if(o.source&&o.source.input.hasBOM&&this.builder("\uFEFF",o,"start"),this.body(o),o.raws.after){let n=o.raws.after,i=o.parent&&o.parent.type==="document";this.builder(i?n:s(n))}}rule(o){this.block(o,this.rawValue(o,"selector")),o.raws.ownSemicolon&&this.builder(s(o.raws.ownSemicolon),o,"end")}stringify(o,n){if(!this[o.type])throw new Error("Unknown AST node type "+o.type+". Maybe you need to change PostCSS stringifier.");this[o.type](o,n)}}return Pr=d,d.default=d,Pr}var Lr,tn;function Xt(){if(tn)return Lr;tn=1;let e=Eo();function t(r,s){new e(s).stringify(r)}return Lr=t,t.default=t,Lr}var Ct={},rn;function Qt(){return rn||(rn=1,Ct.isClean=Symbol("isClean"),Ct.my=Symbol("my")),Ct}var Fr,sn;function Zt(){if(sn)return Fr;sn=1;let e=Pi(),t=Eo(),r=Xt(),{isClean:s,my:a}=Qt();function u(m,d){let p=new m.constructor,o=[[m,p,d]];for(;o.length>0;){let[n,i,l]=o.pop();for(let h in n){if(!Object.prototype.hasOwnProperty.call(n,h)||h==="proxyCache")continue;let g=n[h],b=typeof g;if(h==="parent"&&b==="object")l&&(i[h]=l);else if(h==="source")i[h]=g;else if(Array.isArray(g)){let y=[];i[h]=y;for(let v of g){let E=new v.constructor;y.push(E),o.push([v,E,i])}}else{if(b==="object"&&g!==null){let y=new g.constructor;o.push([g,y,void 0]),g=y}i[h]=g}}}return p}function c(m,d){if(d&&typeof d.offset!="undefined")return d.offset;let p=1,o=1,n=0;for(let i=0;i<m.length;i++){if(o===d.line&&p===d.column){n=i;break}m[i]===`
49
+ `?(p=1,o+=1):p+=1}return n}class f{get proxyOf(){return this}constructor(d={}){this.raws={},this[s]=!1,this[a]=!0;for(let p of Object.keys(d))if(p!=="__proto__")if(p==="nodes"){this.nodes=[];for(let o of d[p])typeof o.clone=="function"&&o.parent?this.append(o.clone()):this.append(o)}else this[p]=d[p]}addToError(d){if(d.postcssNode=this,d.stack&&this.source&&/\n\s{4}at /.test(d.stack)){let p=this.source;d.stack=d.stack.replace(/\n\s{4}at /,`$&${p.input.from}:${p.start.line}:${p.start.column}$&`)}return d}after(d){return this.parent.insertAfter(this,d),this}assign(d={}){for(let p in d)this[p]=d[p];return this}before(d){return this.parent.insertBefore(this,d),this}cleanRaws(d){delete this.raws.before,delete this.raws.after,d||delete this.raws.between}clone(d={}){let p=u(this);for(let o in d)p[o]=d[o];return p}cloneAfter(d={}){let p=this.clone(d);return this.parent.insertAfter(this,p),p}cloneBefore(d={}){let p=this.clone(d);return this.parent.insertBefore(this,p),p}error(d,p={}){if(this.source){let{end:o,start:n}=this.rangeBy(p);return this.source.input.error(d,{column:n.column,line:n.line},{column:o.column,line:o.line},p)}return new e(d)}getProxyProcessor(){return{get(d,p){return p==="proxyOf"?d:p==="root"?()=>d.root().toProxy():d[p]},set(d,p,o){return d[p]===o||(d[p]=o,(p==="prop"||p==="value"||p==="name"||p==="params"||p==="important"||p==="text")&&d.markDirty()),!0}}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let d=this;for(;d=d.parent;)d[s]=!1}}next(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d+1]}positionBy(d={}){let p="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:c(p,this.source.start)};if(d.index)o=this.positionInside(d.index);else if(d.word){let i=p.slice(c(p,this.source.start),c(p,this.source.end)).indexOf(d.word);i!==-1&&(o=this.positionInside(i))}return o}positionInside(d){let p=this.source.start.column,o=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,i=c(n,this.source.start),l=i+d;for(let h=i;h<l;h++)n[h]===`
50
+ `?(p=1,o+=1):p+=1;return{column:p,line:o,offset:l}}prev(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d-1]}rangeBy(d={}){let p="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:c(p,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:c(p,this.source.end)+1}:{column:o.column+1,line:o.line,offset:o.offset+1};if(d.word){let l=p.slice(c(p,this.source.start),c(p,this.source.end)).indexOf(d.word);l!==-1&&(o=this.positionInside(l),n=this.positionInside(l+d.word.length))}else d.start?o={column:d.start.column,line:d.start.line,offset:c(p,d.start)}:typeof d.index=="number"&&(o=this.positionInside(d.index)),d.end?n={column:d.end.column,line:d.end.line,offset:c(p,d.end)}:typeof d.endIndex=="number"?n=this.positionInside(d.endIndex):typeof d.index=="number"&&(n=this.positionInside(d.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(d,p){return new t().raw(this,d,p)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...d){if(this.parent){let p=this,o=!1;for(let n of d)n===this?o=!0:o?(this.parent.insertAfter(p,n),p=n):this.parent.insertBefore(p,n);o||this.remove()}return this}root(){let d=this;for(;d.parent&&d.parent.type!=="document";)d=d.parent;return d}toJSON(d,p){let o=p==null;p=p||new Map;let n=[],i=[[this,n,0]];for(let h=0;h<i.length;h++){let[g,b,y]=i[h],v={};b[y]=v;for(let E in g){if(!Object.prototype.hasOwnProperty.call(g,E)||E==="parent"||E==="proxyCache")continue;let S=g[E];if(Array.isArray(S)){let w=[];v[E]=w;for(let C=0;C<S.length;C++){let M=S[C];typeof M=="object"&&M.toJSON?M.toJSON===f.prototype.toJSON?i.push([M,w,C]):w[C]=M.toJSON(null,p):w[C]=M}}else if(typeof S=="object"&&S.toJSON)S.toJSON===f.prototype.toJSON?i.push([S,v,E]):v[E]=S.toJSON(null,p);else if(E==="source"){if(S==null)continue;let w=p.get(S.input);w==null&&(w=p.size,p.set(S.input,w)),v[E]={end:S.end,inputId:w,start:S.start}}else v[E]=S}}let l=n[0];return o&&(l.inputs=[...p.keys()].map(h=>h.toJSON())),l}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(d=r){d.stringify&&(d=d.stringify);let p="";return d(this,o=>{p+=o}),p}warn(d,p,o={}){let n={node:this};for(let i in o)n[i]=o[i];return d.warn(p,n)}}return Fr=f,f.default=f,Fr}var Br,nn;function Kt(){if(nn)return Br;nn=1;let e=Zt();class t extends e{constructor(s){super(s),this.type="comment"}}return Br=t,t.default=t,Br}var Ur,on;function er(){if(on)return Ur;on=1;let e=Zt();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 Ur=t,t.default=t,Ur}var Wr,an;function Fe(){if(an)return Wr;an=1;let e=Kt(),t=er(),r=Zt(),{isClean:s,my:a}=Qt(),u,c,f,m;function d(n){let i=n.slice();for(;i.length>0;){let l=i.pop();if(delete l.source,l.nodes){l.nodes=l.nodes.slice();for(let h of l.nodes)i.push(h)}}return n.slice()}function p(n){let i=[n];for(;i.length>0;){let l=i.pop();if(l[s]=!1,l.proxyOf.nodes)for(let h of l.proxyOf.nodes)i.push(h)}}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 l of i){let h=this.normalize(l,this.last);for(let g of h)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(i){let l=[this];for(;l.length>0;){let h=l.pop();if(h!==this&&h.cleanRaws!==o.prototype.cleanRaws){h.cleanRaws(i);continue}if(r.prototype.cleanRaws.call(h,i),h.nodes)for(let g of h.nodes)l.push(g)}}each(i){if(!this.proxyOf.nodes)return;let l=this.getIterator(),h,g;for(;this.indexes[l]<this.proxyOf.nodes.length&&(h=this.indexes[l],g=i(this.proxyOf.nodes[h],h),g!==!1);)this.indexes[l]+=1;return delete this.indexes[l],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,l){return l==="proxyOf"?i:i[l]?l==="each"||typeof l=="string"&&l.startsWith("walk")?(...h)=>i[l](...h.map(g=>typeof g=="function"?(b,y)=>g(b.toProxy(),y):g)):l==="every"||l==="some"?h=>i[l]((g,...b)=>h(g.toProxy(),...b)):l==="root"?()=>i.root().toProxy():l==="nodes"?i.nodes.map(h=>h.toProxy()):l==="first"||l==="last"?i[l].toProxy():i[l]:i[l]},set(i,l,h){return i[l]===h||(i[l]=h,(l==="name"||l==="params"||l==="selector")&&i.markDirty()),!0}}}index(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))}insertAfter(i,l){let h=this.index(i),g=this.normalize(l,this.proxyOf.nodes[h]).reverse();h=this.index(i);for(let y of g)this.proxyOf.nodes.splice(h+1,0,y);let b;for(let y in this.indexes)b=this.indexes[y],h<b&&(this.indexes[y]=b+g.length);return this.markDirty(),this}insertBefore(i,l){let h=this.index(i),g=h===0?"prepend":!1,b=this.normalize(l,this.proxyOf.nodes[h],g).reverse();h=this.index(i);for(let v of b)this.proxyOf.nodes.splice(h,0,v);let y;for(let v in this.indexes)y=this.indexes[v],h<=y&&(this.indexes[v]=y+b.length);return this.markDirty(),this}normalize(i,l){if(typeof i=="string")i=d(c(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 u(i)];else if(i.text)i=[new e(i)];else throw new Error("Unknown node type in node creation");return i.map(g=>(g[a]||o.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[s]&&p(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&l&&typeof l.raws.before!="undefined"&&(g.raws.before=l.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...i){i=i.reverse();for(let l of i){let h=this.normalize(l,this.first,"prepend").reverse();for(let g of h)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+h.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 l;for(let h in this.indexes)l=this.indexes[h],l>=i&&(this.indexes[h]=l-1);return this.markDirty(),this}replaceValues(i,l,h){return h||(h=l,l={}),this.walkDecls(g=>{l.props&&!l.props.includes(g.prop)||l.fast&&!g.value.includes(l.fast)||(g.value=g.value.replace(i,h))}),this.markDirty(),this}some(i){return this.nodes.some(i)}walk(i){if(!this.proxyOf.nodes)return;let l=[{iterator:this.getIterator(),node:this.proxyOf}];for(;l.length>0;){let{iterator:h,node:g}=l[l.length-1],b=g.indexes[h];if(b>=g.proxyOf.nodes.length){delete g.indexes[h],l.pop();let E=l[l.length-1];E&&(E.node.indexes[E.iterator]+=1);continue}let y=g.proxyOf.nodes[b],v;try{v=i(y,b)}catch(E){throw y.addToError(E)}if(v===!1){for(let E of l)delete E.node.indexes[E.iterator];return!1}y.walk&&y.proxyOf.nodes?l.push({iterator:y.getIterator(),node:y}):g.indexes[h]+=1}}walkAtRules(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="atrule"&&i.test(h.name))return l(h,g)}):this.walk((h,g)=>{if(h.type==="atrule"&&h.name===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="atrule")return l(h,g)}))}walkComments(i){return this.walk((l,h)=>{if(l.type==="comment")return i(l,h)})}walkDecls(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="decl"&&i.test(h.prop))return l(h,g)}):this.walk((h,g)=>{if(h.type==="decl"&&h.prop===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="decl")return l(h,g)}))}walkRules(i,l){return l?i instanceof RegExp?this.walk((h,g)=>{if(h.type==="rule"&&i.test(h.selector))return l(h,g)}):this.walk((h,g)=>{if(h.type==="rule"&&h.selector===i)return l(h,g)}):(l=i,this.walk((h,g)=>{if(h.type==="rule")return l(h,g)}))}}return o.registerParse=n=>{c=n},o.registerRule=n=>{m=n},o.registerAtRule=n=>{u=n},o.registerRoot=n=>{f=n},Wr=o,o.default=o,o.rebuild=n=>{let i=[n];for(;i.length>0;){let l=i.pop();if(l.type==="atrule"?Object.setPrototypeOf(l,u.prototype):l.type==="rule"?Object.setPrototypeOf(l,m.prototype):l.type==="decl"?Object.setPrototypeOf(l,t.prototype):l.type==="comment"?Object.setPrototypeOf(l,e.prototype):l.type==="root"&&Object.setPrototypeOf(l,f.prototype),l[a]=!0,l.nodes)for(let h of l.nodes)i.push(h)}},Wr}var $r,ln;function Li(){if(ln)return $r;ln=1;let e=Fe();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 $r=t,t.default=t,e.registerAtRule(t),$r}var zr,un;function Fi(){if(un)return zr;un=1;let e=Fe(),t,r;class s extends e{constructor(u){super(L({type:"document"},u)),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new r,this,u).stringify()}}return s.registerLazyResult=a=>{t=a},s.registerProcessor=a=>{r=a},zr=s,s.default=s,zr}var jr,cn;function iu(){if(cn)return jr;cn=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return jr={nanoid:(s=21)=>{let a="",u=s|0;for(;u-- >0;)a+=e[Math.random()*64|0];return a},customAlphabet:(s,a=21)=>(u=a)=>{let c="",f=u|0;for(;f-- >0;)c+=s[Math.random()*s.length|0];return c}},jr}var Vr,hn;function xo(){if(hn)return Vr;hn=1;let{existsSync:e,readFileSync:t}=ve,{dirname:r,isAbsolute:s,join:a,relative:u,sep:c}=ve,{SourceMapConsumer:f,SourceMapGenerator:m}=ve;function d(o){return Buffer?Buffer.from(o,"base64").toString():window.atob(o)}class p{constructor(n,i){if(i.map===!1)return;i.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(n),this.inline=this.startWith(this.annotation,"data:");let l=i.map?i.map.prev:void 0,h=this.loadMap(i.from,l);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new f(this.json||this.text)),this.consumerCache}decodeInline(n){let i=/^data:application\/json;charset=utf-?8;base64,/,l=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,g=/^data:application\/json,/,b=n.match(h)||n.match(g);if(b)return decodeURIComponent(n.substr(b[0].length));let y=n.match(i)||n.match(l);if(y)return d(n.substr(y[0].length));let v=n.slice(22);throw v=v.slice(0,v.indexOf(",")),new Error("Unsupported source map encoding "+v)}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 l=n.lastIndexOf(i.pop()),h=n.indexOf("*/",l);l>-1&&h>-1&&(this.annotation=this.getAnnotationURL(n.substring(l,h)))}loadFile(n,i,l){if(!l&&!this.unsafeMap){if(!/\.map$/i.test(n)||!i)return;let h=u(r(i),n);if(h===".."||h.startsWith(".."+c)||s(h))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 l=i(n);if(l){let h=this.loadFile(l,n,!0);if(!h)throw new Error("Unable to load previous source map: "+l.toString());return h}}else{if(i instanceof f)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 l=this.annotation;n&&(l=a(r(n),l));let h=this.loadFile(l,n,!1);if(h)try{this.json=JSON.parse(h.replace(/^\)]}'[^\n]*\n/,""))}catch(g){return}return h}}}startWith(n,i){return n?n.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Vr=p,p.default=p,Vr}var qr,fn;function tr(){if(fn)return qr;fn=1;let{nanoid:e}=iu(),{isAbsolute:t,resolve:r}=ve,{SourceMapConsumer:s,SourceMapGenerator:a}=ve,{fileURLToPath:u,pathToFileURL:c}=ve,f=Pi(),m=xo(),d=ve,p=Symbol("lineToIndexCache"),o=!!(s&&a),n=!!(r&&t);function i(h){if(h[p])return h[p];let g=h.css.split(`
51
+ `),b=new Array(g.length),y=0;for(let v=0,E=g.length;v<E;v++)b[v]=y,y+=g[v].length+1;return h[p]=b,b}class l{get from(){return this.file||this.id}constructor(g,b={}){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,b.document&&(this.document=b.document.toString()),b.from&&(!n||/^\w+:\/\//.test(b.from)||t(b.from)?this.file=b.from:this.file=r(b.from)),n&&o){let y=new m(this.css,b);if(y.text){this.map=y;let v=y.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,b,y,v={}){let E,S,w,C,M;if(b&&typeof b=="object"){let x=b,D=y;if(typeof x.offset=="number"){C=x.offset;let T=this.fromOffset(C);b=T.line,y=T.col}else b=x.line,y=x.column,C=this.fromLineAndColumn(b,y);if(typeof D.offset=="number"){w=D.offset;let T=this.fromOffset(w);S=T.line,E=T.col}else S=D.line,E=D.column,w=this.fromLineAndColumn(D.line,D.column)}else if(y)C=this.fromLineAndColumn(b,y);else{C=b;let x=this.fromOffset(C);b=x.line,y=x.col}let R=this.origin(b,y,S,E);return R?M=new f(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,v.plugin):M=new f(g,S===void 0?b:{column:y,line:b},S===void 0?y:{column:E,line:S},this.css,this.file,v.plugin),M.input={column:y,endColumn:E,endLine:S,endOffset:w,line:b,offset:C,source:this.css},this.file&&(c&&(M.input.url=c(this.file).toString()),M.input.file=this.file),M}fromLineAndColumn(g,b){return i(this)[g-1]+b-1}fromOffset(g){let b=i(this),y=b[b.length-1],v=0;if(g>=y)v=b.length-1;else{let E=b.length-2,S;for(;v<E;)if(S=v+(E-v>>1),g<b[S])E=S-1;else if(g>=b[S+1])v=S+1;else{v=S;break}}return{col:g-b[v]+1,line:v+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,b,y,v){if(!this.map)return!1;let E=this.map.consumer(),S=E.originalPositionFor({column:b-1,line:g});if(!S.source)return!1;let w;if(typeof y=="number"){let x=E.originalPositionFor({column:v-1,line:y});x.source&&(w=x)}let C;t(S.source)?C=c(S.source):C=new URL(S.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let M={column:S.column+1,endColumn:w&&w.column+1,endLine:w&&w.line,line:S.line,url:C.toString()};if(C.protocol==="file:")if(u)M.file=u(C);else throw new Error("file: protocol is not available in this PostCSS build");let R=E.sourceContentFor(S.source);return R&&(M.source=R),M}toJSON(){let g={};for(let b of["hasBOM","css","file","id"])this[b]!=null&&(g[b]=this[b]);return this.map&&(g.map=L({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return qr=l,l.default=l,d&&d.registerInput&&d.registerInput(l),qr}var Gr,dn;function ct(){if(dn)return Gr;dn=1;let e=Fe(),t,r;class s extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,c,f){let m=new Set;for(let p of Array.isArray(u)?u:[u])p&&typeof p=="object"&&!p.parent&&p.raws&&typeof p.raws.before!="undefined"&&m.add(p.raws);let d=super.normalize(u);if(c){if(f==="prepend")this.nodes.length>1?c.raws.before=this.nodes[1].raws.before:delete c.raws.before;else if(this.first!==c)for(let p of d)m.has(p.raws)||(p.raws.before=c.raws.before)}return d}removeChild(u,c){let f=this.index(u);return!c&&f===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[f].raws.before),super.removeChild(u)}toResult(u={}){return new t(new r,this,u).stringify()}}return s.registerLazyResult=a=>{t=a},s.registerProcessor=a=>{r=a},Gr=s,s.default=s,e.registerRoot(s),Gr}var Hr,pn;function Ro(){if(pn)return Hr;pn=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
52
+ `," "];return e.split(t,r)},split(t,r,s){if(!t)return[];let a=[],u="",c=!1,f=0,m=!1,d="",p=!1;for(let o of t)p?p=!1:o==="\\"?p=!0:m?o===d&&(m=!1):o==='"'||o==="'"?(m=!0,d=o):o==="("?f+=1:o===")"?f>0&&(f-=1):f===0&&r.includes(o)&&(c=!0),c?(u!==""&&a.push(u.trim()),u="",c=!1):u+=o;return(s||u!=="")&&a.push(u.trim()),a}};return Hr=e,e.default=e,Hr}var Yr,mn;function Bi(){if(mn)return Yr;mn=1;let e=Fe(),t=Ro();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(a){let u=this.selector?this.selector.match(/,\s*/):null,c=u?u[0]:","+this.raw("between","beforeOpen");this.selector=a.join(c)}constructor(a){super(a),this.type="rule",this.nodes||(this.nodes=[])}}return Yr=r,r.default=r,e.registerRule(r),Yr}var Jr,gn;function su(){if(gn)return Jr;gn=1;let e=Li(),t=Kt(),r=er(),s=tr(),a=xo(),u=ct(),c=Bi();function f(p,o){return p.inputs?p.inputs.map(n=>{let i=se(L({},n),{__proto__:s.prototype});return i.map&&(i.map=se(L({},i.map),{__proto__:a.prototype})),i}):o}function m(p,o,n){let i=L({},p);if(delete i.inputs,delete i.nodes,i.source){let h=i.source,{inputId:g}=h,b=mt(h,["inputId"]);i.source=b,g!=null&&(i.source.input=o[g])}let l;if(i.type==="root")l=new u(i);else if(i.type==="decl")l=new r(i);else if(i.type==="rule")l=new c(i);else if(i.type==="comment")l=new t(i);else if(i.type==="atrule")l=new e(i);else throw new Error("Unknown node type: "+p.type);if(n){l.nodes=n;for(let g of n)g.parent=l}return l}function d(p,o){if(Array.isArray(p))return p.map(l=>d(l));let n,i=[{childIndex:0,children:[],inputs:f(p,o),json:p}];for(;i.length>0;){let l=i[i.length-1],h=l.json.nodes;if(h&&l.childIndex<h.length){let b=h[l.childIndex];l.childIndex+=1,i.push({childIndex:0,children:[],inputs:f(b,l.inputs),json:b});continue}i.pop();let g=m(l.json,l.inputs,h?l.children:void 0);i.length>0?i[i.length-1].children.push(g):n=g}return n}return Jr=d,d.default=d,Jr}var Xr,yn;function Mo(){if(yn)return Xr;yn=1;let{dirname:e,relative:t,resolve:r,sep:s}=ve,{SourceMapConsumer:a,SourceMapGenerator:u}=ve,{pathToFileURL:c}=ve,f=tr(),m=!!(a&&u),d=!!(e&&r&&t&&s);class p{constructor(n,i,l,h){this.stringify=n,this.mapOpts=l.map||{},this.root=i,this.opts=l,this.css=h,this.originalCSS=h,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=`
64
53
  `;this.css.includes(`\r
65
- `)&&(t=`\r
66
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||yr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new $a(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ef&&If&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=wr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new wr({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 wr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=l.match(/\n/g),o?(e+=o.length,n=l.lastIndexOf(`
67
- `),t=l.length-n):t+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?yr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=yr(La(r,this.mapOpts.annotation)));let i=ka(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Cf(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Bn){let r=Bn(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Pa==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var Fa=xf;const ds=39,Wn=34,tr=92,Un=47,rr=10,pt=32,sr=12,ir=9,nr=13,Mf=91,Rf=93,Af=40,Nf=41,Of=123,Tf=125,Df=59,_f=42,kf=58,Lf=64,or=/[\t\n\f\r "#'()/;[\\\]{}]/g,ar=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pf=/.[\r\n"'(/\\]/,zn=/[\da-f]/i;var $f=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,c,u,h,f,d,m,g=r.length,p=0,y=[],v=[];function b(){return p}function S(D){throw e.error("Unclosed "+D,p)}function C(){return v.length===0&&p>=g}function R(D){if(v.length)return v.pop();if(p>=g)return;let I=D?D.ignoreUnclosed:!1;switch(n=r.charCodeAt(p),n){case rr:case pt:case ir:case nr:case sr:{a=p;do a+=1,n=r.charCodeAt(a);while(n===pt||n===rr||n===ir||n===nr||n===sr);u=["space",r.slice(p,a)],p=a-1;break}case Mf:case Rf:case Of:case Tf:case kf:case Df:case Nf:{let x=String.fromCharCode(n);u=[x,x,p];break}case Af:{if(m=y.length?y.pop()[1]:"",d=r.charCodeAt(p+1),m==="url"&&d!==ds&&d!==Wn&&d!==pt&&d!==rr&&d!==ir&&d!==sr&&d!==nr){a=p;do{if(h=!1,a=r.indexOf(")",a+1),a===-1)if(i||I){a=p;break}else S("bracket");for(f=a;r.charCodeAt(f-1)===tr;)f-=1,h=!h}while(h);u=["brackets",r.slice(p,a+1),p,a],p=a}else a=r.indexOf(")",p+1),o=r.slice(p,a+1),a===-1||Pf.test(o)?u=["(","(",p]:(u=["brackets",o,p,a],p=a);break}case ds:case Wn:{c=n===ds?"'":'"',a=p;do{if(h=!1,a=r.indexOf(c,a+1),a===-1)if(i||I){a=p+1;break}else S("string");for(f=a;r.charCodeAt(f-1)===tr;)f-=1,h=!h}while(h);u=["string",r.slice(p,a+1),p,a],p=a;break}case Lf:{or.lastIndex=p+1,or.test(r),or.lastIndex===0?a=r.length-1:a=or.lastIndex-2,u=["at-word",r.slice(p,a+1),p,a],p=a;break}case tr:{for(a=p,l=!0;r.charCodeAt(a+1)===tr;)a+=1,l=!l;if(n=r.charCodeAt(a+1),l&&n!==Un&&n!==pt&&n!==rr&&n!==ir&&n!==nr&&n!==sr&&(a+=1,zn.test(r.charAt(a)))){for(;zn.test(r.charAt(a+1));)a+=1;r.charCodeAt(a+1)===pt&&(a+=1)}u=["word",r.slice(p,a+1),p,a],p=a;break}default:{n===Un&&r.charCodeAt(p+1)===_f?(a=r.indexOf("*/",p+2)+1,a===0&&(i||I?a=r.length:S("comment")),u=["comment",r.slice(p,a+1),p,a],p=a):(ar.lastIndex=p+1,ar.test(r),ar.lastIndex===0?a=r.length-1:a=ar.lastIndex-2,u=["word",r.slice(p,a+1),p,a],y.push(u),p=a);break}}return p++,u}function T(D){v.push(D)}return{back:T,endOfFile:C,nextToken:R,position:b}};let Ff=Ii,Bf=Zr,Wf=Xr,Uf=Lt,Vn=xi,zf=$f;const Gn={empty:!0,space:!0};function Vf(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Gf=class{constructor(e){this.input=e,this.root=new Uf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Ff;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(i=l,n=i[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return o}r=i}return!1}comment(e){let t=new Bf;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=zf(this.input)}decl(e,t){let r=new Wf;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Vf(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(n=e[c],n[1].toLowerCase()==="!important"){r.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(r.raws.important=u);break}else if(n[1].toLowerCase()==="important"){let u=e.slice(0),h="";for(let f=c;f>0;f--){let d=u[f][0];if(h.trim().startsWith("!")&&d!=="space")break;h=u.pop()[1]+h}h.trim().startsWith("!")&&(r.important=!0,r.raws.important=h,e=u)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(r.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Vn;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(r=c[0],a.push(c),r==="("||r==="[")n||(n=c),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=c),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",c=!0,u,h;for(let f=0;f<l;f+=1)n=r[f],o=n[0],o==="space"&&f===l-1&&!i?c=!1:o==="comment"?(h=r[f-1]?r[f-1][0]:"empty",u=r[f+1]?r[f+1][0]:"empty",!Gn[h]&&!Gn[u]?a.slice(-1)===","?c=!1:a+=n[1]:c=!1):a+=n[1];if(!c){let f=r.reduce((d,m)=>d+m[1],"");e.raws[t]={raw:f,value:a}}e[t]=a}rule(e){e.pop();let t=new Vn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var jf=Gf;let Hf=Ve,Yf=Jr,Zf=jf;function _r(s,e){let t=new Yf(s,e),r=new Zf(t);try{r.parse()}catch(i){throw i}return r.root}var Mi=_r;_r.default=_r;Hf.registerParse(_r);let Ys=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Ba=Ys;Ys.default=Ys;let Xf=Ba,Zs=class{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Xf(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}};var Ri=Zs;Zs.default=Zs;let Jf=Ve,Kf=Ei,Qf=Fa,qf=Mi,jn=Ri,ed=Lt,td=Hr,{isClean:be,my:rd}=kt;const sd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},id={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},nd={Once:!0,postcssPlugin:!0,prepare:!0},nt=0;function mt(s){return typeof s=="object"&&typeof s.then=="function"}function Wa(s){let e=!1,t=sd[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,nt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,nt,t+"Exit"]:[t,t+"Exit"]}function Hn(s){let e;return s.type==="document"?e=["Document",nt,"DocumentExit"]:s.type==="root"?e=["Root",nt,"RootExit"]:e=Wa(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Xs(s){return s[be]=!1,s.nodes&&s.nodes.forEach(e=>Xs(e)),s}let Js={},ot=class Ua{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(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Xs(t);else if(t instanceof Ua||t instanceof jn)i=Xs(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=qf;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[rd]&&Jf.rebuild(i)}this.result=new jn(e,i,r),this.helpers=te(O({},Js),{postcss:Js,result:this.result}),this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?O(O({},n),n.prepare(this.result)):n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!id[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!nd[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(mt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[be];){e[be]=!0;let t=[Hn(e)];for(;t.length>0;){let r=this.visitTick(t);if(mt(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return mt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=td;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Qf(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(mt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[be];)e[be]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(mt(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[be]){l[be]=!0,e.push(Hn(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===nt){r.nodes&&r.nodes.length&&(r[be]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[be]=!0;let t=Wa(e);for(let r of t)if(r===nt)e.nodes&&e.each(i=>{i[be]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ot.registerPostcss=s=>{Js=s};var za=ot;ot.default=ot;ed.registerLazyResult(ot);Kf.registerLazyResult(ot);let od=Fa,ad=Mi;const ld=Ri;let cd=Hr;let Ks=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=ad;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=cd;this.result=new ld(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new od(n,i,this._opts,t);if(l.isMap()){let[a,c]=l.generate();a&&(this.result.css=a),c&&(this.result.map=c)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};var ud=Ks;Ks.default=Ks;let hd=Ei,fd=za,dd=ud,pd=Lt,Ot=class{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new dd(this,e,t):new fd(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var md=Ot;Ot.default=Ot;pd.registerProcessor(Ot);hd.registerProcessor(Ot);let Va=Ii,Ga=Zr,gd=Ve,yd=vi,ja=Xr,Ha=Ei,wd=Sf,bd=Jr,vd=za,Sd=Da,Cd=Yr,Id=Mi,Ai=md,Ed=Ri,Ya=Lt,Za=xi,xd=Hr,Md=Ba;function G(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Ai(s)}G.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
68
- 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:
69
- https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Ai().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return G([i(a)]).process(o,l)},i};G.stringify=xd;G.parse=Id;G.fromJSON=wd;G.list=Sd;G.comment=s=>new Ga(s);G.atRule=s=>new Va(s);G.decl=s=>new ja(s);G.rule=s=>new Za(s);G.root=s=>new Ya(s);G.document=s=>new Ha(s);G.CssSyntaxError=yd;G.Declaration=ja;G.Container=gd;G.Processor=Ai;G.Document=Ha;G.Comment=Ga;G.Warning=Md;G.AtRule=Va;G.Result=Ed;G.Input=bd;G.Rule=Za;G.Root=Ya;G.Node=Cd;vd.registerPostcss(G);var Rd=G;G.default=G;const X=Bh(Rd);X.stringify;X.fromJSON;X.plugin;X.parse;X.list;X.document;X.comment;X.atRule;X.rule;X.decl;X.root;X.CssSyntaxError;X.Declaration;X.Container;X.Processor;X.Document;X.Comment;X.Warning;X.AtRule;X.Result;X.Input;X.Rule;X.Root;X.Node;var $=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($||{});function Ad(s){const e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(n){if(n){const o=n.split(r);o.length>1&&(e[Qs(o[0].trim())]=o[1].trim())}}),e}function Yn(s){const e=[];for(const t in s){const r=s[t];if(typeof r!="string")continue;const i=Dd(t);e.push(`${i}: ${r};`)}return e.join(" ")}const Nd=/-([a-z])/g,Od=/^--[a-zA-Z0-9-]+$/,Qs=s=>Od.test(s)?s:s.replace(Nd,(e,t)=>t?t.toUpperCase():""),Td=/\B([A-Z])/g,Dd=s=>s.replace(Td,"-$1").toLowerCase();class ge{constructor(...e){E(this,"parentElement",null),E(this,"parentNode",null),E(this,"ownerDocument"),E(this,"firstChild",null),E(this,"lastChild",null),E(this,"previousSibling",null),E(this,"nextSibling",null),E(this,"ELEMENT_NODE",1),E(this,"TEXT_NODE",3),E(this,"nodeType"),E(this,"nodeName"),E(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof ge){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class Ni extends ge{constructor(...e){super(e),E(this,"nodeType",9),E(this,"nodeName","#document"),E(this,"compatMode","CSS1Compat"),E(this,"RRNodeType",$.Document),E(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===$.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===$.Element||t===$.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Oi(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===$.Element||r===$.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=qa(this,e,t);return i.parentElement=null,i}removeChild(e){return el(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new Ni}createDocumentType(e,t,r){const i=new Xa(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=new Kr(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new Ja(e);return t.ownerDocument=this,t}createComment(e){const t=new Ka(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Qa(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class Xa extends ge{constructor(e,t,r){super(),E(this,"nodeType",10),E(this,"RRNodeType",$.DocumentType),E(this,"name"),E(this,"publicId"),E(this,"systemId"),E(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Kr extends ge{constructor(e){super(),E(this,"nodeType",1),E(this,"RRNodeType",$.Element),E(this,"tagName"),E(this,"attributes",{}),E(this,"shadowRoot",null),E(this,"scrollLeft"),E(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Ld(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Ad(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,n)=>{if(t.test(r))return;const o=Qs(r);i?e[o]=i:delete e[o],n==="important"&&(e[o]+=" !important"),this.attributes.style=Yn(e)},e.removeProperty=r=>{if(t.test(r))return"";const i=Qs(r),n=e[i]||"";return delete e[i],this.attributes.style=Yn(e),n},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Oi(this,e)}insertBefore(e,t){return qa(this,e,t)}removeChild(e){return el(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class _d extends Kr{constructor(){super(...arguments),E(this,"currentTime"),E(this,"volume"),E(this,"paused"),E(this,"muted"),E(this,"playbackRate"),E(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class kd extends Kr{constructor(){super(...arguments),E(this,"tagName","DIALOG"),E(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 Ja extends ge{constructor(e){super(),E(this,"nodeType",3),E(this,"nodeName","#text"),E(this,"RRNodeType",$.Text),E(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class Ka extends ge{constructor(e){super(),E(this,"nodeType",8),E(this,"nodeName","#comment"),E(this,"RRNodeType",$.Comment),E(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class Qa extends ge{constructor(e){super(),E(this,"nodeName","#cdata-section"),E(this,"nodeType",4),E(this,"RRNodeType",$.CDATA),E(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Ld{constructor(e,t){if(E(this,"onChange"),E(this,"classes",[]),E(this,"add",(...r)=>{for(const i of r){const n=String(i);this.classes.indexOf(n)>=0||this.classes.push(n)}this.onChange&&this.onChange(this.classes.join(" "))}),E(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}}function Oi(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function qa(s,e,t){if(!t)return Oi(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function el(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var le=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(le||{});const lr=new Map,Zn=new WeakSet;function Xn(s){return s!==null&&typeof s=="object"&&"complete"in s&&"naturalWidth"in s&&"naturalHeight"in s&&"src"in s&&"onload"in s}function tl(s){if(Zn.has(s))return;Zn.add(s);const e=s.drawImage.bind(s);s.drawImage=function(t,...r){const i=lr.get(s);i&&(i.cancelled=!0);const n=()=>{r.length===2&&Xn(t)&&r.push(t.naturalWidth||t.width,t.naturalHeight||t.height),e(t,...r)};if(Xn(t)&&!t.complete){const o={cancelled:!1};lr.set(s,o);const l=()=>{o.cancelled||(lr.delete(s),n())},a=()=>{if(!o.cancelled){lr.delete(s);try{n()}catch(c){}}};t.onload=l,t.onerror=a}else n()}}const qs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Pd={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 ve=null;function kr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=$d(s,e,t,r),rl(s,e,t,r),Fd(s,e,t)}function $d(s,e,t,r){var i;if(t.afterAppend&&!ve&&(ve=new WeakSet,setTimeout(()=>{ve=null},0)),!Ti(s,e)){const n=Lr(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(n,s),s=n}switch(e.RRNodeType){case $.Document:{if(!Ye(s,e,t.mirror,r)){const n=r.getMeta(e);n&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,n),ve==null||ve.add(s))}break}case $.Element:{const n=s,o=e;switch(o.tagName){case"IFRAME":{const l=s.contentDocument;if(!l)break;kr(l,e.contentDocument,t,r);break}}o.shadowRoot&&(n.shadowRoot||n.attachShadow({mode:"open"}),rl(n.shadowRoot,o.shadowRoot,t,r)),Bd(n,o,r);break}}return s}function Fd(s,e,t){var r;switch(e.RRNodeType){case $.Document:{const i=e.scrollData;i&&t.applyScroll(i,!0);break}case $.Element:{const i=s,n=e;switch(n.scrollData&&t.applyScroll(n.scrollData,!0),n.inputData&&t.applyInput(n.inputData),n.tagName){case"AUDIO":case"VIDEO":{const o=s,l=n;l.paused!==void 0&&(l.paused?o.pause():o.play()),l.muted!==void 0&&(o.muted=l.muted),l.volume!==void 0&&(o.volume=l.volume),l.currentTime!==void 0&&(o.currentTime=l.currentTime),l.playbackRate!==void 0&&(o.playbackRate=l.playbackRate),l.loop!==void 0&&(o.loop=l.loop);break}case"CANVAS":{const o=e;if(o.rr_dataURL!==null){const l=document.createElement("img");l.src=o.rr_dataURL;const a=i.getContext("2d");a&&(tl(a),a.drawImage(l,0,0))}o.canvasMutations.forEach(l=>t.applyCanvas(l.event,l.mutation,s));break}case"STYLE":{const o=i.sheet;o&&e.rules.forEach(l=>t.applyStyleSheetMutation(l,o));break}case"DIALOG":{const o=i,l=n,a=o.open,c=o.matches("dialog:modal"),u=l.open,h=l.isModal,f=c!==h,d=a!==u;if((f||a&&d)&&o.close(),u&&(d||f))try{h?o.showModal():o.show()}catch(m){console.warn(m)}break}}break}case $.Text:case $.Comment:case $.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}ve!=null&&ve.has(s)&&(ve.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function Bd(s,e,t){const r=s.attributes,i=e.attributes;for(const n in i){const o=i[n],l=t.getMeta(e);if(l!=null&&l.isSVG&&qs[n])s.setAttributeNS(qs[n],n,o);else if(e.tagName==="CANVAS"&&n==="rr_dataURL"){const a=document.createElement("img");a.src=o;const c=s.getContext("2d");c&&(tl(c),c.drawImage(a,0,0))}else{if(e.tagName==="IFRAME"&&n==="srcdoc")continue;try{s.setAttribute(n,o)}catch(a){console.warn(a)}}}for(const{name:n}of Array.from(r))n in i||s.removeAttribute(n);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function rl(s,e,t,r){const i=Array.from(s.childNodes),n=e.childNodes;if(i.length===0&&n.length===0)return;let o=0,l=i.length-1,a=0,c=n.length-1,u=i[o],h=i[l],f=n[a],d=n[c],m,g;for(;o<=l&&a<=c;)if(u===void 0)u=i[++o];else if(h===void 0)h=i[--l];else if(Ye(u,f,t.mirror,r))u=i[++o],f=n[++a];else if(Ye(h,d,t.mirror,r))h=i[--l],d=n[--c];else if(Ye(u,d,t.mirror,r)){try{s.insertBefore(u,h.nextSibling)}catch(v){console.warn(v)}u=i[++o],d=n[--c]}else if(Ye(h,f,t.mirror,r)){try{s.insertBefore(h,u)}catch(v){console.warn(v)}h=i[--l],f=n[++a]}else{if(!m){m={};for(let b=o;b<=l;b++){const S=i[b];S&&t.mirror.hasNode(S)&&(m[t.mirror.getId(S)]=b)}}g=m[r.getId(f)];const v=i[g];if(g!==void 0&&v&&Ye(v,f,t.mirror,r)){try{s.insertBefore(v,u)}catch(b){console.warn(b)}i[g]=void 0}else{const b=Lr(f,t.mirror,r);s.nodeName==="#document"&&u&&(b.nodeType===b.DOCUMENT_TYPE_NODE&&u.nodeType===u.DOCUMENT_TYPE_NODE||b.nodeType===b.ELEMENT_NODE&&u.nodeType===u.ELEMENT_NODE)&&(s.removeChild(u),t.mirror.removeNodeFromMap(u),u=i[++o]);try{s.insertBefore(b,u||null)}catch(S){console.warn(S)}}f=n[++a]}if(o>l){const v=n[c+1];let b=null;for(v&&(b=t.mirror.getNode(r.getId(v)));a<=c;++a){const S=Lr(n[a],t.mirror,r);try{s.insertBefore(S,b)}catch(C){console.warn(C)}}}else if(a>c)for(;o<=l;o++){const v=i[o];if(!(!v||v.parentNode!==s))try{s.removeChild(v),t.mirror.removeNodeFromMap(v)}catch(b){console.warn(b)}}let p=s.firstChild,y=e.firstChild;for(;p!==null&&y!==null;)kr(p,y,t,r),p=p.nextSibling,y=y.nextSibling}function Lr(s,e,t){const r=t.getId(s),i=t.getMeta(s);let n=null;if(r>-1&&(n=e.getNode(r)),n!==null&&Ti(n,s))return n;switch(s.RRNodeType){case $.Document:n=new Document;break;case $.DocumentType:n=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case $.Element:{let o=s.tagName.toLowerCase();o=Pd[o]||o,i&&"isSVG"in i&&(i!=null&&i.isSVG)?n=document.createElementNS(qs.svg,o):n=document.createElement(s.tagName);break}case $.Text:n=document.createTextNode(s.data);break;case $.Comment:n=document.createComment(s.data);break;case $.CDATA:n=document.createCDATASection(s.data);break}i&&e.add(n,O({},i));try{ve==null||ve.add(n)}catch(o){}return n}function Ti(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ye(s,e,t,r){const i=t.getId(s),n=r.getId(e);return i===-1||i!==n?!1:Ti(s,e)}class lt extends Ni{constructor(e){super(),E(this,"UNSERIALIZED_STARTING_ID",-2),E(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),E(this,"mirror",Kd()),E(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new lt}createDocumentType(e,t,r){const i=new Wd(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new Ud(t);break;case"IFRAME":r=new jd(t,this.mirror);break;case"CANVAS":r=new Vd(t);break;case"STYLE":r=new Gd(t);break;case"DIALOG":r=new zd(t);break;default:r=new Qr(t);break}return r.ownerDocument=this,r}createComment(e){const t=new Yd(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Zd(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Hd(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Wd=Xa;class Qr extends Kr{constructor(){super(...arguments),E(this,"inputData",null),E(this,"scrollData",null)}}class Ud extends _d{}class zd extends kd{}class Vd extends Qr{constructor(){super(...arguments),E(this,"rr_dataURL",null),E(this,"canvasMutations",[])}getContext(){return null}}class Gd extends Qr{constructor(){super(...arguments),E(this,"rules",[])}}class jd extends Qr{constructor(e,t){super(e),E(this,"contentDocument",new lt),this.contentDocument.mirror=t}}const Hd=Ja,Yd=Ka,Zd=Qa;function Xd(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function sl(s,e,t,r){let i;switch(s.nodeType){case le.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case le.DOCUMENT_TYPE_NODE:{const o=s;i=e.createDocumentType(o.name,o.publicId,o.systemId);break}case le.ELEMENT_NODE:{const o=s,l=Xd(o);i=e.createElement(l);const a=i;for(const{name:c,value:u}of Array.from(o.attributes))a.attributes[c]=u;o.scrollLeft&&(a.scrollLeft=o.scrollLeft),o.scrollTop&&(a.scrollTop=o.scrollTop);break}case le.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case le.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case le.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case le.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let n=t.getMeta(s);return e instanceof lt&&(n||(n=il(i,e.unserializedId),t.add(s,n)),e.mirror.add(i,O({},n))),i}function Jd(s,e=Fh(),t=new lt){function r(i,n){const o=sl(i,t,e,n);if(o!==null)if((n==null?void 0:n.nodeName)!=="IFRAME"&&i.nodeType!==le.DOCUMENT_FRAGMENT_NODE&&(n==null||n.appendChild(o),o.parentNode=n,o.parentElement=n),i.nodeName==="IFRAME"){const l=i.contentDocument;l&&r(l,o)}else(i.nodeType===le.DOCUMENT_NODE||i.nodeType===le.ELEMENT_NODE||i.nodeType===le.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===le.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,o),i.childNodes.forEach(l=>r(l,o)))}return r(s,null),t}function Kd(){return new Qd}class Qd{constructor(){E(this,"idNodeMap",new Map),E(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function il(s,e){switch(s.RRNodeType){case $.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case $.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case $.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const cr=new Map,Jn=new WeakSet;function Kn(s){return s!==null&&typeof s=="object"&&"complete"in s&&"naturalWidth"in s&&"naturalHeight"in s&&"src"in s&&"onload"in s}function nl(s){if(Jn.has(s))return;Jn.add(s);const e=s.drawImage.bind(s);s.drawImage=function(t,...r){const i=cr.get(s);i&&(i.cancelled=!0);const n=()=>{r.length===2&&Kn(t)&&r.push(t.naturalWidth||t.width,t.naturalHeight||t.height),e(t,...r)};if(Kn(t)&&!t.complete){const o={cancelled:!1};cr.set(s,o);const l=()=>{o.cancelled||(cr.delete(s),n())},a=()=>{if(!o.cancelled){cr.delete(s);try{n()}catch(c){}}};t.onload=l,t.onerror=a}else n()}}const Qn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ur={},qd=()=>!!globalThis.Zone;function Di(s){if(ur[s])return ur[s];const e=globalThis[s],t=e.prototype,r=s in Qn?Qn[s]:void 0,i=!!(r&&r.every(l=>{var a,c;return!!((c=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&c.toString().includes("[native code]"))})),n=s in qn?qn[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!qd())return ur[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const c=a[s].prototype;return document.body.removeChild(l),c?ur[s]=c:t}catch(l){return t}}const ps={};function Le(s,e,t){var r;const i=`${s}.${String(t)}`;if(ps[i])return ps[i].call(e);const n=Di(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(ps[i]=o,o.call(e)):e[t]}const ms={};function ol(s,e,t){const r=`${s}.${String(t)}`;if(ms[r])return ms[r].bind(e);const n=Di(s)[t];return typeof n!="function"?e[t]:(ms[r]=n,n.bind(e))}function ep(s){return Le("Node",s,"childNodes")}function tp(s){return Le("Node",s,"parentNode")}function rp(s){return Le("Node",s,"parentElement")}function sp(s){return Le("Node",s,"textContent")}function ip(s,e){return ol("Node",s,"contains")(e)}function np(s){return ol("Node",s,"getRootNode")()}function op(s){return!s||!("host"in s)?null:Le("ShadowRoot",s,"host")}function ap(s){return s.styleSheets}function lp(s){return!s||!("shadowRoot"in s)?null:Le("Element",s,"shadowRoot")}function cp(s,e){return Le("Element",s,"querySelector")(e)}function up(s,e){return Le("Element",s,"querySelectorAll")(e)}function al(){return Di("MutationObserver").constructor}function Ge(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}const P={childNodes:ep,parentNode:tp,parentElement:rp,textContent:sp,contains:ip,getRootNode:np,host:op,styleSheets:ap,shadowRoot:lp,querySelector:cp,querySelectorAll:up,mutationObserver:al,patch:Ge,wrapCanvasContextDrawImage:nl};function oe(s,e,t=document){const r={capture:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const Ze=`Please stop import mirror directly. Instead of that,\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)),l=n.root||e(n.file),h;this.mapOpts.sourcesContent===!1?(h=new a(n.text),h.sourcesContent&&(h.sourcesContent=null)):h=n.consumer(),this.map.applySourceMap(h,i,this.toUrl(this.path(l)))}}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(),d&&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=u.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new u({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 u({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,i=1,l="<no source>",h={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(y,v,E)=>{if(this.css+=y,v&&E!=="end"&&(h.generated.line=n,h.generated.column=i-1,v.source&&v.source.start?(h.source=this.sourcePath(v),h.original.line=v.source.start.line,h.original.column=v.source.start.column-1,this.map.addMapping(h)):(h.source=l,h.original.line=1,h.original.column=0,this.map.addMapping(h))),b=y.match(/\n/g),b?(n+=b.length,g=y.lastIndexOf(`
57
+ `),i=y.length-g):i+=y.length,v&&E!=="start"){let S=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==S.last||S.raws.semicolon)&&(v.source&&v.source.end?(h.source=this.sourcePath(v),h.original.line=v.source.end.line,h.original.column=v.source.end.column-1,h.generated.line=n,h.generated.column=i-2,this.map.addMapping(h)):(h.source=l,h.original.line=1,h.original.column=0,h.generated.line=n,h.generated.column=i-1,this.map.addMapping(h)))}})}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 l=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(l=e(r(l,this.mapOpts.annotation)));let h=t(l,n);return this.memoizedPaths.set(n,h),h}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 f(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 l=i.source.input.from;if(l&&!n[l]){n[l]=!0;let h=this.usesFileUrls?this.toFileUrl(l):this.toUrl(this.path(l));this.map.setSourceContent(h,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(c){let l=c(n).toString();return this.memoizedFileURLs.set(n,l),l}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 l=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,l),l}}return Xr=p,Xr}var Qr,wn;function nu(){if(wn)return Qr;wn=1;const e=39,t=34,r=92,s=47,a=10,u=32,c=12,f=9,m=13,d=91,p=93,o=40,n=41,i=123,l=125,h=59,g=42,b=58,y=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,E=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,w=/[\da-f]/i;return Qr=function(M,R={}){let x=M.css.valueOf(),D=R.ignoreErrors,T,G,X,I,ne,P,V,H,F,Z,ue=x.length,N=0,Se=[],ce=[],Te=-1;function De(){return N}function Ce(ie){throw M.error("Unclosed "+ie,N)}function ze(){return ce.length===0&&N>=ue}function tt(ie){if(ce.length)return ce.pop();if(N>=ue)return;let me=ie?ie.ignoreUnclosed:!1;switch(T=x.charCodeAt(N),T){case a:case u:case f:case m:case c:{I=N;do I+=1,T=x.charCodeAt(I);while(T===u||T===a||T===f||T===m||T===c);P=["space",x.slice(N,I)],N=I-1;break}case d:case p:case i:case l:case b:case h:case n:{let de=String.fromCharCode(T);P=[de,de,N];break}case o:{if(Z=Se.length?Se.pop()[1]:"",F=x.charCodeAt(N+1),Z==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==f&&F!==c&&F!==m){I=N;do{if(V=!1,I=x.indexOf(")",I+1),I===-1)if(D||me){I=N;break}else Ce("bracket");for(H=I;x.charCodeAt(H-1)===r;)H-=1,V=!V}while(V);P=["brackets",x.slice(N,I+1),N,I],N=I}else N<=Te?P=["(","(",N]:(I=x.indexOf(")",N+1),G=x.slice(N,I+1),I===-1||S.test(G)?(Te=I===-1?ue:I,P=["(","(",N]):(P=["brackets",G,N,I],N=I));break}case e:case t:{ne=T===e?"'":'"',I=N;do{if(V=!1,I=x.indexOf(ne,I+1),I===-1)if(D||me){I=N+1;break}else Ce("string");for(H=I;x.charCodeAt(H-1)===r;)H-=1,V=!V}while(V);P=["string",x.slice(N,I+1),N,I],N=I;break}case y:{v.lastIndex=N+1,v.test(x),v.lastIndex===0?I=x.length-1:I=v.lastIndex-2,P=["at-word",x.slice(N,I+1),N,I],N=I;break}case r:{for(I=N,X=!0;x.charCodeAt(I+1)===r;)I+=1,X=!X;if(T=x.charCodeAt(I+1),X&&T!==s&&T!==u&&T!==a&&T!==f&&T!==m&&T!==c&&(I+=1,w.test(x.charAt(I)))){for(;w.test(x.charAt(I+1));)I+=1;x.charCodeAt(I+1)===u&&(I+=1)}P=["word",x.slice(N,I+1),N,I],N=I;break}default:{T===s&&x.charCodeAt(N+1)===g?(I=x.indexOf("*/",N+2)+1,I===0&&(D||me?I=x.length:Ce("comment")),P=["comment",x.slice(N,I+1),N,I],N=I):(E.lastIndex=N+1,E.test(x),E.lastIndex===0?I=x.length-1:I=E.lastIndex-2,P=["word",x.slice(N,I+1),N,I],Se.push(P),N=I);break}}return N++,P}function pe(ie){ce.push(ie)}return{back:pe,endOfFile:ze,nextToken:tt,position:De}},Qr}var Zr,vn;function ou(){if(vn)return Zr;vn=1;let e=Li(),t=Kt(),r=er(),s=ct(),a=Bi(),u=nu();const c={empty:!0,space:!0};function f(p){for(let o=p.length-1;o>=0;o--){let n=p[o],i=n[3]||n[2];if(i)return i}}function m(p,o,n){let i="";for(let l=o;l<n;l++)i+=p[l][1];return i}class d{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,l,h,g=!1,b=!1,y=[],v=[];for(;!this.tokenizer.endOfFile();){if(o=this.tokenizer.nextToken(),i=o[0],i==="("||i==="["?v.push(i==="("?")":"]"):i==="{"&&v.length>0?v.push("}"):i===v[v.length-1]&&v.pop(),v.length===0)if(i===";"){n.source.end=this.getPosition(o[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){b=!0;break}else if(i==="}"){if(y.length>0){for(h=y.length-1,l=y[h];l&&l[0]==="space";)l=y[--h];l&&(n.source.end=this.getPosition(l[3]||l[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=""),b&&(n.nodes=[],this.current=n)}checkMissedSemicolon(o){let n=this.colon(o);if(n===!1)return;let i=0,l;for(let h=n-1;h>=0&&(l=o[h],!(l[0]!=="space"&&(i+=1,i===2)));h--);throw this.input.error("Missed semicolon",l[0]==="word"?l[3]+1:l[2])}colon(o){let n=0,i,l,h;for(let[g,b]of o.entries()){if(l=b,h=l[0],h==="("&&(n+=1),h===")"&&(n-=1),n===0&&h===":")if(!i)this.doubleColon(l);else{if(i[0]==="word"&&i[1]==="progid")continue;return g}i=l}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 l=i.match(/^(\s*)([^]*\S)(\s*)$/);n.text=l[2],n.raws.left=l[1],n.raws.right=l[3]}}createTokenizer(){this.tokenizer=u(this.input)}decl(o,n){let i=new r;this.init(i,o[0][2]);let l=o[o.length-1];l[0]===";"&&(this.semicolon=!0,o.pop()),i.source.end=this.getPosition(l[3]||l[2]||f(o)),i.source.end.offset++;let h=0;for(;o[h][0]!=="word";)h===o.length-1&&this.unknownWord([o[h]]),h++;i.raws.before+=m(o,0,h),i.source.start=this.getPosition(o[h][2]);let g=h;for(;h<o.length;){let w=o[h][0];if(w===":"||w==="space"||w==="comment")break;h++}i.prop=m(o,g,h);let b=h,y;for(;h<o.length&&(y=o[h],h++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);i.raws.between=m(o,b,h),(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let v=h;for(;h<o.length;){let w=o[h][0];if(w!=="space"&&w!=="comment")break;h++}let E=o.slice(v,h);o=o.slice(h),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 a;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,l=!1,h=null,g=[],b=o[1].startsWith("--"),y=[],v=o;for(;v;){if(i=v[0],y.push(v),i==="("||i==="[")h||(h=v),g.push(i==="("?")":"]");else if(b&&l&&i==="{")h||(h=v),g.push("}");else if(g.length===0)if(i===";")if(l){this.decl(y,b);return}else break;else if(i==="{"){this.rule(y);return}else if(i==="}"){this.tokenizer.back(y.pop()),n=!0;break}else i===":"&&(l=!0);else i===g[g.length-1]&&(g.pop(),g.length===0&&(h=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),g.length>0&&this.unclosedBracket(h),n&&l){if(!b)for(;y.length&&(v=y[y.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,b)}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,l){let h,g,b=i.length,y="",v=!0,E,S;for(let w=0;w<b;w+=1)h=i[w],g=h[0],g==="space"&&w===b-1&&!l?v=!1:g==="comment"?(S=i[w-1]?i[w-1][0]:"empty",E=i[w+1]?i[w+1][0]:"empty",!c[S]&&!c[E]?y.slice(-1)===","?v=!1:y+=h[1]:v=!1):y+=h[1];if(!v){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 a;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 l=n;l<o.length;l++)i+=o[l][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 Zr=d,Zr}var Kr,bn;function Ui(){if(bn)return Kr;bn=1;let e=Fe(),t=tr(),r=ou();function s(a,u){let c=new t(a,u),f=new r(c);try{f.parse()}catch(m){throw m}return f.root}return Kr=s,s.default=s,e.registerParse(s),Kr}var ei,Sn;function Io(){if(Sn)return ei;Sn=1;let e=Fe(),{my:t}=Qt();class r{constructor(a,u={}){if(this.type="warning",this.text=a,u.node&&u.node.source){u.node[t]||e.rebuild(u.node);let c=u.node.rangeBy(u);this.line=c.start.line,this.column=c.start.column,this.endLine=c.end.line,this.endColumn=c.end.column}for(let c in u)this[c]=u[c]}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 ei=r,r.default=r,ei}var ti,Cn;function Wi(){if(Cn)return ti;Cn=1;let e=Io();class t{get content(){return this.css}constructor(s,a,u){this.processor=s,this.messages=[],this.root=a,this.opts=u,this.css="",this.map=void 0}toString(){return this.css}warn(s,a={}){a.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(a.plugin=this.lastPlugin.postcssPlugin);let u=new e(s,a);return this.messages.push(u),u}warnings(){return this.messages.filter(s=>s.type==="warning")}}return ti=t,t.default=t,ti}var ri,En;function Oo(){if(En)return ri;En=1;let e={};return ri=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},ri}var ii,xn;function No(){if(xn)return ii;xn=1;let e=Fe(),t=Fi(),r=Mo(),s=Ui(),a=Wi(),u=ct(),c=Xt(),{isClean:f,my:m}=Qt(),d=Oo();const p={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 l(E){return typeof E=="object"&&typeof E.then=="function"}function h(E){let S=!1,w=p[E.type];return E.type==="decl"?S=E.prop.toLowerCase():E.type==="atrule"&&(S=E.name.toLowerCase()),S&&E.append?[w,w+"-"+S,i,w+"Exit",w+"Exit-"+S]:S?[w,w+"-"+S,w+"Exit",w+"Exit-"+S]:E.append?[w,i,w+"Exit"]:[w,w+"Exit"]}function g(E){let S;return E.type==="document"?S=["Document",i,"DocumentExit"]:E.type==="root"?S=["Root",i,"RootExit"]:S=h(E),{eventIndex:0,events:S,iterator:0,node:E,visitorIndex:0,visitors:[]}}function b(E){let S=[E];for(;S.length>0;){let w=S.pop();if(w[f]=!1,w.nodes)for(let C of w.nodes)S.push(C)}return E}let y={};class v{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(S,w,C){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=b(w);else if(w instanceof v||w instanceof a)M=b(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 a(S,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(S){return this.async().catch(S)}finally(S){return this.async().then(S,S)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(S,w){let C=this.result.lastPlugin;try{w&&w.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=C.postcssPlugin,S.setMessage()):C.postcssVersion}catch(M){console&&console.error&&console.error(M)}return S}prepareVisitors(){this.listeners={};let S=(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==="*"?S(w,C,w[C][M]):S(w,C+"-"+M.toLowerCase(),w[C][M]);else typeof w[C]=="function"&&S(w,C,w[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let w=this.plugins[S],C=this.runOnRoot(w);if(l(C))try{await C}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[f];){S[f]=!0;let w=[g(S)];for(;w.length>0;){let C=this.visitTick(w);if(l(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(S.type==="document"){let M=S.nodes.map(R=>C(R,this.helpers));await Promise.all(M)}else await C(S,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(S){this.result.lastPlugin=S;try{if(typeof S=="object"&&S.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(C=>S.Once(C,this.helpers));return l(w[0])?Promise.all(w):w}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(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 S=this.result.opts,w=c;S.syntax&&(w=S.syntax.stringify),S.stringifier&&(w=S.stringifier),w.stringify&&(w=w.stringify);let C=this.result.root.source;if(S.map===void 0&&!(C&&C.input&&C.input.map)){let x="";return w(this.result.root,D=>{x+=D}),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 S of this.plugins){let w=this.runOnRoot(S);if(l(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[f];)S[f]=!0,this.walkSync(S);if(this.listeners.OnceExit)if(S.type==="document")for(let w of S.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,w){return this.async().then(S,w)}toString(){return this.css}visitSync(S,w){for(let[C,M]of S){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(l(R))throw this.getAsyncError()}}visitTick(S){let w=S[S.length-1],{node:C,visitors:M}=w;if(C.type!=="root"&&C.type!=="document"&&!C.parent){S.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[x,D]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=x;try{return D(C.toProxy(),this.helpers)}catch(T){throw this.handleError(T,C)}}if(w.iterator!==0){let x=w.iterator;w.descending&&(w.descending=!1,C.indexes[x]+=1);let D;for(;D=C.nodes[C.indexes[x]];){if(!D[f]){D[f]=!0,w.descending=!0,S.push(g(D));return}C.indexes[x]+=1}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[f]=!0,w.iterator=C.getIterator());return}else if(this.listeners[x]){w.visitors=this.listeners[x];return}}S.pop()}walkSync(S){S[f]=!0;let w=[{eventIndex:0,events:h(S),iterator:0,node:S}];for(;w.length>0;){let C=w[w.length-1],M=C.node;if(C.iterator!==0){let R=C.iterator;C.descending&&(C.descending=!1,M.indexes[R]+=1);let x,D=!1;for(;x=M.nodes[M.indexes[R]];){if(!x[f]){x[f]=!0,C.descending=!0,w.push({eventIndex:0,events:h(x),iterator:0,node:x}),D=!0;break}M.indexes[R]+=1}if(D)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 v.registerPostcss=E=>{y=E},ii=v,v.default=v,u.registerLazyResult(v),t.registerLazyResult(v),ii}var si,Rn;function au(){if(Rn)return si;Rn=1;let e=Mo(),t=Ui(),r=Wi(),s=Xt(),a=Oo();class u{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 f,m=t;try{f=m(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=f,f}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(f,m,d){m=m.toString(),this.stringified=!1,this._processor=f,this._css=m,this._opts=d,this._map=void 0;let p=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(p,void 0,this._opts,m);if(n.isMap()){let[i,l]=n.generate();i&&(this.result.css=i),l&&(this.result.map=l)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(f){return this.async().catch(f)}finally(f){return this.async().then(f,f)}sync(){if(this.error)throw this.error;return this.result}then(f,m){return this.async().then(f,m)}toString(){return this._css}warnings(){return[]}}return si=u,u.default=u,si}var ni,Mn;function lu(){if(Mn)return ni;Mn=1;let e=Fi(),t=No(),r=au(),s=ct();class a{constructor(c=[]){this.version="8.5.25",this.plugins=this.normalize(c)}normalize(c){let f=[];for(let m of c)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))f=f.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)f.push(m);else if(typeof m=="function")f.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return f}process(c,f={}){return!this.plugins.length&&!f.parser&&!f.stringifier&&!f.syntax?new r(this,c,f):new t(this,c,f)}use(c){return this.plugins=this.plugins.concat(this.normalize([c])),this}}return ni=a,a.default=a,s.registerProcessor(a),e.registerProcessor(a),ni}var oi,In;function uu(){if(In)return oi;In=1;let e=Li(),t=Kt(),r=Fe(),s=Pi(),a=er(),u=Fi(),c=su(),f=tr(),m=No(),d=Ro(),p=Zt(),o=Ui(),n=lu(),i=Wi(),l=ct(),h=Bi(),g=Xt(),b=Io();function y(...v){return v.length===1&&Array.isArray(v[0])&&(v=v[0]),new n(v)}return y.plugin=function(E,S){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=S(...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,D){return y([C(D)]).process(R,x)},C},y.stringify=g,y.parse=o,y.fromJSON=c,y.list=d,y.comment=v=>new t(v),y.atRule=v=>new e(v),y.decl=v=>new a(v),y.rule=v=>new h(v),y.root=v=>new l(v),y.document=v=>new u(v),y.CssSyntaxError=s,y.Declaration=a,y.Container=r,y.Processor=n,y.Document=u,y.Comment=t,y.Warning=b,y.AtRule=e,y.Result=i,y.Input=f,y.Rule=h,y.Root=l,y.Node=p,m.registerPostcss(y),oi=y,y.default=y,oi}var cu=uu();const K=Zl(cu);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 $=(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))($||{});function hu(e){const t={},r=/;(?![^(]*\))/g,s=/:(.+)/,a=/\/\*.*?\*\//g;return e.replace(a,"").split(r).forEach(function(u){if(u){const c=u.split(s);c.length>1&&(t[gi(c[0].trim())]=c[1].trim())}}),t}function On(e){const t=[];for(const r in e){const s=e[r];if(typeof s!="string")continue;const a=mu(r);t.push(`${a}: ${s};`)}return t.join(" ")}const fu=/-([a-z])/g,du=/^--[a-zA-Z0-9-]+$/,gi=e=>du.test(e)?e:e.replace(fu,(t,r)=>r?r.toUpperCase():""),pu=/\B([A-Z])/g,mu=e=>e.replace(pu,"-$1").toLowerCase();class be{constructor(...t){A(this,"parentElement",null),A(this,"parentNode",null),A(this,"ownerDocument"),A(this,"firstChild",null),A(this,"lastChild",null),A(this,"previousSibling",null),A(this,"nextSibling",null),A(this,"ELEMENT_NODE",1),A(this,"TEXT_NODE",3),A(this,"nodeType"),A(this,"nodeName"),A(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 be){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 $i extends be{constructor(...t){super(t),A(this,"nodeType",9),A(this,"nodeName","#document"),A(this,"compatMode","CSS1Compat"),A(this,"RRNodeType",$.Document),A(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const r=t.RRNodeType;if((r===$.Element||r===$.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=zi(this,t);return s.parentElement=null,s}insertBefore(t,r){const s=t.RRNodeType;if((s===$.Element||s===$.DocumentType)&&this.childNodes.some(u=>u.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const a=ko(this,t,r);return a.parentElement=null,a}removeChild(t){return Po(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 $i}createDocumentType(t,r,s){const a=new To(t,r,s);return a.ownerDocument=this,a}createElement(t){const r=new rr(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){const r=new Do(t);return r.ownerDocument=this,r}createComment(t){const r=new Ao(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new _o(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}}class To extends be{constructor(t,r,s){super(),A(this,"nodeType",10),A(this,"RRNodeType",$.DocumentType),A(this,"name"),A(this,"publicId"),A(this,"systemId"),A(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=s,this.nodeName=t}toString(){return"RRDocumentType"}}class rr extends be{constructor(t){super(),A(this,"nodeType",1),A(this,"RRNodeType",$.Element),A(this,"tagName"),A(this,"attributes",{}),A(this,"shadowRoot",null),A(this,"scrollLeft"),A(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 wu(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?hu(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(s,a,u)=>{if(r.test(s))return;const c=gi(s);a?t[c]=a:delete t[c],u==="important"&&(t[c]+=" !important"),this.attributes.style=On(t)},t.removeProperty=s=>{if(r.test(s))return"";const a=gi(s),u=t[a]||"";return delete t[a],this.attributes.style=On(t),u},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 zi(this,t)}insertBefore(t,r){return ko(this,t,r)}removeChild(t){return Po(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 gu extends rr{constructor(){super(...arguments),A(this,"currentTime"),A(this,"volume"),A(this,"paused"),A(this,"muted"),A(this,"playbackRate"),A(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 yu extends rr{constructor(){super(...arguments),A(this,"tagName","DIALOG"),A(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 Do extends be{constructor(t){super(),A(this,"nodeType",3),A(this,"nodeName","#text"),A(this,"RRNodeType",$.Text),A(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 Ao extends be{constructor(t){super(),A(this,"nodeType",8),A(this,"nodeName","#comment"),A(this,"RRNodeType",$.Comment),A(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 _o extends be{constructor(t){super(),A(this,"nodeName","#cdata-section"),A(this,"nodeType",4),A(this,"RRNodeType",$.CDATA),A(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 wu{constructor(t,r){if(A(this,"onChange"),A(this,"classes",[]),A(this,"add",(...s)=>{for(const a of s){const u=String(a);this.classes.indexOf(u)>=0||this.classes.push(u)}this.onChange&&this.onChange(this.classes.join(" "))}),A(this,"remove",(...s)=>{this.classes=this.classes.filter(a=>s.indexOf(a)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const s=t.trim().split(/\s+/);this.classes.push(...s)}this.onChange=r}}function zi(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 ko(e,t,r){if(!r)return zi(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 Po(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,Nn=new WeakSet;function Tn(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Lo(e){if(Nn.has(e))return;Nn.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const a=Et.get(e);a&&(a.cancelled=!0);const u=()=>{s.length===2&&Tn(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(Tn(r)&&!r.complete){const c={cancelled:!1};Et.set(e,c);const f=()=>{c.cancelled||(Et.delete(e),u())},m=()=>{if(!c.cancelled){Et.delete(e);try{u()}catch(d){}}};r.onload=f,r.onerror=m}else u()}}Date.now().toString();const yi={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},vu={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=bu(e,t,r,s),Fo(e,t,r,s),Su(e,t,r)}function bu(e,t,r,s){var a;if(r.afterAppend&&!Ee&&(Ee=new WeakSet,setTimeout(()=>{Ee=null},0)),!ji(e,t)){const u=Bt(t,r.mirror,s);(a=e.parentNode)==null||a.replaceChild(u,e),e=u}switch(t.RRNodeType){case $.Document:{if(!Ve(e,t,r.mirror,s)){const u=s.getMeta(t);u&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,u),Ee==null||Ee.add(e))}break}case $.Element:{const u=e,c=t;switch(c.tagName){case"IFRAME":{const f=e.contentDocument;if(!f)break;Ft(f,t.contentDocument,r,s);break}}c.shadowRoot&&(u.shadowRoot||u.attachShadow({mode:"open"}),Fo(u.shadowRoot,c.shadowRoot,r,s)),Cu(u,c,s);break}}return e}function Su(e,t,r){var s;switch(t.RRNodeType){case $.Document:{const a=t.scrollData;a&&r.applyScroll(a,!0);break}case $.Element:{const a=e,u=t;switch(u.scrollData&&r.applyScroll(u.scrollData,!0),u.inputData&&r.applyInput(u.inputData),u.tagName){case"AUDIO":case"VIDEO":{const c=e,f=u;f.paused!==void 0&&(f.paused?c.pause():c.play()),f.muted!==void 0&&(c.muted=f.muted),f.volume!==void 0&&(c.volume=f.volume),f.currentTime!==void 0&&(c.currentTime=f.currentTime),f.playbackRate!==void 0&&(c.playbackRate=f.playbackRate),f.loop!==void 0&&(c.loop=f.loop);break}case"CANVAS":{const c=t;if(c.rr_dataURL!==null){const f=document.createElement("img");f.src=c.rr_dataURL;const m=a.getContext("2d");m&&(Lo(m),m.drawImage(f,0,0))}c.canvasMutations.forEach(f=>r.applyCanvas(f.event,f.mutation,e));break}case"STYLE":{const c=a.sheet;c&&t.rules.forEach(f=>r.applyStyleSheetMutation(f,c));break}case"DIALOG":{const c=a,f=u,m=c.open,d=c.matches("dialog:modal"),p=f.open,o=f.isModal,n=d!==o,i=m!==p;if((n||m&&i)&&c.close(),p&&(i||n))try{o?c.showModal():c.show()}catch(l){console.warn(l)}break}}break}case $.Text:case $.Comment:case $.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 Cu(e,t,r){const s=e.attributes,a=t.attributes;for(const u in a){const c=a[u],f=r.getMeta(t);if(f!=null&&f.isSVG&&yi[u])e.setAttributeNS(yi[u],u,c);else if(t.tagName==="CANVAS"&&u==="rr_dataURL"){const m=document.createElement("img");m.src=c;const d=e.getContext("2d");d&&(Lo(d),d.drawImage(m,0,0))}else{if(t.tagName==="IFRAME"&&u==="srcdoc")continue;try{e.setAttribute(u,c)}catch(m){console.warn(m)}}}for(const{name:u}of Array.from(s))u in a||e.removeAttribute(u);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Fo(e,t,r,s){const a=Array.from(e.childNodes),u=t.childNodes;if(a.length===0&&u.length===0)return;let c=0,f=a.length-1,m=0,d=u.length-1,p=a[c],o=a[f],n=u[m],i=u[d],l,h;for(;c<=f&&m<=d;)if(p===void 0)p=a[++c];else if(o===void 0)o=a[--f];else if(Ve(p,n,r.mirror,s))p=a[++c],n=u[++m];else if(Ve(o,i,r.mirror,s))o=a[--f],i=u[--d];else if(Ve(p,i,r.mirror,s)){try{e.insertBefore(p,o.nextSibling)}catch(y){console.warn(y)}p=a[++c],i=u[--d]}else if(Ve(o,n,r.mirror,s)){try{e.insertBefore(o,p)}catch(y){console.warn(y)}o=a[--f],n=u[++m]}else{if(!l){l={};for(let v=c;v<=f;v++){const E=a[v];E&&r.mirror.hasNode(E)&&(l[r.mirror.getId(E)]=v)}}h=l[s.getId(n)];const y=a[h];if(h!==void 0&&y&&Ve(y,n,r.mirror,s)){try{e.insertBefore(y,p)}catch(v){console.warn(v)}a[h]=void 0}else{const v=Bt(n,r.mirror,s);e.nodeName==="#document"&&p&&(v.nodeType===v.DOCUMENT_TYPE_NODE&&p.nodeType===p.DOCUMENT_TYPE_NODE||v.nodeType===v.ELEMENT_NODE&&p.nodeType===p.ELEMENT_NODE)&&(e.removeChild(p),r.mirror.removeNodeFromMap(p),p=a[++c]);try{e.insertBefore(v,p||null)}catch(E){console.warn(E)}}n=u[++m]}if(c>f){const y=u[d+1];let v=null;for(y&&(v=r.mirror.getNode(s.getId(y)));m<=d;++m){const E=Bt(u[m],r.mirror,s);try{e.insertBefore(E,v)}catch(S){console.warn(S)}}}else if(m>d)for(;c<=f;c++){const y=a[c];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(v){console.warn(v)}}let g=e.firstChild,b=t.firstChild;for(;g!==null&&b!==null;)Ft(g,b,r,s),g=g.nextSibling,b=b.nextSibling}function Bt(e,t,r){const s=r.getId(e),a=r.getMeta(e);let u=null;if(s>-1&&(u=t.getNode(s)),u!==null&&ji(u,e))return u;switch(e.RRNodeType){case $.Document:u=new Document;break;case $.DocumentType:u=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{let c=e.tagName.toLowerCase();c=vu[c]||c,a&&"isSVG"in a&&(a!=null&&a.isSVG)?u=document.createElementNS(yi.svg,c):u=document.createElement(e.tagName);break}case $.Text:u=document.createTextNode(e.data);break;case $.Comment:u=document.createComment(e.data);break;case $.CDATA:u=document.createCDATASection(e.data);break}a&&t.add(u,L({},a));try{Ee==null||Ee.add(u)}catch(c){}return u}function ji(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function Ve(e,t,r,s){const a=r.getId(e),u=s.getId(t);return a===-1||a!==u?!1:ji(e,t)}class et extends $i{constructor(t){super(),A(this,"UNSERIALIZED_STARTING_ID",-2),A(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),A(this,"mirror",ku()),A(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,s){return new et}createDocumentType(t,r,s){const a=new Eu(t,r,s);return a.ownerDocument=this,a}createElement(t){const r=t.toUpperCase();let s;switch(r){case"AUDIO":case"VIDEO":s=new xu(r);break;case"IFRAME":s=new Ou(r,this.mirror);break;case"CANVAS":s=new Mu(r);break;case"STYLE":s=new Iu(r);break;case"DIALOG":s=new Ru(r);break;default:s=new ir(r);break}return s.ownerDocument=this,s}createComment(t){const r=new Tu(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Du(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Nu(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 Eu=To;class ir extends rr{constructor(){super(...arguments),A(this,"inputData",null),A(this,"scrollData",null)}}class xu extends gu{}class Ru extends yu{}class Mu extends ir{constructor(){super(...arguments),A(this,"rr_dataURL",null),A(this,"canvasMutations",[])}getContext(){return null}}class Iu extends ir{constructor(){super(...arguments),A(this,"rules",[])}}class Ou extends ir{constructor(t,r){super(t),A(this,"contentDocument",new et),this.contentDocument.mirror=r}}const Nu=Do,Tu=Ao,Du=_o;function Au(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Bo(e,t,r,s){let a;switch(e.nodeType){case fe.DOCUMENT_NODE:s&&s.nodeName==="IFRAME"?a=s.contentDocument:(a=t,a.compatMode=e.compatMode);break;case fe.DOCUMENT_TYPE_NODE:{const c=e;a=t.createDocumentType(c.name,c.publicId,c.systemId);break}case fe.ELEMENT_NODE:{const c=e,f=Au(c);a=t.createElement(f);const m=a;for(const{name:d,value:p}of Array.from(c.attributes))m.attributes[d]=p;c.scrollLeft&&(m.scrollLeft=c.scrollLeft),c.scrollTop&&(m.scrollTop=c.scrollTop);break}case fe.TEXT_NODE:a=t.createTextNode(e.textContent||"");break;case fe.CDATA_SECTION_NODE:a=t.createCDATASection(e.data);break;case fe.COMMENT_NODE:a=t.createComment(e.textContent||"");break;case fe.DOCUMENT_FRAGMENT_NODE:a=s.attachShadow({mode:"open"});break;default:return null}let u=r.getMeta(e);return t instanceof et&&(u||(u=Uo(a,t.unserializedId),r.add(e,u)),t.mirror.add(a,L({},u))),a}function _u(e,t=Ql(),r=new et){function s(a,u){const c=Bo(a,r,t,u);if(c!==null)if((u==null?void 0:u.nodeName)!=="IFRAME"&&a.nodeType!==fe.DOCUMENT_FRAGMENT_NODE&&(u==null||u.appendChild(c),c.parentNode=u,c.parentElement=u),a.nodeName==="IFRAME"){const f=a.contentDocument;f&&s(f,c)}else(a.nodeType===fe.DOCUMENT_NODE||a.nodeType===fe.ELEMENT_NODE||a.nodeType===fe.DOCUMENT_FRAGMENT_NODE)&&(a.nodeType===fe.ELEMENT_NODE&&a.shadowRoot&&s(a.shadowRoot,c),a.childNodes.forEach(f=>s(f,c)))}return s(e,null),r}function ku(){return new Pu}class Pu{constructor(){A(this,"idNodeMap",new Map),A(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 a=this.nodeMetaMap.get(s);a&&this.nodeMetaMap.set(r,a)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Uo(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const xt=new Map,Dn=new WeakSet;function An(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Wo(e){if(Dn.has(e))return;Dn.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...s){const a=xt.get(e);a&&(a.cancelled=!0);const u=()=>{s.length===2&&An(r)&&s.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...s)};if(An(r)&&!r.complete){const c={cancelled:!1};xt.set(e,c);const f=()=>{c.cancelled||(xt.delete(e),u())},m=()=>{if(!c.cancelled){xt.delete(e);try{u()}catch(d){}}};r.onload=f,r.onerror=m}else u()}}const _n={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rt={},$o={},Lu=()=>!!globalThis.Zone;function Vi(e){if(Rt[e])return Rt[e];const t=globalThis[e],r=t.prototype,s=e in _n?_n[e]:void 0,a=!!(s&&s.every(f=>{var m,d;return!!((d=(m=Object.getOwnPropertyDescriptor(r,f))==null?void 0:m.get)!=null&&d.toString().includes("[native code]"))})),u=e in kn?kn[e]:void 0,c=!!(u&&u.every(f=>{var m;return typeof r[f]=="function"&&((m=r[f])==null?void 0:m.toString().includes("[native code]"))}));if(a&&c&&!Lu())return Rt[e]=t.prototype,t.prototype;try{const f=document.createElement("iframe");f.style.display="none",document.body.appendChild(f);const m=f.contentWindow;if(!m)return t.prototype;const d=m[e].prototype;if(!d)return f.remove(),r;const p=navigator.userAgent;return p.includes("Safari")&&!p.includes("Chrome")?(f.classList.add("rr-block"),f.setAttribute("__rrwebUntaintedMutationObserver",""),$o[e]=()=>f.remove()):f.remove(),Rt[e]=d}catch(f){return r}}const ai={};function Oe(e,t,r){var s;const a=`${e}.${String(r)}`;if(ai[a])return ai[a].call(t);const u=Vi(e),c=(s=Object.getOwnPropertyDescriptor(u,r))==null?void 0:s.get;return c?(ai[a]=c,c.call(t)):t[r]}const li={};function zo(e,t,r){const s=`${e}.${String(r)}`;if(li[s])return li[s].bind(t);const u=Vi(e)[r];return typeof u!="function"?t[r]:(li[s]=u,u.bind(t))}function Fu(e){return Oe("Node",e,"ownerDocument")}function Bu(e){return Oe("Node",e,"childNodes")}function Uu(e){return Oe("Node",e,"parentNode")}function Wu(e){return Oe("Node",e,"parentElement")}function $u(e){return Oe("Node",e,"textContent")}function zu(e,t){return zo("Node",e,"contains")(t)}function ju(e){return zo("Node",e,"getRootNode")()}function Vu(e){return!e||!("host"in e)?null:Oe("ShadowRoot",e,"host")}function qu(e){return e.styleSheets}function Gu(e){return!e||!("shadowRoot"in e)?null:Oe("Element",e,"shadowRoot")}function Hu(e,t){return Oe("Element",e,"querySelector")(t)}function Yu(e,t){return Oe("Element",e,"querySelectorAll")(t)}function jo(){var e;return[Vi("MutationObserver").constructor,(e=$o.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],a=r(s);return typeof a=="function"&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=a,()=>{e[t]=s}}catch(s){return()=>{}}}const W={ownerDocument:Fu,childNodes:Bu,parentNode:Uu,parentElement:Wu,textContent:$u,contains:zu,getRootNode:ju,host:Vu,styleSheets:qu,shadowRoot:Gu,querySelector:Hu,querySelectorAll:Yu,nowTimestamp:Ze,mutationObserverCtor:jo,patch:$e,wrapCanvasContextDrawImage:Wo};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
70
60
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
71
- or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(Ze),-1},getNode(){return console.error(Ze),null},removeNodeFromMap(){console.error(Ze)},has(){return console.error(Ze),!1},reset(){console.error(Ze)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(Ze),Reflect.get(s,e,t)}}));function at(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function Pt(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>Pt(s,e,n||{},!0)}let Tt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Tt=()=>new Date().getTime());function _i(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=P.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=P.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function ki(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Li(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Pi(s){return s?s.nodeType===s.ELEMENT_NODE?s:P.parentElement(s):null}const ll=s=>{try{if(s instanceof HTMLElement)return s.tagName==="CANVAS"}catch(e){return!1}return!1};function re(s,e,t,r){if(!s)return!1;const i=Pi(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(xr(i,e,r))return!0}catch(n){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function cl(s,e){return e.getId(s)!==-1}function br(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ct}function $i(s,e){if(yt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=P.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?$i(r,e):!0}function Pr(s){return!!s.changedTouches}function Fi(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function ul(s){const e={},t=(i,n)=>{const o={value:i,parent:n,children:[]};return e[i.node.id]=o,o},r=[];for(const i of s){const{nextId:n,parentId:o}=i;if(n&&n in e){const l=e[n];if(l.parent){const a=l.parent.children.indexOf(l);l.parent.children.splice(a,0,t(i,l.parent))}else{const a=r.indexOf(l);r.splice(a,0,t(i,null))}continue}if(o in e){const l=e[o];l.children.push(t(i,l));continue}r.push(t(i,null))}return r}function Bi(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Bi(s.children[t],e)}function et(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Wi(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ui(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const n=i.getBoundingClientRect(),o=Ui(i,e),l=n.height/i.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:l,absoluteScale:o.absoluteScale*l}}function De(s){return s?s instanceof ge&&"shadowRoot"in s?!!s.shadowRoot:!!P.shadowRoot(s):!1}function Ke(s,e){const t=s[e[0]];return e.length===1?t:Ke(t.cssRules[e[1]].cssRules,e.slice(2))}function ei(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function hl(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class zi{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Vi(s){var e;let t=null;return"getRootNode"in s&&((e=P.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&P.host(P.getRootNode(s))&&(t=P.host(P.getRootNode(s))),t}function fl(s){let e=s,t;for(;t=Vi(e);)e=t;return e}function dl(s){const e=s.ownerDocument;if(!e)return!1;const t=fl(s);return P.contains(e,t)}function Gi(s){const e=s.ownerDocument;return e?P.contains(e,s)||dl(s):!1}const hp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:zi,get _mirror(){return exports.mirror},closestElementOfNode:Pi,getBaseDimension:Ui,getNestedRule:Ke,getPositionsAndIndex:ei,getRootShadowHost:fl,getShadowHost:Vi,getWindowHeight:ki,getWindowScroll:_i,getWindowWidth:Li,hasShadowRoot:De,hookSetter:Pt,inDom:Gi,isAncestorRemoved:$i,isBlocked:re,isCanvasNode:ll,isIgnored:br,isSerialized:cl,isSerializedIframe:et,isSerializedStylesheet:Wi,iterateResolveTree:Bi,legacy_isTouchEvent:Pr,get nowTimestamp(){return Tt},on:oe,polyfill:Fi,queueToResolveTrees:ul,shadowHostInDom:dl,throttle:at,uniqueTextMutations:hl},Symbol.toStringTag,{value:"Module"}));var N=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(N||{}),M=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(M||{}),U=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(U||{}),Ie=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ie||{}),Re=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Re||{}),Te=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Te||{}),F=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(F||{}),Ee=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Ee||{});function eo(s){return"__ln"in s}class fp{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&eo(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&eo(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const to=(s,e)=>`${s}@${e}`;class dp{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"inlineVideos"),w(this,"privacySetting"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new fp,i=a=>{let c=a,u=Ct;for(;u===Ct;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{const c=P.parentNode(a);if(!c||!Gi(a))return;let u=!1;if(a.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=!0)}const h=yt(c)?this.mirror.getId(Vi(a)):this.mirror.getId(c),f=i(a);if(h===-1||f===-1)return r.addNode(a);const d=Je(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,inlineVideos:this.inlineVideos,privacySetting:this.privacySetting,onSerialize:m=>{et(m,this.mirror)&&this.iframeManager.addIframe(m),Wi(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),De(a)&&this.shadowDomManager.addShadowRoot(P.shadowRoot(a),this.doc)},onIframeLoad:(m,g)=>{this.iframeManager.attachIframe(m,g),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,g)=>{this.stylesheetManager.attachLinkElement(m,g)},cssCaptured:u});d&&(e.push({parentId:h,nextId:f,node:d}),t.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ro(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(P.parentNode(a))||n(a);for(const a of this.addedSet)!so(this.droppedSet,a)&&!ro(this.removesSubTreeCache,a,this.mirror)||so(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const c=this.mirror.getId(P.parentNode(o.value)),u=i(o.value);c!==-1&&u!==-1&&(a=o)}if(!a){let c=r.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(P.parentNode(u.value));if(i(u.value)===-1)continue;if(h!==-1){a=u;break}else{const d=u.value,m=P.parentNode(d);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=P.host(m);if(this.mirror.getId(g)!==-1){a=u;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{var c,u;const h=a.node,f=P.parentNode(h);f&&f.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(f);let d=a.value;const m=this.privacySetting==="strict",g=this.privacySetting==="default"&&xo(d),p=(u=(c=a.node)==null?void 0:c.parentElement)==null?void 0:u.getAttribute("data-hl-record");return(m||g)&&!p&&d&&(d=ai(d)),{id:this.mirror.getId(h),value:d}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const u=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:c}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(P.childNodes(e),i=>P.textContent(i)||"").join("");t.attributes.value=Cr({overwriteRecord:null,element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ir(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!br(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=P.textContent(e.target);!re(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Oo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Pi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=Ir(t);i=Cr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,overwriteRecord:t.getAttribute("data-hl-record"),maskInputFn:this.maskInputFn})}if(re(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!No(t.tagName,r)){if(e.target.tagName==="INPUT"){const l=e.target;if(l.type==="password"){n.attributes.value="*".repeat(l.value.length);break}}if(n.attributes[r]=Ao(this.doc,Ue(t.tagName),Ue(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){this.unattachedDoc=this.doc}const l=this.unattachedDoc.createElement("span");e.oldValue&&l.setAttribute("style",e.oldValue);for(const a of Array.from(t.style)){const c=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);c!==l.style.getPropertyValue(a)||u!==l.style.getPropertyPriority(a)?u===""?n.styleDiff[a]=c:n.styleDiff[a]=[c,u]:n._unchangedStyles[a]=[c,u]}for(const a of Array.from(l.style))t.style.getPropertyValue(a)===""&&(n.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal")}break}case"childList":{if(re(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=yt(e.target)?this.mirror.getId(P.host(e.target)):this.mirror.getId(e.target);re(e.target,this.blockClass,this.blockSelector,!1)||br(t,this.mirror,this.slimDOMOptions)||!cl(t,this.mirror)||(this.addedSet.has(t)?(ti(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||$i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[to(r,i)]?ti(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:yt(e.target)&&wt(e.target)?!0:void 0}),pp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(br(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[to(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);re(e,this.blockClass,this.blockSelector,!1)||(P.childNodes(e).forEach(r=>this.genAdds(r)),De(e)&&P.childNodes(P.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","inlineVideos","privacySetting","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ti(s,e){s.delete(e),P.childNodes(e).forEach(t=>ti(s,t))}function pp(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),P.childNodes(r).forEach(i=>t.push(i)))}}function ro(s,e,t){return s.size===0?!1:mp(s,e)}function mp(s,e,t){const r=P.parentNode(e);return r?s.has(r):!1}function so(s,e){return s.size===0?!1:pl(s,e)}function pl(s,e){const t=P.parentNode(e);return t?s.has(t)?!0:pl(s,t):!1}let vt;function gp(s){vt=s}function yp(){vt=void 0}const B=s=>vt?(...t)=>{try{return s(...t)}catch(r){if(vt&&vt(r)===!0)return;throw r}}:s,We=[];function $t(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function ml(s,e){const t=new dp;We.push(t),t.init(s);const r=new(al())(B(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function wp({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=at(B(h=>{const f=Date.now()-l;s(o.map(d=>(d.timeOffset-=f,d)),h),o=[],l=null}),n),c=B(at(B(h=>{const f=$t(h),{clientX:d,clientY:m}=Pr(h)?h.changedTouches[0]:h;l||(l=Tt()),o.push({x:d,y:m,id:r.getId(f),timeOffset:Tt()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?M.Drag:h instanceof MouseEvent?M.MouseMove:M.TouchMove)}),i,{trailing:!1})),u=[oe("mousemove",c,t),oe("touchmove",c,t),oe("drag",c,t)];return B(()=>{u.forEach(h=>h())})}function bp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const f=$t(h);if(re(f,r,i,!0)||ll(f))return;let d=null,m=u;if("pointerType"in h){switch(h.pointerType){case"mouse":d=Ie.Mouse;break;case"touch":d=Ie.Touch;break;case"pen":d=Ie.Pen;break}d===Ie.Touch?U[u]===U.MouseDown?m="TouchStart":U[u]===U.MouseUp&&(m="TouchEnd"):Ie.Pen}else Pr(h)&&(d=Ie.Touch);d!==null?(a=d,(m.startsWith("Touch")&&d===Ie.Touch||m.startsWith("Mouse")&&d===Ie.Mouse)&&(d=null)):U[u]===U.Click&&(d=a,a=null);const g=Pr(h)?h.changedTouches[0]:h;if(!g)return;const p=t.getId(f),{clientX:y,clientY:v}=g;B(s)(O({type:U[m],id:p,x:y,y:v},d!==null&&{pointerType:d}))};return Object.keys(U).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=Ue(u);const f=c(u);if(window.PointerEvent)switch(U[u]){case U.MouseDown:case U.MouseUp:h=h.replace("mouse","pointer");break;case U.TouchStart:case U.TouchEnd:return}l.push(oe(h,f,e))}),B(()=>{l.forEach(u=>u())})}function gl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=B(at(B(l=>{const a=$t(l);if(!a||re(a,r,i,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=_i(e.defaultView);s({id:c,x:u.left,y:u.top})}else s({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return oe("scroll",o,e)}function vp({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=B(at(B(()=>{const n=ki(),o=Li();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return oe("resize",i,e)}const Sp=["INPUT","TEXTAREA","SELECT"],io=new WeakMap;function Cp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(v){let b=$t(v);const S=v.isTrusted,C=b&&b.tagName;if(b&&C==="OPTION"&&(b=P.parentElement(b)),!b||!C||Sp.indexOf(C)<0||re(b,r,i,!0)||b.classList.contains(n)||o&&b.matches(o))return;let R=b.value,T=!1;const D=Ir(b)||"",I=b.getAttribute("data-hl-record");D==="radio"||D==="checkbox"?T=b.checked:Mo({maskInputOptions:l,type:D,tagName:C,overwriteRecord:I})&&(R=Cr({element:b,maskInputOptions:l,tagName:C,type:D,value:R,overwriteRecord:I,maskInputFn:a})),f(b,u?{text:R,isChecked:T,userTriggered:S}:{text:R,isChecked:T});const x=b.name;D==="radio"&&x&&T&&e.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(W=>{if(W!==b){const j=W.value;f(W,u?{text:j,isChecked:!T,userTriggered:!1}:{text:j,isChecked:!T})}})}function f(v,b){const S=io.get(v);if(!S||S.text!==b.text||S.isChecked!==b.isChecked){io.set(v,b);const C=t.getId(v);B(s)(te(O({},b),{id:C}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(v=>oe(v,B(h),e)),g=e.defaultView;if(!g)return()=>{m.forEach(v=>v())};const p=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return p&&p.set&&m.push(...y.map(v=>Pt(v[0],v[1],{set(){B(h)({target:this,isTrusted:!1})}},!1,g))),B(()=>{m.forEach(v=>v())})}function $r(s){const e=[];function t(r,i){if(hr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||hr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||hr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||hr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Oe(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Ip({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:B((u,h,f)=>{const[d,m]=f,{id:g,styleId:p}=Oe(h,e,t.styleMirror);return(g&&g!==-1||p&&p!==-1)&&s({id:g,styleId:p,adds:[{rule:d,index:m}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(u,h,f=this.cssRules.length){const d=`${u} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[d,f])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:B((u,h,f)=>{const[d]=f,{id:m,styleId:g}=Oe(h,e,t.styleMirror);return(m&&m!==-1||g&&g!==-1)&&s({id:m,styleId:g,removes:[{index:d}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(u){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:B((u,h,f)=>{const[d]=f,{id:m,styleId:g}=Oe(h,e,t.styleMirror);return(m&&m!==-1||g&&g!==-1)&&s({id:m,styleId:g,replace:d}),u.apply(h,f)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:B((u,h,f)=>{const[d]=f,{id:m,styleId:g}=Oe(h,e,t.styleMirror);return(m&&m!==-1||g&&g!==-1)&&s({id:m,styleId:g,replaceSync:d}),u.apply(h,f)})}));const a={};fr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(fr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),fr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),fr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:B((f,d,m)=>{const[g,p]=m,{id:y,styleId:v}=Oe(d.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||v&&v!==-1)&&s({id:y,styleId:v,adds:[{rule:g,index:[...$r(d),p||0]}]}),f.apply(d,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:B((f,d,m)=>{const[g]=m,{id:p,styleId:y}=Oe(d.parentStyleSheet,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,removes:[{index:[...$r(d),g]}]}),f.apply(d,m)})})}),B(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function yl({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(P.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var u;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(f){}return h}}),B(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Ep({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:B((l,a,c)=>{var u;const[h,f,d]=c;if(t.has(h))return n.apply(a,[h,f,d]);const{id:m,styleId:g}=Oe((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||g&&g!==-1)&&s({id:m,styleId:g,set:{property:h,value:f,priority:d},index:$r(a.parentRule)}),l.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:B((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:f,styleId:d}=Oe((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||d&&d!==-1)&&s({id:f,styleId:d,remove:{property:h},index:$r(a.parentRule)}),l.apply(a,c)})}),B(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function xp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=B(a=>at(B(c=>{const u=$t(c);if(!u||re(u,e,t,!0))return;const{currentTime:h,volume:f,muted:d,playbackRate:m,loop:g}=u;s({type:a,id:r.getId(u),currentTime:h,volume:f,muted:d,playbackRate:m,loop:g})}),i.media||500)),l=[oe("play",o(Te.Play),n),oe("pause",o(Te.Pause),n),oe("seeked",o(Te.Seeked),n),oe("volumechange",o(Te.VolumeChange),n),oe("ratechange",o(Te.RateChange),n)];return B(()=>{l.forEach(a=>a())})}function Mp({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};const o=Ge(e.fonts,"add",function(l){return function(a){return setTimeout(B(()=>{const c=i.get(a);c&&(s(c),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),B(()=>{r.forEach(l=>l())})}function Rp(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=B(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const f=a.getRangeAt(h),{startContainer:d,startOffset:m,endContainer:g,endOffset:p}=f;re(d,r,i,!0)||re(g,r,i,!0)||c.push({start:t.getId(d),startOffset:m,end:t.getId(g),endOffset:p})}n({ranges:c})});return l(),oe("selectionchange",l)}function Ap({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ge(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function Np(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:f,selectionCb:d,customElementCb:m}=s;s.mutationCb=(...g)=>{e.mutation&&e.mutation(...g),t(...g)},s.mousemoveCb=(...g)=>{e.mousemove&&e.mousemove(...g),r(...g)},s.mouseInteractionCb=(...g)=>{e.mouseInteraction&&e.mouseInteraction(...g),i(...g)},s.scrollCb=(...g)=>{e.scroll&&e.scroll(...g),n(...g)},s.viewportResizeCb=(...g)=>{e.viewportResize&&e.viewportResize(...g),o(...g)},s.inputCb=(...g)=>{e.input&&e.input(...g),l(...g)},s.mediaInteractionCb=(...g)=>{e.mediaInteaction&&e.mediaInteaction(...g),a(...g)},s.styleSheetRuleCb=(...g)=>{e.styleSheetRule&&e.styleSheetRule(...g),c(...g)},s.styleDeclarationCb=(...g)=>{e.styleDeclaration&&e.styleDeclaration(...g),u(...g)},s.canvasMutationCb=(...g)=>{e.canvasMutation&&e.canvasMutation(...g),h(...g)},s.fontCb=(...g)=>{e.font&&e.font(...g),f(...g)},s.selectionCb=(...g)=>{e.selection&&e.selection(...g),d(...g)},s.customElementCb=(...g)=>{e.customElement&&e.customElement(...g),m(...g)}}function Op(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Np(s,e);let r;s.recordDOM&&(r=ml(s,s.doc));const i=wp(s),n=bp(s),o=gl(s),l=vp(s,{win:t}),a=Cp(s),c=xp(s);let u=()=>{},h=()=>{},f=()=>{},d=()=>{};s.recordDOM&&(u=Ip(s,{win:t}),h=yl(s,s.doc),f=Ep(s,{win:t}),s.collectFonts&&(d=Mp(s)));const m=Rp(s),g=Ap(s),p=[];for(const y of s.plugins)p.push(y.observer(y.callback,t,y.options));return B(()=>{We.forEach(y=>y.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),f(),d(),m(),g(),p.forEach(y=>y())})}function hr(s){return typeof window[s]!="undefined"}function fr(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class no{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Tp{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new no(Ro)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new no(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin)return;const r=e.source;if(!r)return;const i=this.crossOriginIframeMap.get(r);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case N.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:N.IncrementalSnapshot,data:{source:M.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case N.Meta:case N.Load:case N.DomContentLoaded:return!1;case N.Plugin:return t;case N.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case N.IncrementalSnapshot:switch(t.data.source){case M.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case M.Drag:case M.TouchMove:case M.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case M.ViewportResize:return!1;case M.MediaInteraction:case M.MouseInteraction:case M.Scroll:case M.CanvasMutation:case M.Input:return this.replaceIds(t.data,e,["id"]),t;case M.StyleSheetRule:case M.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case M.Font:return t;case M.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case M.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Ee.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Dp{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!wt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=ml(te(O({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(gl(te(O({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(P.host(e))),this.restoreHandlers.push(yl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ge(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=P.shadowRoot(this);return l&&Gi(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var dr=0;dr<Qe.length;dr++)gt[Qe.charCodeAt(dr)]=dr;var _p=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Qe[e[t]>>2],i+=Qe[(e[t]&3)<<4|e[t+1]>>4],i+=Qe[(e[t+1]&15)<<2|e[t+2]>>6],i+=Qe[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},kp=function(s){var e=s.length*.75,t=s.length,r,i=0,n,o,l,a;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(r=0;r<t;r+=4)n=gt[s.charCodeAt(r)],o=gt[s.charCodeAt(r+1)],l=gt[s.charCodeAt(r+2)],a=gt[s.charCodeAt(r+3)],u[i++]=n<<2|o>>4,u[i++]=(o&15)<<4|l>>2,u[i++]=(l&3)<<6|a&63;return c};const oo=new Map;function Lp(s,e){let t=oo.get(s);return t||(t=new Map,oo.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const wl=(s,e,t)=>{if(!s||!(vl(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Lp(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function vr(s,e,t){if(s instanceof Array)return s.map(r=>vr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=_p(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[vr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[vr(s.data,e,t),s.width,s.height]};if(vl(s,e)||typeof s=="object"){const r=s.constructor.name,i=wl(s,e,t);return{rr_type:r,index:i}}}}return s}const bl=(s,e,t)=>s.map(r=>vr(r,e,t)),vl=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Pp(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Ge(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return re(this.canvas,t,r,!0)||setTimeout(()=>{const u=bl(c,e,this);s(this.canvas,{type:Re["2D"],property:o,args:u})},0),a.apply(this,c)}});i.push(l)}catch(l){const a=Pt(e.CanvasRenderingContext2D.prototype,o,{set(c){s(this.canvas,{type:Re["2D"],property:o,args:[c],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function $p(s){return s==="experimental-webgl"?"webgl":s}function ao(s,e,t,r){const i=[];try{const n=Ge(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!re(this,e,t,!0)){const c=$p(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function lo(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const c=Ge(s,a,function(u){return function(...h){const f=u.apply(this,h);if(wl(f,n,this),"tagName"in this.canvas&&!re(this.canvas,r,i,!0)){const d=bl(h,n,this),m={type:e,property:a,args:d};t(this.canvas,m)}return f}});o.push(c)}catch(c){const u=Pt(s,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function Fp(s,e,t,r){const i=[];return i.push(...lo(e.WebGLRenderingContext.prototype,Re.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...lo(e.WebGL2RenderingContext.prototype,Re.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const Sl="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIGxldCBsb2dEZWJ1ZyA9IGZhbHNlOwogIGNvbnN0IGRlYnVnID0gKC4uLmFyZ3MpID0+IHsKICAgIGlmIChsb2dEZWJ1ZykgewogICAgICBjb25zb2xlLmRlYnVnKC4uLmFyZ3MpOwogICAgfQogIH07CiAgd29ya2VyLm9ubWVzc2FnZSA9IGFzeW5jIGZ1bmN0aW9uKGUpIHsKICAgIGxvZ0RlYnVnID0gISFlLmRhdGEubG9nRGVidWc7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGR4LCBkeSwgZHcsIGRoLCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOwogICAgICBjb25zdCB0cmFuc3BhcmVudEJhc2U2NCA9IGdldFRyYW5zcGFyZW50QmxvYkZvcigKICAgICAgICB3aWR0aCwKICAgICAgICBoZWlnaHQsCiAgICAgICAgZGF0YVVSTE9wdGlvbnMKICAgICAgKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgY29uc3QgY3R4ID0gb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwLCB3aWR0aCwgaGVpZ2h0KTsKICAgICAgYml0bWFwLmNsb3NlKCk7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgYXdhaXQgdHJhbnNwYXJlbnRCYXNlNjQgPT09IGJhc2U2NCkgewogICAgICAgIGRlYnVnKCJbaGlnaGxpZ2h0LXdvcmtlcl0gY2FudmFzIGJpdG1hcCBpcyB0cmFuc3BhcmVudCIsIHsKICAgICAgICAgIGlkLAogICAgICAgICAgYmFzZTY0CiAgICAgICAgfSk7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCwgc3RhdHVzOiAidHJhbnNwYXJlbnQiIH0pOwogICAgICB9CiAgICAgIGlmIChsYXN0QmxvYk1hcC5nZXQoaWQpID09PSBiYXNlNjQpIHsKICAgICAgICBkZWJ1ZygiW2hpZ2hsaWdodC13b3JrZXJdIGNhbnZhcyBiaXRtYXAgaXMgdW5jaGFuZ2VkIiwgewogICAgICAgICAgaWQsCiAgICAgICAgICBiYXNlNjQKICAgICAgICB9KTsKICAgICAgfQogICAgICBjb25zdCBtc2cgPSB7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0LAogICAgICAgIGR4LAogICAgICAgIGR5LAogICAgICAgIGR3LAogICAgICAgIGRoCiAgICAgIH07CiAgICAgIGRlYnVnKCJbaGlnaGxpZ2h0LXdvcmtlcl0gY2FudmFzIGJpdG1hcCBwcm9jZXNzZWQiLCBtc2cpOwogICAgICB3b3JrZXIucG9zdE1lc3NhZ2UobXNnKTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgZGVidWcoIltoaWdobGlnaHQtd29ya2VyXSBubyBvZmZzY3JlZW5jYW52YXMgc3VwcG9ydCIsIHsKICAgICAgICBpZDogZS5kYXRhLmlkCiAgICAgIH0pOwogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCwgc3RhdHVzOiAidW5zdXBwb3J0ZWQiIH0pOwogICAgfQogIH07Cn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPWltYWdlLWJpdG1hcC1kYXRhLXVybC13b3JrZXItRHd0SzhBMHouanMubWFwCg==",Bp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),co=typeof self!="undefined"&&self.Blob&&new Blob([Bp(Sl)],{type:"text/javascript;charset=utf-8"});function Wp(s){let e;try{if(e=co&&(self.URL||self.webkitURL).createObjectURL(co),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+Sl,{name:s==null?void 0:s.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Up{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"logger"),w(this,"worker"),w(this,"snapshotInProgressMap",new Map),w(this,"lastSnapshotTime",new Map),w(this,"options"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(h,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(h)||this.pendingCanvasMutations.set(h,[]),this.pendingCanvasMutations.get(h).push(f)});const{sampling:t,win:r,blockClass:i,blockSelector:n,recordCanvas:o,recordLocalVideos:l,recordRemoteVideos:a,initialSnapshotDelay:c,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.logger=e.logger,this.worker=new Wp,this.worker.onmessage=h=>{const{id:f}=h.data;if(this.snapshotInProgressMap.set(f,!1),!("base64"in h.data)){this.debug(null,"canvas worker received empty message",{id:f,data:h.data,status:h.data.status});return}const{base64:d,type:m,dx:g,dy:p,dw:y,dh:v}=h.data,b={id:f,type:Re["2D"],commands:[{property:"clearRect",args:[g,p,y,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:m}]},g,p,y,v]}]};this.debug(null,"canvas worker recording mutation",b),this.mutationCb(b)},this.options=e,o&&t==="all"?(this.debug(null,"initializing canvas mutation observer",{sampling:t}),this.initCanvasMutationObserver(r,i,n)):o&&typeof t=="number"&&(this.debug(null,"initializing canvas fps observer",{sampling:t}),this.initCanvasFPSObserver(l,a,t,r,i,n,{initialSnapshotDelay:c,dataURLOptions:u},e.resizeFactor,e.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(e,...t){if(!this.logger)return;const r=this.mirror.getId(e);let i="[highlight-canvas-manager]";e&&(i=`[highlight-canvas] [id:${r}]`,e.tagName.toLowerCase()==="canvas"&&(i+=` [ctx:${e.__context}]`)),this.logger.debug(i,e,...t)}async snapshot(e){var t;const r=this.mirror.getId(e);if(this.snapshotInProgressMap.get(r)){this.debug(e,"snapshotting already in progress for",r);return}const i=1e3/(typeof this.options.samplingManual=="number"?this.options.samplingManual:1),n=this.lastSnapshotTime.get(r);if(!(n&&new Date().getTime()-n<i)){if(this.debug(e,"starting snapshotting"),e.width===0||e.height===0){this.debug(e,"not yet ready",{width:e.width,height:e.height});return}this.lastSnapshotTime.set(r,new Date().getTime()),this.snapshotInProgressMap.set(r,!0);try{if(this.options.clearWebGLBuffer!==!1&&["webgl","webgl2"].includes(e.__context)){const u=e.getContext(e.__context);((t=u==null?void 0:u.getContextAttributes())==null?void 0:t.preserveDrawingBuffer)===!1&&(u.clear(u.COLOR_BUFFER_BIT),this.debug(e,"cleared webgl canvas to load it into memory",{attributes:u==null?void 0:u.getContextAttributes()}))}if(e.width===0||e.height===0){this.debug(e,"not yet ready",{width:e.width,height:e.height});return}let o=this.options.resizeFactor||1;if(this.options.maxSnapshotDimension){const u=Math.max(e.width,e.height);o=Math.min(o,this.options.maxSnapshotDimension/u)}const l=e.width*o,a=e.height*o,c=await createImageBitmap(e,{resizeWidth:l,resizeHeight:a});this.debug(e,"created image bitmap",{width:c.width,height:c.height}),this.worker.postMessage({id:r,bitmap:c,width:l,height:a,dx:0,dy:0,dw:e.width,dh:e.height,dataURLOptions:this.options.dataURLOptions,logDebug:!!this.logger},[c]),this.debug(e,"sent message")}catch(o){this.debug(e,"failed to snapshot",o)}finally{this.snapshotInProgressMap.set(r,!1)}}}initCanvasFPSObserver(e,t,r,i,n,o,l,a,c){const u=ao(i,n,o,!0),h=1e3/r;let f=0,d;const m=new Map,g=(b,S)=>{const C=[];b.querySelectorAll(S).forEach(D=>C.push(D));const R=document.createNodeIterator(b,Node.ELEMENT_NODE);let T;for(;T=R.nextNode();)T!=null&&T.shadowRoot&&C.push(...g(T.shadowRoot,S));return C},p=b=>{const S=[];return g(i.document,"canvas").forEach(C=>{if(!re(C,n,o,!0)){this.debug(C,"discovered canvas"),S.push(C);const R=this.mirror.getId(C);m.has(R)||m.set(R,b)}}),S},y=b=>{const S=[];return(e||t)&&g(i.document,"video").forEach(C=>{if(!(!t&&C.src!==""&&C.src.indexOf("blob:")===-1)&&!(!e&&(C.src===""||C.src.indexOf("blob:")!==-1))&&!re(C,n,o,!0)){S.push(C);const R=this.mirror.getId(C);m.has(R)||m.set(R,b)}}),S},v=async b=>{if(f&&b-f<h){d=requestAnimationFrame(v);return}f=b;const S=R=>{const T=this.mirror.getId(R),D=m.get(T),I=!l.initialSnapshotDelay||b-D>l.initialSnapshotDelay;return this.debug(R,{delay:l.initialSnapshotDelay,delta:b-D,hadLoadingTime:I}),I},C=[];C.push(...p(b).filter(S).map(R=>this.snapshot(R))),C.push(...y(b).filter(S).map(async R=>{this.debug(R,"starting video snapshotting");const T=this.mirror.getId(R);if(this.snapshotInProgressMap.get(T)){this.debug(R,"video snapshotting already in progress for",T);return}this.snapshotInProgressMap.set(T,!0);try{const{width:D,height:I}=R.getBoundingClientRect(),{actualWidth:x,actualHeight:W}={actualWidth:R.videoWidth,actualHeight:R.videoHeight},j=Math.max(x,W);if(j===0){this.debug(R,"not yet ready",{width:R.width,height:R.height,actualWidth:x,actualHeight:W,boxWidth:D,boxHeight:I});return}let ee=a||1;c&&(ee=Math.min(ee,c/j));const ae=x*ee,A=W*ee,ce=await createImageBitmap(R,{resizeWidth:ae,resizeHeight:A}),ue=Math.max(D,I)/j,se=x*ue,he=W*ue,J=(D-se)/2,ie=(I-he)/2;this.debug(R,"created image bitmap",{actualWidth:x,actualHeight:W,boxWidth:D,boxHeight:I,outputWidth:se,outputHeight:he,resizeWidth:ae,resizeHeight:A,scale:ee,outputScale:ue,offsetX:J,offsetY:ie}),this.worker.postMessage({id:T,bitmap:ce,width:ae,height:A,dx:J,dy:ie,dw:se,dh:he,dataURLOptions:l.dataURLOptions,logDebug:!!this.logger},[ce]),this.debug(R,"send message")}catch(D){this.debug(R,"failed to snapshot",D)}finally{this.snapshotInProgressMap.set(T,!1)}})),await Promise.all(C).catch(console.error),d=requestAnimationFrame(v)};d=requestAnimationFrame(v),this.resetObservers=()=>{u(),d&&cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=ao(e,t,r,!1),n=Pp(this.processMutation.bind(this),e,t,r),o=Fp(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(o=>{const c=o,{type:l}=c;return je(c,["type"])}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class zp{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new zi),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Io(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Vp{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let q,Sr,St,Fr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Qi=s.contentWindow)==null?void 0:Qi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const de=Eo();function Ae(s={}){var e,t,r,i,n,o,l,a;const{emit:c,checkoutEveryNms:u,checkoutEveryNth:h,blockClass:f="highlight-block",blockSelector:d=null,ignoreClass:m="highlight-ignore",ignoreSelector:g=null,maskTextClass:p="highlight-mask",maskTextSelector:y=null,inlineStylesheet:v=!0,maskAllInputs:b,maskInputOptions:S,slimDOMOptions:C,maskInputFn:R,maskTextFn:T=ai,hooks:D,packFn:I,sampling:x={},mousemoveWait:W,recordDOM:j=!0,recordCanvas:ee=!1,recordCrossOriginIframes:ae=!1,recordAfter:A=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:ce=!1,collectFonts:ue=!1,inlineImages:se=!1,inlineVideos:he=!1,plugins:J,keepIframeSrcFn:ie=()=>!1,privacySetting:Pe="default",ignoreCSSAttributes:Ne=new Set([]),errorHandler:Al,logger:Nl}=s,Ft=O(O({},s.dataURLOptions),(t=(e=s.sampling)==null?void 0:e.canvas)==null?void 0:t.dataURLOptions);gp(Al);const Bt=ae?window.parent===window:!0;let ct=!1;if(!Bt)try{window.parent.document&&(ct=!1)}catch(z){ct=!0}if(Bt&&!c)throw new Error("emit function is required");if(!Bt&&!ct)return()=>{};W!==void 0&&x.mousemove===void 0&&(x.mousemove=W),de.reset();const qr=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:S!==void 0?S:{password:!0},es=C===!0||C==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:C==="all",headMetaDescKeywords:C==="all",headTitleMutations:C==="all"}:C||{};Fi();let ji,ts=0;const Hi=z=>{for(const fe of J||[])fe.eventProcessor&&(z=fe.eventProcessor(z));return I&&!ct&&(z=I(z)),z};q=(z,fe)=>{var K;const Q=z;if(Q.timestamp=Tt(),(K=We[0])!=null&&K.isFrozen()&&Q.type!==N.FullSnapshot&&!(Q.type===N.IncrementalSnapshot&&Q.data.source===M.Mutation)&&We.forEach(ye=>ye.unfreeze()),Bt)c==null||c(Hi(Q),fe);else if(ct){const ye={type:"rrweb",event:Hi(Q),origin:window.location.origin,isCheckout:fe};window.parent.postMessage(ye,"*")}if(Q.type===N.FullSnapshot)ji=Q,ts=0;else if(Q.type===N.IncrementalSnapshot){if(Q.data.source===M.Mutation&&Q.data.isAttachIframe)return;ts++;const ye=h&&ts>=h,H=u&&Q.timestamp-ji.timestamp>u;(ye||H)&&Sr(!0)}};const Wt=z=>{q({type:N.IncrementalSnapshot,data:O({source:M.Mutation},z)})},Yi=z=>q({type:N.IncrementalSnapshot,data:O({source:M.Scroll},z)}),Zi=z=>q({type:N.IncrementalSnapshot,data:O({source:M.CanvasMutation},z)}),Ol=z=>q({type:N.IncrementalSnapshot,data:O({source:M.AdoptedStyleSheet},z)}),$e=new zp({mutationCb:Wt,adoptedStyleSheetCb:Ol}),Fe=new Tp({mirror:de,mutationCb:Wt,stylesheetManager:$e,recordCrossOriginIframes:ae,wrappedEmit:q});for(const z of J||[])z.getMirror&&z.getMirror({nodeMirror:de,crossOriginIframeMirror:Fe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Fe.crossOriginIframeStyleMirror});const rs=new Vp;St=new Up({recordCanvas:ee,recordLocalVideos:se,recordRemoteVideos:he,mutationCb:Zi,win:window,blockClass:f,blockSelector:d,mirror:de,sampling:(r=x==null?void 0:x.canvas)==null?void 0:r.fps,samplingManual:(i=x==null?void 0:x.canvas)==null?void 0:i.fpsManual,clearWebGLBuffer:(n=x==null?void 0:x.canvas)==null?void 0:n.clearWebGLBuffer,initialSnapshotDelay:(o=x==null?void 0:x.canvas)==null?void 0:o.initialSnapshotDelay,dataURLOptions:Ft,resizeFactor:(l=x==null?void 0:x.canvas)==null?void 0:l.resizeFactor,maxSnapshotDimension:(a=x==null?void 0:x.canvas)==null?void 0:a.maxSnapshotDimension,logger:Nl});const Ut=new Dp({mutationCb:Wt,scrollCb:Yi,bypassOptions:{blockClass:f,blockSelector:d,maskTextClass:p,maskTextSelector:y,inlineStylesheet:v,maskInputOptions:qr,dataURLOptions:Ft,maskTextFn:T,maskInputFn:R,recordCanvas:ee,inlineImages:se,inlineVideos:he,privacySetting:Pe,sampling:x,slimDOMOptions:es,iframeManager:Fe,stylesheetManager:$e,canvasManager:St,keepIframeSrcFn:ie,processedNodeManager:rs},mirror:de});Sr=(z=!1)=>{if(!j)return;q({type:N.Meta,data:{href:window.location.href,width:Li(),height:ki()}},z),$e.reset(),Ut.init(),We.forEach(K=>K.lock());const fe=kc(document,{mirror:de,blockClass:f,blockSelector:d,maskTextClass:p,maskTextSelector:y,inlineStylesheet:v,maskAllInputs:qr,maskTextFn:T,maskInputFn:R,slimDOM:es,dataURLOptions:Ft,recordCanvas:ee,inlineImages:se,inlineVideos:he,privacySetting:Pe,onSerialize:K=>{et(K,de)&&Fe.addIframe(K),Wi(K,de)&&$e.trackLinkElement(K),De(K)&&Ut.addShadowRoot(P.shadowRoot(K),document)},onIframeLoad:(K,Q)=>{Fe.attachIframe(K,Q),Ut.observeAttachShadow(K)},onStylesheetLoad:(K,Q)=>{$e.attachLinkElement(K,Q)},keepIframeSrcFn:ie});if(!fe)return console.warn("Failed to snapshot the document");q({type:N.FullSnapshot,data:{node:fe,initialOffset:_i(window)}},z),We.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&$e.adoptStyleSheets(document.adoptedStyleSheets,de.getId(document))};try{const z=[],fe=Q=>{var ye;return B(Op)({mutationCb:Wt,mousemoveCb:(H,ss)=>q({type:N.IncrementalSnapshot,data:{source:ss,positions:H}}),mouseInteractionCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.MouseInteraction},H)}),scrollCb:Yi,viewportResizeCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.ViewportResize},H)}),inputCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.Input},H)}),mediaInteractionCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.MediaInteraction},H)}),styleSheetRuleCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.StyleSheetRule},H)}),styleDeclarationCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.StyleDeclaration},H)}),canvasMutationCb:Zi,fontCb:H=>q({type:N.IncrementalSnapshot,data:O({source:M.Font},H)}),selectionCb:H=>{q({type:N.IncrementalSnapshot,data:O({source:M.Selection},H)})},customElementCb:H=>{q({type:N.IncrementalSnapshot,data:O({source:M.CustomElement},H)})},blockClass:f,ignoreClass:m,ignoreSelector:g,maskTextClass:p,maskTextSelector:y,maskInputOptions:qr,inlineStylesheet:v,sampling:x,recordDOM:j,recordCanvas:ee,inlineImages:se,inlineVideos:he,userTriggeredOnInput:ce,collectFonts:ue,doc:Q,maskInputFn:R,maskTextFn:T,keepIframeSrcFn:ie,blockSelector:d,slimDOMOptions:es,dataURLOptions:Ft,mirror:de,iframeManager:Fe,stylesheetManager:$e,shadowDomManager:Ut,processedNodeManager:rs,canvasManager:St,ignoreCSSAttributes:Ne,privacySetting:Pe,plugins:((ye=J==null?void 0:J.filter(H=>H.observer))==null?void 0:ye.map(H=>({observer:H.observer,options:H.options,callback:ss=>q({type:N.Plugin,data:{plugin:H.name,payload:ss}})})))||[]},D)};Fe.addLoadListener(Q=>{try{z.push(fe(Q.contentDocument))}catch(ye){console.warn(ye)}});const K=()=>{Sr(),z.push(fe(document)),Fr=!0};return document.readyState==="interactive"||document.readyState==="complete"?K():(z.push(oe("DOMContentLoaded",()=>{q({type:N.DomContentLoaded,data:{}}),A==="DOMContentLoaded"&&K()})),z.push(oe("load",()=>{q({type:N.Load,data:{}}),A==="load"&&K()},window))),()=>{z.forEach(Q=>Q()),rs.destroy(),Fr=!1,yp()}}catch(z){console.warn(z)}}Ae.addCustomEvent=(s,e)=>{Fr&&q({type:N.Custom,data:{tag:s,payload:e}})};Ae.freezePage=()=>{We.forEach(s=>s.freeze())};Ae.takeFullSnapshot=s=>{if(!Fr)throw new Error("please take full snapshot after start recording");Sr(s)};Ae.snapshotCanvas=async s=>{if(!St)throw new Error("canvas manager is not initialized");await St.snapshot(s)};Ae.mirror=de;function Cl(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const Gp=Object.freeze(Object.defineProperty({__proto__:null,default:Cl},Symbol.toStringTag,{value:"Module"}));function jp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},n=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function o(y){const v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(y)}const l=o(s.navigator.userAgent)?1:0;function a(y,v){this.scrollLeft=y,this.scrollTop=v}function c(y){return .5*(1-Math.cos(Math.PI*y))}function u(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,v){if(v==="Y")return y.clientHeight+l<y.scrollHeight;if(v==="X")return y.clientWidth+l<y.scrollWidth}function f(y,v){const b=s.getComputedStyle(y,null)["overflow"+v];return b==="auto"||b==="scroll"}function d(y){const v=h(y,"Y")&&f(y,"Y"),b=h(y,"X")&&f(y,"X");return v||b}function m(y){for(;y!==e.body&&d(y)===!1;)y=y.parentNode||y.host;return y}function g(y){const v=n();let b,S,C,R=(v-y.startTime)/r;R=R>1?1:R,b=c(R),S=y.startX+(y.x-y.startX)*b,C=y.startY+(y.y-y.startY)*b,y.method.call(y.scrollable,S,C),(S!==y.x||C!==y.y)&&s.requestAnimationFrame(g.bind(s,y))}function p(y,v,b){let S,C,R,T;const D=n();y===e.body?(S=s,C=s.scrollX||s.pageXOffset,R=s.scrollY||s.pageYOffset,T=i.scroll):(S=y,C=y.scrollLeft,R=y.scrollTop,T=a),g({scrollable:S,method:T,startTime:D,startX:C,startY:R,x:v,y:b})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}p.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(s,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}p.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const y=arguments[0].left,v=arguments[0].top;p.call(this,this,typeof y=="undefined"?this.scrollLeft:~~y,typeof v=="undefined"?this.scrollTop:~~v)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const y=m(this),v=y.getBoundingClientRect(),b=this.getBoundingClientRect();y!==e.body?(p.call(this,y,y.scrollLeft+b.left-v.left,y.scrollTop+b.top-v.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):s.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}class Hp{constructor(e=[],t){w(this,"timeOffset",0),w(this,"speed"),w(this,"actions"),w(this,"raf",null),w(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}addActions(e){this.actions=this.actions.concat(e)}replaceActions(e){const t=this.raf===!0;this.actions.length=0,this.actions=[...e],t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function gs(s,e){if(s.type===N.IncrementalSnapshot&&s.data.source===M.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
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,a=0;return function(...u){const c=Date.now();!a&&r.leading===!1&&(a=c);const f=t-(c-a),m=this;f<=0||f>t?(s&&(clearTimeout(s),s=null),a=c,e.apply(m,u)):!s&&r.trailing!==!1&&(s=setTimeout(()=>{a=r.leading===!1?0:Date.now(),s=null,e.apply(m,u)},f))}}function ht(e,t,r,s,a=window){const u=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,s?r:{set(c){setTimeout(()=>{r.set.call(this,c)},0),u&&u.set&&u.set.call(this,c)}}),()=>ht(e,t,u||{},!0)}function qi(e){var t,r,s,a;const u=e.document;return{left:u.scrollingElement?u.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:u.documentElement.scrollLeft||(u==null?void 0:u.body)&&((t=W.parentElement(u.body))==null?void 0:t.scrollLeft)||((r=u==null?void 0:u.body)==null?void 0:r.scrollLeft)||0,top:u.scrollingElement?u.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(u==null?void 0:u.documentElement.scrollTop)||(u==null?void 0:u.body)&&((s=W.parentElement(u.body))==null?void 0:s.scrollTop)||((a=u==null?void 0:u.body)==null?void 0:a.scrollTop)||0}}function Gi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Hi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yi(e){return e?e.nodeType===e.ELEMENT_NODE?e:W.parentElement(e):null}const Vo=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 a=Yi(e);if(!a)return!1;try{if(typeof t=="string"){if(a.classList.contains(t)||s&&a.closest("."+t)!==null)return!0}else if(Lt(a,t,s))return!0}catch(u){}return!!(r&&(a.matches(r)||s&&a.closest(r)!==null))}function qo(e,t){return t.getId(e)!==-1}function Tt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===lt}function Ji(e,t){if(it(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=W.parentNode(e);return s&&s.nodeType===e.DOCUMENT_NODE?!1:s?Ji(s,t):!0}function Ut(e){return!!e.changedTouches}function Xi(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 Go(e){const t={},r=(a,u)=>{const c={value:a,parent:u,children:[]};return t[a.node.id]=c,c},s=[];for(const a of e){const{nextId:u,parentId:c}=a;if(u&&u in t){const f=t[u];if(f.parent){const m=f.parent.children.indexOf(f);f.parent.children.splice(m,0,r(a,f.parent))}else{const m=s.indexOf(f);s.splice(m,0,r(a,null))}continue}if(c in t){const f=t[c];f.children.push(r(a,f));continue}s.push(r(a,null))}return s}function Qi(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Qi(e.children[r],t)}function Qe(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Zi(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ki(e,t){var r,s;const a=(s=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:s.frameElement;if(!a||a===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const u=a.getBoundingClientRect(),c=Ki(a,t),f=u.height/a.clientHeight;return{x:u.x*c.relativeScale+c.x,y:u.y*c.relativeScale+c.y,relativeScale:f,absoluteScale:c.absoluteScale*f}}function ke(e){return e?e instanceof be&&"shadowRoot"in e?!!e.shadowRoot:!!W.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 wi(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Ho(e){const t=new Set,r=[];for(let s=e.length;s--;){const a=e[s];t.has(a.id)||(r.push(a),t.add(a.id))}return r}class es{constructor(){O(this,"id",1),O(this,"styleIDMap",new WeakMap),O(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 ts(e){var t;let r=null;return"getRootNode"in e&&((t=W.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&W.host(W.getRootNode(e))&&(r=W.host(W.getRootNode(e))),r}function Yo(e){let t=e,r;for(;r=ts(t);)t=r;return t}function Jo(e){const t=W.ownerDocument(e);if(!t)return!1;const r=Yo(e);return W.contains(t,r)}function rs(e){const t=W.ownerDocument(e);return t?W.contains(t,e)||Jo(e):!1}const Ju=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:es,get _mirror(){return exports.mirror},closestElementOfNode:Yi,getBaseDimension:Ki,getNestedRule:Ye,getPositionsAndIndex:wi,getRootShadowHost:Yo,getShadowHost:ts,getWindowHeight:Gi,getWindowScroll:qi,getWindowWidth:Hi,hasShadowRoot:ke,hookSetter:ht,inDom:rs,isAncestorRemoved:Ji,isBlocked:oe,isCanvasNode:Vo,isIgnored:Tt,isSerialized:qo,isSerializedIframe:Qe,isSerializedStylesheet:Zi,iterateResolveTree:Qi,legacy_isTouchEvent:Ut,get nowTimestamp(){return Ze},on:le,polyfill:Xi,queueToResolveTrees:Go,shadowHostInDom:Jo,throttle:Ke,uniqueTextMutations:Ho},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))(_||{}),j=(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))(j||{}),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||{}),B=(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))(B||{}),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 Pn(e){return"__ln"in e}class Xu{constructor(){O(this,"length",0),O(this,"head",null),O(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&&Pn(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&&Pn(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 Ln=(e,t)=>`${e}@${t}`;class Qu{constructor(){O(this,"frozen",!1),O(this,"locked",!1),O(this,"texts",[]),O(this,"attributes",[]),O(this,"attributeMap",new WeakMap),O(this,"removes",[]),O(this,"mapRemoves",[]),O(this,"movedMap",{}),O(this,"addedSet",new Set),O(this,"movedSet",new Set),O(this,"droppedSet",new Set),O(this,"removesSubTreeCache",new Set),O(this,"mutationCb"),O(this,"blockClass"),O(this,"blockSelector"),O(this,"maskTextClass"),O(this,"maskTextSelector"),O(this,"inlineStylesheet"),O(this,"maskInputOptions"),O(this,"maskTextFn"),O(this,"maskInputFn"),O(this,"keepIframeSrcFn"),O(this,"recordCanvas"),O(this,"inlineImages"),O(this,"inlineVideos"),O(this,"privacySetting"),O(this,"slimDOMOptions"),O(this,"dataURLOptions"),O(this,"doc"),O(this,"mirror"),O(this,"iframeManager"),O(this,"stylesheetManager"),O(this,"shadowDomManager"),O(this,"canvasManager"),O(this,"processedNodeManager"),O(this,"unattachedDoc"),O(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),O(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,s=new Xu,a=m=>{let d=m,p=lt;for(;p===lt;)d=d&&d.nextSibling,p=d&&this.mirror.getId(d);return p},u=m=>{const d=W.parentNode(m);if(!d||!rs(m))return;let p=!1;if(m.nodeType===Node.TEXT_NODE){const l=d.tagName;if(l==="TEXTAREA")return;l==="STYLE"&&this.addedSet.has(d)&&(p=!0)}const o=it(d)?this.mirror.getId(ts(m)):this.mirror.getId(d),n=a(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:l=>{Qe(l,this.mirror)&&this.iframeManager.addIframe(l),Zi(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),ke(m)&&this.shadowDomManager.addShadowRoot(W.shadowRoot(m),this.doc)},onIframeLoad:(l,h)=>{this.iframeManager.attachIframe(l,h),this.shadowDomManager.observeAttachShadow(l)},onStylesheetLoad:(l,h)=>{this.stylesheetManager.attachLinkElement(l,h)},cssCaptured:p});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)Fn(this.removesSubTreeCache,m,this.mirror)&&!this.movedSet.has(W.parentNode(m))||u(m);for(const m of this.addedSet)!Bn(this.droppedSet,m)&&!Fn(this.removesSubTreeCache,m,this.mirror)||Bn(this.movedSet,m)?u(m):this.droppedSet.add(m);let c=null;for(;s.length;){let m=null;if(c){const d=this.mirror.getId(W.parentNode(c.value)),p=a(c.value);d!==-1&&p!==-1&&(m=c)}if(!m){let d=s.tail;for(;d;){const p=d;if(d=d.previous,p){const o=this.mirror.getId(W.parentNode(p.value));if(a(p.value)===-1)continue;if(o!==-1){m=p;break}else{const i=p.value,l=W.parentNode(i);if(l&&l.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=W.host(l);if(this.mirror.getId(h)!==-1){m=p;break}}}}}}if(!m){for(;s.head;)s.removeNode(s.head.value);break}c=m.previous,s.removeNode(m.value),u(m.value)}const f={texts:this.texts.map(m=>{var d,p;const o=m.node,n=W.parentNode(o);n&&n.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(n);let i=m.value;const l=this.privacySetting==="strict",h=this.privacySetting==="default"&&ao(i),g=(p=(d=m.node)==null?void 0:d.parentElement)==null?void 0:p.getAttribute("data-hl-record");return(l||h)&&!g&&i&&(i=Ii(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:d}=m;if(typeof d.style=="string"){const p=JSON.stringify(m.styleDiff),o=JSON.stringify(m._unchangedStyles);p.length<d.style.length&&(p+o).split("var(").length===d.style.split("var(").length&&(d.style=m.styleDiff)}return{id:this.mirror.getId(m.node),attributes:d}}).filter(m=>!r.has(m.id)).filter(m=>this.mirror.has(m.id)),removes:this.removes,adds:t};!f.texts.length&&!f.attributes.length&&!f.removes.length&&!f.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(f))}),O(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(W.childNodes(t),a=>W.textContent(a)||"").join("");r.attributes.value=_t({overwriteRecord:null,element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kt(t),value:s,maskInputFn:this.maskInputFn})}),O(this,"processMutation",t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=W.textContent(t.target);!oe(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:fo(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Yi(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let s=t.attributeName,a=t.target.getAttribute(s);if(s==="value"){const c=kt(r);a=_t({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:a,overwriteRecord:r.getAttribute("data-hl-record"),maskInputFn:this.maskInputFn})}if(oe(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;let u=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(a))if(!r.contentDocument)s="rr_src";else return;if(u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u)),s==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!ho(r.tagName,s)){if(t.target.tagName==="INPUT"){const f=t.target;if(f.type==="password"){u.attributes.value="*".repeat(f.value.length);break}}if(u.attributes[s]=co(this.doc,We(r.tagName),We(s),a),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(m){this.unattachedDoc=this.doc}const f=this.unattachedDoc.createElement("span");t.oldValue&&f.setAttribute("style",t.oldValue);for(const m of Array.from(r.style)){const d=r.style.getPropertyValue(m),p=r.style.getPropertyPriority(m);d!==f.style.getPropertyValue(m)||p!==f.style.getPropertyPriority(m)?p===""?u.styleDiff[m]=d:u.styleDiff[m]=[d,p]:u._unchangedStyles[m]=[d,p]}for(const m of Array.from(f.style))r.style.getPropertyValue(m)===""&&(u.styleDiff[m]=!1)}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?u.attributes.rr_open_mode="modal":u.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),a=it(t.target)?this.mirror.getId(W.host(t.target)):this.mirror.getId(t.target);oe(t.target,this.blockClass,this.blockSelector,!1)||Tt(r,this.mirror,this.slimDOMOptions)||!qo(r,this.mirror)||(this.addedSet.has(r)?(vi(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||Ji(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ln(s,a)]?vi(this.movedSet,r):(this.removes.push({parentId:a,id:s,isShadow:it(t.target)&&st(t.target)?!0:void 0}),Zu(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),O(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[Ln(this.mirror.getId(t),s)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass,this.blockSelector,!1)||(W.childNodes(t).forEach(s=>this.genAdds(s)),ke(t)&&W.childNodes(W.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 vi(e,t){e.delete(t),W.childNodes(t).forEach(r=>vi(e,r))}function Zu(e,t){const r=[e];for(;r.length;){const s=r.pop();t.has(s)||(t.add(s),W.childNodes(s).forEach(a=>r.push(a)))}}function Fn(e,t,r){return e.size===0?!1:Ku(e,t)}function Ku(e,t,r){const s=W.parentNode(t);return s?e.has(s):!1}function Bn(e,t){return e.size===0?!1:Xo(e,t)}function Xo(e,t){const r=W.parentNode(t);return r?e.has(r)?!0:Xo(e,r):!1}let ot;function ec(e){ot=e}function tc(){ot=void 0}const z=e=>ot?((...r)=>{try{return e(...r)}catch(s){if(ot&&ot(s)===!0)return;throw s}}):e,Ue=[];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 Qo(e,t){const r=new Qu;Ue.push(r),r.init(e);const[s,a]=jo(),u=new s(z(r.processMutations.bind(r)));return u.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[u,a]}function rc({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(t.mousemove===!1)return()=>{};const a=typeof t.mousemove=="number"?t.mousemove:50,u=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let c=[],f;const m=Ke(z(o=>{const n=Date.now()-f;e(c.map(i=>(i.timeOffset-=n,i)),o),c=[],f=null}),u),d=z(Ke(z(o=>{const n=ft(o),{clientX:i,clientY:l}=Ut(o)?o.changedTouches[0]:o;f||(f=Ze()),c.push({x:i,y:l,id:s.getId(n),timeOffset:Ze()-f}),m(typeof DragEvent!="undefined"&&o instanceof DragEvent?_.Drag:o instanceof MouseEvent?_.MouseMove:_.TouchMove)}),a,{trailing:!1})),p=[le("mousemove",d,r),le("touchmove",d,r),le("drag",d,r)];return z(()=>{p.forEach(o=>o())})}function ic({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:a,sampling:u}){if(u.mouseInteraction===!1)return()=>{};const c=u.mouseInteraction===!0||u.mouseInteraction===void 0?{}:u.mouseInteraction,f=[];let m=null;const d=p=>o=>{const n=ft(o);if(oe(n,s,a,!0)||Vo(n))return;let i=null,l=p;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?j[p]===j.MouseDown?l="TouchStart":j[p]===j.MouseUp&&(l="TouchEnd"):xe.Pen}else Ut(o)&&(i=xe.Touch);i!==null?(m=i,(l.startsWith("Touch")&&i===xe.Touch||l.startsWith("Mouse")&&i===xe.Mouse)&&(i=null)):j[p]===j.Click&&(i=m,m=null);const h=Ut(o)?o.changedTouches[0]:o;if(!h)return;const g=r.getId(n),{clientX:b,clientY:y}=h;z(e)(L({type:j[l],id:g,x:b,y},i!==null&&{pointerType:i}))};return Object.keys(j).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&c[p]!==!1).forEach(p=>{let o=We(p);const n=d(p);if(window.PointerEvent)switch(j[p]){case j.MouseDown:case j.MouseUp:o=o.replace("mouse","pointer");break;case j.TouchStart:case j.TouchEnd:return}f.push(le(o,n,t))}),z(()=>{f.forEach(p=>p())})}function Zo({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:a,sampling:u}){const c=z(Ke(z(f=>{const m=ft(f);if(!m||oe(m,s,a,!0))return;const d=r.getId(m);if(m===t&&t.defaultView){const p=qi(t.defaultView);e({id:d,x:p.left,y:p.top})}else e({id:d,x:m.scrollLeft,y:m.scrollTop})}),u.scroll||100));return le("scroll",c,t)}function sc({viewportResizeCb:e},{win:t}){let r=-1,s=-1;const a=z(Ke(z(()=>{const u=Gi(),c=Hi();(r!==u||s!==c)&&(e({width:Number(c),height:Number(u)}),r=u,s=c)}),200));return le("resize",a,t)}const nc=["INPUT","TEXTAREA","SELECT"],Un=new WeakMap;function oc({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:a,ignoreClass:u,ignoreSelector:c,maskInputOptions:f,maskInputFn:m,sampling:d,userTriggeredOnInput:p}){function o(y){let v=ft(y);const E=y.isTrusted,S=v&&v.tagName;if(v&&S==="OPTION"&&(v=W.parentElement(v)),!v||!S||nc.indexOf(S)<0||oe(v,s,a,!0)||v.classList.contains(u)||c&&v.matches(c))return;let w=v.value,C=!1;const M=kt(v)||"",R=v.getAttribute("data-hl-record");M==="radio"||M==="checkbox"?C=v.checked:lo({maskInputOptions:f,type:M,tagName:S,overwriteRecord:R})&&(w=_t({element:v,maskInputOptions:f,tagName:S,type:M,value:w,overwriteRecord:R,maskInputFn:m})),n(v,p?{text:w,isChecked:C,userTriggered:E}:{text:w,isChecked:C});const x=v.name;M==="radio"&&x&&C&&t.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(D=>{if(D!==v){const T=D.value;n(D,p?{text:T,isChecked:!C,userTriggered:!1}:{text:T,isChecked:!C})}})}function n(y,v){const E=Un.get(y);if(!E||E.text!==v.text||E.isChecked!==v.isChecked){Un.set(y,v);const S=r.getId(y);z(e)(se(L({},v),{id:S}))}}const l=(d.input==="last"?["change"]:["input","change"]).map(y=>le(y,z(o),t)),h=t.defaultView;if(!h)return()=>{l.forEach(y=>y())};const g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),b=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&l.push(...b.map(y=>ht(y[0],y[1],{set(){z(o)({target:this,isTrusted:!1})}},!1,h))),z(()=>{l.forEach(y=>y())})}function Wt(e){const t=[];function r(s,a){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 c=Array.from(s.parentRule.cssRules).indexOf(s);return a.unshift(c),r(s.parentRule,a)}else if(s.parentStyleSheet){const c=Array.from(s.parentStyleSheet.cssRules).indexOf(s);a.unshift(c)}return a}return r(e,t)}function Ae(e,t,r){let s,a;return e?(e.ownerNode?s=t.getId(e.ownerNode):a=r.getId(e),{styleId:a,id:s}):{}}function ac({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:z((p,o,n)=>{const[i,l]=n,{id:h,styleId:g}=Ae(o,t,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,adds:[{rule:i,index:l}]}),p.apply(o,n)})}),s.CSSStyleSheet.prototype.addRule=function(p,o,n=this.cssRules.length){const i=`${p} { ${o} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:z((p,o,n)=>{const[i]=n,{id:l,styleId:h}=Ae(o,t,r.styleMirror);return(l&&l!==-1||h&&h!==-1)&&e({id:l,styleId:h,removes:[{index:i}]}),p.apply(o,n)})}),s.CSSStyleSheet.prototype.removeRule=function(p){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let c;s.CSSStyleSheet.prototype.replace&&(c=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(c,{apply:z((p,o,n)=>{const[i]=n,{id:l,styleId:h}=Ae(o,t,r.styleMirror);return(l&&l!==-1||h&&h!==-1)&&e({id:l,styleId:h,replace:i}),p.apply(o,n)})}));let f;s.CSSStyleSheet.prototype.replaceSync&&(f=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(f,{apply:z((p,o,n)=>{const[i]=n,{id:l,styleId:h}=Ae(o,t,r.styleMirror);return(l&&l!==-1||h&&h!==-1)&&e({id:l,styleId:h,replaceSync:i}),p.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 d={};return Object.entries(m).forEach(([p,o])=>{d[p]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[p].insertRule,{apply:z((n,i,l)=>{const[h,g]=l,{id:b,styleId:y}=Ae(i.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||y&&y!==-1)&&e({id:b,styleId:y,adds:[{rule:h,index:[...Wt(i),g||0]}]}),n.apply(i,l)})}),o.prototype.deleteRule=new Proxy(d[p].deleteRule,{apply:z((n,i,l)=>{const[h]=l,{id:g,styleId:b}=Ae(i.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||b&&b!==-1)&&e({id:g,styleId:b,removes:[{index:[...Wt(i),h]}]}),n.apply(i,l)})})}),z(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=u,c&&(s.CSSStyleSheet.prototype.replace=c),f&&(s.CSSStyleSheet.prototype.replaceSync=f),Object.entries(m).forEach(([p,o])=>{o.prototype.insertRule=d[p].insertRule,o.prototype.deleteRule=d[p].deleteRule})})}function Ko({mirror:e,stylesheetManager:t},r){var s,a,u;let c=null;r.nodeName==="#document"?c=e.getId(r):c=e.getId(W.host(r));const f=r.nodeName==="#document"?(s=r.defaultView)==null?void 0:s.Document:(u=(a=r.ownerDocument)==null?void 0:a.defaultView)==null?void 0:u.ShadowRoot,m=f!=null&&f.prototype?Object.getOwnPropertyDescriptor(f==null?void 0:f.prototype,"adoptedStyleSheets"):void 0;return c===null||c===-1||!f||!m?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:m.configurable,enumerable:m.enumerable,get(){var d;return(d=m.get)==null?void 0:d.call(this)},set(d){var p;const o=(p=m.set)==null?void 0:p.call(this,d);if(c!==null&&c!==-1)try{t.adoptStyleSheets(d,c)}catch(n){}return o}}),z(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:m.configurable,enumerable:m.enumerable,get:m.get,set:m.set})}))}function lc({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:a}){const u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:z((f,m,d)=>{var p;const[o,n,i]=d;if(r.has(o))return u.apply(m,[o,n,i]);const{id:l,styleId:h}=Ae((p=m.parentRule)==null?void 0:p.parentStyleSheet,t,s.styleMirror);return(l&&l!==-1||h&&h!==-1)&&e({id:l,styleId:h,set:{property:o,value:n,priority:i},index:Wt(m.parentRule)}),f.apply(m,d)})});const c=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:z((f,m,d)=>{var p;const[o]=d;if(r.has(o))return c.apply(m,[o]);const{id:n,styleId:i}=Ae((p=m.parentRule)==null?void 0:p.parentStyleSheet,t,s.styleMirror);return(n&&n!==-1||i&&i!==-1)&&e({id:n,styleId:i,remove:{property:o},index:Wt(m.parentRule)}),f.apply(m,d)})}),z(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=c})}function uc({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:a,doc:u}){const c=z(m=>Ke(z(d=>{const p=ft(d);if(!p||oe(p,t,r,!0))return;const{currentTime:o,volume:n,muted:i,playbackRate:l,loop:h}=p;e({type:m,id:s.getId(p),currentTime:o,volume:n,muted:i,playbackRate:l,loop:h})}),a.media||500)),f=[le("play",c(_e.Play),u),le("pause",c(_e.Pause),u),le("seeked",c(_e.Seeked),u),le("volumechange",c(_e.VolumeChange),u),le("ratechange",c(_e.RateChange),u)];return z(()=>{f.forEach(m=>m())})}function cc({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],a=new WeakMap,u=r.FontFace;r.FontFace=function(m,d,p){const o=new u(m,d,p);return a.set(o,{family:m,buffer:typeof d!="string",descriptors:p,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),o};const c=$e(t.fonts,"add",function(f){return function(m){return setTimeout(z(()=>{const d=a.get(m);d&&(e(d),a.delete(m))}),0),f.apply(this,[m])}});return s.push(()=>{r.FontFace=u}),s.push(c),z(()=>{s.forEach(f=>f())})}function hc(e){const{doc:t,mirror:r,blockClass:s,blockSelector:a,selectionCb:u}=e;let c=!0;const f=z(()=>{const m=t.getSelection();if(!m||c&&(m!=null&&m.isCollapsed))return;c=m.isCollapsed||!1;const d=[],p=m.rangeCount||0;for(let o=0;o<p;o++){const n=m.getRangeAt(o),{startContainer:i,startOffset:l,endContainer:h,endOffset:g}=n;oe(i,s,a,!0)||oe(h,s,a,!0)||d.push({start:r.getId(i),startOffset:l,end:r.getId(h),endOffset:g})}u({ranges:d})});return f(),le("selectionchange",f)}function fc({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:$e(r.customElements,"define",function(a){return function(u,c,f){try{t({define:{name:u}})}catch(m){console.warn(`Custom element callback failed for ${u}`)}return a.apply(this,[u,c,f])}})}function dc(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:a,scrollCb:u,viewportResizeCb:c,inputCb:f,mediaInteractionCb:m,styleSheetRuleCb:d,styleDeclarationCb:p,canvasMutationCb:o,fontCb:n,selectionCb:i,customElementCb:l}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),s(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),a(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),u(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),c(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),f(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),m(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),d(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),p(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),o(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),n(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),i(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),l(...h)}}function pc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};dc(e,t);let s,a=()=>{};e.recordDOM&&([s,a]=Qo(e,e.doc));const u=rc(e),c=ic(e),f=Zo(e),m=sc(e,{win:r}),d=oc(e),p=uc(e);let o=()=>{},n=()=>{},i=()=>{},l=()=>{};e.recordDOM&&(o=ac(e,{win:r}),n=Ko(e,e.doc),i=lc(e,{win:r}),e.collectFonts&&(l=cc(e)));const h=hc(e),g=fc(e),b=[];for(const y of e.plugins)b.push(y.observer(y.callback,r,y.options));return z(()=>{Ue.forEach(y=>y.reset()),s==null||s.disconnect(),a(),u(),c(),f(),m(),d(),p(),o(),n(),i(),l(),h(),g(),b.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 Wn{constructor(t){O(this,"iframeIdToRemoteIdMap",new WeakMap),O(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,s,a){const u=s||this.getIdToRemoteIdMap(t),c=a||this.getRemoteIdToIdMap(t);let f=u.get(r);return f||(f=this.generateIdFn(),u.set(r,f),c.set(f,r)),f}getIds(t,r){const s=this.getIdToRemoteIdMap(t),a=this.getRemoteIdToIdMap(t);return r.map(u=>this.getId(t,u,s,a))}getRemoteId(t,r,s){const a=s||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const u=a.get(r);return u||-1}getRemoteIds(t,r){const s=this.getRemoteIdToIdMap(t);return r.map(a=>this.getRemoteId(t,a,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 mc{constructor(t){O(this,"iframes",new WeakMap),O(this,"crossOriginIframeMap",new WeakMap),O(this,"crossOriginIframeMirror",new Wn(uo)),O(this,"crossOriginIframeStyleMirror"),O(this,"crossOriginIframeRootIdMap",new WeakMap),O(this,"mirror"),O(this,"mutationCb"),O(this,"wrappedEmit"),O(this,"loadListener"),O(this,"stylesheetManager"),O(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wn(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,a;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))),(a=this.loadListener)==null||a.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 a=this.crossOriginIframeMap.get(s);if(!a)return;const u=this.transformCrossOriginEvent(a,r.data.event);u&&this.wrappedEmit(u,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 a=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,a),this.patchRootIdOnNode(r.data.node,a),{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(a=>{this.replaceIds(a,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(a.node,t);const u=this.crossOriginIframeRootIdMap.get(t);u&&this.patchRootIdOnNode(a.node,u)}),r.data.removes.forEach(a=>{this.replaceIds(a,t,["parentId","id"])}),r.data.attributes.forEach(a=>{this.replaceIds(a,t,["id"])}),r.data.texts.forEach(a=>{this.replaceIds(a,t,["id"])}),r;case _.Drag:case _.TouchMove:case _.MouseMove:return r.data.positions.forEach(a=>{this.replaceIds(a,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(a=>{this.replaceIds(a,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(a=>{this.replaceStyleIds(a,t,["styleId"])}),r}}return!1}replace(t,r,s,a){for(const u of a)!Array.isArray(r[u])&&typeof r[u]!="number"||(Array.isArray(r[u])?r[u]=t.getIds(s,r[u]):r[u]=t.getId(s,r[u]));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 gc{constructor(t){O(this,"shadowDoms",new WeakSet),O(this,"mutationCb"),O(this,"scrollCb"),O(this,"bypassOptions"),O(this,"mirror"),O(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]=Qo(se(L({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Zo(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(W.host(t))),this.restoreHandlers.push(Ko({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(a){return function(u){const c=a.call(this,u),f=W.shadowRoot(this);return f&&rs(this)&&s.addShadowRoot(f,r),c}}))}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 Ot=0;Ot<Je.length;Ot++)rt[Je.charCodeAt(Ot)]=Ot;var yc=function(e){var t=new Uint8Array(e),r,s=t.length,a="";for(r=0;r<s;r+=3)a+=Je[t[r]>>2],a+=Je[(t[r]&3)<<4|t[r+1]>>4],a+=Je[(t[r+1]&15)<<2|t[r+2]>>6],a+=Je[t[r+2]&63];return s%3===2?a=a.substring(0,a.length-1)+"=":s%3===1&&(a=a.substring(0,a.length-2)+"=="),a},wc=function(e){var t=e.length*.75,r=e.length,s,a=0,u,c,f,m;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var d=new ArrayBuffer(t),p=new Uint8Array(d);for(s=0;s<r;s+=4)u=rt[e.charCodeAt(s)],c=rt[e.charCodeAt(s+1)],f=rt[e.charCodeAt(s+2)],m=rt[e.charCodeAt(s+3)],p[a++]=u<<2|c>>4,p[a++]=(c&15)<<4|f>>2,p[a++]=(f&3)<<6|m&63;return d};const $n=new Map;function vc(e,t){let r=$n.get(e);return r||(r=new Map,$n.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const ea=(e,t,r)=>{if(!e||!(ra(e,t)||typeof e=="object"))return;const s=e.constructor.name,a=vc(r,s);let u=a.indexOf(e);return u===-1&&(u=a.length,a.push(e)),u};function Dt(e,t,r){if(e instanceof Array)return e.map(s=>Dt(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,a=yc(e);return{rr_type:s,base64:a}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Dt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const s=e.constructor.name,{src:a}=e;return{rr_type:s,src:a}}else if(e instanceof HTMLCanvasElement){const s="HTMLImageElement",a=e.toDataURL();return{rr_type:s,src:a}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Dt(e.data,t,r),e.width,e.height]};if(ra(e,t)||typeof e=="object"){const s=e.constructor.name,a=ea(e,t,r);return{rr_type:s,index:a}}}}return e}const ta=(e,t,r)=>e.map(s=>Dt(s,t,r)),ra=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(a=>typeof t[a]=="function").find(a=>e instanceof t[a]);function bc(e,t,r,s){const a=[],u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const c of u)try{if(typeof t.CanvasRenderingContext2D.prototype[c]!="function")continue;const f=$e(t.CanvasRenderingContext2D.prototype,c,function(m){return function(...d){return oe(this.canvas,r,s,!0)||setTimeout(()=>{const p=ta(d,t,this);e(this.canvas,{type:Me["2D"],property:c,args:p})},0),m.apply(this,d)}});a.push(f)}catch(f){const m=ht(t.CanvasRenderingContext2D.prototype,c,{set(d){e(this.canvas,{type:Me["2D"],property:c,args:[d],setter:!0})}});a.push(m)}return()=>{a.forEach(c=>c())}}function Sc(e){return e==="experimental-webgl"?"webgl":e}function zn(e,t,r,s){const a=[];try{const u=$e(e.HTMLCanvasElement.prototype,"getContext",function(c){return function(f,...m){if(!oe(this,t,r,!0)){const d=Sc(f);if("__context"in this||(this.__context=d),s&&["webgl","webgl2"].includes(d))if(m[0]&&typeof m[0]=="object"){const p=m[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else m.splice(0,1,{preserveDrawingBuffer:!0})}return c.apply(this,[f,...m])}});a.push(u)}catch(u){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach(u=>u())}}function jn(e,t,r,s,a,u){const c=[],f=Object.getOwnPropertyNames(e);for(const m of f)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(m))try{if(typeof e[m]!="function")continue;const d=$e(e,m,function(p){return function(...o){const n=p.apply(this,o);if(ea(n,u,this),"tagName"in this.canvas&&!oe(this.canvas,s,a,!0)){const i=ta(o,u,this),l={type:t,property:m,args:i};r(this.canvas,l)}return n}});c.push(d)}catch(d){const p=ht(e,m,{set(o){r(this.canvas,{type:t,property:m,args:[o],setter:!0})}});c.push(p)}return c}function Cc(e,t,r,s){const a=[];return typeof t.WebGLRenderingContext!="undefined"&&a.push(...jn(t.WebGLRenderingContext.prototype,Me.WebGL,e,r,s,t)),typeof t.WebGL2RenderingContext!="undefined"&&a.push(...jn(t.WebGL2RenderingContext.prototype,Me.WebGL2,e,r,s,t)),()=>{a.forEach(u=>u())}}const ia=`(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
+ `,Vn=typeof self!="undefined"&&self.Blob&&new Blob([ia],{type:"text/javascript;charset=utf-8"});function Ec(e){let t;try{if(t=Vn&&(self.URL||self.webkitURL).createObjectURL(Vn),!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(ia),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class xc{constructor(t){O(this,"pendingCanvasMutations",new Map),O(this,"rafStamps",{latestId:0,invokeId:null}),O(this,"mirror"),O(this,"logger"),O(this,"worker"),O(this,"snapshotInProgressMap",new Map),O(this,"lastSnapshotTime",new Map),O(this,"options"),O(this,"mutationCb"),O(this,"resetObservers"),O(this,"frozen",!1),O(this,"locked",!1),O(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:a,blockSelector:u,recordCanvas:c,recordLocalVideos:f,recordRemoteVideos:m,initialSnapshotDelay:d,dataURLOptions:p}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.logger=t.logger,this.worker=new Ec,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:l,dx:h,dy:g,dw:b,dh:y}=o.data,v={id:n,type:Me["2D"],commands:[{property:"clearRect",args:[h,g,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:l}]},h,g,b,y]}]};this.debug(null,"canvas worker recording mutation",v),this.mutationCb(v)},this.options=t,c&&r==="all"?(this.debug(null,"initializing canvas mutation observer",{sampling:r}),this.initCanvasMutationObserver(s,a,u)):c&&typeof r=="number"&&(this.debug(null,"initializing canvas fps observer",{sampling:r}),this.initCanvasFPSObserver(f,m,r,s,a,u,{initialSnapshotDelay:d,dataURLOptions:p},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 a="[highlight-canvas-manager]";t&&(a=`[highlight-canvas] [id:${s}]`,t.tagName.toLowerCase()==="canvas"&&(a+=` [ctx:${t.__context}]`)),this.logger.debug(a,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 a=1e3/(typeof this.options.samplingManual=="number"?this.options.samplingManual:1),u=this.lastSnapshotTime.get(s);if(!(u&&new Date().getTime()-u<a)){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 p=t.getContext(t.__context);((r=p==null?void 0:p.getContextAttributes())==null?void 0:r.preserveDrawingBuffer)===!1&&(p.clear(p.COLOR_BUFFER_BIT),this.debug(t,"cleared webgl canvas to load it into memory",{attributes:p==null?void 0:p.getContextAttributes()}))}if(t.width===0||t.height===0){this.debug(t,"not yet ready",{width:t.width,height:t.height});return}let c=this.options.resizeFactor||1;if(this.options.maxSnapshotDimension){const p=Math.max(t.width,t.height);c=Math.min(c,this.options.maxSnapshotDimension/p)}const f=t.width*c,m=t.height*c,d=await createImageBitmap(t,{resizeWidth:f,resizeHeight:m});this.debug(t,"created image bitmap",{width:d.width,height:d.height}),this.worker.postMessage({id:s,bitmap:d,width:f,height:m,dx:0,dy:0,dw:t.width,dh:t.height,dataURLOptions:this.options.dataURLOptions,logDebug:!!this.logger},[d]),this.debug(t,"sent message")}catch(c){this.debug(t,"failed to snapshot",c)}finally{this.snapshotInProgressMap.set(s,!1)}}}initCanvasFPSObserver(t,r,s,a,u,c,f,m,d){const p=zn(a,u,c,!0),o=1e3/s;let n=0,i;const l=new Map,h=(v,E)=>{const S=[];v.querySelectorAll(E).forEach(M=>S.push(M));const w=document.createNodeIterator(v,Node.ELEMENT_NODE);let C;for(;C=w.nextNode();)C!=null&&C.shadowRoot&&S.push(...h(C.shadowRoot,E));return S},g=v=>{const E=[];return h(a.document,"canvas").forEach(S=>{if(!oe(S,u,c,!0)){this.debug(S,"discovered canvas"),E.push(S);const w=this.mirror.getId(S);l.has(w)||l.set(w,v)}}),E},b=v=>{const E=[];return(t||r)&&h(a.document,"video").forEach(S=>{if(!(!r&&S.src!==""&&S.src.indexOf("blob:")===-1)&&!(!t&&(S.src===""||S.src.indexOf("blob:")!==-1))&&!oe(S,u,c,!0)){E.push(S);const w=this.mirror.getId(S);l.has(w)||l.set(w,v)}}),E},y=async v=>{if(n&&v-n<o){i=requestAnimationFrame(w=>void y(w));return}n=v;const E=w=>{const C=this.mirror.getId(w),M=l.get(C),R=!f.initialSnapshotDelay||v-M>f.initialSnapshotDelay;return this.debug(w,{delay:f.initialSnapshotDelay,delta:v-M,hadLoadingTime:R}),R},S=[];S.push(...g(v).filter(E).map(w=>this.snapshot(w))),S.push(...b(v).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:D}={actualWidth:w.videoWidth,actualHeight:w.videoHeight},T=Math.max(x,D);if(T===0){this.debug(w,"not yet ready",{width:w.width,height:w.height,actualWidth:x,actualHeight:D,boxWidth:M,boxHeight:R});return}let G=m||1;d&&(G=Math.min(G,d/T));const X=x*G,I=D*G,ne=await createImageBitmap(w,{resizeWidth:X,resizeHeight:I}),P=Math.max(M,R)/T,V=x*P,H=D*P,F=(M-V)/2,Z=(R-H)/2;this.debug(w,"created image bitmap",{actualWidth:x,actualHeight:D,boxWidth:M,boxHeight:R,outputWidth:V,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:V,dh:H,dataURLOptions:f.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(S).catch(console.error),i=requestAnimationFrame(w=>void y(w))};i=requestAnimationFrame(v=>void y(v)),this.resetObservers=()=>{p(),i&&cancelAnimationFrame(i)}}initCanvasMutationObserver(t,r,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const a=zn(t,r,s,!1),u=bc(this.processMutation.bind(this),t,r,s),c=Cc(this.processMutation.bind(this),t,r,s);this.resetObservers=()=>{a(),u(),c()}}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 a=s.map(c=>{const d=c,{type:f}=d;return mt(d,["type"])}),{type:u}=s[0];this.mutationCb({id:r,type:u,commands:a}),this.pendingCanvasMutations.delete(t)}}class Rc{constructor(t){O(this,"trackedLinkElements",new WeakSet),O(this,"mutationCb"),O(this,"adoptedStyleSheetCb"),O(this,"styleMirror",new es),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:[]},a=[];for(const u of t){let c;this.styleMirror.has(u)?c=this.styleMirror.getId(u):(c=this.styleMirror.add(u),a.push({styleId:c,rules:Array.from(u.rules||CSSRule,(f,m)=>({rule:no(f,u.href),index:m}))})),s.styleIds.push(c)}a.length>0&&(s.styles=a),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Mc{constructor(){O(this,"nodeMap",new WeakMap),O(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(a=>a!==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,At,at,$t=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ls=e.contentWindow)==null?void 0:ls.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ye=oo();function Ne(e={}){var t;const{emit:r,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:u="highlight-block",blockSelector:c=null,ignoreClass:f="highlight-ignore",ignoreSelector:m=null,maskTextClass:d="highlight-mask",maskTextSelector:p=null,inlineStylesheet:o=!0,maskAllInputs:n,maskInputOptions:i,slimDOMOptions:l,maskInputFn:h,maskTextFn:g=Ii,hooks:b,packFn:y,sampling:v={},mousemoveWait:E,recordDOM:S=!0,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:R=!1,collectFonts:x=!1,inlineImages:D=!1,inlineVideos:T=!1,plugins:G,keepIframeSrcFn:X=()=>!1,privacySetting:I="default",ignoreCSSAttributes:ne=new Set([]),errorHandler:P,logger:V}=e,H=L(L({},e.dataURLOptions),typeof((t=e.sampling)==null?void 0:t.canvas)=="object"?e.sampling.canvas.dataURLOptions:void 0);ec(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&&v.mousemove===void 0&&(v.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},N=po(l);Xi();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=Ue[0])!=null&&ee.isFrozen()&&te.type!==k.FullSnapshot&&!(te.type===k.IncrementalSnapshot&&te.data.source===_.Mutation)&&Ue.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=a&&ce>=a,Y=s&&te.timestamp-Se.timestamp>s;(he||Y)&&At(!0)}};const De=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 Rc({mutationCb:De,adoptedStyleSheetCb:tt}),ie=new mc({mirror:ye,mutationCb:De,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 Mc,de=typeof(v==null?void 0:v.canvas)=="object"?v.canvas:{fps:v==null?void 0:v.canvas};at=new xc({recordCanvas:w,recordLocalVideos:D,recordRemoteVideos:T,mutationCb:ze,win:window,blockClass:u,blockSelector:c,mirror:ye,sampling:de.fps,samplingManual:de.fpsManual,clearWebGLBuffer:de.clearWebGLBuffer,initialSnapshotDelay:de.initialSnapshotDelay,dataURLOptions:H,resizeFactor:de.resizeFactor,maxSnapshotDimension:de.maxSnapshotDimension,logger:V});const dt=new gc({mutationCb:De,scrollCb:Ce,bypassOptions:{blockClass:u,blockSelector:c,maskTextClass:d,maskTextSelector:p,inlineStylesheet:o,maskInputOptions:ue,dataURLOptions:H,maskTextFn:g,maskInputFn:h,recordCanvas:w,inlineImages:D,inlineVideos:T,privacySetting:I,sampling:v,slimDOMOptions:N,iframeManager:ie,stylesheetManager:pe,canvasManager:at,keepIframeSrcFn:X,processedNodeManager:me},mirror:ye});At=(q=!1)=>{if(!S)return;re({type:k.Meta,data:{href:window.location.href,width:Hi(),height:Gi()}},q),pe.reset(),dt.init(),Ue.forEach(ee=>ee.lock());const ge=yl(document,{mirror:ye,blockClass:u,blockSelector:c,maskTextClass:d,maskTextSelector:p,inlineStylesheet:o,maskAllInputs:ue,maskTextFn:g,maskInputFn:h,slimDOM:N,dataURLOptions:H,recordCanvas:w,inlineImages:D,inlineVideos:T,privacySetting:I,onSerialize:ee=>{Qe(ee,ye)&&ie.addIframe(ee),Zi(ee,ye)&&pe.trackLinkElement(ee),ke(ee)&&dt.addShadowRoot(W.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:qi(window)}},q),Ue.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(pc)({mutationCb:De,mousemoveCb:(Y,sr)=>re({type:k.IncrementalSnapshot,data:{source:sr,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:u,ignoreClass:f,ignoreSelector:m,maskTextClass:d,maskTextSelector:p,maskInputOptions:ue,inlineStylesheet:o,sampling:v,recordDOM:S,recordCanvas:w,inlineImages:D,inlineVideos:T,userTriggeredOnInput:R,collectFonts:x,doc:te,maskInputFn:h,maskTextFn:g,keepIframeSrcFn:X,blockSelector:c,slimDOMOptions:N,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:sr=>re({type:k.Plugin,data:{plugin:Y.name,payload:sr}})})))||[]},b)};ie.addLoadListener(te=>{try{q.push(ge(te.contentDocument))}catch(he){console.warn(he)}});const ee=()=>{At(),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,tc()}}catch(q){console.warn(q)}}Ne.addCustomEvent=(e,t)=>{$t&&re({type:k.Custom,data:{tag:e,payload:t}})};Ne.freezePage=()=>{Ue.forEach(e=>e.freeze())};Ne.takeFullSnapshot=e=>{if(!$t)throw new Error("please take full snapshot after start recording");At(e)};Ne.snapshotCanvas=async e=>{if(!at)throw new Error("canvas manager is not initialized");await at.snapshot(e)};Ne.mirror=ye;function sa(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(a){a(r)}),(s=e.get("*"))&&s.slice().map(function(a){a(t,r)})}}}const Ic=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"}));function Oc(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,a={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||m,scrollIntoView:r.prototype.scrollIntoView},u=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function c(b){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(b)}const f=c(e.navigator.userAgent)?1:0;function m(b,y){this.scrollLeft=b,this.scrollTop=y}function d(b){return .5*(1-Math.cos(Math.PI*b))}function p(b){if(b===null||typeof b!="object"||b.behavior===void 0||b.behavior==="auto"||b.behavior==="instant")return!0;if(typeof b=="object"&&b.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+b.behavior+" is not a valid value for enumeration ScrollBehavior.")}function o(b,y){if(y==="Y")return b.clientHeight+f<b.scrollHeight;if(y==="X")return b.clientWidth+f<b.scrollWidth}function n(b,y){const v=e.getComputedStyle(b,null)["overflow"+y];return v==="auto"||v==="scroll"}function i(b){const y=o(b,"Y")&&n(b,"Y"),v=o(b,"X")&&n(b,"X");return y||v}function l(b){for(;b!==t.body&&i(b)===!1;)b=b.parentNode||b.host;return b}function h(b){const y=u();let v,E,S,w=(y-b.startTime)/s;w=w>1?1:w,v=d(w),E=b.startX+(b.x-b.startX)*v,S=b.startY+(b.y-b.startY)*v,b.method.call(b.scrollable,E,S),(E!==b.x||S!==b.y)&&e.requestAnimationFrame(h.bind(e,b))}function g(b,y,v){let E,S,w,C;const M=u();b===t.body?(E=e,S=e.scrollX||e.pageXOffset,w=e.scrollY||e.pageYOffset,C=a.scroll):(E=b,S=b.scrollLeft,w=b.scrollTop,C=m),h({scrollable:E,method:C,startTime:M,startX:S,startY:w,x:y,y:v})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){a.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(p(arguments[0])){a.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(p(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");a.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 b=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof b=="undefined"?this.scrollLeft:~~b,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(p(arguments[0])===!0){a.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(p(arguments[0])===!0){a.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const b=l(this),y=b.getBoundingClientRect(),v=this.getBoundingClientRect();b!==t.body?(g.call(this,b,b.scrollLeft+v.left-y.left,b.scrollTop+v.top-y.top),e.getComputedStyle(b).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class Nc{constructor(t=[],r){O(this,"timeOffset",0),O(this,"speed"),O(this,"actions"),O(this,"raf",null),O(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 a=Math.floor((r+s)/2);if(this.actions[a].delay<t.delay)r=a+1;else if(this.actions[a].delay>t.delay)s=a-1;else return a+1}return r}}function ui(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}/*! *****************************************************************************
72
162
  Copyright (c) Microsoft Corporation.
73
163
 
74
164
  Permission to use, copy, modify, and/or distribute this software for any
@@ -81,8 +171,18 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
81
171
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
82
172
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
83
173
  PERFORMANCE OF THIS SOFTWARE.
84
- ***************************************************************************** */function uo(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,n=t.call(s),o=[];try{for(;(e===void 0||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(l){i={error:l}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}var qe;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(qe||(qe={}));var Il={type:"xstate.init"};function ys(s){return s===void 0?[]:[].concat(s)}function Be(s){return{type:"xstate.assign",assignment:s}}function ho(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Br(s){return function(e){return s===e}}function El(s){return typeof s=="string"?{type:s}:s}function fo(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Br(s)}}function po(s,e,t){var r=e,i=!1;return[s.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},r);return typeof n.assignment=="function"?o=n.assignment(r,t):Object.keys(n.assignment).forEach(function(l){o[l]=typeof n.assignment[l]=="function"?n.assignment[l](r,t):n.assignment[l]}),r=o,!1}return!0}),r,i]}function xl(s,e){e===void 0&&(e={});var t=uo(po(ys(s.states[s.initial].entry).map(function(o){return ho(o,e.actions)}),s.context,Il),2),r=t[0],i=t[1],n={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Br(s.initial)},transition:function(o,l){var a,c,u=typeof o=="string"?{value:o,context:s.context}:o,h=u.value,f=u.context,d=El(l),m=s.states[h];if(m.on){var g=ys(m.on[d.type]);try{for(var p=function(A){var ce=typeof Symbol=="function"&&Symbol.iterator,ue=ce&&A[ce],se=0;if(ue)return ue.call(A);if(A&&typeof A.length=="number")return{next:function(){return A&&se>=A.length&&(A=void 0),{value:A&&A[se++],done:!A}}};throw new TypeError(ce?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),y=p.next();!y.done;y=p.next()){var v=y.value;if(v===void 0)return fo(h,f);var b=typeof v=="string"?{target:v}:v,S=b.target,C=b.actions,R=C===void 0?[]:C,T=b.cond,D=S===void 0;if((T===void 0?function(){return!0}:T)(f,d)){var I=s.states[S!=null?S:h],x=uo(po((D?ys(R):[].concat(m.exit,R,I.entry).filter(function(A){return A})).map(function(A){return ho(A,n._options.actions)}),f,d),3),W=x[0],j=x[1],ee=x[2],ae=S!=null?S:h;return{value:ae,context:j,actions:W,changed:S!==h||W.length>0||ee,matches:Br(ae)}}}}catch(A){a={error:A}}finally{try{y&&!y.done&&(c=p.return)&&c.call(p)}finally{if(a)throw a.error}}}return fo(h,f)}};return n}var mo=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function Ml(s){var e=s.initialState,t=qe.NotStarted,r=new Set,i={_machine:s,send:function(n){t===qe.Running&&(e=s.transition(e,n),mo(e,El(n)),r.forEach(function(o){return o(e)}))},subscribe:function(n){return r.add(n),n(e),{unsubscribe:function(){return r.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:s.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:Br(o.value)}}return t=qe.Running,mo(e,Il),i},stop:function(){return t=qe.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function Yp(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===N.Meta&&r.timestamp<=e)return s.slice(t)}return s}function Zp(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=xl({id:"player",context:s,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:Be({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:Be((n,o)=>{let l=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),te(O({},n),{timeOffset:l,baselineTime:n.events[0].timestamp+l})}),play(n){var o;const{timer:l,events:a,baselineTime:c,lastPlayedEvent:u}=n;l.clear();for(const m of a)gs(m,c);const h=Yp(a,c);let f=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===N.IncrementalSnapshot&&u.data.source===M.MouseMove&&(f=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(f||0)&&r.emit(F.PlayBack);const d=new Array;for(const m of h)if(!(f&&f<c&&(m.timestamp<=f||m===u)))if(m.timestamp<c)d.push(m);else{const g=e(m,!1);l.addAction({doAction:()=>{g()},delay:m.delay})}t(d),r.emit(F.Flush),l.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:Be(n=>te(O({},n),{lastPlayedEvent:null})),startLive:Be({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),replaceEvents:Be((n,o)=>{if(o.type!=="REPLACE_EVENTS")return n;const{events:l,timer:a,baselineTime:c}=n,{events:u}=o.payload;if(u.length===0)return n;l.length=0;const h=[],f=a.timeOffset+c;for(const d of u)gs(d,c),l.push(d),d.timestamp>=f&&h.push({doAction:e(d,!1),delay:d.delay});return a.isActive()&&a.replaceActions(h),te(O({},n),{events:l})}),addEvent:Be((n,o)=>{const{baselineTime:l,timer:a,events:c}=n;if(o.type==="ADD_EVENT"){const{event:u}=o.payload;gs(u,l);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let m=-1,g=0;for(;g<=h;){const p=Math.floor((g+h)/2);c[p].timestamp<=u.timestamp?g=p+1:h=p-1}m===-1&&(m=g),c.splice(m,0,u)}const f=u.timestamp<l,d=e(u,f);f?d():a.isActive()&&a.addAction({doAction:()=>{d()},delay:u.delay})}return te(O({},n),{events:c})})}});return Ml(i)}function Xp(s){const e=xl({id:"speed",context:s,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:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:Be({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Ml(e)}const Jp=s=>["noscript { display: none !important; }",`.${s} { background: currentColor; border-radius: 5px; }`,`.${s}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`],go=new Map;function Rl(s,e){let t=go.get(s);return t||(t=new Map,go.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function _e(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await _e(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:n}=r;return Rl(e,i)[n]}else if("args"in r){const{rr_type:i,args:n}=r,o=window[i];return new o(...await Promise.all(n.map(_e(s,e,t))))}else{if("base64"in r)return kp(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const n=new Image;return n.src=r.src,s.set(r.src,n),n}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(_e(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(_e(s,e,t)));return r}}function Kp(s,e){try{return e===Re.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const Qp=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function qp(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Qp.includes(t))return;const r=Rl(s,t);r.includes(e)||r.push(e)}async function em({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const n=Kp(e,t);if(!n)return;if(s.setter){n[s.property]=s.args[0];return}const o=n[s.property],l=await Promise.all(s.args.map(_e(r,n))),a=o.apply(n,l);qp(n,a);const c=!1}catch(n){i(s,n)}}async function tm({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}nl(n);const o=e.map(async a=>Promise.all(a.args.map(_e(r,n))));(await Promise.all(o)).forEach((a,c)=>{const u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}const h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(r.get(s),h.apply(n,u.args)):h.apply(n,a)}catch(h){i(u,h)}})}async function ri({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:n}){try{const o=i.get(s)||e,l="commands"in o?o.commands:[o];if([Re.WebGL,Re.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const c=l[a];await em({mutation:c,type:e.type,target:t,imageMap:r,errorHandler:n})}return}await tm({event:s,mutations:l,target:t,imageMap:r,errorHandler:n})}catch(o){n(e,o)}}class rm{constructor(e){w(this,"mediaMap",new Map),w(this,"warn"),w(this,"service"),w(this,"speedService"),w(this,"emitter"),w(this,"getCurrentTime"),w(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(F.Start,this.start.bind(this)),this.emitter.on(F.SkipStart,this.start.bind(this)),this.emitter.on(F.Pause,this.pause.bind(this)),this.emitter.on(F.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const n=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let l=r.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(l=l%o),t.currentTime=l}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var d,m,g,p,y;const i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:l,muted:a,volume:c,loop:u}=r;return{isPlaying:n===Te.Play||n!==Te.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(d=l!=null?l:i==null?void 0:i.currentTimeAtLastInteraction)!=null?d:0,lastInteractionTimeOffset:t,playbackRate:(m=o!=null?o:i==null?void 0:i.playbackRate)!=null?m:1,volume:(g=c!=null?c:i==null?void 0:i.volume)!=null?g:1,muted:(p=a!=null?a:i==null?void 0:i.muted)!=null?p:e.getAttribute("muted")===null,loop:(y=u!=null?u:i==null?void 0:i.loop)!=null?y:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:n,isPlaying:o}=t,l=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=r,e.loop=i,e.playbackRate!==a&&(e.playbackRate=a),o&&!l?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,n=r.getMeta(i);if(!n||!("attributes"in n))return;const o=this.service.state.matches("paused"),l=n.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=i.getAttribute("autoplay")!==null,a&&o&&i.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let u=!1;typeof l.rr_mediaMuted=="boolean"?u=l.rr_mediaMuted:u=i.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof l.rr_mediaVolume=="number"&&(f=l.rr_mediaVolume);let d=0;typeof l.rr_mediaCurrentTime=="number"&&(d=l.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:a,currentTimeAtLastInteraction:d,lastInteractionTimeOffset:t,playbackRate:c,volume:f,muted:u,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function pr(s,e){if(s.nodeName!=="DIALOG"||s instanceof ge)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=n==="modal";if(!(r&&!(i&&n==="non-modal"||!i&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),o&&(l?t.showModal():t.show())}}function sm(s,e){if(s.nodeName!=="DIALOG"||s instanceof ge)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const yo=5*1e3,wo=1*1e3,bo=60*60*1e3,im=Cl||Gp,vo="[replayer]",ws={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function bs(s){return s.type==N.IncrementalSnapshot&&(s.data.source==M.TouchMove||s.data.source==M.MouseInteraction&&s.data.type==U.TouchStart)}class nm{constructor(e,t){if(w(this,"wrapper"),w(this,"iframe"),w(this,"service"),w(this,"speedService"),w(this,"config"),w(this,"usingVirtualDom",!1),w(this,"virtualDom",new lt),w(this,"mouse"),w(this,"mouseTail",null),w(this,"tailPositions",[]),w(this,"emitter",im()),w(this,"nextUserInteractionEvent"),w(this,"activityIntervals",[]),w(this,"inactiveEndTimestamp"),w(this,"legacy_missingNodeRetryMap",{}),w(this,"cache",An()),w(this,"imageMap",new Map),w(this,"canvasEventMap",new Map),w(this,"mirror",Eo()),w(this,"styleMirror",new zi),w(this,"mediaManager"),w(this,"firstFullSnapshot",null),w(this,"newDocumentQueue",[]),w(this,"mousePos",null),w(this,"touchActive",null),w(this,"lastMouseDownEvent",null),w(this,"lastHoveredRootNode"),w(this,"lastSelectionData",null),w(this,"constructedStyleMutations",[]),w(this,"adoptedStyleSheets",[]),w(this,"handleResize",l=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))}),w(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case N.DomContentLoaded:case N.Load:case N.Custom:continue;case N.FullSnapshot:case N.Meta:case N.Plugin:case N.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),w(this,"getCastFn",(l,a=!1)=>{let c;switch(l.type){case N.DomContentLoaded:case N.Load:break;case N.Custom:c=()=>{this.emitter.emit(F.CustomEvent,l)};break;case N.Meta:c=()=>this.emitter.emit(F.Resize,{width:l.data.width,height:l.data.height});break;case N.FullSnapshot:c=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,a),(h=this.iframe.contentWindow)==null||h.scrollTo(l.data.initialOffset)};break;case N.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,a),!a&&(this.handleInactivity(l.timestamp),l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=l.timestamp)&&this.isUserInteraction(h)){h.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-l.delay,f={speed:Math.min(Math.round(h/yo),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(F.SkipStart,f)}}};break}return()=>{c&&c();for(const f of this.config.plugins||[])f.handler&&f.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(F.Finish))};let d=50;l.type===N.IncrementalSnapshot&&l.data.source===M.MouseMove&&l.data.positions.length&&(d+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(f,d)}this.emitter.emit(F.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={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:ws,useVirtualDom:!0,logger:console,inactiveThreshold:.02,inactiveSkipTime:yo};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(F.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(F.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,c,u)=>{ri({event:a,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===M.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===M.StyleDeclaration&&this.applyStyleDeclaration(a,c)},afterAppend:(a,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{kr(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(a){console.warn(a)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[a],u=Lr(c.node,this.mirror,this.virtualDom.mirror);kr(u,c.node,l,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),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[l,a]=this.lastMouseDownEvent;l.dispatchEvent(a)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(F.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new Hp([],{speed:this.config.speed});this.service=Zp({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(F.StateChange,{player:l})}),this.speedService=Xp({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(F.StateChange,{speed:l})}),this.mediaManager=new rm({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(l=>l.type===N.Meta),o=this.service.state.context.events.find(l=>l.type===N.FullSnapshot);if(n){const{width:l,height:a}=n.data;setTimeout(()=>{this.emitter.emit(F.Resize,{width:l,height:a})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(bs)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const e=[],t=this.getMetaData(),r=[{timestamp:t.startTime},...this.service.state.context.events.filter(o=>this.isUserInteraction(o)),{timestamp:t.endTime}];for(let o=1;o<r.length;o++){const l=r[o-1],a=r[o];a.timestamp-l.timestamp>this.config.inactivePeriodThreshold?e.push({startTime:l.timestamp,endTime:a.timestamp,duration:a.timestamp-l.timestamp,active:!1}):e.push({startTime:l.timestamp,endTime:a.timestamp,duration:a.timestamp-l.timestamp,active:!0})}const i=[];let n=e[0];for(let o=1;o<e.length;o++)e[o].active!=e[o-1].active&&(i.push({startTime:n.startTime,endTime:e[o-1].endTime,duration:e[o-1].endTime-n.startTime,active:e[o-1].active}),n=e[o]);n&&e.length>0&&i.push({startTime:n.startTime,endTime:e[e.length-1].endTime,duration:e[e.length-1].endTime-n.startTime,active:e[e.length-1].active}),n=i[0];for(let o=1;o<i.length;o++)(!i[o].active&&i[o].duration>this.config.inactiveThreshold*t.totalTime||!i[o-1].active&&i[o-1].duration>this.config.inactiveThreshold*t.totalTime)&&(this.activityIntervals.push({startTime:n.startTime,endTime:i[o-1].endTime,duration:i[o-1].endTime-n.startTime,active:i[o-1].active}),n=i[o]);n&&i.length>0&&this.activityIntervals.push({startTime:n.startTime,endTime:i[i.length-1].endTime,duration:i[i.length-1].endTime-n.startTime,active:i[i.length-1].active})}return this.activityIntervals}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(F.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(F.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(F.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(F.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;bs(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}replaceEvents(e){for(const t of e)if(bs(t)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})}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=An()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(jp(this.iframe.contentWindow,this.iframe.contentDocument),Fi(this.iframe.contentWindow))}handleInactivity(e,t){if((e===this.inactiveEndTimestamp||t)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(e>=r.startTime&&e<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-e,i={speed:r/bo*this.config.inactiveSkipTime<wo?r/wo:Math.round(Math.max(r,bo)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(F.SkipStart,i)}}}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,n=(a,c)=>{if(a.nodeName==="DIALOG"&&i.add(a),this.collectIframeAndAttachDocument(r,a),this.mediaManager.isSupportedMediaElement(a)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.newDocumentQueue=[],Dh(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:c}of r)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);const{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),i.forEach(a=>pr(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(F.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=Jp(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,il(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:M.StyleSheetRule,adds:i.map((o,l)=>({rule:o,index:l}))})}else{const n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(r=n.sheet)==null||r.insertRule(i[o],o)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(l,a)=>{l.nodeName==="DIALOG"&&n.add(l),this.collectIframeAndAttachDocument(i,l);const c=r.getMeta(l);if((c==null?void 0:c.type)===Ee.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:a,replayer:this})};bt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of i)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);n.forEach(l=>pr(l))}collectIframeAndAttachDocument(e,t){if(et(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,n=this.service.state;const o=()=>{n=this.service.state};this.emitter.on(F.Start,o),this.emitter.on(F.Pause,o);const l=()=>{this.emitter.off(F.Start,o),this.emitter.off(F.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(r.add(a),a.addEventListener("load",()=>{r.delete(a),r.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(F.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(F.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===N.IncrementalSnapshot&&t.data.source===M.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),n=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async n=>{const o=await Promise.all(n.args.map(_e(this.imageMap,null,r)));return te(O({},n),{args:o})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,te(O({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(_e(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,te(O({},e),{args:i}))}}}applyIncremental(e,t){var r,i,n;const{data:o}=e;switch(o.source){case M.Mutation:{try{this.applyMutation(o,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case M.Drag:case M.TouchMove:case M.MouseMove:if(t){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,o)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case M.MouseInteraction:{if(o.id===-1)break;const l=new Event(Ue(U[o.type])),a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);this.emitter.emit(F.MouseInteraction,{type:o.type,target:a});const{triggerFocus:c}=this.config;switch(o.type){case U.Blur:"blur"in a&&a.blur();break;case U.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case U.Click:case U.TouchStart:case U.TouchEnd:case U.MouseDown:case U.MouseUp:t?(o.type===U.TouchStart?this.touchActive=!0:o.type===U.TouchEnd&&(this.touchActive=!1),o.type===U.MouseDown?this.lastMouseDownEvent=[a,l]:o.type===U.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===U.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===U.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===U.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===U.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case U.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case M.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,t);break}case M.ViewportResize:this.emitter.emit(F.Resize,{width:o.width,height:o.height});break;case M.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case M.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const a=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case M.StyleSheetRule:case M.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case M.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:e,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);ri({event:e,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case M.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(l)}catch(l){this.warn(l)}break}case M.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case M.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Jd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=sl(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>r.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=r.getNode(c.id);if(!h)return;let f=r.getNode(c.parentId);if(!f)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&De(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((u=f.rules)==null?void 0:u.length)>0&&(f.rules=[])}catch(d){if(d instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw d}});const i=O({},this.legacy_missingNodeRetryMap),n=[],o=c=>{let u=null;return c.nextId&&(u=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},l=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(c.parentId);if(!f)return c.node.type===Ee.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(De(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let d=null,m=null;if(c.previousId&&(d=r.getNode(c.previousId)),c.nextId&&(m=r.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;const g=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(et(f,r)){this.attachDocumentToIframe(c,f);return}const p=(b,S)=>{if(!this.usingVirtualDom){pr(b);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(b,{id:S,replayer:this})}},y=bt(c.node,{doc:g,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:y,mutation:c};return}const v=r.getMeta(f);if(v&&v.type===Ee.Element&&c.node.type===Ee.Text){const b=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(v.tagName==="textarea")for(const S of b)S.nodeType===f.TEXT_NODE&&f.removeChild(S);else if(v.tagName==="style"&&b.length===1)for(const S of b)S.nodeType===f.TEXT_NODE&&!r.hasNode(S)&&(y.textContent=S.textContent,f.removeChild(S))}else if((v==null?void 0:v.type)===Ee.Document){const b=f;c.node.type===Ee.DocumentType&&((u=b.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&b.removeChild(b.childNodes[0]),y.nodeName==="HTML"&&b.documentElement&&b.removeChild(b.documentElement)}if(d&&d.nextSibling&&d.nextSibling.parentNode?f.insertBefore(y,d.nextSibling):m&&m.parentNode?f.contains(m)?f.insertBefore(y,m):f.insertBefore(y,null):f.appendChild(y),p(y,c.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),et(y,this.mirror)){const b=this.mirror.getId(y),S=this.newDocumentQueue.find(C=>C.parentId===b);S&&(this.attachDocumentToIframe(S,y),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==S))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,f,y,c)};e.adds.forEach(c=>{l(c)});const a=Date.now();for(;n.length;){const c=ul(n);if(n.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)r.getNode(u.value.parentId)?Bi(u,f=>{l(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),hl(e.texts).forEach(c=>{var u;const h=r.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);const f=h.parentElement;if(c.value&&f&&f.tagName==="STYLE"?h.textContent=jr(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){const d=h.parentNode;((u=d==null?void 0:d.rules)==null?void 0:u.length)>0&&(d.rules=[])}}),e.attributes.forEach(c=>{var u;const h=r.getNode(c.id);if(!h)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const f in c.attributes)if(typeof f=="string"){const d=c.attributes[f];if(d===null)h.removeAttribute(f),f==="open"&&sm(h,c);else if(typeof d=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const m=r.getMeta(h),g=bt(te(O({},m),{attributes:O(O({},m.attributes),c.attributes)}),{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const p=h.nextSibling,y=h.parentNode;if(g&&y){y.removeChild(h),y.insertBefore(g,p),r.replace(c.id,g);break}}catch(m){}if(f==="value"&&h.nodeName==="TEXTAREA"){const m=h;m.childNodes.forEach(p=>m.removeChild(p));const g=(u=h.ownerDocument)==null?void 0:u.createTextNode(d);g&&m.appendChild(g)}else h.setAttribute(f,d);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&pr(h,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(f==="style"){const m=d,g=h;for(const p in m)if(m[p]===!1)g.style.removeProperty(p);else if(m[p]instanceof Array){const y=m[p];g.style.setProperty(p,y[0],y[1])}else{const y=m[p];g.style.setProperty(p,y)}}}})}applyScroll(e,t){var r,i;const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===Ee.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(l){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:l})=>{const a=this.mirror.getNode(i),c=this.mirror.getNode(o);if(!a||!c)return;const u=new Range;u.setStart(a,n),u.setEnd(c,l);const h=a.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:u,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===M.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===M.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,n,o;if((r=e.adds)==null||r.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:c,index:u}=ei(a);Ke(t.cssRules,c).insertRule(l,u)}else{const c=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,c)}}catch(c){}}),(i=e.removes)==null||i.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:c}=ei(l);Ke(t.cssRules,a).deleteRule(c||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&Ke(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ke(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(l=>{var a;let c=null,u=null;if(De(r)?u=((a=r.ownerDocument)==null?void 0:a.defaultView)||null:r.nodeName==="#document"&&(u=r.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:M.StyleSheetRule,adds:l.rules},c)}catch(h){}});const i=10;let n=0;const o=(l,a)=>{const c=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);De(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&n<i&&(setTimeout(()=>o(l,a),0+100*n),n++)};o(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:n,nextId:o}=i,l=n&&e[n],a=o&&e[o];if(l){const{node:c,mutation:u}=l;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(a){const{node:c,mutation:u}=a;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,r,i,n){const o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(n,r);const l=Ui(o,this.iframe),a=e*l.absoluteScale+l.x,c=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:a,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:n}=this.config.mouseTail===!0?ws:Object.assign({},ws,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=t,l.strokeStyle=i,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==N.IncrementalSnapshot?!1:e.data.source>M.Mutation&&e.data.source<=M.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(F.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(vo,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(vo,...e)}}const{addCustomEvent:om}=Ae,{freezePage:am}=Ae,{takeFullSnapshot:lm}=Ae;exports.EventType=N;exports.IncrementalSource=M;exports.MouseInteractions=U;exports.Replayer=nm;exports.ReplayerEvents=F;exports.addCustomEvent=om;exports.canvasMutation=ri;exports.freezePage=am;exports.record=Ae;exports.takeFullSnapshot=lm;exports.utils=hp;
85
- if (typeof module.exports == "object" && typeof exports == "object") {
174
+ ***************************************************************************** */function qn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s,a,u=r.call(e),c=[];try{for(;(t===void 0||t-- >0)&&!(s=u.next()).done;)c.push(s.value)}catch(f){a={error:f}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(a)throw a.error}}return c}var Xe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Xe||(Xe={}));var na={type:"xstate.init"};function ci(e){return e===void 0?[]:[].concat(e)}function Be(e){return{type:"xstate.assign",assignment:e}}function Gn(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 oa(e){return typeof e=="string"?{type:e}:e}function Hn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:zt(e)}}function Yn(e,t,r){var s=t,a=!1;return[e.filter((function(u){if(u.type==="xstate.assign"){a=!0;var c=Object.assign({},s);return typeof u.assignment=="function"?c=u.assignment(s,r):Object.keys(u.assignment).forEach((function(f){c[f]=typeof u.assignment[f]=="function"?u.assignment[f](s,r):u.assignment[f]})),s=c,!1}return!0})),s,a]}function aa(e,t){t===void 0&&(t={});var r=qn(Yn(ci(e.states[e.initial].entry).map((function(c){return Gn(c,t.actions)})),e.context,na),2),s=r[0],a=r[1],u={config:e,_options:t,initialState:{value:e.initial,actions:s,context:a,matches:zt(e.initial)},transition:function(c,f){var m,d,p=typeof c=="string"?{value:c,context:e.context}:c,o=p.value,n=p.context,i=oa(f),l=e.states[o];if(l.on){var h=ci(l.on[i.type]);try{for(var g=(function(P){var V=typeof Symbol=="function"&&Symbol.iterator,H=V&&P[V],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(V?"Object is not iterable.":"Symbol.iterator is not defined.")})(h),b=g.next();!b.done;b=g.next()){var y=b.value;if(y===void 0)return Hn(o,n);var v=typeof y=="string"?{target:y}:y,E=v.target,S=v.actions,w=S===void 0?[]:S,C=v.cond,M=C===void 0?function(){return!0}:C,R=E===void 0,x=E!=null?E:o,D=e.states[x];if(M(n,i)){var T=qn(Yn((R?ci(w):[].concat(l.exit,w,D.entry).filter((function(P){return P}))).map((function(P){return Gn(P,u._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{b&&!b.done&&(d=g.return)&&d.call(g)}finally{if(m)throw m.error}}}return Hn(o,n)}};return u}var Jn=function(e,t){return e.actions.forEach((function(r){var s=r.exec;return s&&s(e.context,t)}))};function la(e){var t=e.initialState,r=Xe.NotStarted,s=new Set,a={_machine:e,send:function(u){r===Xe.Running&&(t=e.transition(t,u),Jn(t,oa(u)),s.forEach((function(c){return c(t)})))},subscribe:function(u){return s.add(u),u(t),{unsubscribe:function(){return s.delete(u)}}},start:function(u){if(u){var c=typeof u=="object"?u:{context:e.config.context,value:u};t={value:c.value,actions:[],context:c.context,matches:zt(c.value)}}return r=Xe.Running,Jn(t,na),a},stop:function(){return r=Xe.Stopped,s.clear(),a},get state(){return t},get status(){return r}};return a}function Tc(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 Dc(e,{getCastFn:t,applyEventsSynchronously:r,emitter:s}){const a=aa({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:Be({lastPlayedEvent:(u,c)=>c.type==="CAST_EVENT"?c.payload.event:u.lastPlayedEvent}),recordTimeOffset:Be((u,c)=>{let f=u.timeOffset;return"payload"in c&&"timeOffset"in c.payload&&(f=c.payload.timeOffset),se(L({},u),{timeOffset:f,baselineTime:u.events[0].timestamp+f})}),play(u){var c;const{timer:f,events:m,baselineTime:d,lastPlayedEvent:p}=u;f.clear();for(const l of m)ui(l,d);const o=Tc(m,d);let n=p==null?void 0:p.timestamp;(p==null?void 0:p.type)===k.IncrementalSnapshot&&p.data.source===_.MouseMove&&(n=p.timestamp+((c=p.data.positions[0])==null?void 0:c.timeOffset)),d<(n||0)&&s.emit(B.PlayBack);const i=new Array;for(const l of o)if(!(n&&n<d&&(l.timestamp<=n||l===p)))if(l.timestamp<d)i.push(l);else{const h=t(l,!1);f.addAction({doAction:()=>{h()},delay:l.delay})}r(i),s.emit(B.Flush),f.start()},pause(u){u.timer.clear()},resetLastPlayedEvent:Be(u=>se(L({},u),{lastPlayedEvent:null})),startLive:Be({baselineTime:(u,c)=>(u.timer.start(),c.type==="TO_LIVE"&&c.payload.baselineTime?c.payload.baselineTime:Date.now())}),replaceEvents:Be((u,c)=>{if(c.type!=="REPLACE_EVENTS")return u;const{events:f,timer:m,baselineTime:d}=u,{events:p}=c.payload;if(p.length===0)return u;f.length=0;const o=[],n=m.timeOffset+d;for(const i of p)ui(i,d),f.push(i),i.timestamp>=n&&o.push({doAction:t(i,!1),delay:i.delay});return m.isActive()&&m.replaceActions(o),se(L({},u),{events:f})}),addEvent:Be((u,c)=>{const{baselineTime:f,timer:m,events:d}=u;if(c.type==="ADD_EVENT"){const{event:p}=c.payload;ui(p,f);let o=d.length-1;if(!d[o]||d[o].timestamp<=p.timestamp)d.push(p);else{let l=-1,h=0;for(;h<=o;){const g=Math.floor((h+o)/2);d[g].timestamp<=p.timestamp?h=g+1:o=g-1}l===-1&&(l=h),d.splice(l,0,p)}const n=p.timestamp<f,i=t(p,n);n?i():m.isActive()&&m.addAction({doAction:()=>{i()},delay:p.delay})}return se(L({},u),{events:d})})}});return la(a)}function Ac(e){const t=aa({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:Be({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return la(t)}const _c=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;}`],Xn=new Map;function ua(e,t){let r=Xn.get(e);return r||(r=new Map,Xn.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 a=await Pe(e,t,r)(s.args);return await createImageBitmap.apply(null,a)}else if("index"in s){if(r||t===null)return s;const{rr_type:a,index:u}=s;return ua(t,a)[u]}else if("args"in s){const{rr_type:a,args:u}=s,c=window[a];return new c(...await Promise.all(u.map(Pe(e,t,r))))}else{if("base64"in s)return wc(s.base64);if("src"in s){const a=e.get(s.src);if(a)return a;{const u=new Image;return u.src=s.src,e.set(s.src,u),u}}else if("data"in s&&s.rr_type==="Blob"){const a=await Promise.all(s.data.map(Pe(e,t,r)));return new Blob(a,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(Pe(e,t,r)));return s}}function kc(e,t){try{return t===Me.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(r){return null}}const Pc=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Lc(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Pc.includes(r))return;const s=ua(e,r);s.includes(t)||s.push(t)}async function Fc({mutation:e,target:t,type:r,imageMap:s,errorHandler:a}){try{const u=kc(t,r);if(!u)return;if(e.setter){u[e.property]=e.args[0];return}const c=u[e.property],f=await Promise.all(e.args.map(Pe(s,u))),m=c.apply(u,f);Lc(u,m);const d=!1}catch(u){a(e,u)}}async function Bc({event:e,mutations:t,target:r,imageMap:s,errorHandler:a}){const u=r.getContext("2d");if(!u){a(t[0],new Error("Canvas context is null"));return}Wo(u);const c=t.map(async m=>Promise.all(m.args.map(Pe(s,u))));(await Promise.all(c)).forEach((m,d)=>{const p=t[d];try{if(p.setter){u[p.property]=p.args[0];return}const o=u[p.property];p.property==="drawImage"&&typeof p.args[0]=="string"?(s.get(e),o.apply(u,p.args)):o.apply(u,m)}catch(o){a(p,o)}})}async function bi({event:e,mutation:t,target:r,imageMap:s,canvasEventMap:a,errorHandler:u}){try{const c=a.get(e)||t,f="commands"in c?c.commands:[c];if([Me.WebGL,Me.WebGL2].includes(t.type)){for(let m=0;m<f.length;m++){const d=f[m];await Fc({mutation:d,type:t.type,target:r,imageMap:s,errorHandler:u})}return}await Bc({event:e,mutations:f,target:r,imageMap:s,errorHandler:u})}catch(c){u(t,c)}}class Uc{constructor(t){O(this,"mediaMap",new Map),O(this,"warn"),O(this,"service"),O(this,"speedService"),O(this,"emitter"),O(this,"getCurrentTime"),O(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(B.Start,this.start.bind(this)),this.emitter.on(B.SkipStart,this.start.bind(this)),this.emitter.on(B.Pause,this.pause.bind(this)),this.emitter.on(B.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 u=(t-s.lastInteractionTimeOffset)/1e3*s.playbackRate,c="duration"in r&&r.duration;if(Number.isNaN(c)){this.waitForMetadata(r);return}let f=s.currentTimeAtLastInteraction+u;r.loop&&c!==!1&&(f=f%c),r.currentTime=f}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,l,h,g,b;const a=this.mediaMap.get(t),{type:u,playbackRate:c,currentTime:f,muted:m,volume:d,loop:p}=s;return{isPlaying:u===_e.Play||u!==_e.Pause&&((a==null?void 0:a.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(i=f!=null?f:a==null?void 0:a.currentTimeAtLastInteraction)!=null?i:0,lastInteractionTimeOffset:r,playbackRate:(l=c!=null?c:a==null?void 0:a.playbackRate)!=null?l:1,volume:(h=d!=null?d:a==null?void 0:a.volume)!=null?h:1,muted:(g=m!=null?m:a==null?void 0:a.muted)!=null?g:t.getAttribute("muted")===null,loop:(b=p!=null?p:a==null?void 0:a.loop)!=null?b:t.getAttribute("loop")===null}}syncTargetWithState(t){const r=this.mediaMap.get(t);if(!r)return;const{muted:s,loop:a,volume:u,isPlaying:c}=r,f=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!==u&&(t.volume=u),t.muted=s,t.loop=a,t.playbackRate!==m&&(t.playbackRate=m),c&&!f?t.play():t.pause()}catch(d){this.warn(`Failed to replay media interactions: ${d.message||d}`)}}addMediaElements(t,r,s){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;const a=t,u=s.getMeta(a);if(!u||!("attributes"in u))return;const c=this.service.state.matches("paused"),f=u.attributes;let m=!1;f.rr_mediaState?m=f.rr_mediaState==="played":m=a.getAttribute("autoplay")!==null,m&&c&&a.pause();let d=1;typeof f.rr_mediaPlaybackRate=="number"&&(d=f.rr_mediaPlaybackRate);let p=!1;typeof f.rr_mediaMuted=="boolean"?p=f.rr_mediaMuted:p=a.getAttribute("muted")!==null;let o=!1;typeof f.rr_mediaLoop=="boolean"?o=f.rr_mediaLoop:o=a.getAttribute("loop")!==null;let n=1;typeof f.rr_mediaVolume=="number"&&(n=f.rr_mediaVolume);let i=0;typeof f.rr_mediaCurrentTime=="number"&&(i=f.rr_mediaCurrentTime),this.mediaMap.set(a,{isPlaying:m,currentTimeAtLastInteraction:i,lastInteractionTimeOffset:r,playbackRate:d,volume:n,muted:p,loop:o}),this.syncTargetWithState(a)}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 Nt(e,t){if(e.nodeName!=="DIALOG"||e instanceof be)return;const r=e,s=r.open,a=s&&r.matches("dialog:modal"),u=r.getAttribute("rr_open_mode"),c=typeof(t==null?void 0:t.attributes.open)=="string"||typeof r.getAttribute("open")=="string",f=u==="modal";if(!(s&&!(a&&u==="non-modal"||!a&&f))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}s&&r.close(),c&&(f?r.showModal():r.show())}}function Wc(e,t){if(e.nodeName!=="DIALOG"||e instanceof be)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 Qn=5*1e3,Zn=1*1e3,Kn=3600*1e3,$c=sa||Ic,eo="[replayer]",hi={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function fi(e){return e.type==k.IncrementalSnapshot&&(e.data.source==_.TouchMove||e.data.source==_.MouseInteraction&&e.data.type==j.TouchStart)}class ca{constructor(t,r){if(O(this,"wrapper"),O(this,"iframe"),O(this,"UNSAFE_replayCanvas",!1),O(this,"service"),O(this,"speedService"),O(this,"config"),O(this,"usingVirtualDom",!1),O(this,"virtualDom",new et),O(this,"mouse"),O(this,"mouseTail",null),O(this,"tailPositions",[]),O(this,"emitter",$c()),O(this,"nextUserInteractionEvent"),O(this,"activityIntervals",[]),O(this,"inactiveEndTimestamp"),O(this,"legacy_missingNodeRetryMap",{}),O(this,"cache",Js()),O(this,"imageMap",new Map),O(this,"canvasEventMap",new Map),O(this,"mirror",oo()),O(this,"styleMirror",new es),O(this,"mediaManager"),O(this,"firstFullSnapshot",null),O(this,"newDocumentQueue",[]),O(this,"mousePos",null),O(this,"touchActive",null),O(this,"lastMouseDownEvent",null),O(this,"lastHoveredRootNode"),O(this,"lastSelectionData",null),O(this,"constructedStyleMutations",[]),O(this,"adoptedStyleSheets",[]),O(this,"handleResize",f=>{this.iframe.style.display="inherit";for(const m of[this.mouseTail,this.iframe])m&&(m.setAttribute("width",String(f.width)),m.setAttribute("height",String(f.height)))}),O(this,"applyEventsSynchronously",f=>{for(const m of f){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)()}}),O(this,"getCastFn",(f,m=!1)=>{let d;switch(f.type){case k.DomContentLoaded:case k.Load:break;case k.Custom:d=()=>{this.emitter.emit(B.CustomEvent,f)};break;case k.Meta:d=()=>this.emitter.emit(B.Resize,{width:f.data.width,height:f.data.height});break;case k.FullSnapshot:d=()=>{var o;if(this.firstFullSnapshot){if(this.firstFullSnapshot===f){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(f,m),(o=this.iframe.contentWindow)==null||o.scrollTo(f.data.initialOffset)};break;case k.IncrementalSnapshot:d=()=>{if(this.applyIncremental(f,m),!m&&(this.handleInactivity(f.timestamp),f===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=f.timestamp)&&this.isUserInteraction(o)){o.delay-f.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-f.delay,n={speed:Math.min(Math.round(o/Qn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:n}),this.emitter.emit(B.SkipStart,n)}}};break}return()=>{d&&d();for(const n of this.config.plugins||[])n.handler&&n.handler(f,m,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:f}});const o=this.service.state.context.events.length-1;if(!this.config.liveMode&&f===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(B.Finish))};let i=50;f.type===k.IncrementalSnapshot&&f.data.source===_.MouseMove&&f.data.positions.length&&(i+=Math.max(0,-f.data.positions[0].timeOffset)),setTimeout(n,i)}this.emitter.emit(B.EventCast,f)}}),!(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:hi,useVirtualDom:!0,logger:console,inactiveThreshold:.02,inactiveSkipTime:Qn};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(B.Resize,this.handleResize),this.setupDom();for(const f of this.config.plugins||[])f.getMirror&&f.getMirror({nodeMirror:this.mirror});this.emitter.on(B.Flush,()=>{if(this.usingVirtualDom){const f={mirror:this.mirror,applyCanvas:(m,d,p)=>{bi({event:m,mutation:d,target:p,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(m,d)=>{m.source===_.StyleSheetRule?this.applyStyleSheetRule(m,d):m.source===_.StyleDeclaration&&this.applyStyleDeclaration(m,d)},afterAppend:(m,d)=>{for(const p of this.config.plugins||[])p.onBuild&&p.onBuild(m,{id:d,replayer:this})}};if(this.iframe.contentDocument)try{Ft(this.iframe.contentDocument,this.virtualDom,f,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 d=this.legacy_missingNodeRetryMap[m],p=Bt(d.node,this.mirror,this.virtualDom.mirror);Ft(p,d.node,f,this.virtualDom.mirror),d.node=p}catch(d){this.warn(d)}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[f,m]=this.lastMouseDownEvent;f.dispatchEvent(m)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(B.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const a=new Nc([],{speed:this.config.speed});this.service=Dc({events:t.map(f=>r&&r.unpackFn?r.unpackFn(f):f).sort((f,m)=>f.timestamp-m.timestamp),timer:a,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(f=>{this.emitter.emit(B.StateChange,{player:f})}),this.speedService=Ac({normalSpeed:-1,timer:a}),this.speedService.start(),this.speedService.subscribe(f=>{this.emitter.emit(B.StateChange,{speed:f})}),this.mediaManager=new Uc({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const u=this.service.state.context.events.find(f=>f.type===k.Meta),c=this.service.state.context.events.find(f=>f.type===k.FullSnapshot);if(u){const{width:f,height:m}=u.data;setTimeout(()=>{this.emitter.emit(B.Resize,{width:f,height:m})},0)}c&&setTimeout(()=>{var f;this.firstFullSnapshot||(this.firstFullSnapshot=c,this.rebuildFullSnapshot(c),(f=this.iframe.contentWindow)==null||f.scrollTo(c.data.initialOffset))},1),this.service.state.context.events.find(fi)&&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(c=>this.isUserInteraction(c)),{timestamp:r.endTime}];for(let c=1;c<s.length;c++){const f=s[c-1],m=s[c];m.timestamp-f.timestamp>this.config.inactivePeriodThreshold?t.push({startTime:f.timestamp,endTime:m.timestamp,duration:m.timestamp-f.timestamp,active:!1}):t.push({startTime:f.timestamp,endTime:m.timestamp,duration:m.timestamp-f.timestamp,active:!0})}const a=[];let u=t[0];for(let c=1;c<t.length;c++)t[c].active!=t[c-1].active&&(a.push({startTime:u.startTime,endTime:t[c-1].endTime,duration:t[c-1].endTime-u.startTime,active:t[c-1].active}),u=t[c]);u&&t.length>0&&a.push({startTime:u.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-u.startTime,active:t[t.length-1].active}),u=a[0];for(let c=1;c<a.length;c++)(!a[c].active&&a[c].duration>this.config.inactiveThreshold*r.totalTime||!a[c-1].active&&a[c-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:u.startTime,endTime:a[c-1].endTime,duration:a[c-1].endTime-u.startTime,active:a[c-1].active}),u=a[c]);u&&a.length>0&&this.activityIntervals.push({startTime:u.startTime,endTime:a[a.length-1].endTime,duration:a[a.length-1].endTime-u.startTime,active:a[a.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(B.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(B.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(B.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(B.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;fi(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(fi(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=ql({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Oc(this.iframe.contentWindow,this.iframe.contentDocument),Xi(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,a={speed:s/Kn*this.config.inactiveSkipTime<Zn?s/Zn:Math.round(Math.max(s,Kn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:a}),this.emitter.emit(B.SkipStart,a)}}}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=[],a=new Set,u=(m,d)=>{if(m.nodeName==="DIALOG"&&a.add(m),this.collectIframeAndAttachDocument(s,m),this.mediaManager.isSupportedMediaElement(m)){const{events:p}=this.service.state.context;this.mediaManager.addMediaElements(m,t.timestamp-p[0].timestamp,this.mirror)}for(const p of this.config.plugins||[])p.onBuild&&p.onBuild(m,{id:d,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.newDocumentQueue=[],Vl(t.data.node,{doc:this.iframe.contentDocument,afterAppend:u,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas,cspContent:this.config.cspContent}),u(this.iframe.contentDocument,t.data.node.id);for(const{mutationInQueue:m,builtNode:d}of s)this.attachDocumentToIframe(m,d),this.newDocumentQueue=this.newDocumentQueue.filter(p=>p!==m);const{documentElement:c,head:f}=this.iframe.contentDocument;this.insertStyleRules(c,f),a.forEach(m=>Nt(m)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(B.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var s;const a=_c(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&a.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!a.length)if(this.usingVirtualDom){const u=this.virtualDom.createElement("style");this.virtualDom.mirror.add(u,Uo(u,this.virtualDom.unserializedId)),t.insertBefore(u,r),u.rules.push({source:_.StyleSheetRule,adds:a.map((c,f)=>({rule:c,index:f}))})}else{const u=document.createElement("style");t.insertBefore(u,r);for(let c=0;c<a.length;c++)(s=u.sheet)==null||s.insertRule(a[c],c)}}attachDocumentToIframe(t,r){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,a=[],u=new Set,c=(f,m)=>{f.nodeName==="DIALOG"&&u.add(f),this.collectIframeAndAttachDocument(a,f);const d=s.getMeta(f);if((d==null?void 0:d.type)===Re.Element&&(d==null?void 0:d.tagName.toUpperCase())==="HTML"){const{documentElement:p,head:o}=r.contentDocument;this.insertStyleRules(p,o)}if(!this.usingVirtualDom)for(const p of this.config.plugins||[])p.onBuild&&p.onBuild(f,{id:m,replayer:this})};nt(t.node,{doc:r.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:c,cache:this.cache}),c(r.contentDocument,t.node.id);for(const{mutationInQueue:f,builtNode:m}of a)this.attachDocumentToIframe(f,m),this.newDocumentQueue=this.newDocumentQueue.filter(d=>d!==f);u.forEach(f=>Nt(f))}collectIframeAndAttachDocument(t,r){if(Qe(r,this.mirror)){const s=this.newDocumentQueue.find(a=>a.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 a,u=this.service.state;const c=()=>{u=this.service.state};this.emitter.on(B.Start,c),this.emitter.on(B.Pause,c);const f=()=>{this.emitter.off(B.Start,c),this.emitter.off(B.Pause,c)};r.querySelectorAll('link[rel="stylesheet"]').forEach(m=>{m.sheet||(s.add(m),m.addEventListener("load",()=>{s.delete(m),s.size===0&&a!==-1&&(u.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(B.LoadStylesheetEnd),a&&clearTimeout(a),f())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(B.LoadStylesheetStart),a=setTimeout(()=>{u.matches("playing")&&this.play(this.getCurrentTime()),a=-1,f()},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(a=>{this.preloadImages(a,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"),a=s.getContext("2d"),u=a==null?void 0:a.createImageData(s.width,s.height);a==null||a.putImageData(u,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){const s={isUnchanged:!0};if("commands"in t){const a=await Promise.all(t.commands.map(async u=>{const c=await Promise.all(u.args.map(Pe(this.imageMap,null,s)));return se(L({},u),{args:c})}));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(L({},t),{commands:a}))}else{const a=await Promise.all(t.args.map(Pe(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(L({},t),{args:a}))}}}applyIncremental(t,r){var s,a,u;const{data:c}=t;switch(c.source){case _.Mutation:{try{this.applyMutation(c,r)}catch(f){this.warn(`Exception in mutation ${f.message||f}`,c)}break}case _.Drag:case _.TouchMove:case _.MouseMove:if(r){const f=c.positions[c.positions.length-1];this.mousePos={x:f.x,y:f.y,id:f.id,debugData:c}}else c.positions.forEach(f=>{const m={doAction:()=>{this.moveAndHover(f.x,f.y,f.id,r,c)},delay:f.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(m)}),this.timer.addAction({doAction(){},delay:t.delay-((s=c.positions[0])==null?void 0:s.timeOffset)});break;case _.MouseInteraction:{if(c.id===-1)break;const f=new Event(We(j[c.type])),m=this.mirror.getNode(c.id);if(!m)return this.debugNodeNotFound(c,c.id);this.emitter.emit(B.MouseInteraction,{type:c.type,target:m});const{triggerFocus:d}=this.config;switch(c.type){case j.Blur:"blur"in m&&m.blur();break;case j.Focus:d&&m.focus&&m.focus({preventScroll:!0});break;case j.Click:case j.TouchStart:case j.TouchEnd:case j.MouseDown:case j.MouseUp:r?(c.type===j.TouchStart?this.touchActive=!0:c.type===j.TouchEnd&&(this.touchActive=!1),c.type===j.MouseDown?this.lastMouseDownEvent=[m,f]:c.type===j.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:c.x||0,y:c.y||0,id:c.id,debugData:c}):(c.type===j.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(c.x||0,c.y||0,c.id,r,c),c.type===j.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):c.type===j.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):c.type===j.TouchEnd?this.mouse.classList.remove("touch-active"):m.dispatchEvent(f));break;case j.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:m.dispatchEvent(f)}break}case _.Scroll:{if(c.id===-1)break;if(this.usingVirtualDom){const f=this.virtualDom.mirror.getNode(c.id);if(!f)return this.debugNodeNotFound(c,c.id);f.scrollData=c;break}this.applyScroll(c,r);break}case _.ViewportResize:this.emitter.emit(B.Resize,{width:c.width,height:c.height});break;case _.Input:{if(c.id===-1)break;if(this.usingVirtualDom){const f=this.virtualDom.mirror.getNode(c.id);if(!f)return this.debugNodeNotFound(c,c.id);f.inputData=c;break}this.applyInput(c);break}case _.MediaInteraction:{const f=this.usingVirtualDom?this.virtualDom.mirror.getNode(c.id):this.mirror.getNode(c.id);if(!f)return this.debugNodeNotFound(c,c.id);const m=f,{events:d}=this.service.state.context;this.mediaManager.mediaMutation({target:m,timeOffset:t.timestamp-d[0].timestamp,mutation:c});break}case _.StyleSheetRule:case _.StyleDeclaration:{this.usingVirtualDom?c.styleId?this.constructedStyleMutations.push(c):c.id&&((a=this.virtualDom.mirror.getNode(c.id))==null||a.rules.push(c)):this.applyStyleSheetMutation(c);break}case _.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const f=this.virtualDom.mirror.getNode(c.id);if(!f)return this.debugNodeNotFound(c,c.id);f.canvasMutations.push({event:t,mutation:c})}else{const f=this.mirror.getNode(c.id);if(!f)return this.debugNodeNotFound(c,c.id);bi({event:t,mutation:c,target:f,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case _.Font:{try{const f=new FontFace(c.family,c.buffer?new Uint8Array(JSON.parse(c.fontSource)):c.fontSource,c.descriptors);(u=this.iframe.contentDocument)==null||u.fonts.add(f)}catch(f){this.warn(f)}break}case _.Selection:{if(r){this.lastSelectionData=c;break}this.applySelection(c);break}case _.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(c):this.applyAdoptedStyleSheet(c);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,_u(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const d in this.legacy_missingNodeRetryMap)try{const p=this.legacy_missingNodeRetryMap[d],o=Bo(p.node,this.virtualDom,this.mirror);o&&(p.node=o)}catch(p){this.warn(p)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(d=>s.getNode(d.id)?!0:(this.warnNodeNotFound(t,d.id),!1)),t.removes.forEach(d=>{var p;const o=s.getNode(d.id);if(!o)return;let n=s.getNode(d.parentId);if(!n)return this.warnNodeNotFound(t,d.parentId);if(d.isShadow&&ke(n)&&(n=n.shadowRoot),s.removeNodeFromMap(o),n)try{n.removeChild(o),this.usingVirtualDom&&o.nodeName==="#text"&&n.nodeName==="STYLE"&&((p=n.rules)==null?void 0:p.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 a=L({},this.legacy_missingNodeRetryMap),u=[],c=d=>{let p=null;return d.nextId&&(p=s.getNode(d.nextId)),d.nextId!==null&&d.nextId!==void 0&&d.nextId!==-1&&!p},f=d=>{var p,o;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let n=s.getNode(d.parentId);if(!n)return d.node.type===Re.Document?this.newDocumentQueue.push(d):u.push(d);d.node.isShadow&&(ke(n)||n.attachShadow({mode:"open"}),n=n.shadowRoot);let i=null,l=null;if(d.previousId&&(i=s.getNode(d.previousId)),d.nextId&&(l=s.getNode(d.nextId)),c(d))return u.push(d);if(d.node.rootId&&!s.getNode(d.node.rootId))return;const h=d.node.rootId?s.getNode(d.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(n,s)){this.attachDocumentToIframe(d,n);return}const g=(v,E)=>{if(!this.usingVirtualDom){Nt(v);for(const S of this.config.plugins||[])S.onBuild&&S.onBuild(v,{id:E,replayer:this})}},b=nt(d.node,{doc:h,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(d.previousId===-1||d.nextId===-1){a[d.node.id]={node:b,mutation:d};return}const y=s.getMeta(n);if(y&&y.type===Re.Element&&d.node.type===Re.Text){const v=Array.isArray(n.childNodes)?n.childNodes:Array.from(n.childNodes);if(y.tagName==="textarea")for(const E of v)E.nodeType===n.TEXT_NODE&&n.removeChild(E);else if(y.tagName==="style"&&v.length===1)for(const E of v)E.nodeType===n.TEXT_NODE&&!s.hasNode(E)&&(b.textContent=E.textContent,n.removeChild(E))}else if((y==null?void 0:y.type)===Re.Document){const v=n;d.node.type===Re.DocumentType&&((p=v.childNodes[0])==null?void 0:p.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),b.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(i&&i.nextSibling&&i.nextSibling.parentNode?n.insertBefore(b,i.nextSibling):l&&l.parentNode?n.contains(l)?n.insertBefore(b,l):n.insertBefore(b,null):n.appendChild(b),g(b,d.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&n.nodeName==="STYLE"&&((o=n.rules)==null?void 0:o.length)>0&&(n.rules=[]),Qe(b,this.mirror)){const v=this.mirror.getId(b),E=this.newDocumentQueue.find(S=>S.parentId===v);E&&(this.attachDocumentToIframe(E,b),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==E))}(d.previousId||d.nextId)&&this.legacy_resolveMissingNode(a,n,b,d)};t.adds.forEach(d=>{f(d)});const m=Date.now();for(;u.length;){const d=Go(u);if(u.length=0,Date.now()-m>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}for(const p of d)s.getNode(p.value.parentId)?Qi(p,n=>{f(n)}):this.debug("Drop resolve tree since there is no parent for the root node.",p)}Object.keys(a).length&&Object.assign(this.legacy_missingNodeRetryMap,a),Ho(t.texts).forEach(d=>{var p;const o=s.getNode(d.id);if(!o)return t.removes.find(i=>i.id===d.id)?void 0:this.warnNodeNotFound(t,d.id);const n=o.parentElement;if(d.value&&n&&n.tagName==="STYLE"?o.textContent=Jt(d.value,this.cache):o.textContent=d.value,this.usingVirtualDom){const i=o.parentNode;((p=i==null?void 0:i.rules)==null?void 0:p.length)>0&&(i.rules=[])}}),t.attributes.forEach(d=>{var p;const o=s.getNode(d.id);if(!o)return t.removes.find(n=>n.id===d.id)?void 0:this.warnNodeNotFound(t,d.id);for(const n in d.attributes)if(typeof n=="string"){const i=d.attributes[n];if(i===null)o.removeAttribute(n),n==="open"&&Wc(o,d);else if(typeof i=="string")try{if(n==="_cssText"&&(o.nodeName==="LINK"||o.nodeName==="STYLE"))try{const l=s.getMeta(o),h=nt(se(L({},l),{attributes:L(L({},l.attributes),d.attributes)}),{doc:o.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(l.attributes,d.attributes);const g=o.nextSibling,b=o.parentNode;if(h&&b){b.removeChild(o),b.insertBefore(h,g),s.replace(d.id,h);break}}catch(l){}if(n==="value"&&o.nodeName==="TEXTAREA"){const l=o;l.childNodes.forEach(g=>l.removeChild(g));const h=(p=o.ownerDocument)==null?void 0:p.createTextNode(i);h&&l.appendChild(h)}else o.setAttribute(n,i);n==="rr_open_mode"&&o.nodeName==="DIALOG"&&Nt(o,d)}catch(l){this.warn("An error occurred may due to the checkout feature.",l)}else if(n==="style"){const l=i,h=o;for(const g in l)if(l[g]===!1)h.style.removeProperty(g);else if(l[g]instanceof Array){const b=l[g];h.style.setProperty(g,b[0],b[1])}else{const b=l[g];h.style.setProperty(g,b)}}}})}applyScroll(t,r){var s,a;const u=this.mirror.getNode(t.id);if(!u)return this.debugNodeNotFound(t,t.id);const c=this.mirror.getMeta(u);if(u===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if((c==null?void 0:c.type)===Re.Document)(a=u.defaultView)==null||a.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{u.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch(f){}}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:a,startOffset:u,end:c,endOffset:f})=>{const m=this.mirror.getNode(a),d=this.mirror.getNode(c);if(!m||!d)return;const p=new Range;p.setStart(m,u),p.setEnd(d,f);const o=m.ownerDocument,n=o==null?void 0:o.getSelection();return n&&r.add(n),{range:p,selection:n}});r.forEach(a=>a.removeAllRanges()),s.forEach(a=>{var u;return a&&((u=a.selection)==null?void 0:u.addRange(a.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,a,u,c;if((s=t.adds)==null||s.forEach(({rule:f,index:m})=>{try{if(Array.isArray(m)){const{positions:d,index:p}=wi(m),o=Ye(r.cssRules,d);o==null||o.insertRule(f,p)}else{const d=m===void 0?void 0:Math.min(m,r.cssRules.length);r==null||r.insertRule(f,d)}}catch(d){}}),(a=t.removes)==null||a.forEach(({index:f})=>{try{if(Array.isArray(f)){const{positions:m,index:d}=wi(f),p=Ye(r.cssRules,m);p==null||p.deleteRule(d||0)}else r==null||r.deleteRule(f)}catch(m){}}),typeof t.replace=="string")try{(u=r.replace)==null||u.call(r,t.replace)}catch(f){}if(typeof t.replaceSync=="string")try{(c=r.replaceSync)==null||c.call(r,t.replaceSync)}catch(f){}}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(f=>{var m;let d=null,p=null;if(ke(s)?p=((m=s.ownerDocument)==null?void 0:m.defaultView)||null:s.nodeName==="#document"&&(p=s.defaultView),!!p)try{d=new p.CSSStyleSheet,this.styleMirror.add(d,f.styleId),this.applyStyleSheetRule({source:_.StyleSheetRule,adds:f.rules},d)}catch(o){}});const a=10;let u=0;const c=(f,m)=>{const d=m.map(p=>this.styleMirror.getStyle(p)).filter(p=>p!==null);ke(f)?f.shadowRoot.adoptedStyleSheets=d:f.nodeName==="#document"&&(f.adoptedStyleSheets=d),d.length!==m.length&&u<a&&(setTimeout(()=>c(f,m),0+100*u),u++)};c(s,t.styleIds)}legacy_resolveMissingNode(t,r,s,a){const{previousId:u,nextId:c}=a,f=u&&t[u],m=c&&t[c];if(f){const{node:d,mutation:p}=f;r.insertBefore(d,s),delete t[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(t,r,d,p)}if(m){const{node:d,mutation:p}=m;r.insertBefore(d,s.nextSibling),delete t[p.node.id],delete this.legacy_missingNodeRetryMap[p.node.id],(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(t,r,d,p)}}moveAndHover(t,r,s,a,u){const c=this.mirror.getNode(s);if(!c)return this.debugNodeNotFound(u,s);const f=Ki(c,this.iframe),m=t*f.absoluteScale+f.x,d=r*f.absoluteScale+f.y;this.mouse.style.left=`${m}px`,this.mouse.style.top=`${d}px`,a||this.drawMouseTail({x:m,y:d}),this.hoverElements(c)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:s,strokeStyle:a,duration:u}=this.config.mouseTail===!0?hi:Object.assign({},hi,this.config.mouseTail),c=()=>{if(!this.mouseTail)return;const f=this.mouseTail.getContext("2d");!f||!this.tailPositions.length||(f.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),f.beginPath(),f.lineWidth=s,f.lineCap=r,f.strokeStyle=a,f.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(m=>f.lineTo(m.x,m.y)),f.stroke())};this.tailPositions.push(t),c(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(f=>f!==t),c()},u/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(a=>{a.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(B.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(eo,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(eo,...t)}}const is="rrweb-embedded",ss=1,zc=["speed","maxSpeed","loadTimeout","skipInactive","inactivePeriodThreshold","showWarning","showDebug","blockClass","liveMode","insertStyleRules","triggerFocus","UNSAFE_replayCanvas","cspContent","pauseAnimation","mouseTail","useVirtualDom","inactiveThreshold","inactiveSkipTime"];function Si(e){const t={};if(e&&typeof e=="object")for(const r of zc){const s=e[r];s!==void 0&&typeof s!="function"&&(t[r]=s)}return t}function Ci(e){return{channel:is,version:ss,message:e}}function ha(e){if(!e||typeof e!="object")return!1;const t=e;return t.channel===is&&t.version===ss&&!!t.message&&typeof t.message=="object"&&typeof t.message.type=="string"}const jc=new Set([B.Resize,B.EventCast,B.CustomEvent]);class fa{constructor(t={}){var r,s,a,u,c;O(this,"root"),O(this,"parentWindow"),O(this,"timeUpdateIntervalMs"),O(this,"expectedParentOrigin"),O(this,"replayer",null),O(this,"playing",!1),O(this,"timer",null),O(this,"started",!1),O(this,"layout",null),O(this,"onMessage",f=>{if(f.source===this.parentWindow&&this.expectedParentOrigin!==null&&f.origin===this.expectedParentOrigin&&ha(f.data))try{this.handle(f.data.message)}catch(m){this.post({type:"error",message:m instanceof Error?m.message:String(m)})}}),this.root=(r=t.root)!=null?r:document.body,this.parentWindow=(s=t.parentWindow)!=null?s:window.parent,this.timeUpdateIntervalMs=(a=t.timeUpdateIntervalMs)!=null?a:50,this.expectedParentOrigin=(c=(u=t.expectedParentOrigin)!=null?u:new URLSearchParams(location.search).get("parentOrigin"))!=null?c:null}start(){this.started||(this.started=!0,this.expectedParentOrigin===null&&console.warn("[rrweb-embedded] no parentOrigin configured; all incoming messages will be ignored"),window.addEventListener("message",this.onMessage),this.post({type:"ready"}))}stop(){var t;window.removeEventListener("message",this.onMessage),this.setPlaying(!1),(t=this.replayer)==null||t.destroy(),this.replayer=null,this.started=!1}handle(t){var d,p,o;var r,s,a,u,c,f,m;switch(t.type){case"ping":this.post({type:"ready"});return;case"init":this.init(t.events,t.config,t.autoplay);return;case"play":(r=this.replayer)==null||r.play((d=t.timeOffset)!=null?d:0),this.setPlaying(!0);return;case"pause":(s=this.replayer)==null||s.pause(t.timeOffset),this.setPlaying(!1),this.postTime();return;case"resume":(a=this.replayer)==null||a.resume((p=t.timeOffset)!=null?p:0),this.setPlaying(!0);return;case"setLayout":this.layout={scale:t.scale,anchor:(o=t.anchor)!=null?o:"center"},this.applyLayout(),this.postDimensions();return;case"setConfig":(u=this.replayer)==null||u.setConfig(Si(t.config));return;case"replaceEvents":this.replayer&&(this.replayer.replaceEvents(t.events),this.postInitialized());return;case"addEvent":(c=this.replayer)==null||c.addEvent(t.event);return;case"enableInteract":(f=this.replayer)==null||f.enableInteract();return;case"disableInteract":(m=this.replayer)==null||m.disableInteract();return;case"destroy":this.stop();return}}init(t,r,s){this.replayer&&(this.setPlaying(!1),this.replayer.destroy());const a=se(L({},Si(r)),{root:this.root});this.replayer=new ca(t,a),this.wireEvents(this.replayer),this.applyLayout(),this.postInitialized(),this.postDimensions(),s&&(this.replayer.play(0),this.setPlaying(!0))}applyLayout(){var t;const r=(t=this.replayer)==null?void 0:t.wrapper;if(!r||!this.layout)return;const{scale:s,anchor:a}=this.layout,u=a==="top";r.style.position="absolute",r.style.transformOrigin="top left",r.style.left="50%",r.style.top=u?"0":"50%",r.style.transform=u?`scale(${s}) translate(-50%, 0)`:`scale(${s}) translate(-50%, -50%)`}postDimensions(){var t;const r=(t=this.replayer)==null?void 0:t.wrapper;if(!r)return;const s=r.getBoundingClientRect();this.post({type:"dimensions",width:s.width,height:s.height,top:s.top,left:s.left})}postInitialized(){this.replayer&&this.post({type:"initialized",metadata:this.replayer.getMetaData(),activityIntervals:this.replayer.getActivityIntervals()})}wireEvents(t){for(const r of Object.values(B))t.on(r,s=>{r===B.Finish&&(this.setPlaying(!1),this.postTime()),r===B.Resize&&this.postDimensions(),this.post(jc.has(r)&&s!==void 0?{type:"replayer-event",event:r,payload:s}:{type:"replayer-event",event:r})})}setPlaying(t){this.playing!==t&&(this.playing=t,t?this.startTimePump():this.stopTimePump())}startTimePump(){this.timer===null&&(this.timer=setInterval(()=>this.postTime(),this.timeUpdateIntervalMs))}postTime(){this.replayer&&this.post({type:"time",currentTime:this.replayer.getCurrentTime()})}stopTimePump(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}post(t){var r;this.parentWindow.postMessage(Ci(t),(r=this.expectedParentOrigin)!=null?r:"*")}}function Vc(e){const t=new fa(e);return t.start(),t}class qc{constructor(t,r={}){var s;O(this,"iframe"),O(this,"hostOrigin"),O(this,"listeners",new Map),O(this,"metadata",null),O(this,"activityIntervals",[]),O(this,"dimensions",null),O(this,"lastCurrentTime",0),O(this,"ready",!1),O(this,"readyResolvers",[]),O(this,"disposed",!1),O(this,"pending",[]),O(this,"onMessage",a=>{a.source===this.iframe.contentWindow&&ha(a.data)&&this.handle(a.data.message)}),this.iframe=t,this.hostOrigin=(s=r.hostOrigin)!=null?s:"*",window.addEventListener("message",this.onMessage),this.probe()}whenReady(){return this.ready?Promise.resolve():new Promise(t=>this.readyResolvers.push(t))}init(t,r,s=!1){this.send({type:"init",events:t,config:r,autoplay:s})}play(t){this.send({type:"play",timeOffset:t})}pause(t){this.send({type:"pause",timeOffset:t})}resume(t){this.send({type:"resume",timeOffset:t})}setConfig(t){this.send({type:"setConfig",config:t})}setLayout(t,r){this.send({type:"setLayout",scale:t,anchor:r})}replaceEvents(t){this.send({type:"replaceEvents",events:t})}addEvent(t){this.send({type:"addEvent",event:t})}enableInteract(){this.send({type:"enableInteract"})}disableInteract(){this.send({type:"disableInteract"})}destroy(){if(!this.disposed){this.disposed=!0;try{this.send({type:"destroy"})}finally{window.removeEventListener("message",this.onMessage),this.listeners.clear()}}}on(t,r){let s=this.listeners.get(t);s||(s=new Set,this.listeners.set(t,s)),s.add(r)}off(t,r){var s;(s=this.listeners.get(t))==null||s.delete(r)}getCurrentTime(){return this.lastCurrentTime}getMetaData(){return this.metadata}getActivityIntervals(){return this.activityIntervals}getDimensions(){return this.dimensions}send(t){if(!this.ready){this.pending.push(t);return}this.postToHost(t)}postToHost(t){const r=this.iframe.contentWindow;r&&r.postMessage(Ci(t),this.hostOrigin)}flushPending(){const t=this.pending;this.pending=[],t.forEach(r=>this.postToHost(r))}probe(){var t;(t=this.iframe.contentWindow)==null||t.postMessage(Ci({type:"ping"}),"*")}handle(t){switch(t.type){case"ready":this.ready=!0,this.flushPending(),this.readyResolvers.forEach(r=>r()),this.readyResolvers=[];return;case"initialized":this.metadata=t.metadata,this.activityIntervals=t.activityIntervals,this.emit("initialized",t.metadata);return;case"replayer-event":this.emit(t.event,t.payload);return;case"time":this.lastCurrentTime=t.currentTime,this.emit("time",t.currentTime);return;case"dimensions":this.dimensions={width:t.width,height:t.height,top:t.top,left:t.left},this.emit("dimensions",this.dimensions);return;case"error":this.emit("error",t.message);return}}emit(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(a=>a(r))}}function Gc(e){try{return new URL(e).origin}catch(t){return"'self'"}}function Hc(e){var u;const t=Gc(e.scriptUrl),r=["'unsafe-inline'",t,...(u=e.extraStyleSources)!=null?u:[]].join(" "),s=["default-src 'none'",`script-src ${t}`,`style-src ${r}`,"img-src * data: blob:","font-src * data:","media-src * data: blob:","frame-src *","connect-src 'none'","worker-src 'none'"].join("; "),a=e.styleUrl?`<link rel="stylesheet" href="${di(e.styleUrl)}">`:"";return`<!DOCTYPE html>
175
+ <html>
176
+ <head>
177
+ <meta charset="utf-8">
178
+ <meta http-equiv="Content-Security-Policy" content="${di(s)}">
179
+ <style>html,body{margin:0;padding:0;height:100%;overflow:hidden;background:transparent}</style>
180
+ ${a}
181
+ <script type="module" src="${di(e.scriptUrl)}"><\/script>
182
+ </head>
183
+ <body></body>
184
+ </html>`}function di(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const{addCustomEvent:Yc}=Ne,{freezePage:Jc}=Ne,{takeFullSnapshot:Xc}=Ne;exports.EmbeddedReplayerClient=qc;exports.EmbeddedReplayerHost=fa;exports.EventType=k;exports.IncrementalSource=_;exports.MouseInteractions=j;exports.RRWEB_EMBEDDED_CHANNEL=is;exports.RRWEB_EMBEDDED_PROTOCOL_VERSION=ss;exports.Replayer=ca;exports.ReplayerEvents=B;exports.addCustomEvent=Yc;exports.buildHostDocument=Hc;exports.canvasMutation=bi;exports.freezePage=Jc;exports.pickSerializableConfig=Si;exports.record=Ne;exports.startEmbeddedReplayerHost=Vc;exports.takeFullSnapshot=Xc;exports.utils=Ju;
185
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
86
186
  var __cp = (to, from, except, desc) => {
87
187
  if ((from && typeof from === "object") || typeof from === "function") {
88
188
  for (let key of Object.getOwnPropertyNames(from)) {