@logspace/sdk 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/logspace.esm.js +83 -1
- package/logspace.esm.js.map +1 -1
- package/logspace.iife.js +1 -1
- package/logspace.iife.js.map +1 -1
- package/logspace.umd.js +1 -1
- package/logspace.umd.js.map +1 -1
- package/package.json +5 -3
- package/shared/types.d.ts +99 -1
- package/README.md +0 -269
package/logspace.iife.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var LogSpace=function(e){"use strict";function t(e){if(e.id)return`#${e.id}`;let t="";if(e.className&&("string"==typeof e.className?t=e.className:e.className&&"object"==typeof e.className&&"baseVal"in e.className&&(t=e.className.baseVal||""),t&&"string"==typeof t)){const r=t.split(" ").filter(e=>e).join(".");if(r)return`${e.tagName.toLowerCase()}.${r}`}return e.tagName.toLowerCase()}function r(e){try{if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);if(null===e)return"null";if(void 0===e)return"undefined";const t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}catch(t){return String(e)}}function s(e){if(!e||"string"!=typeof e)return e;let t=e;const r=[{pattern:/\b(?:\d{4}[-\s]?){3}\d{4}\b/g,replacement:"[CREDIT_CARD_REDACTED]"},{pattern:/\b\d{3}-?\d{2}-?\d{4}\b/g,replacement:"[SSN_REDACTED]"},{pattern:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,replacement:"[EMAIL_REDACTED]"},{pattern:/\b(?:\+?1[-.\s]?)?\(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}\b/g,replacement:"[PHONE_REDACTED]"},{pattern:/"password"\s*:\s*"[^"]*"/gi,replacement:'"password": "[REDACTED]"'},{pattern:/'password'\s*:\s*'[^']*'/gi,replacement:"'password': '[REDACTED]'"},{pattern:/"(?:api_?key|token|secret|auth_?token|access_?token)"\s*:\s*"[^"]*"/gi,replacement:'"$1": "[REDACTED]"'},{pattern:/'(?:api_?key|token|secret|auth_?token|access_?token)'\s*:\s*'[^']*'/gi,replacement:"'$1': '[REDACTED]'"},{pattern:/Authorization:\s*Bearer\s+[^\s]+/gi,replacement:"Authorization: Bearer [REDACTED]"},{pattern:/Authorization:\s*Basic\s+[^\s]+/gi,replacement:"Authorization: Basic [REDACTED]"},{pattern:/\b[A-Za-z0-9-_]{36,}\.[A-Za-z0-9-_]{36,}\.[A-Za-z0-9-_]{36,}\b/g,replacement:"[JWT_TOKEN_REDACTED]"}];for(const{pattern:s,replacement:n}of r)t=t.replace(s,n);return t}function n(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(e,t){if(!e||!t||0===t.length)return!1;try{const r=new URL(e).hostname.toLowerCase(),s=e.toLowerCase();for(const e of t){const t=e.trim();if(t)try{const e=new RegExp(t,"i");if(e.test(r)||e.test(s))return!0}catch{}}}catch{}return!1}function i(){try{const e=(new Error).stack||"";return e.split("\n").slice(3).slice(0,3).join("\n").trim()}catch{return""}}function a(e,t){if(JSON.stringify(e).length<=t)return e;if(Array.isArray(e)){const r=[];let s=2;for(let n=0;n<e.length;n++){const o=JSON.stringify(e[n]).length+(n>0?1:0);if(s+o>t-100){const t=e.length-n;r.push({__logspace_truncated:!0,__remaining_items:t,__original_length:e.length});break}r.push(e[n]),s+=o}return r}if("object"==typeof e&&null!==e){const r={};let s=2;const n=Object.entries(e);for(let e=0;e<n.length;e++){const o=n[e];if(!o)continue;const[i,l]=o,c=JSON.stringify({[i]:l}).length-2+(e>0?1:0);if(s+c>t-150){const t=n.length-e;r.__logspace_truncated=!0,r.__remaining_properties=t;break}if("string"==typeof l&&l.length>1e3)r[i]=l.substring(0,1e3)+"... [truncated]";else if("object"==typeof l&&null!==l){JSON.stringify(l).length>5e3?r[i]=a(l,5e3):r[i]=l}else r[i]=l;s+=c}return r}return e}function l(e,t,s=1e4){if(t){const t=e instanceof ArrayBuffer?e.byteLength:e.size||0;return{content:`[Binary: ${t} bytes]`,size:t,truncated:!0}}const n="string"==typeof e?e:r(e),o=new Blob([n]).size;if(o>s){const e=n.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=a(JSON.parse(n),s);return{content:JSON.stringify(e),size:o,truncated:!0}}catch{}return{content:n.substring(0,s)+"... [truncated]",size:o,truncated:!0}}return{content:n,size:o,truncated:!1}}function c(e,t,r="info"){return{id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),type:e,data:t,severity:r}}let u=null;const h={name:"console",install(e,t){if(!n())return;if(u)return;const s=["log","info","warn","error","debug"],o=t.logLevels||s;u={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug},s.forEach(t=>{console[t]=function(...s){if(u[t].apply(console,s),!o.includes(t))return;if(function(e){if(!e||0===e.length)return!1;for(const r of e){const e=String(r||"");if(e.includes("[LogSpace]")||e.includes("LogSpace"))return!0}const t=String(e[0]||"");return!!(t.includes("[HMR]")||t.includes("hot update")||t.includes("@react-refresh")||t.includes("[vite]")||t.includes("vite:")||t.includes("[webpack-dev-server]")||t.includes("[WDS]")||t.includes("[Fast Refresh]")||t.includes("next-dev"))}(s))return;const n=s.map(e=>r(e));let i;i="error"===t?"error":"warn"===t?"warn":"info";const a=c("console",{level:t,args:n,stackTrace:"error"===t?(new Error).stack:void 0},i);e(a)}})},uninstall(){n()&&u&&(console.log=u.log,console.info=u.info,console.warn=u.warn,console.error=u.error,console.debug=u.debug,u=null)}},d=5e3;let p=null,f=null,m=[],g=null;const y=new Map;function w(e){const t=Date.now();let r=y.get(e);r||(r={lastCapture:0},y.set(e,r));return t-r.lastCapture>=100&&(r.lastCapture=t,!0)}const b={name:"network",install(e,t){if(!n())return;if(p)return;g=e,m=t.excludeUrls||[];const s=t.blockNetworkBodies||[];p=window.fetch,window.fetch=async function(...t){const n=performance.now(),a=t[0],u="string"==typeof a?a:a instanceof Request?a.url:a.toString(),h=t[1]||{},f=h.method||(a instanceof Request?a.method:"GET"),b=i();if(o(u,m))return p(...t);const S=s.some(e=>{try{return new RegExp(e,"i").test(u)}catch{return!1}});let v,C={};if(a instanceof Request&&(C=Object.fromEntries(a.headers.entries())),h.headers){const e=Object.fromEntries(new Headers(h.headers).entries());C={...C,...e}}if(!S&&h.body){const e=r(h.body);v=e.length>d?e.substring(0,d)+"...":e}try{const r=await p(...t),s=performance.now()-n,o=r.headers.get("content-type")||"unknown",i=r.headers.get("content-length"),a=r.clone();let h,m,I;try{if(!S&&(o.includes("application/json")||o.includes("text/plain")||o.includes("text/html"))){const e=await a.text();h=e.length>d?e.substring(0,d)+"...":e,m=new Blob([h]).size}else i&&(m=parseInt(i,10))}catch{}I=r.status>=500?"error":r.status>=400?"warn":"info";const k=o.includes("text/event-stream"),x=c("network",{method:f,url:u,status:r.status,requestHeaders:C,responseHeaders:Object.fromEntries(r.headers.entries()),requestBody:v,responseBody:k?void 0:h,contentType:o,contentLength:m,duration:s,timestamp:Date.now(),initiator:b,isSSEStream:k},I);if(e(x),k&&r.body&&g){const t=c("sse",{url:u,event:"open",timestamp:Date.now()});return e(t),function(e,t,r){if(!e.body)return e;const s=e.body.getReader(),n=new TextDecoder;let o="",i={data:[]};const a=new ReadableStream({async start(e){try{for(;;){const{done:a,value:u}=await s.read();if(a){e.close(),y.delete(t);break}e.enqueue(u),o+=n.decode(u,{stream:!0});const h=o.split("\n");o=h.pop()||"";for(const e of h){if(""===e.trim()){if(i.data.length>0&&w(t)){const e=i.data.join("\n"),{content:s,size:n}=l(e,!1),o=c("sse",{url:t,event:"message",eventType:i.event||"message",message:s,messageSize:n,lastEventId:i.id,timestamp:Date.now()});r(o)}i={data:[]};continue}const s=e.indexOf(":");if(-1===s)continue;const n=e.slice(0,s),o=e.slice(s+1).trimStart();switch(n){case"data":i.data.push(o);break;case"event":i.event=o;break;case"id":i.id=o}}}}catch(a){e.error(a),y.delete(t)}},cancel(){s.cancel(),y.delete(t)}});return new Response(a,{headers:e.headers,status:e.status,statusText:e.statusText})}(r,u,g)}return r}catch(I){const t=performance.now()-n;let r="Unknown error";if(I instanceof TypeError){r=I.message;try{new URL(u,window.location.href).origin!==window.location.origin&&(r=`${r} - CORS policy may be blocking this request`)}catch{}}else I instanceof Error&&(r=I.message);const s=c("network",{method:f,url:u,status:0,requestHeaders:C,responseHeaders:{},requestBody:v,duration:t,timestamp:Date.now(),initiator:b,error:r},"error");throw e(s),I}},f=window.XMLHttpRequest,window.XMLHttpRequest=function(){const t=new f,s=performance.now(),n=i();let a,l="",u="";const h={},p=t.open;t.open=function(e,t,...r){return l=e,u=t,p.apply(this,[e,t,...r])};const g=t.setRequestHeader;t.setRequestHeader=function(e,t){return h[e]=t,g.apply(this,[e,t])};const y=t.send;let w;return t.send=function(e){if(e&&!o(u,m)){const t=r(e);a=t.length>d?t.substring(0,d)+"...":t}return y.apply(this,[e])},t.addEventListener("error",()=>{w="Network request failed"}),t.addEventListener("timeout",()=>{w="Request timeout"}),t.addEventListener("abort",()=>{w="Request aborted"}),t.addEventListener("loadend",()=>{if(o(u,m))return;const i=performance.now()-s,p=t.getResponseHeader("content-type")||"unknown",f=t.getResponseHeader("content-length"),g={},y=t.getAllResponseHeaders();let b,S,v;if(y&&y.split("\r\n").forEach(e=>{const t=e.split(": "),r=t.shift(),s=t.join(": ");r&&s&&(g[r.toLowerCase()]=s)}),p.includes("application/json")||p.includes("text/plain")||p.includes("text/html"))try{let e;e=""===t.responseType||"text"===t.responseType?t.responseText:"json"===t.responseType&&t.response?r(t.response):"",e&&(b=e.length>d?e.substring(0,d)+"...":e,S=new Blob([b]).size)}catch{}else f&&(S=parseInt(f,10));v=t.status>=500||w?"error":t.status>=400?"warn":"info";const C=c("network",{method:l,url:u,status:t.status,requestHeaders:h,responseHeaders:g,requestBody:a,responseBody:b,contentType:p,contentLength:S,duration:i,timestamp:Date.now(),initiator:n,...w&&{error:w}},v);e(C)}),t},window.XMLHttpRequest.prototype=f.prototype},uninstall(){n()&&(p&&(window.fetch=p,p=null),f&&(window.XMLHttpRequest=f,f=null),g=null,y.clear())}};let S=null,v=null;const C={name:"errors",install(e,t){n()&&(S||(S=t=>{const r=c("error",{message:t.message,stack:`${t.filename}:${t.lineno}:${t.colno}`,context:{},isUncaught:!0},"error");e(r)},window.addEventListener("error",S,!0),v=t=>{const s=c("error",{message:`Unhandled Promise Rejection: ${r(t.reason)}`,stack:t.reason?.stack||"",context:{},isUncaught:!0},"error");e(s)},window.addEventListener("unhandledrejection",v)))},uninstall(){n()&&(S&&(window.removeEventListener("error",S,!0),S=null),v&&(window.removeEventListener("unhandledrejection",v),v=null))}};let I=null,k=[];const x=new Map;function E(e,t){const r=Date.now();let s=x.get(e);s||(s={sent:{lastCapture:0,messageCount:0,sampleRate:1},received:{lastCapture:0,messageCount:0,sampleRate:1}},x.set(e,s));const n=s[t],o=r-n.lastCapture;if(n.lastCapture>0&&r-n.lastCapture<1e3){n.messageCount++;const e=n.messageCount/((r-n.lastCapture)/1e3);n.sampleRate=e>50?.1:e>10?.5:1}else n.messageCount=1,n.sampleRate=1;const i=o>=100&&(n.sampleRate>=1||Math.random()<n.sampleRate);return i&&(n.lastCapture=r),i}const O={name:"websocket",install(e,t){if(!n())return;if(I)return;k=t.excludeUrls||[],I=window.WebSocket,window.WebSocket=function(t,r){const s=new I(t,r),n=t.toString();if(o(n,k))return s;s.addEventListener("open",()=>{const t=c("websocket",{url:n,event:"open",readyState:s.readyState,timestamp:Date.now()});e(t)}),s.addEventListener("message",t=>{if(!E(s,"received"))return;const r=t.data instanceof ArrayBuffer||t.data instanceof Blob,{content:o,size:i}=l(t.data,r),a=c("websocket",{url:n,event:"message",direction:"received",message:o,messageSize:i,isBinary:r,readyState:s.readyState,timestamp:Date.now()});e(a)});const i=s.send.bind(s);return s.send=function(t){if(E(s,"sent")){const r=t instanceof ArrayBuffer||t instanceof Blob,{content:o,size:i}=l(t,r),a=c("websocket",{url:n,event:"message",direction:"sent",message:o,messageSize:i,isBinary:r,readyState:s.readyState,timestamp:Date.now()});e(a)}return i(t)},s.addEventListener("error",()=>{const t=c("websocket",{url:n,event:"error",readyState:s.readyState,timestamp:Date.now()},"error");e(t)}),s.addEventListener("close",t=>{const r=c("websocket",{url:n,event:"close",code:t.code,reason:t.reason,readyState:s.readyState,timestamp:Date.now()});e(r),x.delete(s)}),s},window.WebSocket.prototype=I.prototype,Object.setPrototypeOf(window.WebSocket,I);["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(e=>{Object.defineProperty(window.WebSocket,e,{value:I[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){n()&&I&&(window.WebSocket=I,I=null,x.clear())}};let M=null,L=[];const A=new Map;const R={name:"sse",install(e,t){if(!n())return;if(!window.EventSource)return;if(M)return;L=t.excludeUrls||[],M=window.EventSource,window.EventSource=function(t,r){const s=new M(t,r),n=t.toString();return o(n,L)||(s.addEventListener("open",()=>{const t=c("sse",{url:n,event:"open",readyState:s.readyState,timestamp:Date.now()});e(t)}),s.addEventListener("message",t=>{if(!function(e){const t=Date.now();let r=A.get(e);return r||(r={lastCapture:0},A.set(e,r)),t-r.lastCapture>=100&&(r.lastCapture=t,!0)}(s))return;const{content:r,size:o}=l(t.data,!1),i=c("sse",{url:n,event:"message",message:r,messageSize:o,lastEventId:t.lastEventId,readyState:s.readyState,timestamp:Date.now()});e(i)}),s.addEventListener("error",()=>{const t=c("sse",{url:n,event:"error",readyState:s.readyState,timestamp:Date.now()},"error");e(t),s.readyState===EventSource.CLOSED&&A.delete(s)})),s},window.EventSource.prototype=M.prototype,Object.setPrototypeOf(window.EventSource,M);["CONNECTING","OPEN","CLOSED"].forEach(e=>{Object.defineProperty(window.EventSource,e,{value:M[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){n()&&M&&(window.EventSource=M,M=null,A.clear())}},T=5e3;let N=null,D=null,P=!1,F=null;function _(e){const t="string"==typeof e?e:r(e),s=new Blob([t]).size;if(s>T){const e=t.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=a(JSON.parse(t),T);return{content:JSON.stringify(e),size:s}}catch{}return{content:t.substring(0,T)+"... [truncated]",size:s}}return{content:t,size:s}}const B={name:"storage",install(e,t){n()&&(N||(F=e,N={setItem:Storage.prototype.setItem,removeItem:Storage.prototype.removeItem,clear:Storage.prototype.clear},Storage.prototype.setItem=function(t,r){const s=this===sessionStorage;if(P||t.startsWith("__logspace"))return N.setItem.call(this,t,r);const n=this.getItem(t),o=N.setItem.call(this,t,r);try{P=!0;const o=s?"sessionStorage":"localStorage",{content:i,size:a}=_(r),l=c("storage",{storageType:o,operation:"setItem",key:t,value:i,oldValue:n?_(n).content:void 0,valueSize:a});e(l)}finally{P=!1}return o},Storage.prototype.removeItem=function(t){const r=this===sessionStorage;if(P||t.startsWith("__logspace"))return N.removeItem.call(this,t);const s=this.getItem(t),n=N.removeItem.call(this,t);P=!0;try{const n=c("storage",{storageType:r?"sessionStorage":"localStorage",operation:"removeItem",key:t,oldValue:s?_(s).content:void 0});e(n)}finally{P=!1}return n},Storage.prototype.clear=function(){const t=this===sessionStorage,r=N.clear.call(this);if(P)return r;P=!0;try{const r=c("storage",{storageType:t?"sessionStorage":"localStorage",operation:"clear"});e(r)}finally{P=!1}return r},window.IDBDatabase&&(D=IDBDatabase.prototype.transaction,IDBDatabase.prototype.transaction=function(e,t,...r){const s=D.call(this,e,t,...r),n=this.name;if("logspace-sdk-db"===n)return s;if(F&&!P){const r=c("storage",{storageType:"indexedDB",operation:"readwrite"===t?"setItem":"getItem",dbName:n,storeName:Array.isArray(e)?e.join(", "):e});F(r)}return s})))},uninstall(){n()&&(N&&(Storage.prototype.setItem=N.setItem,Storage.prototype.removeItem=N.removeItem,Storage.prototype.clear=N.clear,N=null),D&&window.IDBDatabase&&(IDBDatabase.prototype.transaction=D,D=null),F=null)}};let z,U=null,j=null,W=null,V=null;const $={name:"interactions",install(e,r){if(!n())return;if(U)return;const o=r.maskSelectors||[];function i(e){return 0!==o.length&&o.some(t=>{try{return e.matches(t)||e.closest(t)}catch{return!1}})}U=n=>{const o=n.target;if(!o)return;let a=o.textContent?.substring(0,100);r.maskSensitiveData&&a&&(a=s(a)),i(o)&&(a="[MASKED]");const l=c("interaction",{eventType:"click",element:{selector:t(o),tagName:o.tagName,text:a},coordinates:{x:n.clientX,y:n.clientY}});e(l)},document.addEventListener("click",U,!0),j=n=>{const o=n.target;if(!o||"INPUT"!==o.tagName&&"TEXTAREA"!==o.tagName)return;const a="password"===o.type||o.name?.toLowerCase().includes("password")||o.name?.toLowerCase().includes("credit")||o.name?.toLowerCase().includes("ssn")||o.autocomplete?.includes("current-password")||o.autocomplete?.includes("new-password")||i(o);let l=o.value;r.maskSensitiveData&&(l=a?"[SENSITIVE_INPUT_REDACTED]":s(l));const u=c("interaction",{eventType:"input",element:{selector:t(o),tagName:o.tagName},value:l});e(u)},document.addEventListener("input",j,!0),W=r=>{const s=r.target;if(!s)return;const n=c("interaction",{eventType:"submit",element:{selector:t(s),tagName:s.tagName}});e(n)},document.addEventListener("submit",W,!0),V=()=>{clearTimeout(z),z=setTimeout(()=>{const t=c("interaction",{eventType:"scroll",element:{selector:"document",tagName:"document"},coordinates:{x:window.scrollX,y:window.scrollY}});e(t)},500)},document.addEventListener("scroll",V,!0)},uninstall(){n()&&(U&&(document.removeEventListener("click",U,!0),U=null),j&&(document.removeEventListener("input",j,!0),j=null),W&&(document.removeEventListener("submit",W,!0),W=null),V&&(document.removeEventListener("scroll",V,!0),V=null),z&&clearTimeout(z))}};let G=null,J=null,Z=null,Y=null,H=null;const X={lcp:null,fid:null,cls:0,fcp:null,ttfb:null,inp:null,clsEntries:[],sent:!1};let K=null;function q(e,t){const r={LCP:{good:2500,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1800,poor:3e3},TTFB:{good:800,poor:1800},INP:{good:200,poor:500}}[e];return r?t<=r.good?"good":t<=r.poor?"needs-improvement":"poor":"good"}function Q(){if(X.sent||!K)return;if(!(null!==X.lcp||null!==X.fcp||null!==X.ttfb||null!==X.fid||null!==X.inp||X.cls>0))return;X.sent=!0;const e={};null!==X.lcp&&(e.LCP={value:X.lcp,rating:q("LCP",X.lcp)}),null!==X.fid&&(e.FID={value:X.fid,rating:q("FID",X.fid)}),X.cls>0&&(e.CLS={value:X.cls,rating:q("CLS",X.cls)}),null!==X.fcp&&(e.FCP={value:X.fcp,rating:q("FCP",X.fcp)}),null!==X.ttfb&&(e.TTFB={value:X.ttfb,rating:q("TTFB",X.ttfb)}),null!==X.inp&&(e.INP={value:X.inp,rating:q("INP",X.inp)});const t=c("performance",{metric:"Web Vitals",vitals:e});K(t)}const ee={name:"performance",install(e,t){if(n()&&"PerformanceObserver"in window&&!G){K=e;try{G=new PerformanceObserver(e=>{const t=e.getEntries(),r=t[t.length-1];X.lcp=r.renderTime||r.loadTime}),G.observe({type:"largest-contentful-paint",buffered:!0}),J=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{null===X.fid&&(X.fid=e.processingStart-e.startTime)})}),J.observe({type:"first-input",buffered:!0}),Z=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{X.clsEntries.push(e),X.cls=function(e){let t=0,r=[];return e.forEach(e=>{if(!e.hadRecentInput){const s=r[0],n=r[r.length-1];t&&n&&e.startTime-n.startTime<1e3&&e.startTime-s.startTime<5e3?(t+=e.value,r.push(e)):(t=e.value,r=[e])}}),t}(X.clsEntries)})}),Z.observe({type:"layout-shift",buffered:!0}),Y=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"first-contentful-paint"===e.name&&(X.fcp=e.startTime)})}),Y.observe({type:"paint",buffered:!0});try{H=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{const t=e.processingEnd-e.startTime;(null===X.inp||t>X.inp)&&(X.inp=t)})}),H.observe({type:"event",buffered:!0,durationThreshold:16})}catch{}window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&Q()}),window.addEventListener("load",()=>{setTimeout(()=>{!function(){if(!K)return;const e=performance.getEntriesByType("navigation");if(0===e.length)return;const t=e[0];X.ttfb=t.responseStart-t.requestStart;const r=c("performance",{metric:"Navigation",timing:{ttfb:Math.round(X.ttfb),dnsLookup:Math.round(t.domainLookupEnd-t.domainLookupStart),tcpConnection:Math.round(t.connectEnd-t.connectStart),domContentLoaded:Math.round(t.domContentLoadedEventEnd-t.startTime),pageLoad:Math.round(t.loadEventEnd-t.startTime)}});K(r)}()},0)}),setTimeout(()=>{Q()},1e4)}catch{}}},uninstall(){n()&&([G,J,Z,Y,H].forEach(e=>{e&&e.disconnect()}),G=null,J=null,Z=null,Y=null,H=null,K=null,X.lcp=null,X.fid=null,X.cls=0,X.fcp=null,X.ttfb=null,X.inp=null,X.clsEntries=[],X.sent=!1)}};let te=null,re=[];const se=new Set;let ne=null;function oe(e){if(!ne)return;if("resource"!==e.entryType)return;if("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)return;const t=`${e.name}-${e.startTime}`;if(se.has(t))return;if(se.add(t),o(e.name,re))return;const r=function(e){const t=e.initiatorType||"other",r=e.name;return r.match(/\.(woff|woff2|ttf|otf|eot)(\?|$)/i)?"font":r.match(/\.(css)(\?|$)/i)?"stylesheet":r.match(/\.(js|mjs|jsx|ts|tsx)(\?|$)/i)?"script":r.match(/\.(png|jpg|jpeg|gif|webp|svg|ico|avif|bmp)(\?|$)/i)?"image":r.match(/\.(mp4|webm|ogg|mp3|wav|m4a|aac|flac)(\?|$)/i)?"media":"xmlhttprequest"===t||"fetch"===t?t:"link"===t?"stylesheet":"script"===t?"script":"img"===t?"image":t}(e),s=e.duration,n=e.transferSize||0,i=e.decodedBodySize||0,a=e.encodedBodySize||0,l=0===n||a>0&&n<a;let u="info";s>3e3?u="error":s>1e3&&(u="warn");const h=c("network",{method:"GET",url:e.name,status:200,resourceType:r,initiatorType:e.initiatorType,duration:Math.round(s),transferSize:n,decodedBodySize:i,encodedBodySize:a,cached:l,timing:{dns:Math.round(e.domainLookupEnd-e.domainLookupStart),tcp:Math.round(e.connectEnd-e.connectStart),ssl:e.secureConnectionStart>0?Math.round(e.connectEnd-e.secureConnectionStart):0,request:Math.round(e.responseStart-e.requestStart),response:Math.round(e.responseEnd-e.responseStart)},timestamp:Date.now()},u);ne(h)}const ie={name:"resources",install(e,t){if(n()&&"PerformanceObserver"in window&&!te){ne=e,re=t.excludeUrls||[];try{performance.getEntriesByType("resource").forEach(e=>{oe(e)}),te=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{oe(e)})}),te.observe({type:"resource",buffered:!1})}catch{}}},uninstall(){n()&&(te&&(te.disconnect(),te=null),ne=null)},reset(){se.clear()}};let ae=null,le=null,ce=null,ue="",he=0,de=null,pe=null,fe=null;function me(e="client-side"){const t=location.href;t!==ue&&function(e,t,r){if(!ce||e===t)return;const s=performance.now()-he,n=c("performance",{metric:"SPA Navigation",from:e,to:t,duration:Math.round(s),navigationType:r,timestamp:Date.now()});ce(n),ue=t,he=performance.now()}(ue,t,e)}const ge={name:"spa-navigation",install(e,t){if(n()&&!ae){if(ce=e,ue=location.href,he=performance.now(),ae=history.pushState,le=history.replaceState,history.pushState=function(...e){const t=ae.apply(this,e);return me("pushState"),t},history.replaceState=function(...e){const t=le.apply(this,e);return me("replaceState"),t},fe=()=>{me("popstate")},window.addEventListener("popstate",fe),de=new MutationObserver(()=>{pe&&clearTimeout(pe),pe=setTimeout(()=>{me("dom-mutation")},100)}),document.body)de.observe(document.body,{childList:!0,subtree:!0});else{const e=new MutationObserver(()=>{document.body&&(de.observe(document.body,{childList:!0,subtree:!0}),e.disconnect())});e.observe(document.documentElement,{childList:!0})}window.addEventListener("hashchange",()=>{he=performance.now(),me("hashchange")})}},uninstall(){n()&&(ae&&(history.pushState=ae,ae=null),le&&(history.replaceState=le,le=null),fe&&(window.removeEventListener("popstate",fe),fe=null),de&&(de.disconnect(),de=null),pe&&(clearTimeout(pe),pe=null),ce=null,ue="",he=0)}};var ye,we=Object.defineProperty,be=(e,t,r)=>((e,t,r)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Se=Object.defineProperty,ve=(e,t,r)=>((e,t,r)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ce=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ce||{});const Ie={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ke={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xe={};function Ee(e){if(xe[e])return xe[e];const t=globalThis[e],r=t.prototype,s=e in Ie?Ie[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in ke?ke[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return xe[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?xe[e]=o:r}catch{return r}}const Oe={};function Me(e,t,r){var s;const n=`${e}.${String(r)}`;if(Oe[n])return Oe[n].call(t);const o=Ee(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(Oe[n]=i,i.call(t)):t[r]}const Le={};function Ae(e,t,r){const s=`${e}.${String(r)}`;if(Le[s])return Le[s].bind(t);const n=Ee(e)[r];return"function"!=typeof n?t[r]:(Le[s]=n,n.bind(t))}const Re={childNodes:function(e){return Me("Node",e,"childNodes")},parentNode:function(e){return Me("Node",e,"parentNode")},parentElement:function(e){return Me("Node",e,"parentElement")},textContent:function(e){return Me("Node",e,"textContent")},contains:function(e,t){return Ae("Node",e,"contains")(t)},getRootNode:function(e){return Ae("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Me("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Me("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Me("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Me("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ee("MutationObserver").constructor}};function Te(e){return e.nodeType===e.ELEMENT_NODE}function Ne(e){const t=e&&"host"in e&&"mode"in e&&Re.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Re.shadowRoot(t)===e)}function De(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Pe(e){try{const r=e.rules||e.cssRules;if(!r)return null;let s=e.href;!s&&e.ownerNode&&e.ownerNode.ownerDocument&&(s=e.ownerNode.ownerDocument.location.href);const n=Array.from(r,e=>Fe(e,s)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(r){return null}var t}function Fe(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Pe(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?Ze(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?Ze(r,t):r}}class _e{constructor(){ve(this,"idNodeMap",new Map),ve(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const 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 Be({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:o}){let i=n||"";const a=s&&ze(s);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function ze(e){return e.toLowerCase()}const Ue="__rrweb_original__";function je(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ze(t):null}function We(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(n){return null}const s=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}const Ve=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$e=/^(?:[a-z+]+:)?\/\//i,Ge=/^www\..*/i,Je=/^(data:)([^,]*),(.*)/i;function Ze(e,t){return(e||"").replace(Ve,(e,r,s,n,o,i)=>{const a=s||o||i,l=r||n||"";if(!a)return e;if($e.test(a)||Ge.test(a))return`url(${l}${a}${l})`;if(Je.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const t of u)"."!==t&&(".."===t?c.pop():c.push(t));return`url(${l}${c.join("/")}${l})`})}function Ye(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function He(e,t){return function(e,t){const r=Array.from(t.childNodes),s=[];if(r.length>1&&e&&"string"==typeof e){const t=Ye(e);for(let n=1;n<r.length;n++)if(r[n].textContent&&"string"==typeof r[n].textContent){const o=Ye(r[n].textContent);for(let r=3;r<o.length;r++){const n=o.substring(0,r);if(2===t.split(n).length){const r=t.indexOf(n);for(let t=r;t<e.length;t++)if(Ye(e.substring(0,t)).length===r){s.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}let Xe=1;const Ke=new RegExp("[^a-z0-9-_:]");function qe(){return Xe++}let Qe,et;const tt=/^[^ \t\n\r\u000c]+/,rt=/^[, \t\n\r\u000c]+/;const st=new WeakMap;function nt(e,t){return t&&""!==t.trim()?it(e,t):t}function ot(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function it(e,t){let r=st.get(e);if(r||(r=e.createElement("a"),st.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function at(e,t,r,s){return s?"src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0]?nt(e,s):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function s(e){let s;const n=e.exec(t.substring(r));return n?(s=n[0],r+=s.length,s):""}const n=[];for(;s(rt),!(r>=t.length);){let o=s(tt);if(","===o.slice(-1))o=nt(e,o.substring(0,o.length-1)),n.push(o);else{let s="";o=nt(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){n.push((o+s).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,n.push((o+s).trim());break}"("===e&&(i=!0)}s+=e,r+=1}}}return n.join(", ")}(e,s):"style"===r?Ze(s,it(e)):"object"===t&&"data"===r?nt(e,s):s:nt(e,s):s}function lt(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ct(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ct(Re.parentNode(e),t,r);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!r&&ct(Re.parentNode(e),t,r)}function ut(e,t,r,s){let n;if(Te(e)){if(n=e,!Re.childNodes(n).length)return!1}else{if(null===Re.parentElement(e))return!1;n=Re.parentElement(e)}try{if("string"==typeof t){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(ct(n,t,s))return!0;if(r)if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(o){}return!1}function ht(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ce.Document,childNodes:[],compatMode:e.compatMode}:{type:Ce.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ce.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:s,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}if(r)return e.matches(r)}catch(s){}return!1}(e,s,n),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=ze(e.tagName);return Ke.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let S=0;S<y;S++){const t=e.attributes[S];lt(m,t.name,t.value)||(g[t.name]=at(r,m,ze(t.name),t.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let s=null;t&&(s=Pe(t)),s&&(delete g.rel,delete g.href,g._cssText=s)}if("style"===m&&e.sheet){let t=Pe(e.sheet);t&&(e.childNodes.length>1&&(t=He(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Be({element:e,type:je(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let s=0;s<e.height;s+=50){const n=t.getImageData,o=Ue in n?n[Ue]:n;if(new Uint32Array(o.call(t,r,s,Math.min(50,e.width-r),Math.min(50,e.height-s)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),s=r.createElement("canvas");s.width=e.width,s.height=e.height;t!==s.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){Qe||(Qe=r.createElement("canvas"),et=Qe.getContext("2d"));const t=e,s=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Qe.width=t.naturalWidth,Qe.height=t.naturalHeight,et.drawImage(t,0,0),g.rr_dataURL=Qe.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${s}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?g.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||h(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(b){}return{type:Ce.Element,tagName:m,attributes:g,childNodes:[],isSVG:ot(e)||void 0,needBlock:f,rootId:p,isCustom:w}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:o}=t,i=Re.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":o||(l=Re.textContent(e),c&&l&&(l=Ze(l,it(t.doc))));!c&&!u&&l&&r&&(l=s?s(l,Re.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Ce.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Ce.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Ce.Comment,textContent:Re.textContent(e)||"",rootId:y};default:return!1}}function dt(e){return null==e?"":e.toLowerCase()}function pt(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:k=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:E=!0}=t;if(!x){x=ut(e,i,a,void 0===x)}const O=ht(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!O)return console.warn(e,"not serialized"),null;let M;M=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===Ce.Comment)return!0;if(e.type===Ce.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"===We(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(dt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===dt(e.attributes.name)||"icon"===dt(e.attributes.rel)||"apple-touch-icon"===dt(e.attributes.rel)||"shortcut icon"===dt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&dt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(dt(e.attributes.property).match(/^(og|twitter|fb):/)||dt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===dt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===dt(e.attributes.name)||"googlebot"===dt(e.attributes.name)||"bingbot"===dt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===dt(e.attributes.name)||"generator"===dt(e.attributes.name)||"framework"===dt(e.attributes.name)||"publisher"===dt(e.attributes.name)||"progid"===dt(e.attributes.name)||dt(e.attributes.property).match(/^article:/)||dt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===dt(e.attributes.name)||"yandex-verification"===dt(e.attributes.name)||"csrf-token"===dt(e.attributes.name)||"p:domain_verify"===dt(e.attributes.name)||"verify-v1"===dt(e.attributes.name)||"verification"===dt(e.attributes.name)||"shopify-checkout-api-token"===dt(e.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===Ce.Text&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:qe();const L=Object.assign(O,{id:M});if(s.add(e,L),-2===M)return null;y&&y(e);let A=!l;if(L.type===Ce.Element){A=A&&!L.needBlock,delete L.needBlock;const t=Re.shadowRoot(e);t&&De(t)&&(L.isShadowHost=!0)}if((L.type===Ce.Document||L.type===Ce.Element)&&A){p.headWhitespace&&L.type===Ce.Element&&"head"===L.tagName&&(E=!1);const t={doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C,cssCaptured:!1};if(L.type===Ce.Element&&"textarea"===L.tagName&&void 0!==L.attributes.value);else{L.type===Ce.Element&&void 0!==L.attributes._cssText&&"string"==typeof L.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Re.childNodes(e))){const e=pt(r,t);e&&L.childNodes.push(e)}}let I=null;if(Te(e)&&(I=Re.shadowRoot(e)))for(const e of Array.from(Re.childNodes(I))){const r=pt(e,t);r&&(De(I)&&(r.isShadow=!0),L.childNodes.push(r))}}const R=Re.parentNode(e);return R&&Ne(R)&&De(R)&&(L.isShadow=!0),L.type===Ce.Element&&"iframe"===L.tagName&&function(e,t,r){const s=e.contentWindow;if(!s)return;let n,o=!1;try{n=s.document.readyState}catch(a){return}if("complete"!==n){const s=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(s),o=!0,t()})}const i="about:blank";if(s.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const r=pt(t,{doc:t,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C});r&&w(e,r)}},b),L.type===Ce.Element&&"link"===L.tagName&&"string"==typeof L.attributes.rel&&("stylesheet"===L.attributes.rel||"preload"===L.attributes.rel&&"string"==typeof L.attributes.href&&"css"===We(L.attributes.href))&&function(e,t,r){let s,n=!1;try{s=e.sheet}catch(i){return}if(s)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(S){const t=pt(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C});t&&S(e,t)}},v),L}function ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mt(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}var gt={exports:{}},yt=String,wt=function(){return{isColorSupported:!1,reset:yt,bold:yt,dim:yt,italic:yt,underline:yt,inverse:yt,hidden:yt,strikethrough:yt,black:yt,red:yt,green:yt,yellow:yt,blue:yt,magenta:yt,cyan:yt,white:yt,gray:yt,bgBlack:yt,bgRed:yt,bgGreen:yt,bgYellow:yt,bgBlue:yt,bgMagenta:yt,bgCyan:yt,bgWhite:yt}};gt.exports=wt(),gt.exports.createColors=wt;var bt=gt.exports;const St=mt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let vt=bt,Ct=St,It=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==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:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=vt.isColorSupported),Ct&&e&&(t=Ct(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=vt.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var kt=It;It.default=It;var xt={};xt.isClean=Symbol("isClean"),xt.my=Symbol("my");const Et={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ot=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;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Et[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=Et[r]),o.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,t.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,r.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,r.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&&(t=e.raws.between,void 0!==t))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,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(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=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let 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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Mt=Ot;Ot.default=Ot;let Lt=Mt;function At(e,t){new Lt(t).stringify(e)}var Rt=At;At.default=At;let{isClean:Tt,my:Nt}=xt,Dt=kt,Pt=Mt,Ft=Rt;function _t(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>_t(e,r)):("object"===o&&null!==n&&(n=_t(n)),r[s]=n)}return r}let Bt=class{constructor(e={}){this.raws={},this[Tt]=!1,this[Nt]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of 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=_t(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 Dt(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[Tt]){this[Tt]=!1;let e=this;for(;e=e.parent;)e[Tt]=!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 o=0;o<e;o++)"\n"===r[o]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Pt).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))r[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)r[o]=e.toJSON(null,t);else if("source"===o){let s=t.get(e.input);null==s&&(s=n,t.set(e.input,n),n++),r[o]={end:e.end,inputId:s,start:e.start}}else r[o]=e}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=Ft){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let n in r)s[n]=r[n];return e.warn(t,s)}get proxyOf(){return this}};var zt=Bt;Bt.default=Bt;let Ut=zt,jt=class extends Ut{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Wt=jt;jt.default=jt;var Vt={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:$t,SourceMapGenerator:Gt}=St,{existsSync:Jt,readFileSync:Zt}=St,{dirname:Yt,join:Ht}=St;let Xt=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=Yt(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new $t(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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=Yt(e),Jt(e))return this.mapFile=e,Zt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof $t)return Gt.fromSourceMap(t).toString();if(t instanceof Gt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Ht(Yt(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Kt=Xt;Xt.default=Xt;let{SourceMapConsumer:qt,SourceMapGenerator:Qt}=St,{fileURLToPath:er,pathToFileURL:tr}=St,{isAbsolute:rr,resolve:sr}=St,{nanoid:nr}=Vt,or=St,ir=kt,ar=Kt,lr=Symbol("fromOffsetCache"),cr=Boolean(qt&&Qt),ur=Boolean(sr&&rr),hr=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ur||/^\w+:\/\//.test(t.from)||rr(t.from)?this.file=t.from:this.file=sr(t.from)),ur&&cr){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="<input css "+nr(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;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);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new ir(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 ir(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(tr&&(n.input.url=tr(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[lr])r=this[lr];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[lr]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:sr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=rr(a.source)?tr(a.source):new URL(a.source,this.map.consumer().sourceRoot||tr(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!er)throw new Error("file: protocol is not available in this PostCSS build");l.file=er(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var dr=hr;hr.default=hr,or&&or.registerInput&&or.registerInput(hr);let{SourceMapConsumer:pr,SourceMapGenerator:fr}=St,{dirname:mr,relative:gr,resolve:yr,sep:wr}=St,{pathToFileURL:br}=St,Sr=dr,vr=Boolean(pr&&fr),Cr=Boolean(mr&&yr&&gr&&wr);var Ir=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||mr(e.file);!1===this.mapOpts.sourcesContent?(t=new pr(e.text),t.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--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Cr&&vr&&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=fr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new fr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new fr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?mr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=mr(yr(r,this.mapOpts.annotation)));let s=gr(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 Sr(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)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(br){let t=br(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===wr&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let kr=zt,xr=class extends kr{constructor(e){super(e),this.type="comment"}};var Er=xr;xr.default=xr;let Or,Mr,Lr,Ar,{isClean:Rr,my:Tr}=xt,Nr=Wt,Dr=Er,Pr=zt;function Fr(e){return e.map(e=>(e.nodes&&(e.nodes=Fr(e.nodes)),delete e.source,e))}function _r(e){if(e[Rr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)_r(t)}let Br=class e extends Pr{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,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();s=this.index(e);for(let o of n)this.proxyOf.nodes.splice(s+1,0,o);for(let o in this.indexes)r=this.indexes[o],s<r&&(this.indexes[o]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let i of o)this.proxyOf.nodes.splice(s,0,i);for(let i in this.indexes)r=this.indexes[i],s<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Fr(Or(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Nr(t)]}else if(t.selector)t=[new Mr(t)];else if(t.name)t=[new Lr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dr(t)]}return t.map(t=>(t[Tr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Rr]&&_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){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(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(n){throw t.addToError(n)}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]}};Br.registerParse=e=>{Or=e},Br.registerRule=e=>{Mr=e},Br.registerAtRule=e=>{Lr=e},Br.registerRoot=e=>{Ar=e};var zr=Br;Br.default=Br,Br.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Lr.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mr.prototype):"decl"===e.type?Object.setPrototypeOf(e,Nr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ar.prototype),e[Tr]=!0,e.nodes&&e.nodes.forEach(e=>{Br.rebuild(e)})};let Ur,jr,Wr=zr,Vr=class extends Wr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ur(new jr,this,e).stringify()}};Vr.registerLazyResult=e=>{Ur=e},Vr.registerProcessor=e=>{jr=e};var $r=Vr;Vr.default=Vr;let Gr={};var Jr=function(e){Gr[e]||(Gr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Zr=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 r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Yr=Zr;Zr.default=Zr;let Hr=Yr,Xr=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 Hr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Kr=Xr;Xr.default=Xr;const qr="'".charCodeAt(0),Qr='"'.charCodeAt(0),es="\\".charCodeAt(0),ts="/".charCodeAt(0),rs="\n".charCodeAt(0),ss=" ".charCodeAt(0),ns="\f".charCodeAt(0),os="\t".charCodeAt(0),is="\r".charCodeAt(0),as="[".charCodeAt(0),ls="]".charCodeAt(0),cs="(".charCodeAt(0),us=")".charCodeAt(0),hs="{".charCodeAt(0),ds="}".charCodeAt(0),ps=";".charCodeAt(0),fs="*".charCodeAt(0),ms=":".charCodeAt(0),gs="@".charCodeAt(0),ys=/[\t\n\f\r "#'()/;[\\\]{}]/g,ws=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bs=/.[\r\n"'(/\\]/,Ss=/[\da-f]/i;let vs=zr,Cs=class extends vs{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Is=Cs;Cs.default=Cs,vs.registerAtRule(Cs);let ks,xs,Es=zr,Os=class extends Es{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 n of s)n.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 ks(new xs,this,e).stringify()}};Os.registerLazyResult=e=>{ks=e},Os.registerProcessor=e=>{xs=e};var Ms=Os;Os.default=Os,Es.registerRoot(Os);let Ls={comma:e=>Ls.split(e,[","],!0),space:e=>Ls.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?i+=1:")"===u?i>0&&(i-=1):0===i&&t.includes(u)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=u;return(r||""!==n)&&s.push(n.trim()),s}};var As=Ls;Ls.default=Ls;let Rs=zr,Ts=As,Ns=class extends Rs{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ts.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)}};var Ds=Ns;Ns.default=Ns,Rs.registerRule(Ns);let Ps=Wt,Fs=function(e,t={}){let r,s,n,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.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=d.charCodeAt(m),r){case rs:case ss:case os:case is:case ns:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===ss||r===rs||r===os||r===is||r===ns);h=["space",d.slice(m,s)],m=s-1;break;case as:case ls:case hs:case ds:case ms:case ps:case us:{let e=String.fromCharCode(r);h=[e,e,m];break}case cs:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==qr&&u!==Qr&&u!==ss&&u!==rs&&u!==os&&u!==ns&&u!==is){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===es;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||bs.test(o)?h=["(","(",m]:(h=["brackets",o,m,s],m=s);break;case qr:case Qr:n=r===qr?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===es;)l-=1,a=!a}while(a);h=["string",d.slice(m,s+1),m,s],m=s;break;case gs:ys.lastIndex=m+1,ys.test(d),s=0===ys.lastIndex?d.length-1:ys.lastIndex-2,h=["at-word",d.slice(m,s+1),m,s],m=s;break;case es:for(s=m,i=!0;d.charCodeAt(s+1)===es;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==ts&&r!==ss&&r!==rs&&r!==os&&r!==is&&r!==ns&&(s+=1,Ss.test(d.charAt(s)))){for(;Ss.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===ss&&(s+=1)}h=["word",d.slice(m,s+1),m,s],m=s;break;default:r===ts&&d.charCodeAt(m+1)===fs?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),h=["comment",d.slice(m,s+1),m,s],m=s):(ws.lastIndex=m+1,ws.test(d),s=0===ws.lastIndex?d.length-1:ws.lastIndex-2,h=["word",d.slice(m,s+1),m,s],g.push(h),m=s)}return m++,h},position:function(){return m}}},_s=Er,Bs=Is,zs=Ms,Us=Ds;const js={empty:!0,space:!0};let Ws=zr,Vs=class{constructor(e){this.input=e,this.root=new zs,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 Bs;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(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}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new _s;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=Fs(this.input)}decl(e,t){let r=new Ps;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(s=e[a],"!important"===s[1].toLowerCase()){r.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(r.raws.important=t);break}if("important"===s[1].toLowerCase()){let t=e.slice(0),s="";for(let e=a;e>0;e--){let r=t[e][0];if(0===s.trim().indexOf("!")&&"space"!==r)break;s=t.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=t)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 Us;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,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",u=!0;for(let h=0;h<l;h+=1)n=r[h],o=n[0],"space"!==o||h!==l-1||s?"comment"===o?(a=r[h-1]?r[h-1][0]:"empty",i=r[h+1]?r[h+1][0]:"empty",js[a]||js[i]||","===c.slice(-1)?u=!1:c+=n[1]):c+=n[1]:u=!1;if(!u){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new Us;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},$s=dr;function Gs(e,t){let r=new $s(e,t),s=new Vs(r);try{s.parse()}catch(n){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===n.name&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?n.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(n.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),n}return s.root}var Js=Gs;Gs.default=Gs,Ws.registerParse(Gs);let{isClean:Zs,my:Ys}=xt,Hs=Ir,Xs=Rt,Ks=zr,qs=$r,Qs=Jr,en=Kr,tn=Js,rn=Ms;const sn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},nn={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},on={Once:!0,postcssPlugin:!0,prepare:!0};function an(e){return"object"==typeof e&&"function"==typeof e.then}function ln(e){let t=!1,r=sn[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function cn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ln(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function un(e){return e[Zs]=!1,e.nodes&&e.nodes.forEach(e=>un(e)),e}let hn={},dn=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)if(r instanceof e||r instanceof en)n=un(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=tn;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(o){this.processed=!0,this.error=o}n&&!n[Ys]&&Ks.rebuild(n)}else n=un(r);this.result=new en(t,n,s),this.helpers={...hn,postcss:hn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(s){console&&console.error&&console.error(s)}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(!nn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!on[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 r=0;r<this.plugins.length;r++){let t=this.plugins[r],s=this.runOnRoot(t);if(an(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Zs];){e[Zs]=!0;let r=[cn(e)];for(;r.length>0;){let e=this.visitTick(r);if(an(e))try{await e}catch(t){let e=r[r.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[r,s]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return an(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Xs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Hs(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(an(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Zs];)e[Zs]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Qs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(an(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<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[Zs])return s[Zs]=!0,void e.push(cn(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Zs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Zs]=!0;let t=ln(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Zs]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};dn.registerPostcss=e=>{hn=e};var pn=dn;dn.default=dn,rn.registerLazyResult(dn),qs.registerLazyResult(dn);let fn=Ir,mn=Rt,gn=Jr,yn=Js;const wn=Kr;let bn=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;let n=mn;this.result=new wn(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new fn(n,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"production"!==process.env.NODE_ENV&&("from"in this._opts||gn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=yn;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Sn=bn;bn.default=bn;let vn=Sn,Cn=pn,In=$r,kn=Ms,xn=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)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Cn(this,e,t):new vn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var En=xn;xn.default=xn,kn.registerProcessor(xn),In.registerProcessor(xn);let On=Wt,Mn=Kt,Ln=Er,An=Is,Rn=dr,Tn=Ms,Nn=Ds;function Dn(e,t){if(Array.isArray(e))return e.map(e=>Dn(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Rn.prototype};r.map&&(r.map={...r.map,__proto__:Mn.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>Dn(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 Tn(s);if("decl"===s.type)return new On(s);if("rule"===s.type)return new Nn(s);if("comment"===s.type)return new Ln(s);if("atrule"===s.type)return new An(s);throw new Error("Unknown node type: "+e.type)}var Pn=Dn;Dn.default=Dn;let Fn=kt,_n=Wt,Bn=pn,zn=zr,Un=En,jn=Rt,Wn=Pn,Vn=$r,$n=Yr,Gn=Er,Jn=Is,Zn=Kr,Yn=dr,Hn=Js,Xn=As,Kn=Ds,qn=Ms,Qn=zt;function eo(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Un(e)}eo.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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Un).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return eo([n(r)]).process(e,t)},n},eo.stringify=jn,eo.parse=Hn,eo.fromJSON=Wn,eo.list=Xn,eo.comment=e=>new Gn(e),eo.atRule=e=>new Jn(e),eo.decl=e=>new _n(e),eo.rule=e=>new Kn(e),eo.root=e=>new qn(e),eo.document=e=>new Vn(e),eo.CssSyntaxError=Fn,eo.Declaration=_n,eo.Container=zn,eo.Processor=Un,eo.Document=Vn,eo.Comment=Gn,eo.Warning=$n,eo.AtRule=Jn,eo.Result=Zn,eo.Input=Yn,eo.Rule=Kn,eo.Root=qn,eo.Node=Qn,Bn.registerPostcss(eo);var to=eo;eo.default=eo;const ro=ft(to);ro.stringify,ro.fromJSON,ro.plugin,ro.parse,ro.list,ro.document,ro.comment,ro.atRule,ro.rule,ro.decl,ro.root,ro.CssSyntaxError,ro.Declaration,ro.Container,ro.Processor,ro.Document,ro.Comment,ro.Warning,ro.AtRule,ro.Result,ro.Input,ro.Rule,ro.Root,ro.Node;var so=Object.defineProperty,no=(e,t,r)=>((e,t,r)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function io(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}var ao={exports:{}},lo=String,co=function(){return{isColorSupported:!1,reset:lo,bold:lo,dim:lo,italic:lo,underline:lo,inverse:lo,hidden:lo,strikethrough:lo,black:lo,red:lo,green:lo,yellow:lo,blue:lo,magenta:lo,cyan:lo,white:lo,gray:lo,bgBlack:lo,bgRed:lo,bgGreen:lo,bgYellow:lo,bgBlue:lo,bgMagenta:lo,bgCyan:lo,bgWhite:lo}};ao.exports=co(),ao.exports.createColors=co;var uo=ao.exports;const ho=io(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let po=uo,fo=ho,mo=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==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:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=po.isColorSupported),fo&&e&&(t=fo(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=po.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var go=mo;mo.default=mo;var yo={};yo.isClean=Symbol("isClean"),yo.my=Symbol("my");const wo={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let bo=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;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return wo[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=wo[r]),o.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,t.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,r.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,r.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&&(t=e.raws.between,void 0!==t))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,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(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=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let 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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var So=bo;bo.default=bo;let vo=So;function Co(e,t){new vo(t).stringify(e)}var Io=Co;Co.default=Co;let{isClean:ko,my:xo}=yo,Eo=go,Oo=So,Mo=Io;function Lo(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>Lo(e,r)):("object"===o&&null!==n&&(n=Lo(n)),r[s]=n)}return r}let Ao=class{constructor(e={}){this.raws={},this[ko]=!1,this[xo]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of 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=Lo(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 Eo(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[ko]){this[ko]=!1;let e=this;for(;e=e.parent;)e[ko]=!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 o=0;o<e;o++)"\n"===r[o]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Oo).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))r[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)r[o]=e.toJSON(null,t);else if("source"===o){let s=t.get(e.input);null==s&&(s=n,t.set(e.input,n),n++),r[o]={end:e.end,inputId:s,start:e.start}}else r[o]=e}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=Mo){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let n in r)s[n]=r[n];return e.warn(t,s)}get proxyOf(){return this}};var Ro=Ao;Ao.default=Ao;let To=Ro,No=class extends To{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Do=No;No.default=No;var Po={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Fo,SourceMapGenerator:_o}=ho,{existsSync:Bo,readFileSync:zo}=ho,{dirname:Uo,join:jo}=ho;let Wo=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=Uo(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new Fo(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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=Uo(e),Bo(e))return this.mapFile=e,zo(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Fo)return _o.fromSourceMap(t).toString();if(t instanceof _o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=jo(Uo(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Vo=Wo;Wo.default=Wo;let{SourceMapConsumer:$o,SourceMapGenerator:Go}=ho,{fileURLToPath:Jo,pathToFileURL:Zo}=ho,{isAbsolute:Yo,resolve:Ho}=ho,{nanoid:Xo}=Po,Ko=ho,qo=go,Qo=Vo,ei=Symbol("fromOffsetCache"),ti=Boolean($o&&Go),ri=Boolean(Ho&&Yo),si=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ri||/^\w+:\/\//.test(t.from)||Yo(t.from)?this.file=t.from:this.file=Ho(t.from)),ri&&ti){let e=new Qo(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Xo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;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);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new qo(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 qo(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Zo&&(n.input.url=Zo(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[ei])r=this[ei];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[ei]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ho(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=Yo(a.source)?Zo(a.source):new URL(a.source,this.map.consumer().sourceRoot||Zo(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Jo)throw new Error("file: protocol is not available in this PostCSS build");l.file=Jo(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ni=si;si.default=si,Ko&&Ko.registerInput&&Ko.registerInput(si);let{SourceMapConsumer:oi,SourceMapGenerator:ii}=ho,{dirname:ai,relative:li,resolve:ci,sep:ui}=ho,{pathToFileURL:hi}=ho,di=ni,pi=Boolean(oi&&ii),fi=Boolean(ai&&ci&&li&&ui);var mi=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||ai(e.file);!1===this.mapOpts.sourcesContent?(t=new oi(e.text),t.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--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),fi&&pi&&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=ii.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ii({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new ii({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ai(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ai(ci(r,this.mapOpts.annotation)));let s=li(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 di(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)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(hi){let t=hi(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===ui&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let gi=Ro,yi=class extends gi{constructor(e){super(e),this.type="comment"}};var wi=yi;yi.default=yi;let bi,Si,vi,Ci,{isClean:Ii,my:ki}=yo,xi=Do,Ei=wi,Oi=Ro;function Mi(e){return e.map(e=>(e.nodes&&(e.nodes=Mi(e.nodes)),delete e.source,e))}function Li(e){if(e[Ii]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Li(t)}let Ai=class e extends Oi{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,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();s=this.index(e);for(let o of n)this.proxyOf.nodes.splice(s+1,0,o);for(let o in this.indexes)r=this.indexes[o],s<r&&(this.indexes[o]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let i of o)this.proxyOf.nodes.splice(s,0,i);for(let i in this.indexes)r=this.indexes[i],s<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Mi(bi(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new xi(t)]}else if(t.selector)t=[new Si(t)];else if(t.name)t=[new vi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ei(t)]}return t.map(t=>(t[ki]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ii]&&Li(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){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(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(n){throw t.addToError(n)}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]}};Ai.registerParse=e=>{bi=e},Ai.registerRule=e=>{Si=e},Ai.registerAtRule=e=>{vi=e},Ai.registerRoot=e=>{Ci=e};var Ri=Ai;Ai.default=Ai,Ai.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,vi.prototype):"rule"===e.type?Object.setPrototypeOf(e,Si.prototype):"decl"===e.type?Object.setPrototypeOf(e,xi.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ei.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ci.prototype),e[ki]=!0,e.nodes&&e.nodes.forEach(e=>{Ai.rebuild(e)})};let Ti,Ni,Di=Ri,Pi=class extends Di{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ti(new Ni,this,e).stringify()}};Pi.registerLazyResult=e=>{Ti=e},Pi.registerProcessor=e=>{Ni=e};var Fi=Pi;Pi.default=Pi;let _i={};var Bi=function(e){_i[e]||(_i[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let zi=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 r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Ui=zi;zi.default=zi;let ji=Ui,Wi=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 ji(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Vi=Wi;Wi.default=Wi;const $i="'".charCodeAt(0),Gi='"'.charCodeAt(0),Ji="\\".charCodeAt(0),Zi="/".charCodeAt(0),Yi="\n".charCodeAt(0),Hi=" ".charCodeAt(0),Xi="\f".charCodeAt(0),Ki="\t".charCodeAt(0),qi="\r".charCodeAt(0),Qi="[".charCodeAt(0),ea="]".charCodeAt(0),ta="(".charCodeAt(0),ra=")".charCodeAt(0),sa="{".charCodeAt(0),na="}".charCodeAt(0),oa=";".charCodeAt(0),ia="*".charCodeAt(0),aa=":".charCodeAt(0),la="@".charCodeAt(0),ca=/[\t\n\f\r "#'()/;[\\\]{}]/g,ua=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ha=/.[\r\n"'(/\\]/,da=/[\da-f]/i;let pa=Ri,fa=class extends pa{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ma=fa;fa.default=fa,pa.registerAtRule(fa);let ga,ya,wa=Ri,ba=class extends wa{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 n of s)n.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 ga(new ya,this,e).stringify()}};ba.registerLazyResult=e=>{ga=e},ba.registerProcessor=e=>{ya=e};var Sa=ba;ba.default=ba,wa.registerRoot(ba);let va={comma:e=>va.split(e,[","],!0),space:e=>va.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?i+=1:")"===u?i>0&&(i-=1):0===i&&t.includes(u)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=u;return(r||""!==n)&&s.push(n.trim()),s}};var Ca=va;va.default=va;let Ia=Ri,ka=Ca,xa=class extends Ia{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ka.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)}};var Ea=xa;xa.default=xa,Ia.registerRule(xa);let Oa=Do,Ma=function(e,t={}){let r,s,n,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.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=d.charCodeAt(m),r){case Yi:case Hi:case Ki:case qi:case Xi:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===Hi||r===Yi||r===Ki||r===qi||r===Xi);h=["space",d.slice(m,s)],m=s-1;break;case Qi:case ea:case sa:case na:case aa:case oa:case ra:{let e=String.fromCharCode(r);h=[e,e,m];break}case ta:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==$i&&u!==Gi&&u!==Hi&&u!==Yi&&u!==Ki&&u!==Xi&&u!==qi){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===Ji;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||ha.test(o)?h=["(","(",m]:(h=["brackets",o,m,s],m=s);break;case $i:case Gi:n=r===$i?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===Ji;)l-=1,a=!a}while(a);h=["string",d.slice(m,s+1),m,s],m=s;break;case la:ca.lastIndex=m+1,ca.test(d),s=0===ca.lastIndex?d.length-1:ca.lastIndex-2,h=["at-word",d.slice(m,s+1),m,s],m=s;break;case Ji:for(s=m,i=!0;d.charCodeAt(s+1)===Ji;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==Zi&&r!==Hi&&r!==Yi&&r!==Ki&&r!==qi&&r!==Xi&&(s+=1,da.test(d.charAt(s)))){for(;da.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===Hi&&(s+=1)}h=["word",d.slice(m,s+1),m,s],m=s;break;default:r===Zi&&d.charCodeAt(m+1)===ia?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),h=["comment",d.slice(m,s+1),m,s],m=s):(ua.lastIndex=m+1,ua.test(d),s=0===ua.lastIndex?d.length-1:ua.lastIndex-2,h=["word",d.slice(m,s+1),m,s],g.push(h),m=s)}return m++,h},position:function(){return m}}},La=wi,Aa=ma,Ra=Sa,Ta=Ea;const Na={empty:!0,space:!0};let Da=Ri,Pa=class{constructor(e){this.input=e,this.root=new Ra,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 Aa;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(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}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new La;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=Ma(this.input)}decl(e,t){let r=new Oa;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(s=e[a],"!important"===s[1].toLowerCase()){r.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(r.raws.important=t);break}if("important"===s[1].toLowerCase()){let t=e.slice(0),s="";for(let e=a;e>0;e--){let r=t[e][0];if(0===s.trim().indexOf("!")&&"space"!==r)break;s=t.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=t)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 Ta;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,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",u=!0;for(let h=0;h<l;h+=1)n=r[h],o=n[0],"space"!==o||h!==l-1||s?"comment"===o?(a=r[h-1]?r[h-1][0]:"empty",i=r[h+1]?r[h+1][0]:"empty",Na[a]||Na[i]||","===c.slice(-1)?u=!1:c+=n[1]):c+=n[1]:u=!1;if(!u){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new Ta;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Fa=ni;function _a(e,t){let r=new Fa(e,t),s=new Pa(r);try{s.parse()}catch(n){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===n.name&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?n.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(n.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),n}return s.root}var Ba=_a;_a.default=_a,Da.registerParse(_a);let{isClean:za,my:Ua}=yo,ja=mi,Wa=Io,Va=Ri,$a=Fi,Ga=Bi,Ja=Vi,Za=Ba,Ya=Sa;const Ha={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Xa={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Ka={Once:!0,postcssPlugin:!0,prepare:!0};function qa(e){return"object"==typeof e&&"function"==typeof e.then}function Qa(e){let t=!1,r=Ha[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function el(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Qa(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function tl(e){return e[za]=!1,e.nodes&&e.nodes.forEach(e=>tl(e)),e}let rl={},sl=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)if(r instanceof e||r instanceof Ja)n=tl(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=Za;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(o){this.processed=!0,this.error=o}n&&!n[Ua]&&Va.rebuild(n)}else n=tl(r);this.result=new Ja(t,n,s),this.helpers={...rl,postcss:rl,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(s){console&&console.error&&console.error(s)}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(!Xa[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ka[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 r=0;r<this.plugins.length;r++){let t=this.plugins[r],s=this.runOnRoot(t);if(qa(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[za];){e[za]=!0;let r=[el(e)];for(;r.length>0;){let e=this.visitTick(r);if(qa(e))try{await e}catch(t){let e=r[r.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[r,s]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return qa(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Wa;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ja(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(qa(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[za];)e[za]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ga("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(qa(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<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[za])return s[za]=!0,void e.push(el(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[za]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[za]=!0;let t=Qa(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[za]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};sl.registerPostcss=e=>{rl=e};var nl=sl;sl.default=sl,Ya.registerLazyResult(sl),$a.registerLazyResult(sl);let ol=mi,il=Io,al=Bi,ll=Ba;const cl=Vi;let ul=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;let n=il;this.result=new cl(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new ol(n,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"production"!==process.env.NODE_ENV&&("from"in this._opts||al("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=ll;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var hl=ul;ul.default=ul;let dl=hl,pl=nl,fl=Fi,ml=Sa,gl=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)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new pl(this,e,t):new dl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var yl=gl;gl.default=gl,ml.registerProcessor(gl),fl.registerProcessor(gl);let wl=Do,bl=Vo,Sl=wi,vl=ma,Cl=ni,Il=Sa,kl=Ea;function xl(e,t){if(Array.isArray(e))return e.map(e=>xl(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Cl.prototype};r.map&&(r.map={...r.map,__proto__:bl.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>xl(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 Il(s);if("decl"===s.type)return new wl(s);if("rule"===s.type)return new kl(s);if("comment"===s.type)return new Sl(s);if("atrule"===s.type)return new vl(s);throw new Error("Unknown node type: "+e.type)}var El=xl;xl.default=xl;let Ol=go,Ml=Do,Ll=nl,Al=Ri,Rl=yl,Tl=Io,Nl=El,Dl=Fi,Pl=Ui,Fl=wi,_l=ma,Bl=Vi,zl=ni,Ul=Ba,jl=Ca,Wl=Ea,Vl=Sa,$l=Ro;function Gl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Rl(e)}Gl.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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Rl).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return Gl([n(r)]).process(e,t)},n},Gl.stringify=Tl,Gl.parse=Ul,Gl.fromJSON=Nl,Gl.list=jl,Gl.comment=e=>new Fl(e),Gl.atRule=e=>new _l(e),Gl.decl=e=>new Ml(e),Gl.rule=e=>new Wl(e),Gl.root=e=>new Vl(e),Gl.document=e=>new Dl(e),Gl.CssSyntaxError=Ol,Gl.Declaration=Ml,Gl.Container=Al,Gl.Processor=Rl,Gl.Document=Dl,Gl.Comment=Fl,Gl.Warning=Pl,Gl.AtRule=_l,Gl.Result=Bl,Gl.Input=zl,Gl.Rule=Wl,Gl.Root=Vl,Gl.Node=$l,Ll.registerPostcss(Gl);var Jl=Gl;Gl.default=Gl;const Zl=oo(Jl);Zl.stringify,Zl.fromJSON,Zl.plugin,Zl.parse,Zl.list,Zl.document,Zl.comment,Zl.atRule,Zl.rule,Zl.decl,Zl.root,Zl.CssSyntaxError,Zl.Declaration,Zl.Container,Zl.Processor,Zl.Document,Zl.Comment,Zl.Warning,Zl.AtRule,Zl.Result,Zl.Input,Zl.Rule,Zl.Root,Zl.Node;class Yl{constructor(...e){no(this,"parentElement",null),no(this,"parentNode",null),no(this,"ownerDocument"),no(this,"firstChild",null),no(this,"lastChild",null),no(this,"previousSibling",null),no(this,"nextSibling",null),no(this,"ELEMENT_NODE",1),no(this,"TEXT_NODE",3),no(this,"nodeType"),no(this,"nodeName"),no(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Yl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Hl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Kl={};function ql(e){if(Kl[e])return Kl[e];const t=globalThis[e],r=t.prototype,s=e in Hl?Hl[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in Xl?Xl[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return Kl[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?Kl[e]=o:r}catch{return r}}const Ql={};function ec(e,t,r){var s;const n=`${e}.${String(r)}`;if(Ql[n])return Ql[n].call(t);const o=ql(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(Ql[n]=i,i.call(t)):t[r]}const tc={};function rc(e,t,r){const s=`${e}.${String(r)}`;if(tc[s])return tc[s].bind(t);const n=ql(e)[r];return"function"!=typeof n?t[r]:(tc[s]=n,n.bind(t))}function sc(){return ql("MutationObserver").constructor}const nc={childNodes:function(e){return ec("Node",e,"childNodes")},parentNode:function(e){return ec("Node",e,"parentNode")},parentElement:function(e){return ec("Node",e,"parentElement")},textContent:function(e){return ec("Node",e,"textContent")},contains:function(e,t){return rc("Node",e,"contains")(t)},getRootNode:function(e){return rc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ec("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ec("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ec("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ec("Element",e,"querySelectorAll")(t)},mutationObserver:sc};function oc(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const ic="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ac={map:{},getId:()=>(console.error(ic),-1),getNode:()=>(console.error(ic),null),removeNodeFromMap(){console.error(ic)},has:()=>(console.error(ic),!1),reset(){console.error(ic)}};function lc(e,t,r={}){let s=null,n=0;return function(...o){const i=Date.now();n||!1!==r.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(s&&(clearTimeout(s),s=null),n=i,e.apply(l,o)):s||!1===r.trailing||(s=setTimeout(()=>{n=!1===r.leading?0:Date.now(),s=null,e.apply(l,o)},a))}}function cc(e,t,r,s,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>cc(e,t,o||{},!0)}function uc(e,t,r){try{if(!(t in e))return()=>{};const 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&&(ac=new Proxy(ac,{get:(e,t,r)=>("map"===t&&console.error(ic),Reflect.get(e,t,r))}));let hc=Date.now;function dc(e){var t,r,s,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=nc.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(s=nc.parentElement(o.body))?void 0:s.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function pc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mc(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:nc.parentElement(e)}function gc(e,t,r,s){if(!e)return!1;const n=mc(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(s&&null!==n.closest("."+t))return!0}else if(ct(n,t,s))return!0}catch(o){}if(r){if(n.matches(r))return!0;if(s&&null!==n.closest(r))return!0}return!1}function yc(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function wc(e,t){if(Ne(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=nc.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||wc(s,t))}function bc(e){return Boolean(e.changedTouches)}function Sc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function vc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Cc(e){return!!e&&(e instanceof Yl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(nc.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(hc=()=>(new Date).getTime());class Ic{constructor(){be(this,"id",1),be(this,"styleIDMap",new WeakMap),be(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return 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 kc(e){var t;let r=null;return"getRootNode"in e&&(null==(t=nc.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&nc.host(nc.getRootNode(e))&&(r=nc.host(nc.getRootNode(e))),r}function xc(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=kc(r);)r=t;return r}(e);return nc.contains(t,r)}function Ec(e){const t=e.ownerDocument;return!!t&&(nc.contains(t,e)||xc(e))}var Oc=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Oc||{}),Mc=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Mc||{}),Lc=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Lc||{}),Ac=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ac||{}),Rc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Rc||{}),Tc=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Tc||{}),Nc=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Nc||{});function Dc(e){return"__ln"in e}class Pc{constructor(){be(this,"length",0),be(this,"head",null),be(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Dc(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Dc(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Fc=(e,t)=>`${e}@${t}`;class _c{constructor(){be(this,"frozen",!1),be(this,"locked",!1),be(this,"texts",[]),be(this,"attributes",[]),be(this,"attributeMap",new WeakMap),be(this,"removes",[]),be(this,"mapRemoves",[]),be(this,"movedMap",{}),be(this,"addedSet",new Set),be(this,"movedSet",new Set),be(this,"droppedSet",new Set),be(this,"removesSubTreeCache",new Set),be(this,"mutationCb"),be(this,"blockClass"),be(this,"blockSelector"),be(this,"maskTextClass"),be(this,"maskTextSelector"),be(this,"inlineStylesheet"),be(this,"maskInputOptions"),be(this,"maskTextFn"),be(this,"maskInputFn"),be(this,"keepIframeSrcFn"),be(this,"recordCanvas"),be(this,"inlineImages"),be(this,"slimDOMOptions"),be(this,"dataURLOptions"),be(this,"doc"),be(this,"mirror"),be(this,"iframeManager"),be(this,"stylesheetManager"),be(this,"shadowDomManager"),be(this,"canvasManager"),be(this,"processedNodeManager"),be(this,"unattachedDoc"),be(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),be(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Pc,s=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{const o=nc.parentNode(n);if(!o||!Ec(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=Ne(o)?this.mirror.getId(kc(n)):this.mirror.getId(o),l=s(n);if(-1===a||-1===l)return r.addNode(n);const c=pt(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=>{Sc(e,this.mirror)&&this.iframeManager.addIframe(e),vc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Cc(n)&&this.shadowDomManager.addShadowRoot(nc.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)zc(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(nc.parentNode(a))||n(a);for(const a of this.addedSet)Uc(this.droppedSet,a)||zc(this.removesSubTreeCache,a,this.mirror)?Uc(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(nc.parentNode(o.value)),r=s(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(nc.parentNode(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,s=nc.parentNode(t);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=nc.host(s);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=nc.parentNode(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=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),s=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+s).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),be(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(nc.childNodes(e),e=>nc.textContent(e)||"").join("")}),be(this,"processMutation",e=>{if(!yc(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=nc.textContent(e.target);gc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ut(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,mc(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const r=e.target;let s=e.attributeName,n=e.target.getAttribute(s);if("value"===s){const e=je(r);n=Be({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(gc(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===s&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;s="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===s&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!lt(r.tagName,s))if(o.attributes[s]=at(this.doc,ze(r.tagName),ze(s),n),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const s=this.unattachedDoc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue);for(const e of Array.from(r.style)){const t=r.style.getPropertyValue(e),n=r.style.getPropertyPriority(e);t!==s.style.getPropertyValue(e)||n!==s.style.getPropertyPriority(e)?o.styleDiff[e]=""===n?t:[t,n]:o._unchangedStyles[e]=[t,n]}for(const e of Array.from(s.style))""===r.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===s&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(gc(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),s=Ne(e.target)?this.mirror.getId(nc.host(e.target)):this.mirror.getId(e.target);gc(e.target,this.blockClass,this.blockSelector,!1)||yc(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Bc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||wc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fc(r,s)]?Bc(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!(!Ne(e.target)||!De(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),nc.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),be(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(yc(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[Fc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);gc(e,this.blockClass,this.blockSelector,!1)||(nc.childNodes(e).forEach(e=>this.genAdds(e)),Cc(e)&&nc.childNodes(nc.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Bc(e,t){e.delete(t),nc.childNodes(t).forEach(t=>Bc(e,t))}function zc(e,t,r){return 0!==e.size&&function(e,t){const r=nc.parentNode(t);return!!r&&e.has(r)}(e,t)}function Uc(e,t){return 0!==e.size&&jc(e,t)}function jc(e,t){const r=nc.parentNode(t);return!!r&&(!!e.has(r)||jc(e,r))}let Wc;const Vc=e=>{if(!Wc)return e;return(...t)=>{try{return e(...t)}catch(r){if(Wc&&!0===Wc(r))return;throw r}}},$c=[];function Gc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Jc(e,t){const r=new _c;$c.push(r),r.init(e);const s=new(sc())(Vc(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Zc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Lc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=ze(o);const c=(t=>o=>{const i=Gc(o);if(gc(i,s,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Ac.Mouse;break;case"touch":a=Ac.Touch;break;case"pen":a=Ac.Pen}a===Ac.Touch?Lc[t]===Lc.MouseDown?c="TouchStart":Lc[t]===Lc.MouseUp&&(c="TouchEnd"):Ac.Pen}else bc(o)&&(a=Ac.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Ac.Touch||c.startsWith("Mouse")&&a===Ac.Mouse)&&(a=null)):Lc[t]===Lc.Click&&(a=l,l=null);const u=bc(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;Vc(e)({type:Lc[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Lc[o]){case Lc.MouseDown:case Lc.MouseUp:i=i.replace("mouse","pointer");break;case Lc.TouchStart:case Lc.TouchEnd:return}a.push(oc(i,c,t))}),Vc(()=>{a.forEach(e=>e())})}function Yc({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){return oc("scroll",Vc(lc(Vc(o=>{const i=Gc(o);if(!i||gc(i,s,n,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=dc(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const Hc=["INPUT","TEXTAREA","SELECT"],Xc=new WeakMap;function Kc(e){return function(e,t){if(tu("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||tu("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||tu("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||tu("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function qc(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function Qc({mirror:e,stylesheetManager:t},r){var s,n,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(nc.host(r));const a="#document"===r.nodeName?null==(s=r.defaultView)?void 0:s.Document:null==(o=null==(n=r.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(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;const s=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(n){}return s}}),Vc(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function eu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let s;!function(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),s(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(s=Jc(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=lc(Vc(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Vc(lc(Vc(e=>{const t=Gc(e),{clientX:r,clientY:n}=bc(e)?e.changedTouches[0]:e;i||(i=hc()),a.push({x:r,y:n,id:s.getId(t),timeOffset:hc()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Mc.Drag:e instanceof MouseEvent?Mc.MouseMove:Mc.TouchMove)}),n,{trailing:!1})),u=[oc("mousemove",c,r),oc("touchmove",c,r),oc("drag",c,r)];return Vc(()=>{u.forEach(e=>e())})}(e),o=Zc(e),i=Yc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return oc("resize",Vc(lc(Vc(()=>{const t=pc(),n=fc();r===t&&s===n||(e({width:Number(n),height:Number(t)}),r=t,s=n)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Gc(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=nc.parentElement(r)),!r||!h||Hc.indexOf(h)<0||gc(r,s,n,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=je(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Be({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,s){const n=Xc.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){Xc.set(t,s);const n=r.getId(t);Vc(e)({...s,id:n})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>oc(e,Vc(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>cc(e[0],e[1],{set(){Vc(h)({target:this,isTrusted:!1})}},!1,f))),Vc(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:o}){const i=Vc(o=>lc(Vc(n=>{const i=Gc(n);if(!i||gc(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=i;e({type:o,id:s.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),n.media||500)),a=[oc("play",i(Tc.Play),o),oc("pause",i(Tc.Pause),o),oc("seeked",i(Tc.Seeked),o),oc("volumechange",i(Tc.VolumeChange),o),oc("ratechange",i(Tc.RateChange),o)];return Vc(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const n=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Vc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=qc(n,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const n=`${e} { ${t} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};const o=s.CSSStyleSheet.prototype.deleteRule;let i,a;s.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(i=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),s.apply(n,o)})})),s.CSSStyleSheet.prototype.replaceSync&&(a=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),s.apply(n,o)})}));const l={};ru("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(ru("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),ru("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),ru("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([s,n])=>{c[s]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[s].insertRule,{apply:Vc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=qc(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Kc(n),a||0]}]}),s.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[s].deleteRule,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=qc(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Kc(n),i]}]}),s.apply(n,o)})})}),Vc(()=>{s.CSSStyleSheet.prototype.insertRule=n,s.CSSStyleSheet.prototype.deleteRule=o,i&&(s.CSSStyleSheet.prototype.replace=i),a&&(s.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=Qc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Vc((n,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:d,styleId:p}=qc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:Kc(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Vc((n,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=qc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:Kc(o.parentRule)}),n.apply(o,a)})}),Vc(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],n=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const s=new o(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};const i=uc(t.fonts,"add",function(t){return function(r){return setTimeout(Vc(()=>{const t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}});return s.push(()=>{r.FontFace=o}),s.push(i),Vc(()=>{s.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Vc(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=o;gc(i,s,n,!0)||gc(c,s,n,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),oc("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?uc(r.customElements,"define",function(e){return function(r,s,n){try{t({define:{name:r}})}catch(o){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,s,n])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,r,y.options));return Vc(()=>{$c.forEach(e=>e.reset()),null==s||s.disconnect(),n(),o(),i(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function tu(e){return void 0!==window[e]}function ru(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class su{constructor(e){be(this,"iframeIdToRemoteIdMap",new WeakMap),be(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){const n=r||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,s))}getRemoteId(e,t,r){const s=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=s.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class nu{constructor(e){be(this,"iframes",new WeakMap),be(this,"crossOriginIframeMap",new WeakMap),be(this,"crossOriginIframeMirror",new su(qe)),be(this,"crossOriginIframeStyleMirror"),be(this,"crossOriginIframeRootIdMap",new WeakMap),be(this,"mirror"),be(this,"mutationCb"),be(this,"wrappedEmit"),be(this,"loadListener"),be(this,"stylesheetManager"),be(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new su(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){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const s=this.transformCrossOriginEvent(r,t.data.event);s&&this.wrappedEmit(s,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Oc.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Oc.IncrementalSnapshot,data:{source:Mc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Oc.Meta:case Oc.Load:case Oc.DomContentLoaded:return!1;case Oc.Plugin:return t;case Oc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Oc.IncrementalSnapshot:switch(t.data.source){case Mc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const 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 Mc.Drag:case Mc.TouchMove:case Mc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Mc.ViewportResize:return!1;case Mc.MediaInteraction:case Mc.MouseInteraction:case Mc.Scroll:case Mc.CanvasMutation:case Mc.Input:return this.replaceIds(t.data,e,["id"]),t;case Mc.StyleSheetRule:case Mc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Mc.Font:return t;case Mc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Mc.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(const 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===Nc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class ou{constructor(e){be(this,"shadowDoms",new WeakSet),be(this,"mutationCb"),be(this,"scrollCb"),be(this,"bypassOptions"),be(this,"mirror"),be(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(!De(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Jc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Yc({...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(nc.host(e))),this.restoreHandlers.push(Qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(uc(e.prototype,"attachShadow",function(e){return function(s){const n=e.call(this,s),o=nc.shadowRoot(this);return o&&Ec(this)&&r.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",au="undefined"==typeof Uint8Array?[]:new Uint8Array(256),lu=0;lu<64;lu++)au[iu.charCodeAt(lu)]=lu;const cu=new Map;const uu=(e,t,r)=>{if(!e||!pu(e,t)&&"object"!=typeof e)return;const s=function(e,t){let r=cu.get(e);return r||(r=new Map,cu.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let n=s.indexOf(e);return-1===n&&(n=s.length,s.push(e)),n};function hu(e,t,r){if(e instanceof Array)return e.map(e=>hu(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),s=r.length,n="";for(t=0;t<s;t+=3)n+=iu[r[t]>>2],n+=iu[(3&r[t])<<4|r[t+1]>>4],n+=iu[(15&r[t+1])<<2|r[t+2]>>6],n+=iu[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}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[hu(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[hu(e.data,t,r),e.width,e.height]}}if(pu(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:uu(e,t,r)}}return e}const du=(e,t,r)=>e.map(e=>hu(e,t,r)),pu=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function fu(e,t,r,s){const n=[];try{const o=uc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!gc(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function mu(e,t,r,s,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=uc(e,l,function(e){return function(...i){const a=e.apply(this,i);if(uu(a,o,this),"tagName"in this.canvas&&!gc(this.canvas,s,n,!0)){const e=du(i,o,this),s={type:t,property:l,args:e};r(this.canvas,s)}return a}});i.push(a)}catch{const s=cc(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(s)}return i}const gu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",yu="undefined"!=typeof window&&window.Blob&&new Blob([(wu=gu,Uint8Array.from(atob(wu),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var wu;function bu(e){let t;try{if(t=yu&&(window.URL||window.webkitURL).createObjectURL(yu),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;base64,"+gu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Su{constructor(e){be(this,"pendingCanvasMutations",new Map),be(this,"rafStamps",{latestId:0,invokeId:null}),be(this,"mirror"),be(this,"mutationCb"),be(this,"resetObservers"),be(this,"frozen",!1),be(this,"locked",!1),be(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,s,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:i})}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){const o=fu(t,r,s,!0),i=new Map,a=new bu;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:s,width:n,height:o}=e.data;this.mutationCb({id:t,type:Rc["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{gc(t,r,s,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=await createImageBitmap(e);a.postMessage({id:r,bitmap:s,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[s])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=fu(e,t,r,!1),n=function(e,t,r,s){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=uc(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return gc(this.canvas,r,s,!0)||setTimeout(()=>{const r=du(o,t,this);e(this.canvas,{type:Rc["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{const r=cc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Rc["2D"],property:i,args:[t],setter:!0})}});n.push(r)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,s){const n=[];return n.push(...mu(t.WebGLRenderingContext.prototype,Rc.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...mu(t.WebGL2RenderingContext.prototype,Rc.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const s=r.map(e=>{const{type:t,...r}=e;return r}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}}class vu{constructor(e){be(this,"trackedLinkElements",new WeakSet),be(this,"mutationCb"),be(this,"adoptedStyleSheetCb"),be(this,"styleMirror",new Ic),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},s=[];for(const n of e){let e;this.styleMirror.has(n)?e=this.styleMirror.getId(n):(e=this.styleMirror.add(n),s.push({styleId:e,rules:Array.from(n.rules||CSSRule,(e,t)=>({rule:Fe(e,n.href),index:t}))})),r.styleIds.push(e)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Cu{constructor(){be(this,"nodeMap",new WeakMap),be(this,"active",!1)}inOtherBuffer(e,t){const 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 Iu,ku,xu,Eu=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ye=e.contentWindow)?void 0:ye.Array.from)||Array.from,document.body.removeChild(e)}}catch(qh){console.debug("Unable to override Array.from",qh)}const Ou=new _e;function Mu(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:v=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:M,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:R}=e;Wc=R;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(J){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Ou.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let _=0;const B=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};Iu=(e,n)=>{var o;const i=e;if(i.timestamp=hc(),!(null==(o=$c[0])?void 0:o.isFrozen())||i.type===Oc.FullSnapshot||i.type===Oc.IncrementalSnapshot&&i.data.source===Mc.Mutation||$c.forEach(e=>e.unfreeze()),T)null==t||t(B(i),n);else if(N){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===Oc.FullSnapshot)F=i,_=0;else if(i.type===Oc.IncrementalSnapshot){if(i.data.source===Mc.Mutation&&i.data.isAttachIframe)return;_++;const e=s&&_>=s,t=r&&i.timestamp-F.timestamp>r;(e||t)&&ku(!0)}};const z=e=>{Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.Mutation,...e}})},U=e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.Scroll,...e}}),j=e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.CanvasMutation,...e}}),W=new vu({mutationCb:z,adoptedStyleSheetCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.AdoptedStyleSheet,...e}})}),V=new nu({mirror:Ou,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:Iu});for(const Y of M||[])Y.getMirror&&Y.getMirror({nodeMirror:Ou,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const $=new Cu;xu=new Su({recordCanvas:C,mutationCb:j,win:window,blockClass:n,blockSelector:o,mirror:Ou,sampling:w.canvas,dataURLOptions:b});const G=new ou({mutationCb:z,scrollCb:U,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:w,slimDOMOptions:P,iframeManager:V,stylesheetManager:W,canvasManager:xu,keepIframeSrcFn:L,processedNodeManager:$},mirror:Ou});ku=(e=!1)=>{if(!v)return;Iu({type:Oc.Meta,data:{href:window.location.href,width:fc(),height:pc()}},e),W.reset(),G.init(),$c.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new _e,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=()=>!1}=t||{};return pt(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v,newlyAddedElement:!1})}(document,{mirror:Ou,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:b,recordCanvas:C,inlineImages:O,onSerialize:e=>{Sc(e,Ou)&&V.addIframe(e),vc(e,Ou)&&W.trackLinkElement(e),Cc(e)&&G.addShadowRoot(nc.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:L});if(!t)return console.warn("Failed to snapshot the document");Iu({type:Oc.FullSnapshot,data:{node:t,initialOffset:dc(window)}},e),$c.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ou.getId(document))};try{const e=[],t=e=>{var t;return Vc(eu)({mutationCb:z,mousemoveCb:(e,t)=>Iu({type:Oc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.ViewportResize,...e}}),inputCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.Input,...e}}),mediaInteractionCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.MediaInteraction,...e}}),styleSheetRuleCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.StyleSheetRule,...e}}),styleDeclarationCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.StyleDeclaration,...e}}),canvasMutationCb:j,fontCb:e=>Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.Font,...e}}),selectionCb:e=>{Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.Selection,...e}})},customElementCb:e=>{Iu({type:Oc.IncrementalSnapshot,data:{source:Mc.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:v,recordCanvas:C,inlineImages:O,userTriggeredOnInput:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:P,dataURLOptions:b,mirror:Ou,iframeManager:V,stylesheetManager:W,shadowDomManager:G,processedNodeManager:$,canvasManager:xu,ignoreCSSAttributes:A,plugins:(null==(t=null==M?void 0:M.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Iu({type:Oc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(s){console.warn(s)}});const r=()=>{ku(),e.push(t(document)),Eu=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(oc("DOMContentLoaded",()=>{Iu({type:Oc.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(oc("load",()=>{Iu({type:Oc.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),$.destroy(),Eu=!1,Wc=void 0}}catch(Z){console.warn(Z)}}var Lu,Au;Mu.addCustomEvent=(e,t)=>{if(!Eu)throw new Error("please add custom event after start recording");Iu({type:Oc.Custom,data:{tag:e,payload:t}})},Mu.freezePage=()=>{$c.forEach(e=>e.freeze())},Mu.takeFullSnapshot=e=>{if(!Eu)throw new Error("please take full snapshot after start recording");ku(e)},Mu.mirror=Ou,(Au=Lu||(Lu={}))[Au.NotStarted=0]="NotStarted",Au[Au.Running=1]="Running",Au[Au.Stopped=2]="Stopped";const{addCustomEvent:Ru}=Mu,{takeFullSnapshot:Tu}=Mu,Nu={isRecording:!1,events:[],stopFn:null,startTime:null};let Du=null;const Pu={maskAllInputs:!1,inlineStylesheet:!0,sampling:{mousemove:50,mouseInteraction:!0,scroll:150,input:"last"},checkoutEveryNth:200,checkoutEveryNms:3e4,recordCanvas:!1,collectFonts:!1,inlineImages:!0};function Fu(){if(!Nu.isRecording)return[];Nu.stopFn&&(Nu.stopFn(),Nu.stopFn=null),Nu.isRecording=!1;const e=[...Nu.events];return Nu.events=[],Nu.startTime=null,e}function _u(e,t){if(Nu.isRecording)try{Ru(e,t)}catch(r){console.warn("[LogSpace] Failed to add custom event:",r)}}const Bu="__logspace_leader",zu="__logspace_session";const Uu=new class{constructor(){this.channel=null,this.isLeader=!1,this.callbacks=null,this.heartbeatTimer=null,this.leaderCheckTimer=null,this.currentSessionId=null,this.initialized=!1,this.debug=!1,this.tabId=this.generateTabId()}generateTabId(){return`tab_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,8)}`}isSupported(){return"undefined"!=typeof BroadcastChannel&&"undefined"!=typeof localStorage}init(e,t=!1){this.initialized||(this.isSupported()?(this.callbacks=e,this.debug=t,this.initialized=!0,this.channel=new BroadcastChannel("logspace-multi-tab"),this.channel.onmessage=e=>this.handleMessage(e.data),window.addEventListener("beforeunload",()=>this.handleUnload()),this.electLeader(),this.debug&&console.log("[LogSpace MultiTab] Initialized",{tabId:this.tabId,isLeader:this.isLeader})):t&&console.log("[LogSpace MultiTab] BroadcastChannel not supported, running single-tab mode"))}electLeader(){const e=this.getLeaderState();e&&!this.isLeaderStale(e)?this.becomeFollower(e.sessionId):this.tryBecomeLeader()}tryBecomeLeader(){const e=this.getSessionState(),t=e?.id||this.generateSessionId(),r=!e,s={tabId:this.tabId,sessionId:t,heartbeat:Date.now()};try{localStorage.setItem(Bu,JSON.stringify(s));const e=this.getLeaderState();e?.tabId===this.tabId?this.becomeLeader(t,r):this.becomeFollower(e.sessionId)}catch(n){this.debug&&console.warn("[LogSpace MultiTab] Failed to claim leadership:",n)}}becomeLeader(e,t){if(this.isLeader=!0,this.currentSessionId=e,t){const t={id:e,startTime:Date.now()};localStorage.setItem(zu,JSON.stringify(t))}this.startHeartbeat(),this.broadcast({type:"leader-announce",tabId:this.tabId,sessionId:e}),this.callbacks?.onBecomeLeader(e,t),this.debug&&console.log("[LogSpace MultiTab] Became leader",{sessionId:e,isNewSession:t})}becomeFollower(e){this.isLeader=!1,this.currentSessionId=e,this.stopHeartbeat(),this.startLeaderCheck(),this.callbacks?.onBecomeFollower(e),this.debug&&console.log("[LogSpace MultiTab] Became follower",{sessionId:e})}handleMessage(e){switch(this.debug&&console.log("[LogSpace MultiTab] Received message:",e.type),e.type){case"leader-announce":e.tabId!==this.tabId&&(this.isLeader&&this.becomeFollower(e.sessionId),this.callbacks?.onLeaderChanged(e.tabId));break;case"leader-leaving":this.isLeader||(this.debug&&console.log("[LogSpace MultiTab] Leader leaving, attempting to claim leadership"),setTimeout(()=>this.tryBecomeLeader(),100*Math.random()));break;case"log":this.isLeader&&e.tabId!==this.tabId&&this.callbacks?.onReceiveLog(e.log);break;case"rrweb-event":this.isLeader&&e.tabId!==this.tabId&&this.callbacks?.onReceiveRRWebEvent(e.event);break;case"request-session":if(this.isLeader&&e.tabId!==this.tabId){const e=this.getSessionState();e&&this.broadcast({type:"session-info",sessionId:e.id,startTime:e.startTime})}break;case"session-info":this.isLeader||(this.currentSessionId=e.sessionId)}}startHeartbeat(){this.stopHeartbeat(),this.stopLeaderCheck(),this.heartbeatTimer=setInterval(()=>{this.isLeader&&this.updateHeartbeat()},2e3),this.updateHeartbeat()}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}updateHeartbeat(){const e=this.getLeaderState();if(e&&e.tabId===this.tabId){e.heartbeat=Date.now();try{localStorage.setItem(Bu,JSON.stringify(e))}catch(t){}}}startLeaderCheck(){this.stopLeaderCheck(),this.leaderCheckTimer=setInterval(()=>{if(!this.isLeader){const e=this.getLeaderState();e&&!this.isLeaderStale(e)||(this.debug&&console.log("[LogSpace MultiTab] Leader appears dead, attempting takeover"),this.tryBecomeLeader())}},3e3)}stopLeaderCheck(){this.leaderCheckTimer&&(clearInterval(this.leaderCheckTimer),this.leaderCheckTimer=null)}isLeaderStale(e){return Date.now()-e.heartbeat>5e3}getLeaderState(){try{const e=localStorage.getItem(Bu);return e?JSON.parse(e):null}catch{return null}}getSessionState(){try{const e=localStorage.getItem(zu);return e?JSON.parse(e):null}catch{return null}}generateSessionId(){return`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`}broadcast(e){this.channel&&this.channel.postMessage(e)}handleUnload(){if(this.isLeader){this.broadcast({type:"leader-leaving",tabId:this.tabId});try{localStorage.removeItem(Bu)}catch{}}this.cleanup()}sendLog(e){this.initialized&&this.channel&&(this.isLeader?this.callbacks?.onReceiveLog(e):this.broadcast({type:"log",tabId:this.tabId,log:e}))}sendRRWebEvent(e){this.initialized&&this.channel&&(this.isLeader?this.callbacks?.onReceiveRRWebEvent(e):this.broadcast({type:"rrweb-event",tabId:this.tabId,event:e}))}updateSessionUser(e,t){const r=this.getSessionState();if(r){r.userId=e,r.userTraits=t;try{localStorage.setItem(zu,JSON.stringify(r))}catch{}}}endSession(){try{localStorage.removeItem(zu),this.isLeader&&localStorage.removeItem(Bu)}catch{}}getTabId(){return this.tabId}getSessionId(){return this.currentSessionId}isLeaderTab(){return this.isLeader}isActive(){return this.initialized&&null!==this.channel}cleanup(){this.stopHeartbeat(),this.stopLeaderCheck(),this.channel&&(this.channel.close(),this.channel=null),this.initialized=!1}forceLeadership(){if(!this.initialized)return;const e=this.getSessionState(),t=e?.id||this.generateSessionId();this.becomeLeader(t,!e)}},ju="pending_sessions",Wu="current_session";let Vu=null,$u=null;async function Gu(){return $u||(Vu||($u=new Promise((e,t)=>{const r=indexedDB.open("logspace-sdk-db",1);r.onerror=()=>{$u=null,t(new Error("Failed to open IndexedDB"))},r.onsuccess=()=>{Vu=r.result,e(Vu)},r.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(ju)){t.createObjectStore(ju,{keyPath:"id"}).createIndex("by-created","createdAt")}t.objectStoreNames.contains(Wu)||t.createObjectStore(Wu,{keyPath:"id"})}}),$u))}function Ju(){return"undefined"!=typeof indexedDB}async function Zu(){if(Ju())try{const e=await Gu(),t=e.transaction(Wu,"readwrite").objectStore(Wu);await new Promise((e,r)=>{const s=t.delete("current");s.onsuccess=()=>e(),s.onerror=()=>r(s.error)})}catch(e){console.warn("[LogSpace] Failed to clear session backup:",e)}}async function Yu(e){if(Ju())try{const t=await Gu(),r=t.transaction(ju,"readwrite").objectStore(ju),s={id:e.id,data:e,createdAt:Date.now(),retryCount:0};await new Promise((e,t)=>{const n=r.put(s);n.onsuccess=()=>e(),n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to save pending session:",t)}}async function Hu(){if(!Ju())return[];try{const e=await Gu(),t=e.transaction(ju,"readonly").objectStore(ju);return new Promise((e,r)=>{const s=t.getAll();s.onsuccess=()=>e(s.result||[]),s.onerror=()=>r(s.error)})}catch(e){return console.warn("[LogSpace] Failed to get pending sessions:",e),[]}}async function Xu(e){if(Ju())try{const t=await Gu(),r=t.transaction(ju,"readwrite").objectStore(ju);await new Promise((t,s)=>{const n=r.delete(e);n.onsuccess=()=>t(),n.onerror=()=>s(n.error)})}catch(t){console.warn("[LogSpace] Failed to remove pending session:",t)}}async function Ku(e){if(Ju())try{const t=await Gu(),r=t.transaction(ju,"readwrite").objectStore(ju),s=r.get(e);await new Promise((e,t)=>{s.onsuccess=()=>{const n=s.result;if(n){n.retryCount++,n.lastRetryAt=Date.now();const s=r.put(n);s.onsuccess=()=>e(),s.onerror=()=>t(s.error)}else e()},s.onerror=()=>t(s.error)})}catch(t){console.warn("[LogSpace] Failed to update pending session retry:",t)}}const qu="0.1.0";let Qu=null,eh=null,th=[],rh=[],sh=!1,nh="manual",oh=!1,ih=!1,ah={count:0,windowStart:0},lh={lastLogHash:null,lastLogCount:0},ch=0,uh=0,hh=null,dh=null,ph=null,fh=null,mh=0,gh=!1,yh=null,wh=null,bh=null,Sh=null,vh=null,Ch=null;const Ih={rrweb:!0,console:!0,network:!0,errors:!0,interactions:!0,performance:!0,websocket:!0,sse:!0,storage:!0,resources:!0,spaNavigation:!0},kh={maskAllInputs:!1,checkoutEveryNth:200,recordCanvas:!1},xh={maskSensitiveData:!0,maskSelectors:[],excludeUrls:[],blockNetworkBodies:[],redactHeaders:["authorization","cookie","x-api-key"],logLevels:["log","info","warn","error","debug"]},Eh={maxLogs:1e4,maxSize:10485760,maxDuration:300,idleTimeout:30,navigateAwayTimeout:120,rateLimit:100,deduplicate:!0},Oh={continueOnRefresh:!0,onIdle:!0,onLimitReached:!0},Mh={enabled:!1,bufferBefore:15,recordAfter:15,triggers:{onError:!0,onConsoleError:!0,onNetworkStatus:[500,502,503,504]}};function Lh(e){if(!Qu?.limits.deduplicate)return!0;const t=function(e){return`${e.type}:${JSON.stringify(e.data)}`}(e);if(t===lh.lastLogHash){if(lh.lastLogCount++,th.length>0){const e=th[th.length-1];e&&(e.data.duplicateCount=lh.lastLogCount)}return!1}return lh.lastLogHash=t,lh.lastLogCount=1,!0}function Ah(){Qu?.autoEnd.onIdle&&(Uu.isActive()&&!Uu.isLeaderTab()||(hh&&clearTimeout(hh),hh=setTimeout(()=>{"recording"===eh?.status&&(Qu?.debug&&console.log("[LogSpace] Session auto-ended due to idle timeout"),nh="idle",ih=!0,Qu?.hooks.onLimitReached?.("idle"),Kh.stopSession())},1e3*Qu.limits.idleTimeout)))}function Rh(){Qu&&sh&&(Uu.isActive()&&!Uu.isLeaderTab()||!ih||eh&&"stopped"!==eh.status||(Qu.debug&&console.log("[LogSpace] User activity detected - starting new session"),ih=!1,Kh.startSession()))}const Th=["mousedown","keydown","scroll","touchstart"];function Nh(){const e=Date.now();e-mh<1e3||(mh=e,Ah(),Rh())}function Dh(e,t){Qu?.sampling.enabled&&!gh&&(gh=!0,yh=e,wh=Date.now(),Qu.debug&&console.log(`[LogSpace] Sampling triggered by: ${e}`),Qu.hooks.onSamplingTrigger?.(e,t),bh=setTimeout(()=>{"recording"===eh?.status&&(Qu?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),nh="samplingTriggered",Kh.stopSession())},1e3*Qu.sampling.recordAfter))}const Ph=e=>{if(!Qu||!eh||"recording"!==eh.status)return;if(!function(){if(!Qu)return!1;const e=Date.now();return e-ah.windowStart>1e3?(ah.windowStart=e,ah.count=1,!0):ah.count>=Qu.limits.rateLimit?(Qu.debug&&console.warn("[LogSpace] Rate limit exceeded, dropping log"),!1):(ah.count++,!0)}())return;if(!Lh(e))return;const t=Qu?th.length>=Qu.limits.maxLogs?"maxLogs":ch+uh>=Qu.limits.maxSize?"maxSize":null:null;if(t)return void(Qu.autoEnd.onLimitReached&&(Qu.debug&&console.log(`[LogSpace] Session auto-ended: ${t}`),nh=t,oh=!0,Qu.hooks.onLimitReached?.(t),Kh.stopSession()));const r=Uu.isActive()?Uu.getTabId():"single",s={id:`${th.length+1}`,timestamp:Date.now(),tabId:r,tabUrl:"undefined"!=typeof window?window.location.href:"",type:e.type,data:e.data,severity:e.severity};if(Uu.isActive()&&!Uu.isLeaderTab())return Uu.sendLog(s),Ah(),void(Qu.debug&&console.log("[LogSpace] Captured (sent to leader):",s.type,s.data));th.push(s),ch+=JSON.stringify(s).length,Fh(s),Ah(),function(e){if(Qu?.sampling.enabled&&!gh)if(Qu.sampling.triggers.onError&&"error"===e.type)Dh("error",e);else{if(Qu.sampling.triggers.onConsoleError&&"console"===e.type&&"error"===e.data.level)return void Dh("consoleError",e);if(Qu.sampling.triggers.onNetworkStatus&&"network"===e.type){const t=e.data;if(t.status&&Qu.sampling.triggers.onNetworkStatus.includes(t.status))Dh("networkError",e)}}}(s),Qu.hooks.onAction?.(s,eh),Qu.debug&&console.log("[LogSpace] Captured:",s.type,s.data)};function Fh(e){if(eh)switch(eh.stats.logCount++,e.type){case"network":eh.stats.networkLogCount++;break;case"console":eh.stats.consoleLogCount++,"error"===e.data?.level&&eh.stats.errorCount++;break;case"error":eh.stats.errorCount++;break;case"interaction":eh.stats.interactionLogCount++;break;case"performance":eh.stats.performanceLogCount++;break;case"storage":eh.stats.storageLogCount++;break;case"annotation":eh.stats.annotationCount++}}function _h(){h.uninstall(),b.uninstall(),C.uninstall(),O.uninstall(),R.uninstall(),B.uninstall(),$.uninstall(),ee.uninstall(),ie.uninstall(),ge.uninstall()}let Bh=!1;async function zh(){if(eh&&"recording"===eh.status&&Ju()&&(!Uu.isActive()||Uu.isLeaderTab()))try{await async function(e,t,r,s){if(Ju())try{const n=(await Gu()).transaction(Wu,"readwrite").objectStore(Wu),o={id:"current",sessionId:e,logs:t,rrwebEvents:r,startTime:s.startTime,url:s.url,title:s.title,userId:s.userId,userTraits:s.userTraits,metadata:s.metadata,lastCheckpoint:Date.now()};await new Promise((e,t)=>{const r=n.put(o);r.onsuccess=()=>e(),r.onerror=()=>t(r.error)})}catch(n){console.warn("[LogSpace] Failed to save session checkpoint:",n)}}(eh.id,th,rh,{startTime:eh.startTime,url:eh.url,title:eh.title,userId:eh.userId,userTraits:eh.userTraits,metadata:eh.metadata}),Qu?.debug&&console.log("[LogSpace] Session checkpoint saved",{logs:th.length,rrwebEvents:rh.length})}catch(e){Qu?.debug&&console.warn("[LogSpace] Failed to save checkpoint:",e)}}function Uh(){ph&&(clearInterval(ph),ph=null)}const jh="__logspace_emergency_backup";function Wh(){try{localStorage.removeItem(jh)}catch(e){}}function Vh(){if(Bh)return;if(!Qu||!eh||"recording"!==eh.status)return;if(Uu.isActive()&&!Uu.isLeaderTab())return void(Qu.debug&&console.log("[LogSpace] Follower tab unloading - no session to save (data is with leader)"));Bh=!0,nh="unload";const e=Jh();if(e){if(Qu.autoEnd.continueOnRefresh)try{sessionStorage.setItem("logspace_continuing_session_id",eh.id),sessionStorage.setItem("logspace_continuing_session_start",String(eh.startTime)),sessionStorage.setItem("logspace_continuing_session_saved_at",String(Date.now())),Qu.debug&&console.log("[LogSpace] Session ID and startTime saved for continuation:",eh.id,eh.startTime)}catch{}!function(e){try{if(0===e.logs.length&&(!e.rrwebEvents||e.rrwebEvents.length<3))return;const t=JSON.stringify(e);localStorage.setItem(jh,t)}catch(t){}}(e),Ju()&&Yu(e).catch(()=>{}),Qu.debug&&console.log("[LogSpace] Session saved for recovery on next visit")}}function $h(){if("hidden"===document.visibilityState){if(!Qu||!eh||"recording"!==eh.status)return;const e=1e3*Qu.limits.navigateAwayTimeout;Qu.debug&&console.log(`[LogSpace] Tab hidden, grace period started (${Qu.limits.navigateAwayTimeout}s)`),Qu.capture.rrweb&&_u("tab-hidden",{tabId:Uu.isActive()?Uu.getTabId():"main",timestamp:Date.now()}),fh&&clearTimeout(fh),fh=setTimeout(()=>{if("recording"===eh?.status&&"hidden"===document.visibilityState){if(Uu.isActive()&&!Uu.isLeaderTab())return void(Qu?.debug&&console.log("[LogSpace] Grace period expired, but follower tab - not ending session"));Qu?.debug&&console.log("[LogSpace] Grace period expired, ending session"),nh="navigateAway",Vh()}},e)}else{if(fh&&(Qu?.debug&&console.log("[LogSpace] Tab visible, grace period cancelled"),clearTimeout(fh),fh=null),Qu?.capture.rrweb&&"recording"===eh?.status){const e=Uu.isActive()?Uu.getTabId():"main";Qu.debug&&console.log("[LogSpace] Tab visible, forcing full rrweb snapshot for:",e),_u("tab-visible",{tabId:e,timestamp:Date.now()}),function(){if(Nu.isRecording)try{Tu(!0)}catch(e){console.warn("[LogSpace] Failed to take full snapshot:",e)}}()}Ah()}}function Gh(e){Vh()}function Jh(){if(!eh)return null;if(Qu?.sampling.enabled&&!gh)return Qu.debug&&console.log("[LogSpace] Sampling enabled but not triggered - session not sent"),null;Qu?.sampling.enabled&&gh&&function(){if(!Qu?.sampling.enabled||!wh||!eh)return;const e=wh-1e3*Qu.sampling.bufferBefore,t=wh+1e3*Qu.sampling.recordAfter;th=th.filter(r=>r.timestamp>=e&&r.timestamp<=t),rh=rh.filter(r=>r.timestamp>=e&&r.timestamp<=t),Qu.debug&&console.log(`[LogSpace] Trimmed to sampling window: ${th.length} logs, ${rh.length} rrweb events`)}();const e=Date.now(),t={id:eh.id,startTime:eh.startTime,endTime:e,duration:e-eh.startTime,url:eh.url,title:eh.title,userId:eh.userId,userTraits:eh.userTraits,metadata:eh.metadata,logs:Qu?.hooks.beforeSend?Qu.hooks.beforeSend(th)||[]:th,stats:eh.stats,endReason:nh,recordingType:"rrweb",userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,sdkVersion:qu};return Qu?.sampling.enabled&&gh&&yh&&(t.samplingTrigger=yh),Qu?.capture.rrweb&&rh.length>0&&(t.rrwebEvents=rh),t}async function Zh(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof CompressionStream){const e=new CompressionStream("gzip"),r=e.writable.getWriter();r.write(t),r.close();const s=[],n=e.readable.getReader();for(;;){const{done:e,value:t}=await n.read();if(e)break;s.push(t)}const o=s.reduce((e,t)=>e+t.length,0),i=new Uint8Array(o);let a=0;for(const t of s)i.set(t,a),a+=t.length;return new Blob([i],{type:"application/gzip"})}return new Blob([t],{type:"application/json"})}async function Yh(e){if(!Qu?.serverUrl)throw new Error("No serverUrl configured");const t=JSON.stringify(e),r=await Zh(t),s="application/gzip"===r.type,n=new FormData;n.append("title",e.title||`SDK Session ${e.id}`),n.append("log_file",r,s?`${e.id}.json.gz`:`${e.id}.json`),e.url&&n.append("description",`Recovered session from ${e.url}`);const o={};for(const c of e.logs){const e=c.type||"unknown";o[e]=(o[e]||0)+1}const i={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:e.duration,userAgent:e.userAgent,timestamp:e.startTime,recovered:!0,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};n.append("log_metadata",JSON.stringify(i));const a={...Qu.headers};Qu.apiKey&&(a.Authorization=`Bearer ${Qu.apiKey}`);const l=await fetch(`${Qu.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:a,body:n});if(!l.ok){const e=await l.text();throw new Error(`HTTP ${l.status}: ${e}`)}}function Hh(e,t){if(eh&&"recording"===eh.status){if(e.length>0){const t=new Set(th.map(e=>e.timestamp)),r=e.filter(e=>!t.has(e.timestamp));if(r.length>0){th=[...r,...th];for(const e of r)ch+=JSON.stringify(e).length,Fh(e);Qu?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered logs (${e.length-r.length} duplicates skipped)`)}else Qu?.debug&&console.log(`[LogSpace] All ${e.length} recovered logs already exist, skipping`)}if(t.length>0){const e=new Set(rh.map(e=>e.timestamp)),r=t.filter(t=>!e.has(t.timestamp));if(r.length>0){rh=[...r,...rh];for(const e of r)uh+=JSON.stringify(e).length;Qu?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered rrweb events (${t.length-r.length} duplicates skipped)`)}else Qu?.debug&&console.log(`[LogSpace] All ${t.length} recovered rrweb events already exist, skipping`)}}else Qu?.debug&&console.warn("[LogSpace] Cannot merge recovered data - no active session")}async function Xh(){if(Qu?.serverUrl)try{const t=function(){try{const e=localStorage.getItem(jh);if(e)return JSON.parse(e)}catch(e){}return null}();if(t)if(Ch&&t.id===Ch)Qu.debug&&console.log("[LogSpace] Merging emergency backup into continuing session:",t.id),Hh(t.logs,t.rrwebEvents||[]),Wh(),await Zu();else{Qu.debug&&console.log("[LogSpace] Recovering emergency backup session:",t.id);try{await Yh(t),Wh(),await Zu(),Ju()&&await Xu(t.id),Qu.debug&&console.log("[LogSpace] Emergency backup session sent:",t.id)}catch(e){Ju()&&(await Yu(t),Wh()),Qu.debug&&console.warn("[LogSpace] Error sending emergency backup, saved to IndexedDB:",e)}}if(!Ju())return;await async function(){if(!Ju())return;const t=Date.now();try{const e=await Hu();for(const r of e){const e=t-r.createdAt>6048e5,s=r.retryCount>=5;(e||s)&&await Xu(r.id)}}catch(e){console.warn("[LogSpace] Failed to cleanup old sessions:",e)}}();const r=await Hu();if(0===r.length){const t=await async function(){if(!Ju())return null;try{const e=(await Gu()).transaction(Wu,"readonly").objectStore(Wu);return new Promise((t,r)=>{const s=e.get("current");s.onsuccess=()=>t(s.result||null),s.onerror=()=>r(s.error)})}catch(e){return console.warn("[LogSpace] Failed to get session backup:",e),null}}();if(t&&t.logs.length>0){Qu.debug&&console.log("[LogSpace] Recovering crashed session:",t.sessionId);const e={id:t.sessionId,startTime:t.startTime,endTime:t.lastCheckpoint,duration:t.lastCheckpoint-t.startTime,url:t.url,title:t.title,userId:t.userId,userTraits:t.userTraits,metadata:t.metadata,logs:t.logs,stats:{logCount:t.logs.length,networkLogCount:t.logs.filter(e=>"network"===e.type).length,consoleLogCount:t.logs.filter(e=>"console"===e.type).length,errorCount:t.logs.filter(e=>"error"===e.type).length,storageLogCount:t.logs.filter(e=>"storage"===e.type).length,interactionLogCount:t.logs.filter(e=>"interaction"===e.type).length,performanceLogCount:t.logs.filter(e=>"performance"===e.type).length,annotationCount:t.logs.filter(e=>"annotation"===e.type).length,tabCount:1},endReason:"crash",recordingType:"rrweb",rrwebEvents:t.rrwebEvents,sdkVersion:qu};r.push({id:t.sessionId,data:e,createdAt:t.lastCheckpoint,retryCount:0}),await Zu()}}if(0===r.length)return;Qu.debug&&console.log(`[LogSpace] Recovering ${r.length} pending session(s)`);for(const s of r)if(Ch&&s.id===Ch)Qu.debug&&console.log("[LogSpace] Merging pending session into continuing session:",s.id),Hh(s.data.logs,s.data.rrwebEvents||[]),await Xu(s.id);else try{await Yh(s.data),await Xu(s.id),Qu.debug&&console.log("[LogSpace] Recovered session sent:",s.id)}catch(e){await Ku(s.id),Qu.debug&&console.warn("[LogSpace] Error sending recovered session:",s.id,e)}}catch(e){Qu.debug&&console.warn("[LogSpace] Session recovery failed:",e)}finally{Ch=null}}const Kh={init(e){if(sh)console.warn("[LogSpace] SDK already initialized");else if("undefined"!=typeof window){if(Qu=function(e){return{serverUrl:e.serverUrl,apiKey:e.apiKey,capture:{...Ih,...e.capture},rrweb:{...kh,...e.rrweb},privacy:{...xh,...e.privacy},limits:{...Eh,...e.limits},autoEnd:{...Oh,...e.autoEnd},sampling:{...Mh,...e.sampling,triggers:{...Mh.triggers,...e.sampling?.triggers}},hooks:e.hooks||{},headers:e.headers||{},debug:e.debug||!1,dryRun:e.dryRun||!1}}(e),sh=!0,Qu.debug&&console.log("[LogSpace] SDK initialized",{version:qu,serverUrl:Qu.serverUrl,limits:Qu.limits,persistence:Ju()?"enabled":"disabled",multiTab:Uu.isSupported()?"enabled":"disabled"}),Uu.isSupported()&&Uu.init({onBecomeLeader:(e,t)=>{Qu?.debug&&console.log("[LogSpace] This tab is now the leader",{sessionId:e,isNewSession:t}),t||(Sh=e),eh||Kh.startSession()},onBecomeFollower:e=>{Qu?.debug&&console.log("[LogSpace] This tab is now a follower",{sessionId:e}),eh||Kh.startSession()},onReceiveLog:e=>{"recording"===eh?.status&&(th.push(e),ch+=JSON.stringify(e).length,Fh(e))},onReceiveRRWebEvent:e=>{"recording"===eh?.status&&(rh.push(e),uh+=JSON.stringify(e).length)},onLeaderChanged:e=>{Qu?.debug&&console.log("[LogSpace] Leader changed to:",e)}},Qu.debug),Qu.autoEnd.continueOnRefresh)try{const e=sessionStorage.getItem("logspace_continuing_session_id"),t=sessionStorage.getItem("logspace_continuing_session_start"),r=sessionStorage.getItem("logspace_continuing_session_saved_at");if(sessionStorage.removeItem("logspace_continuing_session_id"),sessionStorage.removeItem("logspace_continuing_session_start"),sessionStorage.removeItem("logspace_continuing_session_saved_at"),e){const s=r?Number(r):0,n=Date.now()-s,o=1e3*Qu.limits.navigateAwayTimeout;s>0&&n>o?Qu.debug&&console.log("[LogSpace] Session continuation expired:",e,`(${Math.round(n/1e3)}s > ${Qu.limits.navigateAwayTimeout}s timeout)`):(Sh=e,Ch=e,t&&(vh=Number(t)),Qu.debug&&console.log("[LogSpace] Continuing session from previous page:",e,"startTime:",t))}}catch{}window.addEventListener("beforeunload",Vh),window.addEventListener("pagehide",Gh),document.addEventListener("visibilitychange",$h),Qu.autoEnd.onIdle&&function(){if("undefined"!=typeof window){for(const e of Th)window.addEventListener(e,Rh,{passive:!0,capture:!0});window.addEventListener("mousemove",Nh,{passive:!0,capture:!0})}}(),Bh=!1,Uu.isActive()||this.startSession(),Xh().catch(()=>{})}else console.warn("[LogSpace] SDK requires browser environment")},startSession(e){if(!sh||!Qu)return void console.warn("[LogSpace] SDK not initialized");if("recording"===eh?.status)return void console.warn("[LogSpace] Session already recording");if(oh)return void(Qu.debug&&console.log("[LogSpace] Session not restarted - previous session ended by hard limit"));let t,r;ih=!1,gh=!1,yh=null,wh=null,bh&&(clearTimeout(bh),bh=null),th=[],rh=[],ch=0,uh=0,ah={count:0,windowStart:0},lh={lastLogHash:null,lastLogCount:0},nh="manual",Uu.isActive()&&Uu.getSessionId()?(t=Uu.getSessionId(),r=Date.now()):Sh?(t=Sh,r=vh||Date.now(),Qu.debug&&console.log("[LogSpace] Using continuing session ID:",t,"with original startTime:",r),Sh=null,vh=null):(t=`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`,r=Date.now()),eh={id:t,startTime:r,status:"recording",url:window.location.href,title:document.title,metadata:e,stats:{logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:Uu.isActive()?0:1}};const s=Uu.isActive()?Uu.getTabId():void 0;if(Qu.capture.rrweb){const e=function(e={},t,r){if(Nu.isRecording)return console.warn("[LogSpace] rrweb recording already in progress"),!1;const s={...Pu,...e};Du=r||null;try{Nu.events=[],Nu.startTime=Date.now(),Nu.isRecording=!0,Nu.stopFn=Mu({emit:(e,r)=>{const s={...e,tabId:Du||void 0};Nu.events.push(s),t?.(s)},maskAllInputs:s.maskAllInputs,maskTextSelector:s.maskTextSelector,blockSelector:s.blockSelector,ignoreSelector:s.ignoreSelector,inlineStylesheet:s.inlineStylesheet,sampling:s.sampling,checkoutEveryNth:s.checkoutEveryNth,checkoutEveryNms:s.checkoutEveryNms,recordCanvas:s.recordCanvas,collectFonts:s.collectFonts,inlineImages:s.inlineImages,plugins:s.plugins})??null;try{Tu(!0)}catch(n){console.warn("[LogSpace] Failed to take initial full snapshot:",n)}return!0}catch(o){return console.error("[LogSpace] Failed to start rrweb recording:",o),Nu.isRecording=!1,!1}}({maskAllInputs:Qu.rrweb.maskAllInputs,maskTextSelector:Qu.rrweb.maskTextSelector,blockSelector:Qu.rrweb.blockSelector,ignoreSelector:Qu.rrweb.ignoreSelector,recordCanvas:Qu.rrweb.recordCanvas,checkoutEveryNth:Qu.rrweb.checkoutEveryNth},e=>{if(!eh||"recording"!==eh.status)return;if(Uu.isActive()&&!Uu.isLeaderTab())return Uu.sendRRWebEvent(e),void Ah();const t=JSON.stringify(e).length;uh+=t;Qu&&ch+uh>=Qu.limits.maxSize?Qu.autoEnd.onLimitReached&&!oh&&(oh=!0,Qu.debug&&console.log("[LogSpace] Session auto-ended: maxSize (rrweb)"),nh="maxSize",Qu.hooks.onLimitReached?.("maxSize"),Kh.stopSession()):(rh.push(e),Ah())},s);Qu.debug&&console.log("[LogSpace] rrweb recording started:",e,s?`(tabId: ${s})`:"")}Qu.limits.maxDuration>0&&(dh=setTimeout(()=>{"recording"===eh?.status&&(Qu?.debug&&console.log("[LogSpace] Session auto-ended: maxDuration"),nh="maxDuration",Qu?.hooks.onLimitReached?.("maxDuration"),this.stopSession())},1e3*Qu.limits.maxDuration)),Ah(),function(){if(!Qu)return;const e={...Qu.privacy};if(Qu.serverUrl){const t=[`${Qu.serverUrl}/api/v1/sessions`,`${Qu.serverUrl}/api/v1/protected/sdk/logs`];e.excludeUrls=[...e.excludeUrls||[],...t]}Qu.capture.console&&h.install(Ph,Qu.privacy),Qu.capture.network&&b.install(Ph,e),Qu.capture.errors&&C.install(Ph,Qu.privacy),Qu.capture.websocket&&O.install(Ph,Qu.privacy),Qu.capture.sse&&R.install(Ph,Qu.privacy),Qu.capture.storage&&B.install(Ph,Qu.privacy),Qu.capture.interactions&&$.install(Ph,Qu.privacy),Qu.capture.performance&&ee.install(Ph,Qu.privacy),Qu.capture.resources&&ie.install(Ph,e),Qu.capture.spaNavigation&&ge.install(Ph,Qu.privacy)}(),!ph&&Ju()&&(ph=setInterval(()=>{zh()},15e3)),eh&&(Qu.hooks.onSessionStart?.(eh),Qu.debug&&console.log("[LogSpace] Session started:",eh.id))},async stopSession(){if(eh&&"stopped"!==eh.status){if(eh.status="stopped",eh.endTime=Date.now(),Sh=null,hh&&(clearTimeout(hh),hh=null),dh&&(clearTimeout(dh),dh=null),fh&&(clearTimeout(fh),fh=null),Uh(),Qu?.capture.rrweb){const e=Fu();Qu.debug&&console.log("[LogSpace] rrweb recording stopped, events:",e.length)}if(_h(),Qu?.hooks.onSessionEnd?.(eh,th),Qu?.debug&&console.log("[LogSpace] Session stopped:",eh.id,{duration:eh.endTime-eh.startTime,logs:th.length,rrwebEvents:rh.length,reason:nh}),!Uu.isActive()||Uu.isLeaderTab())try{await async function(){const e=Jh();if(e){if(Qu?.dryRun)return console.log("[LogSpace] 🔶 DRY RUN - Session payload:",{id:e.id,duration:`${Math.round(e.duration/1e3)}s`,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0,size:`${Math.round(JSON.stringify(e).length/1024)}KB`,reason:e.endReason}),void console.log("[LogSpace] 🔶 Full payload available via LogSpace.getSessionData()");if(Qu?.serverUrl)try{const t=JSON.stringify(e),r=await Zh(t),s="application/gzip"===r.type,n=new FormData;n.append("title",e.title||`SDK Session ${e.id}`),n.append("log_file",r,s?`${e.id}.json.gz`:`${e.id}.json`),e.url&&n.append("description",`Session recorded on ${e.url}`);const o={};for(const c of e.logs){const e=c.type||"unknown";o[e]=(o[e]||0)+1}const i={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:e.duration,userAgent:e.userAgent,timestamp:e.startTime,url:e.url,userId:eh?.userId,userTraits:eh?.userTraits,duration:e.duration,stats:e.stats};n.append("log_metadata",JSON.stringify(i));const a={...Qu.headers};Qu.apiKey&&(a.Authorization=`Bearer ${Qu.apiKey}`);const l=await fetch(`${Qu.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:a,body:n});if(!l.ok){const e=await l.text();throw new Error(`HTTP ${l.status}: ${e}`)}if(Qu.debug){const t=await l.json();console.log("[LogSpace] Session sent successfully:",{sessionId:e.id,logId:t.id,compressed:s,size:`${Math.round(r.size/1024)}KB`})}}catch(t){throw Qu.debug&&console.error("[LogSpace] Failed to send session:",t),Qu.hooks.onError?.(t),t}else Qu?.debug&&console.log("[LogSpace] No serverUrl configured - session stored locally only",{id:e.id,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0})}}(),await Zu(),Wh(),Uu.isActive()&&Uu.endSession()}catch(e){const t=Jh();throw t&&await Yu(t),e}}},identify(e,t){eh&&(eh.userId=e,eh.userTraits=t,Uu.isActive()&&Uu.updateSessionUser(e,t),Qu?.debug&&console.log("[LogSpace] User identified:",e))},track(e,t){Ph({type:"annotation",data:{annotationType:"event",event:e,properties:t}})},breadcrumb(e,t){Ph({type:"annotation",data:{annotationType:"breadcrumb",message:e,category:t}})},pauseRecording(){"recording"===eh?.status&&(eh.status="paused",Qu?.debug&&console.log("[LogSpace] Recording paused"))},resumeRecording(){"paused"===eh?.status&&(eh.status="recording",Ah(),Qu?.debug&&console.log("[LogSpace] Recording resumed"))},trigger(e){Qu?.sampling.enabled?(Qu.debug&&console.log("[LogSpace] Manual sampling trigger:",e||"user_triggered"),Dh("manual")):Qu?.debug&&console.log("[LogSpace] trigger() called but sampling is not enabled")},getSession:()=>eh,getSessionLogs:()=>[...th],getSessionData:()=>Jh(),getRRWebEvents:()=>[...rh],destroy(){if(!sh)return;hh&&(clearTimeout(hh),hh=null),dh&&(clearTimeout(dh),dh=null),bh&&(clearTimeout(bh),bh=null),fh&&(clearTimeout(fh),fh=null),Uh(),Uu.isActive()&&Uu.cleanup(),Qu?.capture.rrweb&&Fu(),"undefined"!=typeof window&&(window.removeEventListener("beforeunload",Vh),window.removeEventListener("pagehide",Gh),document.removeEventListener("visibilitychange",$h)),function(){if("undefined"!=typeof window){for(const e of Th)window.removeEventListener(e,Rh,{capture:!0});window.removeEventListener("mousemove",Nh,{capture:!0})}}(),_h(),Vu&&(Vu.close(),Vu=null,$u=null);const e=Qu?.debug;Qu=null,eh=null,th=[],rh=[],ch=0,uh=0,oh=!1,ih=!1,gh=!1,yh=null,wh=null,Ch=null,Bh=!1,mh=0,sh=!1,e&&console.log("[LogSpace] SDK destroyed")},version:qu};return e.LogSpace=Kh,e.default=Kh,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
1
|
+
var LogSpace=function(e){"use strict";function t(e){if(e.id)return`#${e.id}`;let t="";if(e.className&&("string"==typeof e.className?t=e.className:e.className&&"object"==typeof e.className&&"baseVal"in e.className&&(t=e.className.baseVal||""),t&&"string"==typeof t)){const r=t.split(" ").filter(e=>e).join(".");if(r)return`${e.tagName.toLowerCase()}.${r}`}return e.tagName.toLowerCase()}function r(e){try{if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);if(null===e)return"null";if(void 0===e)return"undefined";if("undefined"!=typeof FormData&&e instanceof FormData){const t={};return e.forEach((e,r)=>{if("undefined"!=typeof Blob&&e instanceof Blob){const s=e,n="undefined"!=typeof File&&e instanceof File?`File(${e.name}, ${s.size}b)`:`Blob(${s.size}b)`;if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,n]:[e,n]}else t[r]=n}else{const s=String(e).length>1e3?String(e).substring(0,1e3)+"...":String(e);if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,s]:[e,s]}else t[r]=s}}),JSON.stringify(t)}if("undefined"!=typeof Blob&&e instanceof Blob)return e instanceof File?`File(${e.name}, ${e.size}b, ${e.type})`:`Blob(${e.size}b, ${e.type})`;const t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}catch(t){return String(e)}}function s(e){if(!e||"string"!=typeof e)return e;let t=e;const r=[{pattern:/\b(?:\d{4}[-\s]?){3}\d{4}\b/g,replacement:"[CREDIT_CARD_REDACTED]"},{pattern:/\b\d{3}-?\d{2}-?\d{4}\b/g,replacement:"[SSN_REDACTED]"},{pattern:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,replacement:"[EMAIL_REDACTED]"},{pattern:/\b(?:\+?1[-.\s]?)?\(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}\b/g,replacement:"[PHONE_REDACTED]"},{pattern:/"password"\s*:\s*"[^"]*"/gi,replacement:'"password": "[REDACTED]"'},{pattern:/'password'\s*:\s*'[^']*'/gi,replacement:"'password': '[REDACTED]'"},{pattern:/"(?:api_?key|token|secret|auth_?token|access_?token)"\s*:\s*"[^"]*"/gi,replacement:'"$1": "[REDACTED]"'},{pattern:/'(?:api_?key|token|secret|auth_?token|access_?token)'\s*:\s*'[^']*'/gi,replacement:"'$1': '[REDACTED]'"},{pattern:/Authorization:\s*Bearer\s+[^\s]+/gi,replacement:"Authorization: Bearer [REDACTED]"},{pattern:/Authorization:\s*Basic\s+[^\s]+/gi,replacement:"Authorization: Basic [REDACTED]"},{pattern:/\b[A-Za-z0-9-_]{36,}\.[A-Za-z0-9-_]{36,}\.[A-Za-z0-9-_]{36,}\b/g,replacement:"[JWT_TOKEN_REDACTED]"}];for(const{pattern:s,replacement:n}of r)t=t.replace(s,n);return t}function n(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(e,t){if(!e||!t||0===t.length)return!1;try{const r=new URL(e).hostname.toLowerCase(),s=e.toLowerCase();for(const e of t){const t=e.trim();if(t)try{const e=new RegExp(t,"i");if(e.test(r)||e.test(s))return!0}catch{}}}catch{}return!1}function i(){try{const e=(new Error).stack||"";return e.split("\n").slice(3).slice(0,3).join("\n").trim()}catch{return""}}function a(e,t){if(JSON.stringify(e).length<=t)return e;if(Array.isArray(e)){const r=[];let s=2;for(let n=0;n<e.length;n++){const o=JSON.stringify(e[n]).length+(n>0?1:0);if(s+o>t-100){const t=e.length-n;r.push({__logspace_truncated:!0,__remaining_items:t,__original_length:e.length});break}r.push(e[n]),s+=o}return r}if("object"==typeof e&&null!==e){const r={};let s=2;const n=Object.entries(e);for(let e=0;e<n.length;e++){const o=n[e];if(!o)continue;const[i,l]=o,c=JSON.stringify({[i]:l}).length-2+(e>0?1:0);if(s+c>t-150){const t=n.length-e;r.__logspace_truncated=!0,r.__remaining_properties=t;break}if("string"==typeof l&&l.length>1e3)r[i]=l.substring(0,1e3)+"... [truncated]";else if("object"==typeof l&&null!==l){JSON.stringify(l).length>5e3?r[i]=a(l,5e3):r[i]=l}else r[i]=l;s+=c}return r}return e}function l(e,t,s=1e4){if(t){const t=e instanceof ArrayBuffer?e.byteLength:e.size||0;return{content:`[Binary: ${t} bytes]`,size:t,truncated:!0}}const n="string"==typeof e?e:r(e),o=new Blob([n]).size;if(o>s){const e=n.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=a(JSON.parse(n),s);return{content:JSON.stringify(e),size:o,truncated:!0}}catch{}return{content:n.substring(0,s)+"... [truncated]",size:o,truncated:!0}}return{content:n,size:o,truncated:!1}}function c(e,t,r="info"){return{id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),type:e,data:t,severity:r}}let u=null;const h=new Map;const d={name:"console",install(e,t){if(!n())return;if(u)return;const s=["log","info","warn","error","debug"],o=t.logLevels||s;u={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug,time:console.time,timeEnd:console.timeEnd,timeLog:console.timeLog},s.forEach(t=>{console[t]=function(...s){if(u[t].apply(console,s),!o.includes(t))return;if(function(e){if(!e||0===e.length)return!1;for(const r of e){const e=String(r||"");if(e.includes("[LogSpace]")||e.includes("LogSpace"))return!0}const t=String(e[0]||"");return!!(t.includes("[HMR]")||t.includes("hot update")||t.includes("@react-refresh")||t.includes("[vite]")||t.includes("vite:")||t.includes("[webpack-dev-server]")||t.includes("[WDS]")||t.includes("[Fast Refresh]")||t.includes("next-dev"))}(s))return;const n=s.map(e=>r(e));let i;i="error"===t?"error":"warn"===t?"warn":"info";const a=c("console",{level:t,args:n,stackTrace:"error"===t?(new Error).stack:void 0},i);e(a)}}),console.time=function(e="default"){u.time.call(console,e),h.set(e,performance.now())},console.timeLog=function(t="default",...s){u.timeLog.apply(console,[t,...s]);const n=h.get(t);if(void 0===n)return;const o=performance.now()-n,i=s.map(e=>r(e)),a=c("console",{level:"timeLog",args:[`${t}: ${o.toFixed(3)}ms`,...i],timerLabel:t,duration:o},"info");e(a)},console.timeEnd=function(t="default"){u.timeEnd.call(console,t);const r=h.get(t);if(void 0===r)return;const s=performance.now()-r;h.delete(t);const n=c("console",{level:"timeEnd",args:[`${t}: ${s.toFixed(3)}ms`],timerLabel:t,duration:s},"info");e(n)}},uninstall(){n()&&u&&(console.log=u.log,console.info=u.info,console.warn=u.warn,console.error=u.error,console.debug=u.debug,console.time=u.time,console.timeEnd=u.timeEnd,console.timeLog=u.timeLog,h.clear(),u=null)}},p=5e3;let f=null,m=null,g=[],y=null;const w=new Map;function b(e){const t=Date.now();let r=w.get(e);r||(r={lastCapture:0},w.set(e,r));return t-r.lastCapture>=100&&(r.lastCapture=t,!0)}const S={name:"network",install(e,t){if(!n())return;if(f)return;y=e,g=t.excludeUrls||[];const s=t.blockNetworkBodies||[];f=window.fetch,window.fetch=async function(...t){const n=performance.now(),a=t[0],u="string"==typeof a?a:a instanceof Request?a.url:a.toString(),h=t[1]||{},d=h.method||(a instanceof Request?a.method:"GET"),m=i();if(o(u,g))return f(...t);const S=s.some(e=>{try{return new RegExp(e,"i").test(u)}catch{return!1}});let v,C={};if(a instanceof Request&&(C=Object.fromEntries(a.headers.entries())),h.headers){const e=Object.fromEntries(new Headers(h.headers).entries());C={...C,...e}}if(!S&&h.body){const e=r(h.body);v=e.length>p?e.substring(0,p)+"...":e}try{const r=await f(...t),s=performance.now()-n,o=r.headers.get("content-type")||"unknown",i=r.headers.get("content-length"),a=r.clone();let h,g,I;try{if(!S&&(o.includes("application/json")||o.includes("text/plain")||o.includes("text/html"))){const e=await a.text();h=e.length>p?e.substring(0,p)+"...":e,g=new Blob([h]).size}else i&&(g=parseInt(i,10))}catch{}I=r.status>=500?"error":r.status>=400?"warn":"info";const k=o.includes("text/event-stream"),x=c("network",{method:d,url:u,status:r.status,requestHeaders:C,responseHeaders:Object.fromEntries(r.headers.entries()),requestBody:v,responseBody:k?void 0:h,contentType:o,contentLength:g,duration:s,timestamp:Date.now(),initiator:m,isSSEStream:k},I);if(e(x),k&&r.body&&y){const t=c("sse",{url:u,event:"open",timestamp:Date.now()});return e(t),function(e,t,r){if(!e.body)return e;const s=e.body.getReader(),n=new TextDecoder;let o="",i={data:[]};const a=new ReadableStream({async start(e){try{for(;;){const{done:a,value:u}=await s.read();if(a){e.close(),w.delete(t);break}e.enqueue(u),o+=n.decode(u,{stream:!0});const h=o.split("\n");o=h.pop()||"";for(const e of h){if(""===e.trim()){if(i.data.length>0&&b(t)){const e=i.data.join("\n"),{content:s,size:n}=l(e,!1),o=c("sse",{url:t,event:"message",eventType:i.event||"message",message:s,messageSize:n,lastEventId:i.id,timestamp:Date.now()});r(o)}i={data:[]};continue}const s=e.indexOf(":");if(-1===s)continue;const n=e.slice(0,s),o=e.slice(s+1).trimStart();switch(n){case"data":i.data.push(o);break;case"event":i.event=o;break;case"id":i.id=o}}}}catch(a){e.error(a),w.delete(t)}},cancel(){s.cancel(),w.delete(t)}});return new Response(a,{headers:e.headers,status:e.status,statusText:e.statusText})}(r,u,y)}return r}catch(I){const t=performance.now()-n;let r="Unknown error";if(I instanceof TypeError){r=I.message;try{new URL(u,window.location.href).origin!==window.location.origin&&(r=`${r} - CORS policy may be blocking this request`)}catch{}}else I instanceof Error&&(r=I.message);const s=c("network",{method:d,url:u,status:0,requestHeaders:C,responseHeaders:{},requestBody:v,duration:t,timestamp:Date.now(),initiator:m,error:r},"error");throw e(s),I}},m=window.XMLHttpRequest,window.XMLHttpRequest=function(){const t=new m,s=performance.now(),n=i();let a,l="",u="";const h={},d=t.open;t.open=function(e,t,...r){return l=e,u=t,d.apply(this,[e,t,...r])};const f=t.setRequestHeader;t.setRequestHeader=function(e,t){return h[e]=t,f.apply(this,[e,t])};const y=t.send;let w;return t.send=function(e){if(e&&!o(u,g)){const t=r(e);a=t.length>p?t.substring(0,p)+"...":t}return y.apply(this,[e])},t.addEventListener("error",()=>{w="Network request failed"}),t.addEventListener("timeout",()=>{w="Request timeout"}),t.addEventListener("abort",()=>{w="Request aborted"}),t.addEventListener("loadend",()=>{if(o(u,g))return;const i=performance.now()-s,d=t.getResponseHeader("content-type")||"unknown",f=t.getResponseHeader("content-length"),m={},y=t.getAllResponseHeaders();let b,S,v;if(y&&y.split("\r\n").forEach(e=>{const t=e.split(": "),r=t.shift(),s=t.join(": ");r&&s&&(m[r.toLowerCase()]=s)}),d.includes("application/json")||d.includes("text/plain")||d.includes("text/html"))try{let e;e=""===t.responseType||"text"===t.responseType?t.responseText:"json"===t.responseType&&t.response?r(t.response):"",e&&(b=e.length>p?e.substring(0,p)+"...":e,S=new Blob([b]).size)}catch{}else f&&(S=parseInt(f,10));v=t.status>=500||w?"error":t.status>=400?"warn":"info";const C=c("network",{method:l,url:u,status:t.status,requestHeaders:h,responseHeaders:m,requestBody:a,responseBody:b,contentType:d,contentLength:S,duration:i,timestamp:Date.now(),initiator:n,...w&&{error:w}},v);e(C)}),t},window.XMLHttpRequest.prototype=m.prototype},uninstall(){n()&&(f&&(window.fetch=f,f=null),m&&(window.XMLHttpRequest=m,m=null),y=null,w.clear())}};let v=null,C=null;const I={name:"errors",install(e,t){n()&&(v||(v=t=>{const r=c("error",{message:t.message,stack:`${t.filename}:${t.lineno}:${t.colno}`,context:{},isUncaught:!0},"error");e(r)},window.addEventListener("error",v,!0),C=t=>{const s=c("error",{message:`Unhandled Promise Rejection: ${r(t.reason)}`,stack:t.reason?.stack||"",context:{},isUncaught:!0},"error");e(s)},window.addEventListener("unhandledrejection",C)))},uninstall(){n()&&(v&&(window.removeEventListener("error",v,!0),v=null),C&&(window.removeEventListener("unhandledrejection",C),C=null))}};let k=null,x=[];const E=new Map;function O(e,t){const r=Date.now();let s=E.get(e);s||(s={sent:{lastCapture:0,messageCount:0,sampleRate:1},received:{lastCapture:0,messageCount:0,sampleRate:1}},E.set(e,s));const n=s[t],o=r-n.lastCapture;if(n.lastCapture>0&&r-n.lastCapture<1e3){n.messageCount++;const e=n.messageCount/((r-n.lastCapture)/1e3);n.sampleRate=e>50?.1:e>10?.5:1}else n.messageCount=1,n.sampleRate=1;const i=o>=100&&(n.sampleRate>=1||Math.random()<n.sampleRate);return i&&(n.lastCapture=r),i}const L={name:"websocket",install(e,t){if(!n())return;if(k)return;x=t.excludeUrls||[],k=window.WebSocket,window.WebSocket=function(t,r){const s=new k(t,r),n=t.toString();if(o(n,x))return s;s.addEventListener("open",()=>{const t=c("websocket",{url:n,event:"open",readyState:s.readyState,timestamp:Date.now()});e(t)}),s.addEventListener("message",t=>{if(!O(s,"received"))return;const r=t.data instanceof ArrayBuffer||t.data instanceof Blob,{content:o,size:i}=l(t.data,r),a=c("websocket",{url:n,event:"message",direction:"received",message:o,messageSize:i,isBinary:r,readyState:s.readyState,timestamp:Date.now()});e(a)});const i=s.send.bind(s);return s.send=function(t){if(O(s,"sent")){const r=t instanceof ArrayBuffer||t instanceof Blob,{content:o,size:i}=l(t,r),a=c("websocket",{url:n,event:"message",direction:"sent",message:o,messageSize:i,isBinary:r,readyState:s.readyState,timestamp:Date.now()});e(a)}return i(t)},s.addEventListener("error",()=>{const t=c("websocket",{url:n,event:"error",readyState:s.readyState,timestamp:Date.now()},"error");e(t)}),s.addEventListener("close",t=>{const r=c("websocket",{url:n,event:"close",code:t.code,reason:t.reason,readyState:s.readyState,timestamp:Date.now()});e(r),E.delete(s)}),s},window.WebSocket.prototype=k.prototype,Object.setPrototypeOf(window.WebSocket,k);["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(e=>{Object.defineProperty(window.WebSocket,e,{value:k[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){n()&&k&&(window.WebSocket=k,k=null,E.clear())}};let M=null,A=[];const R=new Map;const T={name:"sse",install(e,t){if(!n())return;if(!window.EventSource)return;if(M)return;A=t.excludeUrls||[],M=window.EventSource,window.EventSource=function(t,r){const s=new M(t,r),n=t.toString();return o(n,A)||(s.addEventListener("open",()=>{const t=c("sse",{url:n,event:"open",readyState:s.readyState,timestamp:Date.now()});e(t)}),s.addEventListener("message",t=>{if(!function(e){const t=Date.now();let r=R.get(e);return r||(r={lastCapture:0},R.set(e,r)),t-r.lastCapture>=100&&(r.lastCapture=t,!0)}(s))return;const{content:r,size:o}=l(t.data,!1),i=c("sse",{url:n,event:"message",message:r,messageSize:o,lastEventId:t.lastEventId,readyState:s.readyState,timestamp:Date.now()});e(i)}),s.addEventListener("error",()=>{const t=c("sse",{url:n,event:"error",readyState:s.readyState,timestamp:Date.now()},"error");e(t),s.readyState===EventSource.CLOSED&&R.delete(s)})),s},window.EventSource.prototype=M.prototype,Object.setPrototypeOf(window.EventSource,M);["CONNECTING","OPEN","CLOSED"].forEach(e=>{Object.defineProperty(window.EventSource,e,{value:M[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){n()&&M&&(window.EventSource=M,M=null,R.clear())}},N=5e3;let D=null,P=null,F=!1,_=null;function B(e){const t="string"==typeof e?e:r(e),s=new Blob([t]).size;if(s>N){const e=t.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=a(JSON.parse(t),N);return{content:JSON.stringify(e),size:s}}catch{}return{content:t.substring(0,N)+"... [truncated]",size:s}}return{content:t,size:s}}const z={name:"storage",install(e,t){n()&&(D||(_=e,D={setItem:Storage.prototype.setItem,removeItem:Storage.prototype.removeItem,clear:Storage.prototype.clear},Storage.prototype.setItem=function(t,r){const s=this===sessionStorage;if(F||t.startsWith("__logspace"))return D.setItem.call(this,t,r);const n=this.getItem(t),o=D.setItem.call(this,t,r);try{F=!0;const o=s?"sessionStorage":"localStorage",{content:i,size:a}=B(r),l=c("storage",{storageType:o,operation:"setItem",key:t,value:i,oldValue:n?B(n).content:void 0,valueSize:a});e(l)}finally{F=!1}return o},Storage.prototype.removeItem=function(t){const r=this===sessionStorage;if(F||t.startsWith("__logspace"))return D.removeItem.call(this,t);const s=this.getItem(t),n=D.removeItem.call(this,t);F=!0;try{const n=c("storage",{storageType:r?"sessionStorage":"localStorage",operation:"removeItem",key:t,oldValue:s?B(s).content:void 0});e(n)}finally{F=!1}return n},Storage.prototype.clear=function(){const t=this===sessionStorage,r=D.clear.call(this);if(F)return r;F=!0;try{const r=c("storage",{storageType:t?"sessionStorage":"localStorage",operation:"clear"});e(r)}finally{F=!1}return r},window.IDBDatabase&&(P=IDBDatabase.prototype.transaction,IDBDatabase.prototype.transaction=function(e,t,...r){const s=P.call(this,e,t,...r),n=this.name;if("logspace-sdk-db"===n)return s;if(_&&!F){const r=c("storage",{storageType:"indexedDB",operation:"readwrite"===t?"setItem":"getItem",dbName:n,storeName:Array.isArray(e)?e.join(", "):e});_(r)}return s})))},uninstall(){n()&&(D&&(Storage.prototype.setItem=D.setItem,Storage.prototype.removeItem=D.removeItem,Storage.prototype.clear=D.clear,D=null),P&&window.IDBDatabase&&(IDBDatabase.prototype.transaction=P,P=null),_=null)}};let U,j=null,W=null,$=null,V=null;const G={name:"interactions",install(e,r){if(!n())return;if(j)return;const o=r.maskSelectors||[];function i(e){return 0!==o.length&&o.some(t=>{try{return e.matches(t)||e.closest(t)}catch{return!1}})}j=n=>{const o=n.target;if(!o)return;let a=o.textContent?.substring(0,100);r.maskSensitiveData&&a&&(a=s(a)),i(o)&&(a="[MASKED]");const l=c("interaction",{eventType:"click",element:{selector:t(o),tagName:o.tagName,text:a},coordinates:{x:n.clientX,y:n.clientY}});e(l)},document.addEventListener("click",j,!0),W=n=>{const o=n.target;if(!o||"INPUT"!==o.tagName&&"TEXTAREA"!==o.tagName)return;const a="password"===o.type||o.name?.toLowerCase().includes("password")||o.name?.toLowerCase().includes("credit")||o.name?.toLowerCase().includes("ssn")||o.autocomplete?.includes("current-password")||o.autocomplete?.includes("new-password")||i(o);let l=o.value;r.maskSensitiveData&&(l=a?"[SENSITIVE_INPUT_REDACTED]":s(l));const u=c("interaction",{eventType:"input",element:{selector:t(o),tagName:o.tagName},value:l});e(u)},document.addEventListener("input",W,!0),$=r=>{const s=r.target;if(!s)return;const n=c("interaction",{eventType:"submit",element:{selector:t(s),tagName:s.tagName}});e(n)},document.addEventListener("submit",$,!0),V=()=>{clearTimeout(U),U=setTimeout(()=>{const t=c("interaction",{eventType:"scroll",element:{selector:"document",tagName:"document"},coordinates:{x:window.scrollX,y:window.scrollY}});e(t)},500)},document.addEventListener("scroll",V,!0)},uninstall(){n()&&(j&&(document.removeEventListener("click",j,!0),j=null),W&&(document.removeEventListener("input",W,!0),W=null),$&&(document.removeEventListener("submit",$,!0),$=null),V&&(document.removeEventListener("scroll",V,!0),V=null),U&&clearTimeout(U))}};let J=null,Z=null,Y=null,H=null,X=null;const K={lcp:null,fid:null,cls:0,fcp:null,ttfb:null,inp:null,clsEntries:[],sent:!1};let q=null;function Q(e,t){const r={LCP:{good:2500,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1800,poor:3e3},TTFB:{good:800,poor:1800},INP:{good:200,poor:500}}[e];return r?t<=r.good?"good":t<=r.poor?"needs-improvement":"poor":"good"}function ee(){if(K.sent||!q)return;if(!(null!==K.lcp||null!==K.fcp||null!==K.ttfb||null!==K.fid||null!==K.inp||K.cls>0))return;K.sent=!0;const e={};null!==K.lcp&&(e.LCP={value:K.lcp,rating:Q("LCP",K.lcp)}),null!==K.fid&&(e.FID={value:K.fid,rating:Q("FID",K.fid)}),K.cls>0&&(e.CLS={value:K.cls,rating:Q("CLS",K.cls)}),null!==K.fcp&&(e.FCP={value:K.fcp,rating:Q("FCP",K.fcp)}),null!==K.ttfb&&(e.TTFB={value:K.ttfb,rating:Q("TTFB",K.ttfb)}),null!==K.inp&&(e.INP={value:K.inp,rating:Q("INP",K.inp)});const t=c("performance",{metric:"Web Vitals",vitals:e});q(t)}const te={name:"performance",install(e,t){if(n()&&"PerformanceObserver"in window&&!J){q=e;try{J=new PerformanceObserver(e=>{const t=e.getEntries(),r=t[t.length-1];K.lcp=r.renderTime||r.loadTime}),J.observe({type:"largest-contentful-paint",buffered:!0}),Z=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{null===K.fid&&(K.fid=e.processingStart-e.startTime)})}),Z.observe({type:"first-input",buffered:!0}),Y=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{K.clsEntries.push(e),K.cls=function(e){let t=0,r=[];return e.forEach(e=>{if(!e.hadRecentInput){const s=r[0],n=r[r.length-1];t&&n&&e.startTime-n.startTime<1e3&&e.startTime-s.startTime<5e3?(t+=e.value,r.push(e)):(t=e.value,r=[e])}}),t}(K.clsEntries)})}),Y.observe({type:"layout-shift",buffered:!0}),H=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"first-contentful-paint"===e.name&&(K.fcp=e.startTime)})}),H.observe({type:"paint",buffered:!0});try{X=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{const t=e.processingEnd-e.startTime;(null===K.inp||t>K.inp)&&(K.inp=t)})}),X.observe({type:"event",buffered:!0,durationThreshold:16})}catch{}window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&ee()}),window.addEventListener("load",()=>{setTimeout(()=>{!function(){if(!q)return;const e=performance.getEntriesByType("navigation");if(0===e.length)return;const t=e[0];K.ttfb=t.responseStart-t.requestStart;const r=c("performance",{metric:"Navigation",timing:{ttfb:Math.round(K.ttfb),dnsLookup:Math.round(t.domainLookupEnd-t.domainLookupStart),tcpConnection:Math.round(t.connectEnd-t.connectStart),domContentLoaded:Math.round(t.domContentLoadedEventEnd-t.startTime),pageLoad:Math.round(t.loadEventEnd-t.startTime)}});q(r)}()},0)}),setTimeout(()=>{ee()},1e4)}catch{}}},uninstall(){n()&&([J,Z,Y,H,X].forEach(e=>{e&&e.disconnect()}),J=null,Z=null,Y=null,H=null,X=null,q=null,K.lcp=null,K.fid=null,K.cls=0,K.fcp=null,K.ttfb=null,K.inp=null,K.clsEntries=[],K.sent=!1)}};let re=null,se=[];const ne=new Set;let oe=null;function ie(e){if(!oe)return;if("resource"!==e.entryType)return;if("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)return;const t=`${e.name}-${e.startTime}`;if(ne.has(t))return;if(ne.add(t),o(e.name,se))return;const r=function(e){const t=e.initiatorType||"other",r=e.name;return r.match(/\.(woff|woff2|ttf|otf|eot)(\?|$)/i)?"font":r.match(/\.(css)(\?|$)/i)?"stylesheet":r.match(/\.(js|mjs|jsx|ts|tsx)(\?|$)/i)?"script":r.match(/\.(png|jpg|jpeg|gif|webp|svg|ico|avif|bmp)(\?|$)/i)?"image":r.match(/\.(mp4|webm|ogg|mp3|wav|m4a|aac|flac)(\?|$)/i)?"media":"xmlhttprequest"===t||"fetch"===t?t:"link"===t?"stylesheet":"script"===t?"script":"img"===t?"image":t}(e),s=e.duration,n=e.transferSize||0,i=e.decodedBodySize||0,a=e.encodedBodySize||0,l=0===n||a>0&&n<a;let u="info";s>3e3?u="error":s>1e3&&(u="warn");const h=c("network",{method:"GET",url:e.name,status:200,resourceType:r,initiatorType:e.initiatorType,duration:Math.round(s),transferSize:n,decodedBodySize:i,encodedBodySize:a,cached:l,timing:{dns:Math.round(e.domainLookupEnd-e.domainLookupStart),tcp:Math.round(e.connectEnd-e.connectStart),ssl:e.secureConnectionStart>0?Math.round(e.connectEnd-e.secureConnectionStart):0,request:Math.round(e.responseStart-e.requestStart),response:Math.round(e.responseEnd-e.responseStart)},timestamp:Date.now()},u);oe(h)}const ae={name:"resources",install(e,t){if(n()&&"PerformanceObserver"in window&&!re){oe=e,se=t.excludeUrls||[];try{performance.getEntriesByType("resource").forEach(e=>{ie(e)}),re=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{ie(e)})}),re.observe({type:"resource",buffered:!1})}catch{}}},uninstall(){n()&&(re&&(re.disconnect(),re=null),oe=null)},reset(){ne.clear()}};let le=null,ce=null,ue=null,he="",de=0,pe=null,fe=null,me=null;function ge(e="client-side"){const t=location.href;t!==he&&function(e,t,r){if(!ue||e===t)return;const s=performance.now()-de,n=c("performance",{metric:"SPA Navigation",from:e,to:t,duration:Math.round(s),navigationType:r,timestamp:Date.now()});ue(n),he=t,de=performance.now()}(he,t,e)}const ye={name:"spa-navigation",install(e,t){if(n()&&!le){if(ue=e,he=location.href,de=performance.now(),le=history.pushState,ce=history.replaceState,history.pushState=function(...e){const t=le.apply(this,e);return ge("pushState"),t},history.replaceState=function(...e){const t=ce.apply(this,e);return ge("replaceState"),t},me=()=>{ge("popstate")},window.addEventListener("popstate",me),pe=new MutationObserver(()=>{fe&&clearTimeout(fe),fe=setTimeout(()=>{ge("dom-mutation")},100)}),document.body)pe.observe(document.body,{childList:!0,subtree:!0});else{const e=new MutationObserver(()=>{document.body&&(pe.observe(document.body,{childList:!0,subtree:!0}),e.disconnect())});e.observe(document.documentElement,{childList:!0})}window.addEventListener("hashchange",()=>{de=performance.now(),ge("hashchange")})}},uninstall(){n()&&(le&&(history.pushState=le,le=null),ce&&(history.replaceState=ce,ce=null),me&&(window.removeEventListener("popstate",me),me=null),pe&&(pe.disconnect(),pe=null),fe&&(clearTimeout(fe),fe=null),ue=null,he="",de=0)}};var we,be=Object.defineProperty,Se=(e,t,r)=>((e,t,r)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ve=Object.defineProperty,Ce=(e,t,r)=>((e,t,r)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ie=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ie||{});const ke={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},xe={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ee={};function Oe(e){if(Ee[e])return Ee[e];const t=globalThis[e],r=t.prototype,s=e in ke?ke[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in xe?xe[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return Ee[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?Ee[e]=o:r}catch{return r}}const Le={};function Me(e,t,r){var s;const n=`${e}.${String(r)}`;if(Le[n])return Le[n].call(t);const o=Oe(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(Le[n]=i,i.call(t)):t[r]}const Ae={};function Re(e,t,r){const s=`${e}.${String(r)}`;if(Ae[s])return Ae[s].bind(t);const n=Oe(e)[r];return"function"!=typeof n?t[r]:(Ae[s]=n,n.bind(t))}const Te={childNodes:function(e){return Me("Node",e,"childNodes")},parentNode:function(e){return Me("Node",e,"parentNode")},parentElement:function(e){return Me("Node",e,"parentElement")},textContent:function(e){return Me("Node",e,"textContent")},contains:function(e,t){return Re("Node",e,"contains")(t)},getRootNode:function(e){return Re("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Me("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Me("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Me("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Me("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Oe("MutationObserver").constructor}};function Ne(e){return e.nodeType===e.ELEMENT_NODE}function De(e){const t=e&&"host"in e&&"mode"in e&&Te.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Te.shadowRoot(t)===e)}function Pe(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Fe(e){try{const r=e.rules||e.cssRules;if(!r)return null;let s=e.href;!s&&e.ownerNode&&e.ownerNode.ownerDocument&&(s=e.ownerNode.ownerDocument.location.href);const n=Array.from(r,e=>_e(e,s)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(r){return null}var t}function _e(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Fe(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?Ye(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?Ye(r,t):r}}class Be{constructor(){Ce(this,"idNodeMap",new Map),Ce(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const 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 ze({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:o}){let i=n||"";const a=s&&Ue(s);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function Ue(e){return e.toLowerCase()}const je="__rrweb_original__";function We(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ue(t):null}function $e(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(n){return null}const s=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}const Ve=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ge=/^(?:[a-z+]+:)?\/\//i,Je=/^www\..*/i,Ze=/^(data:)([^,]*),(.*)/i;function Ye(e,t){return(e||"").replace(Ve,(e,r,s,n,o,i)=>{const a=s||o||i,l=r||n||"";if(!a)return e;if(Ge.test(a)||Je.test(a))return`url(${l}${a}${l})`;if(Ze.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),u=a.split("/");c.pop();for(const t of u)"."!==t&&(".."===t?c.pop():c.push(t));return`url(${l}${c.join("/")}${l})`})}function He(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Xe(e,t){return function(e,t){const r=Array.from(t.childNodes),s=[];if(r.length>1&&e&&"string"==typeof e){const t=He(e);for(let n=1;n<r.length;n++)if(r[n].textContent&&"string"==typeof r[n].textContent){const o=He(r[n].textContent);for(let r=3;r<o.length;r++){const n=o.substring(0,r);if(2===t.split(n).length){const r=t.indexOf(n);for(let t=r;t<e.length;t++)if(He(e.substring(0,t)).length===r){s.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}let Ke=1;const qe=new RegExp("[^a-z0-9-_:]");function Qe(){return Ke++}let et,tt;const rt=/^[^ \t\n\r\u000c]+/,st=/^[, \t\n\r\u000c]+/;const nt=new WeakMap;function ot(e,t){return t&&""!==t.trim()?at(e,t):t}function it(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function at(e,t){let r=nt.get(e);if(r||(r=e.createElement("a"),nt.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function lt(e,t,r,s){return s?"src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0]?ot(e,s):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function s(e){let s;const n=e.exec(t.substring(r));return n?(s=n[0],r+=s.length,s):""}const n=[];for(;s(st),!(r>=t.length);){let o=s(rt);if(","===o.slice(-1))o=ot(e,o.substring(0,o.length-1)),n.push(o);else{let s="";o=ot(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){n.push((o+s).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,n.push((o+s).trim());break}"("===e&&(i=!0)}s+=e,r+=1}}}return n.join(", ")}(e,s):"style"===r?Ye(s,at(e)):"object"===t&&"data"===r?ot(e,s):s:ot(e,s):s}function ct(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ut(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ut(Te.parentNode(e),t,r);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!r&&ut(Te.parentNode(e),t,r)}function ht(e,t,r,s){let n;if(Ne(e)){if(n=e,!Te.childNodes(n).length)return!1}else{if(null===Te.parentElement(e))return!1;n=Te.parentElement(e)}try{if("string"==typeof t){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(ut(n,t,s))return!0;if(r)if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(o){}return!1}function dt(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ie.Document,childNodes:[],compatMode:e.compatMode}:{type:Ie.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ie.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:s,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}if(r)return e.matches(r)}catch(s){}return!1}(e,s,n),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ue(e.tagName);return qe.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let S=0;S<y;S++){const t=e.attributes[S];ct(m,t.name,t.value)||(g[t.name]=lt(r,m,Ue(t.name),t.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let s=null;t&&(s=Fe(t)),s&&(delete g.rel,delete g.href,g._cssText=s)}if("style"===m&&e.sheet){let t=Fe(e.sheet);t&&(e.childNodes.length>1&&(t=Xe(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=ze({element:e,type:We(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let s=0;s<e.height;s+=50){const n=t.getImageData,o=je in n?n[je]:n;if(new Uint32Array(o.call(t,r,s,Math.min(50,e.width-r),Math.min(50,e.height-s)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),s=r.createElement("canvas");s.width=e.width,s.height=e.height;t!==s.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){et||(et=r.createElement("canvas"),tt=et.getContext("2d"));const t=e,s=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{et.width=t.naturalWidth,et.height=t.naturalHeight,tt.drawImage(t,0,0),g.rr_dataURL=et.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${s}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?g.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||h(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(b){}return{type:Ie.Element,tagName:m,attributes:g,childNodes:[],isSVG:it(e)||void 0,needBlock:f,rootId:p,isCustom:w}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:o}=t,i=Te.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":o||(l=Te.textContent(e),c&&l&&(l=Ye(l,at(t.doc))));!c&&!u&&l&&r&&(l=s?s(l,Te.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Ie.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Ie.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Ie.Comment,textContent:Te.textContent(e)||"",rootId:y};default:return!1}}function pt(e){return null==e?"":e.toLowerCase()}function ft(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:k=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:E=!0}=t;if(!x){x=ht(e,i,a,void 0===x)}const O=dt(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!O)return console.warn(e,"not serialized"),null;let L;L=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===Ie.Comment)return!0;if(e.type===Ie.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"===$e(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(pt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===pt(e.attributes.name)||"icon"===pt(e.attributes.rel)||"apple-touch-icon"===pt(e.attributes.rel)||"shortcut icon"===pt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&pt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(pt(e.attributes.property).match(/^(og|twitter|fb):/)||pt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===pt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===pt(e.attributes.name)||"googlebot"===pt(e.attributes.name)||"bingbot"===pt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===pt(e.attributes.name)||"generator"===pt(e.attributes.name)||"framework"===pt(e.attributes.name)||"publisher"===pt(e.attributes.name)||"progid"===pt(e.attributes.name)||pt(e.attributes.property).match(/^article:/)||pt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===pt(e.attributes.name)||"yandex-verification"===pt(e.attributes.name)||"csrf-token"===pt(e.attributes.name)||"p:domain_verify"===pt(e.attributes.name)||"verify-v1"===pt(e.attributes.name)||"verification"===pt(e.attributes.name)||"shopify-checkout-api-token"===pt(e.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===Ie.Text&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Qe();const M=Object.assign(O,{id:L});if(s.add(e,M),-2===L)return null;y&&y(e);let A=!l;if(M.type===Ie.Element){A=A&&!M.needBlock,delete M.needBlock;const t=Te.shadowRoot(e);t&&Pe(t)&&(M.isShadowHost=!0)}if((M.type===Ie.Document||M.type===Ie.Element)&&A){p.headWhitespace&&M.type===Ie.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C,cssCaptured:!1};if(M.type===Ie.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===Ie.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Te.childNodes(e))){const e=ft(r,t);e&&M.childNodes.push(e)}}let I=null;if(Ne(e)&&(I=Te.shadowRoot(e)))for(const e of Array.from(Te.childNodes(I))){const r=ft(e,t);r&&(Pe(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const R=Te.parentNode(e);return R&&De(R)&&Pe(R)&&(M.isShadow=!0),M.type===Ie.Element&&"iframe"===M.tagName&&function(e,t,r){const s=e.contentWindow;if(!s)return;let n,o=!1;try{n=s.document.readyState}catch(a){return}if("complete"!==n){const s=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(s),o=!0,t()})}const i="about:blank";if(s.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const r=ft(t,{doc:t,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C});r&&w(e,r)}},b),M.type===Ie.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===$e(M.attributes.href))&&function(e,t,r){let s,n=!1;try{s=e.sheet}catch(i){return}if(s)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(S){const t=ft(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:C});t&&S(e,t)}},v),M}function mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gt(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}var yt={exports:{}},wt=String,bt=function(){return{isColorSupported:!1,reset:wt,bold:wt,dim:wt,italic:wt,underline:wt,inverse:wt,hidden:wt,strikethrough:wt,black:wt,red:wt,green:wt,yellow:wt,blue:wt,magenta:wt,cyan:wt,white:wt,gray:wt,bgBlack:wt,bgRed:wt,bgGreen:wt,bgYellow:wt,bgBlue:wt,bgMagenta:wt,bgCyan:wt,bgWhite:wt}};yt.exports=bt(),yt.exports.createColors=bt;var St=yt.exports;const vt=gt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ct=St,It=vt,kt=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==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:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Ct.isColorSupported),It&&e&&(t=It(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Ct.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xt=kt;kt.default=kt;var Et={};Et.isClean=Symbol("isClean"),Et.my=Symbol("my");const Ot={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Lt=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;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Ot[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=Ot[r]),o.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,t.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,r.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,r.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&&(t=e.raws.between,void 0!==t))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,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(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=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let 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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Mt=Lt;Lt.default=Lt;let At=Mt;function Rt(e,t){new At(t).stringify(e)}var Tt=Rt;Rt.default=Rt;let{isClean:Nt,my:Dt}=Et,Pt=xt,Ft=Mt,_t=Tt;function Bt(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>Bt(e,r)):("object"===o&&null!==n&&(n=Bt(n)),r[s]=n)}return r}let zt=class{constructor(e={}){this.raws={},this[Nt]=!1,this[Dt]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of 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=Bt(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 Pt(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[Nt]){this[Nt]=!1;let e=this;for(;e=e.parent;)e[Nt]=!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 o=0;o<e;o++)"\n"===r[o]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ft).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))r[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)r[o]=e.toJSON(null,t);else if("source"===o){let s=t.get(e.input);null==s&&(s=n,t.set(e.input,n),n++),r[o]={end:e.end,inputId:s,start:e.start}}else r[o]=e}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=_t){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let n in r)s[n]=r[n];return e.warn(t,s)}get proxyOf(){return this}};var Ut=zt;zt.default=zt;let jt=Ut,Wt=class extends jt{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var $t=Wt;Wt.default=Wt;var Vt={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Gt,SourceMapGenerator:Jt}=vt,{existsSync:Zt,readFileSync:Yt}=vt,{dirname:Ht,join:Xt}=vt;let Kt=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=Ht(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new Gt(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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=Ht(e),Zt(e))return this.mapFile=e,Yt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Gt)return Jt.fromSourceMap(t).toString();if(t instanceof Jt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Xt(Ht(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var qt=Kt;Kt.default=Kt;let{SourceMapConsumer:Qt,SourceMapGenerator:er}=vt,{fileURLToPath:tr,pathToFileURL:rr}=vt,{isAbsolute:sr,resolve:nr}=vt,{nanoid:or}=Vt,ir=vt,ar=xt,lr=qt,cr=Symbol("fromOffsetCache"),ur=Boolean(Qt&&er),hr=Boolean(nr&&sr),dr=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hr||/^\w+:\/\//.test(t.from)||sr(t.from)?this.file=t.from:this.file=nr(t.from)),hr&&ur){let e=new lr(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+or(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;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);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new ar(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 ar(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(rr&&(n.input.url=rr(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[cr])r=this[cr];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[cr]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:nr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=sr(a.source)?rr(a.source):new URL(a.source,this.map.consumer().sourceRoot||rr(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!tr)throw new Error("file: protocol is not available in this PostCSS build");l.file=tr(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var pr=dr;dr.default=dr,ir&&ir.registerInput&&ir.registerInput(dr);let{SourceMapConsumer:fr,SourceMapGenerator:mr}=vt,{dirname:gr,relative:yr,resolve:wr,sep:br}=vt,{pathToFileURL:Sr}=vt,vr=pr,Cr=Boolean(fr&&mr),Ir=Boolean(gr&&wr&&yr&&br);var kr=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||gr(e.file);!1===this.mapOpts.sourcesContent?(t=new fr(e.text),t.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--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ir&&Cr&&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=mr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new mr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?gr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=gr(wr(r,this.mapOpts.annotation)));let s=yr(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 vr(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)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Sr){let t=Sr(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===br&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let xr=Ut,Er=class extends xr{constructor(e){super(e),this.type="comment"}};var Or=Er;Er.default=Er;let Lr,Mr,Ar,Rr,{isClean:Tr,my:Nr}=Et,Dr=$t,Pr=Or,Fr=Ut;function _r(e){return e.map(e=>(e.nodes&&(e.nodes=_r(e.nodes)),delete e.source,e))}function Br(e){if(e[Tr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Br(t)}let zr=class e extends Fr{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,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();s=this.index(e);for(let o of n)this.proxyOf.nodes.splice(s+1,0,o);for(let o in this.indexes)r=this.indexes[o],s<r&&(this.indexes[o]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let i of o)this.proxyOf.nodes.splice(s,0,i);for(let i in this.indexes)r=this.indexes[i],s<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=_r(Lr(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Dr(t)]}else if(t.selector)t=[new Mr(t)];else if(t.name)t=[new Ar(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Pr(t)]}return t.map(t=>(t[Nr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Tr]&&Br(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){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(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(n){throw t.addToError(n)}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]}};zr.registerParse=e=>{Lr=e},zr.registerRule=e=>{Mr=e},zr.registerAtRule=e=>{Ar=e},zr.registerRoot=e=>{Rr=e};var Ur=zr;zr.default=zr,zr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ar.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mr.prototype):"decl"===e.type?Object.setPrototypeOf(e,Dr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Pr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rr.prototype),e[Nr]=!0,e.nodes&&e.nodes.forEach(e=>{zr.rebuild(e)})};let jr,Wr,$r=Ur,Vr=class extends $r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new jr(new Wr,this,e).stringify()}};Vr.registerLazyResult=e=>{jr=e},Vr.registerProcessor=e=>{Wr=e};var Gr=Vr;Vr.default=Vr;let Jr={};var Zr=function(e){Jr[e]||(Jr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Yr=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 r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Hr=Yr;Yr.default=Yr;let Xr=Hr,Kr=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 Xr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var qr=Kr;Kr.default=Kr;const Qr="'".charCodeAt(0),es='"'.charCodeAt(0),ts="\\".charCodeAt(0),rs="/".charCodeAt(0),ss="\n".charCodeAt(0),ns=" ".charCodeAt(0),os="\f".charCodeAt(0),is="\t".charCodeAt(0),as="\r".charCodeAt(0),ls="[".charCodeAt(0),cs="]".charCodeAt(0),us="(".charCodeAt(0),hs=")".charCodeAt(0),ds="{".charCodeAt(0),ps="}".charCodeAt(0),fs=";".charCodeAt(0),ms="*".charCodeAt(0),gs=":".charCodeAt(0),ys="@".charCodeAt(0),ws=/[\t\n\f\r "#'()/;[\\\]{}]/g,bs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ss=/.[\r\n"'(/\\]/,vs=/[\da-f]/i;let Cs=Ur,Is=class extends Cs{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ks=Is;Is.default=Is,Cs.registerAtRule(Is);let xs,Es,Os=Ur,Ls=class extends Os{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 n of s)n.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 xs(new Es,this,e).stringify()}};Ls.registerLazyResult=e=>{xs=e},Ls.registerProcessor=e=>{Es=e};var Ms=Ls;Ls.default=Ls,Os.registerRoot(Ls);let As={comma:e=>As.split(e,[","],!0),space:e=>As.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?i+=1:")"===u?i>0&&(i-=1):0===i&&t.includes(u)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=u;return(r||""!==n)&&s.push(n.trim()),s}};var Rs=As;As.default=As;let Ts=Ur,Ns=Rs,Ds=class extends Ts{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ns.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)}};var Ps=Ds;Ds.default=Ds,Ts.registerRule(Ds);let Fs=$t,_s=function(e,t={}){let r,s,n,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.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=d.charCodeAt(m),r){case ss:case ns:case is:case as:case os:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===ns||r===ss||r===is||r===as||r===os);h=["space",d.slice(m,s)],m=s-1;break;case ls:case cs:case ds:case ps:case gs:case fs:case hs:{let e=String.fromCharCode(r);h=[e,e,m];break}case us:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Qr&&u!==es&&u!==ns&&u!==ss&&u!==is&&u!==os&&u!==as){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===ts;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||Ss.test(o)?h=["(","(",m]:(h=["brackets",o,m,s],m=s);break;case Qr:case es:n=r===Qr?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===ts;)l-=1,a=!a}while(a);h=["string",d.slice(m,s+1),m,s],m=s;break;case ys:ws.lastIndex=m+1,ws.test(d),s=0===ws.lastIndex?d.length-1:ws.lastIndex-2,h=["at-word",d.slice(m,s+1),m,s],m=s;break;case ts:for(s=m,i=!0;d.charCodeAt(s+1)===ts;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==rs&&r!==ns&&r!==ss&&r!==is&&r!==as&&r!==os&&(s+=1,vs.test(d.charAt(s)))){for(;vs.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===ns&&(s+=1)}h=["word",d.slice(m,s+1),m,s],m=s;break;default:r===rs&&d.charCodeAt(m+1)===ms?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),h=["comment",d.slice(m,s+1),m,s],m=s):(bs.lastIndex=m+1,bs.test(d),s=0===bs.lastIndex?d.length-1:bs.lastIndex-2,h=["word",d.slice(m,s+1),m,s],g.push(h),m=s)}return m++,h},position:function(){return m}}},Bs=Or,zs=ks,Us=Ms,js=Ps;const Ws={empty:!0,space:!0};let $s=Ur,Vs=class{constructor(e){this.input=e,this.root=new Us,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 zs;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(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}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new Bs;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=_s(this.input)}decl(e,t){let r=new Fs;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(s=e[a],"!important"===s[1].toLowerCase()){r.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(r.raws.important=t);break}if("important"===s[1].toLowerCase()){let t=e.slice(0),s="";for(let e=a;e>0;e--){let r=t[e][0];if(0===s.trim().indexOf("!")&&"space"!==r)break;s=t.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=t)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 js;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,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",u=!0;for(let h=0;h<l;h+=1)n=r[h],o=n[0],"space"!==o||h!==l-1||s?"comment"===o?(a=r[h-1]?r[h-1][0]:"empty",i=r[h+1]?r[h+1][0]:"empty",Ws[a]||Ws[i]||","===c.slice(-1)?u=!1:c+=n[1]):c+=n[1]:u=!1;if(!u){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new js;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gs=pr;function Js(e,t){let r=new Gs(e,t),s=new Vs(r);try{s.parse()}catch(n){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===n.name&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?n.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(n.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),n}return s.root}var Zs=Js;Js.default=Js,$s.registerParse(Js);let{isClean:Ys,my:Hs}=Et,Xs=kr,Ks=Tt,qs=Ur,Qs=Gr,en=Zr,tn=qr,rn=Zs,sn=Ms;const nn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},on={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},an={Once:!0,postcssPlugin:!0,prepare:!0};function ln(e){return"object"==typeof e&&"function"==typeof e.then}function cn(e){let t=!1,r=nn[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function un(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:cn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function hn(e){return e[Ys]=!1,e.nodes&&e.nodes.forEach(e=>hn(e)),e}let dn={},pn=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)if(r instanceof e||r instanceof tn)n=hn(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=rn;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(o){this.processed=!0,this.error=o}n&&!n[Hs]&&qs.rebuild(n)}else n=hn(r);this.result=new tn(t,n,s),this.helpers={...dn,postcss:dn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(s){console&&console.error&&console.error(s)}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(!on[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!an[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 r=0;r<this.plugins.length;r++){let t=this.plugins[r],s=this.runOnRoot(t);if(ln(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ys];){e[Ys]=!0;let r=[un(e)];for(;r.length>0;){let e=this.visitTick(r);if(ln(e))try{await e}catch(t){let e=r[r.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[r,s]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ln(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ks;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Xs(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(ln(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ys];)e[Ys]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||en("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ln(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<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[Ys])return s[Ys]=!0,void e.push(un(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Ys]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ys]=!0;let t=cn(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Ys]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};pn.registerPostcss=e=>{dn=e};var fn=pn;pn.default=pn,sn.registerLazyResult(pn),Qs.registerLazyResult(pn);let mn=kr,gn=Tt,yn=Zr,wn=Zs;const bn=qr;let Sn=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;let n=gn;this.result=new bn(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new mn(n,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"production"!==process.env.NODE_ENV&&("from"in this._opts||yn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=wn;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var vn=Sn;Sn.default=Sn;let Cn=vn,In=fn,kn=Gr,xn=Ms,En=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)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new In(this,e,t):new Cn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var On=En;En.default=En,xn.registerProcessor(En),kn.registerProcessor(En);let Ln=$t,Mn=qt,An=Or,Rn=ks,Tn=pr,Nn=Ms,Dn=Ps;function Pn(e,t){if(Array.isArray(e))return e.map(e=>Pn(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Tn.prototype};r.map&&(r.map={...r.map,__proto__:Mn.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>Pn(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 Nn(s);if("decl"===s.type)return new Ln(s);if("rule"===s.type)return new Dn(s);if("comment"===s.type)return new An(s);if("atrule"===s.type)return new Rn(s);throw new Error("Unknown node type: "+e.type)}var Fn=Pn;Pn.default=Pn;let _n=xt,Bn=$t,zn=fn,Un=Ur,jn=On,Wn=Tt,$n=Fn,Vn=Gr,Gn=Hr,Jn=Or,Zn=ks,Yn=qr,Hn=pr,Xn=Zs,Kn=Rs,qn=Ps,Qn=Ms,eo=Ut;function to(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new jn(e)}to.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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new jn).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return to([n(r)]).process(e,t)},n},to.stringify=Wn,to.parse=Xn,to.fromJSON=$n,to.list=Kn,to.comment=e=>new Jn(e),to.atRule=e=>new Zn(e),to.decl=e=>new Bn(e),to.rule=e=>new qn(e),to.root=e=>new Qn(e),to.document=e=>new Vn(e),to.CssSyntaxError=_n,to.Declaration=Bn,to.Container=Un,to.Processor=jn,to.Document=Vn,to.Comment=Jn,to.Warning=Gn,to.AtRule=Zn,to.Result=Yn,to.Input=Hn,to.Rule=qn,to.Root=Qn,to.Node=eo,zn.registerPostcss(to);var ro=to;to.default=to;const so=mt(ro);so.stringify,so.fromJSON,so.plugin,so.parse,so.list,so.document,so.comment,so.atRule,so.rule,so.decl,so.root,so.CssSyntaxError,so.Declaration,so.Container,so.Processor,so.Document,so.Comment,so.Warning,so.AtRule,so.Result,so.Input,so.Rule,so.Root,so.Node;var no=Object.defineProperty,oo=(e,t,r)=>((e,t,r)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(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}var lo={exports:{}},co=String,uo=function(){return{isColorSupported:!1,reset:co,bold:co,dim:co,italic:co,underline:co,inverse:co,hidden:co,strikethrough:co,black:co,red:co,green:co,yellow:co,blue:co,magenta:co,cyan:co,white:co,gray:co,bgBlack:co,bgRed:co,bgGreen:co,bgYellow:co,bgBlue:co,bgMagenta:co,bgCyan:co,bgWhite:co}};lo.exports=uo(),lo.exports.createColors=uo;var ho=lo.exports;const po=ao(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let fo=ho,mo=po,go=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==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:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=fo.isColorSupported),mo&&e&&(t=mo(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=fo.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var yo=go;go.default=go;var wo={};wo.isClean=Symbol("isClean"),wo.my=Symbol("my");const bo={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let So=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;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return bo[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=bo[r]),o.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,t.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,r.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,r.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&&(t=e.raws.between,void 0!==t))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,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(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=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let 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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var vo=So;So.default=So;let Co=vo;function Io(e,t){new Co(t).stringify(e)}var ko=Io;Io.default=Io;let{isClean:xo,my:Eo}=wo,Oo=yo,Lo=vo,Mo=ko;function Ao(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>Ao(e,r)):("object"===o&&null!==n&&(n=Ao(n)),r[s]=n)}return r}let Ro=class{constructor(e={}){this.raws={},this[xo]=!1,this[Eo]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of 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=Ao(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 Oo(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[xo]){this[xo]=!1;let e=this;for(;e=e.parent;)e[xo]=!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 o=0;o<e;o++)"\n"===r[o]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Lo).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))r[o]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)r[o]=e.toJSON(null,t);else if("source"===o){let s=t.get(e.input);null==s&&(s=n,t.set(e.input,n),n++),r[o]={end:e.end,inputId:s,start:e.start}}else r[o]=e}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=Mo){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let n in r)s[n]=r[n];return e.warn(t,s)}get proxyOf(){return this}};var To=Ro;Ro.default=Ro;let No=To,Do=class extends No{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Po=Do;Do.default=Do;var Fo={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:_o,SourceMapGenerator:Bo}=po,{existsSync:zo,readFileSync:Uo}=po,{dirname:jo,join:Wo}=po;let $o=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=jo(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new _o(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}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=jo(e),zo(e))return this.mapFile=e,Uo(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof _o)return Bo.fromSourceMap(t).toString();if(t instanceof Bo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Wo(jo(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Vo=$o;$o.default=$o;let{SourceMapConsumer:Go,SourceMapGenerator:Jo}=po,{fileURLToPath:Zo,pathToFileURL:Yo}=po,{isAbsolute:Ho,resolve:Xo}=po,{nanoid:Ko}=Fo,qo=po,Qo=yo,ei=Vo,ti=Symbol("fromOffsetCache"),ri=Boolean(Go&&Jo),si=Boolean(Xo&&Ho),ni=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!si||/^\w+:\/\//.test(t.from)||Ho(t.from)?this.file=t.from:this.file=Xo(t.from)),si&&ri){let e=new ei(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Ko(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;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);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new Qo(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 Qo(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Yo&&(n.input.url=Yo(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[ti])r=this[ti];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[ti]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Xo(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=Ho(a.source)?Yo(a.source):new URL(a.source,this.map.consumer().sourceRoot||Yo(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Zo)throw new Error("file: protocol is not available in this PostCSS build");l.file=Zo(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var oi=ni;ni.default=ni,qo&&qo.registerInput&&qo.registerInput(ni);let{SourceMapConsumer:ii,SourceMapGenerator:ai}=po,{dirname:li,relative:ci,resolve:ui,sep:hi}=po,{pathToFileURL:di}=po,pi=oi,fi=Boolean(ii&&ai),mi=Boolean(li&&ui&&ci&&hi);var gi=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||li(e.file);!1===this.mapOpts.sourcesContent?(t=new ii(e.text),t.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--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),mi&&fi&&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=ai.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ai({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new ai({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?li(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=li(ui(r,this.mapOpts.annotation)));let s=ci(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 pi(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)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(di){let t=di(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===hi&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let yi=To,wi=class extends yi{constructor(e){super(e),this.type="comment"}};var bi=wi;wi.default=wi;let Si,vi,Ci,Ii,{isClean:ki,my:xi}=wo,Ei=Po,Oi=bi,Li=To;function Mi(e){return e.map(e=>(e.nodes&&(e.nodes=Mi(e.nodes)),delete e.source,e))}function Ai(e){if(e[ki]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ai(t)}let Ri=class e extends Li{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,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();s=this.index(e);for(let o of n)this.proxyOf.nodes.splice(s+1,0,o);for(let o in this.indexes)r=this.indexes[o],s<r&&(this.indexes[o]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let i of o)this.proxyOf.nodes.splice(s,0,i);for(let i in this.indexes)r=this.indexes[i],s<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Mi(Si(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Ei(t)]}else if(t.selector)t=[new vi(t)];else if(t.name)t=[new Ci(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Oi(t)]}return t.map(t=>(t[xi]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ki]&&Ai(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){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(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(n){throw t.addToError(n)}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]}};Ri.registerParse=e=>{Si=e},Ri.registerRule=e=>{vi=e},Ri.registerAtRule=e=>{Ci=e},Ri.registerRoot=e=>{Ii=e};var Ti=Ri;Ri.default=Ri,Ri.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ci.prototype):"rule"===e.type?Object.setPrototypeOf(e,vi.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ei.prototype):"comment"===e.type?Object.setPrototypeOf(e,Oi.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ii.prototype),e[xi]=!0,e.nodes&&e.nodes.forEach(e=>{Ri.rebuild(e)})};let Ni,Di,Pi=Ti,Fi=class extends Pi{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ni(new Di,this,e).stringify()}};Fi.registerLazyResult=e=>{Ni=e},Fi.registerProcessor=e=>{Di=e};var _i=Fi;Fi.default=Fi;let Bi={};var zi=function(e){Bi[e]||(Bi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ui=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 r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var ji=Ui;Ui.default=Ui;let Wi=ji,$i=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 Wi(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Vi=$i;$i.default=$i;const Gi="'".charCodeAt(0),Ji='"'.charCodeAt(0),Zi="\\".charCodeAt(0),Yi="/".charCodeAt(0),Hi="\n".charCodeAt(0),Xi=" ".charCodeAt(0),Ki="\f".charCodeAt(0),qi="\t".charCodeAt(0),Qi="\r".charCodeAt(0),ea="[".charCodeAt(0),ta="]".charCodeAt(0),ra="(".charCodeAt(0),sa=")".charCodeAt(0),na="{".charCodeAt(0),oa="}".charCodeAt(0),ia=";".charCodeAt(0),aa="*".charCodeAt(0),la=":".charCodeAt(0),ca="@".charCodeAt(0),ua=/[\t\n\f\r "#'()/;[\\\]{}]/g,ha=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,da=/.[\r\n"'(/\\]/,pa=/[\da-f]/i;let fa=Ti,ma=class extends fa{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ga=ma;ma.default=ma,fa.registerAtRule(ma);let ya,wa,ba=Ti,Sa=class extends ba{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 n of s)n.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 ya(new wa,this,e).stringify()}};Sa.registerLazyResult=e=>{ya=e},Sa.registerProcessor=e=>{wa=e};var va=Sa;Sa.default=Sa,ba.registerRoot(Sa);let Ca={comma:e=>Ca.split(e,[","],!0),space:e=>Ca.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?i+=1:")"===u?i>0&&(i-=1):0===i&&t.includes(u)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=u;return(r||""!==n)&&s.push(n.trim()),s}};var Ia=Ca;Ca.default=Ca;let ka=Ti,xa=Ia,Ea=class extends ka{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return xa.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)}};var Oa=Ea;Ea.default=Ea,ka.registerRule(Ea);let La=Po,Ma=function(e,t={}){let r,s,n,o,i,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.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=d.charCodeAt(m),r){case Hi:case Xi:case qi:case Qi:case Ki:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===Xi||r===Hi||r===qi||r===Qi||r===Ki);h=["space",d.slice(m,s)],m=s-1;break;case ea:case ta:case na:case oa:case la:case ia:case sa:{let e=String.fromCharCode(r);h=[e,e,m];break}case ra:if(c=g.length?g.pop()[1]:"",u=d.charCodeAt(m+1),"url"===c&&u!==Gi&&u!==Ji&&u!==Xi&&u!==Hi&&u!==qi&&u!==Ki&&u!==Qi){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===Zi;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||da.test(o)?h=["(","(",m]:(h=["brackets",o,m,s],m=s);break;case Gi:case Ji:n=r===Gi?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===Zi;)l-=1,a=!a}while(a);h=["string",d.slice(m,s+1),m,s],m=s;break;case ca:ua.lastIndex=m+1,ua.test(d),s=0===ua.lastIndex?d.length-1:ua.lastIndex-2,h=["at-word",d.slice(m,s+1),m,s],m=s;break;case Zi:for(s=m,i=!0;d.charCodeAt(s+1)===Zi;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==Yi&&r!==Xi&&r!==Hi&&r!==qi&&r!==Qi&&r!==Ki&&(s+=1,pa.test(d.charAt(s)))){for(;pa.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===Xi&&(s+=1)}h=["word",d.slice(m,s+1),m,s],m=s;break;default:r===Yi&&d.charCodeAt(m+1)===aa?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),h=["comment",d.slice(m,s+1),m,s],m=s):(ha.lastIndex=m+1,ha.test(d),s=0===ha.lastIndex?d.length-1:ha.lastIndex-2,h=["word",d.slice(m,s+1),m,s],g.push(h),m=s)}return m++,h},position:function(){return m}}},Aa=bi,Ra=ga,Ta=va,Na=Oa;const Da={empty:!0,space:!0};let Pa=Ti,Fa=class{constructor(e){this.input=e,this.root=new Ta,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 Ra;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(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}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new Aa;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=Ma(this.input)}decl(e,t){let r=new La;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[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)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(s=e[a],"!important"===s[1].toLowerCase()){r.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(r.raws.important=t);break}if("important"===s[1].toLowerCase()){let t=e.slice(0),s="";for(let e=a;e>0;e--){let r=t[e][0];if(0===s.trim().indexOf("!")&&"space"!==r)break;s=t.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=t)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.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 Na;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,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",u=!0;for(let h=0;h<l;h+=1)n=r[h],o=n[0],"space"!==o||h!==l-1||s?"comment"===o?(a=r[h-1]?r[h-1][0]:"empty",i=r[h+1]?r[h+1][0]:"empty",Da[a]||Da[i]||","===c.slice(-1)?u=!1:c+=n[1]):c+=n[1]:u=!1;if(!u){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new Na;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&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},_a=oi;function Ba(e,t){let r=new _a(e,t),s=new Fa(r);try{s.parse()}catch(n){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===n.name&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?n.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(n.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),n}return s.root}var za=Ba;Ba.default=Ba,Pa.registerParse(Ba);let{isClean:Ua,my:ja}=wo,Wa=gi,$a=ko,Va=Ti,Ga=_i,Ja=zi,Za=Vi,Ya=za,Ha=va;const Xa={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ka={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},qa={Once:!0,postcssPlugin:!0,prepare:!0};function Qa(e){return"object"==typeof e&&"function"==typeof e.then}function el(e){let t=!1,r=Xa[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function tl(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:el(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function rl(e){return e[Ua]=!1,e.nodes&&e.nodes.forEach(e=>rl(e)),e}let sl={},nl=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)if(r instanceof e||r instanceof Za)n=rl(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=Ya;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(o){this.processed=!0,this.error=o}n&&!n[ja]&&Va.rebuild(n)}else n=rl(r);this.result=new Za(t,n,s),this.helpers={...sl,postcss:sl,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(s){console&&console.error&&console.error(s)}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(!Ka[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!qa[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 r=0;r<this.plugins.length;r++){let t=this.plugins[r],s=this.runOnRoot(t);if(Qa(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ua];){e[Ua]=!0;let r=[tl(e)];for(;r.length>0;){let e=this.visitTick(r);if(Qa(e))try{await e}catch(t){let e=r[r.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[r,s]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Qa(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=$a;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Wa(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(Qa(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ua];)e[Ua]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ja("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Qa(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<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[Ua])return s[Ua]=!0,void e.push(tl(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Ua]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ua]=!0;let t=el(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Ua]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};nl.registerPostcss=e=>{sl=e};var ol=nl;nl.default=nl,Ha.registerLazyResult(nl),Ga.registerLazyResult(nl);let il=gi,al=ko,ll=zi,cl=za;const ul=Vi;let hl=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;let n=al;this.result=new ul(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new il(n,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"production"!==process.env.NODE_ENV&&("from"in this._opts||ll("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=cl;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var dl=hl;hl.default=hl;let pl=dl,fl=ol,ml=_i,gl=va,yl=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)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new fl(this,e,t):new pl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var wl=yl;yl.default=yl,gl.registerProcessor(yl),ml.registerProcessor(yl);let bl=Po,Sl=Vo,vl=bi,Cl=ga,Il=oi,kl=va,xl=Oa;function El(e,t){if(Array.isArray(e))return e.map(e=>El(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Il.prototype};r.map&&(r.map={...r.map,__proto__:Sl.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>El(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 kl(s);if("decl"===s.type)return new bl(s);if("rule"===s.type)return new xl(s);if("comment"===s.type)return new vl(s);if("atrule"===s.type)return new Cl(s);throw new Error("Unknown node type: "+e.type)}var Ol=El;El.default=El;let Ll=yo,Ml=Po,Al=ol,Rl=Ti,Tl=wl,Nl=ko,Dl=Ol,Pl=_i,Fl=ji,_l=bi,Bl=ga,zl=Vi,Ul=oi,jl=za,Wl=Ia,$l=Oa,Vl=va,Gl=To;function Jl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Tl(e)}Jl.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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Tl).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return Jl([n(r)]).process(e,t)},n},Jl.stringify=Nl,Jl.parse=jl,Jl.fromJSON=Dl,Jl.list=Wl,Jl.comment=e=>new _l(e),Jl.atRule=e=>new Bl(e),Jl.decl=e=>new Ml(e),Jl.rule=e=>new $l(e),Jl.root=e=>new Vl(e),Jl.document=e=>new Pl(e),Jl.CssSyntaxError=Ll,Jl.Declaration=Ml,Jl.Container=Rl,Jl.Processor=Tl,Jl.Document=Pl,Jl.Comment=_l,Jl.Warning=Fl,Jl.AtRule=Bl,Jl.Result=zl,Jl.Input=Ul,Jl.Rule=$l,Jl.Root=Vl,Jl.Node=Gl,Al.registerPostcss(Jl);var Zl=Jl;Jl.default=Jl;const Yl=io(Zl);Yl.stringify,Yl.fromJSON,Yl.plugin,Yl.parse,Yl.list,Yl.document,Yl.comment,Yl.atRule,Yl.rule,Yl.decl,Yl.root,Yl.CssSyntaxError,Yl.Declaration,Yl.Container,Yl.Processor,Yl.Document,Yl.Comment,Yl.Warning,Yl.AtRule,Yl.Result,Yl.Input,Yl.Rule,Yl.Root,Yl.Node;class Hl{constructor(...e){oo(this,"parentElement",null),oo(this,"parentNode",null),oo(this,"ownerDocument"),oo(this,"firstChild",null),oo(this,"lastChild",null),oo(this,"previousSibling",null),oo(this,"nextSibling",null),oo(this,"ELEMENT_NODE",1),oo(this,"TEXT_NODE",3),oo(this,"nodeType"),oo(this,"nodeName"),oo(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Hl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Xl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ql={};function Ql(e){if(ql[e])return ql[e];const t=globalThis[e],r=t.prototype,s=e in Xl?Xl[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in Kl?Kl[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return ql[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?ql[e]=o:r}catch{return r}}const ec={};function tc(e,t,r){var s;const n=`${e}.${String(r)}`;if(ec[n])return ec[n].call(t);const o=Ql(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(ec[n]=i,i.call(t)):t[r]}const rc={};function sc(e,t,r){const s=`${e}.${String(r)}`;if(rc[s])return rc[s].bind(t);const n=Ql(e)[r];return"function"!=typeof n?t[r]:(rc[s]=n,n.bind(t))}function nc(){return Ql("MutationObserver").constructor}const oc={childNodes:function(e){return tc("Node",e,"childNodes")},parentNode:function(e){return tc("Node",e,"parentNode")},parentElement:function(e){return tc("Node",e,"parentElement")},textContent:function(e){return tc("Node",e,"textContent")},contains:function(e,t){return sc("Node",e,"contains")(t)},getRootNode:function(e){return sc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?tc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?tc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return tc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return tc("Element",e,"querySelectorAll")(t)},mutationObserver:nc};function ic(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const ac="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let lc={map:{},getId:()=>(console.error(ac),-1),getNode:()=>(console.error(ac),null),removeNodeFromMap(){console.error(ac)},has:()=>(console.error(ac),!1),reset(){console.error(ac)}};function cc(e,t,r={}){let s=null,n=0;return function(...o){const i=Date.now();n||!1!==r.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(s&&(clearTimeout(s),s=null),n=i,e.apply(l,o)):s||!1===r.trailing||(s=setTimeout(()=>{n=!1===r.leading?0:Date.now(),s=null,e.apply(l,o)},a))}}function uc(e,t,r,s,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>uc(e,t,o||{},!0)}function hc(e,t,r){try{if(!(t in e))return()=>{};const 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&&(lc=new Proxy(lc,{get:(e,t,r)=>("map"===t&&console.error(ac),Reflect.get(e,t,r))}));let dc=Date.now;function pc(e){var t,r,s,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=oc.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(s=oc.parentElement(o.body))?void 0:s.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function fc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function mc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function gc(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:oc.parentElement(e)}function yc(e,t,r,s){if(!e)return!1;const n=gc(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(s&&null!==n.closest("."+t))return!0}else if(ut(n,t,s))return!0}catch(o){}if(r){if(n.matches(r))return!0;if(s&&null!==n.closest(r))return!0}return!1}function wc(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function bc(e,t){if(De(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=oc.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||bc(s,t))}function Sc(e){return Boolean(e.changedTouches)}function vc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Cc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ic(e){return!!e&&(e instanceof Hl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(oc.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dc=()=>(new Date).getTime());class kc{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return 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 xc(e){var t;let r=null;return"getRootNode"in e&&(null==(t=oc.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oc.host(oc.getRootNode(e))&&(r=oc.host(oc.getRootNode(e))),r}function Ec(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=xc(r);)r=t;return r}(e);return oc.contains(t,r)}function Oc(e){const t=e.ownerDocument;return!!t&&(oc.contains(t,e)||Ec(e))}var Lc=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Lc||{}),Mc=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Mc||{}),Ac=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ac||{}),Rc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Rc||{}),Tc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Tc||{}),Nc=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Nc||{}),Dc=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Dc||{});function Pc(e){return"__ln"in e}class Fc{constructor(){Se(this,"length",0),Se(this,"head",null),Se(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pc(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Pc(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const _c=(e,t)=>`${e}@${t}`;class Bc{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"removesSubTreeCache",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Se(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Fc,s=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{const o=oc.parentNode(n);if(!o||!Oc(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=De(o)?this.mirror.getId(xc(n)):this.mirror.getId(o),l=s(n);if(-1===a||-1===l)return r.addNode(n);const c=ft(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=>{vc(e,this.mirror)&&this.iframeManager.addIframe(e),Cc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ic(n)&&this.shadowDomManager.addShadowRoot(oc.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Uc(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(oc.parentNode(a))||n(a);for(const a of this.addedSet)jc(this.droppedSet,a)||Uc(this.removesSubTreeCache,a,this.mirror)?jc(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(oc.parentNode(o.value)),r=s(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(oc.parentNode(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,s=oc.parentNode(t);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=oc.host(s);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=oc.parentNode(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=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),s=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+s).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),Se(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(oc.childNodes(e),e=>oc.textContent(e)||"").join("")}),Se(this,"processMutation",e=>{if(!wc(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=oc.textContent(e.target);yc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ht(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,gc(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const r=e.target;let s=e.attributeName,n=e.target.getAttribute(s);if("value"===s){const e=We(r);n=ze({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(yc(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===s&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;s="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===s&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ct(r.tagName,s))if(o.attributes[s]=lt(this.doc,Ue(r.tagName),Ue(s),n),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const s=this.unattachedDoc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue);for(const e of Array.from(r.style)){const t=r.style.getPropertyValue(e),n=r.style.getPropertyPriority(e);t!==s.style.getPropertyValue(e)||n!==s.style.getPropertyPriority(e)?o.styleDiff[e]=""===n?t:[t,n]:o._unchangedStyles[e]=[t,n]}for(const e of Array.from(s.style))""===r.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===s&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(yc(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),s=De(e.target)?this.mirror.getId(oc.host(e.target)):this.mirror.getId(e.target);yc(e.target,this.blockClass,this.blockSelector,!1)||wc(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(zc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||bc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[_c(r,s)]?zc(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!(!De(e.target)||!Pe(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),oc.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Se(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(wc(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[_c(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yc(e,this.blockClass,this.blockSelector,!1)||(oc.childNodes(e).forEach(e=>this.genAdds(e)),Ic(e)&&oc.childNodes(oc.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function zc(e,t){e.delete(t),oc.childNodes(t).forEach(t=>zc(e,t))}function Uc(e,t,r){return 0!==e.size&&function(e,t){const r=oc.parentNode(t);return!!r&&e.has(r)}(e,t)}function jc(e,t){return 0!==e.size&&Wc(e,t)}function Wc(e,t){const r=oc.parentNode(t);return!!r&&(!!e.has(r)||Wc(e,r))}let $c;const Vc=e=>{if(!$c)return e;return(...t)=>{try{return e(...t)}catch(r){if($c&&!0===$c(r))return;throw r}}},Gc=[];function Jc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Zc(e,t){const r=new Bc;Gc.push(r),r.init(e);const s=new(nc())(Vc(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Yc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Ac).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=Ue(o);const c=(t=>o=>{const i=Jc(o);if(yc(i,s,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Rc.Mouse;break;case"touch":a=Rc.Touch;break;case"pen":a=Rc.Pen}a===Rc.Touch?Ac[t]===Ac.MouseDown?c="TouchStart":Ac[t]===Ac.MouseUp&&(c="TouchEnd"):Rc.Pen}else Sc(o)&&(a=Rc.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Rc.Touch||c.startsWith("Mouse")&&a===Rc.Mouse)&&(a=null)):Ac[t]===Ac.Click&&(a=l,l=null);const u=Sc(o)?o.changedTouches[0]:o;if(!u)return;const h=r.getId(i),{clientX:d,clientY:p}=u;Vc(e)({type:Ac[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Ac[o]){case Ac.MouseDown:case Ac.MouseUp:i=i.replace("mouse","pointer");break;case Ac.TouchStart:case Ac.TouchEnd:return}a.push(ic(i,c,t))}),Vc(()=>{a.forEach(e=>e())})}function Hc({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){return ic("scroll",Vc(cc(Vc(o=>{const i=Jc(o);if(!i||yc(i,s,n,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=pc(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const Xc=["INPUT","TEXTAREA","SELECT"],Kc=new WeakMap;function qc(e){return function(e,t){if(ru("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ru("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ru("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ru("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Qc(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function eu({mirror:e,stylesheetManager:t},r){var s,n,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(oc.host(r));const a="#document"===r.nodeName?null==(s=r.defaultView)?void 0:s.Document:null==(o=null==(n=r.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(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;const s=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(n){}return s}}),Vc(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function tu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let s;!function(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),s(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(s=Zc(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=cc(Vc(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Vc(cc(Vc(e=>{const t=Jc(e),{clientX:r,clientY:n}=Sc(e)?e.changedTouches[0]:e;i||(i=dc()),a.push({x:r,y:n,id:s.getId(t),timeOffset:dc()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Mc.Drag:e instanceof MouseEvent?Mc.MouseMove:Mc.TouchMove)}),n,{trailing:!1})),u=[ic("mousemove",c,r),ic("touchmove",c,r),ic("drag",c,r)];return Vc(()=>{u.forEach(e=>e())})}(e),o=Yc(e),i=Hc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return ic("resize",Vc(cc(Vc(()=>{const t=fc(),n=mc();r===t&&s===n||(e({width:Number(n),height:Number(t)}),r=t,s=n)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Jc(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=oc.parentElement(r)),!r||!h||Xc.indexOf(h)<0||yc(r,s,n,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=We(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=ze({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,s){const n=Kc.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){Kc.set(t,s);const n=r.getId(t);Vc(e)({...s,id:n})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>ic(e,Vc(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>uc(e[0],e[1],{set(){Vc(h)({target:this,isTrusted:!1})}},!1,f))),Vc(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:o}){const i=Vc(o=>cc(Vc(n=>{const i=Jc(n);if(!i||yc(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=i;e({type:o,id:s.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),n.media||500)),a=[ic("play",i(Nc.Play),o),ic("pause",i(Nc.Pause),o),ic("seeked",i(Nc.Seeked),o),ic("volumechange",i(Nc.VolumeChange),o),ic("ratechange",i(Nc.RateChange),o)];return Vc(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const n=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Vc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=Qc(n,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const n=`${e} { ${t} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};const o=s.CSSStyleSheet.prototype.deleteRule;let i,a;s.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=Qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(i=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=Qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),s.apply(n,o)})})),s.CSSStyleSheet.prototype.replaceSync&&(a=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=Qc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),s.apply(n,o)})}));const l={};su("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(su("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),su("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),su("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([s,n])=>{c[s]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[s].insertRule,{apply:Vc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=Qc(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...qc(n),a||0]}]}),s.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[s].deleteRule,{apply:Vc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=Qc(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...qc(n),i]}]}),s.apply(n,o)})})}),Vc(()=>{s.CSSStyleSheet.prototype.insertRule=n,s.CSSStyleSheet.prototype.deleteRule=o,i&&(s.CSSStyleSheet.prototype.replace=i),a&&(s.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=eu(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Vc((n,i,a)=>{var l;const[c,u,h]=a;if(r.has(c))return o.apply(i,[c,u,h]);const{id:d,styleId:p}=Qc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:qc(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Vc((n,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:h}=Qc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:qc(o.parentRule)}),n.apply(o,a)})}),Vc(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],n=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const s=new o(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};const i=hc(t.fonts,"add",function(t){return function(r){return setTimeout(Vc(()=>{const t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}});return s.push(()=>{r.FontFace=o}),s.push(i),Vc(()=>{s.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Vc(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=o;yc(i,s,n,!0)||yc(c,s,n,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),ic("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?hc(r.customElements,"define",function(e){return function(r,s,n){try{t({define:{name:r}})}catch(o){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,s,n])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,r,y.options));return Vc(()=>{Gc.forEach(e=>e.reset()),null==s||s.disconnect(),n(),o(),i(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function ru(e){return void 0!==window[e]}function su(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class nu{constructor(e){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){const n=r||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,s))}getRemoteId(e,t,r){const s=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=s.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ou{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new nu(Qe)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new nu(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){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const s=this.transformCrossOriginEvent(r,t.data.event);s&&this.wrappedEmit(s,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Lc.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Lc.IncrementalSnapshot,data:{source:Mc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Lc.Meta:case Lc.Load:case Lc.DomContentLoaded:return!1;case Lc.Plugin:return t;case Lc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Lc.IncrementalSnapshot:switch(t.data.source){case Mc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const 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 Mc.Drag:case Mc.TouchMove:case Mc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Mc.ViewportResize:return!1;case Mc.MediaInteraction:case Mc.MouseInteraction:case Mc.Scroll:case Mc.CanvasMutation:case Mc.Input:return this.replaceIds(t.data,e,["id"]),t;case Mc.StyleSheetRule:case Mc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Mc.Font:return t;case Mc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Mc.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(const 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===Dc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class iu{constructor(e){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(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(!Pe(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Zc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Hc({...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(oc.host(e))),this.restoreHandlers.push(eu({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(hc(e.prototype,"attachShadow",function(e){return function(s){const n=e.call(this,s),o=oc.shadowRoot(this);return o&&Oc(this)&&r.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var au="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),cu=0;cu<64;cu++)lu[au.charCodeAt(cu)]=cu;const uu=new Map;const hu=(e,t,r)=>{if(!e||!fu(e,t)&&"object"!=typeof e)return;const s=function(e,t){let r=uu.get(e);return r||(r=new Map,uu.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let n=s.indexOf(e);return-1===n&&(n=s.length,s.push(e)),n};function du(e,t,r){if(e instanceof Array)return e.map(e=>du(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),s=r.length,n="";for(t=0;t<s;t+=3)n+=au[r[t]>>2],n+=au[(3&r[t])<<4|r[t+1]>>4],n+=au[(15&r[t+1])<<2|r[t+2]>>6],n+=au[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}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[du(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[du(e.data,t,r),e.width,e.height]}}if(fu(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:hu(e,t,r)}}return e}const pu=(e,t,r)=>e.map(e=>du(e,t,r)),fu=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function mu(e,t,r,s){const n=[];try{const o=hc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!yc(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function gu(e,t,r,s,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=hc(e,l,function(e){return function(...i){const a=e.apply(this,i);if(hu(a,o,this),"tagName"in this.canvas&&!yc(this.canvas,s,n,!0)){const e=pu(i,o,this),s={type:t,property:l,args:e};r(this.canvas,s)}return a}});i.push(a)}catch{const s=uc(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(s)}return i}const yu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",wu="undefined"!=typeof window&&window.Blob&&new Blob([(bu=yu,Uint8Array.from(atob(bu),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var bu;function Su(e){let t;try{if(t=wu&&(window.URL||window.webkitURL).createObjectURL(wu),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;base64,"+yu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class vu{constructor(e){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,s,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:i})}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){const o=mu(t,r,s,!0),i=new Map,a=new Su;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:s,width:n,height:o}=e.data;this.mutationCb({id:t,type:Tc["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{yc(t,r,s,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=await createImageBitmap(e);a.postMessage({id:r,bitmap:s,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[s])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=mu(e,t,r,!1),n=function(e,t,r,s){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=hc(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return yc(this.canvas,r,s,!0)||setTimeout(()=>{const r=pu(o,t,this);e(this.canvas,{type:Tc["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{const r=uc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Tc["2D"],property:i,args:[t],setter:!0})}});n.push(r)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,s){const n=[];return n.push(...gu(t.WebGLRenderingContext.prototype,Tc.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...gu(t.WebGL2RenderingContext.prototype,Tc.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const s=r.map(e=>{const{type:t,...r}=e;return r}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}}class Cu{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new kc),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},s=[];for(const n of e){let e;this.styleMirror.has(n)?e=this.styleMirror.getId(n):(e=this.styleMirror.add(n),s.push({styleId:e,rules:Array.from(n.rules||CSSRule,(e,t)=>({rule:_e(e,n.href),index:t}))})),r.styleIds.push(e)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Iu{constructor(){Se(this,"nodeMap",new WeakMap),Se(this,"active",!1)}inOtherBuffer(e,t){const 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 ku,xu,Eu,Ou=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(we=e.contentWindow)?void 0:we.Array.from)||Array.from,document.body.removeChild(e)}}catch(Qh){console.debug("Unable to override Array.from",Qh)}const Lu=new Be;function Mu(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:v=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:L,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:R}=e;$c=R;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(J){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Lu.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let _=0;const B=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};ku=(e,n)=>{var o;const i=e;if(i.timestamp=dc(),!(null==(o=Gc[0])?void 0:o.isFrozen())||i.type===Lc.FullSnapshot||i.type===Lc.IncrementalSnapshot&&i.data.source===Mc.Mutation||Gc.forEach(e=>e.unfreeze()),T)null==t||t(B(i),n);else if(N){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===Lc.FullSnapshot)F=i,_=0;else if(i.type===Lc.IncrementalSnapshot){if(i.data.source===Mc.Mutation&&i.data.isAttachIframe)return;_++;const e=s&&_>=s,t=r&&i.timestamp-F.timestamp>r;(e||t)&&xu(!0)}};const z=e=>{ku({type:Lc.IncrementalSnapshot,data:{source:Mc.Mutation,...e}})},U=e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.Scroll,...e}}),j=e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.CanvasMutation,...e}}),W=new Cu({mutationCb:z,adoptedStyleSheetCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.AdoptedStyleSheet,...e}})}),$=new ou({mirror:Lu,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:ku});for(const Y of L||[])Y.getMirror&&Y.getMirror({nodeMirror:Lu,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const V=new Iu;Eu=new vu({recordCanvas:C,mutationCb:j,win:window,blockClass:n,blockSelector:o,mirror:Lu,sampling:w.canvas,dataURLOptions:b});const G=new iu({mutationCb:z,scrollCb:U,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:w,slimDOMOptions:P,iframeManager:$,stylesheetManager:W,canvasManager:Eu,keepIframeSrcFn:M,processedNodeManager:V},mirror:Lu});xu=(e=!1)=>{if(!v)return;ku({type:Lc.Meta,data:{href:window.location.href,width:mc(),height:fc()}},e),W.reset(),G.init(),Gc.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Be,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=()=>!1}=t||{};return ft(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v,newlyAddedElement:!1})}(document,{mirror:Lu,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:b,recordCanvas:C,inlineImages:O,onSerialize:e=>{vc(e,Lu)&&$.addIframe(e),Cc(e,Lu)&&W.trackLinkElement(e),Ic(e)&&G.addShadowRoot(oc.shadowRoot(e),document)},onIframeLoad:(e,t)=>{$.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:M});if(!t)return console.warn("Failed to snapshot the document");ku({type:Lc.FullSnapshot,data:{node:t,initialOffset:pc(window)}},e),Gc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Lu.getId(document))};try{const e=[],t=e=>{var t;return Vc(tu)({mutationCb:z,mousemoveCb:(e,t)=>ku({type:Lc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.ViewportResize,...e}}),inputCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.Input,...e}}),mediaInteractionCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.MediaInteraction,...e}}),styleSheetRuleCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.StyleSheetRule,...e}}),styleDeclarationCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.StyleDeclaration,...e}}),canvasMutationCb:j,fontCb:e=>ku({type:Lc.IncrementalSnapshot,data:{source:Mc.Font,...e}}),selectionCb:e=>{ku({type:Lc.IncrementalSnapshot,data:{source:Mc.Selection,...e}})},customElementCb:e=>{ku({type:Lc.IncrementalSnapshot,data:{source:Mc.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:v,recordCanvas:C,inlineImages:O,userTriggeredOnInput:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:M,blockSelector:o,slimDOMOptions:P,dataURLOptions:b,mirror:Lu,iframeManager:$,stylesheetManager:W,shadowDomManager:G,processedNodeManager:V,canvasManager:Eu,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>ku({type:Lc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};$.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(s){console.warn(s)}});const r=()=>{xu(),e.push(t(document)),Ou=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(ic("DOMContentLoaded",()=>{ku({type:Lc.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(ic("load",()=>{ku({type:Lc.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),V.destroy(),Ou=!1,$c=void 0}}catch(Z){console.warn(Z)}}var Au,Ru;Mu.addCustomEvent=(e,t)=>{if(!Ou)throw new Error("please add custom event after start recording");ku({type:Lc.Custom,data:{tag:e,payload:t}})},Mu.freezePage=()=>{Gc.forEach(e=>e.freeze())},Mu.takeFullSnapshot=e=>{if(!Ou)throw new Error("please take full snapshot after start recording");xu(e)},Mu.mirror=Lu,(Ru=Au||(Au={}))[Ru.NotStarted=0]="NotStarted",Ru[Ru.Running=1]="Running",Ru[Ru.Stopped=2]="Stopped";const{addCustomEvent:Tu}=Mu,{takeFullSnapshot:Nu}=Mu,Du={isRecording:!1,events:[],stopFn:null,startTime:null};let Pu=null;const Fu={maskAllInputs:!1,inlineStylesheet:!0,sampling:{mousemove:50,mouseInteraction:!0,scroll:150,input:"last"},checkoutEveryNth:200,checkoutEveryNms:3e4,recordCanvas:!1,collectFonts:!1,inlineImages:!0};function _u(){if(!Du.isRecording)return[];Du.stopFn&&(Du.stopFn(),Du.stopFn=null),Du.isRecording=!1;const e=[...Du.events];return Du.events=[],Du.startTime=null,e}function Bu(e,t){if(Du.isRecording)try{Tu(e,t)}catch(r){console.warn("[LogSpace] Failed to add custom event:",r)}}const zu="__logspace_leader",Uu="__logspace_session";const ju=new class{constructor(){this.channel=null,this.isLeader=!1,this.callbacks=null,this.heartbeatTimer=null,this.leaderCheckTimer=null,this.currentSessionId=null,this.initialized=!1,this.debug=!1,this.tabId=this.generateTabId()}generateTabId(){return`tab_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,8)}`}isSupported(){return"undefined"!=typeof BroadcastChannel&&"undefined"!=typeof localStorage}init(e,t=!1){this.initialized||(this.isSupported()?(this.callbacks=e,this.debug=t,this.initialized=!0,this.channel=new BroadcastChannel("logspace-multi-tab"),this.channel.onmessage=e=>this.handleMessage(e.data),window.addEventListener("beforeunload",()=>this.handleUnload()),this.electLeader(),this.debug&&console.log("[LogSpace MultiTab] Initialized",{tabId:this.tabId,isLeader:this.isLeader})):t&&console.log("[LogSpace MultiTab] BroadcastChannel not supported, running single-tab mode"))}electLeader(){const e=this.getLeaderState();e&&!this.isLeaderStale(e)?this.becomeFollower(e.sessionId):this.tryBecomeLeader()}tryBecomeLeader(){const e=this.getSessionState(),t=e?.id||this.generateSessionId(),r=!e,s={tabId:this.tabId,sessionId:t,heartbeat:Date.now()};try{localStorage.setItem(zu,JSON.stringify(s));const e=this.getLeaderState();e?.tabId===this.tabId?this.becomeLeader(t,r):this.becomeFollower(e.sessionId)}catch(n){this.debug&&console.warn("[LogSpace MultiTab] Failed to claim leadership:",n)}}becomeLeader(e,t){if(this.isLeader=!0,this.currentSessionId=e,t){const t={id:e,startTime:Date.now()};localStorage.setItem(Uu,JSON.stringify(t))}this.startHeartbeat(),this.broadcast({type:"leader-announce",tabId:this.tabId,sessionId:e}),this.callbacks?.onBecomeLeader(e,t),this.debug&&console.log("[LogSpace MultiTab] Became leader",{sessionId:e,isNewSession:t})}becomeFollower(e){this.isLeader=!1,this.currentSessionId=e,this.stopHeartbeat(),this.startLeaderCheck(),this.callbacks?.onBecomeFollower(e),this.debug&&console.log("[LogSpace MultiTab] Became follower",{sessionId:e})}handleMessage(e){switch(this.debug&&console.log("[LogSpace MultiTab] Received message:",e.type),e.type){case"leader-announce":e.tabId!==this.tabId&&(this.isLeader&&this.becomeFollower(e.sessionId),this.callbacks?.onLeaderChanged(e.tabId));break;case"leader-leaving":this.isLeader||(this.debug&&console.log("[LogSpace MultiTab] Leader leaving, attempting to claim leadership"),setTimeout(()=>this.tryBecomeLeader(),100*Math.random()));break;case"log":this.isLeader&&e.tabId!==this.tabId&&this.callbacks?.onReceiveLog(e.log);break;case"rrweb-event":this.isLeader&&e.tabId!==this.tabId&&this.callbacks?.onReceiveRRWebEvent(e.event);break;case"request-session":if(this.isLeader&&e.tabId!==this.tabId){const e=this.getSessionState();e&&this.broadcast({type:"session-info",sessionId:e.id,startTime:e.startTime})}break;case"session-info":this.isLeader||(this.currentSessionId=e.sessionId)}}startHeartbeat(){this.stopHeartbeat(),this.stopLeaderCheck(),this.heartbeatTimer=setInterval(()=>{this.isLeader&&this.updateHeartbeat()},2e3),this.updateHeartbeat()}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}updateHeartbeat(){const e=this.getLeaderState();if(e&&e.tabId===this.tabId){e.heartbeat=Date.now();try{localStorage.setItem(zu,JSON.stringify(e))}catch(t){}}}startLeaderCheck(){this.stopLeaderCheck(),this.leaderCheckTimer=setInterval(()=>{if(!this.isLeader){const e=this.getLeaderState();e&&!this.isLeaderStale(e)||(this.debug&&console.log("[LogSpace MultiTab] Leader appears dead, attempting takeover"),this.tryBecomeLeader())}},3e3)}stopLeaderCheck(){this.leaderCheckTimer&&(clearInterval(this.leaderCheckTimer),this.leaderCheckTimer=null)}isLeaderStale(e){return Date.now()-e.heartbeat>5e3}getLeaderState(){try{const e=localStorage.getItem(zu);return e?JSON.parse(e):null}catch{return null}}getSessionState(){try{const e=localStorage.getItem(Uu);return e?JSON.parse(e):null}catch{return null}}generateSessionId(){return`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`}broadcast(e){this.channel&&this.channel.postMessage(e)}handleUnload(){if(this.isLeader){this.broadcast({type:"leader-leaving",tabId:this.tabId});try{localStorage.removeItem(zu)}catch{}}this.cleanup()}sendLog(e){this.initialized&&this.channel&&(this.isLeader?this.callbacks?.onReceiveLog(e):this.broadcast({type:"log",tabId:this.tabId,log:e}))}sendRRWebEvent(e){this.initialized&&this.channel&&(this.isLeader?this.callbacks?.onReceiveRRWebEvent(e):this.broadcast({type:"rrweb-event",tabId:this.tabId,event:e}))}updateSessionUser(e,t){const r=this.getSessionState();if(r){r.userId=e,r.userTraits=t;try{localStorage.setItem(Uu,JSON.stringify(r))}catch{}}}endSession(){try{localStorage.removeItem(Uu),this.isLeader&&localStorage.removeItem(zu)}catch{}}getTabId(){return this.tabId}getSessionId(){return this.currentSessionId}isLeaderTab(){return this.isLeader}isActive(){return this.initialized&&null!==this.channel}cleanup(){this.stopHeartbeat(),this.stopLeaderCheck(),this.channel&&(this.channel.close(),this.channel=null),this.initialized=!1}forceLeadership(){if(!this.initialized)return;const e=this.getSessionState(),t=e?.id||this.generateSessionId();this.becomeLeader(t,!e)}},Wu="pending_sessions",$u="current_session";let Vu=null,Gu=null;async function Ju(){return Gu||(Vu||(Gu=new Promise((e,t)=>{const r=indexedDB.open("logspace-sdk-db",1);r.onerror=()=>{Gu=null,t(new Error("Failed to open IndexedDB"))},r.onsuccess=()=>{Vu=r.result,e(Vu)},r.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(Wu)){t.createObjectStore(Wu,{keyPath:"id"}).createIndex("by-created","createdAt")}t.objectStoreNames.contains($u)||t.createObjectStore($u,{keyPath:"id"})}}),Gu))}function Zu(){return"undefined"!=typeof indexedDB}async function Yu(){if(Zu())try{const e=await Ju(),t=e.transaction($u,"readwrite").objectStore($u);await new Promise((e,r)=>{const s=t.delete("current");s.onsuccess=()=>e(),s.onerror=()=>r(s.error)})}catch(e){console.warn("[LogSpace] Failed to clear session backup:",e)}}async function Hu(e){if(Zu())try{const t=await Ju(),r=t.transaction(Wu,"readwrite").objectStore(Wu),s={id:e.id,data:e,createdAt:Date.now(),retryCount:0};await new Promise((e,t)=>{const n=r.put(s);n.onsuccess=()=>e(),n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to save pending session:",t)}}async function Xu(){if(!Zu())return[];try{const e=await Ju(),t=e.transaction(Wu,"readonly").objectStore(Wu);return new Promise((e,r)=>{const s=t.getAll();s.onsuccess=()=>e(s.result||[]),s.onerror=()=>r(s.error)})}catch(e){return console.warn("[LogSpace] Failed to get pending sessions:",e),[]}}async function Ku(e){if(Zu())try{const t=await Ju(),r=t.transaction(Wu,"readwrite").objectStore(Wu);await new Promise((t,s)=>{const n=r.delete(e);n.onsuccess=()=>t(),n.onerror=()=>s(n.error)})}catch(t){console.warn("[LogSpace] Failed to remove pending session:",t)}}async function qu(e){if(Zu())try{const t=await Ju(),r=t.transaction(Wu,"readwrite").objectStore(Wu),s=r.get(e);await new Promise((e,t)=>{s.onsuccess=()=>{const n=s.result;if(n){n.retryCount++,n.lastRetryAt=Date.now();const s=r.put(n);s.onsuccess=()=>e(),s.onerror=()=>t(s.error)}else e()},s.onerror=()=>t(s.error)})}catch(t){console.warn("[LogSpace] Failed to update pending session retry:",t)}}const Qu="0.1.0";let eh=null,th=null,rh=[],sh=[],nh=!1,oh="manual",ih=!1,ah=!1,lh={count:0,windowStart:0},ch={lastLogHash:null,lastLogCount:0},uh=0,hh=0,dh=null,ph=null,fh=null,mh=null,gh=0,yh=!1,wh=null,bh=null,Sh=null,vh=null,Ch=null,Ih=null;const kh={rrweb:!0,console:!0,network:!0,errors:!0,interactions:!0,performance:!0,websocket:!0,sse:!0,storage:!0,resources:!0,spaNavigation:!0},xh={maskAllInputs:!1,checkoutEveryNth:200,recordCanvas:!1},Eh={maskSensitiveData:!0,maskSelectors:[],excludeUrls:[],blockNetworkBodies:[],redactHeaders:["authorization","cookie","x-api-key"],logLevels:["log","info","warn","error","debug"]},Oh={maxLogs:1e4,maxSize:10485760,maxDuration:300,idleTimeout:30,navigateAwayTimeout:120,rateLimit:100,deduplicate:!0},Lh={continueOnRefresh:!0,onIdle:!0,onLimitReached:!0},Mh={enabled:!1,bufferBefore:15,recordAfter:15,triggers:{onError:!0,onConsoleError:!0,onNetworkStatus:[500,502,503,504]}};function Ah(e){if(!eh?.limits.deduplicate)return!0;const t=function(e){return`${e.type}:${JSON.stringify(e.data)}`}(e);if(t===ch.lastLogHash){if(ch.lastLogCount++,rh.length>0){const e=rh[rh.length-1];e&&(e.data.duplicateCount=ch.lastLogCount)}return!1}return ch.lastLogHash=t,ch.lastLogCount=1,!0}function Rh(){eh?.autoEnd.onIdle&&(ju.isActive()&&!ju.isLeaderTab()||(dh&&clearTimeout(dh),dh=setTimeout(()=>{"recording"===th?.status&&(eh?.debug&&console.log("[LogSpace] Session auto-ended due to idle timeout"),oh="idle",ah=!0,eh?.hooks.onLimitReached?.("idle"),qh.stopSession())},1e3*eh.limits.idleTimeout)))}function Th(){eh&&nh&&(ju.isActive()&&!ju.isLeaderTab()||!ah||th&&"stopped"!==th.status||(eh.debug&&console.log("[LogSpace] User activity detected - starting new session"),ah=!1,qh.startSession()))}const Nh=["mousedown","keydown","scroll","touchstart"];function Dh(){const e=Date.now();e-gh<1e3||(gh=e,Rh(),Th())}function Ph(e,t){eh?.sampling.enabled&&!yh&&(yh=!0,wh=e,bh=Date.now(),eh.debug&&console.log(`[LogSpace] Sampling triggered by: ${e}`),eh.hooks.onSamplingTrigger?.(e,t),Sh=setTimeout(()=>{"recording"===th?.status&&(eh?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),oh="samplingTriggered",qh.stopSession())},1e3*eh.sampling.recordAfter))}const Fh=e=>{if(!eh||!th||"recording"!==th.status)return;if(!function(){if(!eh)return!1;const e=Date.now();return e-lh.windowStart>1e3?(lh.windowStart=e,lh.count=1,!0):lh.count>=eh.limits.rateLimit?(eh.debug&&console.warn("[LogSpace] Rate limit exceeded, dropping log"),!1):(lh.count++,!0)}())return;if(!Ah(e))return;const t=eh?rh.length>=eh.limits.maxLogs?"maxLogs":uh+hh>=eh.limits.maxSize?"maxSize":null:null;if(t)return void(eh.autoEnd.onLimitReached&&(eh.debug&&console.log(`[LogSpace] Session auto-ended: ${t}`),oh=t,ih=!0,eh.hooks.onLimitReached?.(t),qh.stopSession()));const r=ju.isActive()?ju.getTabId():"single",s={id:`${rh.length+1}`,timestamp:Date.now(),tabId:r,tabUrl:"undefined"!=typeof window?window.location.href:"",type:e.type,data:e.data,severity:e.severity};if(ju.isActive()&&!ju.isLeaderTab())return ju.sendLog(s),Rh(),void(eh.debug&&console.log("[LogSpace] Captured (sent to leader):",s.type,s.data));rh.push(s),uh+=JSON.stringify(s).length,_h(s),Rh(),function(e){if(eh?.sampling.enabled&&!yh)if(eh.sampling.triggers.onError&&"error"===e.type)Ph("error",e);else{if(eh.sampling.triggers.onConsoleError&&"console"===e.type&&"error"===e.data.level)return void Ph("consoleError",e);if(eh.sampling.triggers.onNetworkStatus&&"network"===e.type){const t=e.data;if(t.status&&eh.sampling.triggers.onNetworkStatus.includes(t.status))Ph("networkError",e)}}}(s),eh.hooks.onAction?.(s,th),eh.debug&&console.log("[LogSpace] Captured:",s.type,s.data)};function _h(e){if(th)switch(th.stats.logCount++,e.type){case"network":th.stats.networkLogCount++;break;case"console":th.stats.consoleLogCount++,"error"===e.data?.level&&th.stats.errorCount++;break;case"error":th.stats.errorCount++;break;case"interaction":th.stats.interactionLogCount++;break;case"performance":th.stats.performanceLogCount++;break;case"storage":th.stats.storageLogCount++;break;case"annotation":th.stats.annotationCount++}}function Bh(){d.uninstall(),S.uninstall(),I.uninstall(),L.uninstall(),T.uninstall(),z.uninstall(),G.uninstall(),te.uninstall(),ae.uninstall(),ye.uninstall()}let zh=!1;async function Uh(){if(th&&"recording"===th.status&&Zu()&&(!ju.isActive()||ju.isLeaderTab()))try{await async function(e,t,r,s){if(Zu())try{const n=(await Ju()).transaction($u,"readwrite").objectStore($u),o={id:"current",sessionId:e,logs:t,rrwebEvents:r,startTime:s.startTime,url:s.url,title:s.title,userId:s.userId,userTraits:s.userTraits,metadata:s.metadata,lastCheckpoint:Date.now()};await new Promise((e,t)=>{const r=n.put(o);r.onsuccess=()=>e(),r.onerror=()=>t(r.error)})}catch(n){console.warn("[LogSpace] Failed to save session checkpoint:",n)}}(th.id,rh,sh,{startTime:th.startTime,url:th.url,title:th.title,userId:th.userId,userTraits:th.userTraits,metadata:th.metadata}),eh?.debug&&console.log("[LogSpace] Session checkpoint saved",{logs:rh.length,rrwebEvents:sh.length})}catch(e){eh?.debug&&console.warn("[LogSpace] Failed to save checkpoint:",e)}}function jh(){fh&&(clearInterval(fh),fh=null)}const Wh="__logspace_emergency_backup";function $h(){try{localStorage.removeItem(Wh)}catch(e){}}function Vh(){if(zh)return;if(!eh||!th||"recording"!==th.status)return;if(ju.isActive()&&!ju.isLeaderTab())return void(eh.debug&&console.log("[LogSpace] Follower tab unloading - no session to save (data is with leader)"));zh=!0,oh="unload";const e=Zh();if(e){if(eh.autoEnd.continueOnRefresh)try{sessionStorage.setItem("logspace_continuing_session_id",th.id),sessionStorage.setItem("logspace_continuing_session_start",String(th.startTime)),sessionStorage.setItem("logspace_continuing_session_saved_at",String(Date.now())),eh.debug&&console.log("[LogSpace] Session ID and startTime saved for continuation:",th.id,th.startTime)}catch{}!function(e){try{if(0===e.logs.length&&(!e.rrwebEvents||e.rrwebEvents.length<3))return;const t=JSON.stringify(e);localStorage.setItem(Wh,t)}catch(t){}}(e),Zu()&&Hu(e).catch(()=>{}),eh.debug&&console.log("[LogSpace] Session saved for recovery on next visit")}}function Gh(){if("hidden"===document.visibilityState){if(!eh||!th||"recording"!==th.status)return;const e=1e3*eh.limits.navigateAwayTimeout;eh.debug&&console.log(`[LogSpace] Tab hidden, grace period started (${eh.limits.navigateAwayTimeout}s)`),eh.capture.rrweb&&Bu("tab-hidden",{tabId:ju.isActive()?ju.getTabId():"main",timestamp:Date.now()}),mh&&clearTimeout(mh),mh=setTimeout(()=>{if("recording"===th?.status&&"hidden"===document.visibilityState){if(ju.isActive()&&!ju.isLeaderTab())return void(eh?.debug&&console.log("[LogSpace] Grace period expired, but follower tab - not ending session"));eh?.debug&&console.log("[LogSpace] Grace period expired, ending session"),oh="navigateAway",Vh()}},e)}else{if(mh&&(eh?.debug&&console.log("[LogSpace] Tab visible, grace period cancelled"),clearTimeout(mh),mh=null),eh?.capture.rrweb&&"recording"===th?.status){const e=ju.isActive()?ju.getTabId():"main";eh.debug&&console.log("[LogSpace] Tab visible, forcing full rrweb snapshot for:",e),Bu("tab-visible",{tabId:e,timestamp:Date.now()}),function(){if(Du.isRecording)try{Nu(!0)}catch(e){console.warn("[LogSpace] Failed to take full snapshot:",e)}}()}Rh()}}function Jh(e){Vh()}function Zh(){if(!th)return null;if(eh?.sampling.enabled&&!yh)return eh.debug&&console.log("[LogSpace] Sampling enabled but not triggered - session not sent"),null;eh?.sampling.enabled&&yh&&function(){if(!eh?.sampling.enabled||!bh||!th)return;const e=bh-1e3*eh.sampling.bufferBefore,t=bh+1e3*eh.sampling.recordAfter;rh=rh.filter(r=>r.timestamp>=e&&r.timestamp<=t),sh=sh.filter(r=>r.timestamp>=e&&r.timestamp<=t),eh.debug&&console.log(`[LogSpace] Trimmed to sampling window: ${rh.length} logs, ${sh.length} rrweb events`)}();const e=Date.now(),t={id:th.id,startTime:th.startTime,endTime:e,duration:e-th.startTime,url:th.url,title:th.title,userId:th.userId,userTraits:th.userTraits,metadata:th.metadata,logs:eh?.hooks.beforeSend?eh.hooks.beforeSend(rh)||[]:rh,stats:th.stats,endReason:oh,recordingType:"rrweb",userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,sdkVersion:Qu};return eh?.sampling.enabled&&yh&&wh&&(t.samplingTrigger=wh),eh?.capture.rrweb&&sh.length>0&&(t.rrwebEvents=sh),t}async function Yh(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof CompressionStream){const e=new CompressionStream("gzip"),r=e.writable.getWriter();r.write(t),r.close();const s=[],n=e.readable.getReader();for(;;){const{done:e,value:t}=await n.read();if(e)break;s.push(t)}const o=s.reduce((e,t)=>e+t.length,0),i=new Uint8Array(o);let a=0;for(const t of s)i.set(t,a),a+=t.length;return new Blob([i],{type:"application/gzip"})}return new Blob([t],{type:"application/json"})}async function Hh(e){if(!eh?.serverUrl)throw new Error("No serverUrl configured");const t=JSON.stringify(e),r=await Yh(t),s="application/gzip"===r.type,n=new FormData;n.append("title",e.title||`SDK Session ${e.id}`),n.append("log_file",r,s?`${e.id}.json.gz`:`${e.id}.json`),e.url&&n.append("description",`Recovered session from ${e.url}`);const o={};for(const c of e.logs){const e=c.type||"unknown";o[e]=(o[e]||0)+1}const i={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:e.duration,userAgent:e.userAgent,timestamp:e.startTime,recovered:!0,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};n.append("log_metadata",JSON.stringify(i));const a={...eh.headers};eh.apiKey&&(a.Authorization=`Bearer ${eh.apiKey}`);const l=await fetch(`${eh.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:a,body:n});if(!l.ok){const e=await l.text();throw new Error(`HTTP ${l.status}: ${e}`)}}function Xh(e,t){if(th&&"recording"===th.status){if(e.length>0){const t=new Set(rh.map(e=>e.timestamp)),r=e.filter(e=>!t.has(e.timestamp));if(r.length>0){rh=[...r,...rh];for(const e of r)uh+=JSON.stringify(e).length,_h(e);eh?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered logs (${e.length-r.length} duplicates skipped)`)}else eh?.debug&&console.log(`[LogSpace] All ${e.length} recovered logs already exist, skipping`)}if(t.length>0){const e=new Set(sh.map(e=>e.timestamp)),r=t.filter(t=>!e.has(t.timestamp));if(r.length>0){sh=[...r,...sh];for(const e of r)hh+=JSON.stringify(e).length;eh?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered rrweb events (${t.length-r.length} duplicates skipped)`)}else eh?.debug&&console.log(`[LogSpace] All ${t.length} recovered rrweb events already exist, skipping`)}}else eh?.debug&&console.warn("[LogSpace] Cannot merge recovered data - no active session")}async function Kh(){if(eh?.serverUrl)try{const t=function(){try{const e=localStorage.getItem(Wh);if(e)return JSON.parse(e)}catch(e){}return null}();if(t)if(Ih&&t.id===Ih)eh.debug&&console.log("[LogSpace] Merging emergency backup into continuing session:",t.id),Xh(t.logs,t.rrwebEvents||[]),$h(),await Yu();else{eh.debug&&console.log("[LogSpace] Recovering emergency backup session:",t.id);try{await Hh(t),$h(),await Yu(),Zu()&&await Ku(t.id),eh.debug&&console.log("[LogSpace] Emergency backup session sent:",t.id)}catch(e){Zu()&&(await Hu(t),$h()),eh.debug&&console.warn("[LogSpace] Error sending emergency backup, saved to IndexedDB:",e)}}if(!Zu())return;await async function(){if(!Zu())return;const t=Date.now();try{const e=await Xu();for(const r of e){const e=t-r.createdAt>6048e5,s=r.retryCount>=5;(e||s)&&await Ku(r.id)}}catch(e){console.warn("[LogSpace] Failed to cleanup old sessions:",e)}}();const r=await Xu();if(0===r.length){const t=await async function(){if(!Zu())return null;try{const e=(await Ju()).transaction($u,"readonly").objectStore($u);return new Promise((t,r)=>{const s=e.get("current");s.onsuccess=()=>t(s.result||null),s.onerror=()=>r(s.error)})}catch(e){return console.warn("[LogSpace] Failed to get session backup:",e),null}}();if(t&&t.logs.length>0){eh.debug&&console.log("[LogSpace] Recovering crashed session:",t.sessionId);const e={id:t.sessionId,startTime:t.startTime,endTime:t.lastCheckpoint,duration:t.lastCheckpoint-t.startTime,url:t.url,title:t.title,userId:t.userId,userTraits:t.userTraits,metadata:t.metadata,logs:t.logs,stats:{logCount:t.logs.length,networkLogCount:t.logs.filter(e=>"network"===e.type).length,consoleLogCount:t.logs.filter(e=>"console"===e.type).length,errorCount:t.logs.filter(e=>"error"===e.type).length,storageLogCount:t.logs.filter(e=>"storage"===e.type).length,interactionLogCount:t.logs.filter(e=>"interaction"===e.type).length,performanceLogCount:t.logs.filter(e=>"performance"===e.type).length,annotationCount:t.logs.filter(e=>"annotation"===e.type).length,tabCount:1},endReason:"crash",recordingType:"rrweb",rrwebEvents:t.rrwebEvents,sdkVersion:Qu};r.push({id:t.sessionId,data:e,createdAt:t.lastCheckpoint,retryCount:0}),await Yu()}}if(0===r.length)return;eh.debug&&console.log(`[LogSpace] Recovering ${r.length} pending session(s)`);for(const s of r)if(Ih&&s.id===Ih)eh.debug&&console.log("[LogSpace] Merging pending session into continuing session:",s.id),Xh(s.data.logs,s.data.rrwebEvents||[]),await Ku(s.id);else try{await Hh(s.data),await Ku(s.id),eh.debug&&console.log("[LogSpace] Recovered session sent:",s.id)}catch(e){await qu(s.id),eh.debug&&console.warn("[LogSpace] Error sending recovered session:",s.id,e)}}catch(e){eh.debug&&console.warn("[LogSpace] Session recovery failed:",e)}finally{Ih=null}}const qh={init(e){if(nh)console.warn("[LogSpace] SDK already initialized");else if("undefined"!=typeof window){if(eh=function(e){return{serverUrl:e.serverUrl,apiKey:e.apiKey,capture:{...kh,...e.capture},rrweb:{...xh,...e.rrweb},privacy:{...Eh,...e.privacy},limits:{...Oh,...e.limits},autoEnd:{...Lh,...e.autoEnd},sampling:{...Mh,...e.sampling,triggers:{...Mh.triggers,...e.sampling?.triggers}},hooks:e.hooks||{},headers:e.headers||{},debug:e.debug||!1,dryRun:e.dryRun||!1}}(e),nh=!0,eh.debug&&console.log("[LogSpace] SDK initialized",{version:Qu,serverUrl:eh.serverUrl,limits:eh.limits,persistence:Zu()?"enabled":"disabled",multiTab:ju.isSupported()?"enabled":"disabled"}),ju.isSupported()&&ju.init({onBecomeLeader:(e,t)=>{eh?.debug&&console.log("[LogSpace] This tab is now the leader",{sessionId:e,isNewSession:t}),t||(vh=e),th||qh.startSession()},onBecomeFollower:e=>{eh?.debug&&console.log("[LogSpace] This tab is now a follower",{sessionId:e}),th||qh.startSession()},onReceiveLog:e=>{"recording"===th?.status&&(rh.push(e),uh+=JSON.stringify(e).length,_h(e))},onReceiveRRWebEvent:e=>{"recording"===th?.status&&(sh.push(e),hh+=JSON.stringify(e).length)},onLeaderChanged:e=>{eh?.debug&&console.log("[LogSpace] Leader changed to:",e)}},eh.debug),eh.autoEnd.continueOnRefresh)try{const e=sessionStorage.getItem("logspace_continuing_session_id"),t=sessionStorage.getItem("logspace_continuing_session_start"),r=sessionStorage.getItem("logspace_continuing_session_saved_at");if(sessionStorage.removeItem("logspace_continuing_session_id"),sessionStorage.removeItem("logspace_continuing_session_start"),sessionStorage.removeItem("logspace_continuing_session_saved_at"),e){const s=r?Number(r):0,n=Date.now()-s,o=1e3*eh.limits.navigateAwayTimeout;s>0&&n>o?eh.debug&&console.log("[LogSpace] Session continuation expired:",e,`(${Math.round(n/1e3)}s > ${eh.limits.navigateAwayTimeout}s timeout)`):(vh=e,Ih=e,t&&(Ch=Number(t)),eh.debug&&console.log("[LogSpace] Continuing session from previous page:",e,"startTime:",t))}}catch{}window.addEventListener("beforeunload",Vh),window.addEventListener("pagehide",Jh),document.addEventListener("visibilitychange",Gh),eh.autoEnd.onIdle&&function(){if("undefined"!=typeof window){for(const e of Nh)window.addEventListener(e,Th,{passive:!0,capture:!0});window.addEventListener("mousemove",Dh,{passive:!0,capture:!0})}}(),zh=!1,ju.isActive()||this.startSession(),Kh().catch(()=>{})}else console.warn("[LogSpace] SDK requires browser environment")},startSession(e){if(!nh||!eh)return void console.warn("[LogSpace] SDK not initialized");if("recording"===th?.status)return void console.warn("[LogSpace] Session already recording");if(ih)return void(eh.debug&&console.log("[LogSpace] Session not restarted - previous session ended by hard limit"));let t,r;ah=!1,yh=!1,wh=null,bh=null,Sh&&(clearTimeout(Sh),Sh=null),rh=[],sh=[],uh=0,hh=0,lh={count:0,windowStart:0},ch={lastLogHash:null,lastLogCount:0},oh="manual",ju.isActive()&&ju.getSessionId()?(t=ju.getSessionId(),r=Date.now()):vh?(t=vh,r=Ch||Date.now(),eh.debug&&console.log("[LogSpace] Using continuing session ID:",t,"with original startTime:",r),vh=null,Ch=null):(t=`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`,r=Date.now()),th={id:t,startTime:r,status:"recording",url:window.location.href,title:document.title,metadata:e,stats:{logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:ju.isActive()?0:1}};const s=ju.isActive()?ju.getTabId():void 0;if(eh.capture.rrweb){const e=function(e={},t,r){if(Du.isRecording)return console.warn("[LogSpace] rrweb recording already in progress"),!1;const s={...Fu,...e};Pu=r||null;try{Du.events=[],Du.startTime=Date.now(),Du.isRecording=!0,Du.stopFn=Mu({emit:(e,r)=>{const s={...e,tabId:Pu||void 0};Du.events.push(s),t?.(s)},maskAllInputs:s.maskAllInputs,maskTextSelector:s.maskTextSelector,blockSelector:s.blockSelector,ignoreSelector:s.ignoreSelector,inlineStylesheet:s.inlineStylesheet,sampling:s.sampling,checkoutEveryNth:s.checkoutEveryNth,checkoutEveryNms:s.checkoutEveryNms,recordCanvas:s.recordCanvas,collectFonts:s.collectFonts,inlineImages:s.inlineImages,plugins:s.plugins})??null;try{Nu(!0)}catch(n){console.warn("[LogSpace] Failed to take initial full snapshot:",n)}return!0}catch(o){return console.error("[LogSpace] Failed to start rrweb recording:",o),Du.isRecording=!1,!1}}({maskAllInputs:eh.rrweb.maskAllInputs,maskTextSelector:eh.rrweb.maskTextSelector,blockSelector:eh.rrweb.blockSelector,ignoreSelector:eh.rrweb.ignoreSelector,recordCanvas:eh.rrweb.recordCanvas,checkoutEveryNth:eh.rrweb.checkoutEveryNth},e=>{if(!th||"recording"!==th.status)return;if(ju.isActive()&&!ju.isLeaderTab())return ju.sendRRWebEvent(e),void Rh();const t=JSON.stringify(e).length;hh+=t;eh&&uh+hh>=eh.limits.maxSize?eh.autoEnd.onLimitReached&&!ih&&(ih=!0,eh.debug&&console.log("[LogSpace] Session auto-ended: maxSize (rrweb)"),oh="maxSize",eh.hooks.onLimitReached?.("maxSize"),qh.stopSession()):(sh.push(e),Rh())},s);eh.debug&&console.log("[LogSpace] rrweb recording started:",e,s?`(tabId: ${s})`:"")}eh.limits.maxDuration>0&&(ph=setTimeout(()=>{"recording"===th?.status&&(eh?.debug&&console.log("[LogSpace] Session auto-ended: maxDuration"),oh="maxDuration",eh?.hooks.onLimitReached?.("maxDuration"),this.stopSession())},1e3*eh.limits.maxDuration)),Rh(),function(){if(!eh)return;const e={...eh.privacy};if(eh.serverUrl){const t=[`${eh.serverUrl}/api/v1/sessions`,`${eh.serverUrl}/api/v1/protected/sdk/logs`];e.excludeUrls=[...e.excludeUrls||[],...t]}eh.capture.console&&d.install(Fh,eh.privacy),eh.capture.network&&S.install(Fh,e),eh.capture.errors&&I.install(Fh,eh.privacy),eh.capture.websocket&&L.install(Fh,eh.privacy),eh.capture.sse&&T.install(Fh,eh.privacy),eh.capture.storage&&z.install(Fh,eh.privacy),eh.capture.interactions&&G.install(Fh,eh.privacy),eh.capture.performance&&te.install(Fh,eh.privacy),eh.capture.resources&&ae.install(Fh,e),eh.capture.spaNavigation&&ye.install(Fh,eh.privacy)}(),!fh&&Zu()&&(fh=setInterval(()=>{Uh()},15e3)),th&&(eh.hooks.onSessionStart?.(th),eh.debug&&console.log("[LogSpace] Session started:",th.id))},async stopSession(){if(th&&"stopped"!==th.status){if(th.status="stopped",th.endTime=Date.now(),vh=null,dh&&(clearTimeout(dh),dh=null),ph&&(clearTimeout(ph),ph=null),mh&&(clearTimeout(mh),mh=null),jh(),eh?.capture.rrweb){const e=_u();eh.debug&&console.log("[LogSpace] rrweb recording stopped, events:",e.length)}if(Bh(),eh?.hooks.onSessionEnd?.(th,rh),eh?.debug&&console.log("[LogSpace] Session stopped:",th.id,{duration:th.endTime-th.startTime,logs:rh.length,rrwebEvents:sh.length,reason:oh}),!ju.isActive()||ju.isLeaderTab())try{await async function(){const e=Zh();if(e){if(eh?.dryRun)return console.log("[LogSpace] 🔶 DRY RUN - Session payload:",{id:e.id,duration:`${Math.round(e.duration/1e3)}s`,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0,size:`${Math.round(JSON.stringify(e).length/1024)}KB`,reason:e.endReason}),void console.log("[LogSpace] 🔶 Full payload available via LogSpace.getSessionData()");if(eh?.serverUrl)try{const t=JSON.stringify(e),r=await Yh(t),s="application/gzip"===r.type,n=new FormData;n.append("title",e.title||`SDK Session ${e.id}`),n.append("log_file",r,s?`${e.id}.json.gz`:`${e.id}.json`),e.url&&n.append("description",`Session recorded on ${e.url}`);const o={};for(const c of e.logs){const e=c.type||"unknown";o[e]=(o[e]||0)+1}const i={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:e.duration,userAgent:e.userAgent,timestamp:e.startTime,url:e.url,userId:th?.userId,userTraits:th?.userTraits,duration:e.duration,stats:e.stats};n.append("log_metadata",JSON.stringify(i));const a={...eh.headers};eh.apiKey&&(a.Authorization=`Bearer ${eh.apiKey}`);const l=await fetch(`${eh.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:a,body:n});if(!l.ok){const e=await l.text();throw new Error(`HTTP ${l.status}: ${e}`)}if(eh.debug){const t=await l.json();console.log("[LogSpace] Session sent successfully:",{sessionId:e.id,logId:t.id,compressed:s,size:`${Math.round(r.size/1024)}KB`})}}catch(t){throw eh.debug&&console.error("[LogSpace] Failed to send session:",t),eh.hooks.onError?.(t),t}else eh?.debug&&console.log("[LogSpace] No serverUrl configured - session stored locally only",{id:e.id,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0})}}(),await Yu(),$h(),ju.isActive()&&ju.endSession()}catch(e){const t=Zh();throw t&&await Hu(t),e}}},identify(e,t){th&&(th.userId=e,th.userTraits=t,ju.isActive()&&ju.updateSessionUser(e,t),eh?.debug&&console.log("[LogSpace] User identified:",e))},track(e,t){Fh({type:"annotation",data:{annotationType:"event",event:e,properties:t}})},breadcrumb(e,t){Fh({type:"annotation",data:{annotationType:"breadcrumb",message:e,category:t}})},pauseRecording(){"recording"===th?.status&&(th.status="paused",eh?.debug&&console.log("[LogSpace] Recording paused"))},resumeRecording(){"paused"===th?.status&&(th.status="recording",Rh(),eh?.debug&&console.log("[LogSpace] Recording resumed"))},trigger(e){eh?.sampling.enabled?(eh.debug&&console.log("[LogSpace] Manual sampling trigger:",e||"user_triggered"),Ph("manual")):eh?.debug&&console.log("[LogSpace] trigger() called but sampling is not enabled")},getSession:()=>th,getSessionLogs:()=>[...rh],getSessionData:()=>Zh(),getRRWebEvents:()=>[...sh],destroy(){if(!nh)return;dh&&(clearTimeout(dh),dh=null),ph&&(clearTimeout(ph),ph=null),Sh&&(clearTimeout(Sh),Sh=null),mh&&(clearTimeout(mh),mh=null),jh(),ju.isActive()&&ju.cleanup(),eh?.capture.rrweb&&_u(),"undefined"!=typeof window&&(window.removeEventListener("beforeunload",Vh),window.removeEventListener("pagehide",Jh),document.removeEventListener("visibilitychange",Gh)),function(){if("undefined"!=typeof window){for(const e of Nh)window.removeEventListener(e,Th,{capture:!0});window.removeEventListener("mousemove",Dh,{capture:!0})}}(),Bh(),Vu&&(Vu.close(),Vu=null,Gu=null);const e=eh?.debug;eh=null,th=null,rh=[],sh=[],uh=0,hh=0,ih=!1,ah=!1,yh=!1,wh=null,bh=null,Ih=null,zh=!1,gh=0,nh=!1,e&&console.log("[LogSpace] SDK destroyed")},version:Qu};return e.LogSpace=qh,e.default=qh,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
2
2
|
//# sourceMappingURL=logspace.iife.js.map
|