@posthog/rrweb
Version:
record and replay the web
39 lines (38 loc) • 268 kB
JavaScript
(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();
}
}(this, () => {
var exports = {};
var module = { exports };
"use strict";var qo=Object.defineProperty,Vo=Object.defineProperties;var jo=Object.getOwnPropertyDescriptors;var ht=Object.getOwnPropertySymbols;var js=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable;var Vs=(e,t,r)=>t in e?qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L=(e,t)=>{for(var r in t||(t={}))js.call(t,r)&&Vs(e,r,t[r]);if(ht)for(var r of ht(t))Gs.call(t,r)&&Vs(e,r,t[r]);return e},se=(e,t)=>Vo(e,jo(t));var Ue=(e,t)=>{var r={};for(var s in e)js.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&ht)for(var s of ht(e))t.indexOf(s)<0&&Gs.call(e,s)&&(r[s]=e[s]);return r};var Go=Object.defineProperty,Ho=(e,t,r)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,M=(e,t,r)=>Ho(e,typeof t!="symbol"?t+"":t,r),Hs;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Yo=Object.defineProperty,Jo=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ys=(e,t,r)=>Jo(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 Js={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ft={};function Xo(e){var t,r;const s=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(s&&globalThis[s])return globalThis[s]}function as(e){if(ft[e])return ft[e];const t=Xo(e)||globalThis[e],r=t.prototype,s=e in Js?Js[e]:void 0,i=!!(s&&s.every(l=>{var u,c;return!!((c=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&c.toString().includes("[native code]"))})),a=e in Xs?Xs[e]:void 0,o=!!(a&&a.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(i&&o)return ft[e]=t.prototype,t.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const u=l.contentWindow;if(!u)return t.prototype;const c=u[e].prototype;return document.body.removeChild(l),c?ft[e]=c:r}catch(l){return r}}const jt={};function De(e,t,r){var s;const i=`${e}.${String(r)}`;if(jt[i])return jt[i].call(t);const a=as(e),o=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return o?(jt[i]=o,o.call(t)):t[r]}const Gt={};function Fn(e,t,r){const s=`${e}.${String(r)}`;if(Gt[s])return Gt[s].bind(t);const a=as(e)[r];return typeof a!="function"?t[r]:(Gt[s]=a,a.bind(t))}function Qo(e){return De("Node",e,"childNodes")}function Ko(e){return De("Node",e,"parentNode")}function Zo(e){return De("Node",e,"parentElement")}function ea(e){return De("Node",e,"textContent")}function ta(e,t){return Fn("Node",e,"contains")(t)}function ra(e){return Fn("Node",e,"getRootNode")()}function sa(e){return!e||!("host"in e)?null:De("ShadowRoot",e,"host")}function ia(e){return e.styleSheets}function na(e){return!e||!("shadowRoot"in e)?null:De("Element",e,"shadowRoot")}function oa(e,t){return De("Element",e,"querySelector")(t)}function aa(e,t){return De("Element",e,"querySelectorAll")(t)}function la(){return as("MutationObserver").constructor}function ua(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],i=r(s);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=i,()=>{e[t]=s}}catch(s){return()=>{}}}const ne={childNodes:Qo,parentNode:Ko,parentElement:Zo,textContent:ea,contains:ta,getRootNode:ra,host:sa,styleSheets:ia,shadowRoot:na,querySelector:oa,querySelectorAll:aa,mutationObserver:la,patch:ua};function ls(e){return e.nodeType===e.ELEMENT_NODE}function Ze(e){const t=e&&"host"in e&&"mode"in e&&ne.host(e)||null;return!!(t&&"shadowRoot"in t&&ne.shadowRoot(t)===e)}function et(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ca(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 ha(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 xt(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.baseURI);const s=Array.from(t,i=>Un(i,r)).join("");return ca(s)}catch(t){return null}}function Un(e,t){var r;if(da(e)){let s;try{s=xt(e.styleSheet)||ha(e)}catch(i){s=e.cssText}try{if(s&&((r=e.styleSheet)!=null&&r.href))return Mt(s,e.styleSheet.href)}catch(i){}return s}else{let s=e.cssText;return pa(e)&&e.selectorText.includes(":")&&(s=fa(s)),t?Mt(s,t):s}}function fa(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function da(e){return"styleSheet"in e}function pa(e){return"selectorText"in e}class us{constructor(){Ys(this,"idNodeMap",new Map),Ys(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 i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Bn(){return new us}function cs({element:e,maskInputOptions:t,tagName:r,type:s,value:i,maskInputFn:a}){let o=i||"";const l=s&&Ie(s);return(t[r.toLowerCase()]||l&&t[l])&&(a?o=a(o,e):o="*".repeat(o.length)),o}function Ie(e){return e.toLowerCase()}const Qs="__rrweb_original__";function ma(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let s=0;s<e.width;s+=r)for(let i=0;i<e.height;i+=r){const a=t.getImageData,o=Qs in a?a[Qs]:a;if(new Uint32Array(o.call(t,s,i,Math.min(r,e.width-s),Math.min(r,e.height-i)).data.buffer).some(u=>u!==0))return!1}return!0}function ga(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 hs(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ie(t):null}function fs(e,t){var a;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(o){return null}const s=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(s);return(a=i==null?void 0:i[1])!=null?a:null}function ya(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const wa=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ba=/^(?:[a-z+]+:)?\/\//i,va=/^www\..*/i,Sa=/^(data:)([^,]*),(.*)/i;function Mt(e,t){return(e||"").replace(wa,(r,s,i,a,o,l)=>{const u=i||o||l,c=s||a||"";if(!u)return r;if(ba.test(u)||va.test(u))return`url(${c}${u}${c})`;if(Sa.test(u))return`url(${c}${u}${c})`;if(u[0]==="/")return`url(${c}${ya(t)+u}${c})`;const n=t.split("/"),h=u.split("/");n.pop();for(const d of h)d!=="."&&(d===".."?n.pop():n.push(d));return`url(${c}${n.join("/")}${c})`})}let Ca=1;const Ea=new RegExp("[^a-z0-9-_:]"),st=-2;function $n(){return Ca++}function Ra(e){if(e instanceof HTMLFormElement)return"form";const t=Ie(e.tagName);return Ea.test(t)?"div":t}let Be,Ks;const xa=/^[^ \t\n\r\u000c]+/,Ma=/^[, \t\n\r\u000c]+/;function Na(e,t){if(t.trim()==="")return t;let r=0;function s(a){let o;const l=a.exec(t.substring(r));return l?(o=l[0],r+=o.length,o):""}const i=[];for(;s(Ma),!(r>=t.length);){let a=s(xa);if(a.slice(-1)===",")a=qe(e,a.substring(0,a.length-1)),i.push(a);else{let o="";a=qe(e,a);let l=!1;for(;;){const u=t.charAt(r);if(u===""){i.push((a+o).trim());break}else if(l)u===")"&&(l=!1);else if(u===","){r+=1,i.push((a+o).trim());break}else u==="("&&(l=!0);o+=u,r+=1}}}return i.join(", ")}const Zs=new WeakMap;function qe(e,t){return!t||t.trim()===""?t:ds(e,t)}function Oa(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ds(e,t){let r=Zs.get(e);if(r||(r=e.createElement("a"),Zs.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Wn(e,t,r,s){return s&&(r==="src"||r==="href"&&!(t==="use"&&s[0]==="#")||r==="xlink:href"&&s[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?qe(e,s):r==="srcset"?Na(e,s):r==="style"?Mt(s,ds(e)):t==="object"&&r==="data"?qe(e,s):s)}function zn(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function Ia(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(r)return e.matches(r)}catch(s){}return!1}function Nt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Nt(ne.parentNode(e),t,r):!1;for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}return r?Nt(ne.parentNode(e),t,r):!1}function qn(e,t,r,s){let i;if(ls(e)){if(i=e,!ne.childNodes(i).length)return!1}else{if(ne.parentElement(e)===null)return!1;i=ne.parentElement(e)}try{if(typeof t=="string"){if(s){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Nt(i,t,s))return!0;if(r){if(s){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(a){}return!1}function Da(e,t,r){const s=e.contentWindow;if(!s)return;let i=!1,a;try{a=s.document.readyState}catch(l){return}if(a!=="complete"){const l=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),i=!0,t()});return}const o="about:blank";if(s.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Aa(e,t,r){let s=!1,i;try{i=e.sheet}catch(o){return}if(i)return;const a=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),s=!0,t()})}function Ta(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:a,needsMask:o,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:n,dataURLOptions:h={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p=!1}=t,g=_a(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:g};case e.ELEMENT_NODE:return La(e,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:l,maskInputOptions:u,maskInputFn:n,dataURLOptions:h,inlineImages:d,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p,rootId:g});case e.TEXT_NODE:return Pa(e,{doc:r,needsMask:o,maskTextFn:c,rootId:g});case e.CDATA_SECTION_NODE:return{type:U.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:U.Comment,textContent:ne.textContent(e)||"",rootId:g};default:return!1}}function _a(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Pa(e,t){var r;const{needsMask:s,maskTextFn:i,rootId:a}=t,o=ne.parentNode(e),l=o&&o.tagName;let u=ne.textContent(e);const c=l==="STYLE"?!0:void 0,n=l==="SCRIPT"?!0:void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(r=o.sheet)!=null&&r.cssRules&&(u=xt(o.sheet))}catch(h){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${h}`,e)}u=Mt(u,ds(t.doc))}return n&&(u="SCRIPT_PLACEHOLDER"),!c&&!n&&u&&s&&(u=i?i(u,ne.parentElement(e)):u.replace(/[\S]/g,"*")),{type:U.Text,textContent:u||"",isStyle:c,rootId:a}}function ei(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function ka(e){return e.href}function La(e,t){const{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:o={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:n,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:f}=t,m=Ia(e,s,i),p=Ra(e);let g={};const b=e.attributes.length;for(let w=0;w<b;w++){const C=e.attributes[w];zn(p,C.name,C.value)||(g[C.name]=Wn(r,p,Ie(C.name),C.value))}if(p==="link"&&a){const w=ka(e);if(w){let C=ei(r,w);if(!C&&w.includes(".css")){const S=window.location.origin,E=w.replace(window.location.href,""),R=S+"/"+E;C=ei(r,R)}let v=null;C&&(v=xt(C)),v&&(delete g.rel,delete g.href,g._cssText=v)}}if(p==="style"&&e.sheet&&!(e.innerText||ne.textContent(e)||"").trim().length){const w=xt(e.sheet);w&&(g._cssText=w)}if(p==="input"||p==="textarea"||p==="select"){const w=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&w?g.value=cs({element:e,type:hs(e),tagName:p,value:w,maskInputOptions:o,maskInputFn:l}):C&&(g.checked=C)}if(p==="option"&&(e.selected&&!o.select?g.selected=!0:delete g.selected),p==="dialog"&&e.open)try{g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(w){g.rr_open_mode="modal",g.ph_rr_could_not_detect_modal=!0}if(p==="canvas"&&n){if(e.__context==="2d")ma(e)||(g.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const w=e.toDataURL(u.type,u.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;const v=C.toDataURL(u.type,u.quality);w!==v&&(g.rr_dataURL=w)}}if(p==="img"&&c){Be||(Be=r.createElement("canvas"),Ks=Be.getContext("2d"));const w=e,C=w.currentSrc||w.getAttribute("src")||"<unknown-src>",v=w.crossOrigin,S=()=>{w.removeEventListener("load",S);try{Be.width=w.naturalWidth,Be.height=w.naturalHeight,Ks.drawImage(w,0,0),g.rr_dataURL=Be.toDataURL(u.type,u.quality)}catch(E){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?S():w.addEventListener("load",S);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}w.crossOrigin==="anonymous"&&(v?g.crossOrigin=v:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?S():w.addEventListener("load",S)}if(p==="audio"||p==="video"){const w=g;w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime,w.rr_mediaPlaybackRate=e.playbackRate,w.rr_mediaMuted=e.muted,w.rr_mediaLoop=e.loop,w.rr_mediaVolume=e.volume}if(d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){const{width:w,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${w}px`,rr_height:`${C}px`}}p==="iframe"&&!h(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let y;try{customElements.get(p)&&(y=!0)}catch(w){}return{type:U.Element,tagName:p,attributes:g,childNodes:[],isSVG:Oa(e)||void 0,needBlock:m,rootId:f,isCustom:y}}function H(e){return e==null?"":e.toLowerCase()}function Fa(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"&&fs(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(H(e.attributes.name).match(/^msapplication-tile(image|color)$/)||H(e.attributes.name)==="application-name"||H(e.attributes.rel)==="icon"||H(e.attributes.rel)==="apple-touch-icon"||H(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&H(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(H(e.attributes.property).match(/^(og|twitter|fb):/)||H(e.attributes.name).match(/^(og|twitter):/)||H(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(H(e.attributes.name)==="robots"||H(e.attributes.name)==="googlebot"||H(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(H(e.attributes.name)==="author"||H(e.attributes.name)==="generator"||H(e.attributes.name)==="framework"||H(e.attributes.name)==="publisher"||H(e.attributes.name)==="progid"||H(e.attributes.property).match(/^article:/)||H(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(H(e.attributes.name)==="google-site-verification"||H(e.attributes.name)==="yandex-verification"||H(e.attributes.name)==="csrf-token"||H(e.attributes.name)==="p:domain_verify"||H(e.attributes.name)==="verify-v1"||H(e.attributes.name)==="verification"||H(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ve(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:n={},maskTextFn:h,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:g=!1,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:E=!1}=t;let{needsMask:R}=t,{preserveWhiteSpace:I=!0}=t;R||(R=qn(e,o,l,R===void 0));const N=Ta(e,{doc:r,mirror:s,blockClass:i,blockSelector:a,needsMask:R,inlineStylesheet:c,maskInputOptions:n,maskTextFn:h,maskInputFn:d,dataURLOptions:m,inlineImages:p,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:E});if(!N)return console.warn(e,"not serialized"),null;let F;s.hasNode(e)?F=s.getId(e):Fa(N,f)||!I&&N.type===U.Text&&!N.isStyle&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?F=st:F=$n();const D=Object.assign(N,{id:F});if(s.add(e,D),F===st)return null;b&&b(e);let re=!u;if(D.type===U.Element){re=re&&!D.needBlock,delete D.needBlock;const x=ne.shadowRoot(e);x&&et(x)&&(D.isShadowHost=!0)}if((D.type===U.Document||D.type===U.Element)&&re){f.headWhitespace&&D.type===U.Element&&D.tagName==="head"&&(I=!1);const x={doc:r,mirror:s,blockClass:i,blockSelector:a,needsMask:R,maskTextClass:o,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:n,maskTextFn:h,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:I,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S};if(!(D.type===U.Element&&D.tagName==="textarea"&&D.attributes.value!==void 0))for(const P of Array.from(ne.childNodes(e))){const V=Ve(P,x);V&&D.childNodes.push(V)}let Z=null;if(ls(e)&&(Z=ne.shadowRoot(e)))for(const P of Array.from(ne.childNodes(Z))){const V=Ve(P,x);V&&(et(Z)&&(V.isShadow=!0),D.childNodes.push(V))}}const ie=ne.parentNode(e);return ie&&Ze(ie)&&et(ie)&&(D.isShadow=!0),D.type===U.Element&&D.tagName==="iframe"&&Da(e,()=>{const x=e.contentDocument;if(x&&y){const Z=Ve(x,{doc:x,mirror:s,blockClass:i,blockSelector:a,needsMask:R,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:h,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:I,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S});Z&&y(e,Z)}},w),D.type===U.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&fs(D.attributes.href)==="css")&&Aa(e,()=>{if(C){const x=Ve(e,{doc:r,mirror:s,blockClass:i,blockSelector:a,needsMask:R,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:h,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:I,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S});x&&C(e,x)}},v),D}function Ua(e,t){const{mirror:r=new us,blockClass:s="rr-block",blockSelector:i=null,maskTextClass:a="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:u=!1,recordCanvas:c=!1,maskAllInputs:n=!1,maskTextFn:h,maskInputFn:d,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:v=()=>!1}=t||{};return Ve(e,{doc:e,mirror:r,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions: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}:n===!1?{password:!0}:n,maskTextFn:h,maskInputFn:d,slimDOMOptions:f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:f==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:f===!1?{}:f,dataURLOptions:m,inlineImages:u,recordCanvas:c,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:v,newlyAddedElement:!1})}const Ba=/(max|min)-device-(width|height)/,ti=new RegExp(Ba.source,"g"),$a={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ti)&&(e.params=e.params.replace(ti,"$1-$2"))}}}},Wa={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+=`,
`+r.replace(/:hover/g,".\\:hover"))}))}}}};function Vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function za(e){if(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),r}var dt={exports:{}},ri;function qa(){if(ri)return dt.exports;ri=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 dt.exports=t(),dt.exports.createColors=t,dt.exports}const Va={},ja=Object.freeze(Object.defineProperty({__proto__:null,default:Va},Symbol.toStringTag,{value:"Module"})),de=za(ja);var Ht,si;function ps(){if(si)return Ht;si=1;let e=qa(),t=de;class r extends Error{constructor(i,a,o,l,u,c){super(i),this.name="CssSyntaxError",this.reason=i,u&&(this.file=u),l&&(this.source=l),c&&(this.plugin=c),typeof a!="undefined"&&typeof o!="undefined"&&(typeof a=="number"?(this.line=a,this.column=o):(this.line=a.line,this.column=a.column,this.endLine=o.line,this.endColumn=o.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(i){if(!this.source)return"";let a=this.source;i==null&&(i=e.isColorSupported);let o=f=>f,l=f=>f,u=f=>f;if(i){let{bold:f,gray:m,red:p}=e.createColors(!0);l=g=>f(p(g)),o=g=>m(g),t&&(u=g=>t(g))}let c=a.split(/\r?\n/),n=Math.max(this.line-3,0),h=Math.min(this.line+2,c.length),d=String(h).length;return c.slice(n,h).map((f,m)=>{let p=n+1+m,g=" "+(" "+p).slice(-d)+" | ";if(p===this.line){if(f.length>160){let y=20,w=Math.max(0,this.column-y),C=Math.max(this.column+y,this.endColumn+y),v=f.slice(w,C),S=o(g.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return l(">")+o(g)+u(v)+`
`+S+l("^")}let b=o(g.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+o(g)+u(f)+`
`+b+l("^")}return" "+o(g)+u(f)}).join(`
`)}toString(){let i=this.showSourceCode();return i&&(i=`
`+i+`
`),this.name+": "+this.message+i}}return Ht=r,r.default=r,Ht}var Yt,ii;function jn(){if(ii)return Yt;ii=1;const e={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(s){return s[0].toUpperCase()+s.slice(1)}class r{constructor(i){this.builder=i}atrule(i,a){let o="@"+i.name,l=i.params?this.rawValue(i,"params"):"";if(typeof i.raws.afterName!="undefined"?o+=i.raws.afterName:l&&(o+=" "),i.nodes)this.block(i,o+l);else{let u=(i.raws.between||"")+(a?";":"");this.builder(o+l+u,i)}}beforeAfter(i,a){let o;i.type==="decl"?o=this.raw(i,null,"beforeDecl"):i.type==="comment"?o=this.raw(i,null,"beforeComment"):a==="before"?o=this.raw(i,null,"beforeRule"):o=this.raw(i,null,"beforeClose");let l=i.parent,u=0;for(;l&&l.type!=="root";)u+=1,l=l.parent;if(o.includes(`
`)){let c=this.raw(i,null,"indent");if(c.length)for(let n=0;n<u;n++)o+=c}return o}block(i,a){let o=this.raw(i,"between","beforeOpen");this.builder(a+o+"{",i,"start");let l;i.nodes&&i.nodes.length?(this.body(i),l=this.raw(i,"after")):l=this.raw(i,"after","emptyBody"),l&&this.builder(l),this.builder("}",i,"end")}body(i){let a=i.nodes.length-1;for(;a>0&&i.nodes[a].type==="comment";)a-=1;let o=this.raw(i,"semicolon");for(let l=0;l<i.nodes.length;l++){let u=i.nodes[l],c=this.raw(u,"before");c&&this.builder(c),this.stringify(u,a!==l||o)}}comment(i){let a=this.raw(i,"left","commentLeft"),o=this.raw(i,"right","commentRight");this.builder("/*"+a+i.text+o+"*/",i)}decl(i,a){let o=this.raw(i,"between","colon"),l=i.prop+o+this.rawValue(i,"value");i.important&&(l+=i.raws.important||" !important"),a&&(l+=";"),this.builder(l,i)}document(i){this.body(i)}raw(i,a,o){let l;if(o||(o=a),a&&(l=i.raws[a],typeof l!="undefined"))return l;let u=i.parent;if(o==="before"&&(!u||u.type==="root"&&u.first===i||u&&u.type==="document"))return"";if(!u)return e[o];let c=i.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[o]!="undefined")return c.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(i,o);{let n="raw"+t(o);this[n]?l=this[n](c,i):c.walk(h=>{if(l=h.raws[a],typeof l!="undefined")return!1})}return typeof l=="undefined"&&(l=e[o]),c.rawCache[o]=l,l}rawBeforeClose(i){let a;return i.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after!="undefined")return a=o.raws.after,a.includes(`
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawBeforeComment(i,a){let o;return i.walkComments(l=>{if(typeof l.raws.before!="undefined")return o=l.raws.before,o.includes(`
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeDecl(i,a){let o;return i.walkDecls(l=>{if(typeof l.raws.before!="undefined")return o=l.raws.before,o.includes(`
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeOpen(i){let a;return i.walk(o=>{if(o.type!=="decl"&&(a=o.raws.between,typeof a!="undefined"))return!1}),a}rawBeforeRule(i){let a;return i.walk(o=>{if(o.nodes&&(o.parent!==i||i.first!==o)&&typeof o.raws.before!="undefined")return a=o.raws.before,a.includes(`
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawColon(i){let a;return i.walkDecls(o=>{if(typeof o.raws.between!="undefined")return a=o.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(i){let a;return i.walk(o=>{if(o.nodes&&o.nodes.length===0&&(a=o.raws.after,typeof a!="undefined"))return!1}),a}rawIndent(i){if(i.raws.indent)return i.raws.indent;let a;return i.walk(o=>{let l=o.parent;if(l&&l!==i&&l.parent&&l.parent===i&&typeof o.raws.before!="undefined"){let u=o.raws.before.split(`
`);return a=u[u.length-1],a=a.replace(/\S/g,""),!1}}),a}rawSemicolon(i){let a;return i.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(a=o.raws.semicolon,typeof a!="undefined"))return!1}),a}rawValue(i,a){let o=i[a],l=i.raws[a];return l&&l.value===o?l.raw:o}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,a){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,a)}}return Yt=r,r.default=r,Yt}var Jt,ni;function Pt(){if(ni)return Jt;ni=1;let e=jn();function t(r,s){new e(s).stringify(r)}return Jt=t,t.default=t,Jt}var pt={},oi;function ms(){return oi||(oi=1,pt.isClean=Symbol("isClean"),pt.my=Symbol("my")),pt}var Xt,ai;function kt(){if(ai)return Xt;ai=1;let e=ps(),t=jn(),r=Pt(),{isClean:s,my:i}=ms();function a(u,c){let n=new u.constructor;for(let h in u){if(!Object.prototype.hasOwnProperty.call(u,h)||h==="proxyCache")continue;let d=u[h],f=typeof d;h==="parent"&&f==="object"?c&&(n[h]=c):h==="source"?n[h]=d:Array.isArray(d)?n[h]=d.map(m=>a(m,n)):(f==="object"&&d!==null&&(d=a(d)),n[h]=d)}return n}function o(u,c){if(c&&typeof c.offset!="undefined")return c.offset;let n=1,h=1,d=0;for(let f=0;f<u.length;f++){if(h===c.line&&n===c.column){d=f;break}u[f]===`
`?(n=1,h+=1):n+=1}return d}class l{constructor(c={}){this.raws={},this[s]=!1,this[i]=!0;for(let n in c)if(n==="nodes"){this.nodes=[];for(let h of c[n])typeof h.clone=="function"?this.append(h.clone()):this.append(h)}else this[n]=c[n]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\n\s{4}at /.test(c.stack)){let n=this.source;c.stack=c.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let n in c)this[n]=c[n];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let n=a(this);for(let h in c)n[h]=c[h];return n}cloneAfter(c={}){let n=this.clone(c);return this.parent.insertAfter(this,n),n}cloneBefore(c={}){let n=this.clone(c);return this.parent.insertBefore(this,n),n}error(c,n={}){if(this.source){let{end:h,start:d}=this.rangeBy(n);return this.source.input.error(c,{column:d.column,line:d.line},{column:h.column,line:h.line},n)}return new e(c)}getProxyProcessor(){return{get(c,n){return n==="proxyOf"?c:n==="root"?()=>c.root().toProxy():c[n]},set(c,n,h){return c[n]===h||(c[n]=h,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&c.markDirty()),!0}}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let c=this;for(;c=c.parent;)c[s]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c){let n=this.source.start;if(c.index)n=this.positionInside(c.index);else if(c.word){let h="document"in this.source.input?this.source.input.document:this.source.input.css,f=h.slice(o(h,this.source.start),o(h,this.source.end)).indexOf(c.word);f!==-1&&(n=this.positionInside(f))}return n}positionInside(c){let n=this.source.start.column,h=this.source.start.line,d="document"in this.source.input?this.source.input.document:this.source.input.css,f=o(d,this.source.start),m=f+c;for(let p=f;p<m;p++)d[p]===`
`?(n=1,h+=1):n+=1;return{column:n,line:h}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c){let n={column:this.source.start.column,line:this.source.start.line},h=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(c.word){let d="document"in this.source.input?this.source.input.document:this.source.input.css,m=d.slice(o(d,this.source.start),o(d,this.source.end)).indexOf(c.word);m!==-1&&(n=this.positionInside(m),h=this.positionInside(m+c.word.length))}else c.start?n={column:c.start.column,line:c.start.line}:c.index&&(n=this.positionInside(c.index)),c.end?h={column:c.end.column,line:c.end.line}:typeof c.endIndex=="number"?h=this.positionInside(c.endIndex):c.index&&(h=this.positionInside(c.index+1));return(h.line<n.line||h.line===n.line&&h.column<=n.column)&&(h={column:n.column+1,line:n.line}),{end:h,start:n}}raw(c,n){return new t().raw(this,c,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let n=this,h=!1;for(let d of c)d===this?h=!0:h?(this.parent.insertAfter(n,d),n=d):this.parent.insertBefore(n,d);h||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,n){let h={},d=n==null;n=n||new Map;let f=0;for(let m in this){if(!Object.prototype.hasOwnProperty.call(this,m)||m==="parent"||m==="proxyCache")continue;let p=this[m];if(Array.isArray(p))h[m]=p.map(g=>typeof g=="object"&&g.toJSON?g.toJSON(null,n):g);else if(typeof p=="object"&&p.toJSON)h[m]=p.toJSON(null,n);else if(m==="source"){let g=n.get(p.input);g==null&&(g=f,n.set(p.input,f),f++),h[m]={end:p.end,inputId:g,start:p.start}}else h[m]=p}return d&&(h.inputs=[...n.keys()].map(m=>m.toJSON())),h}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=r){c.stringify&&(c=c.stringify);let n="";return c(this,h=>{n+=h}),n}warn(c,n,h){let d={node:this};for(let f in h)d[f]=h[f];return c.warn(n,d)}get proxyOf(){return this}}return Xt=l,l.default=l,Xt}var Qt,li;function nt(){if(li)return Qt;li=1;let e=kt();class t extends e{constructor(s){super(s),this.type="comment"}}return Qt=t,t.default=t,Qt}var Kt,ui;function Lt(){if(ui)return Kt;ui=1;let e=kt();class t extends e{constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(L({},s),{value:String(s.value)})),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Kt=t,t.default=t,Kt}var Zt,ci;function ke(){if(ci)return Zt;ci=1;let e=nt(),t=Lt(),r=kt(),{isClean:s,my:i}=ms(),a,o,l,u;function c(d){return d.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(d){if(d[s]=!1,d.proxyOf.nodes)for(let f of d.proxyOf.nodes)n(f)}class h extends r{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(b,y)=>g(b.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...b)=>p(g.toProxy(),...b)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let b;for(let y in this.indexes)b=this.indexes[y],p<b&&(this.indexes[y]=b+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of b)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+b.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(o(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new t(f)]}else if(f.selector||f.selectors)f=[new u(f)];else if(f.name)f=[new a(f)];else if(f.text)f=[new e(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[i]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[s]&&n(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(b){throw m.addToError(b)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,g)}))}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]}}return h.registerParse=d=>{o=d},h.registerRule=d=>{u=d},h.registerAtRule=d=>{a=d},h.registerRoot=d=>{l=d},Zt=h,h.default=h,h.rebuild=d=>{d.type==="atrule"?Object.setPrototypeOf(d,a.prototype):d.type==="rule"?Object.setPrototypeOf(d,u.prototype):d.type==="decl"?Object.setPrototypeOf(d,t.prototype):d.type==="comment"?Object.setPrototypeOf(d,e.prototype):d.type==="root"&&Object.setPrototypeOf(d,l.prototype),d[i]=!0,d.nodes&&d.nodes.forEach(f=>{h.rebuild(f)})},Zt}var er,hi;function gs(){if(hi)return er;hi=1;let e=ke();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 er=t,t.default=t,e.registerAtRule(t),er}var tr,fi;function ys(){if(fi)return tr;fi=1;let e=ke(),t,r;class s extends e{constructor(a){super(L({type:"document"},a)),this.nodes||(this.nodes=[])}toResult(a={}){return new t(new r,this,a).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},tr=s,s.default=s,tr}var rr,di;function Ga(){if(di)return rr;di=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return rr={nanoid:(s=21)=>{let i="",a=s|0;for(;a--;)i+=e[Math.random()*64|0];return i},customAlphabet:(s,i=21)=>(a=i)=>{let o="",l=a|0;for(;l--;)o+=s[Math.random()*s.length|0];return o}},rr}var sr,pi;function Gn(){if(pi)return sr;pi=1;let{existsSync:e,readFileSync:t}=de,{dirname:r,join:s}=de,{SourceMapConsumer:i,SourceMapGenerator:a}=de;function o(u){return Buffer?Buffer.from(u,"base64").toString():window.atob(u)}class l{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let h=n.map?n.map.prev:void 0,d=this.loadMap(n.from,h);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=r(this.mapFile)),d&&(this.text=d)}consumer(){return this.consumerCache||(this.consumerCache=new i(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,h=/^data:application\/json;base64,/,d=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/,m=c.match(d)||c.match(f);if(m)return decodeURIComponent(c.substr(m[0].length));let p=c.match(n)||c.match(h);if(p)return o(c.substr(p[0].length));let g=c.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+g)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let n=c.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let h=c.lastIndexOf(n.pop()),d=c.indexOf("*/",h);h>-1&&d>-1&&(this.annotation=this.getAnnotationURL(c.substring(h,d)))}loadFile(c){if(this.root=r(c),e(c))return this.mapFile=c,t(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let h=n(c);if(h){let d=this.loadFile(h);if(!d)throw new Error("Unable to load previous source map: "+h.toString());return d}}else{if(n instanceof i)return a.fromSourceMap(n).toString();if(n instanceof a)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return c&&(h=s(r(c),h)),this.loadFile(h)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return sr=l,l.default=l,sr}var ir,mi;function Ft(){if(mi)return ir;mi=1;let{nanoid:e}=Ga(),{isAbsolute:t,resolve:r}=de,{SourceMapConsumer:s,SourceMapGenerator:i}=de,{fileURLToPath:a,pathToFileURL:o}=de,l=ps(),u=Gn(),c=de,n=Symbol("fromOffsetCache"),h=!!(s&&i),d=!!(r&&t);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.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,g.document&&(this.document=g.document.toString()),g.from&&(!d||/^\w+:\/\//.test(g.from)||t(g.from)?this.file=g.from:this.file=r(g.from)),d&&h){let b=new u(this.css,g);if(b.text){this.map=b;let y=b.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,b,y={}){let w,C,v;if(g&&typeof g=="object"){let E=g,R=b;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,b=I.col}else g=E.line,b=E.column;if(typeof R.offset=="number"){let I=this.fromOffset(R.offset);C=I.line,w=I.col}else C=R.line,w=R.column}else if(!b){let E=this.fromOffset(g);g=E.line,b=E.col}let S=this.origin(g,b,C,w);return S?v=new l(p,S.endLine===void 0?S.line:{column:S.column,line:S.line},S.endLine===void 0?S.column:{column:S.endColumn,line:S.endLine},S.source,S.file,y.plugin):v=new l(p,C===void 0?g:{column:b,line:g},C===void 0?b:{column:w,line:C},this.css,this.file,y.plugin),v.input={column:b,endColumn:w,endLine:C,line:g,source:this.css},this.file&&(o&&(v.input.url=o(this.file).toString()),v.input.file=this.file),v}fromOffset(p){let g,b;if(this[n])b=this[n];else{let w=this.css.split(`
`);b=new Array(w.length);let C=0;for(let v=0,S=w.length;v<S;v++)b[v]=C,C+=w[v].length+1;this[n]=b}g=b[b.length-1];let y=0;if(p>=g)y=b.length-1;else{let w=b.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<b[C])w=C-1;else if(p>=b[C+1])y=C+1;else{y=C;break}}return{col:p-b[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:r(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,b,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let v;typeof b=="number"&&(v=w.originalPositionFor({column:y,line:b}));let S;t(C.source)?S=o(C.source):S=new URL(C.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let E={column:C.column,endColumn:v&&v.column,endLine:v&&v.line,line:C.line,url:S.toString()};if(S.protocol==="file:")if(a)E.file=a(S);else throw new Error("file: protocol is not available in this PostCSS build");let R=w.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=L({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return ir=f,f.default=f,c&&c.registerInput&&c.registerInput(f),ir}var nr,gi;function ot(){if(gi)return nr;gi=1;let e=ke(),t,r;class s extends e{constructor(a){super(a),this.type="root",this.nodes||(this.nodes=[])}normalize(a,o,l){let u=super.normalize(a);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let c of u)c.raws.before=o.raws.before}return u}removeChild(a,o){let l=this.index(a);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(a)}toResult(a={}){return new t(new r,this,a).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},nr=s,s.default=s,e.registerRoot(s),nr}var or,yi;function Hn(){if(yi)return or;yi=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
`," "];return e.split(t,r)},split(t,r,s){let i=[],a="",o=!1,l=0,u=!1,c="",n=!1;for(let h of t)n?n=!1:h==="\\"?n=!0:u?h===c&&(u=!1):h==='"'||h==="'"?(u=!0,c=h):h==="("?l+=1:h===")"?l>0&&(l-=1):l===0&&r.includes(h)&&(o=!0),o?(a!==""&&i.push(a.trim()),a="",o=!1):a+=h;return(s||a!=="")&&i.push(a.trim()),i}};return or=e,e.default=e,or}var ar,wi;function ws(){if(wi)return ar;wi=1;let e=ke(),t=Hn();class r extends e{constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(i){let a=this.selector?this.selector.match(/,\s*/):null,o=a?a[0]:","+this.raw("between","beforeOpen");this.selector=i.join(o)}}return ar=r,r.default=r,e.registerRule(r),ar}var lr,bi;function Ha(){if(bi)return lr;bi=1;let e=gs(),t=nt(),r=Lt(),s=Ft(),i=Gn(),a=ot(),o=ws();function l(u,c){if(Array.isArray(u))return u.map(m=>l(m));let d=u,{inputs:n}=d,h=Ue(d,["inputs"]);if(n){c=[];for(let m of n){let p=se(L({},m),{__proto__:s.prototype});p.map&&(p.map=se(L({},p.map),{__proto__:i.prototype})),c.push(p)}}if(h.nodes&&(h.nodes=u.nodes.map(m=>l(m,c))),h.source){let f=h.source,{inputId:m}=f,p=Ue(f,["inputId"]);h.source=p,m!=null&&(h.source.input=c[m])}if(h.type==="root")return new a(h);if(h.type==="decl")return new r(h);if(h.type==="rule")return new o(h);if(h.type==="comment")return new t(h);if(h.type==="atrule")return new e(h);throw new Error("Unknown node type: "+u.type)}return lr=l,l.default=l,lr}var ur,vi;function Yn(){if(vi)return ur;vi=1;let{dirname:e,relative:t,resolve:r,sep:s}=de,{SourceMapConsumer:i,SourceMapGenerator:a}=de,{pathToFileURL:o}=de,l=Ft(),u=!!(i&&a),c=!!(e&&r&&t&&s);class n{constructor(d,f,m,p){this.stringify=d,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let d;this.isInline()?d="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?d=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?d=this.mapOpts.annotation(this.opts.to,this.root):d=this.outputFile()+".map";let f=`
`;this.css.includes(`\r
`)&&(f=`\r
`),this.css+=f+"/*# sourceMappingURL="+d+" */"}applyPrevMaps(){for(let d of this.previous()){let f=this.toUrl(this.path(d.file)),m=d.root||e(d.file),p;this.mapOpts.sourcesContent===!1?(p=new i(d.text),p.sourcesContent&&(p.sourcesContent=null)):p=d.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let d;for(let f=this.root.nodes.length-1;f>=0;f--)d=this.root.nodes[f],d.type==="comment"&&d.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&u&&this.isMap())return this.generateMap();{let d="";return th