UNPKG

testplane

Version:

Tests framework based on mocha and wdio

36 lines (35 loc) 183 kB
(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 Fo=Object.defineProperty,Uo=Object.defineProperties;var Bo=Object.getOwnPropertyDescriptors;var ft=Object.getOwnPropertySymbols;var zs=Object.prototype.hasOwnProperty,Ws=Object.prototype.propertyIsEnumerable;var Bs=(s,e,t)=>e in s?Fo(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,x=(s,e)=>{for(var t in e||(e={}))zs.call(e,t)&&Bs(s,t,e[t]);if(ft)for(var t of ft(e))Ws.call(e,t)&&Bs(s,t,e[t]);return s},te=(s,e)=>Uo(s,Bo(e));var Oe=(s,e)=>{var t={};for(var r in s)zs.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&ft)for(var r of ft(s))e.indexOf(r)<0&&Ws.call(s,r)&&(t[r]=s[r]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var zo=Object.defineProperty,Wo=(s,e,t)=>e in s?zo(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>Wo(s,typeof e!="symbol"?e+"":e,t),Gs,Go=Object.defineProperty,Vo=(s,e,t)=>e in s?Go(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Vs=(s,e,t)=>Vo(s,typeof e!="symbol"?e+"":e,t),j=(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))(j||{});const js={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Hs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},pt={},jo=()=>!!globalThis.Zone;function fs(s){if(pt[s])return pt[s];const e=globalThis[s],t=e.prototype,r=s in js?js[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in Hs?Hs[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&&!jo())return pt[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 u=a[s].prototype;return document.body.removeChild(l),u?pt[s]=u:t}catch(l){return t}}const wr={};function me(s,e,t){var r;const i=`${s}.${String(t)}`;if(wr[i])return wr[i].call(e);const n=fs(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(wr[i]=o,o.call(e)):e[t]}const br={};function Wi(s,e,t){const r=`${s}.${String(t)}`;if(br[r])return br[r].bind(e);const n=fs(s)[t];return typeof n!="function"?e[t]:(br[r]=n,n.bind(e))}function Ho(s){return me("Node",s,"childNodes")}function Yo(s){return me("Node",s,"parentNode")}function Zo(s){return me("Node",s,"parentElement")}function Jo(s){return me("Node",s,"textContent")}function Xo(s,e){return Wi("Node",s,"contains")(e)}function Ko(s){return Wi("Node",s,"getRootNode")()}function Qo(s){return!s||!("host"in s)?null:me("ShadowRoot",s,"host")}function qo(s){return s.styleSheets}function ea(s){return!s||!("shadowRoot"in s)?null:me("Element",s,"shadowRoot")}function ta(s,e){return me("Element",s,"querySelector")(e)}function ra(s,e){return me("Element",s,"querySelectorAll")(e)}function sa(){return fs("MutationObserver").constructor}function ia(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 Z={childNodes:Ho,parentNode:Yo,parentElement:Zo,textContent:Jo,contains:Xo,getRootNode:Ko,host:Qo,styleSheets:qo,shadowRoot:ea,querySelector:ta,querySelectorAll:ra,mutationObserver:sa,patch:ia};function Gi(s){return s.nodeType===s.ELEMENT_NODE}function je(s){const e=s&&"host"in s&&"mode"in s&&Z.host(s)||null;return!!(e&&"shadowRoot"in e&&Z.shadowRoot(e)===s)}function He(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function na(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 oa(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 kr(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&(t=s.ownerNode.baseURI);const r=Array.from(e,i=>Vi(i,t)).join("");return na(r)}catch(e){return null}}function Vi(s,e){if(ua(s)){let t;try{t=kr(s.styleSheet)||oa(s)}catch(r){t=s.cssText}return s.styleSheet.href?jt(t,s.styleSheet.href):t}else{let t=la(s.cssText);return ca(s)&&s.selectorText.includes(":")&&(t=aa(t)),e?jt(t,e):t}}function aa(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function la(s){if(/:\s*;/.test(s)){const t=new RegExp("(?<=^|\\{|\\;)\\s*[_a-zA-Z][_a-zA-Z0-9-]*:\\s*;","gm");return s.replace(t,"")}return s}function ua(s){return"styleSheet"in s}function ca(s){return"selectorText"in s}class ji{constructor(){Vs(this,"idNodeMap",new Map),Vs(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 ha(){return new ji}function Gt({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"";const l=r&&Ce(r);return(e[t.toLowerCase()]||l&&e[l])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Ce(s){return s.toLowerCase()}const Ys="__rrweb_original__";function fa(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=Ys in n?n[Ys]: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 Vt(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Ce(e):null}function Hi(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 pa(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const da=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ma=/^(?:[a-z+]+:)?\/\//i,ga=/^www\..*/i,ya=/^(data:)([^,]*),(.*)/i;function jt(s,e){return(s||"").replace(da,(t,r,i,n,o,l)=>{const a=i||o||l,u=r||n||"";if(!a)return t;if(ma.test(a)||ga.test(a))return`url(${u}${a}${u})`;if(ya.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${pa(e)+a}${u})`;const c=e.split("/"),h=a.split("/");c.pop();for(const d of h)d!=="."&&(d===".."?c.pop():c.push(d));return`url(${u}${c.join("/")}${u})`})}function dt(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function wa(s,e,t=!1){const r=Array.from(e.childNodes),i=[];let n=0;if(r.length>1&&s&&typeof s=="string"){let o=dt(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 u=dt(r[a].textContent,t),c=100;let h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let d=u.substring(0,h),g=o.split(d),m=-1;if(g.length===2)m=g[0].length;else if(g.length>2&&g[0]===""&&r[a-1].textContent!=="")m=o.indexOf(d,1);else if(g.length===1){if(d=d.substring(0,d.length-1),g=o.split(d),g.length<=1)return i.push(s),i;h=c+1}else h===u.length-1&&(m=o.indexOf(d));if(g.length>=2&&h>c){const p=r[a-1].textContent;if(p&&typeof p=="string"){const f=dt(p).length;m=o.indexOf(d,f)}m===-1&&(m=g[0].length)}if(m!==-1){let p=Math.floor(m/l);for(;p>0&&p<s.length;){if(n+=1,n>50*r.length)return i.push(s),i;const f=dt(s.substring(0,p),t);if(f.length===m){i.push(s.substring(0,p)),s=s.substring(p),o=o.substring(m);break}else f.length<m?p+=Math.max(1,Math.floor((m-f.length)/l)):p-=Math.max(1,Math.floor((f.length-m)*l))}break}}}}return i.push(s),i}function ba(s,e){return wa(s,e).join("/* rr_split */")}let Sa=1;const Ca=new RegExp("[^a-z0-9-_:]"),Ze=-2;function Yi(){return Sa++}function va(s){if(s instanceof HTMLFormElement)return"form";const e=Ce(s.tagName);return Ca.test(e)?"div":e}let Re,Zs;const Ia=/^[^ \t\n\r\u000c]+/,xa=/^[, \t\n\r\u000c]+/;function Oa(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(xa),!(t>=e.length);){let n=r(Ia);if(n.slice(-1)===",")n=Ee(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Ee(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 Js=new WeakMap;function Ee(s,e){return!e||e.trim()===""?e:ps(s,e)}function Ra(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function ps(s,e){let t=Js.get(s);if(t||(t=s.createElement("a"),Js.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Zi(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")?Ee(s,r):t==="srcset"?Oa(s,r):t==="style"?jt(r,ps(s)):e==="object"&&t==="data"?Ee(s,r):r)}function Ji(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Aa(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 Ht(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Ht(Z.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?Ht(Z.parentNode(s),e,t):!1}function Xi(s,e,t,r){let i;if(Gi(s)){if(i=s,!Z.childNodes(i).length)return!1}else{if(Z.parentElement(s)===null)return!1;i=Z.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(Ht(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 Ma(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 Ea(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 $a(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:p=!1,cssCaptured:f=!1}=e,b=Na(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:j.Document,childNodes:[],compatMode:s.compatMode}:{type:j.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:j.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:b};case s.ELEMENT_NODE:return Pa(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:p,rootId:b});case s.TEXT_NODE:return ka(s,{doc:t,needsMask:o,maskTextFn:u,rootId:b,cssCaptured:f});case s.CDATA_SECTION_NODE:return{type:j.CDATA,textContent:"",rootId:b};case s.COMMENT_NODE:return{type:j.Comment,textContent:Z.textContent(s)||"",rootId:b};default:return!1}}function Na(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function ka(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=Z.parentNode(s),l=o&&o.tagName;let a="";const u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":n||(a=Z.textContent(s),u&&a&&(a=jt(a,ps(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,Z.parentElement(s)):a.replace(/[\S]/g,"*")),{type:j.Text,textContent:a||"",rootId:i}}function Pa(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,dataURLOptions:a={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:g}=e,m=Aa(s,r,i),p=va(s);let f={};const b=s.attributes.length;for(let y=0;y<b;y++){const C=s.attributes[y];Ji(p,C.name,C.value)||(f[C.name]=Zi(t,p,Ce(C.name),C.value))}if(p==="link"&&n){const y=Array.from(t.styleSheets).find(N=>N.href===s.href);let C=null;y&&(C=kr(y)),C&&(delete f.rel,delete f.href,f._cssText=C)}if(p==="style"&&s.sheet){let y=kr(s.sheet);y&&(s.childNodes.length>1&&(y=ba(y,s)),f._cssText=y)}if(p==="input"||p==="textarea"||p==="select"){const y=s.value,C=s.checked;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&y?f.value=Gt({element:s,type:Vt(s),tagName:p,value:y,maskInputOptions:o,maskInputFn:l}):C&&(f.checked=C)}if(p==="option"&&(s.selected&&!o.select?f.selected=!0:delete f.selected),p==="dialog"&&s.open&&(f.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),p==="canvas"&&c){if(s.__context==="2d")fa(s)||(f.rr_dataURL=s.toDataURL(a.type,a.quality));else if(!("__context"in s)){const y=s.toDataURL(a.type,a.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const N=C.toDataURL(a.type,a.quality);y!==N&&(f.rr_dataURL=y)}}if(p==="img"&&u){Re||(Re=t.createElement("canvas"),Zs=Re.getContext("2d"));const y=s,C=y.currentSrc||y.getAttribute("src")||"<unknown-src>",N=y.crossOrigin,D=()=>{y.removeEventListener("load",D);try{Re.width=y.naturalWidth,Re.height=y.naturalHeight,Zs.drawImage(y,0,0),f.rr_dataURL=Re.toDataURL(a.type,a.quality)}catch(H){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?D():y.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${C}! Error: ${H}`)}y.crossOrigin==="anonymous"&&(N?f.crossOrigin=N:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?D():y.addEventListener("load",D)}if(p==="audio"||p==="video"){const y=f;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(d||(s.scrollLeft&&(f.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(f.rr_scrollTop=s.scrollTop)),m){const{width:y,height:C}=s.getBoundingClientRect();f={class:f.class,rr_width:`${y}px`,rr_height:`${C}px`}}p==="iframe"&&!h(f.src)&&(s.contentDocument||(f.rr_src=f.src),delete f.src);let S;try{customElements.get(p)&&(S=!0)}catch(y){}return{type:j.Element,tagName:p,attributes:f,childNodes:[],isSVG:Ra(s)||void 0,needBlock:m,rootId:g,isCustom:S}}function P(s){return s==null?"":s.toLowerCase()}function Da(s,e){if(e.comment&&s.type===j.Comment)return!0;if(s.type===j.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"&&Hi(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(P(s.attributes.name).match(/^msapplication-tile(image|color)$/)||P(s.attributes.name)==="application-name"||P(s.attributes.rel)==="icon"||P(s.attributes.rel)==="apple-touch-icon"||P(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&P(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(P(s.attributes.property).match(/^(og|twitter|fb):/)||P(s.attributes.name).match(/^(og|twitter):/)||P(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(P(s.attributes.name)==="robots"||P(s.attributes.name)==="googlebot"||P(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(P(s.attributes.name)==="author"||P(s.attributes.name)==="generator"||P(s.attributes.name)==="framework"||P(s.attributes.name)==="publisher"||P(s.attributes.name)==="progid"||P(s.attributes.property).match(/^article:/)||P(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(P(s.attributes.name)==="google-site-verification"||P(s.attributes.name)==="yandex-verification"||P(s.attributes.name)==="csrf-token"||P(s.attributes.name)==="p:domain_verify"||P(s.attributes.name)==="verify-v1"||P(s.attributes.name)==="verification"||P(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function $e(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:g,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:f=!1,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:H=!1,cssCaptured:T=!1}=e;let{needsMask:G}=e,{preserveWhiteSpace:Y=!0}=e;G||(G=Xi(s,o,l,G===void 0));const q=$a(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:G,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:m,inlineImages:p,recordCanvas:f,keepIframeSrcFn:D,newlyAddedElement:H,cssCaptured:T});if(!q)return console.warn(s,"not serialized"),null;let ae;r.hasNode(s)?ae=r.getId(s):Da(q,g)||!Y&&q.type===j.Text&&!q.textContent.replace(/^\s+|\s+$/gm,"").length?ae=Ze:ae=Yi();const A=Object.assign(q,{id:ae});if(r.add(s,A),ae===Ze)return null;b&&b(s);let Ue=!a;if(A.type===j.Element){Ue=Ue&&!A.needBlock,delete A.needBlock;const V=Z.shadowRoot(s);V&&He(V)&&(A.isShadowHost=!0)}if((A.type===j.Document||A.type===j.Element)&&Ue){g.headWhitespace&&A.type===j.Element&&A.tagName==="head"&&(Y=!1);const V={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:G,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:g,dataURLOptions:m,inlineImages:p,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:N,keepIframeSrcFn:D,cssCaptured:!1};if(!(A.type===j.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===j.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(V.cssCaptured=!0);for(const ye of Array.from(Z.childNodes(s))){const le=$e(ye,V);le&&A.childNodes.push(le)}}let ee=null;if(Gi(s)&&(ee=Z.shadowRoot(s)))for(const ye of Array.from(Z.childNodes(ee))){const le=$e(ye,V);le&&(He(ee)&&(le.isShadow=!0),A.childNodes.push(le))}}const Be=Z.parentNode(s);return Be&&je(Be)&&He(Be)&&(A.isShadow=!0),A.type===j.Element&&A.tagName==="iframe"&&Ma(s,()=>{const V=s.contentDocument;if(V&&S){const ee=$e(V,{doc:V,mirror:r,blockClass:i,blockSelector:n,needsMask:G,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:g,dataURLOptions:m,inlineImages:p,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:N,keepIframeSrcFn:D});ee&&S(s,ee)}},y),A.type===j.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&Hi(A.attributes.href)==="css")&&Ea(s,()=>{if(C){const V=$e(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:G,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:g,dataURLOptions:m,inlineImages:p,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:N,keepIframeSrcFn:D});V&&C(s,V)}},N),A}function La(s,e){const{mirror:t=new ji,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:g=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:f,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:N=()=>!1}=e||{};return $e(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!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}:c===!1?{password:!0}:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:g==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:g===!1?{}:g,dataURLOptions:m,inlineImages:a,recordCanvas:u,preserveWhiteSpace:p,onSerialize:f,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:N,newlyAddedElement:!1})}function _a(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ta(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 ds={exports:{}},L=String,Ki=function(){return{isColorSupported:!1,reset:L,bold:L,dim:L,italic:L,underline:L,inverse:L,hidden:L,strikethrough:L,black:L,red:L,green:L,yellow:L,blue:L,magenta:L,cyan:L,white:L,gray:L,bgBlack:L,bgRed:L,bgGreen:L,bgYellow:L,bgBlue:L,bgMagenta:L,bgCyan:L,bgWhite:L}};ds.exports=Ki();ds.exports.createColors=Ki;var Fa=ds.exports;const Ua={},Ba=Object.freeze(Object.defineProperty({__proto__:null,default:Ua},Symbol.toStringTag,{value:"Module"})),ne=Ta(Ba);let Xs=Fa,Ks=ne,Pr=class Qi 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,Qi)}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=Xs.isColorSupported),Ks&&e&&(t=Ks(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Xs.createColors(!0);l=d=>u(h(d)),a=d=>c(d)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,d=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let g=a(d.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(d)+u+` `+g+l("^")}return" "+a(d)+u}).join(` `)}toString(){let e=this.showSourceCode();return e&&(e=` `+e+` `),this.name+": "+this.message+e}};var ms=Pr;Pr.default=Pr;var it={};it.isClean=Symbol("isClean");it.my=Symbol("my");const Qs={after:` `,beforeClose:` `,beforeComment:` `,beforeDecl:` `,beforeOpen:" ",beforeRule:` `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function za(s){return s[0].toUpperCase()+s.slice(1)}let Dr=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(` `)){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 Qs[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"+za(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=Qs[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(` `)&&(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(` `)&&(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(` `)&&(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(` `)&&(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(` `);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 qi=Dr;Dr.default=Dr;let Wa=qi;function Lr(s,e){new Wa(e).stringify(s)}var ir=Lr;Lr.default=Lr;let{isClean:mt,my:Ga}=it,Va=ms,ja=qi,Ha=ir;function _r(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=>_r(o,t)):(n==="object"&&i!==null&&(i=_r(i)),t[r]=i)}return t}let Tr=class{constructor(e={}){this.raws={},this[mt]=!1,this[Ga]=!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=_r(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 Va(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}}}markDirty(){if(this[mt]){this[mt]=!1;let e=this;for(;e=e.parent;)e[mt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===` `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new ja().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"){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=Ha){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)}get proxyOf(){return this}};var nr=Tr;Tr.default=Tr;let Ya=nr,Fr=class extends Ya{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=te(x({},e),{value:String(e.value)})),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var or=Fr;Fr.default=Fr;let Za="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Ja=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},Xa=(s=21)=>{let e="",t=s;for(;t--;)e+=Za[Math.random()*64|0];return e};var Ka={nanoid:Xa,customAlphabet:Ja};let{SourceMapConsumer:qs,SourceMapGenerator:ei}=ne,{existsSync:Qa,readFileSync:qa}=ne,{dirname:Sr,join:el}=ne;function tl(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Ur=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=Sr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new qs(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,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return tl(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}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=/gm);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=Sr(e),Qa(e))return this.mapFile=e,qa(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 qs)return ei.fromSourceMap(t).toString();if(t instanceof ei)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=el(Sr(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 en=Ur;Ur.default=Ur;let{SourceMapConsumer:rl,SourceMapGenerator:sl}=ne,{fileURLToPath:ti,pathToFileURL:gt}=ne,{isAbsolute:Br,resolve:zr}=ne,{nanoid:il}=Ka,Cr=ne,ri=ms,nl=en,vr=Symbol("fromOffsetCache"),ol=!!(rl&&sl),si=!!(zr&&Br),Yt=class{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,t.from&&(!si||/^\w+:\/\//.test(t.from)||Br(t.from)?this.file=t.from:this.file=zr(t.from)),si&&ol){let r=new nl(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 "+il(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new ri(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new ri(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(gt&&(n.input.url=gt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[vr])r=this[vr];else{let n=this.css.split(` `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[vr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:zr(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;Br(o.source)?a=gt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||gt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(ti)u.file=ti(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map=x({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ar=Yt;Yt.default=Yt;Cr&&Cr.registerInput&&Cr.registerInput(Yt);let{SourceMapConsumer:tn,SourceMapGenerator:Tt}=ne,{dirname:Ft,relative:rn,resolve:sn,sep:nn}=ne,{pathToFileURL:ii}=ne,al=ar,ll=!!(tn&&Tt),ul=!!(Ft&&sn&&rn&&nn),cl=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=` `;this.css.includes(`\r `)&&(t=`\r `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Ft(e.file),i;this.mapOpts.sourcesContent===!1?(i=new tn(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.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ul&&ll&&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=Tt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Tt({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 Tt({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,u)=>{if(this.css+=l,a&&u!=="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))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(` `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.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?Ft(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ft(sn(r,this.mapOpts.annotation)));let i=rn(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 al(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(ii){let r=ii(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;nn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var on=cl;let hl=nr,Wr=class extends hl{constructor(e){super(e),this.type="comment"}};var lr=Wr;Wr.default=Wr;let{isClean:an,my:ln}=it,un=or,cn=lr,fl=nr,hn,gs,ys,fn;function pn(s){return s.map(e=>(e.nodes&&(e.nodes=pn(e.nodes)),delete e.source,e))}function dn(s){if(s[an]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)dn(e)}let fe=class mn extends fl{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=pn(hn(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 un(e)]}else if(e.selector)e=[new gs(e)];else if(e.name)e=[new ys(e)];else if(e.text)e=[new cn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[ln]||mn.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[an]&&dn(i),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)}))}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]}};fe.registerParse=s=>{hn=s};fe.registerRule=s=>{gs=s};fe.registerAtRule=s=>{ys=s};fe.registerRoot=s=>{fn=s};var ve=fe;fe.default=fe;fe.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,ys.prototype):s.type==="rule"?Object.setPrototypeOf(s,gs.prototype):s.type==="decl"?Object.setPrototypeOf(s,un.prototype):s.type==="comment"?Object.setPrototypeOf(s,cn.prototype):s.type==="root"&&Object.setPrototypeOf(s,fn.prototype),s[ln]=!0,s.nodes&&s.nodes.forEach(e=>{fe.rebuild(e)})};let pl=ve,gn,yn,Je=class extends pl{constructor(e){super(x({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new gn(new yn,this,e).stringify()}};Je.registerLazyResult=s=>{gn=s};Je.regis