UNPKG

humanbehavior-js

Version:

SDK for HumanBehavior session and event recording

1 lines 258 kB
"use strict";var e,t=require("react/jsx-runtime"),s=require("react"),r=Object.defineProperty,n=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),i=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),a=(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))(a||{});const l={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},h={};function u(e){if(h[e])return h[e];const t=globalThis[e],s=t.prototype,r=e in l?l[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),i=e in c?c[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&o)return h[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const i=n[e].prototype;return document.body.removeChild(r),i?h[e]=i:s}catch{return s}}const d={};function p(e,t,s){var r;const n=`${e}.${String(s)}`;if(d[n])return d[n].call(t);const i=u(e),o=null==(r=Object.getOwnPropertyDescriptor(i,s))?void 0:r.get;return o?(d[n]=o,o.call(t)):t[s]}const m={};function f(e,t,s){const r=`${e}.${String(s)}`;if(m[r])return m[r].bind(t);const n=u(e)[s];return"function"!=typeof n?t[s]:(m[r]=n,n.bind(t))}const g={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return f("Node",e,"contains")(t)},getRootNode:function(e){return f("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};function y(e){return e.nodeType===e.ELEMENT_NODE}function w(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function v(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function S(e){try{const s=e.rules||e.cssRules;if(!s)return null;const r=Array.from(s,t=>b(t,e.href)).join("");return(t=r).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function b(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=S(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const s=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}(e)}catch(s){t=e.cssText}return e.styleSheet.href?A(t,e.styleSheet.href):t}{let s=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(s=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(s)),t?A(s,t):s}}class C{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function I({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:i}){let o=n||"";const a=r&&k(r);return(t[s.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function k(e){return e.toLowerCase()}const E="__rrweb_original__";function x(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?k(t):null}function O(e,t){let s;try{s=new URL(e,t??window.location.href)}catch(e){return null}const r=s.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const T=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?:[a-z+]+:)?\/\//i,M=/^www\..*/i,_=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(T,(e,s,r,n,i,o)=>{const a=r||i||o,l=s||n||"";if(!a)return e;if(R.test(a)||M.test(a))return`url(${l}${a}${l})`;if(_.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}let P=1;const N=new RegExp("[^a-z0-9-_:]");function F(){return P++}let L,D;const U=/^[^ \t\n\r\u000c]+/,B=/^[, \t\n\r\u000c]+/;const $=new WeakMap;function z(e,t){return t&&""!==t.trim()?W(e,t):t}function j(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function W(e,t){let s=$.get(e);if(s||(s=e.createElement("a"),$.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function K(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?z(e,r):"background"!==s||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===s?function(e,t){if(""===t.trim())return t;let s=0;function r(e){let r;const n=e.exec(t.substring(s));return n?(r=n[0],s+=r.length,r):""}const n=[];for(;r(B),!(s>=t.length);){let i=r(U);if(","===i.slice(-1))i=z(e,i.substring(0,i.length-1)),n.push(i);else{let r="";i=z(e,i);let o=!1;for(;;){const e=t.charAt(s);if(""===e){n.push((i+r).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){s+=1,n.push((i+r).trim());break}"("===e&&(o=!0)}r+=e,s+=1}}}return n.join(", ")}(e,r):"style"===s?A(r,W(e)):"object"===t&&"data"===s?z(e,r):r:z(e,r):r}function V(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function G(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&G(g.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&G(g.parentNode(e),t,s)}function H(e,t,s,r){let n;if(y(e)){if(n=e,!g.childNodes(n).length)return!1}else{if(null===g.parentElement(e))return!1;n=g.parentElement(e)}try{if("string"==typeof t){if(r){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(G(n,t,r))return!0;if(s)if(r){if(n.closest(s))return!0}else if(n.matches(s))return!0}catch(e){}return!1}function Y(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:i,needsMask:o,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:h,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y=!1}=t,w=function(e,t){if(!t.hasNode(e))return;const s=t.getId(e);return 1===s?void 0:s}(s,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:a.Document,childNodes:[],compatMode:e.compatMode}:{type:a.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:a.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){const{doc:s,blockClass:r,blockSelector:n,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:l,dataURLOptions:c={},inlineImages:h,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:m}=t,f=function(e,t,s){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}if(s)return e.matches(s)}catch(e){}return!1}(e,r,n),y=function(e){if(e instanceof HTMLFormElement)return"form";const t=k(e.tagName);return N.test(t)?"div":t}(e);let w={};const v=e.attributes.length;for(let t=0;t<v;t++){const r=e.attributes[t];V(y,r.name,r.value)||(w[r.name]=K(s,y,k(r.name),r.value))}if("link"===y&&i){const t=Array.from(s.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=S(t)),r&&(delete w.rel,delete w.href,w._cssText=r)}if("style"===y&&e.sheet&&!(e.innerText||g.textContent(e)||"").trim().length){const t=S(e.sheet);t&&(w._cssText=t)}if("input"===y||"textarea"===y||"select"===y){const t=e.value,s=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&t?w.value=I({element:e,type:x(e),tagName:y,value:t,maskInputOptions:o,maskInputFn:l}):s&&(w.checked=s)}"option"===y&&(e.selected&&!o.select?w.selected=!0:delete w.selected);"dialog"===y&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===y&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let s=0;s<e.width;s+=50)for(let r=0;r<e.height;r+=50){const n=t.getImageData,i=E in n?n[E]:n;if(new Uint32Array(i.call(t,s,r,Math.min(50,e.width-s),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=s.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(w.rr_dataURL=t)}if("img"===y&&h){L||(L=s.createElement("canvas"),D=L.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{L.width=t.naturalWidth,L.height=t.naturalHeight,D.drawImage(t,0,0),w.rr_dataURL=L.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?w.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===y||"video"===y){const t=w;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:s}=e.getBoundingClientRect();w={class:w.class,rr_width:`${t}px`,rr_height:`${s}px`}}"iframe"!==y||d(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);let b;try{customElements.get(y)&&(b=!0)}catch(e){}return{type:a.Element,tagName:y,attributes:w,childNodes:[],isSVG:j(e)||void 0,needBlock:f,rootId:m,isCustom:b}}(e,{doc:s,blockClass:n,blockSelector:i,inlineStylesheet:l,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y,rootId:w});case e.TEXT_NODE:return function(e,t){var s;const{needsMask:r,maskTextFn:n,rootId:i}=t,o=g.parentNode(e),l=o&&o.tagName;let c=g.textContent(e);const h="STYLE"===l||void 0,u="SCRIPT"===l||void 0;if(h&&c){try{e.nextSibling||e.previousSibling||(null==(s=o.sheet)?void 0:s.cssRules)&&(c=S(o.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}c=A(c,W(t.doc))}u&&(c="SCRIPT_PLACEHOLDER");!h&&!u&&c&&r&&(c=n?n(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:a.Text,textContent:c||"",isStyle:h,rootId:i}}(e,{doc:s,needsMask:o,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:a.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:a.Comment,textContent:g.textContent(e)||"",rootId:w};default:return!1}}function q(e){return null==e?"":e.toLowerCase()}function Z(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:h=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f={},inlineImages:S=!1,recordCanvas:b=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:R=!1}=t;let{needsMask:M}=t,{preserveWhiteSpace:_=!0}=t;if(!M){M=H(e,o,l,void 0===M)}const A=Y(e,{doc:s,mirror:r,blockClass:n,blockSelector:i,needsMask:M,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:S,recordCanvas:b,keepIframeSrcFn:T,newlyAddedElement:R});if(!A)return console.warn(e,"not serialized"),null;let P;P=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===a.Comment)return!0;if(e.type===a.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===O(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===q(e.attributes.name)||"icon"===q(e.attributes.rel)||"apple-touch-icon"===q(e.attributes.rel)||"shortcut icon"===q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(q(e.attributes.property).match(/^(og|twitter|fb):/)||q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===q(e.attributes.name)||"googlebot"===q(e.attributes.name)||"bingbot"===q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===q(e.attributes.name)||"generator"===q(e.attributes.name)||"framework"===q(e.attributes.name)||"publisher"===q(e.attributes.name)||"progid"===q(e.attributes.name)||q(e.attributes.property).match(/^article:/)||q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===q(e.attributes.name)||"yandex-verification"===q(e.attributes.name)||"csrf-token"===q(e.attributes.name)||"p:domain_verify"===q(e.attributes.name)||"verify-v1"===q(e.attributes.name)||"verification"===q(e.attributes.name)||"shopify-checkout-api-token"===q(e.attributes.name)))return!0}}return!1}(A,m)&&(_||A.type!==a.Text||A.isStyle||A.textContent.replace(/^\s+|\s+$/gm,"").length)?F():-2;const N=Object.assign(A,{id:P});if(r.add(e,N),-2===P)return null;C&&C(e);let L=!c;if(N.type===a.Element){L=L&&!N.needBlock,delete N.needBlock;const t=g.shadowRoot(e);t&&v(t)&&(N.isShadowHost=!0)}if((N.type===a.Document||N.type===a.Element)&&L){m.headWhitespace&&N.type===a.Element&&"head"===N.tagName&&(_=!1);const t={doc:s,mirror:r,blockClass:n,blockSelector:i,needsMask:M,maskTextClass:o,maskTextSelector:l,skipChild:c,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:S,recordCanvas:b,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T};if(N.type===a.Element&&"textarea"===N.tagName&&void 0!==N.attributes.value);else for(const s of Array.from(g.childNodes(e))){const e=Z(s,t);e&&N.childNodes.push(e)}let w=null;if(y(e)&&(w=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(w))){const s=Z(e,t);s&&(v(w)&&(s.isShadow=!0),N.childNodes.push(s))}}const D=g.parentNode(e);return D&&w(D)&&v(D)&&(N.isShadow=!0),N.type===a.Element&&"iframe"===N.tagName&&function(e,t,s){const r=e.contentWindow;if(!r)return;let n,i=!1;try{n=r.document.readyState}catch(e){return}if("complete"!==n){const r=setTimeout(()=>{i||(t(),i=!0)},s);return void e.addEventListener("load",()=>{clearTimeout(r),i=!0,t()})}const o="about:blank";if(r.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&I){const s=Z(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,needsMask:M,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:S,recordCanvas:b,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T});s&&I(e,s)}},k),N.type===a.Element&&"link"===N.tagName&&"string"==typeof N.attributes.rel&&("stylesheet"===N.attributes.rel||"preload"===N.attributes.rel&&"string"==typeof N.attributes.href&&"css"===O(N.attributes.href))&&function(e,t,s){let r,n=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout(()=>{n||(t(),n=!0)},s);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}(e,()=>{if(E){const t=Z(e,{doc:s,mirror:r,blockClass:n,blockSelector:i,needsMask:M,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:S,recordCanvas:b,preserveWhiteSpace:_,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T});t&&E(e,t)}},x),N}function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Q(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var X={exports:{}},ee=String,te=function(){return{isColorSupported:!1,reset:ee,bold:ee,dim:ee,italic:ee,underline:ee,inverse:ee,hidden:ee,strikethrough:ee,black:ee,red:ee,green:ee,yellow:ee,blue:ee,magenta:ee,cyan:ee,white:ee,gray:ee,bgBlack:ee,bgRed:ee,bgGreen:ee,bgYellow:ee,bgBlue:ee,bgMagenta:ee,bgCyan:ee,bgWhite:ee}};X.exports=te(),X.exports.createColors=te;var se=X.exports;const re=Q(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ne=se,ie=re,oe=class e extends Error{constructor(t,s,r,n,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=ne.isColorSupported),ie&&e&&(t=ie(t));let s,r,n=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),a=String(o).length;if(e){let{bold:e,gray:t,red:n}=ne.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(i,o).map((e,t)=>{let n=i+1+t,o=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(o)+e+"\n "+t+s("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ae=oe;oe.default=oe;var le={};le.isClean=Symbol("isClean"),le.my=Symbol("my");const ce={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let he=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],i=this.raw(n,"before");i&&this.builder(i),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return ce[s];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[s])return i.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((o=s)[0].toUpperCase()+o.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var o;return void 0===r&&(r=ce[s]),i.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}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 ue=he;he.default=he;let de=ue;function pe(e,t){new de(t).stringify(e)}var me=pe;pe.default=pe;let{isClean:fe,my:ge}=le,ye=ae,we=ue,ve=me;function Se(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],i=typeof n;"parent"===r&&"object"===i?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>Se(e,s)):("object"===i&&null!==n&&(n=Se(n)),s[r]=n)}return s}let be=class{constructor(e={}){this.raws={},this[fe]=!1,this[ge]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}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=Se(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new ye(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[fe]){this[fe]=!1;let e=this;for(;e=e.parent;)e[fe]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,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},s=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 r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new we).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let i=t.get(r.input);null==i&&(i=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:i,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ve){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var Ce=be;be.default=be;let Ie=Ce,ke=class extends Ie{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Ee=ke;ke.default=ke;var xe={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Oe,SourceMapGenerator:Te}=re,{existsSync:Re,readFileSync:Me}=re,{dirname:_e,join:Ae}=re;let Pe=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=_e(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Oe(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=_e(e),Re(e))return this.mapFile=e,Me(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Oe)return Te.fromSourceMap(t).toString();if(t instanceof Te)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Ae(_e(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Ne=Pe;Pe.default=Pe;let{SourceMapConsumer:Fe,SourceMapGenerator:Le}=re,{fileURLToPath:De,pathToFileURL:Ue}=re,{isAbsolute:Be,resolve:$e}=re,{nanoid:ze}=xe,je=re,We=ae,Ke=Ne,Ve=Symbol("fromOffsetCache"),Ge=Boolean(Fe&&Le),He=Boolean($e&&Be),Ye=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!He||/^\w+:\/\//.test(t.from)||Be(t.from)?this.file=t.from:this.file=$e(t.from)),He&&Ge){let e=new Ke(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+ze(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,i,o;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);i=e.line,o=e.col}else i=r.line,o=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,i,o);return n=a?new We(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new We(e,void 0===i?t:{column:s,line:t},void 0===i?s:{column:o,line:i},this.css,this.file,r.plugin),n.input={column:s,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Ue&&(n.input.url=Ue(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[Ve])s=this[Ve];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[Ve]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:$e(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=o.originalPositionFor({column:r,line:s})),i=Be(a.source)?Ue(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ue(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!De)throw new Error("file: protocol is not available in this PostCSS build");l.file=De(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var qe=Ye;Ye.default=Ye,je&&je.registerInput&&je.registerInput(Ye);let{SourceMapConsumer:Ze,SourceMapGenerator:Je}=re,{dirname:Qe,relative:Xe,resolve:et,sep:tt}=re,{pathToFileURL:st}=re,rt=qe,nt=Boolean(Ze&&Je),it=Boolean(Qe&&et&&Xe&&tt);var ot=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||Qe(e.file);!1===this.mapOpts.sourcesContent?(t=new Ze(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),it&&nt&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Je.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Je({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 Je({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=r-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=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(s+=e.length,t=o.lastIndexOf("\n"),r=o.length-t):r+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.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=s,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?Qe(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=Qe(et(s,this.mapOpts.annotation)));let r=Xe(s,e);return this.memoizedPaths.set(e,r),r}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 rt(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,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(st){let t=st(e).toString();return this.memoizedFileURLs.set(e,t),t}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;"\\"===tt&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let at=Ce,lt=class extends at{constructor(e){super(e),this.type="comment"}};var ct=lt;lt.default=lt;let ht,ut,dt,pt,{isClean:mt,my:ft}=le,gt=Ee,yt=ct,wt=Ce;function vt(e){return e.map(e=>(e.nodes&&(e.nodes=vt(e.nodes)),delete e.source,e))}function St(e){if(e[mt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)St(t)}let bt=class e extends wt{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}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,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}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)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+i.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=vt(ht(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new gt(t)]}else if(t.selector)t=[new ut(t)];else if(t.name)t=[new dt(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new yt(t)]}return t.map(t=>(t[ft]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[mt]&&St(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}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]}};bt.registerParse=e=>{ht=e},bt.registerRule=e=>{ut=e},bt.registerAtRule=e=>{dt=e},bt.registerRoot=e=>{pt=e};var Ct=bt;bt.default=bt,bt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,dt.prototype):"rule"===e.type?Object.setPrototypeOf(e,ut.prototype):"decl"===e.type?Object.setPrototypeOf(e,gt.prototype):"comment"===e.type?Object.setPrototypeOf(e,yt.prototype):"root"===e.type&&Object.setPrototypeOf(e,pt.prototype),e[ft]=!0,e.nodes&&e.nodes.forEach(e=>{bt.rebuild(e)})};let It,kt,Et=Ct,xt=class extends Et{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new It(new kt,this,e).stringify()}};xt.registerLazyResult=e=>{It=e},xt.registerProcessor=e=>{kt=e};var Ot=xt;xt.default=xt;let Tt={};var Rt=function(e){Tt[e]||(Tt[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Mt=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var _t=Mt;Mt.default=Mt;let At=_t,Pt=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let s=new At(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Nt=Pt;Pt.default=Pt;const Ft="'".charCodeAt(0),Lt='"'.charCodeAt(0),Dt="\\".charCodeAt(0),Ut="/".charCodeAt(0),Bt="\n".charCodeAt(0),$t=" ".charCodeAt(0),zt="\f".charCodeAt(0),jt="\t".charCodeAt(0),Wt="\r".charCodeAt(0),Kt="[".charCodeAt(0),Vt="]".charCodeAt(0),Gt="(".charCodeAt(0),Ht=")".charCodeAt(0),Yt="{".charCodeAt(0),qt="}".charCodeAt(0),Zt=";".charCodeAt(0),Jt="*".charCodeAt(0),Qt=":".charCodeAt(0),Xt="@".charCodeAt(0),es=/[\t\n\f\r "#'()/;[\\\]{}]/g,ts=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ss=/.[\r\n"'(/\\]/,rs=/[\da-f]/i;let ns=Ct,is=class extends ns{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var os=is;is.default=is,ns.registerAtRule(is);let as,ls,cs=Ct,hs=class extends cs{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new as(new ls,this,e).stringify()}};hs.registerLazyResult=e=>{as=e},hs.registerProcessor=e=>{ls=e};var us=hs;hs.default=hs,cs.registerRoot(hs);let ds={comma:e=>ds.split(e,[","],!0),space:e=>ds.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",i=!1,o=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?o+=1:")"===s?o>0&&(o-=1):0===o&&t.includes(s)&&(i=!0),i?(""!==n&&r.push(n.trim()),n="",i=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var ps=ds;ds.default=ds;let ms=Ct,fs=ps,gs=class extends ms{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return fs.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var ys=gs;gs.default=gs,ms.registerRule(gs);let ws=Ee,vs=function(e,t={}){let s,r,n,i,o,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,m=d.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(s=d.charCodeAt(f),s){case Bt:case $t:case jt:case Wt:case zt:r=f;do{r+=1,s=d.charCodeAt(r)}while(s===$t||s===Bt||s===jt||s===Wt||s===zt);u=["space",d.slice(f,r)],f=r-1;break;case Kt:case Vt:case Yt:case qt:case Qt:case Zt:case Ht:{let e=String.fromCharCode(s);u=[e,e,f];break}case Gt:if(c=g.length?g.pop()[1]:"",h=d.charCodeAt(f+1),"url"===c&&h!==Ft&&h!==Lt&&h!==$t&&h!==Bt&&h!==jt&&h!==zt&&h!==Wt){r=f;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=f;break}w("bracket")}for(l=r;d.charCodeAt(l-1)===Dt;)l-=1,a=!a}while(a);u=["brackets",d.slice(f,r+1),f,r],f=r}else r=d.indexOf(")",f+1),i=d.slice(f,r+1),-1===r||ss.test(i)?u=["(","(",f]:(u=["brackets",i,f,r],f=r);break;case Ft:case Lt:n=s===Ft?"'":'"',r=f;do{if(a=!1,r=d.indexOf(n,r+1),-1===r){if(p||t){r=f+1;break}w("string")}for(l=r;d.charCodeAt(l-1)===Dt;)l-=1,a=!a}while(a);u=["string",d.slice(f,r+1),f,r],f=r;break;case Xt:es.lastIndex=f+1,es.test(d),r=0===es.lastIndex?d.length-1:es.lastIndex-2,u=["at-word",d.slice(f,r+1),f,r],f=r;break;case Dt:for(r=f,o=!0;d.charCodeAt(r+1)===Dt;)r+=1,o=!o;if(s=d.charCodeAt(r+1),o&&s!==Ut&&s!==$t&&s!==Bt&&s!==jt&&s!==Wt&&s!==zt&&(r+=1,rs.test(d.charAt(r)))){for(;rs.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===$t&&(r+=1)}u=["word",d.slice(f,r+1),f,r],f=r;break;default:s===Ut&&d.charCodeAt(f+1)===Jt?(r=d.indexOf("*/",f+2)+1,0===r&&(p||t?r=d.length:w("comment")),u=["comment",d.slice(f,r+1),f,r],f=r):(ts.lastIndex=f+1,ts.test(d),r=0===ts.la