@powerit/cms-tracker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{createGrpcTransport as e}from"@powerit/cms-grpc";var t,s=Object.defineProperty,r=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),n=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),i=(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))(i||{});const a={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},l={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},c={};function h(e){if(c[e])return c[e];const t=globalThis[e],s=t.prototype,r=e in a?a[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]"))})),o=e in l?l[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return c[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 o=n[e].prototype;return document.body.removeChild(r),o?c[e]=o:s}catch{return s}}const u={};function p(e,t,s){var r;const n=`${e}.${String(s)}`;if(u[n])return u[n].call(t);const o=h(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(u[n]=i,i.call(t)):t[s]}const d={};function f(e,t,s){const r=`${e}.${String(s)}`;if(d[r])return d[r].bind(t);const n=h(e)[s];return"function"!=typeof n?t[s]:(d[r]=n,n.bind(t))}const m={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 h("MutationObserver").constructor}};function g(e){return e.nodeType===e.ELEMENT_NODE}function y(e){const t=e&&"host"in e&&"mode"in e&&m.host(e)||null;return Boolean(t&&"shadowRoot"in t&&m.shadowRoot(t)===e)}function w(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function b(e){try{const s=e.rules||e.cssRules;if(!s)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);const n=Array.from(s,e=>S(e,r)).join("");return(t=n).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 S(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=b(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?T(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?T(s,t):s}}class v{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 C({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:o}){let i=n||"";const a=r&&I(r);return(t[s.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function I(e){return e.toLowerCase()}const k="__rrweb_original__";function x(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?I(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 M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?:[a-z+]+:)?\/\//i,E=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function T(e,t){return(e||"").replace(M,(e,s,r,n,o,i)=>{const a=r||o||i,l=s||n||"";if(!a)return e;if(A.test(a)||E.test(a))return`url(${l}${a}${l})`;if(R.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})`})}function N(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function D(e,t){return function(e,t){const s=Array.from(t.childNodes),r=[];if(s.length>1&&e&&"string"==typeof e){const t=N(e);for(let n=1;n<s.length;n++)if(s[n].textContent&&"string"==typeof s[n].textContent){const o=N(s[n].textContent);for(let s=3;s<o.length;s++){const n=o.substring(0,s);if(2===t.split(n).length){const s=t.indexOf(n);for(let t=s;t<e.length;t++)if(N(e.substring(0,t)).length===s){r.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}let L=1;const P=new RegExp("[^a-z0-9-_:]");function F(){return L++}let _,U;const B=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;const W=new WeakMap;function j(e,t){return t&&""!==t.trim()?G(e,t):t}function V(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function G(e,t){let s=W.get(e);if(s||(s=e.createElement("a"),W.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function Y(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?j(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(z),!(s>=t.length);){let o=r(B);if(","===o.slice(-1))o=j(e,o.substring(0,o.length-1)),n.push(o);else{let r="";o=j(e,o);let i=!1;for(;;){const e=t.charAt(s);if(""===e){n.push((o+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){s+=1,n.push((o+r).trim());break}"("===e&&(i=!0)}r+=e,s+=1}}}return n.join(", ")}(e,r):"style"===s?T(r,G(e)):"object"===t&&"data"===s?j(e,r):r:j(e,r):r}function Z(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&J(m.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&J(m.parentNode(e),t,s)}function H(e,t,s,r){let n;if(g(e)){if(n=e,!m.childNodes(n).length)return!1}else{if(null===m.parentElement(e))return!1;n=m.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(J(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 X(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:h,maskInputFn:u,dataURLOptions:p={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:y=!1,cssCaptured:w=!1}=t,S=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:i.Document,childNodes:[],compatMode:e.compatMode}:{type:i.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return function(e,t){const{doc:s,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:h,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:d=!1,rootId:f}=t,m=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),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=I(e.tagName);return P.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const r=e.attributes[t];Z(g,r.name,r.value)||(y[r.name]=Y(s,g,I(r.name),r.value))}if("link"===g&&o){const t=Array.from(s.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=b(t)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===g&&e.sheet){let t=b(e.sheet);t&&(e.childNodes.length>1&&(t=D(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,s=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=C({element:e,type:x(e),tagName:g,value:t,maskInputOptions:a,maskInputFn:l}):s&&(y.checked=s)}"option"===g&&(e.selected&&!a.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&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,o=k in n?n[k]:n;if(new Uint32Array(o.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)||(y.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)&&(y.rr_dataURL=t)}if("img"===g&&h){_||(_=s.createElement("canvas"),U=_.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{_.width=t.naturalWidth,_.height=t.naturalHeight,U.drawImage(t,0,0),y.rr_dataURL=_.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?y.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=y;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}d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:s}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${s}px`}}"iframe"!==g||p(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let S;try{customElements.get(g)&&(S=!0)}catch(e){}return{type:i.Element,tagName:g,attributes:y,childNodes:[],isSVG:V(e)||void 0,needBlock:m,rootId:f,isCustom:S}}(e,{doc:s,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:u,dataURLOptions:p,inlineImages:d,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:y,rootId:S});case e.TEXT_NODE:return function(e,t){const{needsMask:s,maskTextFn:r,rootId:n,cssCaptured:o}=t,a=m.parentNode(e),l=a&&a.tagName;let c="";const h="STYLE"===l||void 0,u="SCRIPT"===l||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=m.textContent(e),h&&c&&(c=T(c,G(t.doc))));!h&&!u&&c&&s&&(c=r?r(c,m.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:i.Text,textContent:c||"",rootId:n}}(e,{doc:s,needsMask:a,maskTextFn:h,rootId:S,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:i.Comment,textContent:m.textContent(e)||"",rootId:S};default:return!1}}function K(e){return null==e?"":e.toLowerCase()}function $(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:h=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:b={},inlineImages:S=!1,recordCanvas:v=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t;let{needsMask:T}=t,{preserveWhiteSpace:N=!0}=t;if(!T){T=H(e,a,l,void 0===T)}const D=X(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,inlineStylesheet:h,maskInputOptions:u,maskTextFn:p,maskInputFn:d,dataURLOptions:b,inlineImages:S,recordCanvas:v,keepIframeSrcFn:A,newlyAddedElement:E,cssCaptured:R});if(!D)return console.warn(e,"not serialized"),null;let L;L=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===i.Comment)return!0;if(e.type===i.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&&(K(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===K(e.attributes.name)||"icon"===K(e.attributes.rel)||"apple-touch-icon"===K(e.attributes.rel)||"shortcut icon"===K(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&K(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(K(e.attributes.property).match(/^(og|twitter|fb):/)||K(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===K(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===K(e.attributes.name)||"googlebot"===K(e.attributes.name)||"bingbot"===K(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===K(e.attributes.name)||"generator"===K(e.attributes.name)||"framework"===K(e.attributes.name)||"publisher"===K(e.attributes.name)||"progid"===K(e.attributes.name)||K(e.attributes.property).match(/^article:/)||K(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===K(e.attributes.name)||"yandex-verification"===K(e.attributes.name)||"csrf-token"===K(e.attributes.name)||"p:domain_verify"===K(e.attributes.name)||"verify-v1"===K(e.attributes.name)||"verification"===K(e.attributes.name)||"shopify-checkout-api-token"===K(e.attributes.name)))return!0}}return!1}(D,f)||!N&&D.type===i.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:F();const P=Object.assign(D,{id:L});if(r.add(e,P),-2===L)return null;C&&C(e);let _=!c;if(P.type===i.Element){_=_&&!P.needBlock,delete P.needBlock;const t=m.shadowRoot(e);t&&w(t)&&(P.isShadowHost=!0)}if((P.type===i.Document||P.type===i.Element)&&_){f.headWhitespace&&P.type===i.Element&&"head"===P.tagName&&(N=!1);const t={doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:h,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:A,cssCaptured:!1};if(P.type===i.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else{P.type===i.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0);for(const s of Array.from(m.childNodes(e))){const e=$(s,t);e&&P.childNodes.push(e)}}let y=null;if(g(e)&&(y=m.shadowRoot(e)))for(const e of Array.from(m.childNodes(y))){const s=$(e,t);s&&(w(y)&&(s.isShadow=!0),P.childNodes.push(s))}}const U=m.parentNode(e);return U&&y(U)&&w(U)&&(P.isShadow=!0),P.type===i.Element&&"iframe"===P.tagName&&function(e,t,s){const r=e.contentWindow;if(!r)return;let n,o=!1;try{n=r.document.readyState}catch(e){return}if("complete"!==n){const r=setTimeout(()=>{o||(t(),o=!0)},s);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&I){const s=$(t,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:A});s&&I(e,s)}},k),P.type===i.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===O(P.attributes.href))&&function(e,t,s){let r,n=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{n||(t(),n=!0)},s);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(x){const t=$(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:b,inlineImages:S,recordCanvas:v,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:A});t&&x(e,t)}},M),P}function Q(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 ee={exports:{}},te=String,se=function(){return{isColorSupported:!1,reset:te,bold:te,dim:te,italic:te,underline:te,inverse:te,hidden:te,strikethrough:te,black:te,red:te,green:te,yellow:te,blue:te,magenta:te,cyan:te,white:te,gray:te,bgBlack:te,bgRed:te,bgGreen:te,bgYellow:te,bgBlue:te,bgMagenta:te,bgCyan:te,bgWhite:te}};ee.exports=se(),ee.exports.createColors=se;var re=ee.exports;const ne=q(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let oe=re,ie=ne,ae=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),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=oe.isColorSupported),ie&&e&&(t=ie(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=oe.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var le=ae;ae.default=ae;var ce={};ce.isClean=Symbol("isClean"),ce.my=Symbol("my");const he={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ue=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],o=this.raw(n,"before");o&&this.builder(o),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 he[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=he[s]),o.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 pe=ue;ue.default=ue;let de=pe;function fe(e,t){new de(t).stringify(e)}var me=fe;fe.default=fe;let{isClean:ge,my:ye}=ce,we=le,be=pe,Se=me;function ve(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],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>ve(e,s)):("object"===o&&null!==n&&(n=ve(n)),s[r]=n)}return s}let Ce=class{constructor(e={}){this.raws={},this[ge]=!1,this[ye]=!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=ve(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 we(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[ge]){this[ge]=!1;let e=this;for(;e=e.parent;)e[ge]=!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 be).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 o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,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=Se){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 Ie=Ce;Ce.default=Ce;let ke=Ie,xe=class extends ke{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 Oe=xe;xe.default=xe;var Me={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Ae,SourceMapGenerator:Ee}=ne,{existsSync:Re,readFileSync:Te}=ne,{dirname:Ne,join:De}=ne;let Le=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=Ne(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Ae(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=Ne(e),Re(e))return this.mapFile=e,Te(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 Ae)return Ee.fromSourceMap(t).toString();if(t instanceof Ee)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=De(Ne(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 Pe=Le;Le.default=Le;let{SourceMapConsumer:Fe,SourceMapGenerator:_e}=ne,{fileURLToPath:Ue,pathToFileURL:Be}=ne,{isAbsolute:ze,resolve:We}=ne,{nanoid:je}=Me,Ve=ne,Ge=le,Ye=Pe,Ze=Symbol("fromOffsetCache"),Je=Boolean(Fe&&_e),He=Boolean(We&&ze),Xe=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)||ze(t.from)?this.file=t.from:this.file=We(t.from)),He&&Je){let e=new Ye(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 "+je(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;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);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new Ge(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 Ge(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Be&&(n.input.url=Be(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[Ze])s=this[Ze];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[Ze]=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:We(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=ze(a.source)?Be(a.source):new URL(a.source,this.map.consumer().sourceRoot||Be(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ue)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ue(o)}let c=i.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 Ke=Xe;Xe.default=Xe,Ve&&Ve.registerInput&&Ve.registerInput(Xe);let{SourceMapConsumer:$e,SourceMapGenerator:Qe}=ne,{dirname:qe,relative:et,resolve:tt,sep:st}=ne,{pathToFileURL:rt}=ne,nt=Ke,ot=Boolean($e&&Qe),it=Boolean(qe&&tt&&et&&st);var at=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 $e(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&&ot&&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=Qe.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qe({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 Qe({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}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(tt(s,this.mapOpts.annotation)));let r=et(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 nt(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(rt){let t=rt(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;"\\"===st&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let lt=Ie,ct=class extends lt{constructor(e){super(e),this.type="comment"}};var ht=ct;ct.default=ct;let ut,pt,dt,ft,{isClean:mt,my:gt}=ce,yt=Oe,wt=ht,bt=Ie;function St(e){return e.map(e=>(e.nodes&&(e.nodes=St(e.nodes)),delete e.source,e))}function vt(e){if(e[mt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)vt(t)}let Ct=class e extends bt{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",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=St(ut(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 yt(t)]}else if(t.selector)t=[new pt(t)];else if(t.name)t=[new dt(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new wt(t)]}return t.map(t=>(t[gt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[mt]&&vt(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]}};Ct.registerParse=e=>{ut=e},Ct.registerRule=e=>{pt=e},Ct.registerAtRule=e=>{dt=e},Ct.registerRoot=e=>{ft=e};var It=Ct;Ct.default=Ct,Ct.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,dt.prototype):"rule"===e.type?Object.setPrototypeOf(e,pt.prototype):"decl"===e.type?Object.setPrototypeOf(e,yt.prototype):"comment"===e.type?Object.setPrototypeOf(e,wt.prototype):"root"===e.type&&Object.setPrototypeOf(e,ft.prototype),e[gt]=!0,e.nodes&&e.nodes.forEach(e=>{Ct.rebuild(e)})};let kt,xt,Ot=It,Mt=class extends Ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new kt(new xt,this,e).stringify()}};Mt.registerLazyResult=e=>{kt=e},Mt.registerProcessor=e=>{xt=e};var At=Mt;Mt.default=Mt;let Et={};var Rt=function(e){Et[e]||(Et[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Tt=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 Nt=Tt;Tt.default=Tt;let Dt=Nt,Lt=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 Dt(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Pt=Lt;Lt.default=Lt;const Ft="'".charCodeAt(0),_t='"'.charCodeAt(0),Ut="\\".charCodeAt(0),Bt="/".charCodeAt(0),zt="\n".charCodeAt(0),Wt=" ".charCodeAt(0),jt="\f".charCodeAt(0),Vt="\t".charCodeAt(0),Gt="\r".charCodeAt(0),Yt="[".charCodeAt(0),Zt="]".charCodeAt(0),Jt="(".charCodeAt(0),Ht=")".charCodeAt(0),Xt="{".charCodeAt(0),Kt="}".charCodeAt(0),$t=";".charCodeAt(0),Qt="*".charCodeAt(0),qt=":".charCodeAt(0),es="@".charCodeAt(0),ts=/[\t\n\f\r "#'()/;[\\\]{}]/g,ss=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,rs=/.[\r\n"'(/\\]/,ns=/[\da-f]/i;let os=It,is=class extends os{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 as=is;is.default=is,os.registerAtRule(is);let ls,cs,hs=It,us=class extends hs{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 ls(new cs,this,e).stringify()}};us.registerLazyResult=e=>{ls=e},us.registerProcessor=e=>{cs=e};var ps=us;us.default=us,hs.registerRoot(us);let ds={comma:e=>ds.split(e,[","],!0),space:e=>ds.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=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?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var fs=ds;ds.default=ds;let ms=It,gs=fs,ys=class extends ms{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return gs.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 ws=ys;ys.default=ys,ms.registerRule(ys);let bs=Oe,Ss=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case zt:case Wt:case Vt:case Gt:case jt:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===Wt||s===zt||s===Vt||s===Gt||s===jt);u=["space",p.slice(m,r)],m=r-1;break;case Yt:case Zt:case Xt:case Kt:case qt:case $t:case Ht:{let e=String.fromCharCode(s);u=[e,e,m];break}case Jt:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==Ft&&h!==_t&&h!==Wt&&h!==zt&&h!==Vt&&h!==jt&&h!==Gt){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===Ut;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),o=p.slice(m,r+1),-1===r||rs.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case Ft:case _t:n=s===Ft?"'":'"',r=m;do{if(a=!1,r=p.indexOf(n,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===Ut;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case es:ts.lastIndex=m+1,ts.test(p),r=0===ts.lastIndex?p.length-1:ts.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case Ut:for(r=m,i=!0;p.charCodeAt(r+1)===Ut;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==Bt&&s!==Wt&&s!==zt&&s!==Vt&&s!==Gt&&s!==jt&&(r+=1,ns.test(p.charAt(r)))){for(;ns.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===Wt&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===Bt&&p.charCodeAt(m+1)===Qt?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(ss.lastIndex=m+1,ss.test(p),r=0===ss.lastIndex?p.length-1:ss.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},vs=ht,Cs=as,Is=ps,ks=ws;const xs={empty:!0,space:!0};let Os=It,Ms=class{constructor(e){this.input=e,this.root=new Is,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,s,r,n=new Cs;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new vs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ss(this.input)}decl(e,t){let s=new bs;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ks;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",xs[a]||xs[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new ks;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},As=Ke;function Es(e,t){let s=new As(e,t),r=new Ms(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Rs=Es;Es.default=Es,Os.registerParse(Es);let{isClean:Ts,my:Ns}=ce,Ds=at,Ls=me,Ps=It,Fs=At,_s=Rt,Us=Pt,Bs=Rs,zs=ps;const Ws={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},js={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Vs={Once:!0,postcssPlugin:!0,prepare:!0};function Gs(e){return"object"==typeof e&&"function"==typeof e.then}function Ys(e){let t=!1,s=Ws[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function Zs(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ys(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Js(e){return e[Ts]=!1,e.nodes&&e.nodes.forEach(e=>Js(e)),e}let Hs={},Xs=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof Us)n=Js(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=Bs;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Ns]&&Ps.rebuild(n)}else n=Js(s);this.result=new Us(t,n,r),this.helpers={...Hs,postcss:Hs,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!js[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Vs[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(Gs(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ts];){e[Ts]=!0;let t=[Zs(e)];for(;t.length>0;){let e=this.visitTick(t);if(Gs(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Gs(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ls;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Ds(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(Gs(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ts];)e[Ts]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||_s("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Gs(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[Ts])return r[Ts]=!0,void e.push(Zs(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Ts]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ts]=!0;let t=Ys(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Ts]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Xs.registerPostcss=e=>{Hs=e};var Ks=Xs;Xs.default=Xs,zs.registerLazyResult(Xs),Fs.registerLazyResult(Xs);let $s=at,Qs=me,qs=Rt,er=Rs;const tr=Pt;let sr=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=Qs;this.result=new tr(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new $s(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||qs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=er;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var rr=sr;sr.default=sr;let nr=rr,or=Ks,ir=At,ar=ps,lr=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new or(this,e,t):new nr(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var cr=lr;lr.default=lr,ar.registerProcessor(lr),ir.registerProcessor(lr);let hr=Oe,ur=Pe,pr=ht,dr=as,fr=Ke,mr=ps,gr=ws;function yr(e,t){if(Array.isArray(e))return e.map(e=>yr(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:fr.prototype};s.map&&(s.map={...s.map,__proto__:ur.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>yr(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new mr(r);if("decl"===r.type)return new hr(r);if("rule"===r.type)return new gr(r);if("comment"===r.type)return new pr(r);if("atrule"===r.type)return new dr(r);throw new Error("Unknown node type: "+e.type)}var wr=yr;yr.default=yr;let br=le,Sr=Oe,vr=Ks,Cr=It,Ir=cr,kr=me,xr=wr,Or=At,Mr=Nt,Ar=ht,Er=as,Rr=Pt,Tr=Ke,Nr=Rs,Dr=fs,Lr=ws,Pr=ps,Fr=Ie;function _r(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Ir(e)}_r.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new Ir).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return _r([n(s)]).process(e,t)},n},_r.stringify=kr,_r.parse=Nr,_r.fromJSON=xr,_r.list=Dr,_r.comment=e=>new Ar(e),_r.atRule=e=>new Er(e),_r.decl=e=>new Sr(e),_r.rule=e=>new Lr(e),_r.root=e=>new Pr(e),_r.document=e=>new Or(e),_r.CssSyntaxError=br,_r.Declaration=Sr,_r.Container=Cr,_r.Processor=Ir,_r.Document=Or,_r.Comment=Ar,_r.Warning=Mr,_r.AtRule=Er,_r.Result=Rr,_r.Input=Tr,_r.Rule=Lr,_r.Root=Pr,_r.Node=Fr,vr.registerPostcss(_r);var Ur=_r;_r.default=_r;const Br=Q(Ur);Br.stringify,Br.fromJSON,Br.plugin,Br.parse,Br.list,Br.document,Br.comment,Br.atRule,Br.rule,Br.decl,Br.root,Br.CssSyntaxError,Br.Declaration,Br.Container,Br.Processor,Br.Document,Br.Comment,Br.Warning,Br.AtRule,Br.Result,Br.Input,Br.Rule,Br.Root,Br.Node;var zr=Object.defineProperty,Wr=(e,t,s)=>((e,t,s)=>t in e?zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);function jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vr(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 Gr={exports:{}},Yr=String,Zr=function(){return{isColorSupported:!1,reset:Yr,bold:Yr,dim:Yr,italic:Yr,underline:Yr,inverse:Yr,hidden:Yr,strikethrough:Yr,black:Yr,red:Yr,green:Yr,yellow:Yr,blue:Yr,magenta:Yr,cyan:Yr,white:Yr,gray:Yr,bgBlack:Yr,bgRed:Yr,bgGreen:Yr,bgYellow:Yr,bgBlue:Yr,bgMagenta:Yr,bgCyan:Yr,bgWhite:Yr}};Gr.exports=Zr(),Gr.exports.createColors=Zr;var Jr=Gr.exports;const Hr=Vr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Xr=Jr,Kr=Hr,$r=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),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=Xr.isColorSupported),Kr&&e&&(t=Kr(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Xr.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Qr=$r;$r.default=$r;var qr={};qr.isClean=Symbol("isClean"),qr.my=Symbol("my");const en={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let tn=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],o=this.raw(n,"before");o&&this.builder(o),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 en[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=en[s]),o.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 sn=tn;tn.default=tn;let rn=sn;function nn(e,t){new rn(t).stringify(e)}var on=nn;nn.default=nn;let{isClean:an,my:ln}=qr,cn=Qr,hn=sn,un=on;function pn(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],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>pn(e,s)):("object"===o&&null!==n&&(n=pn(n)),s[r]=n)}return s}let dn=class{constructor(e={}){this.raws={},this[an]=!1,this[ln]=!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=pn(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 cn(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[an]){this[an]=!1;let e=this;for(;e=e.parent;)e[an]=!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 hn).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 o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,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=un){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 fn=dn;dn.default=dn;let mn=fn,gn=class extends mn{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 yn=gn;gn.default=gn;var wn={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:bn,SourceMapGenerator:Sn}=Hr,{existsSync:vn,readFileSync:Cn}=Hr,{dirname:In,join:kn}=Hr;let xn=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=In(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new bn(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=In(e),vn(e))return this.mapFile=e,Cn(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 bn)return Sn.fromSourceMap(t).toString();if(t instanceof Sn)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=kn(In(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 On=xn;xn.default=xn;let{SourceMapConsumer:Mn,SourceMapGenerator:An}=Hr,{fileURLToPath:En,pathToFileURL:Rn}=Hr,{isAbsolute:Tn,resolve:Nn}=Hr,{nanoid:Dn}=wn,Ln=Hr,Pn=Qr,Fn=On,_n=Symbol("fromOffsetCache"),Un=Boolean(Mn&&An),Bn=Boolean(Nn&&Tn),zn=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&&(!Bn||/^\w+:\/\//.test(t.from)||Tn(t.from)?this.file=t.from:this.file=Nn(t.from)),Bn&&Un){let e=new Fn(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 "+Dn(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;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);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new Pn(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 Pn(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Rn&&(n.input.url=Rn(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[_n])s=this[_n];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[_n]=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:Nn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=Tn(a.source)?Rn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Rn(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!En)throw new Error("file: protocol is not available in this PostCSS build");l.file=En(o)}let c=i.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 Wn=zn;zn.default=zn,Ln&&Ln.registerInput&&Ln.registerInput(zn);let{SourceMapConsumer:jn,SourceMapGenerator:Vn}=Hr,{dirname:Gn,relative:Yn,resolve:Zn,sep:Jn}=Hr,{pathToFileURL:Hn}=Hr,Xn=Wn,Kn=Boolean(jn&&Vn),$n=Boolean(Gn&&Zn&&Yn&&Jn);var Qn=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||Gn(e.file);!1===this.mapOpts.sourcesContent?(t=new jn(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(),$n&&Kn&&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=Vn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Vn({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 Vn({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.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?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}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?Gn(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=Gn(Zn(s,this.mapOpts.annotation)));let r=Yn(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 Xn(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(Hn){let t=Hn(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;"\\"===Jn&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let qn=fn,eo=class extends qn{constructor(e){super(e),this.type="comment"}};var to=eo;eo.default=eo;let so,ro,no,oo,{isClean:io,my:ao}=qr,lo=yn,co=to,ho=fn;function uo(e){return e.map(e=>(e.nodes&&(e.nodes=uo(e.nodes)),delete e.source,e))}function po(e){if(e[io]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)po(t)}let fo=class e extends ho{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",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=uo(so(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 lo(t)]}else if(t.selector)t=[new ro(t)];else if(t.name)t=[new no(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new co(t)]}return t.map(t=>(t[ao]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[io]&&po(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]}};fo.registerParse=e=>{so=e},fo.registerRule=e=>{ro=e},fo.registerAtRule=e=>{no=e},fo.registerRoot=e=>{oo=e};var mo=fo;fo.default=fo,fo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,no.prototype):"rule"===e.type?Object.setPrototypeOf(e,ro.prototype):"decl"===e.type?Object.setPrototypeOf(e,lo.prototype):"comment"===e.type?Object.setPrototypeOf(e,co.prototype):"root"===e.type&&Object.setPrototypeOf(e,oo.prototype),e[ao]=!0,e.nodes&&e.nodes.forEach(e=>{fo.rebuild(e)})};let go,yo,wo=mo,bo=class extends wo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new go(new yo,this,e).stringify()}};bo.registerLazyResult=e=>{go=e},bo.registerProcessor=e=>{yo=e};var So=bo;bo.default=bo;let vo={};var Co=function(e){vo[e]||(vo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Io=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 ko=Io;Io.default=Io;let xo=ko,Oo=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 xo(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Mo=Oo;Oo.default=Oo;const Ao="'".charCodeAt(0),Eo='"'.charCodeAt(0),Ro="\\".charCodeAt(0),To="/".charCodeAt(0),No="\n".charCodeAt(0),Do=" ".charCodeAt(0),Lo="\f".charCodeAt(0),Po="\t".charCodeAt(0),Fo="\r".charCodeAt(0),_o="[".charCodeAt(0),Uo="]".charCodeAt(0),Bo="(".charCodeAt(0),zo=")".charCodeAt(0),Wo="{".charCodeAt(0),jo="}".charCodeAt(0),Vo=";".charCodeAt(0),Go="*".charCodeAt(0),Yo=":".charCodeAt(0),Zo="@".charCodeAt(0),Jo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ho=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Xo=/.[\r\n"'(/\\]/,Ko=/[\da-f]/i;let $o=mo,Qo=class extends $o{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 qo=Qo;Qo.default=Qo,$o.registerAtRule(Qo);let ei,ti,si=mo,ri=class extends si{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 ei(new ti,this,e).stringify()}};ri.registerLazyResult=e=>{ei=e},ri.registerProcessor=e=>{ti=e};var ni=ri;ri.default=ri,si.registerRoot(ri);let oi={comma:e=>oi.split(e,[","],!0),space:e=>oi.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=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?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var ii=oi;oi.default=oi;let ai=mo,li=ii,ci=class extends ai{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return li.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 hi=ci;ci.default=ci,ai.registerRule(ci);let ui=yn,pi=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case No:case Do:case Po:case Fo:case Lo:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===Do||s===No||s===Po||s===Fo||s===Lo);u=["space",p.slice(m,r)],m=r-1;break;case _o:case Uo:case Wo:case jo:case Yo:case Vo:case zo:{let e=String.fromCharCode(s);u=[e,e,m];break}case Bo:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==Ao&&h!==Eo&&h!==Do&&h!==No&&h!==Po&&h!==Lo&&h!==Fo){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===Ro;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),o=p.slice(m,r+1),-1===r||Xo.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case Ao:case Eo:n=s===Ao?"'":'"',r=m;do{if(a=!1,r=p.indexOf(n,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===Ro;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case Zo:Jo.lastIndex=m+1,Jo.test(p),r=0===Jo.lastIndex?p.length-1:Jo.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case Ro:for(r=m,i=!0;p.charCodeAt(r+1)===Ro;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==To&&s!==Do&&s!==No&&s!==Po&&s!==Fo&&s!==Lo&&(r+=1,Ko.test(p.charAt(r)))){for(;Ko.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===Do&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===To&&p.charCodeAt(m+1)===Go?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(Ho.lastIndex=m+1,Ho.test(p),r=0===Ho.lastIndex?p.length-1:Ho.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},di=to,fi=qo,mi=ni,gi=hi;const yi={empty:!0,space:!0};let wi=mo,bi=class{constructor(e){this.input=e,this.root=new mi,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,s,r,n=new fi;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new di;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=pi(this.input)}decl(e,t){let s=new ui;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new gi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",yi[a]||yi[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new gi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Si=Wn;function vi(e,t){let s=new Si(e,t),r=new bi(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Ci=vi;vi.default=vi,wi.registerParse(vi);let{isClean:Ii,my:ki}=qr,xi=Qn,Oi=on,Mi=mo,Ai=So,Ei=Co,Ri=Mo,Ti=Ci,Ni=ni;const Di={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Li={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Pi={Once:!0,postcssPlugin:!0,prepare:!0};function Fi(e){return"object"==typeof e&&"function"==typeof e.then}function _i(e){let t=!1,s=Di[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function Ui(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:_i(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Bi(e){return e[Ii]=!1,e.nodes&&e.nodes.forEach(e=>Bi(e)),e}let zi={},Wi=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof Ri)n=Bi(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=Ti;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[ki]&&Mi.rebuild(n)}else n=Bi(s);this.result=new Ri(t,n,r),this.helpers={...zi,postcss:zi,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!Li[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Pi[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(Fi(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ii];){e[Ii]=!0;let t=[Ui(e)];for(;t.length>0;){let e=this.visitTick(t);if(Fi(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Fi(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Oi;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new xi(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(Fi(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ii];)e[Ii]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ei("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Fi(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[Ii])return r[Ii]=!0,void e.push(Ui(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Ii]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ii]=!0;let t=_i(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Ii]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Wi.registerPostcss=e=>{zi=e};var ji=Wi;Wi.default=Wi,Ni.registerLazyResult(Wi),Ai.registerLazyResult(Wi);let Vi=Qn,Gi=on,Yi=Co,Zi=Ci;const Ji=Mo;let Hi=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=Gi;this.result=new Ji(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Vi(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Yi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Zi;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Xi=Hi;Hi.default=Hi;let Ki=Xi,$i=ji,Qi=So,qi=ni,ea=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new $i(this,e,t):new Ki(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ta=ea;ea.default=ea,qi.registerProcessor(ea),Qi.registerProcessor(ea);let sa=yn,ra=On,na=to,oa=qo,ia=Wn,aa=ni,la=hi;function ca(e,t){if(Array.isArray(e))return e.map(e=>ca(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:ia.prototype};s.map&&(s.map={...s.map,__proto__:ra.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>ca(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new aa(r);if("decl"===r.type)return new sa(r);if("rule"===r.type)return new la(r);if("comment"===r.type)return new na(r);if("atrule"===r.type)return new oa(r);throw new Error("Unknown node type: "+e.type)}var ha=ca;ca.default=ca;let ua=Qr,pa=yn,da=ji,fa=mo,ma=ta,ga=on,ya=ha,wa=So,ba=ko,Sa=to,va=qo,Ca=Mo,Ia=Wn,ka=Ci,xa=ii,Oa=hi,Ma=ni,Aa=fn;function Ea(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ma(e)}Ea.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new ma).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return Ea([n(s)]).process(e,t)},n},Ea.stringify=ga,Ea.parse=ka,Ea.fromJSON=ya,Ea.list=xa,Ea.comment=e=>new Sa(e),Ea.atRule=e=>new va(e),Ea.decl=e=>new pa(e),Ea.rule=e=>new Oa(e),Ea.root=e=>new Ma(e),Ea.document=e=>new wa(e),Ea.CssSyntaxError=ua,Ea.Declaration=pa,Ea.Container=fa,Ea.Processor=ma,Ea.Document=wa,Ea.Comment=Sa,Ea.Warning=ba,Ea.AtRule=va,Ea.Result=Ca,Ea.Input=Ia,Ea.Rule=Oa,Ea.Root=Ma,Ea.Node=Aa,da.registerPostcss(Ea);var Ra=Ea;Ea.default=Ea;const Ta=jr(Ra);Ta.stringify,Ta.fromJSON,Ta.plugin,Ta.parse,Ta.list,Ta.document,Ta.comment,Ta.atRule,Ta.rule,Ta.decl,Ta.root,Ta.CssSyntaxError,Ta.Declaration,Ta.Container,Ta.Processor,Ta.Document,Ta.Comment,Ta.Warning,Ta.AtRule,Ta.Result,Ta.Input,Ta.Rule,Ta.Root,Ta.Node;class Na{constructor(...e){Wr(this,"parentElement",null),Wr(this,"parentNode",null),Wr(this,"ownerDocument"),Wr(this,"firstChild",null),Wr(this,"lastChild",null),Wr(this,"previousSibling",null),Wr(this,"nextSibling",null),Wr(this,"ELEMENT_NODE",1),Wr(this,"TEXT_NODE",3),Wr(this,"nodeType"),Wr(this,"nodeName"),Wr(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Na))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Da={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},La={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pa={};function Fa(e){if(Pa[e])return Pa[e];const t=globalThis[e],s=t.prototype,r=e in Da?Da[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]"))})),o=e in La?La[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return Pa[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 o=n[e].prototype;return document.body.removeChild(r),o?Pa[e]=o:s}catch{return s}}const _a={};function Ua(e,t,s){var r;const n=`${e}.${String(s)}`;if(_a[n])return _a[n].call(t);const o=Fa(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(_a[n]=i,i.call(t)):t[s]}const Ba={};function za(e,t,s){const r=`${e}.${String(s)}`;if(Ba[r])return Ba[r].bind(t);const n=Fa(e)[s];return"function"!=typeof n?t[s]:(Ba[r]=n,n.bind(t))}function Wa(){return Fa("MutationObserver").constructor}const ja={childNodes:function(e){return Ua("Node",e,"childNodes")},parentNode:function(e){return Ua("Node",e,"parentNode")},parentElement:function(e){return Ua("Node",e,"parentElement")},textContent:function(e){return Ua("Node",e,"textContent")},contains:function(e,t){return za("Node",e,"contains")(t)},getRootNode:function(e){return za("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ua("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ua("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ua("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ua("Element",e,"querySelectorAll")(t)},mutationObserver:Wa};function Va(e,t,s=document){const r={capture:!0,passive:!0};return s.addEventListener(e,t,r),()=>s.removeEventListener(e,t,r)}const Ga="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ya={map:{},getId:()=>(console.error(Ga),-1),getNode:()=>(console.error(Ga),null),removeNodeFromMap(){console.error(Ga)},has:()=>(console.error(Ga),!1),reset(){console.error(Ga)}};function Za(e,t,s={}){let r=null,n=0;return function(...o){const i=Date.now();n||!1!==s.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),n=i,e.apply(l,o)):r||!1===s.trailing||(r=setTimeout(()=>{n=!1===s.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function Ja(e,t,s,r,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,r?s:{set(e){setTimeout(()=>{s.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Ja(e,t,o||{},!0)}function Ha(e,t,s){try{if(!(t in e))return()=>{};const r=e[t],n=s(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=n,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ya=new Proxy(Ya,{get:(e,t,s)=>("map"===t&&console.error(Ga),Reflect.get(e,t,s))}));let Xa=Date.now;function Ka(e){var t,s,r,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ja.parentElement(o.body))?void 0:t.scrollLeft)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=ja.parentElement(o.body))?void 0:r.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function $a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function qa(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ja.parentElement(e)}function el(e,t,s,r){if(!e)return!1;const n=qa(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(r&&null!==n.closest("."+t))return!0}else if(J(n,t,r))return!0}catch(e){}if(s){if(n.matches(s))return!0;if(r&&null!==n.closest(s))return!0}return!1}function tl(e,t,s){return!("TITLE"!==e.tagName||!s.headTitleMutations)||-2===t.getId(e)}function sl(e,t){if(y(e))return!1;const s=t.getId(e);if(!t.has(s))return!0;const r=ja.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||sl(r,t))}function rl(e){return Boolean(e.changedTouches)}function nl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ol(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function il(e){return!!e&&(e instanceof Na&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ja.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Xa=()=>(new Date).getTime());class al{constructor(){r(this,"id",1),r(this,"styleIDMap",new WeakMap),r(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let s;return s=void 0===t?this.id++:t,this.styleIDMap.set(e,s),this.idStyleMap.set(s,e),s}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ll(e){var t;let s=null;return"getRootNode"in e&&(null==(t=ja.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ja.host(ja.getRootNode(e))&&(s=ja.host(ja.getRootNode(e))),s}function cl(e){const t=e.ownerDocument;if(!t)return!1;const s=function(e){let t,s=e;for(;t=ll(s);)s=t;return s}(e);return ja.contains(t,s)}function hl(e){const t=e.ownerDocument;return!!t&&(ja.contains(t,e)||cl(e))}var ul=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ul||{}),pl=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(pl||{}),dl=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(dl||{}),fl=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(fl||{}),ml=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ml||{}),gl=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(gl||{}),yl=(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))(yl||{});function wl(e){return"__ln"in e}class bl{constructor(){r(this,"length",0),r(this,"head",null),r(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&wl(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&wl(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Sl=(e,t)=>`${e}@${t}`;class vl{constructor(){r(this,"frozen",!1),r(this,"locked",!1),r(this,"texts",[]),r(this,"attributes",[]),r(this,"attributeMap",new WeakMap),r(this,"removes",[]),r(this,"mapRemoves",[]),r(this,"movedMap",{}),r(this,"addedSet",new Set),r(this,"movedSet",new Set),r(this,"droppedSet",new Set),r(this,"removesSubTreeCache",new Set),r(this,"mutationCb"),r(this,"blockClass"),r(this,"blockSelector"),r(this,"maskTextClass"),r(this,"maskTextSelector"),r(this,"inlineStylesheet"),r(this,"maskInputOptions"),r(this,"maskTextFn"),r(this,"maskInputFn"),r(this,"keepIframeSrcFn"),r(this,"recordCanvas"),r(this,"inlineImages"),r(this,"slimDOMOptions"),r(this,"dataURLOptions"),r(this,"doc"),r(this,"mirror"),r(this,"iframeManager"),r(this,"stylesheetManager"),r(this,"shadowDomManager"),r(this,"canvasManager"),r(this,"processedNodeManager"),r(this,"unattachedDoc"),r(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),r(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new bl,r=e=>{let t=e,s=-2;for(;-2===s;)t=t&&t.nextSibling,s=t&&this.mirror.getId(t);return s},n=n=>{const o=ja.parentNode(n);if(!o||!hl(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=y(o)?this.mirror.getId(ll(n)):this.mirror.getId(o),l=r(n);if(-1===a||-1===l)return s.addNode(n);const c=$(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{nl(e,this.mirror)&&this.iframeManager.addIframe(e),ol(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),il(n)&&this.shadowDomManager.addShadowRoot(ja.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Il(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(ja.parentNode(e))||n(e);for(const e of this.addedSet)kl(this.droppedSet,e)||Il(this.removesSubTreeCache,e,this.mirror)?kl(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;s.length;){let e=null;if(o){const t=this.mirror.getId(ja.parentNode(o.value)),s=r(o.value);-1!==t&&-1!==s&&(e=o)}if(!e){let t=s.tail;for(;t;){const s=t;if(t=t.previous,s){const t=this.mirror.getId(ja.parentNode(s.value));if(-1===r(s.value))continue;if(-1!==t){e=s;break}{const t=s.value,r=ja.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ja.host(r);if(-1!==this.mirror.getId(t)){e=s;break}}}}}}if(!e){for(;s.head;)s.removeNode(s.head.value);break}o=e.previous,s.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,s=ja.parentNode(t);return s&&"TEXTAREA"===s.tagName&&this.genTextAreaValueMutation(s),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const s=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);s.length<t.style.length&&(s+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),r(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ja.childNodes(e),e=>ja.textContent(e)||"").join("")}),r(this,"processMutation",e=>{if(!tl(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ja.textContent(e.target);el(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:H(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,qa(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,r=e.target.getAttribute(s);if("value"===s){const e=x(t);r=C({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(el(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===s&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;s="rr_src"}if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===s&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Z(t.tagName,s))if(n.attributes[s]=Y(this.doc,I(t.tagName),I(s),r),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const s=this.unattachedDoc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==s.style.getPropertyValue(e)||o!==s.style.getPropertyPriority(e)?n.styleDiff[e]=""===o?r:[r,o]:n._unchangedStyles[e]=[r,o]}for(const e of Array.from(s.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===s&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(el(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),r=y(e.target)?this.mirror.getId(ja.host(e.target)):this.mirror.getId(e.target);el(e.target,this.blockClass,this.blockSelector,!1)||tl(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Cl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===s||sl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Sl(s,r)]?Cl(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:!(!y(e.target)||!w(e.target))||void 0}),function(e,t){const s=[e];for(;s.length;){const e=s.pop();t.has(e)||(t.add(e),ja.childNodes(e).forEach(e=>s.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),r(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(tl(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&-1!==s&&(this.movedMap[Sl(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);el(e,this.blockClass,this.blockSelector,!1)||(ja.childNodes(e).forEach(e=>this.genAdds(e)),il(e)&&ja.childNodes(ja.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Cl(e,t){e.delete(t),ja.childNodes(t).forEach(t=>Cl(e,t))}function Il(e,t,s){return 0!==e.size&&function(e,t){const s=ja.parentNode(t);return!!s&&e.has(s)}(e,t)}function kl(e,t){return 0!==e.size&&xl(e,t)}function xl(e,t){const s=ja.parentNode(t);return!!s&&(!!e.has(s)||xl(e,s))}let Ol;const Ml=e=>{if(!Ol)return e;return(...t)=>{try{return e(...t)}catch(e){if(Ol&&!0===Ol(e))return;throw e}}},Al=[];function El(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Rl(e,t){const s=new vl;Al.push(s),s.init(e);const r=new(Wa())(Ml(s.processMutations.bind(s)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Tl({mouseInteractionCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(dl).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=I(o);const c=(t=>o=>{const i=El(o);if(el(i,r,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=fl.Mouse;break;case"touch":a=fl.Touch;break;case"pen":a=fl.Pen}a===fl.Touch?dl[t]===dl.MouseDown?c="TouchStart":dl[t]===dl.MouseUp&&(c="TouchEnd"):fl.Pen}else rl(o)&&(a=fl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===fl.Touch||c.startsWith("Mouse")&&a===fl.Mouse)&&(a=null)):dl[t]===dl.Click&&(a=l,l=null);const h=rl(o)?o.changedTouches[0]:o;if(!h)return;const u=s.getId(i),{clientX:p,clientY:d}=h;Ml(e)({type:dl[c],id:u,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(dl[o]){case dl.MouseDown:case dl.MouseUp:i=i.replace("mouse","pointer");break;case dl.TouchStart:case dl.TouchEnd:return}a.push(Va(i,c,t))}),Ml(()=>{a.forEach(e=>e())})}function Nl({scrollCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){return Va("scroll",Ml(Za(Ml(o=>{const i=El(o);if(!i||el(i,r,n,!0))return;const a=s.getId(i);if(i===t&&t.defaultView){const s=Ka(t.defaultView);e({id:a,x:s.left,y:s.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const Dl=["INPUT","TEXTAREA","SELECT"],Ll=new WeakMap;function Pl(e){return function(e,t){if(Bl("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Bl("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Bl("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Bl("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const s=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(s)}else if(e.parentStyleSheet){const s=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(s)}return t}(e,[])}function Fl(e,t,s){let r,n;return e?(e.ownerNode?r=t.getId(e.ownerNode):n=s.getId(e),{styleId:n,id:r}):{}}function _l({mirror:e,stylesheetManager:t},s){var r,n,o;let i=null;i="#document"===s.nodeName?e.getId(s):e.getId(ja.host(s));const a="#document"===s.nodeName?null==(r=s.defaultView)?void 0:r.Document:null==(o=null==(n=s.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var s;const r=null==(s=l.set)?void 0:s.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),Ml(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Ul(e,t={}){const s=e.doc.defaultView;if(!s)return()=>{};let r;!function(e,t){const{mutationCb:s,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:u,fontCb:p,selectionCb:d,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),s(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),h(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(r=Rl(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:s,mirror:r}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Za(Ml(t=>{const s=Date.now()-i;e(a.map(e=>(e.timeOffset-=s,e)),t),a=[],i=null}),o),c=Ml(Za(Ml(e=>{const t=El(e),{clientX:s,clientY:n}=rl(e)?e.changedTouches[0]:e;i||(i=Xa()),a.push({x:s,y:n,id:r.getId(t),timeOffset:Xa()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?pl.Drag:e instanceof MouseEvent?pl.MouseMove:pl.TouchMove)}),n,{trailing:!1})),h=[Va("mousemove",c,s),Va("touchmove",c,s),Va("drag",c,s)];return Ml(()=>{h.forEach(e=>e())})}(e),o=Tl(e),i=Nl(e),a=function({viewportResizeCb:e},{win:t}){let s=-1,r=-1;return Va("resize",Ml(Za(Ml(()=>{const t=$a(),n=Qa();s===t&&r===n||(e({width:Number(n),height:Number(t)}),s=t,r=n)}),200)),t)}(e,{win:s}),l=function({inputCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:h}){function u(e){let s=El(e);const c=e.isTrusted,u=s&&s.tagName;if(s&&"OPTION"===u&&(s=ja.parentElement(s)),!s||!u||Dl.indexOf(u)<0||el(s,r,n,!0))return;if(s.classList.contains(o)||i&&s.matches(i))return;let d=s.value,f=!1;const m=x(s)||"";"radio"===m||"checkbox"===m?f=s.checked:(a[u.toLowerCase()]||a[m])&&(d=C({element:s,maskInputOptions:a,tagName:u,type:m,value:d,maskInputFn:l})),p(s,h?{text:d,isChecked:f,userTriggered:c}:{text:d,isChecked:f});const g=s.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==s){const t=e.value;p(e,h?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,r){const n=Ll.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Ll.set(t,r);const n=s.getId(t);Ml(e)({...r,id:n})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>Va(e,Ml(u),t)),f=t.defaultView;if(!f)return()=>{d.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...g.map(e=>Ja(e[0],e[1],{set(){Ml(u)({target:this,isTrusted:!1})}},!1,f))),Ml(()=>{d.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:r,sampling:n,doc:o}){const i=Ml(o=>Za(Ml(n=>{const i=El(n);if(!i||el(i,t,s,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:h,loop:u}=i;e({type:o,id:r.getId(i),currentTime:a,volume:l,muted:c,playbackRate:h,loop:u})}),n.media||500)),a=[Va("play",i(gl.Play),o),Va("pause",i(gl.Pause),o),Va("seeked",i(gl.Seeked),o),Va("volumechange",i(gl.VolumeChange),o),Va("ratechange",i(gl.RateChange),o)];return Ml(()=>{a.forEach(e=>e())})}(e);let h=()=>{},u=()=>{},p=()=>{},d=()=>{};e.recordDOM&&(h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ml((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=Fl(n,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,s=this.cssRules.length){const n=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[n,s])};const o=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=Fl(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=Fl(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),r.apply(n,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=Fl(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),r.apply(n,o)})}));const l={};zl("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(zl("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),zl("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),zl("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,n])=>{c[r]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ml((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=Fl(n.parentStyleSheet,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Pl(n),a||0]}]}),r.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=Fl(n.parentStyleSheet,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Pl(n),i]}]}),r.apply(n,o)})})}),Ml(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:s}),u=_l(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:r},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ml((n,i,a)=>{var l;const[c,h,u]=a;if(s.has(c))return o.apply(i,[c,h,u]);const{id:p,styleId:d}=Fl(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:c,value:h,priority:u},index:Pl(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ml((n,o,a)=>{var l;const[c]=a;if(s.has(c))return i.apply(o,[c]);const{id:h,styleId:u}=Fl(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||u&&-1!==u)&&e({id:h,styleId:u,remove:{property:c},index:Pl(o.parentRule)}),n.apply(o,a)})}),Ml(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:s}),e.collectFonts&&(d=function({fontCb:e,doc:t}){const s=t.defaultView;if(!s)return()=>{};const r=[],n=new WeakMap,o=s.FontFace;s.FontFace=function(e,t,s){const r=new o(e,t,s);return n.set(r,{family:e,buffer:"string"!=typeof t,descriptors:s,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=Ha(t.fonts,"add",function(t){return function(s){return setTimeout(Ml(()=>{const t=n.get(s);t&&(e(t),n.delete(s))}),0),t.apply(this,[s])}});return r.push(()=>{s.FontFace=o}),r.push(i),Ml(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:s,blockClass:r,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Ml(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:h}=o;el(i,r,n,!0)||el(c,r,n,!0)||a.push({start:s.getId(i),startOffset:l,end:s.getId(c),endOffset:h})}o({ranges:a})});return a(),Va("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const s=e.defaultView;return s&&s.customElements?Ha(s.customElements,"define",function(e){return function(s,r,n){try{t({define:{name:s}})}catch(e){console.warn(`Custom element callback failed for ${s}`)}return e.apply(this,[s,r,n])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,s,t.options));return Ml(()=>{Al.forEach(e=>e.reset()),null==r||r.disconnect(),n(),o(),i(),a(),l(),c(),h(),u(),p(),d(),f(),m(),g.forEach(e=>e())})}function Bl(e){return void 0!==window[e]}function zl(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Wl{constructor(e){r(this,"iframeIdToRemoteIdMap",new WeakMap),r(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,r){const n=s||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const s=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,s,r))}getRemoteId(e,t,s){const r=s||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=r.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,s))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class jl{constructor(e){r(this,"iframes",new WeakMap),r(this,"crossOriginIframeMap",new WeakMap),r(this,"crossOriginIframeMirror",new Wl(F)),r(this,"crossOriginIframeStyleMirror"),r(this,"crossOriginIframeRootIdMap",new WeakMap),r(this,"mirror"),r(this,"mutationCb"),r(this,"wrappedEmit"),r(this,"loadListener"),r(this,"stylesheetManager"),r(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(s=e.contentWindow)||s.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const r=this.transformCrossOriginEvent(s,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case ul.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:ul.IncrementalSnapshot,data:{source:pl.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ul.Meta:case ul.Load:case ul.DomContentLoaded:return!1;case ul.Plugin:return t;case ul.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ul.IncrementalSnapshot:switch(t.data.source){case pl.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(t.node,s)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case pl.Drag:case pl.TouchMove:case pl.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case pl.ViewportResize:return!1;case pl.MediaInteraction:case pl.MouseInteraction:case pl.Scroll:case pl.CanvasMutation:case pl.Input:return this.replaceIds(t.data,e,["id"]),t;case pl.StyleSheetRule:case pl.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case pl.Font:return t;case pl.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case pl.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(s=t.data.styles)||s.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,s,r){for(const n of r)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===yl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Vl{constructor(e){r(this,"shadowDoms",new WeakSet),r(this,"mutationCb"),r(this,"scrollCb"),r(this,"bypassOptions"),r(this,"mirror"),r(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!w(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=Rl({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Nl({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(ja.host(e))),this.restoreHandlers.push(_l({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const s=this;this.restoreHandlers.push(Ha(e.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r),o=ja.shadowRoot(this);return o&&hl(this)&&s.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Gl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yl="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zl=0;Zl<64;Zl++)Yl[Gl.charCodeAt(Zl)]=Zl;const Jl=new Map;const Hl=(e,t,s)=>{if(!e||!$l(e,t)&&"object"!=typeof e)return;const r=function(e,t){let s=Jl.get(e);return s||(s=new Map,Jl.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}(s,e.constructor.name);let n=r.indexOf(e);return-1===n&&(n=r.length,r.push(e)),n};function Xl(e,t,s){if(e instanceof Array)return e.map(e=>Xl(e,t,s));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,s=new Uint8Array(e),r=s.length,n="";for(t=0;t<r;t+=3)n+=Gl[s[t]>>2],n+=Gl[(3&s[t])<<4|s[t+1]>>4],n+=Gl[(15&s[t+1])<<2|s[t+2]>>6],n+=Gl[63&s[t+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Xl(e.buffer,t,s),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:s}=e;return{rr_type:t,src:s}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Xl(e.data,t,s),e.width,e.height]}}if($l(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Hl(e,t,s)}}return e}const Kl=(e,t,s)=>e.map(e=>Xl(e,t,s)),$l=(e,t)=>{const s=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(s.find(s=>e instanceof t[s]))};function Ql(e,t,s,r){const n=[];try{const o=Ha(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!el(this,t,s,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function ql(e,t,s,r,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Ha(e,l,function(e){return function(...i){const a=e.apply(this,i);if(Hl(a,o,this),"tagName"in this.canvas&&!el(this.canvas,r,n,!0)){const e=Kl(i,o,this),r={type:t,property:l,args:e};s(this.canvas,r)}return a}});i.push(a)}catch{const r=Ja(e,l,{set(e){s(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(r)}return i}const ec="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",tc="undefined"!=typeof window&&window.Blob&&new Blob([(sc=ec,Uint8Array.from(atob(sc),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var sc;function rc(e){let t;try{if(t=tc&&(window.URL||window.webkitURL).createObjectURL(tc),!t)throw"";const s=new Worker(t,{name:null==e?void 0:e.name});return s.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),s}catch(t){return new Worker("data:text/javascript;base64,"+ec,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class nc{constructor(e){r(this,"pendingCanvasMutations",new Map),r(this,"rafStamps",{latestId:0,invokeId:null}),r(this,"mirror"),r(this,"mutationCb"),r(this,"resetObservers"),r(this,"frozen",!1),r(this,"locked",!1),r(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:s,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(s,n,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,s,n,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,r,n){const o=Ql(t,s,r,!0),i=new Map,a=new rc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:s,type:r,width:n,height:o}=e.data;this.mutationCb({id:t,type:ml["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:r}]},0,0]}]})};const l=1e3/e;let c,h=0;const u=e=>{h&&e-h<l||(h=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{el(t,s,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const s=this.mirror.getId(e);if(i.get(s))return;if(0===e.width||0===e.height)return;if(i.set(s,!0),["webgl","webgl2"].includes(e.__context)){const s=e.getContext(e.__context);!1===(null==(t=null==s?void 0:s.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&s.clear(s.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:s,bitmap:r,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[r])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Ql(e,t,s,!1),n=function(e,t,s,r){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=Ha(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return el(this.canvas,s,r,!0)||setTimeout(()=>{const s=Kl(o,t,this);e(this.canvas,{type:ml["2D"],property:i,args:s})},0),n.apply(this,o)}});n.push(o)}catch{const s=Ja(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:ml["2D"],property:i,args:[t],setter:!0})}});n.push(s)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s),o=function(e,t,s,r){const n=[];return n.push(...ql(t.WebGLRenderingContext.prototype,ml.WebGL,e,s,r,t)),void 0!==t.WebGL2RenderingContext&&n.push(...ql(t.WebGL2RenderingContext.prototype,ml.WebGL2,e,s,r,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{r(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||-1===t)return;const r=s.map(e=>{const{type:t,...s}=e;return s}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e)}}class oc{constructor(e){r(this,"trackedLinkElements",new WeakSet),r(this,"mutationCb"),r(this,"adoptedStyleSheetCb"),r(this,"styleMirror",new al),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const s={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,s)=>({rule:S(e,t.href),index:s}))})),s.styleIds.push(e)}r.length>0&&(s.styles=r),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ic{constructor(){r(this,"nodeMap",new WeakMap),r(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let ac,lc,cc,hc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(t=e.contentWindow)?void 0:t.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const uc=new v;function pc(e={}){const{emit:t,checkoutEveryNms:s,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:d,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:I=!1,recordCrossOriginIframes:k=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:M=!1,inlineImages:A=!1,plugins:E,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N}=e;Ol=N;const D=!k||window.parent===window;let L=!1;if(!D)try{window.parent.document&&(L=!1)}catch(e){L=!0}if(D&&!t)throw new Error("emit function is required");if(!D&&!L)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),uc.reset();const P=!0===u?{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}:void 0!==p?p:{password:!0},F=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d,headTitleMutations:"all"===d}:d||{};let _;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const B=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!L&&(e=y(e)),e};ac=(e,n)=>{var o;const i=e;if(i.timestamp=Xa(),!(null==(o=Al[0])?void 0:o.isFrozen())||i.type===ul.FullSnapshot||i.type===ul.IncrementalSnapshot&&i.data.source===pl.Mutation||Al.forEach(e=>e.unfreeze()),D)null==t||t(B(i),n);else if(L){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===ul.FullSnapshot)_=i,U=0;else if(i.type===ul.IncrementalSnapshot){if(i.data.source===pl.Mutation&&i.data.isAttachIframe)return;U++;const e=r&&U>=r,t=s&&i.timestamp-_.timestamp>s;(e||t)&&lc(!0)}};const z=e=>{ac({type:ul.IncrementalSnapshot,data:{source:pl.Mutation,...e}})},W=e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.Scroll,...e}}),j=e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.CanvasMutation,...e}}),V=new oc({mutationCb:z,adoptedStyleSheetCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.AdoptedStyleSheet,...e}})}),G=new jl({mirror:uc,mutationCb:z,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:ac});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:uc,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const Y=new ic;cc=new nc({recordCanvas:I,mutationCb:j,win:window,blockClass:n,blockSelector:o,mirror:uc,sampling:w.canvas,dataURLOptions:b});const Z=new Vl({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:P,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:I,inlineImages:A,sampling:w,slimDOMOptions:F,iframeManager:G,stylesheetManager:V,canvasManager:cc,keepIframeSrcFn:R,processedNodeManager:Y},mirror:uc});lc=(e=!1)=>{if(!C)return;ac({type:ul.Meta,data:{href:window.location.href,width:Qa(),height:$a()}},e),V.reset(),Z.init(),Al.forEach(e=>e.lock());const t=function(e,t){const{mirror:s=new v,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:u,maskInputFn:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C=()=>!1}=t||{};return $(e,{doc:e,mirror:s,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{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}:!1===h?{password:!0}:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:uc,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:P,maskTextFn:m,maskInputFn:f,slimDOM:F,dataURLOptions:b,recordCanvas:I,inlineImages:A,onSerialize:e=>{nl(e,uc)&&G.addIframe(e),ol(e,uc)&&V.trackLinkElement(e),il(e)&&Z.addShadowRoot(ja.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");ac({type:ul.FullSnapshot,data:{node:t,initialOffset:Ka(window)}},e),Al.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,uc.getId(document))};try{const e=[],t=e=>{var t;return Ml(Ul)({mutationCb:z,mousemoveCb:(e,t)=>ac({type:ul.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.ViewportResize,...e}}),inputCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.Input,...e}}),mediaInteractionCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.MediaInteraction,...e}}),styleSheetRuleCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.StyleSheetRule,...e}}),styleDeclarationCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.StyleDeclaration,...e}}),canvasMutationCb:j,fontCb:e=>ac({type:ul.IncrementalSnapshot,data:{source:pl.Font,...e}}),selectionCb:e=>{ac({type:ul.IncrementalSnapshot,data:{source:pl.Selection,...e}})},customElementCb:e=>{ac({type:ul.IncrementalSnapshot,data:{source:pl.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:P,inlineStylesheet:h,sampling:w,recordDOM:C,recordCanvas:I,inlineImages:A,userTriggeredOnInput:O,collectFonts:M,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:F,dataURLOptions:b,mirror:uc,iframeManager:G,stylesheetManager:V,shadowDomManager:Z,processedNodeManager:Y,canvasManager:cc,ignoreCSSAttributes:T,plugins:(null==(t=null==E?void 0:E.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>ac({type:ul.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};G.addLoadListener(s=>{try{e.push(t(s.contentDocument))}catch(e){console.warn(e)}});const s=()=>{lc(),e.push(t(document)),hc=!0};return"interactive"===document.readyState||"complete"===document.readyState?s():(e.push(Va("DOMContentLoaded",()=>{ac({type:ul.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&s()})),e.push(Va("load",()=>{ac({type:ul.Load,data:{}}),"load"===x&&s()},window))),()=>{e.forEach(e=>e()),Y.destroy(),hc=!1,Ol=void 0}}catch(e){console.warn(e)}}var dc,fc;pc.addCustomEvent=(e,t)=>{if(!hc)throw new Error("please add custom event after start recording");ac({type:ul.Custom,data:{tag:e,payload:t}})},pc.freezePage=()=>{Al.forEach(e=>e.freeze())},pc.takeFullSnapshot=e=>{if(!hc)throw new Error("please take full snapshot after start recording");lc(e)},pc.mirror=uc,(fc=dc||(dc={}))[fc.NotStarted=0]="NotStarted",fc[fc.Running=1]="Running",fc[fc.Stopped=2]="Stopped";const{addCustomEvent:mc}=pc,{freezePage:gc}=pc,{takeFullSnapshot:yc}=pc;class wc{constructor(e={}){this.storageKey=e.storageKey||"powerit_tracker",this.sessionTimeout=e.sessionTimeout||18e5,this.session=null}getOrCreateSession(){const e=this._getStoredSession();return e&&!this._isExpired(e)?(this.session=e,this.session.lastActivityAt=Date.now(),this._saveSession(),this.session):this._createSession()}getSession(){return this.session}getVisitorId(){return this.session?.visitorId||null}getSessionId(){return this.session?.sessionId||null}linkToAnalytics(e){if(!this.session||!e)return;const t=e.getVisitorId?.(),s=e.getSessionId?.();t&&(this.session.visitorId=t),s&&(this.session.linkedToAnalytics=!0,this.session.analyticsSessionId=s),this._saveSession()}touch(){this.session&&(this.session.lastActivityAt=Date.now(),this._saveSession())}incrementEventCount(e=1){this.session&&(this.session.eventCount+=e)}endSession(){this._clearSession(),this.session=null}isSessionValid(){return this.session&&!this._isExpired(this.session)}_createSession(){return this.session={sessionId:this._generateId(),visitorId:this._getOrCreateVisitorId(),startedAt:Date.now(),lastActivityAt:Date.now(),entryPage:"undefined"!=typeof window?window.location.pathname:"/",entryUrl:"undefined"!=typeof window?window.location.href:"/",eventCount:0,linkedToAnalytics:!1,analyticsSessionId:null},this._saveSession(),this.session}_generateId(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}_getOrCreateVisitorId(){if("undefined"==typeof localStorage)return this._generateId();const e=`${this.storageKey}_visitor`;let t=localStorage.getItem(e);if(!t){t=this._generateId();try{localStorage.setItem(e,t)}catch{}}return t}_getStoredSession(){if("undefined"==typeof sessionStorage)return null;try{const e=sessionStorage.getItem(`${this.storageKey}_session`);return e?JSON.parse(e):null}catch{return null}}_saveSession(){if("undefined"!=typeof sessionStorage&&this.session)try{sessionStorage.setItem(`${this.storageKey}_session`,JSON.stringify(this.session))}catch{}}_clearSession(){"undefined"!=typeof sessionStorage&&sessionStorage.removeItem(`${this.storageKey}_session`)}_isExpired(e){return Date.now()-e.lastActivityAt>this.sessionTimeout}}function bc(e){return new wc(e)}const Sc={respectDoNotTrack:!0,blockClass:"rr-block",blockSelector:null,ignoreClass:"rr-ignore",ignoreSelector:null,maskTextClass:"rr-mask",maskTextSelector:null,maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0,creditCard:!0,text:!1,textarea:!1,select:!1},blockedPages:[],allowedPages:[]},vc=['input[type="password"]','input[name*="credit"]','input[name*="card"]','input[name*="cvv"]','input[name*="ssn"]','input[autocomplete="cc-number"]','input[autocomplete="cc-csc"]','input[autocomplete="cc-exp"]',"[data-sensitive]","[data-private]","[data-no-record]"];function Cc(){return"undefined"!=typeof navigator&&("1"===navigator.doNotTrack||"yes"===navigator.doNotTrack||"undefined"!=typeof window&&"1"===window.doNotTrack)}function Ic(e,t){const{blockedPages:s=[],allowedPages:r=[]}=e;return r.length>0?r.some(e=>kc(e,t)):!(s.length>0)||!s.some(e=>kc(e,t))}function kc(e,t){return e instanceof RegExp?e.test(t):e.endsWith("*")?t.startsWith(e.slice(0,-1)):t===e||t.startsWith(e+"/")}function xc(e){const t={...Sc,...e};let s=t.blockSelector||"";s&&!s.endsWith(",")&&(s+=","),s+=vc.filter(e=>e.includes("[data-")).join(",");let r=t.maskTextSelector||"";return{blockClass:t.blockClass,blockSelector:s||null,ignoreClass:t.ignoreClass,ignoreSelector:t.ignoreSelector||null,maskTextClass:t.maskTextClass,maskTextSelector:r||null,maskAllInputs:t.maskAllInputs,maskInputOptions:{...Sc.maskInputOptions,...t.maskInputOptions},maskInputFn:t.maskInputFn,maskTextFn:t.maskTextFn,inlineStylesheet:!0,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}}}function Oc(e={}){return{...Sc,...e,maskInputOptions:{...Sc.maskInputOptions,...e.maskInputOptions}}}async function Mc(e){const t=JSON.stringify(e);if("undefined"!=typeof CompressionStream)try{const e=(new TextEncoder).encode(t),s=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip")),r=await new Response(s).blob(),n=function(e){const t=new Uint8Array(e);let s="";for(let e=0;e<t.byteLength;e++)s+=String.fromCharCode(t[e]);return btoa(s)}(await r.arrayBuffer());return{type:"gzip",data:n,originalSize:t.length,compressedSize:n.length}}catch(e){console.warn("Compression failed, using uncompressed:",e.message)}return{type:"none",data:t,originalSize:t.length,compressedSize:t.length}}async function Ac(e){if(!e||!e.type)throw new Error("Invalid compressed data");if("none"===e.type)return JSON.parse(e.data);if("gzip"===e.type){if("undefined"==typeof DecompressionStream)throw new Error("DecompressionStream not available");try{const t=atob(e.data),s=new Uint8Array(t.length);for(let e=0;e<t.length;e++)s[e]=t.charCodeAt(e);const r=new Blob([s]).stream().pipeThrough(new DecompressionStream("gzip")),n=await new Response(r).text();return JSON.parse(n)}catch(e){throw new Error(`Decompression failed: ${e.message}`)}}throw new Error(`Unknown compression type: ${e.type}`)}async function Ec(e){const t=await Mc(e),s=t.originalSize/t.compressedSize;return{originalSize:t.originalSize,compressedSize:t.compressedSize,ratio:s.toFixed(2),savings:`${(100*(1-1/s)).toFixed(1)}%`,type:t.type}}const Rc={transport:"http",batchSize:50,flushInterval:5e3,maxQueueSize:500,compress:!0,checkoutEveryNth:200,checkoutEveryNms:3e5,sessionTimeout:18e5,storageKey:"powerit_tracker"},Tc={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Nc={debug:(...e)=>console.debug("[Tracker]",...e),info:(...e)=>console.info("[Tracker]",...e),warn:(...e)=>console.warn("[Tracker]",...e),error:(...e)=>console.error("[Tracker]",...e)};class Dc{constructor(e,t={}){if(!e)throw new Error("CMS client instance is required");this.client=e,this.config={...Rc,...t},this.privacyConfig=Oc(t.privacy),this.isInitialized=!1,this.recording=!1,this.enabled=!0,this.stopFn=null,this.eventQueue=[],this.flushTimer=null,this.sessionManager=new wc({storageKey:this.config.storageKey,sessionTimeout:this.config.sessionTimeout}),this.transport=null,this._setupLogger(),this.privacyConfig.respectDoNotTrack&&Cc()&&(this.enabled=!1,this.logger.info("Tracker disabled due to Do Not Track preference"))}async init(){if(this.isInitialized||!this.enabled)return this;if("undefined"!=typeof window){const e=window.location.pathname;if(!Ic(this.privacyConfig,e))return this.enabled=!1,this.logger.info("Recording disabled for this page"),this}const t=this.client.getConfig();return this.transport=e({baseUrl:this.config.transportUrl||t.baseUrl,apiKey:t.apiKey,logger:this.logger}),await this.transport.connect(),this.client.analytics&&this.sessionManager.linkToAnalytics(this.client.analytics),this.sessionManager.getOrCreateSession(),this._setupUnloadHandler(),this.isInitialized=!0,this.logger.debug("Tracker initialized"),this}start(){if(!this.isInitialized||!this.enabled||this.recording)return;const e={emit:(e,t)=>this._handleEvent(e,t),checkoutEveryNth:this.config.checkoutEveryNth,checkoutEveryNms:this.config.checkoutEveryNms,...xc(this.privacyConfig),recordCanvas:this.config.recording?.recordCanvas||!1,recordCrossOriginIframes:this.config.recording?.recordCrossOriginIframes||!1,inlineStylesheet:this.config.recording?.inlineStylesheet??!0,inlineImages:this.config.recording?.inlineImages||!1,collectFonts:this.config.recording?.collectFonts||!1,sampling:this._buildSamplingConfig(),errorHandler:e=>{this.logger.error("rrweb error:",e),this.config.onError?.(e)}};this.stopFn=pc(e),this.recording=!0,this._startFlushTimer(),this.logger.debug("Recording started")}pause(){this.stopFn&&(this.stopFn(),this.stopFn=null),this.recording=!1,this._stopFlushTimer(),this.logger.debug("Recording paused")}resume(){!this.recording&&this.enabled&&this.start()}async stop(){this.pause(),await this.flush(),this.logger.debug("Recording stopped")}isRecording(){return this.recording}isEnabled(){return this.enabled}getSession(){return this.sessionManager.getSession()}getVisitorId(){return this.sessionManager.getVisitorId()}getSessionId(){return this.sessionManager.getSessionId()}async flush(){if(0===this.eventQueue.length)return;const e=[...this.eventQueue];let t;this.eventQueue=[],t=this.config.compress?await Mc(e):{type:"none",data:JSON.stringify(e)};const s={session_id:this.getSessionId(),visitor_id:this.getVisitorId(),events:t,event_count:e.length,timestamp:Date.now()};try{await this.transport.send({endpoint:"/api/public/tracker/events",method:"POST",data:s}),this.sessionManager.incrementEventCount(e.length),this.logger.debug(`Flushed ${e.length} events`)}catch(t){this.eventQueue=[...e,...this.eventQueue],this.logger.warn("Failed to flush events:",t.message)}}addCustomEvent(e,t={}){this.recording&&"function"==typeof pc.addCustomEvent&&pc.addCustomEvent(e,t)}identify(e,t={}){this.addCustomEvent("identify",{userId:e,traits:t,timestamp:Date.now()})}takeSnapshot(){this.stopFn&&"function"==typeof pc.takeFullSnapshot&&pc.takeFullSnapshot()}updatePrivacy(e){this.privacyConfig=Oc({...this.privacyConfig,...e}),this.recording&&(this.pause(),this.start())}enable(){this.enabled=!0,this.logger.info("Tracker enabled")}disable(){this.enabled=!1,this.pause(),this.logger.info("Tracker disabled")}destroy(){this.pause(),this._removeUnloadHandler(),this.transport&&this.transport.disconnect(),this.isInitialized=!1,this.logger.debug("Tracker destroyed")}_handleEvent(e,t){this.eventQueue.push(e),this.sessionManager.touch(),(t||this.eventQueue.length>=this.config.maxQueueSize)&&this.flush()}_buildSamplingConfig(){const e=this.config.sampling;if(e?.enabled)return{mousemove:e.mousemove??50,mouseInteraction:e.mouseInteraction??!0,scroll:e.scroll??10,media:e.media??!0,input:e.input??"last"}}_startFlushTimer(){this._stopFlushTimer(),this.flushTimer=setInterval(()=>{this.eventQueue.length>0&&this.flush()},this.config.flushInterval)}_stopFlushTimer(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}_setupUnloadHandler(){"undefined"!=typeof window&&(this._unloadHandler=async()=>{if(this.eventQueue.length>0){let e;e=this.config.compress?await Mc(this.eventQueue):{type:"none",data:JSON.stringify(this.eventQueue)};const t={session_id:this.getSessionId(),visitor_id:this.getVisitorId(),events:e,event_count:this.eventQueue.length,timestamp:Date.now(),is_exit:!0};this.transport.sendBeacon("/api/public/tracker/events",t)}},window.addEventListener("beforeunload",this._unloadHandler),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this._unloadHandler()}))}_removeUnloadHandler(){"undefined"!=typeof window&&this._unloadHandler&&window.removeEventListener("beforeunload",this._unloadHandler)}_setupLogger(){!0===this.config.logger?this.logger=Nc:this.config.logger&&"object"==typeof this.config.logger?this.logger=this.config.logger:this.client.logger?this.logger=this.client.logger:this.logger=Tc}}function Lc(e,t){return new Dc(e,t)}const Pc={name:"tracker",install(e,t={}){const s=new Dc(e,t);return e.tracker=s,e.startRecording=()=>s.start(),e.stopRecording=()=>s.stop(),e.pauseRecording=()=>s.pause(),e.resumeRecording=()=>s.resume(),e.addCustomEvent=(e,t)=>s.addCustomEvent(e,t),e.identifyUser=(e,t)=>s.identify(e,t),e.takeSnapshot=()=>s.takeSnapshot(),()=>{s.destroy(),delete e.tracker,delete e.startRecording,delete e.stopRecording,delete e.pauseRecording,delete e.resumeRecording,delete e.addCustomEvent,delete e.identifyUser,delete e.takeSnapshot}}};export{Sc as DEFAULT_PRIVACY_CONFIG,vc as SENSITIVE_SELECTORS,wc as SessionManager,Dc as SessionRecorder,xc as buildRrwebPrivacyConfig,Mc as compressEvents,Lc as createRecorder,bc as createSessionManager,Ac as decompressEvents,Pc as default,Ec as estimateCompression,Cc as isDoNotTrackEnabled,Oc as mergePrivacyConfig,Ic as shouldRecordPage,Pc as trackerPlugin};
2
+ //# sourceMappingURL=index.mjs.map