/*! For license information please see capture.js.LICENSE.txt */ var e={857:function(e,t,r){e.exports=r(772).Symbol},343:function(e){e.exports=function(e,t){for(var r=-1,s=null==e?0:e.length,n=Array(s);++r=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var s,n,i,o,a=typeof e;if("string"===a&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===a&&isFinite(e)){return r.long?(n=Math.abs(s=e))>=864e5?t(s,n,864e5,"day"):n>=36e5?t(s,n,36e5,"hour"):n>=6e4?t(s,n,6e4,"minute"):n>=1e3?t(s,n,1e3,"second"):s+" ms":(o=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":o>=36e5?Math.round(i/36e5)+"h":o>=6e4?Math.round(i/6e4)+"m":o>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};(()=>{let e,t,n,i,o,a,l,u,c,h,p,d,f,m,g,y,w,b,v,S,x,O,C,k,E,M,R,I,A,P,T,L,D,N,j,_,F,U,B,z,$;r.d(s,{h:()=>cH});var W,H,V,J,q,G,K,X,Y,Q,Z,ee,et,er,es,en,ei,eo,ea,el,eu,ec,eh,ep,ed,ef,em,eg,ey,ew,eb,ev,eS,ex,eO,eC,ek=r(378),eE=r.n(ek);function eM(e){return eE()(e)}["passport","phone","address","street","apt","apartment","email","ssn"].concat(["auth","cookie","password","passcode","secret","access","token","key","code","csrf"]),eM("10m"),eM("30m"),eM("1m");let eR=Symbol.for("\uD83C\uDF53jam");var eI=((W={}).Development="development",W.Preview="preview",W.Staging="staging",W.Production="production",W.Test="test",W);function eA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let eP=eM("15s"),eT={[eI.Development]:["debug","log","info","warn","error"],[eI.Staging]:["info","warn","error"],[eI.Production]:["info","warn","error"],[eI.Test]:[],[eI.Preview]:["info","warn","error"]},eL={getEnvironment:()=>{let e=new URL("file:///home/runner/_work/apiofjam/apiofjam/packages/embedded-scripts/src/entrypoints/_shared/logger.ts");return"https://js.jam.dev"===e.origin?eI.Production:"https://js.jamtest.kitchen"===e.origin?eI.Staging:/^https:\/\/js\.pr-\d+\.jamtest\.kitchen$/.test(e.origin)?eI.Preview:eI.Development}},eD=new Set({[eI.Development]:["debug","log","info","warn","error"],[eI.Staging]:[],[eI.Production]:[],[eI.Test]:[],[eI.Preview]:[]}[eL.getEnvironment()]),eN=new class{get enabled(){return this._enabled}setEnabled(e){this._enabled=e}connect(e){for(let t of(this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0),this.forwardLog=e,this.buffer))this.forwardLog(t);this.buffer.length=0}disconnect(){this.forwardLog=void 0}log(e,t,r){if(!this.enabled||!this.levels.has(e))return;let s={level:e,message:t,context:r,timestamp:Date.now()};this.forwardLog?this.forwardLog(s):(this.buffer.length>=500&&this.buffer.shift(),this.buffer.push(s),this.startTimeoutIfNeeded())}startTimeoutIfNeeded(){this.timeoutHandle||this.forwardLog||(this.timeoutHandle=setTimeout(()=>{this.flushToConsole()},eP))}flushToConsole(){for(let r of(console.warn("[RecordingLinksDatadog] Iframe not connected within 15s, flushing logs to console"),this.buffer)){var e,t;null==(e=(t=console)[r.level])||e.call(t,`[Buffered] ${r.message}`,r.context)}this.buffer.length=0,this.timeoutHandle=void 0}constructor(e,t=eT){eA(this,"environment",void 0),eA(this,"name",void 0),eA(this,"levels",void 0),eA(this,"buffer",void 0),eA(this,"forwardLog",void 0),eA(this,"timeoutHandle",void 0),eA(this,"_enabled",void 0),this.environment=e,this.name="recording-links-datadog",this.buffer=[],this._enabled=!0,this.levels=new Set(t[this.environment.getEnvironment()])}}(eL),ej=function e(t){let r=e=>function(){for(var r=arguments.length,s=Array(r),n=0;n{let n=t?`[${t}] ${r}`:r;eD.has(e)&&(s?console[e](n,s):console[e](n)),eN.log(e,n,s)})(e,String(i),o.length>0?{args:o}:void 0)};return{debug:r("debug"),log:r("log"),info:r("info"),warn:r("warn"),error:r("error"),fork:r=>e(t?`${t}::${r}`:r)}}("jam");async function e_(e,t){window.jam||(window.jam={}),window[eR]||(window[eR]={documentId:crypto.randomUUID()}),"function"!=typeof Promise.allSettled&&Object.assign(window.Promise,{allSettled:eF});let{name:r,autoInit:s}=t;window.jam[r]?ej.error(`Could not auto-initialize ${r}: one already exists.`):(window.jam[r]=e,ej.debug(`Installed ${r} script on host page`)),s&&(await new Promise(e=>setTimeout(e,0)),e.isInitialized||await s())}async function eF(e){return new Promise(t=>{let r=[],s=0,n=e.length;if(0===n)return void t([]);e.forEach((e,i)=>{e.then(e=>{r[i]={status:"fulfilled",value:e}}).catch(e=>{r[i]={status:"rejected",reason:e}}).then(()=>{++s===n&&t(r)})})})}function eU(e){return void 0!==e}(H=eg||(eg={})).Byte=1,H.Kilobyte=1e3*H.Byte,H.Megabyte=1e3*H.Kilobyte,H.Gigabyte=1e3*H.Megabyte,H.Kibibyte=1024*H.Byte,H.Mebibyte=1024*H.Kibibyte,H.Gibibyte=1024*H.Mebibyte;let eB="[truncated by truncateSerializable]",ez="[cyclic by truncateSerializable]";class e$ extends Error{get extensions(){return{wrappedError:this}}toJSON(){let e={},t=function(e){let t=Object.assign(Object.create(Object.getPrototypeOf(eW)),e);return delete t.stack,t}(this);for(let r of Object.getOwnPropertyNames(t))e[r]=eV(t[r]);return e}valueOf(){return this.toString()}toString(){return this.fullError()}shortError(){return`${this.name}: ${this.message}`}find(e){if(e(this))return this;if(!this.previous)return;if(this.previous instanceof e$)return this.previous.find(e);let t=this.previous;if(this.previous&&(t=this.previous),e(t))return t}is(e){return!!this.find(t=>t instanceof e)}fullError(){let e;this.previous&&(e=this.previous.toString());let t="";try{t=JSON.stringify(this.serializableContext)}catch{t="[Error: provided context was not serializable]"}let r=[[this.title?void 0:`${this.name}:`,this.message,this.debugMessage?`(${this.debugMessage})`:void 0,this.userError?"(user error)":void 0],[t?`Serializable context: (${t})`:void 0]].map(e=>{let t=e.filter(eU);return t.length>0?t.join(" ")+".":""}).join(" ");return e?r+". \nCaused by: \n"+e:r}previousMessage(){if(this.previous)return"string"==typeof this.previous?this.previous:this.previous.message}static isInside(e){if(!(e instanceof e$))return!1;let t=this.name;return e.find(e=>e instanceof e$&&e.name===t)}constructor(e,t){super(e.message),eA(this,"userError",void 0),eA(this,"debugMessage",void 0),eA(this,"previous",void 0),eA(this,"serializableContext",void 0),eA(this,"title",void 0),this.title=e.title,this.name=e.name??"WrappedError",this.userError=e.userError,this.debugMessage=e.debugMessage??e.message,this.serializableContext=e.serializableContext,t&&(t instanceof e$||t instanceof Error||"string"==typeof t)&&(this.previous=t)}}let eW=new e$({message:"Example Error"});function eH(e){if(e instanceof e$||e instanceof Error)return e.toString();if(null!==e&&"object"==typeof e)try{return JSON.stringify(e)}catch{}return String(e)}function eV(e){return null==e?null:"string"==typeof e||"number"==typeof e||"boolean"==typeof e?e:eJ(e)}function eJ(e){return function e(t,r,s){if(null===t||"object"!=typeof t){let e=function(e,t){let r=void 0===e?9:null===e?4:"string"==typeof e?e.length+2:JSON.stringify(e).length;return r<=t?{value:e,size:r}:{value:eB,size:eB.length}}(t,r);return{value:e.value,size:e.size}}if(s.has(t))return{value:Array.isArray(t)?[ez]:{error:ez},size:ez.length};if(s.add(t),Array.isArray(t)){let n=function(t,r,s){let n=[],i=1;for(let[o,a]of t.entries()){o>0&&(i+=1);let t=e(a,r-i-1,s);if((i+=t.size)>r){n.push(eB),i+=eB.length;break}n.push(t.value)}return{value:n,size:i+=1}}(t,r,s);return{value:n.value,size:n.size}}let n=function(t,r,s){let n={},i=1,o=!0;for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){i+=+!o+a.length+2+1;let l=e(t[a],r-i-1,s);if((i+=l.size)>r){n[a]=eB,i+=eB.length;break}n[a]=l.value,o=!1}return{value:n,size:i+=1}}(t,r,s);return{value:n.value,size:n.size}}(function(e){if("string"==typeof e)return{error:e};if(e instanceof e$)return e.toJSON();if("object"==typeof e&&null!==e&&"toJSON"in e&&"function"==typeof e.toJSON)try{let t=e.toJSON();if("string"==typeof t)return{error:t};return t}catch{}if(e instanceof Error)try{let t={};for(let r of function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=new Set;for(let s=0;e.constructor!==Object&&svoid 0===t?null:t)}catch(e){return{originalTimestamp:Date.now(),success:!1,reason:"serialization-throws-error",underlyingError:JSON.parse(JSON.stringify(eJ(e)))}}let o=function(e){let t=0,r=JSON.stringify(e,(e,r)=>(r instanceof Blob&&(t+=r.size),r));return new Blob([r],{type:"application/json"}).size+t}(n);return o>eq?{originalTimestamp:Date.now(),success:!1,reason:"metadata-too-large",sizeInBytes:o}:{originalTimestamp:Date.now(),success:!0,serializedMetadata:n}}let eK={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},eX=new Set(["combinator","comma"]),eY=new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),eQ=/(?[\dn+-]+)\s+of\s+(?.+)/,eZ={"nth-child":eQ,"nth-last-child":eQ},e0=e=>{switch(e){case"pseudo-element":case"pseudo-class":return RegExp(eK[e].source.replace("(?\xb6*)","(?.*)"),"gu");default:return eK[e]}},e1=/(['"])([^\\\n]*?)\1/g,e2=/\\./g;function e3(e,{recursive:t=!0,list:r=!0}={}){let s=function(e,t=eK){if(""===(e=e.trim()))return[];let r=[];e=(e=e.replace(e2,(e,t)=>(r.push({value:e,offset:t}),"".repeat(e.length)))).replace(e1,(e,t,s,n)=>(r.push({value:e,offset:n}),`${t}${"".repeat(s.length)}${t}`));{let t,s=0;for(;(t=e.indexOf("(",s))>-1;){let n=function(e,t){let r=0,s="";for(;t"comma"===e.type)){let r=[],s=[];for(let n=0;n=0;r--){let s=t[r];if("combinator"===s.type){let n=t.slice(0,r),i=t.slice(r+1);if(0===n.length)return{type:"relative",combinator:s.content,right:e(i)};return{type:"complex",combinator:s.content,left:e(n),right:e(i)}}}switch(t.length){case 0:throw Error("Could not build AST.");case 1:return t[0];default:return{type:"compound",list:[...t]}}}(s,{list:r});if(!t)return n;for(let[e]of function* e(t,r){switch(t.type){case"list":for(let r of t.list)yield*e(r,t);break;case"complex":yield*e(t.left,t),yield*e(t.right,t);break;case"relative":yield*e(t.right,t);break;case"compound":yield*t.list.map(e=>[e,t]);break;default:yield[t,r]}}(n)){if("pseudo-class"!==e.type||!e.argument||!eY.has(e.name))continue;let t=e.argument,r=eZ[e.name];if(r){let s=r.exec(t);if(!s)continue;Object.assign(e,s.groups),t=s.groups.subtree}t&&Object.assign(e,{subtree:e3(t,{recursive:!0,list:!0})})}return n}let e4=["input[autocomplete$='cc-number']","input[autocomplete$='cc-exp']","input[autocomplete$='cc-csc']","input[autocomplete$='email']","input[autocomplete$='tel']",...["ssn","social-security","social-security-number","tax-id","account-number","routing-number","iban","swift","credit-card-number","debit-card-number","card-number","cc-number","cvv","cvc","security-code","card-code","passport-number","driver-license","driver-license-number","drivers-license","drivers-license-number","id-number","identification-number","national-id","license-number","dl-number"].flatMap(e=>[e,e.replace(/-/g,"_"),e.replace(/-/g,"")]).flatMap(e=>[`[name="${e}"]`,`[id="${e}"]`,`[class="${e}"]`,`[data-${e}]`]),"[data-jam-blur]",".fs-exclude",".fs-block",".fs-mask",".data-hj-suppress",".data-hj-masked","[data-hj-suppress]","[data-hj-masked]","[data-private]","[data-clarity-mask]",".sentry-block","[data-sentry-block]",".sentry-mask","[data-sentry-mask]","[data-openreplay-obscured]","[data-openreplay-hidden]",".highlight-block",".highlight-mask",".highlight-ignore","[data-cs-mask]","[data-cs-encrypt]","[data-matomo-mask]","[data-heap-redact-text]","[data-heap-redact-attributes]","[data-heap-ignore]",".heap-ignore","[data-amp-mask]",".rr-block",".rr-mask",".rr-ignore"],e6=".fs-unmask,[data-jam-blur='false'],[data-jam-blur='0'],[data-jam-blur='no'],[data-clarity-unmask],[data-cs-capture],[data-amp-unmask]",e5=e4.map(e=>`${e}:not(${e6})`).join(","),e8=e3(e4.join(","));function e9(e){let t=null==e?void 0:e.map(e=>`${e}:not(${e6})`).join(","),r=t?e3(t):void 0,s=[e5];return t&&t.length>0&&s.push(t),{predicate:t=>{var s,n;return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?function(e,t){if(e.matches(e5))return!0;if(t){for(let r of t)if(e.matches(r))return!0}return!1}(t,e):(s=t,n=r,!!e8&&e7(e8,s)||!!n&&e7(n,s))},selectors:s}}function e7(e,t){var r,s,n;switch(e.type){case"list":return e.list.some(e=>e7(e,t));case"compound":return e.list.every(e=>e7(e,t));case"type":return(null==(r=t.tagName)?void 0:r.toLowerCase())===(null==(s=e.name)?void 0:s.toLowerCase());case"id":return t.id===e.name;case"class":return(null==(n=t.className)?void 0:n.split(" ").includes(e.name))??!1;case"pseudo-class":if("not"===e.name&&e.subtree)return!e7(e.subtree,t);return!1;case"attribute":{let{name:r,operator:s,value:n}=e,i=null==n?void 0:n.replace(/^["']|["']$/g,""),o=t["class"===r?"className":r];if(void 0===i)return void 0!==o;if(void 0===o)return!1;switch(s){case"=":default:return o===i;case"$=":return o.endsWith(i);case"^=":return o.startsWith(i);case"*=":return o.includes(i);case"~=":return o.split(/\s+/).includes(i);case"|=":return o===i||o.startsWith(`${i}-`)}}default:return!1}}function te(e){return function(){for(var t=arguments.length,r=Array(t),s=0;s1&&void 0!==arguments[1]?arguments[1]:function(e){let t=getComputedStyle(e),r=Math.max(function(e){let t=to.evaluate(e,XPathResult.UNORDERED_NODE_ITERATOR_TYPE),r=null,s=0;for(;r=t.iterateNext();){let e=Number.parseInt(getComputedStyle(r).fontSize,10);Number.isNaN(e)||(s=Math.max(s,e))}return Math.max(4,Math.ceil(s/4))}(e),function(e){let t={width:0,height:0,area:0};if(e.matches(tn)){let{width:r,height:s,area:n}=tm(e);t.width=r,t.height=s,t.area=n}for(let r of e.querySelectorAll(tn)){let{width:e,height:s,area:n}=tm(r);t.width=Math.max(t.width,e),t.height=Math.max(t.height,s),t.area=Math.max(t.area,n)}return Math.max(4,Math.ceil(Math.max(t.width,t.height)/30),Math.ceil(Math.sqrt(t.area)/28))}(e));return"none"===t.filter?`blur(${r}px)`:`${t.filter} blur(${r}px)`.trimStart()}(e);return!ta(e)&&(e.dataset[ts]=e.style.filter,e.style.filter=t,!0)}function th(e){e.style.filter=e.dataset[ts]??"",delete e.dataset[ts]}function tp(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"blur",{element:s,rect:n}=function(e){let t,r=e.closest(`[${tr}]`)??e;if(td(r,"unblur")){for(;r.parentElement;){let e=r.parentElement.closest(`[${tr}]`);if(!e)break;r=e}t=r.getBoundingClientRect()}else for(t=e.getBoundingClientRect();r.parentElement!==document.body;){let e=r.parentElement;if(!e)break;if(1===e.children.length&&tf(t,e.getBoundingClientRect()))r=e;else break}return{rect:t,element:r}}(e);if(!s||!td(s,r))return[];let i=[s];for(let e of(null==(t=s.parentElement)?void 0:t.children)??[])e!==s&&td(e,r)&&tf(n,e.getBoundingClientRect())&&i.push(e);return i}function td(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"blur";return"blur"===t?void 0===e.dataset[ts]:void 0!==e.dataset[ts]}function tf(e,t){return e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height}function tm(e){let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r,area:t*r}}let tg={logger:ej};class ty{get customSelectors(){let e="function"==typeof this._customSelectors?this._customSelectors():this._customSelectors;return"string"==typeof e?[e]:e}get didBlurElements(){return this._didBlurElements}start(){if(this.disposer)return void this.logger.warn("BlurManager#start() called when already started; ignoring");this._didBlurElements=!1;let e=new IntersectionObserver((e,t)=>{for(let r of e)if(r.isIntersecting){this._didBlurElements=!0,t.disconnect();return}},{threshold:[.1]}),t=e9(this.customSelectors),[r]=t.selectors;this.disposer=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document.documentElement,{watchAttributes:s=!1,...n}=t,i=e=>()=>th(e),o=e=>(t,r)=>tl(t,{...r,root:e}),a=new MutationObserver(t=>{e(function*(){for(let e of t)if("attributes"===e.type)e.target instanceof HTMLElement&&!ti.includes(e.target.tagName)&&(yield{element:e.target,type:"attributes",blur:o(e.target),unblur:i(e.target)});else for(let t of e.addedNodes)t instanceof HTMLElement&&!ti.includes(t.tagName)&&(yield{element:t,type:"childList",blur:o(t),unblur:i(t)})}())});return!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeout:r=eM("1m"),onTimeout:s="callback",safeCriteria:n="stateCompleteAndBodyAvailable",...i}=t,o=performance.now();new Promise((t,a)=>{let l=!1,u=!1;function c(){if(l)return;let{state:r,body:s,safeToExecute:i}=tt(n),c=performance.now()-o;if(!i&&u)return void a(Error(`Document not ready: ${r} ${s?"":"(no body)"} ${c}ms`));(i||u)&&(l=!0,t(e({waitedMs:c,timedOut:u})))}setTimeout(function(){switch(u=!0,window.removeEventListener("load",c,i),s){case"reject":a(Error("Timeout: Document not ready"));break;case"callback":c()}},r);let{safeToExecute:h}=tt(n);h?c():window.addEventListener("load",c,i)})}(()=>a.observe(r,{attributes:s,childList:!0,subtree:!0}),{once:!0,timeout:eM("2m"),safeCriteria:"bodyAvailable",...n}),()=>a.disconnect()}(s=>{let n={numCustomBlurred:0,numDefaultBlurred:0,numUnblurred:0};for(let i of s){if("attributes"===i.type&&ta(i.element)){t.predicate(i.element)||(i.unblur(),n.numUnblurred+=1);continue}for(let s of t.selectors){let t=s!==r;for(let r of i.blur(s))!1===this._didBlurElements&&e.observe(r),t?n.numCustomBlurred+=1:n.numDefaultBlurred+=1,this.logger.debug(`Blurred target matching selector: ${s}`,r)}}Object.values(n).some(e=>e>0)&&this.logger.info("Blurred elements during mutation",n)},{watchAttributes:!0});let s={numCustomBlurred:0,numDefaultBlurred:0};for(let n of t.selectors){let t=n!==r;for(let r of tl(n,{logger:this.logger}))!1===this._didBlurElements&&e.observe(r),t?s.numCustomBlurred+=1:s.numDefaultBlurred+=1,this.logger.debug(`Blurred target matching selector: ${n}`,r)}Object.values(s).some(e=>e>0)&&this.logger.info("Blurred elements on start",s)}stop(){if(this.disposer){let e=this.disposer;this.disposer=null,e();let t=0;for(let e of tu({logger:this.logger}))t+=1;t>0&&this.logger.info(`Unblurred ${t} elements on stop`)}}clearData(){this.stop(),this._didBlurElements=!1}constructor(e,t=tg){eA(this,"logger",void 0),eA(this,"disposer",null),eA(this,"_customSelectors",void 0),eA(this,"_didBlurElements",!1),this._customSelectors=e??(()=>Array.from(document.querySelectorAll("meta[name='jam:blur']")).map(e=>e.content)),this.logger=t.logger}}class tw{addEventListener(e,t,r){let s="boolean"==typeof r?{capture:r,signal:this.resetController.signal}:{...r,signal:(null==r?void 0:r.signal)?function(e){let t=new AbortController;for(let r of e){if(r.aborted){t.abort();break}r.addEventListener("abort",()=>t.abort())}return t.signal}([r.signal,this.resetController.signal]):this.resetController.signal};return this.target.addEventListener(e,t,s)}dispatchEvent(e,t){return this.target.dispatchEvent(new CustomEvent(e,{detail:t}))}removeEventListener(e,t,r){return this.target.removeEventListener(e,t,r)}reset(){this.resetController.abort(),this.resetController=new AbortController}constructor(){eA(this,"resetController",new AbortController),eA(this,"target",new EventTarget)}}var tb=((V={}).Rewind="Rewind",V.Screenshot="Screenshot",V.Video="Video",V);({...((J={}).Idle="Idle",J.Processing="Processing",J),...tb});var tv=Object.defineProperty,tS=Object.defineProperty,tx=(e,t,r)=>{let s;return(s="symbol"!=typeof t?t+"":t)in e?tS(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r},tO={exports:{}},tC=String,tk=function(){return{isColorSupported:!1,reset:tC,bold:tC,dim:tC,italic:tC,underline:tC,inverse:tC,hidden:tC,strikethrough:tC,black:tC,red:tC,green:tC,yellow:tC,blue:tC,magenta:tC,cyan:tC,white:tC,gray:tC,bgBlack:tC,bgRed:tC,bgGreen:tC,bgYellow:tC,bgBlue:tC,bgMagenta:tC,bgCyan:tC,bgWhite:tC}};tO.exports=tk(),tO.exports.createColors=tk;var tE=tO.exports;let tM=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),tR=class e extends Error{constructor(t,r,s,n,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){let t,r;if(!this.source)return"";let s=this.source;null==e&&(e=tE.isColorSupported),tM&&e&&(s=tM(s));let n=s.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),a=String(o).length;if(e){let{bold:e,gray:s,red:n}=tE.createColors(!0);t=t=>e(n(t)),r=e=>s(e)}else t=r=e=>e;return n.slice(i,o).map((e,s)=>{let n=i+1+s,o=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let s=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return t(">")+r(o)+e+"\n "+s+t("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};tR.default=tR;var tI={};tI.isClean=Symbol("isClean"),tI.my=Symbol("my");let tA={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1},tP=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="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 s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s{if(void 0!==(s=e.raws[t]))return!1})}return void 0===s&&(s=tA[r]),i.rawCache[r]=s,s}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).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return(t=r.raws.before).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&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(e){let t;return e.raws.indent?e.raws.indent:(e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=(t=e[e.length-1]).replace(/\S/g,""),!1}}),t)}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};function tT(e,t){new tP(t).stringify(e)}tP.default=tP,tT.default=tT;let{isClean:tL,my:tD}=tI,tN=class{constructor(e={}){for(let t in this.raws={},this[tL]=!1,this[tD]=!0,e)if("nodes"===t)for(let r of(this.nodes=[],e[t]))"function"==typeof r.clone?this.append(r.clone()):this.append(r);else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=function e(t,r){let s=new t.constructor;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||"proxyCache"===n)continue;let i=t[n],o=typeof i;"parent"===n&&"object"===o?r&&(s[n]=r):"source"===n?s[n]=i:Array.isArray(i)?s[n]=i.map(t=>e(t,s)):("object"===o&&null!==i&&(i=e(i)),s[n]=i)}return s}(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new tR(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>e[t]===r||(e[t]=r,("prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[tL]){this[tL]=!1;let e=this;for(;e=e.parent;)e[tL]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let i=t.get(s.input);null==i&&(i=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:i,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=tT){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};tN.default=tN;let tj=tN,t_=class extends tj{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]}};t_.default=t_;let{SourceMapConsumer:tF,SourceMapGenerator:tU}=tM,{existsSync:tB,readFileSync:tz}=tM,{dirname:t$,join:tW}=tM,tH=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=t$(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new tF(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)){var t;return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t)}throw Error("Unsupported source map encoding "+e.match(/data:application\/json;([^,]+),/)[1])}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 r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=t$(e),tB(e))return this.mapFile=e,tz(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t)if("string"==typeof t)return t;else if("function"==typeof t){let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw Error("Unable to load previous source map: "+r.toString());return e}}else if(t instanceof tF)return tU.fromSourceMap(t).toString();else if(t instanceof tU)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;return e&&(t=tW(t$(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)}};tH.default=tH;let{SourceMapConsumer:tV,SourceMapGenerator:tJ}=tM,{fileURLToPath:tq,pathToFileURL:tG}=tM,{isAbsolute:tK,resolve:tX}=tM,{nanoid:tY}={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let s="",n=r;for(;n--;)s+=e[Math.random()*e.length|0];return s}},tQ=Symbol("fromOffsetCache"),tZ=!!(tV&&tJ),t0=!!(tX&&tK),t1=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\uFEFF"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!t0||/^\w+:\/\//.test(t.from)||tK(t.from)?this.file=t.from:this.file=tX(t.from)),t0&&tZ){let e=new tH(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=""),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);i=e.line,o=e.col}else i=s.line,o=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return(n=a?new tR(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,s.plugin):new tR(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(tG&&(n.input.url=tG(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[tQ])r=this[tQ];else{let e=this.css.split("\n");r=Array(e.length);let t=0;for(let s=0,n=e.length;s=t)s=r.length-1;else{let t,n=r.length-2;for(;s>1)])n=t-1;else if(e>=r[t+1])s=t+1;else{s=t;break}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:tX(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){let n,i;if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=o.originalPositionFor({column:s,line:r})),i=tK(a.source)?tG(a.source):new URL(a.source,this.map.consumer().sourceRoot||tG(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:i.toString()};if("file:"===i.protocol)if(tq)l.file=tq(i);else throw Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(a.source);return u&&(l.source=u),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}};t1.default=t1,tM&&tM.registerInput&&tM.registerInput(t1);let{SourceMapConsumer:t2,SourceMapGenerator:t3}=tM,{dirname:t4,relative:t6,resolve:t5,sep:t8}=tM,{pathToFileURL:t9}=tM,t7=!!(t2&&t3),re=!!(t4&&t5&&t6&&t8),rt=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,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,r=this.toUrl(this.path(e.file)),s=e.root||t4(e.file);!1===this.mapOpts.sourcesContent?(t=new t2(e.text)).sourcesContent&&(t.sourcesContent=null):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).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(),re&&t7&&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=t3.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t3({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)):""});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(){let e,t;this.css="",this.map=new t3({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,s=1,n="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1):(i.source=n,i.original.line=1,i.original.column=0),this.map.addMapping(i)),(e=o.match(/\n/g))?(r+=e.length,t=o.lastIndexOf("\n"),s=o.length-t):s+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};(!("decl"===a.type||"atrule"===a.type&&!a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=s-2):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=s-1),this.map.addMapping(i))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?t4(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=t4(t5(r,this.mapOpts.annotation)));let s=t6(r,e);return this.memoizedPaths.set(e,s),s}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 t1(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";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(t9){let t=t9(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===t8&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},rr=tN,rs=class extends rr{constructor(e){super(e),this.type="comment"}};rs.default=rs;let{isClean:rn,my:ri}=tI,ro=tN,ra=class r extends ro{append(...e){for(let t of e)for(let e of this.normalize(t,this.last))this.proxyOf.nodes.push(e);return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){let t,r;if(!this.proxyOf.nodes)return;let s=this.getIterator();for(;this.indexes[s]e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e));if("every"===t||"some"===t)return r=>e[t]((e,...t)=>r(e.toProxy(),...t));if("root"===t)return()=>e.root().toProxy();else if("nodes"===t)return e.nodes.map(e=>e.toProxy());else if("first"===t||"last"===t)return e[t].toProxy();else return e[t]},set:(e,t,r)=>e[t]===r||(e[t]=r,("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 r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();for(let t of(s=this.index(e),n))this.proxyOf.nodes.splice(s+1,0,t);for(let e in this.indexes)s<(r=this.indexes[e])&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",i=this.normalize(t,this.proxyOf.nodes[s],n).reverse();for(let t of(s=this.index(e),i))this.proxyOf.nodes.splice(s,0,t);for(let e in this.indexes)s<=(r=this.indexes[e])&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=function e(t){return t.map(t=>(t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t))}(e(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s))for(let e of s=s.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if("root"===s.type&&"document"!==this.type)for(let e of s=s.nodes.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new t_(s)]}else if(s.selector)s=[new t(s)];else if(s.name)s=[new n(s)];else if(s.text)s=[new rs(s)];else throw Error("Unknown node type in node creation");return s.map(e=>(e[ri]||r.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[rn]&&function e(t){if(t[rn]=!1,t.proxyOf.nodes)for(let r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(let t of e=e.reverse()){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;for(let r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[r])>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{(!t.props||t.props.includes(s.prop))&&(!t.fast||s.value.includes(t.fast))&&(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ra.registerParse=t=>{e=t},ra.registerRule=e=>{t=e},ra.registerAtRule=e=>{n=e},ra.registerRoot=e=>{i=e},ra.default=ra,ra.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,n.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,t_.prototype):"comment"===e.type?Object.setPrototypeOf(e,rs.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[ri]=!0,e.nodes&&e.nodes.forEach(e=>{ra.rebuild(e)})};let rl=ra,ru=class extends rl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new a,this,e).stringify()}};ru.registerLazyResult=e=>{o=e},ru.registerProcessor=e=>{a=e},ru.default=ru;let rc=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}};rc.default=rc;let rh=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,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 r=new rc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};rh.default=rh;let rp=/[\t\n\f\r "#'()/;[\\\]{}]/g,rd=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,rf=/.[\r\n"'(/\\]/,rm=/[\da-f]/i,rg=ra,ry=class extends rg{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)}};ry.default=ry,rg.registerAtRule(ry);let rw=ra,rb=class extends rw{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if("prepend"===r)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 s)e.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new l(new u,this,e).stringify()}};rb.registerLazyResult=e=>{l=e},rb.registerProcessor=e=>{u=e},rb.default=rb,rw.registerRoot(rb);let rv={comma:e=>rv.split(e,[","],!0),space:e=>rv.split(e,[" ","\n"," "]),split(e,t,r){let s=[],n="",i=!1,o=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==n&&s.push(n.trim()),n="",i=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};rv.default=rv;let rS=ra,rx=class extends rS{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return rv.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};rx.default=rx,rS.registerRule(rx);let rO=function(e,t={}){let r,s,n,i,o,a,l,u,c,h,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(r=p.charCodeAt(m)){case 10:case 32:case 9:case 13:case 12:s=m;do s+=1,r=p.charCodeAt(s);while(32===r||10===r||9===r||13===r||12===r);h=["space",p.slice(m,s)],m=s-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(r);h=[e,e,m];break}case 40:if(u=g.length?g.pop()[1]:"",c=p.charCodeAt(m+1),"url"===u&&39!==c&&34!==c&&32!==c&&10!==c&&9!==c&&12!==c&&13!==c){s=m;do{if(a=!1,-1===(s=p.indexOf(")",s+1)))if(d||t){s=m;break}else w("bracket");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),i=p.slice(m,s+1),-1===s||rf.test(i)?h=["(","(",m]:(h=["brackets",i,m,s],m=s);break;case 39:case 34:n=39===r?"'":'"',s=m;do{if(a=!1,-1===(s=p.indexOf(n,s+1)))if(d||t){s=m+1;break}else w("string");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["string",p.slice(m,s+1),m,s],m=s;break;case 64:rp.lastIndex=m+1,rp.test(p),s=0===rp.lastIndex?p.length-1:rp.lastIndex-2,h=["at-word",p.slice(m,s+1),m,s],m=s;break;case 92:for(s=m,o=!0;92===p.charCodeAt(s+1);)s+=1,o=!o;if(r=p.charCodeAt(s+1),o&&47!==r&&32!==r&&10!==r&&9!==r&&13!==r&&12!==r&&(s+=1,rm.test(p.charAt(s)))){for(;rm.test(p.charAt(s+1));)s+=1;32===p.charCodeAt(s+1)&&(s+=1)}h=["word",p.slice(m,s+1),m,s],m=s;break;default:47===r&&42===p.charCodeAt(m+1)?(0===(s=p.indexOf("*/",m+2)+1)&&(d||t?s=p.length:w("comment")),h=["comment",p.slice(m,s+1),m,s]):(rd.lastIndex=m+1,rd.test(p),s=0===rd.lastIndex?p.length-1:rd.lastIndex-2,h=["word",p.slice(m,s+1),m,s],g.push(h)),m=s}return m++,h},position:function(){return m}}},rC={empty:!0,space:!0},rk=class{constructor(e){this.input=e,this.root=new rb,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,r,s,n=new ry;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===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}else if("{"===t){o=!0;break}else if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),i&&(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=""),o&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t,r=this.colon(e);if(!1===r)return;let s=0;for(let n=r-1;n>=0&&("space"===(t=e[n])[0]||2!==(s+=1));n--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}colon(e){let t,r,s=0;for(let[n,i]of e.entries()){if("("===(t=i[0])&&(s+=1),")"===t&&(s-=1),0===s&&":"===t)if(r)if("word"===r[0]&&"progid"===r[1])continue;else return n;else this.doubleColon(i);r=i}return!1}comment(e){let t=new rs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=rO(this.input)}decl(e,t){let r,s,n=new t_;this.init(n,e[0][2]);let i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}("_"===n.prop[0]||"*"===n.prop[0])&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if("!important"===(r=e[t])[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);" !important"!==(r=this.spacesFromEnd(e)+r)&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.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 rx;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,r=null,s=!1,n=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),i.push("("===r?")":"]");else if(o&&s&&"{"===r)n||(n=l),i.push("}");else if(0===i.length)if(";"===r)if(s)return void this.decl(a,o);else break;else if("{"===r)return void this.rule(a);else if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}else":"===r&&(s=!0);else r===i[i.length-1]&&(i.pop(),0===i.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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,r,s){let n,i,o,a,l=r.length,u="",c=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:s,value:u}}e[t]=u}rule(e){e.pop();let t=new rx;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(e,t){let r="";for(let s=t;srN(e)),e}let rj={},r_=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"==typeof r&&null!==r&&("root"===r.type||"document"===r.type))n=rN(r);else if(r instanceof e||r instanceof rh)n=rN(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=rE;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[rR]&&ra.rebuild(n)}this.result=new rh(t,n,s),this.helpers={...rj,postcss:rj,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 Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!rA[r]&&/^[A-Z]/.test(r))throw Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!rP[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(rT(e))try{await e}catch(r){let e=t[t.length-1].node;throw this.handleError(r,e)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(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));if(rT(t[0]))return Promise.all(t);return 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=tT;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new rt(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(rT(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rM];)e[rM]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(rT(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex{e[rM]||this.walkSync(e)});else{let r=this.listeners[t];if(r&&this.visitSync(r,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"}};r_.registerPostcss=e=>{rj=e},r_.default=r_,rb.registerLazyResult(r_),ru.registerLazyResult(r_);let rF=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0,this.result=new rh(this._processor,s,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let i=new rt(tT,s,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 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(){let e;if(this._root)return this._root;try{e=rE(this._css,this._opts)}catch(e){this.error=e}if(!this.error)return this._root=e,e;throw this.error}get[Symbol.toStringTag](){return"NoWorkResult"}};rF.default=rF;let rU=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"==typeof r&&(r.parse||r.stringify));else throw Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r_(this,e,t):new rF(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};function rB(e,t){if(Array.isArray(e))return e.map(e=>rB(e));let{inputs:r,...s}=e;if(r)for(let e of(t=[],r)){let r={...e,__proto__:t1.prototype};r.map&&(r.map={...r.map,__proto__:tH.prototype}),t.push(r)}if(s.nodes&&(s.nodes=e.nodes.map(e=>rB(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new rb(s);if("decl"===s.type)return new t_(s);if("rule"===s.type)return new rx(s);if("comment"===s.type)return new rs(s);if("atrule"===s.type)return new ry(s);else throw Error("Unknown node type: "+e.type)}function rz(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new rU(e)}rU.default=rU,rb.registerProcessor(rU),ru.registerProcessor(rU),rB.default=rB,rz.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new rU().version,i}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return rz([n(r)]).process(e,t)},n},rz.stringify=tT,rz.parse=rE,rz.fromJSON=rB,rz.list=rv,rz.comment=e=>new rs(e),rz.atRule=e=>new ry(e),rz.decl=e=>new t_(e),rz.rule=e=>new rx(e),rz.root=e=>new rb(e),rz.document=e=>new ru(e),rz.CssSyntaxError=tR,rz.Declaration=t_,rz.Container=ra,rz.Processor=rU,rz.Document=ru,rz.Comment=rs,rz.Warning=rc,rz.AtRule=ry,rz.Result=rh,rz.Input=t1,rz.Rule=rx,rz.Root=rb,rz.Node=tN,r_.registerPostcss(rz),rz.default=rz;let r$=rz&&rz.__esModule&&Object.prototype.hasOwnProperty.call(rz,"default")?rz.default:rz;r$.stringify,r$.fromJSON,r$.plugin,r$.parse,r$.list,r$.document,r$.comment,r$.atRule,r$.rule,r$.decl,r$.root,r$.CssSyntaxError,r$.Declaration,r$.Container,r$.Processor,r$.Document,r$.Comment,r$.Warning,r$.AtRule,r$.Result,r$.Input,r$.Rule,r$.Root,r$.Node;var rW=Object.defineProperty,rH={exports:{}},rV=String,rJ=function(){return{isColorSupported:!1,reset:rV,bold:rV,dim:rV,italic:rV,underline:rV,inverse:rV,hidden:rV,strikethrough:rV,black:rV,red:rV,green:rV,yellow:rV,blue:rV,magenta:rV,cyan:rV,white:rV,gray:rV,bgBlack:rV,bgRed:rV,bgGreen:rV,bgYellow:rV,bgBlue:rV,bgMagenta:rV,bgCyan:rV,bgWhite:rV}};rH.exports=rJ(),rH.exports.createColors=rJ;var rq=rH.exports;let rG=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),rK=class e extends Error{constructor(t,r,s,n,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){let t,r;if(!this.source)return"";let s=this.source;null==e&&(e=rq.isColorSupported),rG&&e&&(s=rG(s));let n=s.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),a=String(o).length;if(e){let{bold:e,gray:s,red:n}=rq.createColors(!0);t=t=>e(n(t)),r=e=>s(e)}else t=r=e=>e;return n.slice(i,o).map((e,s)=>{let n=i+1+s,o=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let s=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return t(">")+r(o)+e+"\n "+s+t("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};rK.default=rK;var rX={};rX.isClean=Symbol("isClean"),rX.my=Symbol("my");let rY={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1},rQ=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="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 s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s{if(void 0!==(s=e.raws[t]))return!1})}return void 0===s&&(s=rY[r]),i.rawCache[r]=s,s}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).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return(t=r.raws.before).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&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(e){let t;return e.raws.indent?e.raws.indent:(e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=(t=e[e.length-1]).replace(/\S/g,""),!1}}),t)}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};function rZ(e,t){new rQ(t).stringify(e)}rQ.default=rQ,rZ.default=rZ;let{isClean:r0,my:r1}=rX,r2=class{constructor(e={}){for(let t in this.raws={},this[r0]=!1,this[r1]=!0,e)if("nodes"===t)for(let r of(this.nodes=[],e[t]))"function"==typeof r.clone?this.append(r.clone()):this.append(r);else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=function e(t,r){let s=new t.constructor;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||"proxyCache"===n)continue;let i=t[n],o=typeof i;"parent"===n&&"object"===o?r&&(s[n]=r):"source"===n?s[n]=i:Array.isArray(i)?s[n]=i.map(t=>e(t,s)):("object"===o&&null!==i&&(i=e(i)),s[n]=i)}return s}(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new rK(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>e[t]===r||(e[t]=r,("prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[r0]){this[r0]=!1;let e=this;for(;e=e.parent;)e[r0]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let i=t.get(s.input);null==i&&(i=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:i,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=rZ){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};r2.default=r2;let r3=r2,r4=class extends r3{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]}};r4.default=r4;let{SourceMapConsumer:r6,SourceMapGenerator:r5}=rG,{existsSync:r8,readFileSync:r9}=rG,{dirname:r7,join:se}=rG,st=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r7(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new r6(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)){var t;return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t)}throw Error("Unsupported source map encoding "+e.match(/data:application\/json;([^,]+),/)[1])}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 r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=r7(e),r8(e))return this.mapFile=e,r9(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t)if("string"==typeof t)return t;else if("function"==typeof t){let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw Error("Unable to load previous source map: "+r.toString());return e}}else if(t instanceof r6)return r5.fromSourceMap(t).toString();else if(t instanceof r5)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;return e&&(t=se(r7(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)}};st.default=st;let{SourceMapConsumer:sr,SourceMapGenerator:ss}=rG,{fileURLToPath:sn,pathToFileURL:si}=rG,{isAbsolute:so,resolve:sa}=rG,{nanoid:sl}={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let s="",n=r;for(;n--;)s+=e[Math.random()*e.length|0];return s}},su=Symbol("fromOffsetCache"),sc=!!(sr&&ss),sh=!!(sa&&so),sp=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\uFEFF"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!sh||/^\w+:\/\//.test(t.from)||so(t.from)?this.file=t.from:this.file=sa(t.from)),sh&&sc){let e=new st(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=""),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);i=e.line,o=e.col}else i=s.line,o=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return(n=a?new rK(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,s.plugin):new rK(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(si&&(n.input.url=si(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[su])r=this[su];else{let e=this.css.split("\n");r=Array(e.length);let t=0;for(let s=0,n=e.length;s=t)s=r.length-1;else{let t,n=r.length-2;for(;s>1)])n=t-1;else if(e>=r[t+1])s=t+1;else{s=t;break}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:sa(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){let n,i;if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=o.originalPositionFor({column:s,line:r})),i=so(a.source)?si(a.source):new URL(a.source,this.map.consumer().sourceRoot||si(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:i.toString()};if("file:"===i.protocol)if(sn)l.file=sn(i);else throw Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(a.source);return u&&(l.source=u),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}};sp.default=sp,rG&&rG.registerInput&&rG.registerInput(sp);let{SourceMapConsumer:sd,SourceMapGenerator:sf}=rG,{dirname:sm,relative:sg,resolve:sy,sep:sw}=rG,{pathToFileURL:sb}=rG,sv=!!(sd&&sf),sS=!!(sm&&sy&&sg&&sw),sx=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,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,r=this.toUrl(this.path(e.file)),s=e.root||sm(e.file);!1===this.mapOpts.sourcesContent?(t=new sd(e.text)).sourcesContent&&(t.sourcesContent=null):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).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(),sS&&sv&&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=sf.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new sf({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)):""});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(){let e,t;this.css="",this.map=new sf({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,s=1,n="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1):(i.source=n,i.original.line=1,i.original.column=0),this.map.addMapping(i)),(e=o.match(/\n/g))?(r+=e.length,t=o.lastIndexOf("\n"),s=o.length-t):s+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};(!("decl"===a.type||"atrule"===a.type&&!a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=s-2):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=s-1),this.map.addMapping(i))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sm(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=sm(sy(r,this.mapOpts.annotation)));let s=sg(r,e);return this.memoizedPaths.set(e,s),s}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 sp(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";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(sb){let t=sb(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===sw&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},sO=r2,sC=class extends sO{constructor(e){super(e),this.type="comment"}};sC.default=sC;let{isClean:sk,my:sE}=rX,sM=r2,sR=class e extends sM{append(...e){for(let t of e)for(let e of this.normalize(t,this.last))this.proxyOf.nodes.push(e);return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){let t,r;if(!this.proxyOf.nodes)return;let s=this.getIterator();for(;this.indexes[s]e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e));if("every"===t||"some"===t)return r=>e[t]((e,...t)=>r(e.toProxy(),...t));if("root"===t)return()=>e.root().toProxy();else if("nodes"===t)return e.nodes.map(e=>e.toProxy());else if("first"===t||"last"===t)return e[t].toProxy();else return e[t]},set:(e,t,r)=>e[t]===r||(e[t]=r,("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 r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();for(let t of(s=this.index(e),n))this.proxyOf.nodes.splice(s+1,0,t);for(let e in this.indexes)s<(r=this.indexes[e])&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",i=this.normalize(t,this.proxyOf.nodes[s],n).reverse();for(let t of(s=this.index(e),i))this.proxyOf.nodes.splice(s,0,t);for(let e in this.indexes)s<=(r=this.indexes[e])&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=function e(t){return t.map(t=>(t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t))}(c(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t))for(let e of t=t.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if("root"===t.type&&"document"!==this.type)for(let e of t=t.nodes.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new r4(t)]}else if(t.selector)t=[new h(t)];else if(t.name)t=[new p(t)];else if(t.text)t=[new sC(t)];else throw Error("Unknown node type in node creation");return t.map(t=>(t[sE]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[sk]&&function e(t){if(t[sk]=!1,t.proxyOf.nodes)for(let r of t.proxyOf.nodes)e(r)}(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){for(let t of e=e.reverse()){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;for(let r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[r])>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{(!t.props||t.props.includes(s.prop))&&(!t.fast||s.value.includes(t.fast))&&(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};sR.registerParse=e=>{c=e},sR.registerRule=e=>{h=e},sR.registerAtRule=e=>{p=e},sR.registerRoot=e=>{d=e},sR.default=sR,sR.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,p.prototype):"rule"===e.type?Object.setPrototypeOf(e,h.prototype):"decl"===e.type?Object.setPrototypeOf(e,r4.prototype):"comment"===e.type?Object.setPrototypeOf(e,sC.prototype):"root"===e.type&&Object.setPrototypeOf(e,d.prototype),e[sE]=!0,e.nodes&&e.nodes.forEach(e=>{sR.rebuild(e)})};let sI=sR,sA=class extends sI{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new f(new m,this,e).stringify()}};sA.registerLazyResult=e=>{f=e},sA.registerProcessor=e=>{m=e},sA.default=sA;let sP=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}};sP.default=sP;let sT=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,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 r=new sP(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};sT.default=sT;let sL=/[\t\n\f\r "#'()/;[\\\]{}]/g,sD=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,sN=/.[\r\n"'(/\\]/,sj=/[\da-f]/i,s_=sR,sF=class extends s_{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)}};sF.default=sF,s_.registerAtRule(sF);let sU=sR,sB=class extends sU{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if("prepend"===r)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 s)e.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new g(new y,this,e).stringify()}};sB.registerLazyResult=e=>{g=e},sB.registerProcessor=e=>{y=e},sB.default=sB,sU.registerRoot(sB);let sz={comma:e=>sz.split(e,[","],!0),space:e=>sz.split(e,[" ","\n"," "]),split(e,t,r){let s=[],n="",i=!1,o=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==n&&s.push(n.trim()),n="",i=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};sz.default=sz;let s$=sR,sW=class extends s${constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return sz.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};sW.default=sW,s$.registerRule(sW);let sH=function(e,t={}){let r,s,n,i,o,a,l,u,c,h,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(r=p.charCodeAt(m)){case 10:case 32:case 9:case 13:case 12:s=m;do s+=1,r=p.charCodeAt(s);while(32===r||10===r||9===r||13===r||12===r);h=["space",p.slice(m,s)],m=s-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(r);h=[e,e,m];break}case 40:if(u=g.length?g.pop()[1]:"",c=p.charCodeAt(m+1),"url"===u&&39!==c&&34!==c&&32!==c&&10!==c&&9!==c&&12!==c&&13!==c){s=m;do{if(a=!1,-1===(s=p.indexOf(")",s+1)))if(d||t){s=m;break}else w("bracket");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),i=p.slice(m,s+1),-1===s||sN.test(i)?h=["(","(",m]:(h=["brackets",i,m,s],m=s);break;case 39:case 34:n=39===r?"'":'"',s=m;do{if(a=!1,-1===(s=p.indexOf(n,s+1)))if(d||t){s=m+1;break}else w("string");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["string",p.slice(m,s+1),m,s],m=s;break;case 64:sL.lastIndex=m+1,sL.test(p),s=0===sL.lastIndex?p.length-1:sL.lastIndex-2,h=["at-word",p.slice(m,s+1),m,s],m=s;break;case 92:for(s=m,o=!0;92===p.charCodeAt(s+1);)s+=1,o=!o;if(r=p.charCodeAt(s+1),o&&47!==r&&32!==r&&10!==r&&9!==r&&13!==r&&12!==r&&(s+=1,sj.test(p.charAt(s)))){for(;sj.test(p.charAt(s+1));)s+=1;32===p.charCodeAt(s+1)&&(s+=1)}h=["word",p.slice(m,s+1),m,s],m=s;break;default:47===r&&42===p.charCodeAt(m+1)?(0===(s=p.indexOf("*/",m+2)+1)&&(d||t?s=p.length:w("comment")),h=["comment",p.slice(m,s+1),m,s]):(sD.lastIndex=m+1,sD.test(p),s=0===sD.lastIndex?p.length-1:sD.lastIndex-2,h=["word",p.slice(m,s+1),m,s],g.push(h)),m=s}return m++,h},position:function(){return m}}},sV={empty:!0,space:!0},sJ=class{constructor(e){this.input=e,this.root=new sB,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,r,s,n=new sF;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===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}else if("{"===t){o=!0;break}else if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),i&&(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=""),o&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t,r=this.colon(e);if(!1===r)return;let s=0;for(let n=r-1;n>=0&&("space"===(t=e[n])[0]||2!==(s+=1));n--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}colon(e){let t,r,s=0;for(let[n,i]of e.entries()){if("("===(t=i[0])&&(s+=1),")"===t&&(s-=1),0===s&&":"===t)if(r)if("word"===r[0]&&"progid"===r[1])continue;else return n;else this.doubleColon(i);r=i}return!1}comment(e){let t=new sC;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=sH(this.input)}decl(e,t){let r,s,n=new r4;this.init(n,e[0][2]);let i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}("_"===n.prop[0]||"*"===n.prop[0])&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if("!important"===(r=e[t])[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);" !important"!==(r=this.spacesFromEnd(e)+r)&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.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 sW;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,r=null,s=!1,n=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),i.push("("===r?")":"]");else if(o&&s&&"{"===r)n||(n=l),i.push("}");else if(0===i.length)if(";"===r)if(s)return void this.decl(a,o);else break;else if("{"===r)return void this.rule(a);else if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}else":"===r&&(s=!0);else r===i[i.length-1]&&(i.pop(),0===i.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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,r,s){let n,i,o,a,l=r.length,u="",c=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:s,value:u}}e[t]=u}rule(e){e.pop();let t=new sW;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(e,t){let r="";for(let s=t;ss2(e)),e}let s3={},s4=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"==typeof r&&null!==r&&("root"===r.type||"document"===r.type))n=s2(r);else if(r instanceof e||r instanceof sT)n=s2(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=sq;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[sK]&&sR.rebuild(n)}this.result=new sT(t,n,s),this.helpers={...s3,postcss:s3,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 Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!sY[r]&&/^[A-Z]/.test(r))throw Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sQ[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(sZ(e))try{await e}catch(r){let e=t[t.length-1].node;throw this.handleError(r,e)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(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));if(sZ(t[0]))return Promise.all(t);return 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=rZ;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new sx(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(sZ(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[sG];)e[sG]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(sZ(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex{e[sG]||this.walkSync(e)});else{let r=this.listeners[t];if(r&&this.visitSync(r,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"}};s4.registerPostcss=e=>{s3=e},s4.default=s4,sB.registerLazyResult(s4),sA.registerLazyResult(s4);let s6=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0,this.result=new sT(this._processor,s,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let i=new sx(rZ,s,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 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(){let e;if(this._root)return this._root;try{e=sq(this._css,this._opts)}catch(e){this.error=e}if(!this.error)return this._root=e,e;throw this.error}get[Symbol.toStringTag](){return"NoWorkResult"}};s6.default=s6;let s5=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"==typeof r&&(r.parse||r.stringify));else throw Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new s4(this,e,t):new s6(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};function s8(e,t){if(Array.isArray(e))return e.map(e=>s8(e));let{inputs:r,...s}=e;if(r)for(let e of(t=[],r)){let r={...e,__proto__:sp.prototype};r.map&&(r.map={...r.map,__proto__:st.prototype}),t.push(r)}if(s.nodes&&(s.nodes=e.nodes.map(e=>s8(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new sB(s);if("decl"===s.type)return new r4(s);if("rule"===s.type)return new sW(s);if("comment"===s.type)return new sC(s);if("atrule"===s.type)return new sF(s);else throw Error("Unknown node type: "+e.type)}function s9(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s5(e)}s5.default=s5,sB.registerProcessor(s5),sA.registerProcessor(s5),s8.default=s8,s9.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new s5().version,i}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return s9([n(r)]).process(e,t)},n},s9.stringify=rZ,s9.parse=sq,s9.fromJSON=s8,s9.list=sz,s9.comment=e=>new sC(e),s9.atRule=e=>new sF(e),s9.decl=e=>new r4(e),s9.rule=e=>new sW(e),s9.root=e=>new sB(e),s9.document=e=>new sA(e),s9.CssSyntaxError=rK,s9.Declaration=r4,s9.Container=sR,s9.Processor=s5,s9.Document=sA,s9.Comment=sC,s9.Warning=sP,s9.AtRule=sF,s9.Result=sT,s9.Input=sp,s9.Rule=sW,s9.Root=sB,s9.Node=r2,s4.registerPostcss(s9),s9.default=s9;let s7=s9&&s9.__esModule&&Object.prototype.hasOwnProperty.call(s9,"default")?s9.default:s9;s7.stringify,s7.fromJSON,s7.plugin,s7.parse,s7.list,s7.document,s7.comment,s7.atRule,s7.rule,s7.decl,s7.root,s7.CssSyntaxError,s7.Declaration,s7.Container,s7.Processor,s7.Document,s7.Comment,s7.Warning,s7.AtRule,s7.Result,s7.Input,s7.Rule,s7.Root,s7.Node;let ne="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.",nt={map:{},getId:()=>(console.error(ne),-1),getNode:()=>(console.error(ne),null),removeNodeFromMap(){console.error(ne)},has:()=>(console.error(ne),!1),reset(){console.error(ne)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(nt=new Proxy(nt,{get:(e,t,r)=>("map"===t&&console.error(ne),Reflect.get(e,t,r))}));/[1-9][0-9]{12}/.test(Date.now().toString())||(()=>new Date().getTime());for(var nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ns="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nn=0;nn> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ey=e.contentWindow)?void 0:ey.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new class e{constructor(){tx(this,"idNodeMap",new Map),tx(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-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){let 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){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},(q=ew||(ew={}))[q.NotStarted=0]="NotStarted",q[q.Running=1]="Running",q[q.Stopped=2]="Stopped";var ni=((G=ni||{})[G.DomContentLoaded=0]="DomContentLoaded",G[G.Load=1]="Load",G[G.FullSnapshot=2]="FullSnapshot",G[G.IncrementalSnapshot=3]="IncrementalSnapshot",G[G.Meta=4]="Meta",G[G.Custom=5]="Custom",G[G.Plugin=6]="Plugin",G),no=((K={}).FAILED="FAILED",K.ABORTED="ABORTED",K.BLOCKED_BY_CLIENT="BLOCKED_BY_CLIENT",K);let na=["error","warn","info","log","debug"];var nl=((X={}).CaptureEvent="captureEvent",X.ConsoleEvent="consoleEvent",X.InteractivityEvent="interactivityEvent",X.NavigationEvent="navigationEvent",X.NetworkEvent="networkEvent",X.ReplayEvent="replayEvent",X.WebsocketEvent="websocketEvent",X.VideoEvent="videoEvent",X),nu=((Y={})[Y.IsDataUrl=0]="IsDataUrl",Y[Y.ContentType=1]="ContentType",Y[Y.ObjectType=2]="ObjectType",Y[Y.Size=3]="Size",Y[Y.NoData=4]="NoData",Y),nc=((Q={}).BackgroundRequestLifecycle="BackgroundRequestLifecycle",Q.HostFetch="HostFetch",Q.HostXHR="HostXHR",Q.HostPerformanceObserver="HostPerformanceObserver",Q),nh=((Z={}).Start="Start",Z.End="End",Z);(et=(ee=eb||(eb={})).MarkBase||(ee.MarkBase={})).Start="start",et.Stop="stop",(er=ee.MarkVideo||(ee.MarkVideo={})).Pause="pause",er.Resume="resume",er.Annotation="annotation",(es=ee.video||(ee.video={})).isStartEvent=function(e){return e.type===ni.Custom&&"start-recording"==e.data.tag||"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Video&&"start"===e.data.payload.mark},es.isPauseEvent=function(e){return e.type===ni.Custom&&"resume-recording"==e.data.tag||"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Video&&"pause"===e.data.payload.mark},es.isResumeEvent=function(e){return e.type===ni.Custom&&"resume-recording"==e.data.tag||"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Video&&"resume"===e.data.payload.mark},es.isStopEvent=function(e){return e.type===ni.Custom&&"stop-recording"==e.data.tag||"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Video&&"stop"===e.data.payload.mark},es.isAnnotationEvent=function(e){return"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Video&&"annotation"===e.data.payload.mark},(en=ee.rewind||(ee.rewind={})).isStartEvent=function(e){return"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Rewind&&"start"===e.data.payload.mark},en.isStopEvent=function(e){return"captureEvent"===e.jamType&&e.data.payload.captureMode===tb.Rewind&&"stop"===e.data.payload.mark};let np=["click"],nd=["keydown","keyup"],nf=["id","className","tagName","type","value","autocomplete"],nm=["data"],ng=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Alt","AltDead","AltLeft","AltRight","Backspace","CapsLock","ContextMenu","Control","ControlLeft","ControlRight","Enter","Escape","Meta","MetaLeft","MetaRight","Shift","ShiftLeft","ShiftRight","Tab"],ny={Digit0:")",Digit1:"!",Digit2:"@",Digit3:"#",Digit4:"$",Digit5:"%",Digit6:"^",Digit7:"&",Digit8:"*",Digit9:"(",Minus:"_",Equal:"+",Period:">",Comma:"<",Slash:"?",Quote:'"',Semicolon:":",BracketLeft:"{",BracketRight:"}",BackSlash:"|",Backquote:"~"},nw=["altKey","ctrlKey","metaKey","shiftKey"],nb={shiftKey:"Shift",altKey:"Alt",metaKey:"Meta",ctrlKey:"Control"};var nv=((ei={}).Input="input",ei.Output="output",ei);!function(e){var t,r;function s(e){var t,r;let s=n(e,"origin",!0)??"";if(0===s.length)return"invalid-security-origin";let i=n(e,"Access-Control-Allow-Origin")??"",o="*"===i,a="true"===n(e,"Access-Control-Allow-Credentials"),l=n(e,"Access-Control-Allow-Methods")??"";return o&&a?"no-wildcard-with-credentials":i!==s?0===i.length?"empty-allowed-origin-header":i.includes(",")?"multiple-origins-specified":(null==(t=e.fetchDetails)?void 0:t.status)!==200?"bad-response-status":"invalid-origin":l.length>0&&!l.split(",").map(e=>e.trim()).includes((null==(r=e.fetchDetails)?void 0:r.method)??"")?"invalid-method":void 0}function n(e,t){var r;let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Headers((null==(r=e.fetchDetails)?void 0:r[s?"requestHeaders":"responseHeaders"])??void 0).get(t)??void 0}function i(t){var r;return!!(null==(r=t.fetchDetails)?void 0:r.requestHeaders)&&(Object.values(e.AccessControlHeaders).some(e=>void 0!==n(t,e))||o(t))}function o(t){return"cors"===n(t,e.SecFetchModeHeader,!0)}(t=e.AccessControlHeaders||(e.AccessControlHeaders={})).Credentials="Access-Control-Allow-Credentials",t.Origin="Access-Control-Allow-Origin",t.Headers="Access-Control-Allow-Headers",t.Method="Access-Control-Allow-Methods",e.SecFetchModeHeader="Sec-Fetch-Mode",(r=e.CorsErrorType||(e.CorsErrorType={})).WildcardOriginWithCredentialsSet="no-wildcard-with-credentials",r.EmptyOriginHeader="empty-allowed-origin-header",r.MultipleOrigins="multiple-origins-specified",r.InvalidOrigin="invalid-origin",r.InvalidSecurityOrigin="invalid-security-origin",r.BadResponseStatus="bad-response-status",r.InvalidMethod="invalid-method",e.isCorsNetworkError=function(e){return(null==e?void 0:e.category)==="cors"},e.hasPreflightRequest=function(e){return!!e.corsOptionsRequest},e.translateCorsErrorToMessage=function(e,t){var r,s,i,o;let a=e.entry.name,l=n(e.corsOptionsRequest??e,"origin",!0),u=n(e.corsOptionsRequest??e,"Access-Control-Allow-Origin"),c=[`Access to fetch at '${a}' from origin '${l}' has been blocked by CORS policy:`,e.corsOptionsRequest?" Response to preflight request doesn't pass access control check:":""].join(" ");switch(t){case"empty-allowed-origin-header":return`${c} No 'Access-Control-Allow-Origin' header was sent by the server, or the header was empty`;case"bad-response-status":return`${c} The response had HTTP status code: ${(null==(s=e.corsOptionsRequest)||null==(r=s.fetchDetails)?void 0:r.status)??(null==(i=e.fetchDetails)?void 0:i.status)??"Unknown"}`;case"invalid-origin":return`${c} The 'Access-Control-Allow-Origin' header has a value "${u}" that is not equal to "${l}"`;case"invalid-security-origin":return`${c} An 'Origin' header was not found on the original request`;case"multiple-origins-specified":return`${c} The 'Access-Control-Allow-Origin' header contains multiple values "${u}", but only one is allowed`;case"no-wildcard-with-credentials":return`${c} A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the 'Access-Control-Allow-Credentials' header is set to 'true'`;case"invalid-method":return`${c} Did not find method "${(null==(o=e.fetchDetails)?void 0:o.method)??"Unknown"}" in the 'Access-Control-Allow-Methods' header of the HTTP response`}},e.findCorsError=function(e){var t;let{fetchDetails:r}=e;if((null==r?void 0:r.error)&&r.error===(t=no.FAILED,`net::ERR_${t}`)&&(e.corsOptionsRequest||i(e)))return e.corsOptionsRequest?s(e.corsOptionsRequest):s(e)},e.checkForCorsError=s,e.getHeader=n,e.hasAnyCorsHeaders=i,e.eventHasSecFetchModeSetToCors=o}(ev||(ev={}));let nS=navigator.userAgent.toLowerCase();nS.includes("android"),nS.includes("mobile");var nx=r(930),nO=r.n(nx);let nC=Symbol.for("jamlogger"),nk={push(e){let t=nk.get();globalThis[nC]=t.concat(e)},get(){let e=globalThis[nC];return e&&Array.isArray(e)?e.filter(e=>"string"==typeof e):[]},shouldLog(e){let t=nk.get();try{return t.some(t=>new RegExp(t).test(e))}catch{return!1}}},nE={IS_DEV:"production"===eI.Development},nM={...console},nR={info:nM.info,log:nM.log,debug:nM.debug,error:nM.error,warn:nM.warn,fork:()=>nR},nI=nE.IS_DEV;function nA(e,t,r){return function(){for(var s=arguments.length,n=Array(s),i=0;i{let t=e?`${e.trim()}:`:void 0;return{info:nA(nP,"info",t),log:nA(nP,"log",t),debug:nA(nP,"debug",t),error:nA(nP,"error",t),warn:nA(nP,"warn",t),fork:e=>nT(t?`${t}${e}`:e)}},nL=nT(),nD=RegExp("text/.*|application/.*","i"),nN=RegExp("application/pdf|application/wasm|application/mp4|application/vnd.yt-ump|application/mpeg4.*","i");function nj(e){let{contentType:t,body:r}=e;if(!t)return{include:!1,reason:{type:nu.NoData}};if(!(nD.test(t)&&!nN.test(t)))return{include:!1,reason:{type:nu.ContentType}};switch(typeof r){case"string":{if(r.startsWith("data:"))return{include:!1,reason:{type:nu.IsDataUrl}};let e=eg.Megabyte;if(r.length>e)return{include:!1,reason:{type:nu.Size,limit:e}};return{include:!0}}case"object":if(r instanceof Document||r instanceof Blob||r instanceof ArrayBuffer)return{include:!1,reason:{type:nu.ObjectType}};return{include:!0};default:return{include:!0}}}let n_=new Map;function nF(e){n_.set(e,performance.now())}function nU(e,t){let r=n_.get(e);return t||void 0===r||n_.delete(e),r}function nB(e,t,r,s){let n=nz(r),i=s&&nz(s);return{absoluteStart:n,name:t,duration:i?i-n:void 0,entryType:"resource",startTime:n,connectEnd:void 0,connectStart:void 0,decodedBodySize:void 0,domainLookupEnd:void 0,domainLookupStart:void 0,encodedBodySize:void 0,fetchStart:n,initiatorType:e,nextHopProtocol:"unknown",redirectEnd:void 0,redirectStart:void 0,requestStart:n,responseEnd:i,responseStart:n,secureConnectionStart:void 0,serverTiming:void 0,transferSize:void 0,workerStart:void 0}}function nz(e){var t;return((null==(t=performance.timing)?void 0:t.navigationStart)??performance.timeOrigin)+e}let n$=nL.fork("fetchInterceptor"),nW=eg.Megabyte,nH=window.fetch;class nV{get signal(){return this.abortController.signal}disconnect(){this.connected=!1}connect(){this.connected=!0,this.originalAbortSignal.aborted&&this.abortController.abort()}constructor(e){eA(this,"originalAbortSignal",void 0),eA(this,"abortController",void 0),eA(this,"connected",void 0),this.originalAbortSignal=e,this.abortController=new AbortController,this.connected=!0,this.abortController.signal.addEventListener("abort",()=>{n$.info("aborting fetch request",{signalOwner:"jam",isConnected:this.connected})}),e.addEventListener("abort",()=>{n$.info("aborting fetch request",{signalOwner:"host",isConnected:this.connected})}),e.addEventListener("abort",()=>{this.connected&&this.abortController.abort()})}}class nJ{static handleStream(e,t){return nj({contentType:e.headers.get("content-type"),body:void 0})?new nJ(e,t).overrideResponse:e}constructor(e,t){var r;eA(this,"submitDataInternal",void 0),eA(this,"collectedChunks",void 0),eA(this,"overrideResponse",void 0),eA(this,"transformChunk",void 0),eA(this,"flushData",void 0),this.submitDataInternal=t,this.collectedChunks=[],this.transformChunk=(e,t)=>{this.collectedChunks.push(e),t.enqueue(e)},this.flushData=()=>{let e;try{e=this.collectedChunks.join("")}catch{e=JSON.stringify(this.collectedChunks)}this.submitDataInternal({size:e.length,value:e})};let s=new TransformStream({transform:this.transformChunk,flush:this.flushData});this.overrideResponse=new Response(null==(r=e.body)?void 0:r.pipeThrough(s),e)}}async function nq(e){if(!e.body)return{size:0,value:void 0};let t=Number.parseInt(e.headers.get("content-length")??"",10);if(t>nW)return{size:t,value:void 0};let r=e.body.getReader(),s=[],n=0;try{for(;;){let{done:e,value:t}=await r.read();if(e)break;t&&(n+t.length<=nW?s.push(t):s.length>0&&(s.length=0),n+=t.length)}}finally{r.releaseLock()}if(0===s.length)return{size:n,value:void 0};let i=new Uint8Array(n),o=0;for(let e of s)i.set(e,o),o+=e.length;return{size:n,value:new TextDecoder().decode(i)}}let nG=new Set(["resource"]);function nK(e){return nG.has(e.entryType)}let nX=window.XMLHttpRequest.prototype.open,nY=window.XMLHttpRequest.prototype.send,nQ=new Map,nZ=new class{clearExistingTimeout(e){let t=this.innerMap.get(e);(null==t?void 0:t.timeout)&&clearTimeout(t.timeout)}newTimeout(e){return setTimeout(()=>{this.innerMap.delete(e)},this.timeToEvict)}set(e,t){this.clearExistingTimeout(e),this.innerMap.set(e,{value:t,timeout:this.newTimeout(e)})}get(e){var t;return null==(t=this.innerMap.get(e))?void 0:t.value}delete(e){return this.innerMap.delete(e)}constructor(e){eA(this,"innerMap",new Map),eA(this,"timeToEvict",void 0),this.timeToEvict=e}}(eM("5m"));async function n0(e,t,r,s,n){var i,o;let a,l=nU(t,!s);if(!l)return void nL.info("could not find mark, context:",n);let u=s?performance.now():void 0,c=nZ.get(t);if(!c)return;s&&(nZ.delete(t),nQ.delete(r));let h=nj({contentType:r.getResponseHeader("content-type"),body:c.requestBody}),p=nj({contentType:r.getResponseHeader("content-type"),body:r.response});if(s&&p.include)try{a="string"==typeof r.response?r.response:r.response instanceof Document?null==(o=r.response.body)?void 0:o.innerText:r.response instanceof Blob?await r.response.text():r.response instanceof ArrayBuffer?new TextDecoder().decode(r.response):JSON.stringify(r.response)}catch{}let d=s?{}:function(e){let t={};for(let r of e.split(/[\r\n]+/)){let[e,s]=r.split(":").map(e=>e.trim());e&&s&&(t[e]=s)}return t}(r.getAllResponseHeaders()),f={frameId:void 0,jamTaggedId:t,timeOrigin:(null==(i=performance.timing)?void 0:i.navigationStart)??window.performance.timeOrigin,entry:nB("xmlhttprequest",c.url??r.responseURL??"",l,u),fetchDetails:{method:c.method,status:r.status,statusText:r.statusText,requestHeaders:void 0,requestMimeType:void 0,requestBody:h.include?c.requestBody:void 0,requestBodySize:c.requestBody?new Blob([c.requestBody]).size:void 0,requestBodyOmittedReason:h.include?void 0:h.reason,responseBody:p.include?a:void 0,responseBodySize:a?new Blob([a]).size:void 0,responseBodyOmittedReason:p.include?void 0:p.reason,responseMimeType:void 0,responseHeaders:d},complete:s,source:"client-xhr",sourceSuffix:s?"end":"start",eventSources:[{jamTaggedId:t,location:nc.HostXHR,point:s?nh.End:nh.Start}]};e(f)}let n1={name:"jam/network@1",observer(e,t,r){var s,n,i,o,a;let l;return s=e,n=r,window.fetch=(i=nH,o=s,a=n,async function(){let e,t;for(var r,s,n=arguments.length,l=Array(n),u=0;u{let t=performance.now(),r=e.clone();null==p||p.measure({metric:"fetchInterceptor_cloneResponse",start:t,end:performance.now()});let s=nU(g);if(!s)return e;let n=e=>{var n;let i=e.size>nW?{include:!1,reason:{type:nu.Size,limit:nW}}:nj({contentType:r.headers.get("content-type"),body:e.value}),a=m.size>nW?{include:!1,reason:{type:nu.Size,limit:nW}}:nj({contentType:f.headers.get("content-type"),body:m.value}),l={jamTaggedId:g,frameId:void 0,timeOrigin:(null==(n=performance.timing)?void 0:n.navigationStart)??window.performance.timeOrigin,entry:nB("fetch",f.url,s,t),fetchDetails:{method:f.method,status:r.status,statusText:r.statusText,requestHeaders:Object.fromEntries(f.headers),requestMimeType:f.headers.get("content-type")??"",requestBody:a.include?m.value:void 0,requestBodyOmittedReason:a.include?void 0:a.reason,requestBodySize:m.size,responseBody:i.include?e.value:void 0,responseBodyOmittedReason:i.include?void 0:i.reason,responseBodySize:e.size,responseMimeType:r.headers.get("content-type")??"",responseHeaders:Object.fromEntries(r.headers)},source:"client-fetch",complete:!0,eventSources:[{jamTaggedId:g,location:nc.HostFetch,point:nh.End}]};n$.debug("intercepted fetch",l),o(l)},i=(null==p?void 0:p.decorate(n,"fetch_submitData"))??n;return!function(e){let t=e.headers.get("content-type"),r="text/event-stream"===t,s=!!(null==t?void 0:t.includes("multipart/"));return r||s}(r)?(null==y||y.disconnect(),nq(r).catch(()=>({size:0,value:void 0})).then(e=>{i(e),null==y||y.connect()}).catch(()=>void 0),null==p||p.measure({metric:"fetchInterceptor_patchResponse",start:t,end:performance.now()}),e):nJ.handleStream(r,i)}).catch(e=>{try{var t;let r=performance.now(),s=nU(g),n=performance.now();if(!s)return Promise.reject(e);let i={jamTaggedId:g,frameId:void 0,timeOrigin:(null==(t=performance.timing)?void 0:t.navigationStart)??window.performance.timeOrigin,entry:nB("fetch",f.url,s,n),fetchDetails:{method:f.method,status:e.status,statusText:e.statusText,requestHeaders:Object.fromEntries(f.headers),error:e.message},eventSources:[{jamTaggedId:g,location:nc.HostFetch,point:nh.End}],source:"client-fetch",complete:!0};o(i),null==p||p.measure({metric:"fetchInterceptor_patchResponseError",start:r,end:performance.now()})}catch(e){n$.error("jam responseError interceptor internal error",e)}throw e})}),n$.debug("attached",{oldFetch:nH}),((e,t)=>{let r=function(){for(var r,s=arguments.length,n=Array(s),i=0;i{};function t(t){return r=>{r.getEntries().filter(nK).filter(e=>(!!t.includeFetch||"fetch"!==e.initiatorType)&&(!!t.includeXHR||"xmlhttprequest"!==e.initiatorType)).forEach(t=>{var r,s;e({frameId:void 0,jamTaggedId:void 0,timeOrigin:(null==(r=performance.timing)?void 0:r.navigationStart)??window.performance.timeOrigin,entry:{...JSON.parse(JSON.stringify(t)),absoluteStart:t.startTime+((null==(s=performance.timing)?void 0:s.navigationStart)??performance.timeOrigin)},rawPerformanceObserverTimings:JSON.parse(JSON.stringify(t)),source:"client-performance-observer",complete:!0,eventSources:[{jamTaggedId:void 0,location:nc.HostPerformanceObserver,point:nh.End}]})})}}t({includeFetch:!0,includeXHR:!0})(window.performance);let r=new PerformanceObserver(t({includeFetch:!1,includeXHR:!1}));return r.observe({entryTypes:[...nG]}),()=>r.disconnect()}(e)),()=>{window.fetch=nH,n$.debug("detached",{oldFetch:nH}),window.XMLHttpRequest.prototype.open=nX,window.XMLHttpRequest.prototype.send=nY,null==l||l()}},options:{}};var n2=new Uint8Array(16);let n3=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var n4=[],n6=0;n6<256;++n6)n4.push((n6+256).toString(16).substr(1));let n5=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(n4[e[t+0]]+n4[e[t+1]]+n4[e[t+2]]+n4[e[t+3]]+"-"+n4[e[t+4]]+n4[e[t+5]]+"-"+n4[e[t+6]]+n4[e[t+7]]+"-"+n4[e[t+8]]+n4[e[t+9]]+"-"+n4[e[t+10]]+n4[e[t+11]]+n4[e[t+12]]+n4[e[t+13]]+n4[e[t+14]]+n4[e[t+15]]).toLowerCase();if(!("string"==typeof r&&n3.test(r)))throw TypeError("Stringified UUID is invalid");return r},n8=function(e,t,r){var s=(e=e||{}).random||(e.rng||function(){if(!ex&&!(ex="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ex(n2)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){r=r||0;for(var n=0;n<16;++n)t[r+n]=s[n];return t}return n5(s)};class n9{onOpen(e){this.openHandler=e}onMessage(e){this.messageHandler=e}onClose(e){this.closeHandler=e}onSend(e){this.sendHandler=e}attach(){if(this.attached)throw Error("already patched WebSocket");this.$WebSocket=window.WebSocket;let e=new Proxy(window.WebSocket,{construct:(e,t,r)=>{var s;let n=n8(),[i]=t,o={jamWsId:n,url:i},a=Reflect.construct(e,t,r),l=e=>{var t;null==(t=this.openHandler)||t.call(this,o,e)},u=e=>{if(e instanceof MessageEvent){var t;null==(t=this.messageHandler)||t.call(this,o,e)}},c=e=>{var t;null==(t=this.closeHandler)||t.call(this,o,e),a.removeEventListener("open",d),a.removeEventListener("message",f),a.removeEventListener("close",m)},h=(e,t)=>{var r;null==(r=this.sendHandler)||r.call(this,e,t)},p=(null==(s=this.perfApi)?void 0:s.ready)?this.perfApi:null,d=(null==p?void 0:p.decorate(l,"websocket_openHandler"))??l,f=(null==p?void 0:p.decorate(u,"websocket_messageHandler"))??u,m=(null==p?void 0:p.decorate(c,"websocket_closeHandler"))??c,g=(null==p?void 0:p.decorate(h,"websocket_sendHandler"))??h;try{a.addEventListener("open",d),a.addEventListener("message",f),a.addEventListener("close",m),a.send=new Proxy(a.send,{apply:(e,t,r)=>{Reflect.apply(e,a,r),g(o,r[0])}})}catch(e){nL.warn("Jam cannot observe WebSocket activity on this website, please reach out to support@jam.dev for assistance",{error:eH(e)})}return a}});return window.WebSocket=e,this.attached=!0,()=>{window.WebSocket=this.$WebSocket,this.$WebSocket=void 0,this.attached=!1}}constructor(e){eA(this,"$WebSocket",void 0),eA(this,"attached",void 0),eA(this,"perfApi",void 0),eA(this,"openHandler",void 0),eA(this,"messageHandler",void 0),eA(this,"closeHandler",void 0),eA(this,"sendHandler",void 0),this.attached=!1,this.perfApi=null==e?void 0:e.perfApi}}var n7=Object.defineProperty,ie=(e,t,r)=>{let s;return(s="symbol"!=typeof t?t+"":t)in e?n7(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r},it=Object.defineProperty,ir=(e,t,r)=>{let s;return(s="symbol"!=typeof t?t+"":t)in e?it(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r},is=((eo=is||{})[eo.Document=0]="Document",eo[eo.DocumentType=1]="DocumentType",eo[eo.Element=2]="Element",eo[eo.Text=3]="Text",eo[eo.CDATA=4]="CDATA",eo[eo.Comment=5]="Comment",eo);let ii={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},io={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ia={};function il(e){if(ia[e])return ia[e];let t=globalThis[e],r=t.prototype,s=e in ii?ii[e]:void 0,n=!!(s&&s.every(e=>{var t,s;return!!(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),i=e in io?io[e]:void 0,o=!!(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&o&&!globalThis.Zone)return ia[e]=t.prototype,t.prototype;try{let s=document.createElement("iframe");document.body.appendChild(s);let n=s.contentWindow;if(!n)return t.prototype;let i=n[e].prototype;if(document.body.removeChild(s),!i)return r;return ia[e]=i}catch{return r}}let iu={};function ic(e,t,r){var s;let n=`${e}.${String(r)}`;if(iu[n])return iu[n].call(t);let i=null==(s=Object.getOwnPropertyDescriptor(il(e),r))?void 0:s.get;return i?(iu[n]=i,i.call(t)):t[r]}let ih=function(e){return ic("Node",e,"childNodes")},ip=function(e){return ic("Node",e,"parentNode")},id=function(e){return ic("Node",e,"parentElement")},im=function(e){return ic("Node",e,"textContent")},ig=function(e){return e&&"shadowRoot"in e?ic("Element",e,"shadowRoot"):null};function iy(e){return e.nodeType===e.ELEMENT_NODE}function iw(e){var t;let r=e&&"host"in e&&"mode"in e&&((t=e)&&"host"in t?ic("ShadowRoot",t,"host"):null)||null;return!!(r&&"shadowRoot"in r&&ig(r)===e)}function ib(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function iv(e){try{var t;let r=e.rules||e.cssRules;if(!r)return null;let s=e.href;return!s&&e.ownerNode&&e.ownerNode.ownerDocument&&(s=e.ownerNode.ownerDocument.location.href),(t=Array.from(r,e=>iS(e,s)).join("")).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}}function iS(e,t){if("styleSheet"in e){let t;try{t=iv(e.styleSheet)||function(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?iT(t,e.styleSheet.href):t}{let r=e.cssText;return("selectorText"in e&&e.selectorText.includes(":")&&(r=r.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t)?iT(r,t):r}}class ix{constructor(){ir(this,"idNodeMap",new Map),ir(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-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){let 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){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function iO({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:i}){let o=n||"",a=s&&iC(s);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function iC(e){return e.toLowerCase()}let ik="__rrweb_original__";function iE(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?iC(t):null}function iM(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}let s=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}let iR=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,iI=/^(?:[a-z+]+:)?\/\//i,iA=/^www\..*/i,iP=/^(data:)([^,]*),(.*)/i;function iT(e,t){return(e||"").replace(iR,(e,r,s,n,i,o)=>{let a=s||i||o,l=r||n||"";if(!a)return e;if(iI.test(a)||iA.test(a)||iP.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${(t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]+a}${l})`;let u=t.split("/"),c=a.split("/");for(let e of(u.pop(),c))if("."===e)continue;else".."===e?u.pop():u.push(e);return`url(${l}${u.join("/")}${l})`})}function iL(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}let iD=1,iN=RegExp("[^a-z0-9-_:]");function ij(){return iD++}let i_=/^[^ \t\n\r\u000c]+/,iF=/^[, \t\n\r\u000c]+/,iU=new WeakMap;function iB(e,t){return t&&""!==t.trim()?iz(e,t):t}function iz(e,t){let r=iU.get(e);if(r||(r=e.createElement("a"),iU.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function i$(e,t,r,s){if(!s)return s;if("src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0])return iB(e,s);if("background"===r&&("table"===t||"td"===t||"th"===t))return iB(e,s);if("srcset"===r)return function(e,t){if(""===t.trim())return t;let r=0;function s(e){let s,n=e.exec(t.substring(r));return n?(s=n[0],r+=s.length,s):""}let n=[];for(;s(iF),!(r>=t.length);){let i=s(i_);if(","===i.slice(-1))i=iB(e,i.substring(0,i.length-1)),n.push(i);else{let s="";i=iB(e,i);let o=!1;for(;;){let e=t.charAt(r);if(""===e){n.push((i+s).trim());break}if(o)")"===e&&(o=!1);else if(","===e){r+=1,n.push((i+s).trim());break}else"("===e&&(o=!0);s+=e,r+=1}}}return n.join(", ")}(e,s);if("style"===r)return iT(s,iz(e));else if("object"===t&&"data"===r)return iB(e,s);return s}function iW(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function iH(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&iH(ip(e),t,r);for(let r=e.classList.length;r--;){let s=e.classList[r];if(t.test(s))return!0}return!!r&&iH(ip(e),t,r)}function iV(e,t,r,s){let n;if(iy(e)){if(!ih(n=e).length)return!1}else{if(null===id(e))return!1;n=id(e)}try{if("string"==typeof t){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(iH(n,t,s))return!0;if(r){if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}}catch(e){}return!1}function iJ(e){return null==e?"":e.toLowerCase()}function iq(e,t){let r,{doc:s,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:x=5e3,onStylesheetLoad:O,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:I=!0}=t;R||(R=iV(e,a,l,void 0===R));let A=function(e,t){let{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return 1===r?void 0:r}(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:if("CSS1Compat"!==e.compatMode)return{type:is.Document,childNodes:[],compatMode:e.compatMode};return{type:is.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:is.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){let r,{doc:s,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:d=!1,rootId:f}=t,m=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let s=e.classList[r];if(t.test(s))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,i),g=function(e){if(e instanceof HTMLFormElement)return"form";let t=iC(e.tagName);return iN.test(t)?"div":t}(e),y={},v=e.attributes.length;for(let t=0;tr.href===e.href||r.href===t?.toString()),n=null;r&&(n=iv(r)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===g&&e.sheet){let t=iv(e.sheet);t&&(e.childNodes.length>1&&(t=(function(e,t,r=!1){let s=Array.from(t.childNodes),n=[],i=0;if(s.length>1&&e&&"string"==typeof e){let t=iL(e,r),o=t.length/e.length;for(let a=1;a2&&""===h[0]&&""!==s[a-1].textContent)p=t.indexOf(c,1);else if(1===h.length){if(c=c.substring(0,c.length-1),(h=t.split(c)).length<=1)return n.push(e),n;u=101}else u===l.length-1&&(p=t.indexOf(c));if(h.length>=2&&u>100){let e=s[a-1].textContent;if(e&&"string"==typeof e){let r=iL(e).length;p=t.indexOf(c,r)}-1===p&&(p=h[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a50*s.length)return n.push(e),n;let l=iL(e.substring(0,a),r);if(l.length===p){n.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length0!==e))return!1}return!0}(e)&&(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let t=e.toDataURL(u.type,u.quality),r=s.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(y.rr_dataURL=t)}}if("img"===g&&c){w||(b=(w=s.createElement("canvas")).getContext("2d"));let t=e.currentSrc||e.getAttribute("src")||"",r=e.crossOrigin,n=()=>{e.removeEventListener("load",n);try{w.width=e.naturalWidth,w.height=e.naturalHeight,b.drawImage(e,0,0),y.rr_dataURL=w.toDataURL(u.type,u.quality)}catch(r){if("anonymous"!==e.crossOrigin){e.crossOrigin="anonymous",e.complete&&0!==e.naturalWidth?n():e.addEventListener("load",n);return}console.warn(`Cannot inline img src=${t}! Error: ${r}`)}"anonymous"===e.crossOrigin&&(r?y.crossOrigin=r:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?n():e.addEventListener("load",n)}if("audio"===g||"video"===g){let 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}if(!d&&(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==g||p(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(g)&&(r=!0)}catch(e){}return{type:is.Element,tagName:g,attributes:y,childNodes:[],isSVG:!!("svg"===e.tagName||e.ownerSVGElement)||void 0,needBlock:m,rootId:f,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){let{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:i}=t,o=ip(e),a=o&&o.tagName,l="",u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;return c?l="SCRIPT_PLACEHOLDER":!i&&(l=im(e),u&&l&&(l=iT(l,iz(t.doc)))),!u&&!c&&l&&r&&(l=s?s(l,id(e)):l.replace(/[\S]/g,"*")),{type:is.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:is.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:is.Comment,textContent:im(e)||"",rootId:y};default:return!1}}(e,{doc:s,mirror:n,blockClass:i,blockSelector:o,needsMask:R,inlineStylesheet:c,maskInputOptions:h,maskTextFn:p,maskInputFn:d,dataURLOptions:m,inlineImages:g,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:E,cssCaptured:M});if(!A)return console.warn(e,"not serialized"),null;r=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===is.Comment)return!0;if(e.type===is.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"===iM(e.attributes.href)))return!0;else if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(iJ(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===iJ(e.attributes.name)||"icon"===iJ(e.attributes.rel)||"apple-touch-icon"===iJ(e.attributes.rel)||"shortcut icon"===iJ(e.attributes.rel))))return!0;else if("meta"===e.tagName){if(t.headMetaDescKeywords&&iJ(e.attributes.name).match(/^description|keywords$/))return!0;else if(t.headMetaSocial&&(iJ(e.attributes.property).match(/^(og|twitter|fb):/)||iJ(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===iJ(e.attributes.name)))return!0;else if(t.headMetaRobots&&("robots"===iJ(e.attributes.name)||"googlebot"===iJ(e.attributes.name)||"bingbot"===iJ(e.attributes.name)))return!0;else if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;else if(t.headMetaAuthorship&&("author"===iJ(e.attributes.name)||"generator"===iJ(e.attributes.name)||"framework"===iJ(e.attributes.name)||"publisher"===iJ(e.attributes.name)||"progid"===iJ(e.attributes.name)||iJ(e.attributes.property).match(/^article:/)||iJ(e.attributes.property).match(/^product:/)))return!0;else if(t.headMetaVerification&&("google-site-verification"===iJ(e.attributes.name)||"yandex-verification"===iJ(e.attributes.name)||"csrf-token"===iJ(e.attributes.name)||"p:domain_verify"===iJ(e.attributes.name)||"verify-v1"===iJ(e.attributes.name)||"verification"===iJ(e.attributes.name)||"shopify-checkout-api-token"===iJ(e.attributes.name)))return!0}}return!1}(A,f)&&(I||A.type!==is.Text||A.textContent.replace(/^\s+|\s+$/gm,"").length)?ij():-2;let P=Object.assign(A,{id:r});if(n.add(e,P),-2===r)return null;v&&v(e);let T=!u;if(P.type===is.Element){T=T&&!P.needBlock,delete P.needBlock;let t=ig(e);t&&ib(t)&&(P.isShadowHost=!0)}if((P.type===is.Document||P.type===is.Element)&&T){f.headWhitespace&&P.type===is.Element&&"head"===P.tagName&&(I=!1);let t={doc:s,mirror:n,blockClass:i,blockSelector:o,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:h,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:O,stylesheetLoadTimeout:C,keepIframeSrcFn:k,cssCaptured:!1};if(P.type===is.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(let r of(P.type===is.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0),Array.from(ih(e)))){let e=iq(r,t);e&&P.childNodes.push(e)}let r=null;if(iy(e)&&(r=ig(e)))for(let e of Array.from(ih(r))){let s=iq(e,t);s&&(ib(r)&&(s.isShadow=!0),P.childNodes.push(s))}}let L=ip(e);return L&&iw(L)&&ib(L)&&(P.isShadow=!0),P.type===is.Element&&"iframe"===P.tagName&&function(e,t,r){let s,n=e.contentWindow;if(!n)return;let i=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){let s=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(s),i=!0,t()});return}let o="about:blank";if(n.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{let t=e.contentDocument;if(t&&S){let r=iq(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:O,stylesheetLoadTimeout:C,keepIframeSrcFn:k});r&&S(e,r)}},x),P.type===is.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===iM(P.attributes.href))&&function(e,t,r){let s,n=!1;try{s=e.sheet}catch(e){return}if(s)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}(e,()=>{if(O){let t=iq(e,{doc:s,mirror:n,blockClass:i,blockSelector:o,needsMask:R,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:g,recordCanvas:y,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:S,iframeLoadTimeout:x,onStylesheetLoad:O,stylesheetLoadTimeout:C,keepIframeSrcFn:k});t&&O(e,t)}},C),P}function iG(e,t){let{mirror:r=new ix,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:S=()=>!1}=t||{};return iq(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:h,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:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:S,newlyAddedElement:!1})}RegExp(/(max|min)-device-(width|height)/.source,"g");var iK={exports:{}},iX=String,iY=function(){return{isColorSupported:!1,reset:iX,bold:iX,dim:iX,italic:iX,underline:iX,inverse:iX,hidden:iX,strikethrough:iX,black:iX,red:iX,green:iX,yellow:iX,blue:iX,magenta:iX,cyan:iX,white:iX,gray:iX,bgBlack:iX,bgRed:iX,bgGreen:iX,bgYellow:iX,bgBlue:iX,bgMagenta:iX,bgCyan:iX,bgWhite:iX}};iK.exports=iY(),iK.exports.createColors=iY;var iQ=iK.exports;let iZ=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),i0=class e extends Error{constructor(t,r,s,n,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){let t,r;if(!this.source)return"";let s=this.source;null==e&&(e=iQ.isColorSupported),iZ&&e&&(s=iZ(s));let n=s.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),a=String(o).length;if(e){let{bold:e,gray:s,red:n}=iQ.createColors(!0);t=t=>e(n(t)),r=e=>s(e)}else t=r=e=>e;return n.slice(i,o).map((e,s)=>{let n=i+1+s,o=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let s=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return t(">")+r(o)+e+"\n "+s+t("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};i0.default=i0;var i1={};i1.isClean=Symbol("isClean"),i1.my=Symbol("my");let i2={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1},i3=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="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 s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s{if(void 0!==(s=e.raws[t]))return!1})}return void 0===s&&(s=i2[r]),i.rawCache[r]=s,s}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).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return(t=r.raws.before).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&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(e){let t;return e.raws.indent?e.raws.indent:(e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=(t=e[e.length-1]).replace(/\S/g,""),!1}}),t)}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};function i4(e,t){new i3(t).stringify(e)}i3.default=i3,i4.default=i4;let{isClean:i6,my:i5}=i1,i8=class{constructor(e={}){for(let t in this.raws={},this[i6]=!1,this[i5]=!0,e)if("nodes"===t)for(let r of(this.nodes=[],e[t]))"function"==typeof r.clone?this.append(r.clone()):this.append(r);else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=function e(t,r){let s=new t.constructor;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||"proxyCache"===n)continue;let i=t[n],o=typeof i;"parent"===n&&"object"===o?r&&(s[n]=r):"source"===n?s[n]=i:Array.isArray(i)?s[n]=i.map(t=>e(t,s)):("object"===o&&null!==i&&(i=e(i)),s[n]=i)}return s}(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new i0(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>e[t]===r||(e[t]=r,("prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[i6]){this[i6]=!1;let e=this;for(;e=e.parent;)e[i6]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let i=t.get(s.input);null==i&&(i=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:i,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i4){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};i8.default=i8;let i9=i8,i7=class extends i9{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]}};i7.default=i7;let{SourceMapConsumer:oe,SourceMapGenerator:ot}=iZ,{existsSync:or,readFileSync:os}=iZ,{dirname:on,join:oi}=iZ,oo=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=on(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new oe(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e)){var t;return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t)}throw Error("Unsupported source map encoding "+e.match(/data:application\/json;([^,]+),/)[1])}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 r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=on(e),or(e))return this.mapFile=e,os(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t)if("string"==typeof t)return t;else if("function"==typeof t){let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw Error("Unable to load previous source map: "+r.toString());return e}}else if(t instanceof oe)return ot.fromSourceMap(t).toString();else if(t instanceof ot)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;return e&&(t=oi(on(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)}};oo.default=oo;let{SourceMapConsumer:oa,SourceMapGenerator:ol}=iZ,{fileURLToPath:ou,pathToFileURL:oc}=iZ,{isAbsolute:oh,resolve:op}=iZ,{nanoid:od}={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let s="",n=r;for(;n--;)s+=e[Math.random()*e.length|0];return s}},of=Symbol("fromOffsetCache"),om=!!(oa&&ol),og=!!(op&&oh),oy=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\uFEFF"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!og||/^\w+:\/\//.test(t.from)||oh(t.from)?this.file=t.from:this.file=op(t.from)),og&&om){let e=new oo(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=""),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);i=e.line,o=e.col}else i=s.line,o=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return(n=a?new i0(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,s.plugin):new i0(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(oc&&(n.input.url=oc(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[of])r=this[of];else{let e=this.css.split("\n");r=Array(e.length);let t=0;for(let s=0,n=e.length;s=t)s=r.length-1;else{let t,n=r.length-2;for(;s>1)])n=t-1;else if(e>=r[t+1])s=t+1;else{s=t;break}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:op(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){let n,i;if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=o.originalPositionFor({column:s,line:r})),i=oh(a.source)?oc(a.source):new URL(a.source,this.map.consumer().sourceRoot||oc(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:i.toString()};if("file:"===i.protocol)if(ou)l.file=ou(i);else throw Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(a.source);return u&&(l.source=u),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}};oy.default=oy,iZ&&iZ.registerInput&&iZ.registerInput(oy);let{SourceMapConsumer:ow,SourceMapGenerator:ob}=iZ,{dirname:ov,relative:oS,resolve:ox,sep:oO}=iZ,{pathToFileURL:oC}=iZ,ok=!!(ow&&ob),oE=!!(ov&&ox&&oS&&oO),oM=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,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,r=this.toUrl(this.path(e.file)),s=e.root||ov(e.file);!1===this.mapOpts.sourcesContent?(t=new ow(e.text)).sourcesContent&&(t.sourcesContent=null):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).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(),oE&&ok&&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=ob.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ob({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)):""});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(){let e,t;this.css="",this.map=new ob({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,s=1,n="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1):(i.source=n,i.original.line=1,i.original.column=0),this.map.addMapping(i)),(e=o.match(/\n/g))?(r+=e.length,t=o.lastIndexOf("\n"),s=o.length-t):s+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};(!("decl"===a.type||"atrule"===a.type&&!a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=s-2):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=s-1),this.map.addMapping(i))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ov(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ov(ox(r,this.mapOpts.annotation)));let s=oS(r,e);return this.memoizedPaths.set(e,s),s}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 oy(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";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(oC){let t=oC(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===oO&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},oR=i8,oI=class extends oR{constructor(e){super(e),this.type="comment"}};oI.default=oI;let{isClean:oA,my:oP}=i1,oT=i8,oL=class e extends oT{append(...e){for(let t of e)for(let e of this.normalize(t,this.last))this.proxyOf.nodes.push(e);return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){let t,r;if(!this.proxyOf.nodes)return;let s=this.getIterator();for(;this.indexes[s]e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e));if("every"===t||"some"===t)return r=>e[t]((e,...t)=>r(e.toProxy(),...t));if("root"===t)return()=>e.root().toProxy();else if("nodes"===t)return e.nodes.map(e=>e.toProxy());else if("first"===t||"last"===t)return e[t].toProxy();else return e[t]},set:(e,t,r)=>e[t]===r||(e[t]=r,("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 r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();for(let t of(s=this.index(e),n))this.proxyOf.nodes.splice(s+1,0,t);for(let e in this.indexes)s<(r=this.indexes[e])&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",i=this.normalize(t,this.proxyOf.nodes[s],n).reverse();for(let t of(s=this.index(e),i))this.proxyOf.nodes.splice(s,0,t);for(let e in this.indexes)s<=(r=this.indexes[e])&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=function e(t){return t.map(t=>(t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t))}(v(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t))for(let e of t=t.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if("root"===t.type&&"document"!==this.type)for(let e of t=t.nodes.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new i7(t)]}else if(t.selector)t=[new S(t)];else if(t.name)t=[new x(t)];else if(t.text)t=[new oI(t)];else throw Error("Unknown node type in node creation");return t.map(t=>(t[oP]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[oA]&&function e(t){if(t[oA]=!1,t.proxyOf.nodes)for(let r of t.proxyOf.nodes)e(r)}(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){for(let t of e=e.reverse()){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;for(let r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[r])>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{(!t.props||t.props.includes(s.prop))&&(!t.fast||s.value.includes(t.fast))&&(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};oL.registerParse=e=>{v=e},oL.registerRule=e=>{S=e},oL.registerAtRule=e=>{x=e},oL.registerRoot=e=>{O=e},oL.default=oL,oL.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,x.prototype):"rule"===e.type?Object.setPrototypeOf(e,S.prototype):"decl"===e.type?Object.setPrototypeOf(e,i7.prototype):"comment"===e.type?Object.setPrototypeOf(e,oI.prototype):"root"===e.type&&Object.setPrototypeOf(e,O.prototype),e[oP]=!0,e.nodes&&e.nodes.forEach(e=>{oL.rebuild(e)})};let oD=oL,oN=class extends oD{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new C(new k,this,e).stringify()}};oN.registerLazyResult=e=>{C=e},oN.registerProcessor=e=>{k=e},oN.default=oN;let oj=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}};oj.default=oj;let o_=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,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 r=new oj(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};o_.default=o_;let oF=/[\t\n\f\r "#'()/;[\\\]{}]/g,oU=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,oB=/.[\r\n"'(/\\]/,oz=/[\da-f]/i,o$=oL,oW=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)}};oW.default=oW,o$.registerAtRule(oW);let oH=oL,oV=class extends oH{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if("prepend"===r)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 s)e.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new E(new M,this,e).stringify()}};oV.registerLazyResult=e=>{E=e},oV.registerProcessor=e=>{M=e},oV.default=oV,oH.registerRoot(oV);let oJ={comma:e=>oJ.split(e,[","],!0),space:e=>oJ.split(e,[" ","\n"," "]),split(e,t,r){let s=[],n="",i=!1,o=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==n&&s.push(n.trim()),n="",i=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};oJ.default=oJ;let oq=oL,oG=class extends oq{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return oJ.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};oG.default=oG,oq.registerRule(oG);let oK=function(e,t={}){let r,s,n,i,o,a,l,u,c,h,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(r=p.charCodeAt(m)){case 10:case 32:case 9:case 13:case 12:s=m;do s+=1,r=p.charCodeAt(s);while(32===r||10===r||9===r||13===r||12===r);h=["space",p.slice(m,s)],m=s-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(r);h=[e,e,m];break}case 40:if(u=g.length?g.pop()[1]:"",c=p.charCodeAt(m+1),"url"===u&&39!==c&&34!==c&&32!==c&&10!==c&&9!==c&&12!==c&&13!==c){s=m;do{if(a=!1,-1===(s=p.indexOf(")",s+1)))if(d||t){s=m;break}else w("bracket");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),i=p.slice(m,s+1),-1===s||oB.test(i)?h=["(","(",m]:(h=["brackets",i,m,s],m=s);break;case 39:case 34:n=39===r?"'":'"',s=m;do{if(a=!1,-1===(s=p.indexOf(n,s+1)))if(d||t){s=m+1;break}else w("string");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["string",p.slice(m,s+1),m,s],m=s;break;case 64:oF.lastIndex=m+1,oF.test(p),s=0===oF.lastIndex?p.length-1:oF.lastIndex-2,h=["at-word",p.slice(m,s+1),m,s],m=s;break;case 92:for(s=m,o=!0;92===p.charCodeAt(s+1);)s+=1,o=!o;if(r=p.charCodeAt(s+1),o&&47!==r&&32!==r&&10!==r&&9!==r&&13!==r&&12!==r&&(s+=1,oz.test(p.charAt(s)))){for(;oz.test(p.charAt(s+1));)s+=1;32===p.charCodeAt(s+1)&&(s+=1)}h=["word",p.slice(m,s+1),m,s],m=s;break;default:47===r&&42===p.charCodeAt(m+1)?(0===(s=p.indexOf("*/",m+2)+1)&&(d||t?s=p.length:w("comment")),h=["comment",p.slice(m,s+1),m,s]):(oU.lastIndex=m+1,oU.test(p),s=0===oU.lastIndex?p.length-1:oU.lastIndex-2,h=["word",p.slice(m,s+1),m,s],g.push(h)),m=s}return m++,h},position:function(){return m}}},oX={empty:!0,space:!0},oY=class{constructor(e){this.input=e,this.root=new oV,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,r,s,n=new oW;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===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}else if("{"===t){o=!0;break}else if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),i&&(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=""),o&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t,r=this.colon(e);if(!1===r)return;let s=0;for(let n=r-1;n>=0&&("space"===(t=e[n])[0]||2!==(s+=1));n--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}colon(e){let t,r,s=0;for(let[n,i]of e.entries()){if("("===(t=i[0])&&(s+=1),")"===t&&(s-=1),0===s&&":"===t)if(r)if("word"===r[0]&&"progid"===r[1])continue;else return n;else this.doubleColon(i);r=i}return!1}comment(e){let t=new oI;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=oK(this.input)}decl(e,t){let r,s,n=new i7;this.init(n,e[0][2]);let i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}("_"===n.prop[0]||"*"===n.prop[0])&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if("!important"===(r=e[t])[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);" !important"!==(r=this.spacesFromEnd(e)+r)&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.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 oG;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,r=null,s=!1,n=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),i.push("("===r?")":"]");else if(o&&s&&"{"===r)n||(n=l),i.push("}");else if(0===i.length)if(";"===r)if(s)return void this.decl(a,o);else break;else if("{"===r)return void this.rule(a);else if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}else":"===r&&(s=!0);else r===i[i.length-1]&&(i.pop(),0===i.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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,r,s){let n,i,o,a,l=r.length,u="",c=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:s,value:u}}e[t]=u}rule(e){e.pop();let t=new oG;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(e,t){let r="";for(let s=t;so8(e)),e}let o9={},o7=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"==typeof r&&null!==r&&("root"===r.type||"document"===r.type))n=o8(r);else if(r instanceof e||r instanceof o_)n=o8(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=oQ;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[o0]&&oL.rebuild(n)}this.result=new o_(t,n,s),this.helpers={...o9,postcss:o9,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 Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!o2[r]&&/^[A-Z]/.test(r))throw Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o3[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(o4(e))try{await e}catch(r){let e=t[t.length-1].node;throw this.handleError(r,e)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(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));if(o4(t[0]))return Promise.all(t);return 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=i4;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new oM(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(o4(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[oZ];)e[oZ]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(o4(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex{e[oZ]||this.walkSync(e)});else{let r=this.listeners[t];if(r&&this.visitSync(r,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"}};o7.registerPostcss=e=>{o9=e},o7.default=o7,oV.registerLazyResult(o7),oN.registerLazyResult(o7);let ae=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0,this.result=new o_(this._processor,s,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let i=new oM(i4,s,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 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(){let e;if(this._root)return this._root;try{e=oQ(this._css,this._opts)}catch(e){this.error=e}if(!this.error)return this._root=e,e;throw this.error}get[Symbol.toStringTag](){return"NoWorkResult"}};ae.default=ae;let at=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"==typeof r&&(r.parse||r.stringify));else throw Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new o7(this,e,t):new ae(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};function ar(e,t){if(Array.isArray(e))return e.map(e=>ar(e));let{inputs:r,...s}=e;if(r)for(let e of(t=[],r)){let r={...e,__proto__:oy.prototype};r.map&&(r.map={...r.map,__proto__:oo.prototype}),t.push(r)}if(s.nodes&&(s.nodes=e.nodes.map(e=>ar(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new oV(s);if("decl"===s.type)return new i7(s);if("rule"===s.type)return new oG(s);if("comment"===s.type)return new oI(s);if("atrule"===s.type)return new oW(s);else throw Error("Unknown node type: "+e.type)}function as(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new at(e)}at.default=at,oV.registerProcessor(at),oN.registerProcessor(at),ar.default=ar,as.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new at().version,i}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return as([n(r)]).process(e,t)},n},as.stringify=i4,as.parse=oQ,as.fromJSON=ar,as.list=oJ,as.comment=e=>new oI(e),as.atRule=e=>new oW(e),as.decl=e=>new i7(e),as.rule=e=>new oG(e),as.root=e=>new oV(e),as.document=e=>new oN(e),as.CssSyntaxError=i0,as.Declaration=i7,as.Container=oL,as.Processor=at,as.Document=oN,as.Comment=oI,as.Warning=oj,as.AtRule=oW,as.Result=o_,as.Input=oy,as.Rule=oG,as.Root=oV,as.Node=i8,o7.registerPostcss(as),as.default=as;let an=as&&as.__esModule&&Object.prototype.hasOwnProperty.call(as,"default")?as.default:as;an.stringify,an.fromJSON,an.plugin,an.parse,an.list,an.document,an.comment,an.atRule,an.rule,an.decl,an.root,an.CssSyntaxError,an.Declaration,an.Container,an.Processor,an.Document,an.Comment,an.Warning,an.AtRule,an.Result,an.Input,an.Rule,an.Root,an.Node;var ai=Object.defineProperty,ao=(e,t,r)=>{let s;return(s="symbol"!=typeof t?t+"":t)in e?ai(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r},aa={exports:{}},al=String,au=function(){return{isColorSupported:!1,reset:al,bold:al,dim:al,italic:al,underline:al,inverse:al,hidden:al,strikethrough:al,black:al,red:al,green:al,yellow:al,blue:al,magenta:al,cyan:al,white:al,gray:al,bgBlack:al,bgRed:al,bgGreen:al,bgYellow:al,bgBlue:al,bgMagenta:al,bgCyan:al,bgWhite:al}};aa.exports=au(),aa.exports.createColors=au;var ac=aa.exports;let ah=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),ap=class e extends Error{constructor(t,r,s,n,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),o&&(this.plugin=o),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){let t,r;if(!this.source)return"";let s=this.source;null==e&&(e=ac.isColorSupported),ah&&e&&(s=ah(s));let n=s.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),a=String(o).length;if(e){let{bold:e,gray:s,red:n}=ac.createColors(!0);t=t=>e(n(t)),r=e=>s(e)}else t=r=e=>e;return n.slice(i,o).map((e,s)=>{let n=i+1+s,o=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let s=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return t(">")+r(o)+e+"\n "+s+t("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};ap.default=ap;var ad={};ad.isClean=Symbol("isClean"),ad.my=Symbol("my");let af={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1},am=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="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 s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s{if(void 0!==(s=e.raws[t]))return!1})}return void 0===s&&(s=af[r]),i.rawCache[r]=s,s}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).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return(t=r.raws.before).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&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(e){let t;return e.raws.indent?e.raws.indent:(e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=(t=e[e.length-1]).replace(/\S/g,""),!1}}),t)}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};function ag(e,t){new am(t).stringify(e)}am.default=am,ag.default=ag;let{isClean:ay,my:aw}=ad,ab=class{constructor(e={}){for(let t in this.raws={},this[ay]=!1,this[aw]=!0,e)if("nodes"===t)for(let r of(this.nodes=[],e[t]))"function"==typeof r.clone?this.append(r.clone()):this.append(r);else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=function e(t,r){let s=new t.constructor;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||"proxyCache"===n)continue;let i=t[n],o=typeof i;"parent"===n&&"object"===o?r&&(s[n]=r):"source"===n?s[n]=i:Array.isArray(i)?s[n]=i.map(t=>e(t,s)):("object"===o&&null!==i&&(i=e(i)),s[n]=i)}return s}(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new ap(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>e[t]===r||(e[t]=r,("prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0)}}markDirty(){if(this[ay]){this[ay]=!1;let e=this;for(;e=e.parent;)e[ay]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let i=t.get(s.input);null==i&&(i=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:i,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ag){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};ab.default=ab;let av=ab,aS=class extends av{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]}};aS.default=aS;let{SourceMapConsumer:ax,SourceMapGenerator:aO}=ah,{existsSync:aC,readFileSync:ak}=ah,{dirname:aE,join:aM}=ah,aR=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=aE(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new ax(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)){var t;return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t)}throw Error("Unsupported source map encoding "+e.match(/data:application\/json;([^,]+),/)[1])}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 r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=aE(e),aC(e))return this.mapFile=e,ak(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t)if("string"==typeof t)return t;else if("function"==typeof t){let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw Error("Unable to load previous source map: "+r.toString());return e}}else if(t instanceof ax)return aO.fromSourceMap(t).toString();else if(t instanceof aO)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;return e&&(t=aM(aE(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)}};aR.default=aR;let{SourceMapConsumer:aI,SourceMapGenerator:aA}=ah,{fileURLToPath:aP,pathToFileURL:aT}=ah,{isAbsolute:aL,resolve:aD}=ah,{nanoid:aN}={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let s="",n=r;for(;n--;)s+=e[Math.random()*e.length|0];return s}},aj=Symbol("fromOffsetCache"),a_=!!(aI&&aA),aF=!!(aD&&aL),aU=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\uFEFF"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!aF||/^\w+:\/\//.test(t.from)||aL(t.from)?this.file=t.from:this.file=aD(t.from)),aF&&a_){let e=new aR(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=""),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);i=e.line,o=e.col}else i=s.line,o=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return(n=a?new ap(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,s.plugin):new ap(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(aT&&(n.input.url=aT(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[aj])r=this[aj];else{let e=this.css.split("\n");r=Array(e.length);let t=0;for(let s=0,n=e.length;s=t)s=r.length-1;else{let t,n=r.length-2;for(;s>1)])n=t-1;else if(e>=r[t+1])s=t+1;else{s=t;break}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:aD(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){let n,i;if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=o.originalPositionFor({column:s,line:r})),i=aL(a.source)?aT(a.source):new URL(a.source,this.map.consumer().sourceRoot||aT(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:i.toString()};if("file:"===i.protocol)if(aP)l.file=aP(i);else throw Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(a.source);return u&&(l.source=u),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}};aU.default=aU,ah&&ah.registerInput&&ah.registerInput(aU);let{SourceMapConsumer:aB,SourceMapGenerator:az}=ah,{dirname:a$,relative:aW,resolve:aH,sep:aV}=ah,{pathToFileURL:aJ}=ah,aq=!!(aB&&az),aG=!!(a$&&aH&&aW&&aV),aK=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,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,r=this.toUrl(this.path(e.file)),s=e.root||a$(e.file);!1===this.mapOpts.sourcesContent?(t=new aB(e.text)).sourcesContent&&(t.sourcesContent=null):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).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(),aG&&aq&&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=az.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new az({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)):""});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(){let e,t;this.css="",this.map=new az({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,s=1,n="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=s-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1):(i.source=n,i.original.line=1,i.original.column=0),this.map.addMapping(i)),(e=o.match(/\n/g))?(r+=e.length,t=o.lastIndexOf("\n"),s=o.length-t):s+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};(!("decl"===a.type||"atrule"===a.type&&!a.nodes)||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=s-2):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=s-1),this.map.addMapping(i))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?a$(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=a$(aH(r,this.mapOpts.annotation)));let s=aW(r,e);return this.memoizedPaths.set(e,s),s}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 aU(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"";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(aJ){let t=aJ(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===aV&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},aX=ab,aY=class extends aX{constructor(e){super(e),this.type="comment"}};aY.default=aY;let{isClean:aQ,my:aZ}=ad,a0=ab,a1=class e extends a0{append(...e){for(let t of e)for(let e of this.normalize(t,this.last))this.proxyOf.nodes.push(e);return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){let t,r;if(!this.proxyOf.nodes)return;let s=this.getIterator();for(;this.indexes[s]e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e));if("every"===t||"some"===t)return r=>e[t]((e,...t)=>r(e.toProxy(),...t));if("root"===t)return()=>e.root().toProxy();else if("nodes"===t)return e.nodes.map(e=>e.toProxy());else if("first"===t||"last"===t)return e[t].toProxy();else return e[t]},set:(e,t,r)=>e[t]===r||(e[t]=r,("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 r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();for(let t of(s=this.index(e),n))this.proxyOf.nodes.splice(s+1,0,t);for(let e in this.indexes)s<(r=this.indexes[e])&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",i=this.normalize(t,this.proxyOf.nodes[s],n).reverse();for(let t of(s=this.index(e),i))this.proxyOf.nodes.splice(s,0,t);for(let e in this.indexes)s<=(r=this.indexes[e])&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=function e(t){return t.map(t=>(t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t))}(R(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t))for(let e of t=t.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if("root"===t.type&&"document"!==this.type)for(let e of t=t.nodes.slice(0))e.parent&&e.parent.removeChild(e,"ignore");else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new aS(t)]}else if(t.selector)t=[new I(t)];else if(t.name)t=[new A(t)];else if(t.text)t=[new aY(t)];else throw Error("Unknown node type in node creation");return t.map(t=>(t[aZ]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[aQ]&&function e(t){if(t[aQ]=!1,t.proxyOf.nodes)for(let r of t.proxyOf.nodes)e(r)}(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){for(let t of e=e.reverse()){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;for(let r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[r])>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{(!t.props||t.props.includes(s.prop))&&(!t.fast||s.value.includes(t.fast))&&(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};a1.registerParse=e=>{R=e},a1.registerRule=e=>{I=e},a1.registerAtRule=e=>{A=e},a1.registerRoot=e=>{P=e},a1.default=a1,a1.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,A.prototype):"rule"===e.type?Object.setPrototypeOf(e,I.prototype):"decl"===e.type?Object.setPrototypeOf(e,aS.prototype):"comment"===e.type?Object.setPrototypeOf(e,aY.prototype):"root"===e.type&&Object.setPrototypeOf(e,P.prototype),e[aZ]=!0,e.nodes&&e.nodes.forEach(e=>{a1.rebuild(e)})};let a2=a1,a3=class extends a2{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new T(new L,this,e).stringify()}};a3.registerLazyResult=e=>{T=e},a3.registerProcessor=e=>{L=e},a3.default=a3;let a4=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}};a4.default=a4;let a6=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,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 r=new a4(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};a6.default=a6;let a5=/[\t\n\f\r "#'()/;[\\\]{}]/g,a8=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,a9=/.[\r\n"'(/\\]/,a7=/[\da-f]/i,le=a1,lt=class extends le{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)}};lt.default=lt,le.registerAtRule(lt);let lr=a1,ls=class extends lr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if("prepend"===r)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 s)e.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new D(new N,this,e).stringify()}};ls.registerLazyResult=e=>{D=e},ls.registerProcessor=e=>{N=e},ls.default=ls,lr.registerRoot(ls);let ln={comma:e=>ln.split(e,[","],!0),space:e=>ln.split(e,[" ","\n"," "]),split(e,t,r){let s=[],n="",i=!1,o=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==n&&s.push(n.trim()),n="",i=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};ln.default=ln;let li=a1,lo=class extends li{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ln.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};lo.default=lo,li.registerRule(lo);let la=function(e,t={}){let r,s,n,i,o,a,l,u,c,h,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(r=p.charCodeAt(m)){case 10:case 32:case 9:case 13:case 12:s=m;do s+=1,r=p.charCodeAt(s);while(32===r||10===r||9===r||13===r||12===r);h=["space",p.slice(m,s)],m=s-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(r);h=[e,e,m];break}case 40:if(u=g.length?g.pop()[1]:"",c=p.charCodeAt(m+1),"url"===u&&39!==c&&34!==c&&32!==c&&10!==c&&9!==c&&12!==c&&13!==c){s=m;do{if(a=!1,-1===(s=p.indexOf(")",s+1)))if(d||t){s=m;break}else w("bracket");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),i=p.slice(m,s+1),-1===s||a9.test(i)?h=["(","(",m]:(h=["brackets",i,m,s],m=s);break;case 39:case 34:n=39===r?"'":'"',s=m;do{if(a=!1,-1===(s=p.indexOf(n,s+1)))if(d||t){s=m+1;break}else w("string");for(l=s;92===p.charCodeAt(l-1);)l-=1,a=!a}while(a);h=["string",p.slice(m,s+1),m,s],m=s;break;case 64:a5.lastIndex=m+1,a5.test(p),s=0===a5.lastIndex?p.length-1:a5.lastIndex-2,h=["at-word",p.slice(m,s+1),m,s],m=s;break;case 92:for(s=m,o=!0;92===p.charCodeAt(s+1);)s+=1,o=!o;if(r=p.charCodeAt(s+1),o&&47!==r&&32!==r&&10!==r&&9!==r&&13!==r&&12!==r&&(s+=1,a7.test(p.charAt(s)))){for(;a7.test(p.charAt(s+1));)s+=1;32===p.charCodeAt(s+1)&&(s+=1)}h=["word",p.slice(m,s+1),m,s],m=s;break;default:47===r&&42===p.charCodeAt(m+1)?(0===(s=p.indexOf("*/",m+2)+1)&&(d||t?s=p.length:w("comment")),h=["comment",p.slice(m,s+1),m,s]):(a8.lastIndex=m+1,a8.test(p),s=0===a8.lastIndex?p.length-1:a8.lastIndex-2,h=["word",p.slice(m,s+1),m,s],g.push(h)),m=s}return m++,h},position:function(){return m}}},ll={empty:!0,space:!0},lu=class{constructor(e){this.input=e,this.root=new ls,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,r,s,n=new lt;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===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}else if("{"===t){o=!0;break}else if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),i&&(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=""),o&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t,r=this.colon(e);if(!1===r)return;let s=0;for(let n=r-1;n>=0&&("space"===(t=e[n])[0]||2!==(s+=1));n--);throw this.input.error("Missed semicolon","word"===t[0]?t[3]+1:t[2])}colon(e){let t,r,s=0;for(let[n,i]of e.entries()){if("("===(t=i[0])&&(s+=1),")"===t&&(s-=1),0===s&&":"===t)if(r)if("word"===r[0]&&"progid"===r[1])continue;else return n;else this.doubleColon(i);r=i}return!1}comment(e){let t=new aY;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=la(this.input)}decl(e,t){let r,s,n=new aS;this.init(n,e[0][2]);let i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}("_"===n.prop[0]||"*"===n.prop[0])&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o=[];for(;e.length&&("space"===(s=e[0][0])||"comment"===s);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if("!important"===(r=e[t])[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);" !important"!==(r=this.spacesFromEnd(e)+r)&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.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 lo;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,r=null,s=!1,n=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),i.push("("===r?")":"]");else if(o&&s&&"{"===r)n||(n=l),i.push("}");else if(0===i.length)if(";"===r)if(s)return void this.decl(a,o);else break;else if("{"===r)return void this.rule(a);else if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}else":"===r&&(s=!0);else r===i[i.length-1]&&(i.pop(),0===i.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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,r,s){let n,i,o,a,l=r.length,u="",c=!0;for(let e=0;ee+t[1],"");e.raws[t]={raw:s,value:u}}e[t]=u}rule(e){e.pop();let t=new lo;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(e,t){let r="";for(let s=t;slb(e)),e}let lv={},lS=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"==typeof r&&null!==r&&("root"===r.type||"document"===r.type))n=lb(r);else if(r instanceof e||r instanceof a6)n=lb(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=lc;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[lp]&&a1.rebuild(n)}this.result=new a6(t,n,s),this.helpers={...lv,postcss:lv,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 Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!lf[r]&&/^[A-Z]/.test(r))throw Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!lm[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let e=this.visitTick(t);if(lg(e))try{await e}catch(r){let e=t[t.length-1].node;throw this.handleError(r,e)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(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));if(lg(t[0]))return Promise.all(t);return 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=ag;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new aK(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(lg(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[lh];)e[lh]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(lg(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex{e[lh]||this.walkSync(e)});else{let r=this.listeners[t];if(r&&this.visitSync(r,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"}};lS.registerPostcss=e=>{lv=e},lS.default=lS,ls.registerLazyResult(lS),a3.registerLazyResult(lS);let lx=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0,this.result=new a6(this._processor,s,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let i=new aK(ag,s,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 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(){let e;if(this._root)return this._root;try{e=lc(this._css,this._opts)}catch(e){this.error=e}if(!this.error)return this._root=e,e;throw this.error}get[Symbol.toStringTag](){return"NoWorkResult"}};lx.default=lx;let lO=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"==typeof r&&(r.parse||r.stringify));else throw Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new lS(this,e,t):new lx(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};function lC(e,t){if(Array.isArray(e))return e.map(e=>lC(e));let{inputs:r,...s}=e;if(r)for(let e of(t=[],r)){let r={...e,__proto__:aU.prototype};r.map&&(r.map={...r.map,__proto__:aR.prototype}),t.push(r)}if(s.nodes&&(s.nodes=e.nodes.map(e=>lC(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new ls(s);if("decl"===s.type)return new aS(s);if("rule"===s.type)return new lo(s);if("comment"===s.type)return new aY(s);if("atrule"===s.type)return new lt(s);else throw Error("Unknown node type: "+e.type)}function lk(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new lO(e)}lO.default=lO,ls.registerProcessor(lO),a3.registerProcessor(lO),lC.default=lC,lk.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new lO().version,i}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return lk([n(r)]).process(e,t)},n},lk.stringify=ag,lk.parse=lc,lk.fromJSON=lC,lk.list=ln,lk.comment=e=>new aY(e),lk.atRule=e=>new lt(e),lk.decl=e=>new aS(e),lk.rule=e=>new lo(e),lk.root=e=>new ls(e),lk.document=e=>new a3(e),lk.CssSyntaxError=ap,lk.Declaration=aS,lk.Container=a1,lk.Processor=lO,lk.Document=a3,lk.Comment=aY,lk.Warning=a4,lk.AtRule=lt,lk.Result=a6,lk.Input=aU,lk.Rule=lo,lk.Root=ls,lk.Node=ab,lS.registerPostcss(lk),lk.default=lk;let lE=lk&&lk.__esModule&&Object.prototype.hasOwnProperty.call(lk,"default")?lk.default:lk;lE.stringify,lE.fromJSON,lE.plugin,lE.parse,lE.list,lE.document,lE.comment,lE.atRule,lE.rule,lE.decl,lE.root,lE.CssSyntaxError,lE.Declaration,lE.Container,lE.Processor,lE.Document,lE.Comment,lE.Warning,lE.AtRule,lE.Result,lE.Input,lE.Rule,lE.Root,lE.Node;var lM=((ea=lM||{})[ea.Document=0]="Document",ea[ea.DocumentType=1]="DocumentType",ea[ea.Element=2]="Element",ea[ea.Text=3]="Text",ea[ea.CDATA=4]="CDATA",ea[ea.Comment=5]="Comment",ea);class lR{constructor(...e){ao(this,"parentElement",null),ao(this,"parentNode",null),ao(this,"ownerDocument"),ao(this,"firstChild",null),ao(this,"lastChild",null),ao(this,"previousSibling",null),ao(this,"nextSibling",null),ao(this,"ELEMENT_NODE",1),ao(this,"TEXT_NODE",3),ao(this,"nodeType"),ao(this,"nodeName"),ao(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof lR)||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 Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}let lI={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},lA={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},lP={};function lT(e){if(lP[e])return lP[e];let t=globalThis[e],r=t.prototype,s=e in lI?lI[e]:void 0,n=!!(s&&s.every(e=>{var t,s;return!!(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),i=e in lA?lA[e]:void 0,o=!!(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&o&&!globalThis.Zone)return lP[e]=t.prototype,t.prototype;try{let s=document.createElement("iframe");document.body.appendChild(s);let n=s.contentWindow;if(!n)return t.prototype;let i=n[e].prototype;if(document.body.removeChild(s),!i)return r;return lP[e]=i}catch{return r}}let lL={};function lD(e,t,r){var s;let n=`${e}.${String(r)}`;if(lL[n])return lL[n].call(t);let i=null==(s=Object.getOwnPropertyDescriptor(lT(e),r))?void 0:s.get;return i?(lL[n]=i,i.call(t)):t[r]}let lN={};function lj(e,t,r){let s=`${e}.${String(r)}`;if(lN[s])return lN[s].bind(t);let n=lT(e)[r];return"function"!=typeof n?t[r]:(lN[s]=n,n.bind(t))}let l_=function(e){return lD("Node",e,"childNodes")},lF=function(e){return lD("Node",e,"parentNode")},lU=function(e){return lD("Node",e,"parentElement")},lB=function(e){return lD("Node",e,"textContent")},lz=function(e,t){return lj("Node",e,"contains")(t)},l$=function(e){return lj("Node",e,"getRootNode")()},lW=function(e){return e&&"host"in e?lD("ShadowRoot",e,"host"):null},lH=function(e){return e&&"shadowRoot"in e?lD("Element",e,"shadowRoot"):null};function lV(e,t,r=document){let s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}let lJ="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.",lq={map:{},getId:()=>(console.error(lJ),-1),getNode:()=>(console.error(lJ),null),removeNodeFromMap(){console.error(lJ)},has:()=>(console.error(lJ),!1),reset(){console.error(lJ)}};function lG(e,t,r={}){let s=null,n=0;return function(...i){let o=Date.now();n||!1!==r.leading||(n=o);let a=t-(o-n),l=this;a<=0||a>t?(s&&(clearTimeout(s),s=null),n=o,e.apply(l,i)):s||!1===r.trailing||(s=setTimeout(()=>{n=!1===r.leading?0:Date.now(),s=null,e.apply(l,i)},a))}}function lK(e,t,r,s,n=window){let i=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>lK(e,t,i||{},!0)}function lX(e,t,r){try{if(!(t in e))return()=>{};let s=e[t],n=r(s);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(lq=new Proxy(lq,{get:(e,t,r)=>("map"===t&&console.error(lJ),Reflect.get(e,t,r))}));let lY=Date.now;function lQ(e){var t,r,s,n;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=lU(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(s=lU(i.body))?void 0:s.scrollTop)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollTop)||0}}function lZ(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function l0(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function l1(e){return e?e.nodeType===e.ELEMENT_NODE?e:lU(e):null}function l2(e,t,r,s){if(!e)return!1;let n=l1(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t)||s&&null!==n.closest("."+t))return!0}else if(iH(n,t,s))return!0}catch(e){}return!!(r&&(n.matches(r)||s&&null!==n.closest(r)))||!1}function l3(e,t){return -1!==t.getId(e)}function l4(e,t,r){return"TITLE"===e.tagName&&!!r.headTitleMutations||-2===t.getId(e)}function l6(e,t){if(iw(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let s=lF(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||l6(s,t))}function l5(e){return!!e.changedTouches}function l8(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function l9(e,t){return!!("IFRAME"===e.nodeName&&t.getMeta(e))}function l7(e,t){return!!("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ue(e){return!!e&&(e instanceof lR&&"shadowRoot"in e?!!e.shadowRoot:!!lH(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(lY=()=>new Date().getTime());class ut{constructor(){ie(this,"id",1),ie(this,"styleIDMap",new WeakMap),ie(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){let r;return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r)}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ur(e){var t;let r=null;return"getRootNode"in e&&(null==(t=l$(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lW(l$(e))&&(r=lW(l$(e))),r}function us(e){let t,r=e;for(;t=ur(r);)r=t;return r}function un(e){let t=e.ownerDocument;return!!t&&lz(t,us(e))}function ui(e){let t=e.ownerDocument;return!!t&&(lz(t,e)||un(e))}let uo=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:ut,get _mirror(){return lq},closestElementOfNode:l1,getBaseDimension:function e(t,r){var s,n;let i=null==(n=null==(s=t.ownerDocument)?void 0:s.defaultView)?void 0:n.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=i.getBoundingClientRect(),a=e(i,r),l=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){let s=t[r[0]];return 1===r.length?s:e(s.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){let t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:us,getShadowHost:ur,getWindowHeight:lZ,getWindowScroll:lQ,getWindowWidth:l0,hasShadowRoot:ue,hookSetter:lK,inDom:ui,isAncestorRemoved:l6,isBlocked:l2,isIgnored:l4,isSerialized:l3,isSerializedIframe:l9,isSerializedStylesheet:l7,iterateResolveTree:function e(t,r){r(t.value);for(let s=t.children.length-1;s>=0;s--)e(t.children[s],r)},legacy_isTouchEvent:l5,get nowTimestamp(){return lY},on:lV,patch:lX,polyfill:l8,queueToResolveTrees:function(e){let t={},r=(e,r)=>{let s={value:e,parent:r,children:[]};return t[e.node.id]=s,s},s=[];for(let n of e){let{nextId:e,parentId:i}=n;if(e&&e in t){let i=t[e];if(i.parent){let e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,r(n,i.parent))}else{let e=s.indexOf(i);s.splice(e,0,r(n,null))}continue}if(i in t){let e=t[i];e.children.push(r(n,e));continue}s.push(r(n,null))}return s},shadowHostInDom:un,throttle:lG,uniqueTextMutations:function(e){let t=new Set,r=[];for(let s=e.length;s--;){let n=e[s];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"}));var ua=((el=ua||{})[el.DomContentLoaded=0]="DomContentLoaded",el[el.Load=1]="Load",el[el.FullSnapshot=2]="FullSnapshot",el[el.IncrementalSnapshot=3]="IncrementalSnapshot",el[el.Meta=4]="Meta",el[el.Custom=5]="Custom",el[el.Plugin=6]="Plugin",el),ul=((eu=ul||{})[eu.Mutation=0]="Mutation",eu[eu.MouseMove=1]="MouseMove",eu[eu.MouseInteraction=2]="MouseInteraction",eu[eu.Scroll=3]="Scroll",eu[eu.ViewportResize=4]="ViewportResize",eu[eu.Input=5]="Input",eu[eu.TouchMove=6]="TouchMove",eu[eu.MediaInteraction=7]="MediaInteraction",eu[eu.StyleSheetRule=8]="StyleSheetRule",eu[eu.CanvasMutation=9]="CanvasMutation",eu[eu.Font=10]="Font",eu[eu.Log=11]="Log",eu[eu.Drag=12]="Drag",eu[eu.StyleDeclaration=13]="StyleDeclaration",eu[eu.Selection=14]="Selection",eu[eu.AdoptedStyleSheet=15]="AdoptedStyleSheet",eu[eu.CustomElement=16]="CustomElement",eu),uu=((ec=uu||{})[ec.MouseUp=0]="MouseUp",ec[ec.MouseDown=1]="MouseDown",ec[ec.Click=2]="Click",ec[ec.ContextMenu=3]="ContextMenu",ec[ec.DblClick=4]="DblClick",ec[ec.Focus=5]="Focus",ec[ec.Blur=6]="Blur",ec[ec.TouchStart=7]="TouchStart",ec[ec.TouchMove_Departed=8]="TouchMove_Departed",ec[ec.TouchEnd=9]="TouchEnd",ec[ec.TouchCancel=10]="TouchCancel",ec),uc=((eh=uc||{})[eh.Mouse=0]="Mouse",eh[eh.Pen=1]="Pen",eh[eh.Touch=2]="Touch",eh),uh=((ep=uh||{})[ep["2D"]=0]="2D",ep[ep.WebGL=1]="WebGL",ep[ep.WebGL2=2]="WebGL2",ep),up=((ed=up||{})[ed.Play=0]="Play",ed[ed.Pause=1]="Pause",ed[ed.Seeked=2]="Seeked",ed[ed.VolumeChange=3]="VolumeChange",ed[ed.RateChange=4]="RateChange",ed),ud=((ef=ud||{})[ef.Document=0]="Document",ef[ef.DocumentType=1]="DocumentType",ef[ef.Element=2]="Element",ef[ef.Text=3]="Text",ef[ef.CDATA=4]="CDATA",ef[ef.Comment=5]="Comment",ef);class uf{constructor(){ie(this,"length",0),ie(this,"head",null),ie(this,"tail",null)}get(e){if(e>=this.length)throw Error("Position outside of list range");let t=this.head;for(let r=0;r`${e}@${t}`;class ug{constructor(){ie(this,"frozen",!1),ie(this,"locked",!1),ie(this,"texts",[]),ie(this,"attributes",[]),ie(this,"attributeMap",new WeakMap),ie(this,"removes",[]),ie(this,"mapRemoves",[]),ie(this,"movedMap",{}),ie(this,"addedSet",new Set),ie(this,"movedSet",new Set),ie(this,"droppedSet",new Set),ie(this,"removesSubTreeCache",new Set),ie(this,"mutationCb"),ie(this,"blockClass"),ie(this,"blockSelector"),ie(this,"maskTextClass"),ie(this,"maskTextSelector"),ie(this,"inlineStylesheet"),ie(this,"maskInputOptions"),ie(this,"maskTextFn"),ie(this,"maskInputFn"),ie(this,"keepIframeSrcFn"),ie(this,"recordCanvas"),ie(this,"inlineImages"),ie(this,"slimDOMOptions"),ie(this,"dataURLOptions"),ie(this,"doc"),ie(this,"mirror"),ie(this,"iframeManager"),ie(this,"stylesheetManager"),ie(this,"shadowDomManager"),ie(this,"canvasManager"),ie(this,"processedNodeManager"),ie(this,"unattachedDoc"),ie(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),ie(this,"emit_original",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new uf,s=e=>{let t=e,r=-2;for(;-2===r;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{let i=lF(n);if(!i||!ui(n))return;let o=!1;if(n.nodeType===Node.TEXT_NODE){let e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(o=!0)}let a=iw(i)?this.mirror.getId(ur(n)):this.mirror.getId(i),l=s(n);if(-1===a||-1===l)return r.addNode(n);let u=iq(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=>{l9(e,this.mirror)&&this.iframeManager.addIframe(e),l7(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ue(n)&&this.shadowDomManager.addShadowRoot(lH(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:o});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)(!uw(this.removesSubTreeCache,e,this.mirror)||this.movedSet.has(lF(e)))&&n(e);for(let e of this.addedSet)ub(this.droppedSet,e)||uw(this.removesSubTreeCache,e,this.mirror)?ub(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let i=null;for(;r.length;){let e=null;if(i){let t=this.mirror.getId(lF(i.value)),r=s(i.value);-1!==t&&-1!==r&&(e=i)}if(!e){let t=r.tail;for(;t;){let r=t;if(t=t.previous,r){let t=this.mirror.getId(lF(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{let t=lF(r.value);if(t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let s=lW(t);if(-1!==this.mirror.getId(s)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}i=e.previous,r.removeNode(e.value),n(e.value)}let o={texts:this.texts.map(e=>{let t=e.node,r=lF(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{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=>{let{attributes:t}=e;if("string"==typeof t.style){let r=JSON.stringify(e.styleDiff),s=JSON.stringify(e._unchangedStyles);r.length!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),ie(this,"emit",(...e)=>globalThis.$jamPerf&&globalThis.$jamPerf.ready?globalThis.$jamPerf.decorate(this.emit_original.bind(this),"rrweb_emit")(...e):this.emit_original(...e)),ie(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(l_(e),e=>lB(e)||"").join("")}),ie(this,"processMutation",e=>{if(!l4(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=lB(e.target);l2(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:iV(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,l1(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,s=e.target.getAttribute(r);if("value"===r){let e=iE(t);s=iO({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(l2(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(s))if(t.contentDocument)return;else r="rr_src";if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!iW(t.tagName,r))if(n.attributes[r]=i$(this.doc,iC(t.tagName),iC(r),s),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}let r=this.unattachedDoc.createElement("span");for(let s of(e.oldValue&&r.setAttribute("style",e.oldValue),Array.from(t.style))){let e=t.style.getPropertyValue(s),i=t.style.getPropertyPriority(s);e!==r.style.getPropertyValue(s)||i!==r.style.getPropertyPriority(s)?""===i?n.styleDiff[s]=e:n.styleDiff[s]=[e,i]:n._unchangedStyles[s]=[e,i]}for(let e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(l2(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=>{let r=this.mirror.getId(t),s=iw(e.target)?this.mirror.getId(lW(e.target)):this.mirror.getId(e.target);!(l2(e.target,this.blockClass,this.blockSelector,!1)||l4(t,this.mirror,this.slimDOMOptions))&&l3(t,this.mirror)&&(this.addedSet.has(t)?(uy(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||l6(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[um(r,s)]?uy(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!!(iw(e.target)&&ib(e.target))||void 0}),function(e,t){let r=[e];for(;r.length;){let e=r.pop();t.has(e)||(t.add(e),l_(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),ie(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(l4(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[um(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);!l2(e,this.blockClass,this.blockSelector,!1)&&(l_(e).forEach(e=>this.genAdds(e)),ue(e)&&l_(lH(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 uy(e,t){e.delete(t),l_(t).forEach(t=>uy(e,t))}function uw(e,t,r){return 0!==e.size&&function(e,t,r){let s=lF(t);return!!s&&e.has(s)}(e,t)}function ub(e,t){return 0!==e.size&&function e(t,r){let s=lF(r);return!!s&&(!!t.has(s)||e(t,s))}(e,t)}let uv=e=>j?(...t)=>{try{return e(...t)}catch(e){if(j&&!0===j(e))return;throw e}}:e,uS=[];function ux(e){try{if("composedPath"in e){let 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 uO(e,t){let r=new ug;uS.push(r),r.init(e);let s=new(lT("MutationObserver")).constructor(uv(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function uC({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:i}){return lV("scroll",uv(lG(uv(i=>{let o=ux(i);if(!o||l2(o,s,n,!0))return;let a=r.getId(o);if(o===t&&t.defaultView){let r=lQ(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100)),t)}let uk=["INPUT","TEXTAREA","SELECT"],uE=new WeakMap;function uM(e){var t=[];if(uP("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||uP("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||uP("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||uP("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){let r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}function uR(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function uI({mirror:e,stylesheetManager:t},r){var s,n,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(lW(r));let a="#document"===r.nodeName?null==(s=r.defaultView)?void 0:s.Document:null==(i=null==(n=r.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;let s=null==(r=l.set)?void 0:r.call(this,e);if(null!==o&&-1!==o)try{t.adoptStyleSheets(e,o)}catch(e){}return s}}),uv(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function uA(e,t={}){let r,s=e.doc.defaultView;if(!s)return()=>{};let{mutationCb:n,mousemoveCb:i,mouseInteractionCb:o,scrollCb:a,viewportResizeCb:l,inputCb:u,mediaInteractionCb:c,styleSheetRuleCb:h,styleDeclarationCb:p,canvasMutationCb:d,fontCb:f,selectionCb:m,customElementCb:g}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),i(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),l(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),u(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),h(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),p(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),m(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),g(...e)},e.recordDOM&&(r=uO(e,e.doc));let y=function({mousemoveCb:e,sampling:t,doc:r,mirror:s}){let n;if(!1===t.mousemove)return()=>{};let i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,a=[],l=lG(uv(t=>{let r=Date.now()-n;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],n=null}),o),u=uv(lG(uv(e=>{let t=ux(e),{clientX:r,clientY:i}=l5(e)?e.changedTouches[0]:e;n||(n=lY()),a.push({x:r,y:i,id:s.getId(t),timeOffset:lY()-n}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?ul.Drag:e instanceof MouseEvent?ul.MouseMove:ul.TouchMove)}),i,{trailing:!1})),c=[lV("mousemove",u,r),lV("touchmove",u,r),lV("drag",u,r)];return uv(()=>{c.forEach(e=>e())})}(e),w=function({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:i}){if(!1===i.mouseInteraction)return()=>{};let o=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[],l=null;return Object.keys(uu).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=iC(i),u=t=>{let o=ux(t);if(l2(o,s,n,!0))return;let a=null,u=i;if("pointerType"in t){switch(t.pointerType){case"mouse":a=uc.Mouse;break;case"touch":a=uc.Touch;break;case"pen":a=uc.Pen}a===uc.Touch?uu[i]===uu.MouseDown?u="TouchStart":uu[i]===uu.MouseUp&&(u="TouchEnd"):uc.Pen}else l5(t)&&(a=uc.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===uc.Touch||u.startsWith("Mouse")&&a===uc.Mouse)&&(a=null)):uu[i]===uu.Click&&(a=l,l=null);let c=l5(t)?t.changedTouches[0]:t;if(!c)return;let h=r.getId(o),{clientX:p,clientY:d}=c;uv(e)({type:uu[u],id:h,x:p,y:d,...null!==a&&{pointerType:a}})};if(window.PointerEvent)switch(uu[i]){case uu.MouseDown:case uu.MouseUp:o=o.replace("mouse","pointer");break;case uu.TouchStart:case uu.TouchEnd:return}a.push(lV(o,u,t))}),uv(()=>{a.forEach(e=>e())})}(e),b=uC(e),v=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return lV("resize",uv(lG(uv(()=>{let t=lZ(),n=l0();(r!==t||s!==n)&&(e({width:Number(n),height:Number(t)}),r=t,s=n)}),200)),t)}(e,{win:s}),S=function({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:i,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let r=ux(e),u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=lU(r)),!r||!h||0>uk.indexOf(h)||l2(r,s,n,!0)||r.classList.contains(i)||o&&r.matches(o))return;let d=r.value,f=!1,m=iE(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(d=iO({element:r,maskInputOptions:a,tagName:h,type:m,value:d,maskInputFn:l})),p(r,c?{text:d,isChecked:f,userTriggered:u}:{text:d,isChecked:f});let g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){let t=e.value;p(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,s){let n=uE.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){uE.set(t,s);let n=r.getId(t);uv(e)({...s,id:n})}}let d=("last"===u.input?["change"]:["input","change"]).map(e=>lV(e,uv(h),t)),f=t.defaultView;if(!f)return()=>{d.forEach(e=>e())};let 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=>lK(e[0],e[1],{set(){uv(h)({target:this,isTrusted:!1})}},!1,f))),uv(()=>{d.forEach(e=>e())})}(e),x=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:i}){let o=uv(i=>lG(uv(n=>{let o=ux(n);if(!o||l2(o,t,r,!0))return;let{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=o;e({type:i,id:s.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),n.media||500)),a=[lV("play",o(up.Play),i),lV("pause",o(up.Pause),i),lV("seeked",o(up.Seeked),i),lV("volumechange",o(up.VolumeChange),i),lV("ratechange",o(up.RateChange),i)];return uv(()=>{a.forEach(e=>e())})}(e),O=()=>{},C=()=>{},k=()=>{},E=()=>{};e.recordDOM&&(O=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){let n,i;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};let o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:uv((s,n,i)=>{let[o,a]=i,{id:l,styleId:u}=uR(n,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:o,index:a}]}),s.apply(n,i)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){let n=`${e} { ${t} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};let a=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:uv((s,n,i)=>{let[o]=i,{id:a,styleId:l}=uR(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),s.apply(n,i)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(n=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:uv((s,n,i)=>{let[o]=i,{id:a,styleId:l}=uR(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:o}),s.apply(n,i)})})),s.CSSStyleSheet.prototype.replaceSync&&(i=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:uv((s,n,i)=>{let[o]=i,{id:a,styleId:l}=uR(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),s.apply(n,i)})}));let l={};uT("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(uT("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),uT("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),uT("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));let u={};return Object.entries(l).forEach(([s,n])=>{u[s]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(u[s].insertRule,{apply:uv((s,n,i)=>{let[o,a]=i,{id:l,styleId:u}=uR(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:o,index:[...uM(n),a||0]}]}),s.apply(n,i)})}),n.prototype.deleteRule=new Proxy(u[s].deleteRule,{apply:uv((s,n,i)=>{let[o]=i,{id:a,styleId:l}=uR(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...uM(n),o]}]}),s.apply(n,i)})})}),uv(()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=a,n&&(s.CSSStyleSheet.prototype.replace=n),i&&(s.CSSStyleSheet.prototype.replaceSync=i),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:s}),C=uI(e,e.doc),k=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){let i=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:uv((n,o,a)=>{var l;let[u,c,h]=a;if(r.has(u))return i.apply(o,[u,c,h]);let{id:p,styleId:d}=uR(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:u,value:c,priority:h},index:uM(o.parentRule)}),n.apply(o,a)})});let o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:uv((n,i,a)=>{var l;let[u]=a;if(r.has(u))return o.apply(i,[u]);let{id:c,styleId:h}=uR(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:uM(i.parentRule)}),n.apply(i,a)})}),uv(()=>{n.CSSStyleDeclaration.prototype.setProperty=i,n.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:s}),e.collectFonts&&(E=function({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let s=[],n=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){let s=new i(e,t,r);return n.set(s,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),s};let o=lX(t.fonts,"add",function(t){return function(r){return setTimeout(uv(()=>{let t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}});return s.push(()=>{r.FontFace=i}),s.push(o),uv(()=>{s.forEach(e=>e())})}(e)));let M=function(e){let{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:i}=e,o=!0,a=uv(()=>{let e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;let a=[],l=e.rangeCount||0;for(let t=0;t{}}(e),I=[];for(let t of e.plugins)I.push(t.observer(t.callback,s,t.options));return uv(()=>{uS.forEach(e=>e.reset()),null==r||r.disconnect(),y(),w(),b(),v(),S(),x(),O(),C(),k(),E(),M(),R(),I.forEach(e=>e())})}function uP(e){return void 0!==window[e]}function uT(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class uL{constructor(e){ie(this,"iframeIdToRemoteIdMap",new WeakMap),ie(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){let n=r||this.getIdToRemoteIdMap(e),i=s||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),i.set(o,t)),o}getIds(e,t){let r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,s))}getRemoteId(e,t,r){let s=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;let n=s.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class uD{constructor(e){ie(this,"iframes",new WeakMap),ie(this,"crossOriginIframeMap",new WeakMap),ie(this,"crossOriginIframeMirror",new uL(ij)),ie(this,"crossOriginIframeStyleMirror"),ie(this,"crossOriginIframeRootIdMap",new WeakMap),ie(this,"mirror"),ie(this,"mutationCb"),ie(this,"wrappedEmit"),ie(this,"loadListener"),ie(this,"stylesheetManager"),ie(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new uL(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(s=this.loadListener)||s.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){if("rrweb"!==e.data.type||e.origin!==e.data.origin||!e.source)return;let t=this.crossOriginIframeMap.get(e.source);if(!t)return;let r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case ua.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:ua.IncrementalSnapshot,data:{source:ul.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ua.Meta:case ua.Load:case ua.DomContentLoaded:break;case ua.Plugin:return t;case ua.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ua.IncrementalSnapshot:switch(t.data.source){case ul.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);let r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),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 ul.Drag:case ul.TouchMove:case ul.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case ul.ViewportResize:return!1;case ul.MediaInteraction:case ul.MouseInteraction:case ul.Scroll:case ul.CanvasMutation:case ul.Input:return this.replaceIds(t.data,e,["id"]),t;case ul.StyleSheetRule:case ul.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ul.Font:return t;case ul.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case ul.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,s){for(let n of s)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===ud.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class uN{constructor(e){ie(this,"shadowDoms",new WeakSet),ie(this,"mutationCb"),ie(this,"scrollCb"),ie(this,"bypassOptions"),ie(this,"mirror"),ie(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(!ib(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=uO({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(uC({...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(lW(e))),this.restoreHandlers.push(uI({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){let r=this;this.restoreHandlers.push(lX(e.prototype,"attachShadow",function(e){return function(s){let n=e.call(this,s),i=lH(this);return i&&ui(this)&&r.addShadowRoot(i,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var uj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),uF=0;uF>2],n+=uj[(3&r[t])<<4|r[t+1]>>4],n+=uj[(15&r[t+1])<<2|r[t+2]>>6],n+=uj[63&r[t+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n};let uB=new Map,uz=(e,t,r)=>{let s;if(!e||!(uW(e,t)||"object"==typeof e))return;let n=e.constructor.name,i=((s=uB.get(r))||(s=new Map,uB.set(r,s)),s.has(n)||s.set(n,[]),s.get(n)),o=i.indexOf(e);return -1===o&&(o=i.length,i.push(e)),o},u$=(e,t,r)=>e.map(e=>(function e(t,r,s){if(t instanceof Array)return t.map(t=>e(t,r,s));if(null===t);else if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};else if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:uU(t)};else if(t instanceof DataView)return{rr_type:t.constructor.name,args:[e(t.buffer,r,s),t.byteOffset,t.byteLength]};else if(t instanceof HTMLImageElement){let e=t.constructor.name,{src:r}=t;return{rr_type:e,src:r}}else if(t instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:t.toDataURL()};else if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[e(t.data,r,s),t.width,t.height]};else if(uW(t,r)||"object"==typeof t)return{rr_type:t.constructor.name,index:uz(t,r,s)};return t})(e,t,r)),uW=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]).find(r=>e instanceof t[r]);function uH(e,t,r,s){let n=[];try{let i=lX(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...i){if(!l2(this,t,r,!0)){let e="experimental-webgl"===n?"webgl":n;if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){let e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...i])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function uV(e,t,r,s,n,i){let o=[];for(let a of Object.getOwnPropertyNames(e))if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if("function"!=typeof e[a])continue;let l=lX(e,a,function(e){return function(...o){let l=e.apply(this,o);if(uz(l,i,this),"tagName"in this.canvas&&!l2(this.canvas,s,n,!0)){let e=u$(o,i,this),s={type:t,property:a,args:e};r(this.canvas,s)}return l}});o.push(l)}catch{let s=lK(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(s)}return o}let uJ='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',uq="undefined"!=typeof self&&self.Blob&&new Blob([uJ],{type:"text/javascript;charset=utf-8"});function uG(e){let t;try{if(!(t=uq&&(window.URL||window.webkitURL).createObjectURL(uq)))throw"";let r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(uJ),{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class uK{constructor(e){ie(this,"pendingCanvasMutations",new Map),ie(this,"rafStamps",{latestId:0,invokeId:null}),ie(this,"mirror"),ie(this,"mutationCb"),ie(this,"resetObservers"),ie(this,"frozen",!1),ie(this,"locked",!1),ie(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)});let{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:i,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,s,n),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:o})}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,r,s,n){let i,o=uH(t,r,s,!0),a=new Map,l=new uG;l.onmessage=e=>{let{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;let{base64:r,type:s,width:n,height:i}=e.data;this.mutationCb({id:t,type:uh["2D"],commands:[{property:"clearRect",args:[0,0,n,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})};let u=1e3/e,c=0,h=e=>{if(c&&e-c{let e=[];return t.document.querySelectorAll("canvas").forEach(t=>{l2(t,r,s,!0)||e.push(t)}),e})().forEach(async e=>{var t;let r=this.mirror.getId(e);if(a.get(r)||0===e.width||0===e.height)return;if(a.set(r,!0),["webgl","webgl2"].includes(e.__context)){let r=e.getContext(e.__context);(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)===!1&&r.clear(r.COLOR_BUFFER_BIT)}let s=await createImageBitmap(e);l.postMessage({id:r,bitmap:s,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[s])}),i=requestAnimationFrame(h)};i=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=uH(e,t,r,!1),n=function(e,t,r,s){let n=[];for(let i of Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype))try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;let o=lX(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return l2(this.canvas,r,s,!0)||setTimeout(()=>{let r=u$(o,t,this);e(this.canvas,{type:uh["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{let r=lK(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:uh["2D"],property:i,args:[t],setter:!0})}});n.push(r)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,s){let n=[];return n.push(...uV(t.WebGLRenderingContext.prototype,uh.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...uV(t.WebGL2RenderingContext.prototype,uh.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;let s=r.map(e=>{let{type:t,...r}=e;return r}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}}class uX{constructor(e){ie(this,"trackedLinkElements",new WeakSet),ie(this,"mutationCb"),ie(this,"adoptedStyleSheetCb"),ie(this,"styleMirror",new ut),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;let r={id:t,styleIds:[]},s=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),s.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:iS(e,t.href),index:r}))})),r.styleIds.push(e)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class uY{constructor(){ie(this,"nodeMap",new WeakMap),ie(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).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 uQ=!1;try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(eO=e.contentWindow)?void 0:eO.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}let uZ=new ix;function u0(e={}){let t,{emit:r,checkoutEveryNms:s,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:f,maskInputFn:m,maskTextFn:g,hooks:y,packFn:w,sampling:b={},dataURLOptions:v={},mousemoveWait:S,recordDOM:x=!0,recordCanvas:O=!1,recordCrossOriginIframes:C=!1,recordAfter:k="DOMContentLoaded"===e.recordAfter?e.recordAfter:"load",userTriggeredOnInput:E=!1,collectFonts:M=!1,inlineImages:R=!1,plugins:I,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:T}=e;j=T;let L=!C||window.parent===window,D=!1;if(!L)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(L&&!r)throw Error("emit function is required");if(!L&&!D)return()=>{};void 0!==S&&void 0===b.mousemove&&(b.mousemove=S),uZ.reset();let N=!0===p?{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!==d?d:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};l8();let z=0,$=e=>{for(let t of I||[])t.eventProcessor&&(e=t.eventProcessor(e));return w&&!D&&(e=w(e)),e};_=(e,i)=>{var o;if(e.timestamp=lY(),(null==(o=uS[0])?void 0:o.isFrozen())&&e.type!==ua.FullSnapshot&&(e.type!==ua.IncrementalSnapshot||e.data.source!==ul.Mutation)&&uS.forEach(e=>e.unfreeze()),L)null==r||r($(e),i);else if(D){let t={type:"rrweb",event:$(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===ua.FullSnapshot)t=e,z=0;else if(e.type===ua.IncrementalSnapshot){if(e.data.source===ul.Mutation&&e.data.isAttachIframe)return;z++;let r=n&&z>=n,i=s&&e.timestamp-t.timestamp>s;(r||i)&&F(!0)}};let W=e=>{_({type:ua.IncrementalSnapshot,data:{source:ul.Mutation,...e}})},H=e=>_({type:ua.IncrementalSnapshot,data:{source:ul.Scroll,...e}}),V=e=>_({type:ua.IncrementalSnapshot,data:{source:ul.CanvasMutation,...e}}),J=new uX({mutationCb:W,adoptedStyleSheetCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.AdoptedStyleSheet,...e}})}),q=new uD({mirror:uZ,mutationCb:W,stylesheetManager:J,recordCrossOriginIframes:C,wrappedEmit:_});for(let e of I||[])e.getMirror&&e.getMirror({nodeMirror:uZ,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});let G=new uY;U=new uK({recordCanvas:O,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:uZ,sampling:b.canvas,dataURLOptions:v});let K=new uN({mutationCb:W,scrollCb:H,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:N,dataURLOptions:v,maskTextFn:g,maskInputFn:m,recordCanvas:O,inlineImages:R,sampling:b,slimDOMOptions:B,iframeManager:q,stylesheetManager:J,canvasManager:U,keepIframeSrcFn:A,processedNodeManager:G},mirror:uZ});F=(e=!1)=>{if(!x)return;_({type:ua.Meta,data:{href:window.location.href,width:l0(),height:lZ()}},e),J.reset(),K.init(),uS.forEach(e=>e.lock());let t=function(...e){return globalThis.$jamPerf&&globalThis.$jamPerf.ready?globalThis.$jamPerf.decorate(iG,"rrweb_snapshot")(...e):iG(...e)}(document,{mirror:uZ,blockClass:i,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:N,maskTextFn:g,maskInputFn:m,slimDOM:B,dataURLOptions:v,recordCanvas:O,inlineImages:R,onSerialize:e=>{l9(e,uZ)&&q.addIframe(e),l7(e,uZ)&&J.trackLinkElement(e),ue(e)&&K.addShadowRoot(lH(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{J.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");_({type:ua.FullSnapshot,data:{node:t,initialOffset:lQ(window)}},e),uS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,uZ.getId(document))};try{let e=[],t=e=>{var t;return uv(uA)({mutationCb:W,mousemoveCb:(e,t)=>_({type:ua.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.ViewportResize,...e}}),inputCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.Input,...e}}),mediaInteractionCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.MediaInteraction,...e}}),styleSheetRuleCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.StyleSheetRule,...e}}),styleDeclarationCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>_({type:ua.IncrementalSnapshot,data:{source:ul.Font,...e}}),selectionCb:e=>{_({type:ua.IncrementalSnapshot,data:{source:ul.Selection,...e}})},customElementCb:e=>{_({type:ua.IncrementalSnapshot,data:{source:ul.CustomElement,...e}})},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:N,inlineStylesheet:h,sampling:b,recordDOM:x,recordCanvas:O,inlineImages:R,userTriggeredOnInput:E,collectFonts:M,doc:e,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:B,dataURLOptions:v,mirror:uZ,iframeManager:q,stylesheetManager:J,shadowDomManager:K,processedNodeManager:G,canvasManager:U,ignoreCSSAttributes:P,plugins:(null==(t=null==I?void 0:I.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>_({type:ua.Plugin,data:{plugin:e.name,payload:t}})})))||[]},y)};q.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});let r=()=>{F(),e.push(t(document)),uQ=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(lV("DOMContentLoaded",()=>{_({type:ua.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(lV("load",()=>{_({type:ua.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),uQ=!1,j=void 0}}catch(e){console.warn(e)}}u0.addCustomEvent=(e,t)=>{if(!uQ)throw Error("please add custom event after start recording");_({type:ua.Custom,data:{tag:e,payload:t}})},u0.freezePage=()=>{uS.forEach(e=>e.freeze())},u0.takeFullSnapshot=e=>{if(!uQ)throw Error("please take full snapshot after start recording");F(e)},u0.mirror=uZ,(em=eC||(eC={}))[em.NotStarted=0]="NotStarted",em[em.Running=1]="Running",em[em.Stopped=2]="Stopped";let{addCustomEvent:u1}=u0,{freezePage:u2}=u0,{takeFullSnapshot:u3}=u0,u4=e=>({type:ua.Plugin,timestamp:e.timestamp,origin:window.location.origin,hostname:window.location.hostname,data:{plugin:"jam/websocket@1",payload:{action:e.action,connectionId:e.connectionId,data:e.data,url:e.url}}});async function u6(e){return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?new TextDecoder().decode(e):window.crossOriginIsolated&&e instanceof SharedArrayBuffer?new TextDecoder().decode(new Uint8Array(e)):e instanceof Blob?e.text():"string"==typeof e?e:String(e)}let u5={_buffer:[],onEmit:e=>u5._buffer.push(e),registerOnEmit(e){for(let t of(u5.onEmit=e,u5._buffer))e(t);u5._buffer=[]}};function u8(e){let{forwardBack:t}=e,r="string"==typeof e.url?e.url:e.url.toString();return{timestamp:Date.now(),jamType:nl.NavigationEvent,type:ua.Custom,data:{tag:"",payload:{eventSource:"onHistoryStateUpdated",url:r,transitionQualifiers:t?["forward_back"]:[],transitionType:"link",originalTimestamp:Date.now(),step:nv.Output,tabId:1}}}}let u9={name:"jam/host-page-state@1",observer(e,t,r){(null==r?void 0:r.emitInitialState)&&e(u7({eventSource:"visibilitychange",state:document.visibilityState}));let s=function(e){function t(t){e(u7({eventSource:"focus",visible:!0}))}function r(t){e(u7({eventSource:"focus",visible:!1}))}return window.addEventListener("focus",t,!0),window.addEventListener("blur",r,!0),()=>{window.removeEventListener("focus",t,!0),window.removeEventListener("blur",r,!0)}}(e),n=function(e){function t(){e(u7({eventSource:"visibilitychange",state:document.visibilityState}))}return document.addEventListener("visibilitychange",t,!0),()=>{document.removeEventListener("visibilitychange",t,!0)}}(e);return()=>{s(),n()}},options:{}};function u7(e){return{origin:window.location.origin,hostname:window.location.hostname,url:window.location.href,timestamp:Date.now(),type:ua.Plugin,data:{plugin:u9.name,payload:e}}}let{predicate:ce}=e9(["input[type=password]","[data-__jam-blur-restore]"]),{predicate:ct}=e9(["input[type=password]","[data-__jam-blur-restore]"]);function cr(e,t){let r=e.getAttribute(t);if(r)return r;let s=null==e?void 0:e[t];return s&&"string"==typeof s?s:s&&"string"!=typeof s?JSON.stringify(s):null}let cs={value:function(e,t){let r=e.getAttribute(t),s=e[t],n=r??("string"==typeof s?s:null);return null!==n&&ct(e)?"***":n},className:cr,id:cr,tagName:cr,type:cr,autocomplete:cr},cn="__jam_target_id";function ci(e){let t=e[e.length-1],r=Array.from({length:e.length});for(let[t,s]of e.entries())r[t]={key:s.data.payload.key,code:s.data.payload.code,repeat:s.data.payload.repeat,type:s.data.payload.type};return{type:t.type,timestamp:t.timestamp,jamType:nl.InteractivityEvent,data:{tag:"",payload:{step:nv.Output,device:"keyboard",target:t.data.payload.target,type:"keyword",isTrusted:t.data.payload.isTrusted,composed:t.data.payload.composed,targetsJamUi:t.data.payload.targetsJamUi,originalTimestamp:t.data.payload.originalTimestamp,isInputLike:t.data.payload.isInputLike,events:r}}}}let co=eM("1200"),ca={status:"initial",scheduledFlush:null,keyboardEventsBuffer:null},cl=["click","keydown","keyup"],cu=[function(e){return"keyboard"===e.data.payload.device&&"keydown"===e.data.payload.type&&ce(e.data.payload.target.attributes)&&!ng.includes(e.data.payload.code)&&(e.data.payload.key="***",e.data.payload.code="KeyAnonymized"),e}],cc=[function(e){let t=new Set(["ShiftLeft","ShiftRight","Shift"]),r=[];for(let s of e)switch(s.data.payload.device){case"mouse":r.push(s);break;case"keyboard":{let e=[];for(let r=0;r="A"&&i.key<="Z"||e.push(n))}let n=s.data.payload.events.slice().pop();n&&e.push(n),s.data.payload.events=e,r.push(s)}}return r}];function ch(e){return e.isTrusted&&e.target instanceof HTMLElement}class cp{toString(){let e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}constructor(e){eA(this,"fileName",void 0),eA(this,"functionName",void 0),eA(this,"lineNumber",void 0),eA(this,"columnNumber",void 0),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}}let cd=/(^|@)\S+:\d+/,cf=/^\s*at .*(\S+:\d+|\(native\))/m,cm=/^(eval@)?(\[native code])?$/,cg={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(cf))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(cf)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),s=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:s.pop());return new cp({functionName:s.join(" ")||void 0,fileName:["eval",""].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(cm)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new cp({functionName:e});{let t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),s=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new cp({functionName:s,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){let t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),s=[];for(let e=2,n=r.length;e/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}},cy={},cw={JSON:{stringify:JSON.stringify}},cb=function(){let e=[];function t(){return e.length}function r(){return e[e.length-1]}return{length:t,peek:r,pop:function(s){0!==t()&&r()===s&&e.pop()},push:function(t){var r;"object"==typeof(r=t)&&null!==r&&e.push(t)}}}();function cv(e,t){let r=function(e){var t,r,s;let[n,i]=e.split(".");if(null==cy||null==(t=cy[n])?void 0:t[i])return cy[n][i];let o=cw[n][i];return(null==(s=o.toString().split("()")[1])?void 0:s.trim())==="{ [native code] }"?(cy[n]||(cy[n]={}),cy[n][i]=o,o):(function(e){let t=document.createElement("iframe");t.style.display="none",document.documentElement.appendChild(t);let r=t.contentWindow,[s,n]=e.split(".");"JSON"===s&&"stringify"===n&&(cy.JSON=cy.JSON||{},cy.JSON.stringify=null==r?void 0:r.JSON.stringify),t.remove()}(e),null==cy||null==(r=cy[n])?void 0:r[i])}("JSON.stringify");if(cb.length()>=4||cb.length()>0&&e===cb.peek())return"[object Object]";if(e instanceof Error)return`${e.name}: ${e.message}`;let s=cb.length()>0;try{cb.push(e);let t=r(e,function(e){let t=function(e){let t=[];return function(r,s){if("object"!=typeof s||null===s)return s;for(;t.length>0&&t.at(-1)!==e;)t.pop();return t.includes(s)?"[Circular]":(t.push(s),s)}}(e);return function(e,r){var s;return s=t(e,r),"bigint"==typeof s?`BigInt(${s.toString()}n)`:s}}(e));if(s){var n=t;if(n.startsWith('"')&&n.endsWith('"')){let e=n.substring(1);return e.substring(0,e.length-1)}return n}return t}catch(e){return`Jam had trouble capturing log: ${eH(e)}`}finally{cb.pop(e)}}let cS={};function cx(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=cS[e];if(r)return r.bind(t);let s=t[e]??window[e];if(s&&(function(e){let t=e.toString(),r=e.name;return cO.test(t)&&t.includes(r)}(s)||s.name.endsWith("_jam")))return cS[e]=s,s.bind(t);if(!B){var n;let e=document.createElement("iframe");if(e.width="0",e.height="0",e.style.width="0",e.style.height="0",e.style.display="none",e.style.visibility="hidden",n=e,document.body?document.body.append(n):document.documentElement.append(n),!e.contentWindow)return void e.remove();B=e.contentWindow,e.remove()}let i=B[e];return cS[e]=i,i.bind(t)}let cO=/function\s+\w+\(\)\s+{\s+\[native code]\s+}/i,cC=uo.patch,ck={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:8},lengthThreshold:null,logger:"console"};class cE extends tw{get currentState(){return this._currentState}get state(){let e=this;return async function*(){for(yield e.currentState;;)yield await new Promise(t=>{let r=s=>{e.removeEventListener("statechange",r),t(s.detail)};e.addEventListener("statechange",r)})}()}get api(){return{setState:this.setState.bind(this),checkDidBlur:()=>this.blurManager.didBlurElements}}connect(e){for(let t of(this.forwardEvent=e.forwardEvent,this.earlyEvents))this.forwardEvent(t);this.earlyEvents.length=0}constructor(e){super(),eA(this,"blurManager",void 0),eA(this,"earlyEvents",[]),eA(this,"disposer",void 0),eA(this,"forwardEvent",e=>{this.earlyEvents.push(e)}),eA(this,"_currentState","idle"),eA(this,"setState",e=>{this._currentState=e,this.dispatchEvent("statechange",e)}),this.blurManager=e,this.disposer=function(e){let t=function(e){let t,r={name:"rrweb/console@1",observer:function(e,r){return function(e,t,r,s){let n,i=cx("addEventListener",t),o=cx("removeEventListener",t),a=r.options.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;let l=0,u=[];if(r.options.level.includes("error")){let t=t=>{let{message:s,error:n}=t,i=[];try{i=cg.parse(n).map(e=>e.toString())}catch(e){}e({level:"error",trace:i,payload:[cv(s,r.options.stringifyOptions)]})};null==i||i("error",t),u.push(()=>{null==o||o("error",t)})}for(let t of r.options.level)u.push(function(t,n){return t[n]?cC(t,n,t=>{var i=this;return function(){for(var o,a=arguments.length,u=Array(a),c=0;ce.toString()).splice(1);null==p||p.mark("stackParsing_done");let s=u.map(e=>{try{return cv(e,r.options.stringifyOptions)}catch(e){return cv({JamStringifyError:"Could not stringify this object",TheInternalError:eJ(e),DeveloperNote:"Jam cannot stringify recursive objects, or objects that access cross-origin resources, such as Window Objects."})}});null==p||p.mark("serialization_done"),l++,null===r.options.lengthThreshold||l{}}(n,t));return()=>{u.forEach(e=>e())}}(e,r,this,t)},options:Object.assign({},ck,{level:na,lengthThreshold:null,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:15}})};return r.observer?r.observer(t=>{var s,n;e((s=t,n=r.name,{origin:window.location.origin,hostname:window.location.hostname,timestamp:Date.now(),type:ua.Plugin,data:{plugin:n,payload:s}}))},window,r.options):()=>void 0}(e),{cleanup:r,registerOnEmit:s}=function(e){let t=[],r=n1.observer(e=>u5.onEmit((e=>{let t=new Date;return{origin:window.location.origin,hostname:window.location.hostname,timestamp:t.getTime(),type:ua.Plugin,data:{plugin:n1.name,payload:e}}})(e)),window,e);t.push(r);let s=new n9(e);if(s.onOpen(e=>{u5.onEmit(u4({timestamp:Date.now(),action:"connect",connectionId:e.jamWsId,url:e.url,data:""}))}),s.onClose(e=>{u5.onEmit(u4({timestamp:Date.now(),action:"close",connectionId:e.jamWsId,url:e.url,data:""}))}),s.onMessage((e,t)=>{u5.onEmit(u4({timestamp:Date.now(),action:"receive",connectionId:e.jamWsId,data:t.data.toString(),url:e.url}))}),s.onSend(async(e,t)=>{u5.onEmit(u4({timestamp:Date.now(),action:"send",connectionId:e.jamWsId,data:await u6(t),url:e.url}))}),!("brave"in navigator)){let e=s.attach();t.push(e)}return{registerOnEmit:u5.registerOnEmit,cleanup(){t.forEach(e=>e())}}}({includePerformanceObserver:!0});s(t=>{!function(e){return e.type===ni.Plugin&&"jam/network@1"===e.data.plugin&&"client-performance-observer"===e.data.payload.source&&("fetch"===e.data.payload.entry.initiatorType||"xmlhttprequest"===e.data.payload.entry.initiatorType)}(t)&&e(t)});let n=function(e){let t=window.history.pushState,r=window.history.replaceState;function s(){e(u8({url:document.location.href,forwardBack:!0}))}return window.addEventListener("popstate",s),window.history.pushState=function(r,s,n){let i=document.location.href;t.call(window.history,r,s,n),document.location.href!==i&&e(u8({url:document.location.href,forwardBack:!1}))},window.history.replaceState=function(t,s,n){let i=document.location.href;r.call(window.history,t,s,n),document.location.href!==i&&e(u8({url:document.location.href,forwardBack:!1}))},function(){window.removeEventListener("popstate",s),window.history.pushState=t,window.history.replaceState=r}}(e),i=function(e){var t;let r,s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ch,i=(t=function(t){e(function(e){let t=e;for(let e of cc)[t]=e([t]);return t}(t))},r=ca,s=null,{addEvent(e){!function e(n){let{nextState:i,sideEffects:o}=function(e,t){let r=t.keyboardEventsBuffer??[];switch(e.type){case"keydown":return{sideEffects:{keyboardEventToEmit:null,mouseEventToEmit:null,newScheduledFlushDeadline:null,cancelScheduledFlush:!1},nextState:{status:"buffering",keyboardEventsBuffer:[...r,e.event]}};case"keyup":if("buffering"!==t.status)return{sideEffects:{keyboardEventToEmit:null,mouseEventToEmit:null,newScheduledFlushDeadline:null,cancelScheduledFlush:!1},nextState:t};return{sideEffects:{keyboardEventToEmit:null,mouseEventToEmit:null,newScheduledFlushDeadline:e.event.timestamp+co,cancelScheduledFlush:!0},nextState:{status:"buffering",keyboardEventsBuffer:r}};case"click":{let t=function(e,t){if("mouse"!==e.data.payload.device)return t;let r=new Set;for(let[t,s]of Object.entries(e.data.payload.modifiers??{}))s&&r.add(t);let s=t.slice();for(let e of r)!function(e,t){let r=-1;for(let s=t.length-1;s>=0;s--){let n=t[s];if("keyboard"===n.data.payload.device&&n.data.payload.code===e){r=s;break}}r>=0&&t.splice(r,1)}(nb[e],s);return s}(e.event,r),s=t.length>0?ci(t):null,n=e.event;return{sideEffects:{keyboardEventToEmit:s,mouseEventToEmit:{...n,data:{...n.data,payload:{...n.data.payload,step:nv.Output}}},newScheduledFlushDeadline:null,cancelScheduledFlush:!0},nextState:ca}}case"scheduled-flush":return{sideEffects:{keyboardEventToEmit:r.length>0?ci(r):null,mouseEventToEmit:null,newScheduledFlushDeadline:null,cancelScheduledFlush:!1},nextState:ca}}}(n,r);r=i,o.cancelScheduledFlush&&(null==s||s.cancel(),s=null),o.newScheduledFlushDeadline&&(s=function(e,t){let r=t-Date.now();if(r<0)throw Error("Tried to schedule an operation in the past");let s=setTimeout(function(){if(!n.complete&&!n.canceled)try{e()}catch(e){}n.complete=!0,n.canceled=!1},r),n={cancel:function(){n.canceled||n.complete||clearTimeout(s),n.canceled=!0,n.complete=!1},complete:!1,canceled:!1};return n}(()=>{e({type:"scheduled-flush",event:null}),s=null},o.newScheduledFlushDeadline)),o.keyboardEventToEmit&&t(o.keyboardEventToEmit),o.mouseEventToEmit&&t(o.mouseEventToEmit)}({event:e,type:e.data.payload.type})}});function o(e){if(n(e)){let t=function(e){let t,r=e.target,s={};if(r){for(let e of nf){let t=(0,cs[e])(r,e);null!==t&&(s[e]=t)}for(let e of nm){for(let t of r.getAttributeNames().filter(t=>t.startsWith(`${e}-`))){let e=r.getAttribute(t);null!==e&&(s[t]=e)}for(let t of Object.getOwnPropertyNames(r).filter(t=>t.startsWith(`${e}-`))){let e=null==r?void 0:r[t];if(e)if("object"==typeof e)try{s[t]=JSON.stringify(e)}catch{s[t]="[object]"}else s[t]=String(e)}}let e=null==r?void 0:r[cn];e?t=e:(t=Math.random().toString(36).slice(2,11),r[cn]=t)}if(nd.includes(e.type)){let n=(null==r?void 0:r.tagName)==="INPUT"||(null==r?void 0:r.tagName)==="TEXTAREA"||(null==r?void 0:r.isContentEditable);return{jamType:nl.InteractivityEvent,timestamp:Date.now(),type:ua.Custom,data:{tag:"",payload:{step:nv.Input,device:"keyboard",type:e.type,isTrusted:e.isTrusted,composed:e.composed,target:{attributes:s,id:t},code:e.code,key:e.key,originalTimestamp:e.timeStamp,repeat:e.repeat,targetsJamUi:!1,isInputLike:n??!1}}}}if(np.includes(e.type)){let n={};for(let t of nw)e[t]&&(n[t]=!0);let i=function(e){if(!e)return null;let t=e.tagName.toLowerCase(),r=null;return ct(e)?r="***":["h1","h2","h3","h4","h5","h6","span","li"].includes(t)&&0===e.children.length||["a","button","label","option"].includes(t)?r=e.textContent:["img"].includes(t)?r=e.getAttribute("alt"):["input"].includes(t)&&(r=e.value),r?r.slice(0,128):null}(r);return{jamType:nl.InteractivityEvent,timestamp:Date.now(),type:ua.Custom,data:{tag:"",payload:{step:nv.Input,device:"mouse",type:e.type,isTrusted:e.isTrusted,composed:e.composed,target:{attributes:s,id:t,...i?{text:i}:{}},modifiers:n,originalTimestamp:e.timeStamp,x:e.x,y:e.y,targetsJamUi:!1}}}}throw Error(`Unsupported event type: ${e.type}`)}(e);i.addEvent(function(e){let t=e;for(let e of cu)t=e(t);return t}(t))}}return cl.forEach(e=>{window.addEventListener(e,o,{passive:!0,capture:!0})}),()=>{cl.forEach(e=>{window.removeEventListener(e,o,{capture:!0})})}}(e),o=u9.observer(e,window,{emitInitialState:!0});return function(){t(),r(),n(),i(),o()}}(e=>this.forwardEvent(e)),window.addEventListener("beforeunload",()=>{this.disposer()}),(async()=>{for await(let t of this.state)switch(t){case"recording":e.start();break;case"retained":e.stop();break;case"idle":e.clearData()}})()}}function cM(){var e;return"u">typeof process&&!!(null!=(e=process.versions)&&e.node)}let cR=/^(https?:|file:)?\/\/([^/:]+)?(:(\d+))?/,cI={"http:":"80","https:":"443"};function cA(e=10){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let s=0;s"u"&&"u">typeof self)return void e.postMessage(t,{transfer:s});if(e.postMessage)return void e.postMessage(t,{targetOrigin:r||"*",transfer:s});throw Error("Rimless Error: Invalid target for postMessage")}function cL(e){return null!==cP&&e===cP}function cD(e,t,r){cL(e)?e.on(t,r):"addEventListener"in e&&e.addEventListener(t,r)}function cN(e,t,r){cL(e)?e.off(t,r):"removeEventListener"in e&&e.removeEventListener(t,r)}function cj(e){return e.data||e}var c_=((z=c_||{}).MESSAGE="message",z),cF=(($=cF||{}).HANDSHAKE_REQUEST="RIMLESS/HANDSHAKE_REQUEST",$.HANDSHAKE_REPLY="RIMLESS/HANDSHAKE_REPLY",$.RPC_REQUEST="RIMLESS/RPC_REQUEST",$.RPC_RESOLVE="RIMLESS/RPC_RESOLVE",$.RPC_REJECT="RIMLESS/RPC_REJECT",$);let cU=Symbol(),cB={},cz=function(e,t={}){if(!e)throw Error("a target is required");let r=cL(e)||"u">typeof Worker&&e instanceof Worker,s=r||cM()?e:e instanceof SharedWorker?e.port:window;return new Promise(n=>{let i=cA();function o(e){let t=cj(e);if((null==t?void 0:t.action)===cF.HANDSHAKE_REPLY&&i===t.connectionID){if(!cB[t.connectionID])throw Error("Rimless Error: No connection found for this connectionID");return n(cB[t.connectionID])}}cD(s,c_.MESSAGE,function n(a){let l=r||cM()?e:e instanceof SharedWorker?e.port:a.source;if(!r&&!cM()&&!function(e,t){if(cL(e)||"u">typeof Worker&&e instanceof Worker)return!0;try{let r=e.src,s=function(e){if(!e)return null;let t=cR.exec(e);if(!t)return null;let[,r="http:",s,,n]=t;if("file:"===r)return"file://";let i=n&&n!==cI[r]?`:${n}`:"";return`${r}//${s}${i}`}(r),n=t.origin===s,i=t.source===e.contentWindow;return n&&i||!r}catch(e){return console.warn("Error checking iframe target:",e),!1}}(e,a))return;let u=cj(a);if((null==u?void 0:u.action)!==cF.HANDSHAKE_REQUEST||cB[i])return;let c=function(e){let t={};return function e(r,s=""){Object.keys(r).forEach(n=>{let i=s?`${s}.${n}`:n;r[n]===Object(r[n])&&e(r[n],i),"function"==typeof r[n]&&(t[i]=r[n],delete r[n])})}(e),t}(t),{remote:h,unregisterRemote:p}=function(e={},t=[],r,s,n,i){let o={...e},a=[];for(let e of t){let t=function(e,t,r,s=[],n,i){return(...o)=>new Promise((a,l)=>{let u=cA();function c(r){let{callID:s,connectionID:n,callName:i,result:o,error:c,action:h}=cj(r);if(!(!s||!i)&&i===e&&s===u&&n===t){if(h===cF.RPC_RESOLVE)return a(o);if(h===cF.RPC_REJECT)return l(c)}}let h={action:cF.RPC_REQUEST,args:o,callID:u,callName:e,connectionID:t},p=o.reduce((e,t)=>{var r;return null!=(r=t[cU])&&r.length?e.concat(t[cU]):e},o[cU]??[]);cD(n,c_.MESSAGE,c),s.push(()=>cN(n,c_.MESSAGE,c)),cT(i,h,null==r?void 0:r.origin,p)})}(e,r,s,a,n,i);!function(e,t,r){if(!e||"object"!=typeof e)return;let s=Array.isArray(t)?t:t.split(".").map(e=>e.match(/^\d+$/)?Number(e):e),n=e;for(let e=0;ea.forEach(e=>e())}}(u.schema,u.methodNames,i,a,s,l),d=function(e={},t,r,s,n){let i=[];for(let[a,l]of Object.entries(e)){async function o(e){let r,{action:i,callID:o,connectionID:u,callName:c,args:h=[]}=cj(e);if(i!==cF.RPC_REQUEST||!o||!c||c!==a||u!==t)return;let p={action:cF.RPC_RESOLVE,callID:o,callName:c,connectionID:u,error:null,result:null};try{p.result=await l(...h,n),p.result&&p.result[cU]&&(r=p.result[cU]??[],delete p.result[cU])}catch(e){p.action=cF.RPC_REJECT,p.error=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}cT(s,p,null==e?void 0:e.origin,r)}cD(r,c_.MESSAGE,o),i.push(()=>cN(r,c_.MESSAGE,o))}return()=>i.forEach(e=>e())}(c,i,s,l,h);cT(l,{action:cF.HANDSHAKE_REPLY,connectionID:i,schema:t,methodNames:Object.keys(c)},a.origin),cB[i]={remote:h,close:()=>{delete cB[i],cN(s,c_.MESSAGE,n),cN(s,c_.MESSAGE,o),p(),d(),r&&e.terminate()},id:i}}),cD(s,c_.MESSAGE,o)})},c$="https://recorder.jam.dev/capture";class cW extends tw{async connect(e){return this.connection=await cz(this.iframe,e),this.dispatchEvent("connected",void 0),this.connection}show(){if(document.body.contains(this.iframe))ej.warn("Trying to show an already-showing frame");else if(document.querySelector(":has(> iframe[data-jam-capture])"))throw Error("Another capture frame is already present");else{let e=()=>{var e;document.body.append(this.iframe),null==(e=this.mutationObserver)||e.disconnect(),this.mutationObserver=new MutationObserver((e,t)=>{for(let r of e)for(let e of r.removedNodes)if(e===this.iframe){ej.warn("Jam capture iframe was removed from the page"),t.disconnect(),this.mutationObserver=null;return}}),this.mutationObserver.observe(document.body,{childList:!0}),this.dispatchEvent("show",void 0)};"loading"!==document.readyState?e():document.addEventListener("readystatechange",e,{once:!0})}}remove(){var e;null==(e=this.mutationObserver)||e.disconnect(),this.mutationObserver=null,this.iframe.remove(),this.dispatchEvent("remove",void 0)}constructor(){super(),eA(this,"iframe",void 0),eA(this,"connection",null),eA(this,"mutationObserver",null);let e=document.createElement("iframe");e.src=c$,this.iframe=e,e.width="0",e.height="0",e.style.width="0",e.style.height="0",e.style.display="none",e.style.visibility="hidden",e.dataset.jamCapture="",e.setAttribute("sandbox","allow-same-origin allow-scripts allow-popups"),e.addEventListener("error",()=>{ej.error("Error loading iframe")}),this.show()}}class cH{static get isInitialized(){return!!cH.instance}static get instance(){return cH._instance}static async initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(cH.isInitialized||document.querySelector(`iframe[src="proxy.php?url=${c$}"]`))throw Error("JamCapture is already initialized");let t=new cH(e);cH._instance=t,t.frameHandle.addEventListener("remove",()=>{cH.instance===t&&(cH._instance=null),eN.disconnect()}),await t.connectToFrame()}async connectToFrame(){let e=(await this.frameHandle.connect({documentId:window[eR].documentId,extractJamMetadata:eG,capture:this.captureHandle.api})).remote;this.captureHandle.connect(e),eN.connect(e.forwardLog)}constructor(e){eA(this,"frameHandle",void 0),eA(this,"captureHandle",void 0);let t=new ty(null==e?void 0:e.blurSelectors);this.frameHandle=new cW,this.captureHandle=new cE(t)}}eA(cH,"_instance",null),async function(){e_(cH,{name:"capture",autoInit(){cH.initialize()}})}()})();var n=s.h;export{n as Capture};