@logspace/sdk 1.1.7 → 1.1.8

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.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LogSpace={})}(this,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("function"==typeof e){return`[Function: ${e.name||"anonymous"}]`}if("symbol"==typeof e)return e.toString();if(e instanceof Error)return JSON.stringify({name:e.name,message:e.message,stack:e.stack});if("undefined"!=typeof FormData&&e instanceof FormData){const t={};return e.forEach((e,r)=>{if("undefined"!=typeof Blob&&e instanceof Blob){const n=e,s="undefined"!=typeof File&&e instanceof File?`File(${e.name}, ${n.size}b)`:`Blob(${n.size}b)`;if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,s]:[e,s]}else t[r]=s}else{const n=String(e).length>1e3?String(e).substring(0,1e3)+"...":String(e);if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,n]:[e,n]}else t[r]=n}}),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 n(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:/\b(password|pwd|passwd)\s*[:=]\s*[^\s,;}\]]+/gi,replacement:"$1: [REDACTED]"},{pattern:/"password"\s*:\s*"[^"]*"/gi,replacement:'"password": "[REDACTED]"'},{pattern:/'password'\s*:\s*'[^']*'/gi,replacement:"'password': '[REDACTED]'"},{pattern:/\b(?:sk|pk|api|auth|secret)_(?:live|test|prod|dev)?_[A-Za-z0-9_-]{10,}/g,replacement:"[API_KEY_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:/\beyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\b/g,replacement:"[JWT_TOKEN_REDACTED]"}];for(const{pattern:n,replacement:s}of r)t=t.replace(n,s);return t}const s=/^(password|pwd|passwd|secret|token|api[_-]?key|auth[_-]?token|access[_-]?token|private[_-]?key|secret[_-]?key)\s*[:=]?\s*$/i;function o(e,t){if(!e||"object"!=typeof e)return e;const r={},s=["authorization","cookie","set-cookie","x-api-key","x-auth-token","x-access-token","x-csrf-token","csrf-token",...(t||[]).map(e=>e.toLowerCase())];for(const[o,i]of Object.entries(e)){let e=i;e=s.some(e=>o.toLowerCase().includes(e.toLowerCase()))?"[REDACTED]":n(i),r[o]=e}return r}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(e,t){if(!e||!t||0===t.length)return!1;try{const r=new URL(e).hostname.toLowerCase(),n=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(n))return!0}catch{}}}catch{}return!1}function l(){try{const e=(new Error).stack||"";return e.split("\n").slice(3).slice(0,3).join("\n").trim()}catch{return""}}function c(e,t){if(JSON.stringify(e).length<=t)return e;if(Array.isArray(e)){const r=[];let n=2;for(let s=0;s<e.length;s++){const o=JSON.stringify(e[s]).length+(s>0?1:0);if(n+o>t-100){const t=e.length-s;r.push({__logspace_truncated:!0,__remaining_items:t,__original_length:e.length});break}r.push(e[s]),n+=o}return r}if("object"==typeof e&&null!==e){const r={};let n=2;const s=Object.entries(e);for(let e=0;e<s.length;e++){const o=s[e];if(!o)continue;const[i,a]=o,l=JSON.stringify({[i]:a}).length-2+(e>0?1:0);if(n+l>t-150){const t=s.length-e;r.__logspace_truncated=!0,r.__remaining_properties=t;break}if("string"==typeof a&&a.length>1e3)r[i]=a.substring(0,1e3)+"... [truncated]";else if("object"==typeof a&&null!==a){JSON.stringify(a).length>5e3?r[i]=c(a,5e3):r[i]=a}else r[i]=a;n+=l}return r}return e}function u(e,t,n=1e4){if(t){const t=e instanceof ArrayBuffer?e.byteLength:e.size||0;return{content:`[Binary: ${t} bytes]`,size:t,truncated:!0}}const s="string"==typeof e?e:r(e),o=new Blob([s]).size;if(o>n){const e=s.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=c(JSON.parse(s),n);return{content:JSON.stringify(e),size:o,truncated:!0}}catch{}return{content:s.substring(0,n)+"... [truncated]",size:o,truncated:!0}}return{content:s,size:o,truncated:!1}}function d(e,t,r="info"){return{id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),type:e,data:t,severity:r}}function h(e,t){if(!t.maskSensitiveData)return e;const r={...e,data:{...e.data}};switch(e.type){case"network":r.data.requestHeaders&&(r.data.requestHeaders=o(r.data.requestHeaders,t.redactHeaders)),r.data.responseHeaders&&(r.data.responseHeaders=o(r.data.responseHeaders,t.redactHeaders)),r.data.requestBody&&(r.data.requestBody=n(r.data.requestBody)),r.data.responseBody&&(r.data.responseBody=n(r.data.responseBody));break;case"console":r.data.args&&Array.isArray(r.data.args)&&(r.data.args=function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r+1];"string"==typeof o&&s.test(o.trim())&&void 0!==i?(t.push(o),t.push("[REDACTED]"),r++):void 0!==o&&t.push(n(o))}return t}(r.data.args));break;case"websocket":case"sse":r.data.message&&(r.data.message=n(r.data.message));break;case"storage":r.data.value&&(r.data.value=n(r.data.value)),r.data.oldValue&&(r.data.oldValue=n(r.data.oldValue));break;case"interaction":r.data.value&&(r.data.value=n(r.data.value)),r.data.element?.text&&(r.data.element.text=n(r.data.element.text))}return r}let p=null;const f=new Map,m=new Map;const g={name:"console",install(e,t){if(!i())return;if(p)return;const n=["log","info","warn","error","debug"],s=t.logLevels||n;p={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug,time:console.time,timeEnd:console.timeEnd,timeLog:console.timeLog,trace:console.trace,table:console.table,count:console.count,countReset:console.countReset,assert:console.assert},n.forEach(t=>{console[t]=function(...n){if(p[t].apply(console,n),!s.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"))}(n))return;const o=n.map(e=>r(e));let i;i="error"===t?"error":"warn"===t?"warn":"info";const a=d("console",{level:t,args:o,stackTrace:"error"===t?(new Error).stack:void 0},i);e(a)}}),console.time=function(e="default"){p.time.call(console,e),f.set(e,performance.now())},console.timeLog=function(t="default",...n){p.timeLog.apply(console,[t,...n]);const s=f.get(t);if(void 0===s)return;const o=performance.now()-s,i=n.map(e=>r(e)),a=d("console",{level:"timeLog",args:[`${t}: ${o.toFixed(3)}ms`,...i],timerLabel:t,duration:o},"info");e(a)},console.timeEnd=function(t="default"){p.timeEnd.call(console,t);const r=f.get(t);if(void 0===r)return;const n=performance.now()-r;f.delete(t);const s=d("console",{level:"timeEnd",args:[`${t}: ${n.toFixed(3)}ms`],timerLabel:t,duration:n},"info");e(s)},console.trace=function(...t){p.trace.apply(console,t);const n=t.map(e=>r(e)),s=(new Error).stack||"",o=d("console",{level:"trace",args:n.length>0?n:["Trace"],stackTrace:s},"info");e(o)},console.table=function(t,n){p.table.call(console,t,n);const s=d("console",{level:"table",args:[r(t)],columns:n},"info");e(s)},console.count=function(t="default"){p.count.call(console,t);const r=(m.get(t)||0)+1;m.set(t,r);const n=d("console",{level:"count",args:[`${t}: ${r}`],counterLabel:t,count:r},"info");e(n)},console.countReset=function(t="default"){p.countReset.call(console,t),m.set(t,0);const r=d("console",{level:"countReset",args:[`${t}: 0`],counterLabel:t},"info");e(r)},console.assert=function(t,...n){if(p.assert.apply(console,[t,...n]),!t){const t=d("console",{level:"assert",args:["Assertion failed:",...n.map(e=>r(e))],stackTrace:(new Error).stack},"warn");e(t)}}},uninstall(){i()&&p&&(console.log=p.log,console.info=p.info,console.warn=p.warn,console.error=p.error,console.debug=p.debug,console.time=p.time,console.timeEnd=p.timeEnd,console.timeLog=p.timeLog,console.trace=p.trace,console.table=p.table,console.count=p.count,console.countReset=p.countReset,console.assert=p.assert,f.clear(),m.clear(),p=null)}};let y=10240,w=null,b=null,S=[],v=null;const C=new Map;function I(e){const t=Date.now();let r=C.get(e);r||(r={lastCapture:0},C.set(e,r));return t-r.lastCapture>=100&&(r.lastCapture=t,!0)}const k={name:"network",install(e,t,n,s){if(!i())return;if(w)return;v=e,S=t.excludeUrls||[];const o=t.blockNetworkBodies||[];y=s?.maxNetworkBodySize?1024*s.maxNetworkBodySize:10240,w=window.fetch,window.fetch=async function(...t){const n=performance.now(),s=t[0],i="string"==typeof s?s:s instanceof Request?s.url:s.toString(),c=t[1]||{},h=c.method||(s instanceof Request?s.method:"GET"),p=l();if(a(i,S))return w(...t);const f=o.some(e=>{try{return new RegExp(e,"i").test(i)}catch{return!1}});let m,g={};if(s instanceof Request&&(g=Object.fromEntries(s.headers.entries())),c.headers){const e=Object.fromEntries(new Headers(c.headers).entries());g={...g,...e}}if(!f&&c.body){const e=r(c.body);m=e.length>y?e.substring(0,y)+"...":e}try{const r=await w(...t),s=performance.now()-n,o=r.headers.get("content-type")||"unknown",a=r.headers.get("content-length"),l=r.clone();let c,b,S;try{if(!f&&(o.includes("application/json")||o.includes("text/plain")||o.includes("text/html")||o.includes("text/x-component"))){const e=await l.text();c=e.length>y?e.substring(0,y)+"...":e,b=new Blob([c]).size}else a&&(b=parseInt(a,10))}catch{}S=r.status>=500?"error":r.status>=400?"warn":"info";const k=o.includes("text/event-stream"),x=d("network",{method:h,url:i,statusCode:r.status,requestHeaders:g,responseHeaders:Object.fromEntries(r.headers.entries()),requestBody:m,responseBody:k?void 0:c,contentType:o,contentLength:b,duration:s,timestamp:Date.now(),initiator:p,isSSEStream:k},S);if(e(x),k&&r.body&&v){const t=d("sse",{url:i,event:"open",timestamp:Date.now()});return e(t),function(e,t,r){if(!e.body)return e;const n=e.body.getReader(),s=new TextDecoder;let o="",i={data:[]};const a=new ReadableStream({async start(e){try{for(;;){const{done:a,value:l}=await n.read();if(a){e.close(),C.delete(t);break}e.enqueue(l),o+=s.decode(l,{stream:!0});const c=o.split("\n");o=c.pop()||"";for(const e of c){if(""===e.trim()){if(i.data.length>0&&I(t)){const e=i.data.join("\n"),{content:n,size:s}=u(e,!1),o=d("sse",{url:t,event:"message",eventType:i.event||"message",message:n,messageSize:s,lastEventId:i.id,timestamp:Date.now()});r(o)}i={data:[]};continue}const n=e.indexOf(":");if(-1===n)continue;const s=e.slice(0,n),o=e.slice(n+1).trimStart();switch(s){case"data":i.data.push(o);break;case"event":i.event=o;break;case"id":i.id=o}}}}catch(a){e.error(a),C.delete(t)}},cancel(){n.cancel(),C.delete(t)}});return new Response(a,{headers:e.headers,status:e.status,statusText:e.statusText})}(r,i,v)}return r}catch(b){const t=performance.now()-n;let r="Unknown error";if(b instanceof TypeError){r=b.message;try{new URL(i,window.location.href).origin!==window.location.origin&&(r=`${r} - CORS policy may be blocking this request`)}catch{}}else b instanceof Error&&(r=b.message);const s=d("network",{method:h,url:i,statusCode:0,requestHeaders:g,responseHeaders:{},requestBody:m,duration:t,timestamp:Date.now(),initiator:p,error:r},"error");throw e(s),b}},b=window.XMLHttpRequest,window.XMLHttpRequest=function(){const t=new b,n=performance.now(),s=l();let o,i="",c="";const u={},h=t.open;t.open=function(e,t,...r){return i=e,c=t,h.apply(this,[e,t,...r])};const p=t.setRequestHeader;t.setRequestHeader=function(e,t){return u[e]=t,p.apply(this,[e,t])};const f=t.send;let m;return t.send=function(e){if(e&&!a(c,S)){const t=r(e);o=t.length>y?t.substring(0,y)+"...":t}return f.apply(this,[e])},t.addEventListener("error",()=>{m="Network request failed"}),t.addEventListener("timeout",()=>{m="Request timeout"}),t.addEventListener("abort",()=>{m="Request aborted"}),t.addEventListener("loadend",()=>{if(a(c,S))return;const l=performance.now()-n,h=t.getResponseHeader("content-type")||"unknown",p=t.getResponseHeader("content-length"),f={},g=t.getAllResponseHeaders();let w,b,v;if(g&&g.split("\r\n").forEach(e=>{const t=e.split(": "),r=t.shift(),n=t.join(": ");r&&n&&(f[r.toLowerCase()]=n)}),h.includes("application/json")||h.includes("text/plain")||h.includes("text/html")||h.includes("text/x-component"))try{let e;e=""===t.responseType||"text"===t.responseType?t.responseText:"json"===t.responseType&&t.response?r(t.response):"",e&&(w=e.length>y?e.substring(0,y)+"...":e,b=new Blob([w]).size)}catch{}else p&&(b=parseInt(p,10));v=t.status>=500||m?"error":t.status>=400?"warn":"info";const C=d("network",{method:i,url:c,statusCode:t.status,requestHeaders:u,responseHeaders:f,requestBody:o,responseBody:w,contentType:h,contentLength:b,duration:l,timestamp:Date.now(),initiator:s,...m&&{error:m}},v);e(C)}),t},window.XMLHttpRequest.prototype=b.prototype},uninstall(){i()&&(w&&(window.fetch=w,w=null),b&&(window.XMLHttpRequest=b,b=null),v=null,C.clear())}};let x=null,E=null;const O={name:"errors",install(e,t){i()&&(x||(x=t=>{const r=d("error",{message:t.message,stack:`${t.filename}:${t.lineno}:${t.colno}`,context:{},isUncaught:!0},"error");e(r)},window.addEventListener("error",x,!0),E=t=>{let n;n=t.reason instanceof Error?t.reason.message||t.reason.toString():"string"==typeof t.reason?t.reason:t.reason&&"object"==typeof t.reason&&t.reason.message||r(t.reason);const s=d("error",{message:`Unhandled Promise Rejection: ${n}`,stack:t.reason?.stack||"",context:{},isUncaught:!0},"error");e(s)},window.addEventListener("unhandledrejection",E)))},uninstall(){i()&&(x&&(window.removeEventListener("error",x,!0),x=null),E&&(window.removeEventListener("unhandledrejection",E),E=null))}};let A=null,M=[],R=10240;const L=new Map;function T(e,t){const r=Date.now();let n=L.get(e);n||(n={sent:{lastCapture:0,messageCount:0,sampleRate:1},received:{lastCapture:0,messageCount:0,sampleRate:1}},L.set(e,n));const s=n[t],o=r-s.lastCapture;if(s.lastCapture>0&&r-s.lastCapture<1e3){s.messageCount++;const e=s.messageCount/((r-s.lastCapture)/1e3);s.sampleRate=e>50?.1:e>10?.5:1}else s.messageCount=1,s.sampleRate=1;const i=o>=100&&(s.sampleRate>=1||Math.random()<s.sampleRate);return i&&(s.lastCapture=r),i}let N;const D={name:"websocket",install(e,t,r,n){if(!i())return;if(A)return;M=t.excludeUrls||[],N=r,R=n?.maxNetworkBodySize?1024*n.maxNetworkBodySize:10240,A=window.WebSocket,window.WebSocket=function(t,r){const n=new A(t,r),s=t.toString();if(a(s,M))return n;n.addEventListener("open",()=>{const t=d("websocket",{url:s,event:"open",readyState:n.readyState,timestamp:Date.now()});e(t)}),n.addEventListener("message",t=>{if(N?.(),!T(n,"received"))return;const r=t.data instanceof ArrayBuffer||t.data instanceof Blob,{content:o,size:i}=u(t.data,r,R),a=d("websocket",{url:s,event:"message",direction:"received",message:o,messageSize:i,isBinary:r,readyState:n.readyState,timestamp:Date.now()});e(a)});const o=n.send.bind(n);return n.send=function(t){if(N?.(),T(n,"sent")){const r=t instanceof ArrayBuffer||t instanceof Blob,{content:o,size:i}=u(t,r,R),a=d("websocket",{url:s,event:"message",direction:"sent",message:o,messageSize:i,isBinary:r,readyState:n.readyState,timestamp:Date.now()});e(a)}return o(t)},n.addEventListener("error",()=>{const t=d("websocket",{url:s,event:"error",readyState:n.readyState,timestamp:Date.now()},"error");e(t)}),n.addEventListener("close",t=>{const r=d("websocket",{url:s,event:"close",code:t.code,reason:t.reason,readyState:n.readyState,timestamp:Date.now()});e(r),L.delete(n)}),n},window.WebSocket.prototype=A.prototype,Object.setPrototypeOf(window.WebSocket,A);["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(e=>{Object.defineProperty(window.WebSocket,e,{value:A[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){i()&&A&&(window.WebSocket=A,A=null,L.clear())}};let P=null,F=[],_=10240;const B=new Map;let z;const U={name:"sse",install(e,t,r,n){if(!i())return;if(!window.EventSource)return;if(P)return;F=t.excludeUrls||[],z=r,_=n?.maxNetworkBodySize?1024*n.maxNetworkBodySize:10240,P=window.EventSource,window.EventSource=function(t,r){const n=new P(t,r),s=t.toString();return a(s,F)||(n.addEventListener("open",()=>{const t=d("sse",{url:s,event:"open",readyState:n.readyState,timestamp:Date.now()});e(t)}),n.addEventListener("message",t=>{if(z?.(),!function(e){const t=Date.now();let r=B.get(e);return r||(r={lastCapture:0},B.set(e,r)),t-r.lastCapture>=100&&(r.lastCapture=t,!0)}(n))return;const{content:r,size:o}=u(t.data,!1,_),i=d("sse",{url:s,event:"message",message:r,messageSize:o,lastEventId:t.lastEventId,readyState:n.readyState,timestamp:Date.now()});e(i)}),n.addEventListener("error",()=>{const t=d("sse",{url:s,event:"error",readyState:n.readyState,timestamp:Date.now()},"error");e(t),n.readyState===EventSource.CLOSED&&B.delete(n)})),n},window.EventSource.prototype=P.prototype,Object.setPrototypeOf(window.EventSource,P);["CONNECTING","OPEN","CLOSED"].forEach(e=>{Object.defineProperty(window.EventSource,e,{value:P[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){i()&&P&&(window.EventSource=P,P=null,B.clear())}},j=5e3;let W=null,$=null,V=!1,G=null;function Z(e){const t="string"==typeof e?e:r(e),n=new Blob([t]).size;if(n>j){const e=t.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=c(JSON.parse(t),j);return{content:JSON.stringify(e),size:n}}catch{}return{content:t.substring(0,j)+"... [truncated]",size:n}}return{content:t,size:n}}const J={name:"storage",install(e,t){i()&&(W||(G=e,W={getItem:Storage.prototype.getItem,setItem:Storage.prototype.setItem,removeItem:Storage.prototype.removeItem,clear:Storage.prototype.clear},Storage.prototype.getItem=function(t){const r=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.getItem.call(this,t);const n=W.getItem.call(this,t);try{V=!0;const s=d("storage",{storageType:r?"sessionStorage":"localStorage",operation:"getItem",key:t,value:n?Z(n).content:null,valueSize:n?new Blob([n]).size:0});e(s)}finally{V=!1}return n},Storage.prototype.setItem=function(t,r){const n=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.setItem.call(this,t,r);const s=this.getItem(t),o=W.setItem.call(this,t,r);try{V=!0;const o=n?"sessionStorage":"localStorage",{content:i,size:a}=Z(r),l=d("storage",{storageType:o,operation:"setItem",key:t,value:i,oldValue:s?Z(s).content:void 0,valueSize:a});e(l)}finally{V=!1}return o},Storage.prototype.removeItem=function(t){const r=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.removeItem.call(this,t);const n=this.getItem(t),s=W.removeItem.call(this,t);V=!0;try{const s=d("storage",{storageType:r?"sessionStorage":"localStorage",operation:"removeItem",key:t,oldValue:n?Z(n).content:void 0});e(s)}finally{V=!1}return s},Storage.prototype.clear=function(){const t=this===sessionStorage,r=W.clear.call(this);if(V)return r;V=!0;try{const r=d("storage",{storageType:t?"sessionStorage":"localStorage",operation:"clear"});e(r)}finally{V=!1}return r},window.IDBDatabase&&($=IDBDatabase.prototype.transaction,IDBDatabase.prototype.transaction=function(e,t,...r){const n=$.call(this,e,t,...r),s=this.name;if("logspace-sdk-db"===s)return n;if(G&&!V){const r=d("storage",{storageType:"indexedDB",operation:"readwrite"===t?"setItem":"getItem",dbName:s,storeName:Array.isArray(e)?e.join(", "):e});G(r)}return n})))},uninstall(){i()&&(W&&(Storage.prototype.getItem=W.getItem,Storage.prototype.setItem=W.setItem,Storage.prototype.removeItem=W.removeItem,Storage.prototype.clear=W.clear,W=null),$&&window.IDBDatabase&&(IDBDatabase.prototype.transaction=$,$=null),G=null)}};let Y,H=null,X=null,K=null,q=null;const Q={name:"interactions",install(e,r){if(!i())return;if(H)return;const s=r.maskSelectors||[];function o(e){return 0!==s.length&&s.some(t=>{try{return e.matches(t)||e.closest(t)}catch{return!1}})}H=s=>{const i=s.target;if(!i)return;let a=i.textContent?.substring(0,100);r.maskSensitiveData&&a&&(a=n(a)),o(i)&&(a="[MASKED]");const l=d("interaction",{eventType:"click",element:{selector:t(i),tagName:i.tagName,text:a},coordinates:{x:s.clientX,y:s.clientY}});e(l)},document.addEventListener("click",H,!0),X=s=>{const i=s.target;if(!i||"INPUT"!==i.tagName&&"TEXTAREA"!==i.tagName)return;const a="password"===i.type||i.name?.toLowerCase().includes("password")||i.name?.toLowerCase().includes("credit")||i.name?.toLowerCase().includes("ssn")||i.autocomplete?.includes("current-password")||i.autocomplete?.includes("new-password")||o(i);let l=i.value;r.maskSensitiveData&&(l=a?"[SENSITIVE_INPUT_REDACTED]":n(l));const c=d("interaction",{eventType:"input",element:{selector:t(i),tagName:i.tagName},value:l});e(c)},document.addEventListener("input",X,!0),K=r=>{const n=r.target;if(!n)return;const s=d("interaction",{eventType:"submit",element:{selector:t(n),tagName:n.tagName}});e(s)},document.addEventListener("submit",K,!0),q=()=>{clearTimeout(Y),Y=setTimeout(()=>{const t=d("interaction",{eventType:"scroll",element:{selector:"document",tagName:"document"},coordinates:{x:window.scrollX,y:window.scrollY}});e(t)},500)},document.addEventListener("scroll",q,!0)},uninstall(){i()&&(H&&(document.removeEventListener("click",H,!0),H=null),X&&(document.removeEventListener("input",X,!0),X=null),K&&(document.removeEventListener("submit",K,!0),K=null),q&&(document.removeEventListener("scroll",q,!0),q=null),Y&&clearTimeout(Y))}};let ee=null,te=null,re=null,ne=null,se=null,oe=null,ie=null,ae=null,le=null;const ce={lcp:null,fid:null,cls:0,fcp:null,ttfb:null,inp:null,clsEntries:[],sent:!1};let ue=null;function de(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 he(){if(ce.sent||!ue)return;if(!(null!==ce.lcp||null!==ce.fcp||null!==ce.ttfb||null!==ce.fid||null!==ce.inp||ce.cls>0))return;ce.sent=!0;const e={};null!==ce.lcp&&(e.LCP={value:ce.lcp,rating:de("LCP",ce.lcp)}),null!==ce.fid&&(e.FID={value:ce.fid,rating:de("FID",ce.fid)}),ce.cls>0&&(e.CLS={value:ce.cls,rating:de("CLS",ce.cls)}),null!==ce.fcp&&(e.FCP={value:ce.fcp,rating:de("FCP",ce.fcp)}),null!==ce.ttfb&&(e.TTFB={value:ce.ttfb,rating:de("TTFB",ce.ttfb)}),null!==ce.inp&&(e.INP={value:ce.inp,rating:de("INP",ce.inp)});const t=d("performance",{metric:"Web Vitals",vitals:e});ue(t)}const pe={name:"performance",install(e,t){if(i()&&"PerformanceObserver"in window&&!ee){ue=e;try{ee=new PerformanceObserver(e=>{const t=e.getEntries(),r=t[t.length-1];ce.lcp=r.renderTime||r.loadTime}),ee.observe({type:"largest-contentful-paint",buffered:!0}),te=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{null===ce.fid&&(ce.fid=e.processingStart-e.startTime)})}),te.observe({type:"first-input",buffered:!0}),re=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{ce.clsEntries.push(e),ce.cls=function(e){let t=0,r=[];return e.forEach(e=>{if(!e.hadRecentInput){const n=r[0],s=r[r.length-1];t&&s&&e.startTime-s.startTime<1e3&&e.startTime-n.startTime<5e3?(t+=e.value,r.push(e)):(t=e.value,r=[e])}}),t}(ce.clsEntries)})}),re.observe({type:"layout-shift",buffered:!0}),ne=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"first-contentful-paint"===e.name&&(ce.fcp=e.startTime)})}),ne.observe({type:"paint",buffered:!0});try{se=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{const t=e.processingEnd-e.startTime;(null===ce.inp||t>ce.inp)&&(ce.inp=t)})}),se.observe({type:"event",buffered:!0,durationThreshold:16})}catch{}oe=()=>{"hidden"===document.visibilityState&&he()},window.addEventListener("visibilitychange",oe),ie=()=>{le=setTimeout(()=>{!function(){if(!ue)return;const e=performance.getEntriesByType("navigation");if(0===e.length)return;const t=e[0];ce.ttfb=t.responseStart-t.requestStart;const r=d("performance",{metric:"Navigation",timing:{ttfb:Math.round(ce.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)}});ue(r)}()},0)},window.addEventListener("load",ie),ae=setTimeout(()=>{he()},1e4)}catch{}}},uninstall(){i()&&([ee,te,re,ne,se].forEach(e=>{e&&e.disconnect()}),oe&&(window.removeEventListener("visibilitychange",oe),oe=null),ie&&(window.removeEventListener("load",ie),ie=null),ae&&(clearTimeout(ae),ae=null),le&&(clearTimeout(le),le=null),ee=null,te=null,re=null,ne=null,se=null,ue=null,ce.lcp=null,ce.fid=null,ce.cls=0,ce.fcp=null,ce.ttfb=null,ce.inp=null,ce.clsEntries=[],ce.sent=!1)}};let fe=null,me=[];const ge=new Set;let ye=null;const we=new Map;function be(){if(i())try{for(const e of Array.from(document.styleSheets))try{if(!e.cssRules)continue;for(const t of Array.from(e.cssRules))if(t instanceof CSSFontFaceRule){const r=t.style.getPropertyValue("font-family").replace(/["']/g,"").trim(),n=t.style.getPropertyValue("src");if(r&&n){const t=n.matchAll(/url\(["']?([^"')]+)["']?\)/g);for(const n of t)if(n[1])try{const t=new URL(n[1],e.href||window.location.href).href;we.set(t,r),we.set(n[1],r)}catch{we.set(n[1],r)}}}}catch{}}catch{}}function Se(e){if(!ye)return;if("resource"!==e.entryType)return;if("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)return;const t=`${e.name}-${e.startTime}`;if(ge.has(t))return;if(ge.add(t),a(e.name,me))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),n=e.duration,s=e.transferSize||0,o=e.decodedBodySize||0,i=e.encodedBodySize||0,l=0===s||i>0&&s<i;let c="info";n>3e3?c="error":n>1e3&&(c="warn");const u="font"===r?function(e){if(we.has(e))return we.get(e);try{const t=new URL(e).pathname.split("/").pop();if(t)for(const[e,r]of we.entries())if(e.endsWith(t)||e.includes(t))return r}catch{}if("fonts"in document)try{const t=e.toLowerCase();for(const e of document.fonts)if("loaded"===e.status){const r=e.family.replace(/["']/g,"");if(t.includes(r.toLowerCase().replace(/\s+/g,"")))return r}}catch{}}(e.name):void 0,h=d("network",{method:"GET",url:e.name,statusCode:200,resourceType:r,initiatorType:e.initiatorType,duration:Math.round(n),transferSize:s,decodedBodySize:o,encodedBodySize:i,cached:l,...u&&{fontFamily:u},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()},c);ye(h)}const ve={name:"resources",install(e,t){if(i()&&"PerformanceObserver"in window&&!fe){ye=e,me=t.excludeUrls||[];try{be();performance.getEntriesByType("resource").forEach(e=>{Se(e)}),fe=new PerformanceObserver(e=>{be();e.getEntries().forEach(e=>{Se(e)})}),fe.observe({type:"resource",buffered:!1})}catch{}}},uninstall(){i()&&(fe&&(fe.disconnect(),fe=null),ye=null)},reset(){ge.clear(),we.clear()}};let Ce=null,Ie=null,ke=null,xe="",Ee=0,Oe=null,Ae=null,Me=null;function Re(e="client-side"){const t=location.href;t!==xe&&function(e,t,r){if(!ke||e===t)return;const n=performance.now()-Ee,s=d("performance",{metric:"SPA Navigation",from:e,to:t,duration:Math.round(n),navigationType:r,timestamp:Date.now()});ke(s),xe=t,Ee=performance.now()}(xe,t,e)}const Le={name:"spa-navigation",install(e,t){if(i()&&!Ce){if(ke=e,xe=location.href,Ee=performance.now(),Ce=history.pushState,Ie=history.replaceState,history.pushState=function(...e){const t=Ce.apply(this,e);return Re("pushState"),t},history.replaceState=function(...e){const t=Ie.apply(this,e);return Re("replaceState"),t},Me=()=>{Re("popstate")},window.addEventListener("popstate",Me),Oe=new MutationObserver(()=>{Ae&&clearTimeout(Ae),Ae=setTimeout(()=>{Re("dom-mutation")},100)}),document.body)Oe.observe(document.body,{childList:!0,subtree:!0});else{const e=new MutationObserver(()=>{document.body&&(Oe.observe(document.body,{childList:!0,subtree:!0}),e.disconnect())});e.observe(document.documentElement,{childList:!0})}window.addEventListener("hashchange",()=>{Ee=performance.now(),Re("hashchange")})}},uninstall(){i()&&(Ce&&(history.pushState=Ce,Ce=null),Ie&&(history.replaceState=Ie,Ie=null),Me&&(window.removeEventListener("popstate",Me),Me=null),Oe&&(Oe.disconnect(),Oe=null),Ae&&(clearTimeout(Ae),Ae=null),ke=null,xe="",Ee=0)}};var Te,Ne=Object.defineProperty,De=(e,t,r)=>((e,t,r)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Pe=Object.defineProperty,Fe=(e,t,r)=>((e,t,r)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),_e=(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))(_e||{});const Be={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ze={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function je(e){if(Ue[e])return Ue[e];const t=globalThis[e],r=t.prototype,n=e in Be?Be[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in ze?ze[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(s&&i&&!globalThis.Zone)return Ue[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Ue[e]=o:r}catch{return r}}const We={};function $e(e,t,r){var n;const s=`${e}.${String(r)}`;if(We[s])return We[s].call(t);const o=je(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(We[s]=i,i.call(t)):t[r]}const Ve={};function Ge(e,t,r){const n=`${e}.${String(r)}`;if(Ve[n])return Ve[n].bind(t);const s=je(e)[r];return"function"!=typeof s?t[r]:(Ve[n]=s,s.bind(t))}const Ze={childNodes:function(e){return $e("Node",e,"childNodes")},parentNode:function(e){return $e("Node",e,"parentNode")},parentElement:function(e){return $e("Node",e,"parentElement")},textContent:function(e){return $e("Node",e,"textContent")},contains:function(e,t){return Ge("Node",e,"contains")(t)},getRootNode:function(e){return Ge("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?$e("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?$e("Element",e,"shadowRoot"):null},querySelector:function(e,t){return $e("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return $e("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return je("MutationObserver").constructor}};function Je(e){return e.nodeType===e.ELEMENT_NODE}function Ye(e){const t=e&&"host"in e&&"mode"in e&&Ze.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Ze.shadowRoot(t)===e)}function He(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Xe(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const s=Array.from(r,e=>Ke(e,n)).join("");return(t=s).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 Ke(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Xe(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?lt(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?lt(r,t):r}}class qe{constructor(){Fe(this,"idNodeMap",new Map),Fe(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 Qe({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&et(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function et(e){return e.toLowerCase()}const tt="__rrweb_original__";function rt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?et(t):null}function nt(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(s){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const st=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ot=/^(?:[a-z+]+:)?\/\//i,it=/^www\..*/i,at=/^(data:)([^,]*),(.*)/i;function lt(e,t){return(e||"").replace(st,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(ot.test(a)||it.test(a))return`url(${l}${a}${l})`;if(at.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 ct(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function ut(e,t){return function(e,t){const r=Array.from(t.childNodes),n=[];if(r.length>1&&e&&"string"==typeof e){const t=ct(e);for(let s=1;s<r.length;s++)if(r[s].textContent&&"string"==typeof r[s].textContent){const o=ct(r[s].textContent);for(let r=3;r<o.length;r++){const s=o.substring(0,r);if(2===t.split(s).length){const r=t.indexOf(s);for(let t=r;t<e.length;t++)if(ct(e.substring(0,t)).length===r){n.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return n.push(e),n}(e,t).join("/* rr_split */")}let dt=1;const ht=new RegExp("[^a-z0-9-_:]");function pt(){return dt++}let ft,mt;const gt=/^[^ \t\n\r\u000c]+/,yt=/^[, \t\n\r\u000c]+/;const wt=new WeakMap;function bt(e,t){return t&&""!==t.trim()?vt(e,t):t}function St(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function vt(e,t){let r=wt.get(e);if(r||(r=e.createElement("a"),wt.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ct(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?bt(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(yt),!(r>=t.length);){let o=n(gt);if(","===o.slice(-1))o=bt(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=bt(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((o+n).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,s.push((o+n).trim());break}"("===e&&(i=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?lt(n,vt(e)):"object"===t&&"data"===r?bt(e,n):n:bt(e,n):n}function It(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function kt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&kt(Ze.parentNode(e),t,r);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!r&&kt(Ze.parentNode(e),t,r)}function xt(e,t,r,n){let s;if(Je(e)){if(s=e,!Ze.childNodes(s).length)return!1}else{if(null===Ze.parentElement(e))return!1;s=Ze.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(kt(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(o){}return!1}function Et(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:h,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,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:_e.Document,childNodes:[],compatMode:e.compatMode}:{type:_e.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:_e.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=!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 n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(n){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=et(e.tagName);return ht.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let S=0;S<y;S++){const t=e.attributes[S];It(m,t.name,t.value)||(g[t.name]=Ct(r,m,et(t.name),t.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Xe(t)),n&&(delete g.rel,delete g.href,g._cssText=n)}if("style"===m&&e.sheet){let t=Xe(e.sheet);t&&(e.childNodes.length>1&&(t=ut(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=Qe({element:e,type:rt(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 n=0;n<e.height;n+=50){const s=t.getImageData,o=tt in s?s[tt]:s;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).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),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){ft||(ft=r.createElement("canvas"),mt=ft.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ft.width=t.naturalWidth,ft.height=t.naturalHeight,mt.drawImage(t,0,0),g.rr_dataURL=ft.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=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?g.crossOrigin=s: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}h||(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||d(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(b){}return{type:_e.Element,tagName:m,attributes:g,childNodes:[],isSVG:St(e)||void 0,needBlock:f,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=Ze.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=Ze.textContent(e),c&&l&&(l=lt(l,vt(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Ze.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:_e.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:_e.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:_e.Comment,textContent:Ze.textContent(e)||"",rootId:y};default:return!1}}function Ot(e){return null==e?"":e.toLowerCase()}function At(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,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=xt(e,i,a,void 0===x)}const O=Et(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!O)return console.warn(e,"not serialized"),null;let A;A=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===_e.Comment)return!0;if(e.type===_e.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"===nt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ot(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ot(e.attributes.name)||"icon"===Ot(e.attributes.rel)||"apple-touch-icon"===Ot(e.attributes.rel)||"shortcut icon"===Ot(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ot(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ot(e.attributes.property).match(/^(og|twitter|fb):/)||Ot(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ot(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ot(e.attributes.name)||"googlebot"===Ot(e.attributes.name)||"bingbot"===Ot(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ot(e.attributes.name)||"generator"===Ot(e.attributes.name)||"framework"===Ot(e.attributes.name)||"publisher"===Ot(e.attributes.name)||"progid"===Ot(e.attributes.name)||Ot(e.attributes.property).match(/^article:/)||Ot(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ot(e.attributes.name)||"yandex-verification"===Ot(e.attributes.name)||"csrf-token"===Ot(e.attributes.name)||"p:domain_verify"===Ot(e.attributes.name)||"verify-v1"===Ot(e.attributes.name)||"verification"===Ot(e.attributes.name)||"shopify-checkout-api-token"===Ot(e.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===_e.Text&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:pt();const M=Object.assign(O,{id:A});if(n.add(e,M),-2===A)return null;y&&y(e);let R=!l;if(M.type===_e.Element){R=R&&!M.needBlock,delete M.needBlock;const t=Ze.shadowRoot(e);t&&He(t)&&(M.isShadowHost=!0)}if((M.type===_e.Document||M.type===_e.Element)&&R){p.headWhitespace&&M.type===_e.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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===_e.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===_e.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Ze.childNodes(e))){const e=At(r,t);e&&M.childNodes.push(e)}}let I=null;if(Je(e)&&(I=Ze.shadowRoot(e)))for(const e of Array.from(Ze.childNodes(I))){const r=At(e,t);r&&(He(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const L=Ze.parentNode(e);return L&&Ye(L)&&He(L)&&(M.isShadow=!0),M.type===_e.Element&&"iframe"===M.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,o=!1;try{s=n.document.readyState}catch(a){return}if("complete"!==s){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const i="about:blank";if(n.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=At(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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===_e.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===nt(M.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(i){return}if(n)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}(e,()=>{if(S){const t=At(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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 Rt(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 n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var Lt={exports:{}},Tt=String,Nt=function(){return{isColorSupported:!1,reset:Tt,bold:Tt,dim:Tt,italic:Tt,underline:Tt,inverse:Tt,hidden:Tt,strikethrough:Tt,black:Tt,red:Tt,green:Tt,yellow:Tt,blue:Tt,magenta:Tt,cyan:Tt,white:Tt,gray:Tt,bgBlack:Tt,bgRed:Tt,bgGreen:Tt,bgYellow:Tt,bgBlue:Tt,bgMagenta:Tt,bgCyan:Tt,bgWhite:Tt}};Lt.exports=Nt(),Lt.exports.createColors=Nt;var Dt=Lt.exports;const Pt=Rt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ft=Dt,_t=Pt,Bt=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.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=Ft.isColorSupported),_t&&e&&(t=_t(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ft.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var zt=Bt;Bt.default=Bt;var Ut={};Ut.isClean=Symbol("isClean"),Ut.my=Symbol("my");const jt={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Wt=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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 n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",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 n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||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"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return jt[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 s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=jt[r]),o.rawCache[r]=n,n}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 n=r.parent;if(n&&n!==e&&n.parent&&n.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],n=e.raws[t];return n&&n.value===r?n.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 $t=Wt;Wt.default=Wt;let Vt=$t;function Gt(e,t){new Vt(t).stringify(e)}var Zt=Gt;Gt.default=Gt;let{isClean:Jt,my:Yt}=Ut,Ht=zt,Xt=$t,Kt=Zt;function qt(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>qt(e,r)):("object"===o&&null!==s&&(s=qt(s)),r[n]=s)}return r}let Qt=class{constructor(e={}){this.raws={},this[Jt]=!1,this[Yt]=!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=qt(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:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Ht(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[Jt]){this[Jt]=!1;let e=this;for(;e=e.parent;)e[Jt]=!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 n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let o=0;o<e;o++)"\n"===r[o]?(n=1,s+=1):n+=1;return{column:n,line:s}}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 n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}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 Xt).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 n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);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={},n=null==t;t=t||new Map;let s=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 n=t.get(e.input);null==n&&(n=s,t.set(e.input,s),s++),r[o]={end:e.end,inputId:n,start:e.start}}else r[o]=e}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Kt){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var er=Qt;Qt.default=Qt;let tr=er,rr=class extends tr{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 nr=rr;rr.default=rr;var sr={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:or,SourceMapGenerator:ir}=Pt,{existsSync:ar,readFileSync:lr}=Pt,{dirname:cr,join:ur}=Pt;let dr=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,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=cr(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new or(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()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=cr(e),ar(e))return this.mapFile=e,lr(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 or)return ir.fromSourceMap(t).toString();if(t instanceof ir)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=ur(cr(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 hr=dr;dr.default=dr;let{SourceMapConsumer:pr,SourceMapGenerator:fr}=Pt,{fileURLToPath:mr,pathToFileURL:gr}=Pt,{isAbsolute:yr,resolve:wr}=Pt,{nanoid:br}=sr,Sr=Pt,vr=zt,Cr=hr,Ir=Symbol("fromOffsetCache"),kr=Boolean(pr&&fr),xr=Boolean(wr&&yr),Er=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&&(!xr||/^\w+:\/\//.test(t.from)||yr(t.from)?this.file=t.from:this.file=wr(t.from)),xr&&kr){let e=new Cr(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 "+br(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new vr(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,n.plugin):new vr(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(gr&&(s.input.url=gr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Ir])r=this[Ir];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Ir]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:wr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=yr(a.source)?gr(a.source):new URL(a.source,this.map.consumer().sourceRoot||gr(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!mr)throw new Error("file: protocol is not available in this PostCSS build");l.file=mr(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 Or=Er;Er.default=Er,Sr&&Sr.registerInput&&Sr.registerInput(Er);let{SourceMapConsumer:Ar,SourceMapGenerator:Mr}=Pt,{dirname:Rr,relative:Lr,resolve:Tr,sep:Nr}=Pt,{pathToFileURL:Dr}=Pt,Pr=Or,Fr=Boolean(Ar&&Mr),_r=Boolean(Rr&&Tr&&Lr&&Nr);var Br=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,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)),n=e.root||Rr(e.file);!1===this.mapOpts.sourcesContent?(t=new Ar(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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(),_r&&Fr&&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,n=1,s="<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=n-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=s,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"),n=i.length-t):n+=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=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-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?Rr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Rr(Tr(r,this.mapOpts.annotation)));let n=Lr(r,e);return this.memoizedPaths.set(e,n),n}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 Pr(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 n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,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(Dr){let t=Dr(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;"\\"===Nr&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zr=er,Ur=class extends zr{constructor(e){super(e),this.type="comment"}};var jr=Ur;Ur.default=Ur;let Wr,$r,Vr,Gr,{isClean:Zr,my:Jr}=Ut,Yr=nr,Hr=jr,Xr=er;function Kr(e){return e.map(e=>(e.nodes&&(e.nodes=Kr(e.nodes)),delete e.source,e))}function qr(e){if(e[Zr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)qr(t)}let Qr=class e extends Xr{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,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],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,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let o of s)this.proxyOf.nodes.splice(n+1,0,o);for(let o in this.indexes)r=this.indexes[o],n<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let i of o)this.proxyOf.nodes.splice(n,0,i);for(let i in this.indexes)r=this.indexes[i],n<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Kr(Wr(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 Yr(t)]}else if(t.selector)t=[new $r(t)];else if(t.name)t=[new Vr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Hr(t)]}return t.map(t=>(t[Jr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Zr]&&qr(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(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(s){throw t.addToError(s)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(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,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(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,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(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]}};Qr.registerParse=e=>{Wr=e},Qr.registerRule=e=>{$r=e},Qr.registerAtRule=e=>{Vr=e},Qr.registerRoot=e=>{Gr=e};var en=Qr;Qr.default=Qr,Qr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Vr.prototype):"rule"===e.type?Object.setPrototypeOf(e,$r.prototype):"decl"===e.type?Object.setPrototypeOf(e,Yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Hr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Gr.prototype),e[Jr]=!0,e.nodes&&e.nodes.forEach(e=>{Qr.rebuild(e)})};let tn,rn,nn=en,sn=class extends nn{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tn(new rn,this,e).stringify()}};sn.registerLazyResult=e=>{tn=e},sn.registerProcessor=e=>{rn=e};var on=sn;sn.default=sn;let an={};var ln=function(e){an[e]||(an[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let cn=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 un=cn;cn.default=cn;let dn=un,hn=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 dn(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var pn=hn;hn.default=hn;const fn="'".charCodeAt(0),mn='"'.charCodeAt(0),gn="\\".charCodeAt(0),yn="/".charCodeAt(0),wn="\n".charCodeAt(0),bn=" ".charCodeAt(0),Sn="\f".charCodeAt(0),vn="\t".charCodeAt(0),Cn="\r".charCodeAt(0),In="[".charCodeAt(0),kn="]".charCodeAt(0),xn="(".charCodeAt(0),En=")".charCodeAt(0),On="{".charCodeAt(0),An="}".charCodeAt(0),Mn=";".charCodeAt(0),Rn="*".charCodeAt(0),Ln=":".charCodeAt(0),Tn="@".charCodeAt(0),Nn=/[\t\n\f\r "#'()/;[\\\]{}]/g,Dn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pn=/.[\r\n"'(/\\]/,Fn=/[\da-f]/i;let _n=en,Bn=class extends _n{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 zn=Bn;Bn.default=Bn,_n.registerAtRule(Bn);let Un,jn,Wn=en,$n=class extends Wn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=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 s of n)s.raws.before=t.raws.before;return n}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 Un(new jn,this,e).stringify()}};$n.registerLazyResult=e=>{Un=e},$n.registerProcessor=e=>{jn=e};var Vn=$n;$n.default=$n,Wn.registerRoot($n);let Gn={comma:e=>Gn.split(e,[","],!0),space:e=>Gn.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",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?(""!==s&&n.push(s.trim()),s="",o=!1):s+=u;return(r||""!==s)&&n.push(s.trim()),n}};var Zn=Gn;Gn.default=Gn;let Jn=en,Yn=Zn,Hn=class extends Jn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Yn.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 Xn=Hn;Hn.default=Hn,Jn.registerRule(Hn);let Kn=nr,qn=function(e,t={}){let r,n,s,o,i,a,l,c,u,d,h=e.css.valueOf(),p=t.ignoreErrors,f=h.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=h.charCodeAt(m),r){case wn:case bn:case vn:case Cn:case Sn:n=m;do{n+=1,r=h.charCodeAt(n)}while(r===bn||r===wn||r===vn||r===Cn||r===Sn);d=["space",h.slice(m,n)],m=n-1;break;case In:case kn:case On:case An:case Ln:case Mn:case En:{let e=String.fromCharCode(r);d=[e,e,m];break}case xn:if(c=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===c&&u!==fn&&u!==mn&&u!==bn&&u!==wn&&u!==vn&&u!==Sn&&u!==Cn){n=m;do{if(a=!1,n=h.indexOf(")",n+1),-1===n){if(p||t){n=m;break}w("bracket")}for(l=n;h.charCodeAt(l-1)===gn;)l-=1,a=!a}while(a);d=["brackets",h.slice(m,n+1),m,n],m=n}else n=h.indexOf(")",m+1),o=h.slice(m,n+1),-1===n||Pn.test(o)?d=["(","(",m]:(d=["brackets",o,m,n],m=n);break;case fn:case mn:s=r===fn?"'":'"',n=m;do{if(a=!1,n=h.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}w("string")}for(l=n;h.charCodeAt(l-1)===gn;)l-=1,a=!a}while(a);d=["string",h.slice(m,n+1),m,n],m=n;break;case Tn:Nn.lastIndex=m+1,Nn.test(h),n=0===Nn.lastIndex?h.length-1:Nn.lastIndex-2,d=["at-word",h.slice(m,n+1),m,n],m=n;break;case gn:for(n=m,i=!0;h.charCodeAt(n+1)===gn;)n+=1,i=!i;if(r=h.charCodeAt(n+1),i&&r!==yn&&r!==bn&&r!==wn&&r!==vn&&r!==Cn&&r!==Sn&&(n+=1,Fn.test(h.charAt(n)))){for(;Fn.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===bn&&(n+=1)}d=["word",h.slice(m,n+1),m,n],m=n;break;default:r===yn&&h.charCodeAt(m+1)===Rn?(n=h.indexOf("*/",m+2)+1,0===n&&(p||t?n=h.length:w("comment")),d=["comment",h.slice(m,n+1),m,n],m=n):(Dn.lastIndex=m+1,Dn.test(h),n=0===Dn.lastIndex?h.length-1:Dn.lastIndex-2,d=["word",h.slice(m,n+1),m,n],g.push(d),m=n)}return m++,d},position:function(){return m}}},Qn=jr,es=zn,ts=Vn,rs=Xn;const ns={empty:!0,space:!0};let ss=en,os=class{constructor(e){this.input=e,this.root=new ts,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,n,s=new es;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,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){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Qn;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=qn(this.input)}decl(e,t){let r=new Kn;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(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(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[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(n=e[a],"!important"===n[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"===n[1].toLowerCase()){let t=e.slice(0),n="";for(let e=a;e>0;e--){let r=t[e][0];if(0===n.trim().indexOf("!")&&"space"!==r)break;n=t.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=t)}if("space"!==n[0]&&"comment"!==n[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 rs;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,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)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&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){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,n){let s,o,i,a,l=r.length,c="",u=!0;for(let d=0;d<l;d+=1)s=r[d],o=s[0],"space"!==o||d!==l-1||n?"comment"===o?(a=r[d-1]?r[d-1][0]:"empty",i=r[d+1]?r[d+1][0]:"empty",ns[a]||ns[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new rs;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 n=t;n<e.length;n++)r+=e[n][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})}},is=Or;function as(e,t){let r=new is(e,t),n=new os(r);try{n.parse()}catch(s){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===s.name&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?s.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(s.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),s}return n.root}var ls=as;as.default=as,ss.registerParse(as);let{isClean:cs,my:us}=Ut,ds=Br,hs=Zt,ps=en,fs=on,ms=ln,gs=pn,ys=ls,ws=Vn;const bs={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ss={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},vs={Once:!0,postcssPlugin:!0,prepare:!0};function Cs(e){return"object"==typeof e&&"function"==typeof e.then}function Is(e){let t=!1,r=bs[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 ks(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Is(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function xs(e){return e[cs]=!1,e.nodes&&e.nodes.forEach(e=>xs(e)),e}let Es={},Os=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof gs)s=xs(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=ys;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(o){this.processed=!0,this.error=o}s&&!s[us]&&ps.rebuild(s)}else s=xs(r);this.result=new gs(t,s,n),this.helpers={...Es,postcss:Es,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,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(n){console&&console.error&&console.error(n)}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(!Ss[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!vs[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);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],n=this.runOnRoot(t);if(Cs(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cs];){e[cs]=!0;let r=[ks(e)];for(;r.length>0;){let e=this.visitTick(r);if(Cs(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,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 Cs(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=hs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ds(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(Cs(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cs];)e[cs]=!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||ms("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[n,s]of e){let e;this.result.lastPlugin=n;try{e=s(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Cs(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[cs])return n[cs]=!0,void e.push(ks(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[cs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[cs]=!0;let t=Is(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[cs]||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"}};Os.registerPostcss=e=>{Es=e};var As=Os;Os.default=Os,ws.registerLazyResult(Os),fs.registerLazyResult(Os);let Ms=Br,Rs=Zt,Ls=ln,Ts=ls;const Ns=pn;let Ds=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Rs;this.result=new Ns(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ms(s,n,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||Ls("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=Ts;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 Ps=Ds;Ds.default=Ds;let Fs=Ps,_s=As,Bs=on,zs=Vn,Us=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 _s(this,e,t):new Fs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var js=Us;Us.default=Us,zs.registerProcessor(Us),Bs.registerProcessor(Us);let Ws=nr,$s=hr,Vs=jr,Gs=zn,Zs=Or,Js=Vn,Ys=Xn;function Hs(e,t){if(Array.isArray(e))return e.map(e=>Hs(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Zs.prototype};r.map&&(r.map={...r.map,__proto__:$s.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Hs(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Js(n);if("decl"===n.type)return new Ws(n);if("rule"===n.type)return new Ys(n);if("comment"===n.type)return new Vs(n);if("atrule"===n.type)return new Gs(n);throw new Error("Unknown node type: "+e.type)}var Xs=Hs;Hs.default=Hs;let Ks=zt,qs=nr,Qs=As,eo=en,to=js,ro=Zt,no=Xs,so=on,oo=un,io=jr,ao=zn,lo=pn,co=Or,uo=ls,ho=Zn,po=Xn,fo=Vn,mo=er;function go(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new to(e)}go.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new to).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return go([s(r)]).process(e,t)},s},go.stringify=ro,go.parse=uo,go.fromJSON=no,go.list=ho,go.comment=e=>new io(e),go.atRule=e=>new ao(e),go.decl=e=>new qs(e),go.rule=e=>new po(e),go.root=e=>new fo(e),go.document=e=>new so(e),go.CssSyntaxError=Ks,go.Declaration=qs,go.Container=eo,go.Processor=to,go.Document=so,go.Comment=io,go.Warning=oo,go.AtRule=ao,go.Result=lo,go.Input=co,go.Rule=po,go.Root=fo,go.Node=mo,Qs.registerPostcss(go);var yo=go;go.default=go;const wo=Mt(yo);wo.stringify,wo.fromJSON,wo.plugin,wo.parse,wo.list,wo.document,wo.comment,wo.atRule,wo.rule,wo.decl,wo.root,wo.CssSyntaxError,wo.Declaration,wo.Container,wo.Processor,wo.Document,wo.Comment,wo.Warning,wo.AtRule,wo.Result,wo.Input,wo.Rule,wo.Root,wo.Node;var bo=Object.defineProperty,So=(e,t,r)=>((e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Co(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 n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var Io={exports:{}},ko=String,xo=function(){return{isColorSupported:!1,reset:ko,bold:ko,dim:ko,italic:ko,underline:ko,inverse:ko,hidden:ko,strikethrough:ko,black:ko,red:ko,green:ko,yellow:ko,blue:ko,magenta:ko,cyan:ko,white:ko,gray:ko,bgBlack:ko,bgRed:ko,bgGreen:ko,bgYellow:ko,bgBlue:ko,bgMagenta:ko,bgCyan:ko,bgWhite:ko}};Io.exports=xo(),Io.exports.createColors=xo;var Eo=Io.exports;const Oo=Co(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ao=Eo,Mo=Oo,Ro=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.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=Ao.isColorSupported),Mo&&e&&(t=Mo(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ao.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Lo=Ro;Ro.default=Ro;var To={};To.isClean=Symbol("isClean"),To.my=Symbol("my");const No={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Do=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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 n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",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 n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||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"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return No[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 s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=No[r]),o.rawCache[r]=n,n}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 n=r.parent;if(n&&n!==e&&n.parent&&n.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],n=e.raws[t];return n&&n.value===r?n.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 Po=Do;Do.default=Do;let Fo=Po;function _o(e,t){new Fo(t).stringify(e)}var Bo=_o;_o.default=_o;let{isClean:zo,my:Uo}=To,jo=Lo,Wo=Po,$o=Bo;function Vo(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Vo(e,r)):("object"===o&&null!==s&&(s=Vo(s)),r[n]=s)}return r}let Go=class{constructor(e={}){this.raws={},this[zo]=!1,this[Uo]=!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=Vo(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:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new jo(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[zo]){this[zo]=!1;let e=this;for(;e=e.parent;)e[zo]=!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 n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let o=0;o<e;o++)"\n"===r[o]?(n=1,s+=1):n+=1;return{column:n,line:s}}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 n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}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 Wo).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 n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);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={},n=null==t;t=t||new Map;let s=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 n=t.get(e.input);null==n&&(n=s,t.set(e.input,s),s++),r[o]={end:e.end,inputId:n,start:e.start}}else r[o]=e}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=$o){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Zo=Go;Go.default=Go;let Jo=Zo,Yo=class extends Jo{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 Ho=Yo;Yo.default=Yo;var Xo={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Ko,SourceMapGenerator:qo}=Oo,{existsSync:Qo,readFileSync:ei}=Oo,{dirname:ti,join:ri}=Oo;let ni=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,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ti(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Ko(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()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ti(e),Qo(e))return this.mapFile=e,ei(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 Ko)return qo.fromSourceMap(t).toString();if(t instanceof qo)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=ri(ti(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 si=ni;ni.default=ni;let{SourceMapConsumer:oi,SourceMapGenerator:ii}=Oo,{fileURLToPath:ai,pathToFileURL:li}=Oo,{isAbsolute:ci,resolve:ui}=Oo,{nanoid:di}=Xo,hi=Oo,pi=Lo,fi=si,mi=Symbol("fromOffsetCache"),gi=Boolean(oi&&ii),yi=Boolean(ui&&ci),wi=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&&(!yi||/^\w+:\/\//.test(t.from)||ci(t.from)?this.file=t.from:this.file=ui(t.from)),yi&&gi){let e=new fi(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 "+di(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new pi(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,n.plugin):new pi(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(li&&(s.input.url=li(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[mi])r=this[mi];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[mi]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ui(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=ci(a.source)?li(a.source):new URL(a.source,this.map.consumer().sourceRoot||li(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ai)throw new Error("file: protocol is not available in this PostCSS build");l.file=ai(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 bi=wi;wi.default=wi,hi&&hi.registerInput&&hi.registerInput(wi);let{SourceMapConsumer:Si,SourceMapGenerator:vi}=Oo,{dirname:Ci,relative:Ii,resolve:ki,sep:xi}=Oo,{pathToFileURL:Ei}=Oo,Oi=bi,Ai=Boolean(Si&&vi),Mi=Boolean(Ci&&ki&&Ii&&xi);var Ri=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,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)),n=e.root||Ci(e.file);!1===this.mapOpts.sourcesContent?(t=new Si(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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&&Ai&&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=vi.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new vi({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 vi({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<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=n-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=s,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"),n=i.length-t):n+=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=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-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?Ci(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Ci(ki(r,this.mapOpts.annotation)));let n=Ii(r,e);return this.memoizedPaths.set(e,n),n}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 Oi(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 n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,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(Ei){let t=Ei(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;"\\"===xi&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Li=Zo,Ti=class extends Li{constructor(e){super(e),this.type="comment"}};var Ni=Ti;Ti.default=Ti;let Di,Pi,Fi,_i,{isClean:Bi,my:zi}=To,Ui=Ho,ji=Ni,Wi=Zo;function $i(e){return e.map(e=>(e.nodes&&(e.nodes=$i(e.nodes)),delete e.source,e))}function Vi(e){if(e[Bi]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Vi(t)}let Gi=class e extends Wi{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,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],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,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let o of s)this.proxyOf.nodes.splice(n+1,0,o);for(let o in this.indexes)r=this.indexes[o],n<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let i of o)this.proxyOf.nodes.splice(n,0,i);for(let i in this.indexes)r=this.indexes[i],n<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=$i(Di(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 Ui(t)]}else if(t.selector)t=[new Pi(t)];else if(t.name)t=[new Fi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ji(t)]}return t.map(t=>(t[zi]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Bi]&&Vi(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(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(s){throw t.addToError(s)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(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,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(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,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(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]}};Gi.registerParse=e=>{Di=e},Gi.registerRule=e=>{Pi=e},Gi.registerAtRule=e=>{Fi=e},Gi.registerRoot=e=>{_i=e};var Zi=Gi;Gi.default=Gi,Gi.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Fi.prototype):"rule"===e.type?Object.setPrototypeOf(e,Pi.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ui.prototype):"comment"===e.type?Object.setPrototypeOf(e,ji.prototype):"root"===e.type&&Object.setPrototypeOf(e,_i.prototype),e[zi]=!0,e.nodes&&e.nodes.forEach(e=>{Gi.rebuild(e)})};let Ji,Yi,Hi=Zi,Xi=class extends Hi{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ji(new Yi,this,e).stringify()}};Xi.registerLazyResult=e=>{Ji=e},Xi.registerProcessor=e=>{Yi=e};var Ki=Xi;Xi.default=Xi;let qi={};var Qi=function(e){qi[e]||(qi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ea=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 ta=ea;ea.default=ea;let ra=ta,na=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 ra(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var sa=na;na.default=na;const oa="'".charCodeAt(0),ia='"'.charCodeAt(0),aa="\\".charCodeAt(0),la="/".charCodeAt(0),ca="\n".charCodeAt(0),ua=" ".charCodeAt(0),da="\f".charCodeAt(0),ha="\t".charCodeAt(0),pa="\r".charCodeAt(0),fa="[".charCodeAt(0),ma="]".charCodeAt(0),ga="(".charCodeAt(0),ya=")".charCodeAt(0),wa="{".charCodeAt(0),ba="}".charCodeAt(0),Sa=";".charCodeAt(0),va="*".charCodeAt(0),Ca=":".charCodeAt(0),Ia="@".charCodeAt(0),ka=/[\t\n\f\r "#'()/;[\\\]{}]/g,xa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ea=/.[\r\n"'(/\\]/,Oa=/[\da-f]/i;let Aa=Zi,Ma=class extends Aa{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 Ra=Ma;Ma.default=Ma,Aa.registerAtRule(Ma);let La,Ta,Na=Zi,Da=class extends Na{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=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 s of n)s.raws.before=t.raws.before;return n}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 La(new Ta,this,e).stringify()}};Da.registerLazyResult=e=>{La=e},Da.registerProcessor=e=>{Ta=e};var Pa=Da;Da.default=Da,Na.registerRoot(Da);let Fa={comma:e=>Fa.split(e,[","],!0),space:e=>Fa.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",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?(""!==s&&n.push(s.trim()),s="",o=!1):s+=u;return(r||""!==s)&&n.push(s.trim()),n}};var _a=Fa;Fa.default=Fa;let Ba=Zi,za=_a,Ua=class extends Ba{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return za.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 ja=Ua;Ua.default=Ua,Ba.registerRule(Ua);let Wa=Ho,$a=function(e,t={}){let r,n,s,o,i,a,l,c,u,d,h=e.css.valueOf(),p=t.ignoreErrors,f=h.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=h.charCodeAt(m),r){case ca:case ua:case ha:case pa:case da:n=m;do{n+=1,r=h.charCodeAt(n)}while(r===ua||r===ca||r===ha||r===pa||r===da);d=["space",h.slice(m,n)],m=n-1;break;case fa:case ma:case wa:case ba:case Ca:case Sa:case ya:{let e=String.fromCharCode(r);d=[e,e,m];break}case ga:if(c=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===c&&u!==oa&&u!==ia&&u!==ua&&u!==ca&&u!==ha&&u!==da&&u!==pa){n=m;do{if(a=!1,n=h.indexOf(")",n+1),-1===n){if(p||t){n=m;break}w("bracket")}for(l=n;h.charCodeAt(l-1)===aa;)l-=1,a=!a}while(a);d=["brackets",h.slice(m,n+1),m,n],m=n}else n=h.indexOf(")",m+1),o=h.slice(m,n+1),-1===n||Ea.test(o)?d=["(","(",m]:(d=["brackets",o,m,n],m=n);break;case oa:case ia:s=r===oa?"'":'"',n=m;do{if(a=!1,n=h.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}w("string")}for(l=n;h.charCodeAt(l-1)===aa;)l-=1,a=!a}while(a);d=["string",h.slice(m,n+1),m,n],m=n;break;case Ia:ka.lastIndex=m+1,ka.test(h),n=0===ka.lastIndex?h.length-1:ka.lastIndex-2,d=["at-word",h.slice(m,n+1),m,n],m=n;break;case aa:for(n=m,i=!0;h.charCodeAt(n+1)===aa;)n+=1,i=!i;if(r=h.charCodeAt(n+1),i&&r!==la&&r!==ua&&r!==ca&&r!==ha&&r!==pa&&r!==da&&(n+=1,Oa.test(h.charAt(n)))){for(;Oa.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===ua&&(n+=1)}d=["word",h.slice(m,n+1),m,n],m=n;break;default:r===la&&h.charCodeAt(m+1)===va?(n=h.indexOf("*/",m+2)+1,0===n&&(p||t?n=h.length:w("comment")),d=["comment",h.slice(m,n+1),m,n],m=n):(xa.lastIndex=m+1,xa.test(h),n=0===xa.lastIndex?h.length-1:xa.lastIndex-2,d=["word",h.slice(m,n+1),m,n],g.push(d),m=n)}return m++,d},position:function(){return m}}},Va=Ni,Ga=Ra,Za=Pa,Ja=ja;const Ya={empty:!0,space:!0};let Ha=Zi,Xa=class{constructor(e){this.input=e,this.root=new Za,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,n,s=new Ga;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,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){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Va;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=$a(this.input)}decl(e,t){let r=new Wa;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(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(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[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(n=e[a],"!important"===n[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"===n[1].toLowerCase()){let t=e.slice(0),n="";for(let e=a;e>0;e--){let r=t[e][0];if(0===n.trim().indexOf("!")&&"space"!==r)break;n=t.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=t)}if("space"!==n[0]&&"comment"!==n[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 Ja;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,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)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&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){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,n){let s,o,i,a,l=r.length,c="",u=!0;for(let d=0;d<l;d+=1)s=r[d],o=s[0],"space"!==o||d!==l-1||n?"comment"===o?(a=r[d-1]?r[d-1][0]:"empty",i=r[d+1]?r[d+1][0]:"empty",Ya[a]||Ya[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Ja;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 n=t;n<e.length;n++)r+=e[n][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})}},Ka=bi;function qa(e,t){let r=new Ka(e,t),n=new Xa(r);try{n.parse()}catch(s){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===s.name&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?s.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(s.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),s}return n.root}var Qa=qa;qa.default=qa,Ha.registerParse(qa);let{isClean:el,my:tl}=To,rl=Ri,nl=Bo,sl=Zi,ol=Ki,il=Qi,al=sa,ll=Qa,cl=Pa;const ul={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},dl={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},hl={Once:!0,postcssPlugin:!0,prepare:!0};function pl(e){return"object"==typeof e&&"function"==typeof e.then}function fl(e){let t=!1,r=ul[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 ml(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:fl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function gl(e){return e[el]=!1,e.nodes&&e.nodes.forEach(e=>gl(e)),e}let yl={},wl=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof al)s=gl(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=ll;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(o){this.processed=!0,this.error=o}s&&!s[tl]&&sl.rebuild(s)}else s=gl(r);this.result=new al(t,s,n),this.helpers={...yl,postcss:yl,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,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(n){console&&console.error&&console.error(n)}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(!dl[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!hl[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);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],n=this.runOnRoot(t);if(pl(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[el];){e[el]=!0;let r=[ml(e)];for(;r.length>0;){let e=this.visitTick(r);if(pl(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,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 pl(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=nl;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new rl(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(pl(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[el];)e[el]=!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||il("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[n,s]of e){let e;this.result.lastPlugin=n;try{e=s(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(pl(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[el])return n[el]=!0,void e.push(ml(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[el]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[el]=!0;let t=fl(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[el]||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"}};wl.registerPostcss=e=>{yl=e};var bl=wl;wl.default=wl,cl.registerLazyResult(wl),ol.registerLazyResult(wl);let Sl=Ri,vl=Bo,Cl=Qi,Il=Qa;const kl=sa;let xl=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=vl;this.result=new kl(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Sl(s,n,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||Cl("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=Il;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 El=xl;xl.default=xl;let Ol=El,Al=bl,Ml=Ki,Rl=Pa,Ll=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 Al(this,e,t):new Ol(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Tl=Ll;Ll.default=Ll,Rl.registerProcessor(Ll),Ml.registerProcessor(Ll);let Nl=Ho,Dl=si,Pl=Ni,Fl=Ra,_l=bi,Bl=Pa,zl=ja;function Ul(e,t){if(Array.isArray(e))return e.map(e=>Ul(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:_l.prototype};r.map&&(r.map={...r.map,__proto__:Dl.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Ul(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Bl(n);if("decl"===n.type)return new Nl(n);if("rule"===n.type)return new zl(n);if("comment"===n.type)return new Pl(n);if("atrule"===n.type)return new Fl(n);throw new Error("Unknown node type: "+e.type)}var jl=Ul;Ul.default=Ul;let Wl=Lo,$l=Ho,Vl=bl,Gl=Zi,Zl=Tl,Jl=Bo,Yl=jl,Hl=Ki,Xl=ta,Kl=Ni,ql=Ra,Ql=sa,ec=bi,tc=Qa,rc=_a,nc=ja,sc=Pa,oc=Zo;function ic(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Zl(e)}ic.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Zl).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return ic([s(r)]).process(e,t)},s},ic.stringify=Jl,ic.parse=tc,ic.fromJSON=Yl,ic.list=rc,ic.comment=e=>new Kl(e),ic.atRule=e=>new ql(e),ic.decl=e=>new $l(e),ic.rule=e=>new nc(e),ic.root=e=>new sc(e),ic.document=e=>new Hl(e),ic.CssSyntaxError=Wl,ic.Declaration=$l,ic.Container=Gl,ic.Processor=Zl,ic.Document=Hl,ic.Comment=Kl,ic.Warning=Xl,ic.AtRule=ql,ic.Result=Ql,ic.Input=ec,ic.Rule=nc,ic.Root=sc,ic.Node=oc,Vl.registerPostcss(ic);var ac=ic;ic.default=ic;const lc=vo(ac);lc.stringify,lc.fromJSON,lc.plugin,lc.parse,lc.list,lc.document,lc.comment,lc.atRule,lc.rule,lc.decl,lc.root,lc.CssSyntaxError,lc.Declaration,lc.Container,lc.Processor,lc.Document,lc.Comment,lc.Warning,lc.AtRule,lc.Result,lc.Input,lc.Rule,lc.Root,lc.Node;class cc{constructor(...e){So(this,"parentElement",null),So(this,"parentNode",null),So(this,"ownerDocument"),So(this,"firstChild",null),So(this,"lastChild",null),So(this,"previousSibling",null),So(this,"nextSibling",null),So(this,"ELEMENT_NODE",1),So(this,"TEXT_NODE",3),So(this,"nodeType"),So(this,"nodeName"),So(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 cc))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 uc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hc={};function pc(e){if(hc[e])return hc[e];const t=globalThis[e],r=t.prototype,n=e in uc?uc[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in dc?dc[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(s&&i&&!globalThis.Zone)return hc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?hc[e]=o:r}catch{return r}}const fc={};function mc(e,t,r){var n;const s=`${e}.${String(r)}`;if(fc[s])return fc[s].call(t);const o=pc(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(fc[s]=i,i.call(t)):t[r]}const gc={};function yc(e,t,r){const n=`${e}.${String(r)}`;if(gc[n])return gc[n].bind(t);const s=pc(e)[r];return"function"!=typeof s?t[r]:(gc[n]=s,s.bind(t))}function wc(){return pc("MutationObserver").constructor}const bc={childNodes:function(e){return mc("Node",e,"childNodes")},parentNode:function(e){return mc("Node",e,"parentNode")},parentElement:function(e){return mc("Node",e,"parentElement")},textContent:function(e){return mc("Node",e,"textContent")},contains:function(e,t){return yc("Node",e,"contains")(t)},getRootNode:function(e){return yc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?mc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?mc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return mc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return mc("Element",e,"querySelectorAll")(t)},mutationObserver:wc};function Sc(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const vc="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 Cc={map:{},getId:()=>(console.error(vc),-1),getNode:()=>(console.error(vc),null),removeNodeFromMap(){console.error(vc)},has:()=>(console.error(vc),!1),reset(){console.error(vc)}};function Ic(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function kc(e,t,r,n,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>kc(e,t,o||{},!0)}function xc(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Cc=new Proxy(Cc,{get:(e,t,r)=>("map"===t&&console.error(vc),Reflect.get(e,t,r))}));let Ec=Date.now;function Oc(e){var t,r,n,s;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=bc.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==(n=bc.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function Ac(){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 Rc(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:bc.parentElement(e)}function Lc(e,t,r,n){if(!e)return!1;const s=Rc(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(kt(s,t,n))return!0}catch(o){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function Tc(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Nc(e,t){if(Ye(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=bc.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Nc(n,t))}function Dc(e){return Boolean(e.changedTouches)}function Pc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Fc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function _c(e){return!!e&&(e instanceof cc&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(bc.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ec=()=>(new Date).getTime());class Bc{constructor(){De(this,"id",1),De(this,"styleIDMap",new WeakMap),De(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 zc(e){var t;let r=null;return"getRootNode"in e&&(null==(t=bc.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&bc.host(bc.getRootNode(e))&&(r=bc.host(bc.getRootNode(e))),r}function Uc(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=zc(r);)r=t;return r}(e);return bc.contains(t,r)}function jc(e){const t=e.ownerDocument;return!!t&&(bc.contains(t,e)||Uc(e))}var Wc=(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))(Wc||{}),$c=(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))($c||{}),Vc=(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))(Vc||{}),Gc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Gc||{}),Zc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zc||{}),Jc=(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))(Jc||{}),Yc=(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))(Yc||{});function Hc(e){return"__ln"in e}class Xc{constructor(){De(this,"length",0),De(this,"head",null),De(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&&Hc(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&&Hc(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 Kc=(e,t)=>`${e}@${t}`;class qc{constructor(){De(this,"frozen",!1),De(this,"locked",!1),De(this,"texts",[]),De(this,"attributes",[]),De(this,"attributeMap",new WeakMap),De(this,"removes",[]),De(this,"mapRemoves",[]),De(this,"movedMap",{}),De(this,"addedSet",new Set),De(this,"movedSet",new Set),De(this,"droppedSet",new Set),De(this,"removesSubTreeCache",new Set),De(this,"mutationCb"),De(this,"blockClass"),De(this,"blockSelector"),De(this,"maskTextClass"),De(this,"maskTextSelector"),De(this,"inlineStylesheet"),De(this,"maskInputOptions"),De(this,"maskTextFn"),De(this,"maskInputFn"),De(this,"keepIframeSrcFn"),De(this,"recordCanvas"),De(this,"inlineImages"),De(this,"slimDOMOptions"),De(this,"dataURLOptions"),De(this,"doc"),De(this,"mirror"),De(this,"iframeManager"),De(this,"stylesheetManager"),De(this,"shadowDomManager"),De(this,"canvasManager"),De(this,"processedNodeManager"),De(this,"unattachedDoc"),De(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),De(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Xc,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const o=bc.parentNode(s);if(!o||!jc(s))return;let i=!1;if(s.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=Ye(o)?this.mirror.getId(zc(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=At(s,{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=>{Pc(e,this.mirror)&&this.iframeManager.addIframe(e),Fc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),_c(s)&&this.shadowDomManager.addShadowRoot(bc.shadowRoot(s),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)eu(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(bc.parentNode(a))||s(a);for(const a of this.addedSet)tu(this.droppedSet,a)||eu(this.removesSubTreeCache,a,this.mirror)?tu(this.movedSet,a)?s(a):this.droppedSet.add(a):s(a);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(bc.parentNode(o.value)),r=n(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(bc.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=bc.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=bc.host(n);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),s(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=bc.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),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).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))}),De(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(bc.childNodes(e),e=>bc.textContent(e)||"").join("")}),De(this,"processMutation",e=>{if(!Tc(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=bc.textContent(e.target);Lc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:xt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Rc(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const r=e.target;let n=e.attributeName,s=e.target.getAttribute(n);if("value"===n){const e=rt(r);s=Qe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(Lc(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!It(r.tagName,n))if(o.attributes[n]=Ct(this.doc,et(r.tagName),et(n),s),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(r.style)){const t=r.style.getPropertyValue(e),s=r.style.getPropertyPriority(e);t!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===s?t:[t,s]:o._unchangedStyles[e]=[t,s]}for(const e of Array.from(n.style))""===r.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(Lc(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),n=Ye(e.target)?this.mirror.getId(bc.host(e.target)):this.mirror.getId(e.target);Lc(e.target,this.blockClass,this.blockSelector,!1)||Tc(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Qc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Nc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Kc(r,n)]?Qc(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Ye(e.target)||!He(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),bc.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),De(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Tc(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[Kc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Lc(e,this.blockClass,this.blockSelector,!1)||(bc.childNodes(e).forEach(e=>this.genAdds(e)),_c(e)&&bc.childNodes(bc.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 Qc(e,t){e.delete(t),bc.childNodes(t).forEach(t=>Qc(e,t))}function eu(e,t,r){return 0!==e.size&&function(e,t){const r=bc.parentNode(t);return!!r&&e.has(r)}(e,t)}function tu(e,t){return 0!==e.size&&ru(e,t)}function ru(e,t){const r=bc.parentNode(t);return!!r&&(!!e.has(r)||ru(e,r))}let nu;const su=e=>{if(!nu)return e;return(...t)=>{try{return e(...t)}catch(r){if(nu&&!0===nu(r))return;throw r}}},ou=[];function iu(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 au(e,t){const r=new qc;ou.push(r),r.init(e);const n=new(wc())(su(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function lu({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,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(Vc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=et(o);const c=(t=>o=>{const i=iu(o);if(Lc(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Gc.Mouse;break;case"touch":a=Gc.Touch;break;case"pen":a=Gc.Pen}a===Gc.Touch?Vc[t]===Vc.MouseDown?c="TouchStart":Vc[t]===Vc.MouseUp&&(c="TouchEnd"):Gc.Pen}else Dc(o)&&(a=Gc.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Gc.Touch||c.startsWith("Mouse")&&a===Gc.Mouse)&&(a=null)):Vc[t]===Vc.Click&&(a=l,l=null);const u=Dc(o)?o.changedTouches[0]:o;if(!u)return;const d=r.getId(i),{clientX:h,clientY:p}=u;su(e)({type:Vc[c],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Vc[o]){case Vc.MouseDown:case Vc.MouseUp:i=i.replace("mouse","pointer");break;case Vc.TouchStart:case Vc.TouchEnd:return}a.push(Sc(i,c,t))}),su(()=>{a.forEach(e=>e())})}function cu({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){return Sc("scroll",su(Ic(su(o=>{const i=iu(o);if(!i||Lc(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Oc(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 uu=["INPUT","TEXTAREA","SELECT"],du=new WeakMap;function hu(e){return function(e,t){if(gu("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gu("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gu("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gu("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 pu(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function fu({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(bc.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(s=r.ownerDocument)?void 0:s.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 n=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(s){}return n}}),su(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function mu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),s(...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),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...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&&(n=au(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Ic(su(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=su(Ic(su(e=>{const t=iu(e),{clientX:r,clientY:s}=Dc(e)?e.changedTouches[0]:e;i||(i=Ec()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ec()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?$c.Drag:e instanceof MouseEvent?$c.MouseMove:$c.TouchMove)}),s,{trailing:!1})),u=[Sc("mousemove",c,r),Sc("touchmove",c,r),Sc("drag",c,r)];return su(()=>{u.forEach(e=>e())})}(e),o=lu(e),i=cu(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Sc("resize",su(Ic(su(()=>{const t=Ac(),s=Mc();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function d(e){let r=iu(e);const c=e.isTrusted,d=r&&r.tagName;if(r&&"OPTION"===d&&(r=bc.parentElement(r)),!r||!d||uu.indexOf(d)<0||Lc(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=rt(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[d.toLowerCase()]||a[m])&&(p=Qe({element:r,maskInputOptions:a,tagName:d,type:m,value:p,maskInputFn:l})),h(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;h(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function h(t,n){const s=du.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){du.set(t,n);const s=r.getId(t);su(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Sc(e,su(d),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=>kc(e[0],e[1],{set(){su(d)({target:this,isTrusted:!1})}},!1,f))),su(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=su(o=>Ic(su(s=>{const i=iu(s);if(!i||Lc(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=i;e({type:o,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}),s.media||500)),a=[Sc("play",i(Jc.Play),o),Sc("pause",i(Jc.Pause),o),Sc("seeked",i(Jc.Seeked),o),Sc("volumechange",i(Jc.VolumeChange),o),Sc("ratechange",i(Jc.RateChange),o)];return su(()=>{a.forEach(e=>e())})}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:su((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=pu(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),n.apply(s,o)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),n.apply(s,o)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),n.apply(s,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};yu("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(yu("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),yu("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),yu("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:su((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=pu(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...hu(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...hu(s),i]}]}),n.apply(s,o)})})}),su(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.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}),d=fu(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:su((s,i,a)=>{var l;const[c,u,d]=a;if(r.has(c))return o.apply(i,[c,u,d]);const{id:h,styleId:p}=pu(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:c,value:u,priority:d},index:hu(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:su((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:d}=pu(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:c},index:hu(o.parentRule)}),s.apply(o,a)})}),su(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=xc(t.fonts,"add",function(t){return function(r){return setTimeout(su(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(i),su(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e;let i=!0;const a=su(()=>{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;Lc(i,n,s,!0)||Lc(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Sc("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?xc(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(o){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,r,y.options));return su(()=>{ou.forEach(e=>e.reset()),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),d(),h(),p(),f(),m(),g.forEach(e=>e())})}function gu(e){return void 0!==window[e]}function yu(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class wu{constructor(e){De(this,"iframeIdToRemoteIdMap",new WeakMap),De(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=n.get(t);return s||-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 bu{constructor(e){De(this,"iframes",new WeakMap),De(this,"crossOriginIframeMap",new WeakMap),De(this,"crossOriginIframeMirror",new wu(pt)),De(this,"crossOriginIframeStyleMirror"),De(this,"crossOriginIframeRootIdMap",new WeakMap),De(this,"mirror"),De(this,"mutationCb"),De(this,"wrappedEmit"),De(this,"loadListener"),De(this,"stylesheetManager"),De(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wu(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,n;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==(n=this.loadListener)||n.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 n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Wc.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:Wc.IncrementalSnapshot,data:{source:$c.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Wc.Meta:case Wc.Load:case Wc.DomContentLoaded:return!1;case Wc.Plugin:return t;case Wc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Wc.IncrementalSnapshot:switch(t.data.source){case $c.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 $c.Drag:case $c.TouchMove:case $c.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case $c.ViewportResize:return!1;case $c.MediaInteraction:case $c.MouseInteraction:case $c.Scroll:case $c.CanvasMutation:case $c.Input:return this.replaceIds(t.data,e,["id"]),t;case $c.StyleSheetRule:case $c.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case $c.Font:return t;case $c.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case $c.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,n){for(const s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===Yc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Su{constructor(e){De(this,"shadowDoms",new WeakSet),De(this,"mutationCb"),De(this,"scrollCb"),De(this,"bypassOptions"),De(this,"mirror"),De(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(!He(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=au({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(cu({...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(bc.host(e))),this.restoreHandlers.push(fu({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(xc(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=bc.shadowRoot(this);return o&&jc(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Iu=0;Iu<64;Iu++)Cu[vu.charCodeAt(Iu)]=Iu;const ku=new Map;const xu=(e,t,r)=>{if(!e||!Au(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=ku.get(e);return r||(r=new Map,ku.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Eu(e,t,r){if(e instanceof Array)return e.map(e=>Eu(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),n=r.length,s="";for(t=0;t<n;t+=3)s+=vu[r[t]>>2],s+=vu[(3&r[t])<<4|r[t+1]>>4],s+=vu[(15&r[t+1])<<2|r[t+2]>>6],s+=vu[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Eu(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:[Eu(e.data,t,r),e.width,e.height]}}if(Au(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:xu(e,t,r)}}return e}const Ou=(e,t,r)=>e.map(e=>Eu(e,t,r)),Au=(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,n){const s=[];try{const o=xc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!Lc(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["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,[s,...o])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function Ru(e,t,r,n,s,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=xc(e,l,function(e){return function(...i){const a=e.apply(this,i);if(xu(a,o,this),"tagName"in this.canvas&&!Lc(this.canvas,n,s,!0)){const e=Ou(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=kc(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const Lu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Tu="undefined"!=typeof window&&window.Blob&&new Blob([(Nu=Lu,Uint8Array.from(atob(Nu),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Nu;function Du(e){let t;try{if(t=Tu&&(window.URL||window.webkitURL).createObjectURL(Tu),!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,"+Lu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Pu{constructor(e){De(this,"pendingCanvasMutations",new Map),De(this,"rafStamps",{latestId:0,invokeId:null}),De(this,"mirror"),De(this,"mutationCb"),De(this,"resetObservers"),De(this,"frozen",!1),De(this,"locked",!1),De(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:n,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{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,n,s){const o=Mu(t,r,n,!0),i=new Map,a=new Du;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:o}=e.data;this.mutationCb({id:t,type:Zc["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Lc(t,r,n,!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 n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[n])})),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Mu(e,t,r,!1),s=function(e,t,r,n){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=xc(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return Lc(this.canvas,r,n,!0)||setTimeout(()=>{const r=Ou(o,t,this);e(this.canvas,{type:Zc["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=kc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Zc["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const s=[];return s.push(...Ru(t.WebGLRenderingContext.prototype,Zc.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Ru(t.WebGL2RenderingContext.prototype,Zc.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),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 n=r.map(e=>{const{type:t,...r}=e;return r}),{type:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class Fu{constructor(e){De(this,"trackedLinkElements",new WeakSet),De(this,"mutationCb"),De(this,"adoptedStyleSheetCb"),De(this,"styleMirror",new Bc),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:[]},n=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),n.push({styleId:e,rules:Array.from(s.rules||CSSRule,(e,t)=>({rule:Ke(e,s.href),index:t}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class _u{constructor(){De(this,"nodeMap",new WeakMap),De(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 Bu,zu,Uu,ju=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Te=e.contentWindow)?void 0:Te.Array.from)||Array.from,document.body.removeChild(e)}}catch(Nh){console.debug("Unable to override Array.from",Nh)}const Wu=new qe;function $u(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,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:A,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:L}=e;nu=L;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(Z){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),Wu.reset();const D=!0===d?{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!==h?h:{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 A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};Bu=(e,s)=>{var o;const i=e;if(i.timestamp=Ec(),!(null==(o=ou[0])?void 0:o.isFrozen())||i.type===Wc.FullSnapshot||i.type===Wc.IncrementalSnapshot&&i.data.source===$c.Mutation||ou.forEach(e=>e.unfreeze()),T)null==t||t(B(i),s);else if(N){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Wc.FullSnapshot)F=i,_=0;else if(i.type===Wc.IncrementalSnapshot){if(i.data.source===$c.Mutation&&i.data.isAttachIframe)return;_++;const e=n&&_>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&zu(!0)}};const z=e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Mutation,...e}})},U=e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Scroll,...e}}),j=e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.CanvasMutation,...e}}),W=new Fu({mutationCb:z,adoptedStyleSheetCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.AdoptedStyleSheet,...e}})}),$=new bu({mirror:Wu,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:Bu});for(const Y of A||[])Y.getMirror&&Y.getMirror({nodeMirror:Wu,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const V=new _u;Uu=new Pu({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Wu,sampling:w.canvas,dataURLOptions:b});const G=new Su({mutationCb:z,scrollCb:U,bypassOptions:{blockClass:s,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:Uu,keepIframeSrcFn:M,processedNodeManager:V},mirror:Wu});zu=(e=!1)=>{if(!v)return;Bu({type:Wc.Meta,data:{href:window.location.href,width:Mc(),height:Ac()}},e),W.reset(),G.init(),ou.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new qe,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=()=>!1}=t||{};return At(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,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:d,maskInputFn:h,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:Wu,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:b,recordCanvas:C,inlineImages:O,onSerialize:e=>{Pc(e,Wu)&&$.addIframe(e),Fc(e,Wu)&&W.trackLinkElement(e),_c(e)&&G.addShadowRoot(bc.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");Bu({type:Wc.FullSnapshot,data:{node:t,initialOffset:Oc(window)}},e),ou.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Wu.getId(document))};try{const e=[],t=e=>{var t;return su(mu)({mutationCb:z,mousemoveCb:(e,t)=>Bu({type:Wc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.ViewportResize,...e}}),inputCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Input,...e}}),mediaInteractionCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.MediaInteraction,...e}}),styleSheetRuleCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.StyleSheetRule,...e}}),styleDeclarationCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.StyleDeclaration,...e}}),canvasMutationCb:j,fontCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Font,...e}}),selectionCb:e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Selection,...e}})},customElementCb:e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.CustomElement,...e}})},blockClass:s,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:Wu,iframeManager:$,stylesheetManager:W,shadowDomManager:G,processedNodeManager:V,canvasManager:Uu,ignoreCSSAttributes:R,plugins:(null==(t=null==A?void 0:A.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Bu({type:Wc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};$.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(n){console.warn(n)}});const r=()=>{zu(),e.push(t(document)),ju=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Sc("DOMContentLoaded",()=>{Bu({type:Wc.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(Sc("load",()=>{Bu({type:Wc.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),V.destroy(),ju=!1,nu=void 0}}catch(J){console.warn(J)}}var Vu,Gu;$u.addCustomEvent=(e,t)=>{if(!ju)throw new Error("please add custom event after start recording");Bu({type:Wc.Custom,data:{tag:e,payload:t}})},$u.freezePage=()=>{ou.forEach(e=>e.freeze())},$u.takeFullSnapshot=e=>{if(!ju)throw new Error("please take full snapshot after start recording");zu(e)},$u.mirror=Wu,(Gu=Vu||(Vu={}))[Gu.NotStarted=0]="NotStarted",Gu[Gu.Running=1]="Running",Gu[Gu.Stopped=2]="Stopped";const{addCustomEvent:Zu}=$u,{takeFullSnapshot:Ju}=$u,Yu={isRecording:!1,events:[],stopFn:null,startTime:null};let Hu=null;const Xu={maskAllInputs:!1,inlineStylesheet:!0,sampling:{mousemove:50,mouseInteraction:!0,scroll:150,input:"last"},checkoutEveryNth:200,checkoutEveryNms:3e4,recordCanvas:!1,collectFonts:!1,inlineImages:!0};function Ku(){if(!Yu.isRecording)return[];Yu.stopFn&&(Yu.stopFn(),Yu.stopFn=null),Yu.isRecording=!1;const e=[...Yu.events];return Yu.events=[],Yu.startTime=null,e}function qu(e,t){if(Yu.isRecording)try{Zu(e,t)}catch(r){console.warn("[LogSpace] Failed to add custom event:",r)}}const Qu="pending_sessions",ed="current_session";let td=null,rd=null;async function nd(){return rd||(td||(rd=new Promise((e,t)=>{const r=indexedDB.open("logspace-sdk-db",1);r.onerror=()=>{rd=null,t(new Error("Failed to open IndexedDB"))},r.onsuccess=()=>{td=r.result,e(td)},r.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(Qu)){t.createObjectStore(Qu,{keyPath:"id"}).createIndex("by-created","createdAt")}t.objectStoreNames.contains(ed)||t.createObjectStore(ed,{keyPath:"id"})}}),rd))}function sd(){return"undefined"!=typeof indexedDB}async function od(){if(sd())try{const e=await nd(),t=e.transaction(ed,"readwrite").objectStore(ed);await new Promise((e,r)=>{const n=t.delete("current");n.onsuccess=()=>e(),n.onerror=()=>r(n.error)})}catch(e){console.warn("[LogSpace] Failed to clear session backup:",e)}}async function id(e){if(sd())try{const t=await nd(),r=t.transaction(ed,"readwrite").objectStore(ed),n=await new Promise((e,t)=>{const n=r.get("current");n.onsuccess=()=>e(n.result||null),n.onerror=()=>t(n.error)});if(!n||n.sessionId!==e)return;await new Promise((e,t)=>{const n=r.delete("current");n.onsuccess=()=>e(),n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to clear session backup:",t)}}async function ad(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu),n={id:e.id,data:e,createdAt:Date.now(),retryCount:0};await new Promise((e,t)=>{const s=r.put(n);s.onsuccess=()=>e(),s.onerror=()=>t(s.error)})}catch(t){console.warn("[LogSpace] Failed to save pending session:",t)}}async function ld(){if(!sd())return[];try{const e=await nd(),t=e.transaction(Qu,"readonly").objectStore(Qu);return new Promise((e,r)=>{const n=t.getAll();n.onsuccess=()=>e(n.result||[]),n.onerror=()=>r(n.error)})}catch(e){return console.warn("[LogSpace] Failed to get pending sessions:",e),[]}}async function cd(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu);await new Promise((t,n)=>{const s=r.delete(e);s.onsuccess=()=>t(),s.onerror=()=>n(s.error)})}catch(t){console.warn("[LogSpace] Failed to remove pending session:",t)}}async function ud(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu),n=r.get(e);await new Promise((e,t)=>{n.onsuccess=()=>{const s=n.result;if(s){s.retryCount++,s.lastRetryAt=Date.now();const n=r.put(s);n.onsuccess=()=>e(),n.onerror=()=>t(n.error)}else e()},n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to update pending session retry:",t)}}const dd="1.1.0";let hd=null,pd=null,fd=[],md=[],gd=!1,yd="manual",wd=!1,bd={count:0,windowStart:0},Sd={lastLogHash:null,lastLogCount:0},vd=0,Cd=0,Id=0;let kd={count:0,windowStart:0};let xd=null,Ed=null,Od=null,Ad=null,Md=0,Rd=!1,Ld=null,Td=null,Nd=null,Dd=null,Pd=null,Fd=null,_d=null,Bd=null,zd=null,Ud=null;const jd=new Set,Wd={low:{maskAllInputs:!1,checkoutEveryNth:500,recordCanvas:!1},medium:{maskAllInputs:!1,checkoutEveryNth:300,recordCanvas:!1},high:{maskAllInputs:!1,checkoutEveryNth:150,recordCanvas:!1}},$d={rrweb:!0,console:!0,network:!0,errors:!0,interactions:!0,performance:!0,websocket:!0,sse:!0,storage:!0,resources:!0,spaNavigation:!0},Vd={maskAllInputs:!1,checkoutEveryNth:300,recordCanvas:!1},Gd={maskSensitiveData:!0,maskSelectors:[],excludeUrls:[],blockNetworkBodies:[],redactHeaders:["authorization","cookie","x-api-key"],logLevels:["log","info","warn","error","debug"]},Zd={maxLogs:1e4,maxSize:52428800,maxDuration:1800,idleTimeout:120,navigateAwayTimeout:120,rateLimit:100,deduplicate:!0,maxNetworkBodySize:10},Jd={continueOnRefresh:!0,onIdle:!0,onLimitReached:!0},Yd={enabled:!1,bufferBefore:30,recordAfter:30,triggers:{onError:!0,onConsoleError:!0,onNetworkStatus:[500,502,503,504]}};const Hd="__logspace_tab_id",Xd="__logspace_session_id";let Kd=null;function qd(){if(Kd)return Kd;if("undefined"!=typeof sessionStorage){const e=sessionStorage.getItem(Hd);if(e)return Kd=e,e}const e=`tab_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,8)}`;Kd=e;try{sessionStorage.setItem(Hd,e)}catch{}return e}function Qd(e){const t=function(){if("undefined"==typeof document)return null;const e=document.referrer||void 0;let t,r,n;if("undefined"!=typeof window&&window.opener)try{const e=window.opener;t=e.sessionStorage?.getItem(Xd)??e.__logspace_session_id,r=e.sessionStorage?.getItem(Hd)??e.__logspace_tab_id,n=e.location?.href}catch{}return e||t||r||n?{referrer:e,openerSessionId:t,openerTabId:r,openerUrl:n}:null}();if(!t&&!e)return;if(!t)return e;const r=e?.logspaceOrigin;return r&&"object"==typeof r&&!Array.isArray(r)?{...e,logspaceOrigin:{...t,...r}}:{...e||{},logspaceOrigin:t}}function eh(e){if(!hd?.limits.deduplicate)return!0;const t=function(e){return`${e.type}:${JSON.stringify(e.data)}`}(e);if(t===Sd.lastLogHash){if(Sd.lastLogCount++,fd.length>0){const e=fd[fd.length-1];e&&(e.data.duplicateCount=Sd.lastLogCount)}return!1}return Sd.lastLogHash=t,Sd.lastLogCount=1,!0}function th(){hd?.autoEnd.onIdle&&(xd&&clearTimeout(xd),xd=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Session auto-ended due to idle timeout"),yd="idle",wd=!0,hd?.hooks.onLimitReached?.("idle"),Th.stopSession())},1e3*hd.limits.idleTimeout))}function rh(){hd&&gd&&(!wd||pd&&"stopped"!==pd.status||(hd.debug&&console.log("[LogSpace] User activity detected - starting new session"),wd=!1,Th.startSession()))}const nh=["mousedown","keydown","scroll","touchstart"];function sh(){const e=Date.now();e-Md<1e3||(Md=e,th(),rh())}function oh(e,t){if(!hd?.sampling.enabled)return;if(hh||ph)return void(hd.debug&&console.log(`[LogSpace] Ignoring sampling trigger during unload: ${e}`));const r=!Rd;Rd=!0,Ld=e,r&&(Td=Date.now()),Nd=Date.now(),ah(),hd.debug&&(r?console.log(`[LogSpace] Sampling triggered by: ${e}`):console.log(`[LogSpace] Sampling window extended by: ${e}`)),r&&hd.hooks.onSamplingTrigger?.(e,t),Dd&&(clearTimeout(Dd),Dd=null),Dd=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),yd="samplingTriggered",kh({restartImmediately:!0}))},1e3*hd.sampling.recordAfter)}function ih(){!Pd&&hd?.sampling.enabled&&(Pd=setInterval(()=>{!function(){if(!hd?.sampling.enabled||Rd||!pd)return;const e=Date.now()-1e3*hd.sampling.bufferBefore,t=fd.length,r=md.length;fd=fd.filter(t=>t.timestamp>=e);const n=md.filter(t=>t.timestamp>=e);if(n.some(e=>2===e.type))md=n;else{let t=-1;const r=[];for(let n=0;n<md.length;n++){const s=md[n];s&&2===s.type&&s.timestamp<e&&(-1===t&&(t=n),r.push(n))}if(t>=0){const e=r.map(e=>md[e]).filter(e=>void 0!==e);md=[...e,...n]}else md=n}vd=fd.reduce((e,t)=>e+JSON.stringify(t).length,0),Cd=md.reduce((e,t)=>e+JSON.stringify(t).length,0),uh();const s=t-fd.length,o=r-md.length;hd.debug&&(s>0||o>0)&&console.log(`[LogSpace] Rolling buffer trimmed: ${s} logs, ${o} rrweb events (keeping last ${hd.sampling.bufferBefore}s: ${fd.length} logs, ${md.length} rrweb events)`)}()},5e3),hd.debug&&console.log(`[LogSpace] Sampling rolling buffer started (trimming every 5s, keeping ${hd.sampling.bufferBefore}s)`))}function ah(){Pd&&(clearInterval(Pd),Pd=null)}const lh=e=>{if(!hd||!pd||"recording"!==pd.status)return;if(!function(){if(!hd)return!1;const e=Date.now();if(e-bd.windowStart>1e3)return bd.windowStart=e,bd.count=1,!0;if(bd.count++,bd.count>hd.limits.rateLimit){if(hd.debug){const e=Date.now();e-Id>=1e3&&(Id=e,console.warn("[LogSpace] Rate limit exceeded, dropping log"))}return!1}return!0}())return;if(!eh(e))return;const t=hd?fd.length>=hd.limits.maxLogs?"maxLogs":vd+Cd>=hd.limits.maxSize?"maxSize":null:null;if(t)return void(hd.autoEnd.onLimitReached&&(hd.debug&&console.log(`[LogSpace] Session auto-ended: ${t}`),yd=t,hd.hooks.onLimitReached?.(t),kh({restartImmediately:!0})));const r=qd(),n=h({id:`${fd.length+1}`,timestamp:Date.now(),tabId:r,tabUrl:"undefined"!=typeof window?window.location.href:"",type:e.type,data:e.data,severity:e.severity},hd.privacy);fd.push(n),vd+=JSON.stringify(n).length,ch(n),th(),function(e){if(hd?.sampling.enabled)if(hd.sampling.triggers.onError&&"error"===e.type)oh("error",e);else{if(hd.sampling.triggers.onConsoleError&&"console"===e.type){const t=e.data;if("error"===t.level||"assert"===t.level)return void oh("consoleError",e)}if(hd.sampling.triggers.onNetworkStatus&&"network"===e.type){const t=e.data;if(t.status&&hd.sampling.triggers.onNetworkStatus.includes(t.status))oh("networkError",e)}}}(n),hd.hooks.onAction?.(n,pd),hd.debug&&console.log("[LogSpace] Captured:",n.type,n.data)};function ch(e){if(pd)switch(pd.stats.logCount++,e.type){case"network":pd.stats.networkLogCount++;break;case"console":pd.stats.consoleLogCount++,"error"===e.data?.level&&pd.stats.errorCount++;break;case"error":pd.stats.errorCount++;break;case"interaction":pd.stats.interactionLogCount++;break;case"performance":pd.stats.performanceLogCount++;break;case"storage":pd.stats.storageLogCount++;break;case"annotation":pd.stats.annotationCount++}}function uh(){if(!pd)return;const e=pd.stats.tabCount||1;pd.stats={logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:e};for(const t of fd)ch(t)}function dh(){g.uninstall(),k.uninstall(),O.uninstall(),D.uninstall(),U.uninstall(),J.uninstall(),Q.uninstall(),pe.uninstall(),ve.uninstall(),Le.uninstall()}let hh=!1,ph=!1;async function fh(){if(pd&&"recording"===pd.status&&sd())try{await async function(e,t,r,n){if(sd())try{const s=(await nd()).transaction(ed,"readwrite").objectStore(ed),o={id:"current",sessionId:e,logs:t,rrwebEvents:r,startTime:n.startTime,url:n.url,title:n.title,userId:n.userId,userTraits:n.userTraits,metadata:n.metadata,lastCheckpoint:Date.now()};await new Promise((e,t)=>{const r=s.put(o);r.onsuccess=()=>e(),r.onerror=()=>t(r.error)})}catch(s){console.warn("[LogSpace] Failed to save session checkpoint:",s)}}(pd.id,fd,md,{startTime:pd.startTime,url:pd.url,title:pd.title,userId:pd.userId,userTraits:pd.userTraits,metadata:pd.metadata}),hd?.debug&&console.log("[LogSpace] Session checkpoint saved",{logs:fd.length,rrwebEvents:md.length})}catch(e){hd?.debug&&console.warn("[LogSpace] Failed to save checkpoint:",e)}}function mh(){Od&&(clearInterval(Od),Od=null)}const gh="__logspace_emergency_backup",yh="__logspace_sampling_state";function wh(){try{localStorage.removeItem(yh)}catch(e){}}function bh(){try{localStorage.removeItem(gh)}catch(e){}}function Sh(){if(hh)return;if(!hd||!pd||"recording"!==pd.status)return;if(ph=!0,hh=!0,yd="unload",hd.autoEnd.continueOnRefresh){try{sessionStorage.setItem("logspace_continuing_session_id",pd.id),sessionStorage.setItem("logspace_continuing_session_start",String(pd.startTime)),sessionStorage.setItem("logspace_continuing_session_saved_at",String(Date.now())),hd.debug&&console.log("[LogSpace] Session ID and startTime saved for continuation:",pd.id,pd.startTime)}catch{}Rd&&function(e){if(Rd)try{const t={triggered:Rd,triggerType:Ld,firstTriggerTime:Td,triggerTime:Nd,sessionId:e};localStorage.setItem(yh,JSON.stringify(t))}catch(t){}}(pd.id)}const e=Ih();e&&(!function(e){try{if(0===e.logs.length&&(!e.rrwebEvents||e.rrwebEvents.length<3))return;const t=JSON.stringify(e);localStorage.setItem(gh,t)}catch(t){}}(e),sd()&&ad(e).catch(()=>{}),hd.debug&&console.log("[LogSpace] Session paused and saved for continuation"))}function vh(){if("hidden"===document.visibilityState){if(!hd||!pd||"recording"!==pd.status)return;const e=1e3*hd.limits.navigateAwayTimeout;hd.debug&&console.log(`[LogSpace] Tab hidden, grace period started (${hd.limits.navigateAwayTimeout}s)`),hd.capture.rrweb&&qu("tab-hidden",{tabId:qd(),timestamp:Date.now()}),Ad&&clearTimeout(Ad),Ad=setTimeout(()=>{"recording"===pd?.status&&"hidden"===document.visibilityState&&(hd?.debug&&console.log("[LogSpace] Grace period expired, saving session for continuation"),yd="navigateAway",Sh())},e)}else{if(Ad&&(hd?.debug&&console.log("[LogSpace] Tab visible, grace period cancelled"),clearTimeout(Ad),Ad=null),ph||hh){const e=ph,t=hh;ph=!1,hh=!1,hd?.debug&&console.log("[LogSpace] Navigation flags reset - page is visible",{wasNavigating:e,wasUnloadHandled:t})}if(hd?.capture.rrweb&&"recording"===pd?.status){const e=qd();hd.debug&&console.log("[LogSpace] Tab visible, forcing full rrweb snapshot for:",e),qu("tab-visible",{tabId:e,timestamp:Date.now()}),function(){if(Yu.isRecording)try{Ju(!0)}catch(e){console.warn("[LogSpace] Failed to take full snapshot:",e)}}()}th()}}function Ch(e){Sh()}function Ih(){if(!pd)return null;if(hd?.sampling.enabled&&!Rd){hd.debug&&console.log("[LogSpace] Sampling enabled but not triggered - session discarded");let e="noTrigger";return"idle"===yd?e="idle":"maxDuration"===yd?e="maxDuration":"manual"===yd&&(e="manual"),hd.hooks.onSessionDiscarded?.(pd,e),null}hd?.sampling.enabled&&Rd&&function(){if(!(hd?.sampling.enabled&&Td&&Nd&&pd))return;const e=Td-1e3*hd.sampling.bufferBefore,t=Nd+1e3*hd.sampling.recordAfter;fd=fd.filter(r=>r.timestamp>=e&&r.timestamp<=t);const r=md.filter(r=>r.timestamp>=e&&r.timestamp<=t),n=r.some(e=>2===e.type);if(hd.debug&&(console.log(`[LogSpace] trimLogsToSamplingWindow - before: ${md.length} events, recentEvents: ${r.length}, hasFullSnapshot in recent: ${n}`),console.log(`[LogSpace] trimLogsToSamplingWindow - rrweb types before: ${md.map(e=>e.type).join(",")}`)),n)md=r;else{const t=[];for(let r=0;r<md.length;r++){const n=md[r];n&&2===n.type&&n.timestamp<e&&t.push(n)}hd.debug&&console.log(`[LogSpace] trimLogsToSamplingWindow - found ${t.length} snapshots before window`),md=t.length>0?[...t,...r]:r}hd.debug&&console.log(`[LogSpace] trimLogsToSamplingWindow - after: ${md.length} events, types: ${md.map(e=>e.type).join(",")}`),uh(),hd.debug&&console.log(`[LogSpace] Trimmed to sampling window: ${fd.length} logs, ${md.length} rrweb events`)}();const e=Date.now(),t={id:pd.id,startTime:pd.startTime,endTime:e,duration:e-pd.startTime,url:pd.url,title:pd.title,userId:pd.userId,userTraits:pd.userTraits,metadata:pd.metadata,logs:hd?.hooks.beforeSend?hd.hooks.beforeSend(fd)||[]:fd,stats:pd.stats,endReason:yd,recordingType:"rrweb",userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,sdkVersion:dd};return hd?.sampling.enabled&&Rd&&Ld&&(t.samplingTrigger=Ld),hd?.capture.rrweb&&md.length>0&&(t.rrwebEvents=md),t}async function kh(e){if(!pd||"stopped"===pd.status)return;const t=!0===e?.restartImmediately,r=pd.id;if(pd.status="stopped",pd.endTime=Date.now(),Fd=null,xd&&(clearTimeout(xd),xd=null),Ed&&(clearTimeout(Ed),Ed=null),Ad&&(clearTimeout(Ad),Ad=null),mh(),ah(),hd?.capture.rrweb){const e=Ku();hd.debug&&console.log("[LogSpace] rrweb recording stopped, events:",e.length)}dh(),hd?.hooks.onSessionEnd?.(pd,fd),hd?.debug&&console.log("[LogSpace] Session stopped:",pd.id,{duration:pd.endTime-pd.startTime,logs:fd.length,rrwebEvents:md.length,reason:yd});const n=Ih();if(t&&Th.startSession(),!n)return await id(r),bh(),void wh();try{await async function(e){if(hd?.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(!hd?.serverUrl)return void(hd?.debug&&console.log("[LogSpace] No serverUrl configured - session stored locally only",{id:e.id,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0}));try{const t=JSON.stringify(e),r=await xh(t),n="application/gzip"===r.type,s=new FormData;s.append("title",e.title||`SDK Session ${e.id}`),s.append("log_file",r,n?`${e.id}.json.gz`:`${e.id}.json`),e.url&&s.append("description",`Session recorded on ${e.url}`);const o={};for(const u of e.logs){const e=u.type||"unknown";o[e]=(o[e]||0)+1}let i=e.duration;if(e.rrwebEvents&&e.rrwebEvents.length>0){const t=e.rrwebEvents.map(e=>e.timestamp),r=Math.min(...t);i=Math.max(...t)-r}const a={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:i,userAgent:e.userAgent,timestamp:e.startTime,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};s.append("log_metadata",JSON.stringify(a));const l={...hd.headers};hd.apiKey&&(l.Authorization=`Bearer ${hd.apiKey}`);const c=await fetch(`${hd.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:l,body:s});if(!c.ok){const e=await c.text();throw new Error(`HTTP ${c.status}: ${e}`)}if(hd.debug){const t=await c.json();console.log("[LogSpace] Session sent successfully:",{sessionId:e.id,logId:t.id,compressed:n,size:`${Math.round(r.size/1024)}KB`})}}catch(t){throw hd.debug&&console.error("[LogSpace] Failed to send session:",t),hd.hooks.onError?.(t),t}}(n),await id(r),bh(),wh()}catch(s){throw await ad(n),s}}async function xh(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 n=[],s=e.readable.getReader();for(;;){const{done:e,value:t}=await s.read();if(e)break;n.push(t)}const o=n.reduce((e,t)=>e+t.length,0),i=new Uint8Array(o);let a=0;for(const t of n)i.set(t,a),a+=t.length;return new Blob([i],{type:"application/gzip"})}return new Blob([t],{type:"application/json"})}async function Eh(e){if(!hd?.serverUrl)throw new Error("No serverUrl configured");const t=JSON.stringify(e),r=await xh(t),n="application/gzip"===r.type,s=new FormData;s.append("title",e.title||`SDK Session ${e.id}`),s.append("log_file",r,n?`${e.id}.json.gz`:`${e.id}.json`),e.url&&s.append("description",`Recovered session from ${e.url}`);const o={};for(const u of e.logs){const e=u.type||"unknown";o[e]=(o[e]||0)+1}let i=e.duration;if(e.rrwebEvents&&e.rrwebEvents.length>0){const t=e.rrwebEvents.map(e=>e.timestamp),r=Math.min(...t);i=Math.max(...t)-r}const a={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:i,userAgent:e.userAgent,timestamp:e.startTime,recovered:!0,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};s.append("log_metadata",JSON.stringify(a));const l={...hd.headers};hd.apiKey&&(l.Authorization=`Bearer ${hd.apiKey}`);const c=await fetch(`${hd.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:l,body:s});if(!c.ok){const e=await c.text();throw new Error(`HTTP ${c.status}: ${e}`)}}function Oh(e){try{return JSON.stringify(e)}catch{return String(e)}}function Ah(e){return e.id?`id:${e.id}|ts:${e.timestamp}|type:${e.type}`:`ts:${e.timestamp}|type:${e.type}|data:${Oh(e.data)}`}function Mh(e){const t=e.id??e.data?.id;if(null!=t)return`id:${String(t)}|ts:${e.timestamp}|type:${e.type}`;const r=e.data;return`ts:${e.timestamp}|type:${e.type}|data:${Oh(r)}`}function Rh(e,t){if(pd&&"recording"===pd.status){if(e.length>0){const t=new Set(fd.map(e=>Ah(e))),r=[];for(const n of e){const e=Ah(n);t.has(e)||(t.add(e),r.push(n))}if(r.length>0){fd=[...r,...fd];for(const e of r)vd+=JSON.stringify(e).length,ch(e);hd?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered logs (${e.length-r.length} duplicates skipped)`)}else hd?.debug&&console.log(`[LogSpace] All ${e.length} recovered logs already exist, skipping`)}if(t.length>0){const e=new Set(md.map(e=>Mh(e))),r=[];for(const n of t){const t=Mh(n);e.has(t)||(e.add(t),r.push(n))}if(r.length>0){md=[...r,...md];for(const e of r)Cd+=JSON.stringify(e).length;hd?.sampling.enabled&&Pd&&(ah(),hd?.debug&&console.log("[LogSpace] Stopped sampling trim timer to preserve recovered rrweb events")),hd?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered rrweb events (${t.length-r.length} duplicates skipped)`)}else hd?.debug&&console.log(`[LogSpace] All ${t.length} recovered rrweb events already exist, skipping`)}}else hd?.debug&&console.warn("[LogSpace] Cannot merge recovered data - no active session")}async function Lh(){if(hd?.serverUrl)try{const t=function(){try{const e=localStorage.getItem(gh);if(e)return JSON.parse(e)}catch(e){}return null}();if(t)if(jd.has(t.id))hd.debug&&console.log("[LogSpace] Skipping already processed emergency backup:",t.id),bh();else if(Ud&&t.id===Ud)hd.debug&&console.log("[LogSpace] Merging emergency backup into continuing session:",t.id),Rh(t.logs,t.rrwebEvents||[]),jd.add(t.id),bh(),await od();else{hd.debug&&console.log("[LogSpace] Recovering emergency backup session:",t.id);try{await Eh(t),bh(),await od(),sd()&&await cd(t.id),hd.debug&&console.log("[LogSpace] Emergency backup session sent:",t.id)}catch(e){sd()&&(await ad(t),bh()),hd.debug&&console.warn("[LogSpace] Error sending emergency backup, saved to IndexedDB:",e)}}if(!sd())return;await async function(){if(!sd())return;const t=Date.now();try{const e=await ld();for(const r of e){const e=t-r.createdAt>6048e5,n=r.retryCount>=5;(e||n)&&await cd(r.id)}}catch(e){console.warn("[LogSpace] Failed to cleanup old sessions:",e)}}();const r=await ld();if(0===r.length){const t=await async function(){if(!sd())return null;try{const e=(await nd()).transaction(ed,"readonly").objectStore(ed);return new Promise((t,r)=>{const n=e.get("current");n.onsuccess=()=>t(n.result||null),n.onerror=()=>r(n.error)})}catch(e){return console.warn("[LogSpace] Failed to get session backup:",e),null}}();if(t&&t.logs.length>0)if(Ud&&t.sessionId===Ud)hd.debug&&console.log("[LogSpace] Merging checkpoint backup into continuing session:",t.sessionId),Rh(t.logs,t.rrwebEvents||[]),jd.add(t.sessionId),await od();else if(jd.has(t.sessionId))hd.debug&&console.log("[LogSpace] Skipping already processed backup:",t.sessionId),await od();else{hd.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:dd};r.push({id:t.sessionId,data:e,createdAt:t.lastCheckpoint,retryCount:0}),await ad(e),await od()}}if(0===r.length)return;hd.debug&&console.log(`[LogSpace] Recovering ${r.length} pending session(s)`);for(const n of r)if(jd.has(n.id))hd.debug&&console.log("[LogSpace] Skipping already processed pending session:",n.id),await cd(n.id);else if(Ud&&n.id===Ud)hd.debug&&console.log("[LogSpace] Merging pending session into continuing session:",n.id),Rh(n.data.logs,n.data.rrwebEvents||[]),jd.add(n.id),await cd(n.id);else try{await Eh(n.data),jd.add(n.id),await cd(n.id),hd.debug&&console.log("[LogSpace] Recovered session sent:",n.id)}catch(e){await ud(n.id),hd.debug&&console.warn("[LogSpace] Error sending recovered session:",n.id,e)}}catch(e){hd.debug&&console.warn("[LogSpace] Session recovery failed:",e)}finally{Ud=null}}const Th={init(e){if(gd)throw new Error("[LogSpace] SDK already initialized. Call destroy() first if you need to reinitialize.");if("undefined"!=typeof window){if(hd=function(e){const t=e.recordingQuality||"medium",r={...Vd,...Wd[t],...e.rrweb};return{serverUrl:e.serverUrl,apiKey:e.apiKey,capture:{...$d,...e.capture},rrweb:r,privacy:{...Gd,...e.privacy},limits:{...Zd,...e.limits},autoEnd:{...Jd,...e.autoEnd},sampling:{...Yd,...e.sampling,triggers:{...Yd.triggers,...e.sampling?.triggers}},hooks:e.hooks||{},headers:e.headers||{},debug:e.debug||!1,dryRun:e.dryRun||!1}}(e),gd=!0,hd.debug&&console.log("[LogSpace] SDK initialized",{version:dd,serverUrl:hd.serverUrl,limits:hd.limits,persistence:sd()?"enabled":"disabled"}),hd.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 n=r?Number(r):0,s=Date.now()-n,o=1e3*hd.limits.navigateAwayTimeout;n>0&&s>o?hd.debug&&console.log("[LogSpace] Session continuation expired:",e,`(${Math.round(s/1e3)}s > ${hd.limits.navigateAwayTimeout}s timeout)`):(Fd=e,Ud=e,t&&(_d=Number(t)),hd.debug&&console.log("[LogSpace] Continuing session from previous page:",e,"startTime:",t))}}catch{}window.addEventListener("beforeunload",Sh),window.addEventListener("pagehide",Ch),document.addEventListener("visibilitychange",vh),hd.autoEnd.onIdle&&function(){if("undefined"!=typeof window){for(const e of nh)window.addEventListener(e,rh,{passive:!0,capture:!0});window.addEventListener("mousemove",sh,{passive:!0,capture:!0})}}(),hh=!1,ph=!1,this.startSession(),Lh().catch(()=>{})}else console.warn("[LogSpace] SDK requires browser environment")},startSession(e){if(!gd||!hd)return void console.warn("[LogSpace] SDK not initialized");if("recording"===pd?.status)return void console.warn("[LogSpace] Session already recording");let t,r;wd=!1,Rd=!1,Ld=null,Td=null,Nd=null,Dd&&(clearTimeout(Dd),Dd=null),ah(),fd=[],md=[],vd=0,Cd=0,bd={count:0,windowStart:0},kd={count:0,windowStart:0},Id=0,Sd={lastLogHash:null,lastLogCount:0},yd="manual";let n=!1;if(Fd){t=Fd,r=_d||Date.now(),hd.debug&&console.log("[LogSpace] Using continuing session ID:",t,"with original startTime:",r);const e=function(){try{const e=localStorage.getItem(yh);if(e)return JSON.parse(e)}catch(e){}return null}();e&&e.sessionId===t&&e.triggered&&(Rd=e.triggered,Ld=e.triggerType,Td=e.firstTriggerTime,Nd=e.triggerTime,n=!0,hd.debug&&console.log("[LogSpace] Restored sampling state from before refresh:",e.triggerType)),wh(),Fd=null,_d=null}else t=`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`,r=Date.now();const s=Bd||zd,o=qd(),i=Qd(e);if(pd={id:t,tabId:o,startTime:r,status:"recording",url:window.location.href,title:document.title,metadata:i,userId:s?.userId,userTraits:s?.traits,stats:{logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:1}},function(e,t){try{sessionStorage.setItem(Xd,e),sessionStorage.setItem(Hd,t)}catch{}try{window.__logspace_session_id=e,window.__logspace_tab_id=t}catch{}}(t,o),hd.capture.rrweb){const e=function(e={},t,r){if(Yu.isRecording)return console.warn("[LogSpace] rrweb recording already in progress"),!1;const n={...Xu,...e};Hu=r||null;try{Yu.events=[],Yu.startTime=Date.now(),Yu.isRecording=!0,Yu.stopFn=$u({emit:(e,r)=>{const n={...e,tabId:Hu||void 0};Yu.events.push(n),t?.(n)},maskAllInputs:n.maskAllInputs,maskTextSelector:n.maskTextSelector,blockSelector:n.blockSelector,ignoreSelector:n.ignoreSelector,inlineStylesheet:n.inlineStylesheet,sampling:n.sampling,checkoutEveryNth:n.checkoutEveryNth,checkoutEveryNms:n.checkoutEveryNms,recordCanvas:n.recordCanvas,collectFonts:n.collectFonts,inlineImages:n.inlineImages,plugins:n.plugins})??null;try{Ju(!0)}catch(s){console.warn("[LogSpace] Failed to take initial full snapshot:",s)}return!0}catch(o){return console.error("[LogSpace] Failed to start rrweb recording:",o),Yu.isRecording=!1,!1}}({maskAllInputs:hd.rrweb.maskAllInputs,maskTextSelector:hd.rrweb.maskTextSelector,blockSelector:hd.rrweb.blockSelector,ignoreSelector:hd.rrweb.ignoreSelector,recordCanvas:hd.rrweb.recordCanvas,checkoutEveryNth:hd.rrweb.checkoutEveryNth},e=>{if(!pd||"recording"!==pd.status)return;const t=Date.now();if(t-kd.windowStart>1e3)kd.windowStart=t,kd.count=1;else if(kd.count++,kd.count>500)return;const r=2===e.type?5e4:500;Cd+=r;hd&&vd+Cd>=hd.limits.maxSize?hd.autoEnd.onLimitReached&&(hd.debug&&console.log("[LogSpace] Session auto-ended: maxSize (rrweb)"),yd="maxSize",hd.hooks.onLimitReached?.("maxSize"),kh({restartImmediately:!0})):(md.push(e),th())},o);hd.debug&&console.log("[LogSpace] rrweb recording started:",e,o?`(tabId: ${o})`:"")}if(hd.limits.maxDuration>0&&(Ed=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Session auto-ended: maxDuration"),yd="maxDuration",hd?.hooks.onLimitReached?.("maxDuration"),kh({restartImmediately:!0}))},1e3*hd.limits.maxDuration)),th(),function(){if(!hd)return;const e={...hd.privacy};if(hd.serverUrl){const t=[`${hd.serverUrl}/api/v1/sessions`,`${hd.serverUrl}/api/v1/protected/sdk/logs`];e.excludeUrls=[...e.excludeUrls||[],...t]}hd.capture.console&&g.install(lh,hd.privacy),hd.capture.network&&k.install(lh,e,th,hd.limits),hd.capture.errors&&O.install(lh,hd.privacy),hd.capture.websocket&&D.install(lh,hd.privacy,th,hd.limits),hd.capture.sse&&U.install(lh,hd.privacy,th,hd.limits),hd.capture.storage&&J.install(lh,hd.privacy),hd.capture.interactions&&Q.install(lh,hd.privacy),hd.capture.performance&&pe.install(lh,hd.privacy),hd.capture.resources&&ve.install(lh,e),hd.capture.spaNavigation&&Le.install(lh,hd.privacy)}(),!Od&&sd()&&(Od=setInterval(()=>{fh()},15e3)),hd.sampling.enabled&&!n)ih();else if(hd.sampling.enabled&&n&&Nd){const e=Date.now()-Nd,t=Math.max(0,1e3*hd.sampling.recordAfter-e);hd.debug&&console.log(`[LogSpace] Sampling was triggered before refresh, ${t}ms remaining in recordAfter`),t>0?Dd=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),yd="samplingTriggered",kh({restartImmediately:!0}))},t):(hd.debug&&console.log("[LogSpace] Sampling recordAfter period already elapsed, ending session"),yd="samplingTriggered",kh({restartImmediately:!0}))}pd&&s&&Bd&&hd.debug&&console.log("[LogSpace] Applied pending user identity:",s.userId),Bd&&(Bd=null),pd&&(hd.hooks.onSessionStart?.(pd),hd.debug&&console.log("[LogSpace] Session started:",pd.id))},async stopSession(){await kh()},identify(e,t){if(zd={userId:e,traits:t},!pd)return Bd={userId:e,traits:t},void(hd?.debug&&console.log("[LogSpace] User identity queued (session not started yet):",e));pd.userId=e,pd.userTraits=t,hd?.debug&&console.log("[LogSpace] User identified:",e)},track(e,t){lh({type:"annotation",data:{annotationType:"event",eventName:e,properties:t}})},breadcrumb(e,t){lh({type:"annotation",data:{annotationType:"breadcrumb",message:e,category:t}})},pauseRecording(){"recording"===pd?.status&&(pd.status="paused",hd?.debug&&console.log("[LogSpace] Recording paused"))},resumeRecording(){"paused"===pd?.status&&(pd.status="recording",th(),hd?.debug&&console.log("[LogSpace] Recording resumed"))},trigger(e){hd?.sampling.enabled?(hd.debug&&console.log("[LogSpace] Manual sampling trigger:",e||"user_triggered"),oh("manual")):hd?.debug&&console.log("[LogSpace] trigger() called but sampling is not enabled")},getSession:()=>pd,getSessionLogs:()=>[...fd],getSessionData:()=>Ih(),getRRWebEvents:()=>[...md],getConfig:()=>hd?{...hd,rateLimit:hd.limits.rateLimit,maxLogs:hd.limits.maxLogs,maxSize:hd.limits.maxSize,idleTimeout:hd.limits.idleTimeout}:null,setConfig(e){hd?(void 0!==e.rateLimit&&(hd.limits.rateLimit=e.rateLimit),void 0!==e.maxLogs&&(hd.limits.maxLogs=e.maxLogs),void 0!==e.maxSize&&(hd.limits.maxSize=e.maxSize),void 0!==e.idleTimeout&&(hd.limits.idleTimeout=e.idleTimeout,th()),void 0!==e.debug&&(hd.debug=e.debug),hd.debug&&console.log("[LogSpace] Config updated:",e)):console.warn("[LogSpace] SDK not initialized, cannot update config")},destroy(){if(!gd)return;xd&&(clearTimeout(xd),xd=null),Ed&&(clearTimeout(Ed),Ed=null),Dd&&(clearTimeout(Dd),Dd=null),Ad&&(clearTimeout(Ad),Ad=null),mh(),ah(),hd?.capture.rrweb&&Ku(),"undefined"!=typeof window&&(window.removeEventListener("beforeunload",Sh),window.removeEventListener("pagehide",Ch),document.removeEventListener("visibilitychange",vh)),function(){if("undefined"!=typeof window){for(const e of nh)window.removeEventListener(e,rh,{capture:!0});window.removeEventListener("mousemove",sh,{capture:!0})}}(),dh(),td&&(td.close(),td=null,rd=null);const e=hd?.debug;hd=null,pd=null,fd=[],md=[],vd=0,Cd=0,wd=!1,Rd=!1,Ld=null,Td=null,Nd=null,Ud=null,hh=!1,ph=!1,Md=0,Kd=null,gd=!1,e&&console.log("[LogSpace] SDK destroyed")},version:dd};e.LogSpace=Th,e.default=Th,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LogSpace={})}(this,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("function"==typeof e){return`[Function: ${e.name||"anonymous"}]`}if("symbol"==typeof e)return e.toString();if(e instanceof Error)return JSON.stringify({name:e.name,message:e.message,stack:e.stack});if("undefined"!=typeof FormData&&e instanceof FormData){const t={};return e.forEach((e,r)=>{if("undefined"!=typeof Blob&&e instanceof Blob){const n=e,s="undefined"!=typeof File&&e instanceof File?`File(${e.name}, ${n.size}b)`:`Blob(${n.size}b)`;if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,s]:[e,s]}else t[r]=s}else{const n=String(e).length>1e3?String(e).substring(0,1e3)+"...":String(e);if(t[r]){const e=t[r];t[r]=Array.isArray(e)?[...e,n]:[e,n]}else t[r]=n}}),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 n(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:/\b(password|pwd|passwd)\s*[:=]\s*[^\s,;}\]]+/gi,replacement:"$1: [REDACTED]"},{pattern:/"password"\s*:\s*"[^"]*"/gi,replacement:'"password": "[REDACTED]"'},{pattern:/'password'\s*:\s*'[^']*'/gi,replacement:"'password': '[REDACTED]'"},{pattern:/\b(?:sk|pk|api|auth|secret)_(?:live|test|prod|dev)?_[A-Za-z0-9_-]{10,}/g,replacement:"[API_KEY_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:/\beyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\b/g,replacement:"[JWT_TOKEN_REDACTED]"}];for(const{pattern:n,replacement:s}of r)t=t.replace(n,s);return t}const s=/^(password|pwd|passwd|secret|token|api[_-]?key|auth[_-]?token|access[_-]?token|private[_-]?key|secret[_-]?key)\s*[:=]?\s*$/i;function o(e,t){if(!e||"object"!=typeof e)return e;const r={},s=["authorization","cookie","set-cookie","x-api-key","x-auth-token","x-access-token","x-csrf-token","csrf-token",...(t||[]).map(e=>e.toLowerCase())];for(const[o,i]of Object.entries(e)){let e=i;e=s.some(e=>o.toLowerCase().includes(e.toLowerCase()))?"[REDACTED]":n(i),r[o]=e}return r}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(e,t){if(!e||!t||0===t.length)return!1;try{const r=new URL(e).hostname.toLowerCase(),n=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(n))return!0}catch{}}}catch{}return!1}function l(){try{const e=(new Error).stack||"";return e.split("\n").slice(3).slice(0,3).join("\n").trim()}catch{return""}}function c(e,t){if(JSON.stringify(e).length<=t)return e;if(Array.isArray(e)){const r=[];let n=2;for(let s=0;s<e.length;s++){const o=JSON.stringify(e[s]).length+(s>0?1:0);if(n+o>t-100){const t=e.length-s;r.push({__logspace_truncated:!0,__remaining_items:t,__original_length:e.length});break}r.push(e[s]),n+=o}return r}if("object"==typeof e&&null!==e){const r={};let n=2;const s=Object.entries(e);for(let e=0;e<s.length;e++){const o=s[e];if(!o)continue;const[i,a]=o,l=JSON.stringify({[i]:a}).length-2+(e>0?1:0);if(n+l>t-150){const t=s.length-e;r.__logspace_truncated=!0,r.__remaining_properties=t;break}if("string"==typeof a&&a.length>1e3)r[i]=a.substring(0,1e3)+"... [truncated]";else if("object"==typeof a&&null!==a){JSON.stringify(a).length>5e3?r[i]=c(a,5e3):r[i]=a}else r[i]=a;n+=l}return r}return e}function u(e,t,n=1e4){if(t){const t=e instanceof ArrayBuffer?e.byteLength:e.size||0;return{content:`[Binary: ${t} bytes]`,size:t,truncated:!0}}const s="string"==typeof e?e:r(e),o=new Blob([s]).size;if(o>n){const e=s.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=c(JSON.parse(s),n);return{content:JSON.stringify(e),size:o,truncated:!0}}catch{}return{content:s.substring(0,n)+"... [truncated]",size:o,truncated:!0}}return{content:s,size:o,truncated:!1}}function d(e,t,r="info"){return{id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:Date.now(),type:e,data:t,severity:r}}function h(e,t){if(!t.maskSensitiveData)return e;const r={...e,data:{...e.data}};switch(e.type){case"network":r.data.requestHeaders&&(r.data.requestHeaders=o(r.data.requestHeaders,t.redactHeaders)),r.data.responseHeaders&&(r.data.responseHeaders=o(r.data.responseHeaders,t.redactHeaders)),r.data.requestBody&&(r.data.requestBody=n(r.data.requestBody)),r.data.responseBody&&(r.data.responseBody=n(r.data.responseBody));break;case"console":r.data.args&&Array.isArray(r.data.args)&&(r.data.args=function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r+1];"string"==typeof o&&s.test(o.trim())&&void 0!==i?(t.push(o),t.push("[REDACTED]"),r++):void 0!==o&&t.push(n(o))}return t}(r.data.args));break;case"websocket":case"sse":r.data.message&&(r.data.message=n(r.data.message));break;case"storage":r.data.value&&(r.data.value=n(r.data.value)),r.data.oldValue&&(r.data.oldValue=n(r.data.oldValue));break;case"interaction":r.data.value&&(r.data.value=n(r.data.value)),r.data.element?.text&&(r.data.element.text=n(r.data.element.text))}return r}let p=null;const f=new Map,m=new Map;const g={name:"console",install(e,t){if(!i())return;if(p)return;const n=["log","info","warn","error","debug"],s=t.logLevels||n;p={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug,time:console.time,timeEnd:console.timeEnd,timeLog:console.timeLog,trace:console.trace,table:console.table,count:console.count,countReset:console.countReset,assert:console.assert},n.forEach(t=>{console[t]=function(...n){if(p[t].apply(console,n),!s.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"))}(n))return;const o=n.map(e=>r(e));let i;i="error"===t?"error":"warn"===t?"warn":"info";const a=d("console",{level:t,args:o,stackTrace:"error"===t?(new Error).stack:void 0},i);e(a)}}),console.time=function(e="default"){p.time.call(console,e),f.set(e,performance.now())},console.timeLog=function(t="default",...n){p.timeLog.apply(console,[t,...n]);const s=f.get(t);if(void 0===s)return;const o=performance.now()-s,i=n.map(e=>r(e)),a=d("console",{level:"timeLog",args:[`${t}: ${o.toFixed(3)}ms`,...i],timerLabel:t,duration:o},"info");e(a)},console.timeEnd=function(t="default"){p.timeEnd.call(console,t);const r=f.get(t);if(void 0===r)return;const n=performance.now()-r;f.delete(t);const s=d("console",{level:"timeEnd",args:[`${t}: ${n.toFixed(3)}ms`],timerLabel:t,duration:n},"info");e(s)},console.trace=function(...t){p.trace.apply(console,t);const n=t.map(e=>r(e)),s=(new Error).stack||"",o=d("console",{level:"trace",args:n.length>0?n:["Trace"],stackTrace:s},"info");e(o)},console.table=function(t,n){p.table.call(console,t,n);const s=d("console",{level:"table",args:[r(t)],columns:n},"info");e(s)},console.count=function(t="default"){p.count.call(console,t);const r=(m.get(t)||0)+1;m.set(t,r);const n=d("console",{level:"count",args:[`${t}: ${r}`],counterLabel:t,count:r},"info");e(n)},console.countReset=function(t="default"){p.countReset.call(console,t),m.set(t,0);const r=d("console",{level:"countReset",args:[`${t}: 0`],counterLabel:t},"info");e(r)},console.assert=function(t,...n){if(p.assert.apply(console,[t,...n]),!t){const t=d("console",{level:"assert",args:["Assertion failed:",...n.map(e=>r(e))],stackTrace:(new Error).stack},"warn");e(t)}}},uninstall(){i()&&p&&(console.log=p.log,console.info=p.info,console.warn=p.warn,console.error=p.error,console.debug=p.debug,console.time=p.time,console.timeEnd=p.timeEnd,console.timeLog=p.timeLog,console.trace=p.trace,console.table=p.table,console.count=p.count,console.countReset=p.countReset,console.assert=p.assert,f.clear(),m.clear(),p=null)}};let y=10240,w=null,b=null,S=[],v=null;const C=new Map;function I(e){const t=Date.now();let r=C.get(e);r||(r={lastCapture:0},C.set(e,r));return t-r.lastCapture>=100&&(r.lastCapture=t,!0)}const k={name:"network",install(e,t,n,s){if(!i())return;if(w)return;v=e,S=t.excludeUrls||[];const o=t.blockNetworkBodies||[];y=s?.maxNetworkBodySize?1024*s.maxNetworkBodySize:10240,w=window.fetch,window.fetch=async function(...t){const n=performance.now(),s=t[0],i="string"==typeof s?s:s instanceof Request?s.url:s.toString(),c=t[1]||{},h=c.method||(s instanceof Request?s.method:"GET"),p=l();if(a(i,S))return w(...t);const f=o.some(e=>{try{return new RegExp(e,"i").test(i)}catch{return!1}});let m,g={};if(s instanceof Request&&(g=Object.fromEntries(s.headers.entries())),c.headers){const e=Object.fromEntries(new Headers(c.headers).entries());g={...g,...e}}if(!f&&c.body){const e=r(c.body);m=e.length>y?e.substring(0,y)+"...":e}try{const r=await w(...t),s=performance.now()-n,o=r.headers.get("content-type")||"unknown",a=r.headers.get("content-length"),l=r.clone();let c,b,S;try{if(!f&&(o.includes("application/json")||o.includes("text/plain")||o.includes("text/html")||o.includes("text/x-component"))){const e=await l.text();c=e.length>y?e.substring(0,y)+"...":e,b=new Blob([c]).size}else a&&(b=parseInt(a,10))}catch{}S=r.status>=500?"error":r.status>=400?"warn":"info";const k=o.includes("text/event-stream"),x=d("network",{method:h,url:i,statusCode:r.status,requestHeaders:g,responseHeaders:Object.fromEntries(r.headers.entries()),requestBody:m,responseBody:k?void 0:c,contentType:o,contentLength:b,duration:s,timestamp:Date.now(),initiator:p,isSSEStream:k},S);if(e(x),k&&r.body&&v){const t=d("sse",{url:i,event:"open",timestamp:Date.now()});return e(t),function(e,t,r){if(!e.body)return e;const n=e.body.getReader(),s=new TextDecoder;let o="",i={data:[]};const a=new ReadableStream({async start(e){try{for(;;){const{done:a,value:l}=await n.read();if(a){e.close(),C.delete(t);break}e.enqueue(l),o+=s.decode(l,{stream:!0});const c=o.split("\n");o=c.pop()||"";for(const e of c){if(""===e.trim()){if(i.data.length>0&&I(t)){const e=i.data.join("\n"),{content:n,size:s}=u(e,!1),o=d("sse",{url:t,event:"message",eventType:i.event||"message",message:n,messageSize:s,lastEventId:i.id,timestamp:Date.now()});r(o)}i={data:[]};continue}const n=e.indexOf(":");if(-1===n)continue;const s=e.slice(0,n),o=e.slice(n+1).trimStart();switch(s){case"data":i.data.push(o);break;case"event":i.event=o;break;case"id":i.id=o}}}}catch(a){e.error(a),C.delete(t)}},cancel(){n.cancel(),C.delete(t)}});return new Response(a,{headers:e.headers,status:e.status,statusText:e.statusText})}(r,i,v)}return r}catch(b){const t=performance.now()-n;let r="Unknown error";if(b instanceof TypeError){r=b.message;try{new URL(i,window.location.href).origin!==window.location.origin&&(r=`${r} - CORS policy may be blocking this request`)}catch{}}else b instanceof Error&&(r=b.message);const s=d("network",{method:h,url:i,statusCode:0,requestHeaders:g,responseHeaders:{},requestBody:m,duration:t,timestamp:Date.now(),initiator:p,error:r},"error");throw e(s),b}},b=window.XMLHttpRequest,window.XMLHttpRequest=function(){const t=new b,n=performance.now(),s=l();let o,i="",c="";const u={},h=t.open;t.open=function(e,t,...r){return i=e,c=t,h.apply(this,[e,t,...r])};const p=t.setRequestHeader;t.setRequestHeader=function(e,t){return u[e]=t,p.apply(this,[e,t])};const f=t.send;let m;return t.send=function(e){if(e&&!a(c,S)){const t=r(e);o=t.length>y?t.substring(0,y)+"...":t}return f.apply(this,[e])},t.addEventListener("error",()=>{m="Network request failed"}),t.addEventListener("timeout",()=>{m="Request timeout"}),t.addEventListener("abort",()=>{m="Request aborted"}),t.addEventListener("loadend",()=>{if(a(c,S))return;const l=performance.now()-n,h=t.getResponseHeader("content-type")||"unknown",p=t.getResponseHeader("content-length"),f={},g=t.getAllResponseHeaders();let w,b,v;if(g&&g.split("\r\n").forEach(e=>{const t=e.split(": "),r=t.shift(),n=t.join(": ");r&&n&&(f[r.toLowerCase()]=n)}),h.includes("application/json")||h.includes("text/plain")||h.includes("text/html")||h.includes("text/x-component"))try{let e;e=""===t.responseType||"text"===t.responseType?t.responseText:"json"===t.responseType&&t.response?r(t.response):"",e&&(w=e.length>y?e.substring(0,y)+"...":e,b=new Blob([w]).size)}catch{}else p&&(b=parseInt(p,10));v=t.status>=500||m?"error":t.status>=400?"warn":"info";const C=d("network",{method:i,url:c,statusCode:t.status,requestHeaders:u,responseHeaders:f,requestBody:o,responseBody:w,contentType:h,contentLength:b,duration:l,timestamp:Date.now(),initiator:s,...m&&{error:m}},v);e(C)}),t},window.XMLHttpRequest.prototype=b.prototype},uninstall(){i()&&(w&&(window.fetch=w,w=null),b&&(window.XMLHttpRequest=b,b=null),v=null,C.clear())}};let x=null,E=null;const O={name:"errors",install(e,t){i()&&(x||(x=t=>{const r=d("error",{message:t.message,stack:`${t.filename}:${t.lineno}:${t.colno}`,context:{},isUncaught:!0},"error");e(r)},window.addEventListener("error",x,!0),E=t=>{let n;n=t.reason instanceof Error?t.reason.message||t.reason.toString():"string"==typeof t.reason?t.reason:t.reason&&"object"==typeof t.reason&&t.reason.message||r(t.reason);const s=d("error",{message:`Unhandled Promise Rejection: ${n}`,stack:t.reason?.stack||"",context:{},isUncaught:!0},"error");e(s)},window.addEventListener("unhandledrejection",E)))},uninstall(){i()&&(x&&(window.removeEventListener("error",x,!0),x=null),E&&(window.removeEventListener("unhandledrejection",E),E=null))}};let A=null,M=[],R=10240;const L=new Map;function T(e,t){const r=Date.now();let n=L.get(e);n||(n={sent:{lastCapture:0,messageCount:0,sampleRate:1},received:{lastCapture:0,messageCount:0,sampleRate:1}},L.set(e,n));const s=n[t],o=r-s.lastCapture;if(s.lastCapture>0&&r-s.lastCapture<1e3){s.messageCount++;const e=s.messageCount/((r-s.lastCapture)/1e3);s.sampleRate=e>50?.1:e>10?.5:1}else s.messageCount=1,s.sampleRate=1;const i=o>=100&&(s.sampleRate>=1||Math.random()<s.sampleRate);return i&&(s.lastCapture=r),i}let N;const D={name:"websocket",install(e,t,r,n){if(!i())return;if(A)return;M=t.excludeUrls||[],N=r,R=n?.maxNetworkBodySize?1024*n.maxNetworkBodySize:10240,A=window.WebSocket,window.WebSocket=function(t,r){const n=new A(t,r),s=t.toString();if(a(s,M))return n;n.addEventListener("open",()=>{const t=d("websocket",{url:s,event:"open",readyState:n.readyState,timestamp:Date.now()});e(t)}),n.addEventListener("message",t=>{if(N?.(),!T(n,"received"))return;const r=t.data instanceof ArrayBuffer||t.data instanceof Blob,{content:o,size:i}=u(t.data,r,R),a=d("websocket",{url:s,event:"message",direction:"received",message:o,messageSize:i,isBinary:r,readyState:n.readyState,timestamp:Date.now()});e(a)});const o=n.send.bind(n);return n.send=function(t){if(N?.(),T(n,"sent")){const r=t instanceof ArrayBuffer||t instanceof Blob,{content:o,size:i}=u(t,r,R),a=d("websocket",{url:s,event:"message",direction:"sent",message:o,messageSize:i,isBinary:r,readyState:n.readyState,timestamp:Date.now()});e(a)}return o(t)},n.addEventListener("error",()=>{const t=d("websocket",{url:s,event:"error",readyState:n.readyState,timestamp:Date.now()},"error");e(t)}),n.addEventListener("close",t=>{const r=d("websocket",{url:s,event:"close",code:t.code,reason:t.reason,readyState:n.readyState,timestamp:Date.now()});e(r),L.delete(n)}),n},window.WebSocket.prototype=A.prototype,Object.setPrototypeOf(window.WebSocket,A);["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(e=>{Object.defineProperty(window.WebSocket,e,{value:A[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){i()&&A&&(window.WebSocket=A,A=null,L.clear())}};let P=null,F=[],_=10240;const B=new Map;let z;const U={name:"sse",install(e,t,r,n){if(!i())return;if(!window.EventSource)return;if(P)return;F=t.excludeUrls||[],z=r,_=n?.maxNetworkBodySize?1024*n.maxNetworkBodySize:10240,P=window.EventSource,window.EventSource=function(t,r){const n=new P(t,r),s=t.toString();return a(s,F)||(n.addEventListener("open",()=>{const t=d("sse",{url:s,event:"open",readyState:n.readyState,timestamp:Date.now()});e(t)}),n.addEventListener("message",t=>{if(z?.(),!function(e){const t=Date.now();let r=B.get(e);return r||(r={lastCapture:0},B.set(e,r)),t-r.lastCapture>=100&&(r.lastCapture=t,!0)}(n))return;const{content:r,size:o}=u(t.data,!1,_),i=d("sse",{url:s,event:"message",message:r,messageSize:o,lastEventId:t.lastEventId,readyState:n.readyState,timestamp:Date.now()});e(i)}),n.addEventListener("error",()=>{const t=d("sse",{url:s,event:"error",readyState:n.readyState,timestamp:Date.now()},"error");e(t),n.readyState===EventSource.CLOSED&&B.delete(n)})),n},window.EventSource.prototype=P.prototype,Object.setPrototypeOf(window.EventSource,P);["CONNECTING","OPEN","CLOSED"].forEach(e=>{Object.defineProperty(window.EventSource,e,{value:P[e],writable:!1,enumerable:!0,configurable:!0})})},uninstall(){i()&&P&&(window.EventSource=P,P=null,B.clear())}},j=5e3;let W=null,$=null,V=!1,G=null;function Z(e){const t="string"==typeof e?e:r(e),n=new Blob([t]).size;if(n>j){const e=t.trim();if(e.startsWith("{")&&e.includes("}")||e.startsWith("[")&&e.includes("]"))try{const e=c(JSON.parse(t),j);return{content:JSON.stringify(e),size:n}}catch{}return{content:t.substring(0,j)+"... [truncated]",size:n}}return{content:t,size:n}}const J={name:"storage",install(e,t){i()&&(W||(G=e,W={getItem:Storage.prototype.getItem,setItem:Storage.prototype.setItem,removeItem:Storage.prototype.removeItem,clear:Storage.prototype.clear},Storage.prototype.getItem=function(t){const r=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.getItem.call(this,t);const n=W.getItem.call(this,t);try{V=!0;const s=d("storage",{storageType:r?"sessionStorage":"localStorage",operation:"getItem",key:t,value:n?Z(n).content:null,valueSize:n?new Blob([n]).size:0});e(s)}finally{V=!1}return n},Storage.prototype.setItem=function(t,r){const n=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.setItem.call(this,t,r);const s=this.getItem(t),o=W.setItem.call(this,t,r);try{V=!0;const o=n?"sessionStorage":"localStorage",{content:i,size:a}=Z(r),l=d("storage",{storageType:o,operation:"setItem",key:t,value:i,oldValue:s?Z(s).content:void 0,valueSize:a});e(l)}finally{V=!1}return o},Storage.prototype.removeItem=function(t){const r=this===sessionStorage;if(V||t.startsWith("__logspace"))return W.removeItem.call(this,t);const n=this.getItem(t),s=W.removeItem.call(this,t);V=!0;try{const s=d("storage",{storageType:r?"sessionStorage":"localStorage",operation:"removeItem",key:t,oldValue:n?Z(n).content:void 0});e(s)}finally{V=!1}return s},Storage.prototype.clear=function(){const t=this===sessionStorage,r=W.clear.call(this);if(V)return r;V=!0;try{const r=d("storage",{storageType:t?"sessionStorage":"localStorage",operation:"clear"});e(r)}finally{V=!1}return r},window.IDBDatabase&&($=IDBDatabase.prototype.transaction,IDBDatabase.prototype.transaction=function(e,t,...r){const n=$.call(this,e,t,...r),s=this.name;if("logspace-sdk-db"===s)return n;if(G&&!V){const r=d("storage",{storageType:"indexedDB",operation:"readwrite"===t?"setItem":"getItem",dbName:s,storeName:Array.isArray(e)?e.join(", "):e});G(r)}return n})))},uninstall(){i()&&(W&&(Storage.prototype.getItem=W.getItem,Storage.prototype.setItem=W.setItem,Storage.prototype.removeItem=W.removeItem,Storage.prototype.clear=W.clear,W=null),$&&window.IDBDatabase&&(IDBDatabase.prototype.transaction=$,$=null),G=null)}};let Y,H=null,X=null,K=null,q=null;const Q={name:"interactions",install(e,r){if(!i())return;if(H)return;const s=r.maskSelectors||[];function o(e){return 0!==s.length&&s.some(t=>{try{return e.matches(t)||e.closest(t)}catch{return!1}})}H=s=>{const i=s.target;if(!i)return;let a=i.textContent?.substring(0,100);r.maskSensitiveData&&a&&(a=n(a)),o(i)&&(a="[MASKED]");const l=d("interaction",{eventType:"click",element:{selector:t(i),tagName:i.tagName,text:a},coordinates:{x:s.clientX,y:s.clientY}});e(l)},document.addEventListener("click",H,!0),X=s=>{const i=s.target;if(!i||"INPUT"!==i.tagName&&"TEXTAREA"!==i.tagName)return;const a="password"===i.type||i.name?.toLowerCase().includes("password")||i.name?.toLowerCase().includes("credit")||i.name?.toLowerCase().includes("ssn")||i.autocomplete?.includes("current-password")||i.autocomplete?.includes("new-password")||o(i);let l=i.value;r.maskSensitiveData&&(l=a?"[SENSITIVE_INPUT_REDACTED]":n(l));const c=d("interaction",{eventType:"input",element:{selector:t(i),tagName:i.tagName},value:l});e(c)},document.addEventListener("input",X,!0),K=r=>{const n=r.target;if(!n)return;const s=d("interaction",{eventType:"submit",element:{selector:t(n),tagName:n.tagName}});e(s)},document.addEventListener("submit",K,!0),q=()=>{clearTimeout(Y),Y=setTimeout(()=>{const t=d("interaction",{eventType:"scroll",element:{selector:"document",tagName:"document"},coordinates:{x:window.scrollX,y:window.scrollY}});e(t)},500)},document.addEventListener("scroll",q,!0)},uninstall(){i()&&(H&&(document.removeEventListener("click",H,!0),H=null),X&&(document.removeEventListener("input",X,!0),X=null),K&&(document.removeEventListener("submit",K,!0),K=null),q&&(document.removeEventListener("scroll",q,!0),q=null),Y&&clearTimeout(Y))}};let ee=null,te=null,re=null,ne=null,se=null,oe=null,ie=null,ae=null,le=null;const ce={lcp:null,fid:null,cls:0,fcp:null,ttfb:null,inp:null,clsEntries:[],sent:!1};let ue=null;function de(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 he(){if(ce.sent||!ue)return;if(!(null!==ce.lcp||null!==ce.fcp||null!==ce.ttfb||null!==ce.fid||null!==ce.inp||ce.cls>0))return;ce.sent=!0;const e={};null!==ce.lcp&&(e.LCP={value:ce.lcp,rating:de("LCP",ce.lcp)}),null!==ce.fid&&(e.FID={value:ce.fid,rating:de("FID",ce.fid)}),ce.cls>0&&(e.CLS={value:ce.cls,rating:de("CLS",ce.cls)}),null!==ce.fcp&&(e.FCP={value:ce.fcp,rating:de("FCP",ce.fcp)}),null!==ce.ttfb&&(e.TTFB={value:ce.ttfb,rating:de("TTFB",ce.ttfb)}),null!==ce.inp&&(e.INP={value:ce.inp,rating:de("INP",ce.inp)});const t=d("performance",{metric:"Web Vitals",vitals:e});ue(t)}const pe={name:"performance",install(e,t){if(i()&&"PerformanceObserver"in window&&!ee){ue=e;try{ee=new PerformanceObserver(e=>{const t=e.getEntries(),r=t[t.length-1];ce.lcp=r.renderTime||r.loadTime}),ee.observe({type:"largest-contentful-paint",buffered:!0}),te=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{null===ce.fid&&(ce.fid=e.processingStart-e.startTime)})}),te.observe({type:"first-input",buffered:!0}),re=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{ce.clsEntries.push(e),ce.cls=function(e){let t=0,r=[];return e.forEach(e=>{if(!e.hadRecentInput){const n=r[0],s=r[r.length-1];t&&s&&e.startTime-s.startTime<1e3&&e.startTime-n.startTime<5e3?(t+=e.value,r.push(e)):(t=e.value,r=[e])}}),t}(ce.clsEntries)})}),re.observe({type:"layout-shift",buffered:!0}),ne=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"first-contentful-paint"===e.name&&(ce.fcp=e.startTime)})}),ne.observe({type:"paint",buffered:!0});try{se=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{const t=e.processingEnd-e.startTime;(null===ce.inp||t>ce.inp)&&(ce.inp=t)})}),se.observe({type:"event",buffered:!0,durationThreshold:16})}catch{}oe=()=>{"hidden"===document.visibilityState&&he()},window.addEventListener("visibilitychange",oe),ie=()=>{le=setTimeout(()=>{!function(){if(!ue)return;const e=performance.getEntriesByType("navigation");if(0===e.length)return;const t=e[0];ce.ttfb=t.responseStart-t.requestStart;const r=d("performance",{metric:"Navigation",timing:{ttfb:Math.round(ce.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)}});ue(r)}()},0)},window.addEventListener("load",ie),ae=setTimeout(()=>{he()},1e4)}catch{}}},uninstall(){i()&&([ee,te,re,ne,se].forEach(e=>{e&&e.disconnect()}),oe&&(window.removeEventListener("visibilitychange",oe),oe=null),ie&&(window.removeEventListener("load",ie),ie=null),ae&&(clearTimeout(ae),ae=null),le&&(clearTimeout(le),le=null),ee=null,te=null,re=null,ne=null,se=null,ue=null,ce.lcp=null,ce.fid=null,ce.cls=0,ce.fcp=null,ce.ttfb=null,ce.inp=null,ce.clsEntries=[],ce.sent=!1)}};let fe=null,me=[];const ge=new Set;let ye=null;const we=new Map;function be(){if(i())try{for(const e of Array.from(document.styleSheets))try{if(!e.cssRules)continue;for(const t of Array.from(e.cssRules))if(t instanceof CSSFontFaceRule){const r=t.style.getPropertyValue("font-family").replace(/["']/g,"").trim(),n=t.style.getPropertyValue("src");if(r&&n){const t=n.matchAll(/url\(["']?([^"')]+)["']?\)/g);for(const n of t)if(n[1])try{const t=new URL(n[1],e.href||window.location.href).href;we.set(t,r),we.set(n[1],r)}catch{we.set(n[1],r)}}}}catch{}}catch{}}function Se(e){if(!ye)return;if("resource"!==e.entryType)return;if("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)return;const t=`${e.name}-${e.startTime}`;if(ge.has(t))return;if(ge.add(t),a(e.name,me))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),n=e.duration,s=e.transferSize||0,o=e.decodedBodySize||0,i=e.encodedBodySize||0,l=0===s||i>0&&s<i;let c="info";n>3e3?c="error":n>1e3&&(c="warn");const u="font"===r?function(e){if(we.has(e))return we.get(e);try{const t=new URL(e).pathname.split("/").pop();if(t)for(const[e,r]of we.entries())if(e.endsWith(t)||e.includes(t))return r}catch{}if("fonts"in document)try{const t=e.toLowerCase();for(const e of document.fonts)if("loaded"===e.status){const r=e.family.replace(/["']/g,"");if(t.includes(r.toLowerCase().replace(/\s+/g,"")))return r}}catch{}}(e.name):void 0,h=d("network",{method:"GET",url:e.name,statusCode:200,resourceType:r,initiatorType:e.initiatorType,duration:Math.round(n),transferSize:s,decodedBodySize:o,encodedBodySize:i,cached:l,...u&&{fontFamily:u},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()},c);ye(h)}const ve={name:"resources",install(e,t){if(i()&&"PerformanceObserver"in window&&!fe){ye=e,me=t.excludeUrls||[];try{be();performance.getEntriesByType("resource").forEach(e=>{Se(e)}),fe=new PerformanceObserver(e=>{be();e.getEntries().forEach(e=>{Se(e)})}),fe.observe({type:"resource",buffered:!1})}catch{}}},uninstall(){i()&&(fe&&(fe.disconnect(),fe=null),ye=null)},reset(){ge.clear(),we.clear()}};let Ce=null,Ie=null,ke=null,xe="",Ee=0,Oe=null,Ae=null,Me=null;function Re(e="client-side"){const t=location.href;t!==xe&&function(e,t,r){if(!ke||e===t)return;const n=performance.now()-Ee,s=d("performance",{metric:"SPA Navigation",from:e,to:t,duration:Math.round(n),navigationType:r,timestamp:Date.now()});ke(s),xe=t,Ee=performance.now()}(xe,t,e)}const Le={name:"spa-navigation",install(e,t){if(i()&&!Ce){if(ke=e,xe=location.href,Ee=performance.now(),Ce=history.pushState,Ie=history.replaceState,history.pushState=function(...e){const t=Ce.apply(this,e);return Re("pushState"),t},history.replaceState=function(...e){const t=Ie.apply(this,e);return Re("replaceState"),t},Me=()=>{Re("popstate")},window.addEventListener("popstate",Me),Oe=new MutationObserver(()=>{Ae&&clearTimeout(Ae),Ae=setTimeout(()=>{Re("dom-mutation")},100)}),document.body)Oe.observe(document.body,{childList:!0,subtree:!0});else{const e=new MutationObserver(()=>{document.body&&(Oe.observe(document.body,{childList:!0,subtree:!0}),e.disconnect())});e.observe(document.documentElement,{childList:!0})}window.addEventListener("hashchange",()=>{Ee=performance.now(),Re("hashchange")})}},uninstall(){i()&&(Ce&&(history.pushState=Ce,Ce=null),Ie&&(history.replaceState=Ie,Ie=null),Me&&(window.removeEventListener("popstate",Me),Me=null),Oe&&(Oe.disconnect(),Oe=null),Ae&&(clearTimeout(Ae),Ae=null),ke=null,xe="",Ee=0)}};var Te,Ne=Object.defineProperty,De=(e,t,r)=>((e,t,r)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Pe=Object.defineProperty,Fe=(e,t,r)=>((e,t,r)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),_e=(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))(_e||{});const Be={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ze={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function je(e){if(Ue[e])return Ue[e];const t=globalThis[e],r=t.prototype,n=e in Be?Be[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in ze?ze[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(s&&i&&!globalThis.Zone)return Ue[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?Ue[e]=o:r}catch{return r}}const We={};function $e(e,t,r){var n;const s=`${e}.${String(r)}`;if(We[s])return We[s].call(t);const o=je(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(We[s]=i,i.call(t)):t[r]}const Ve={};function Ge(e,t,r){const n=`${e}.${String(r)}`;if(Ve[n])return Ve[n].bind(t);const s=je(e)[r];return"function"!=typeof s?t[r]:(Ve[n]=s,s.bind(t))}const Ze={childNodes:function(e){return $e("Node",e,"childNodes")},parentNode:function(e){return $e("Node",e,"parentNode")},parentElement:function(e){return $e("Node",e,"parentElement")},textContent:function(e){return $e("Node",e,"textContent")},contains:function(e,t){return Ge("Node",e,"contains")(t)},getRootNode:function(e){return Ge("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?$e("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?$e("Element",e,"shadowRoot"):null},querySelector:function(e,t){return $e("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return $e("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return je("MutationObserver").constructor}};function Je(e){return e.nodeType===e.ELEMENT_NODE}function Ye(e){const t=e&&"host"in e&&"mode"in e&&Ze.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Ze.shadowRoot(t)===e)}function He(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Xe(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const s=Array.from(r,e=>Ke(e,n)).join("");return(t=s).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 Ke(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Xe(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?lt(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?lt(r,t):r}}class qe{constructor(){Fe(this,"idNodeMap",new Map),Fe(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 Qe({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"";const a=n&&et(n);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function et(e){return e.toLowerCase()}const tt="__rrweb_original__";function rt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?et(t):null}function nt(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(s){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const st=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ot=/^(?:[a-z+]+:)?\/\//i,it=/^www\..*/i,at=/^(data:)([^,]*),(.*)/i;function lt(e,t){return(e||"").replace(st,(e,r,n,s,o,i)=>{const a=n||o||i,l=r||s||"";if(!a)return e;if(ot.test(a)||it.test(a))return`url(${l}${a}${l})`;if(at.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 ct(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function ut(e,t){return function(e,t){const r=Array.from(t.childNodes),n=[];if(r.length>1&&e&&"string"==typeof e){const t=ct(e);for(let s=1;s<r.length;s++)if(r[s].textContent&&"string"==typeof r[s].textContent){const o=ct(r[s].textContent);for(let r=3;r<o.length;r++){const s=o.substring(0,r);if(2===t.split(s).length){const r=t.indexOf(s);for(let t=r;t<e.length;t++)if(ct(e.substring(0,t)).length===r){n.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return n.push(e),n}(e,t).join("/* rr_split */")}let dt=1;const ht=new RegExp("[^a-z0-9-_:]");function pt(){return dt++}let ft,mt;const gt=/^[^ \t\n\r\u000c]+/,yt=/^[, \t\n\r\u000c]+/;const wt=new WeakMap;function bt(e,t){return t&&""!==t.trim()?vt(e,t):t}function St(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function vt(e,t){let r=wt.get(e);if(r||(r=e.createElement("a"),wt.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ct(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?bt(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(yt),!(r>=t.length);){let o=n(gt);if(","===o.slice(-1))o=bt(e,o.substring(0,o.length-1)),s.push(o);else{let n="";o=bt(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((o+n).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,s.push((o+n).trim());break}"("===e&&(i=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?lt(n,vt(e)):"object"===t&&"data"===r?bt(e,n):n:bt(e,n):n}function It(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function kt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&kt(Ze.parentNode(e),t,r);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!r&&kt(Ze.parentNode(e),t,r)}function xt(e,t,r,n){let s;if(Je(e)){if(s=e,!Ze.childNodes(s).length)return!1}else{if(null===Ze.parentElement(e))return!1;s=Ze.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(kt(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(o){}return!1}function Et(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:h,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,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:_e.Document,childNodes:[],compatMode:e.compatMode}:{type:_e.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:_e.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=!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 n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(n){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=et(e.tagName);return ht.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let S=0;S<y;S++){const t=e.attributes[S];It(m,t.name,t.value)||(g[t.name]=Ct(r,m,et(t.name),t.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Xe(t)),n&&(delete g.rel,delete g.href,g._cssText=n)}if("style"===m&&e.sheet){let t=Xe(e.sheet);t&&(e.childNodes.length>1&&(t=ut(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=Qe({element:e,type:rt(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 n=0;n<e.height;n+=50){const s=t.getImageData,o=tt in s?s[tt]:s;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).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),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){ft||(ft=r.createElement("canvas"),mt=ft.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ft.width=t.naturalWidth,ft.height=t.naturalHeight,mt.drawImage(t,0,0),g.rr_dataURL=ft.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=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?g.crossOrigin=s: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}h||(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||d(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(b){}return{type:_e.Element,tagName:m,attributes:g,childNodes:[],isSVG:St(e)||void 0,needBlock:f,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=Ze.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=Ze.textContent(e),c&&l&&(l=lt(l,vt(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Ze.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:_e.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:_e.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:_e.Comment,textContent:Ze.textContent(e)||"",rootId:y};default:return!1}}function Ot(e){return null==e?"":e.toLowerCase()}function At(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,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=xt(e,i,a,void 0===x)}const O=Et(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!O)return console.warn(e,"not serialized"),null;let A;A=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===_e.Comment)return!0;if(e.type===_e.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"===nt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ot(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ot(e.attributes.name)||"icon"===Ot(e.attributes.rel)||"apple-touch-icon"===Ot(e.attributes.rel)||"shortcut icon"===Ot(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ot(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ot(e.attributes.property).match(/^(og|twitter|fb):/)||Ot(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ot(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ot(e.attributes.name)||"googlebot"===Ot(e.attributes.name)||"bingbot"===Ot(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ot(e.attributes.name)||"generator"===Ot(e.attributes.name)||"framework"===Ot(e.attributes.name)||"publisher"===Ot(e.attributes.name)||"progid"===Ot(e.attributes.name)||Ot(e.attributes.property).match(/^article:/)||Ot(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ot(e.attributes.name)||"yandex-verification"===Ot(e.attributes.name)||"csrf-token"===Ot(e.attributes.name)||"p:domain_verify"===Ot(e.attributes.name)||"verify-v1"===Ot(e.attributes.name)||"verification"===Ot(e.attributes.name)||"shopify-checkout-api-token"===Ot(e.attributes.name)))return!0}}return!1}(O,p)||!E&&O.type===_e.Text&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:pt();const M=Object.assign(O,{id:A});if(n.add(e,M),-2===A)return null;y&&y(e);let R=!l;if(M.type===_e.Element){R=R&&!M.needBlock,delete M.needBlock;const t=Ze.shadowRoot(e);t&&He(t)&&(M.isShadowHost=!0)}if((M.type===_e.Document||M.type===_e.Element)&&R){p.headWhitespace&&M.type===_e.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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===_e.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===_e.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Ze.childNodes(e))){const e=At(r,t);e&&M.childNodes.push(e)}}let I=null;if(Je(e)&&(I=Ze.shadowRoot(e)))for(const e of Array.from(Ze.childNodes(I))){const r=At(e,t);r&&(He(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const L=Ze.parentNode(e);return L&&Ye(L)&&He(L)&&(M.isShadow=!0),M.type===_e.Element&&"iframe"===M.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,o=!1;try{s=n.document.readyState}catch(a){return}if("complete"!==s){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const i="about:blank";if(n.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=At(t,{doc:t,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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===_e.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===nt(M.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(i){return}if(n)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}(e,()=>{if(S){const t=At(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,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 Rt(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 n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var Lt={exports:{}},Tt=String,Nt=function(){return{isColorSupported:!1,reset:Tt,bold:Tt,dim:Tt,italic:Tt,underline:Tt,inverse:Tt,hidden:Tt,strikethrough:Tt,black:Tt,red:Tt,green:Tt,yellow:Tt,blue:Tt,magenta:Tt,cyan:Tt,white:Tt,gray:Tt,bgBlack:Tt,bgRed:Tt,bgGreen:Tt,bgYellow:Tt,bgBlue:Tt,bgMagenta:Tt,bgCyan:Tt,bgWhite:Tt}};Lt.exports=Nt(),Lt.exports.createColors=Nt;var Dt=Lt.exports;const Pt=Rt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ft=Dt,_t=Pt,Bt=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.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=Ft.isColorSupported),_t&&e&&(t=_t(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ft.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var zt=Bt;Bt.default=Bt;var Ut={};Ut.isClean=Symbol("isClean"),Ut.my=Symbol("my");const jt={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Wt=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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 n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",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 n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||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"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return jt[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 s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=jt[r]),o.rawCache[r]=n,n}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 n=r.parent;if(n&&n!==e&&n.parent&&n.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],n=e.raws[t];return n&&n.value===r?n.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 $t=Wt;Wt.default=Wt;let Vt=$t;function Gt(e,t){new Vt(t).stringify(e)}var Zt=Gt;Gt.default=Gt;let{isClean:Jt,my:Yt}=Ut,Ht=zt,Xt=$t,Kt=Zt;function qt(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>qt(e,r)):("object"===o&&null!==s&&(s=qt(s)),r[n]=s)}return r}let Qt=class{constructor(e={}){this.raws={},this[Jt]=!1,this[Yt]=!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=qt(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:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Ht(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[Jt]){this[Jt]=!1;let e=this;for(;e=e.parent;)e[Jt]=!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 n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let o=0;o<e;o++)"\n"===r[o]?(n=1,s+=1):n+=1;return{column:n,line:s}}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 n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}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 Xt).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 n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);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={},n=null==t;t=t||new Map;let s=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 n=t.get(e.input);null==n&&(n=s,t.set(e.input,s),s++),r[o]={end:e.end,inputId:n,start:e.start}}else r[o]=e}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Kt){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var er=Qt;Qt.default=Qt;let tr=er,rr=class extends tr{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 nr=rr;rr.default=rr;var sr={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:or,SourceMapGenerator:ir}=Pt,{existsSync:ar,readFileSync:lr}=Pt,{dirname:cr,join:ur}=Pt;let dr=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,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=cr(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new or(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()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=cr(e),ar(e))return this.mapFile=e,lr(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 or)return ir.fromSourceMap(t).toString();if(t instanceof ir)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=ur(cr(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 hr=dr;dr.default=dr;let{SourceMapConsumer:pr,SourceMapGenerator:fr}=Pt,{fileURLToPath:mr,pathToFileURL:gr}=Pt,{isAbsolute:yr,resolve:wr}=Pt,{nanoid:br}=sr,Sr=Pt,vr=zt,Cr=hr,Ir=Symbol("fromOffsetCache"),kr=Boolean(pr&&fr),xr=Boolean(wr&&yr),Er=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&&(!xr||/^\w+:\/\//.test(t.from)||yr(t.from)?this.file=t.from:this.file=wr(t.from)),xr&&kr){let e=new Cr(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 "+br(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new vr(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,n.plugin):new vr(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(gr&&(s.input.url=gr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Ir])r=this[Ir];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Ir]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:wr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=yr(a.source)?gr(a.source):new URL(a.source,this.map.consumer().sourceRoot||gr(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!mr)throw new Error("file: protocol is not available in this PostCSS build");l.file=mr(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 Or=Er;Er.default=Er,Sr&&Sr.registerInput&&Sr.registerInput(Er);let{SourceMapConsumer:Ar,SourceMapGenerator:Mr}=Pt,{dirname:Rr,relative:Lr,resolve:Tr,sep:Nr}=Pt,{pathToFileURL:Dr}=Pt,Pr=Or,Fr=Boolean(Ar&&Mr),_r=Boolean(Rr&&Tr&&Lr&&Nr);var Br=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,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)),n=e.root||Rr(e.file);!1===this.mapOpts.sourcesContent?(t=new Ar(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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(),_r&&Fr&&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,n=1,s="<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=n-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=s,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"),n=i.length-t):n+=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=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-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?Rr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Rr(Tr(r,this.mapOpts.annotation)));let n=Lr(r,e);return this.memoizedPaths.set(e,n),n}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 Pr(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 n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,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(Dr){let t=Dr(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;"\\"===Nr&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zr=er,Ur=class extends zr{constructor(e){super(e),this.type="comment"}};var jr=Ur;Ur.default=Ur;let Wr,$r,Vr,Gr,{isClean:Zr,my:Jr}=Ut,Yr=nr,Hr=jr,Xr=er;function Kr(e){return e.map(e=>(e.nodes&&(e.nodes=Kr(e.nodes)),delete e.source,e))}function qr(e){if(e[Zr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)qr(t)}let Qr=class e extends Xr{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,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],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,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let o of s)this.proxyOf.nodes.splice(n+1,0,o);for(let o in this.indexes)r=this.indexes[o],n<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let i of o)this.proxyOf.nodes.splice(n,0,i);for(let i in this.indexes)r=this.indexes[i],n<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Kr(Wr(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 Yr(t)]}else if(t.selector)t=[new $r(t)];else if(t.name)t=[new Vr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Hr(t)]}return t.map(t=>(t[Jr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Zr]&&qr(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(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(s){throw t.addToError(s)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(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,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(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,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(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]}};Qr.registerParse=e=>{Wr=e},Qr.registerRule=e=>{$r=e},Qr.registerAtRule=e=>{Vr=e},Qr.registerRoot=e=>{Gr=e};var en=Qr;Qr.default=Qr,Qr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Vr.prototype):"rule"===e.type?Object.setPrototypeOf(e,$r.prototype):"decl"===e.type?Object.setPrototypeOf(e,Yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Hr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Gr.prototype),e[Jr]=!0,e.nodes&&e.nodes.forEach(e=>{Qr.rebuild(e)})};let tn,rn,nn=en,sn=class extends nn{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tn(new rn,this,e).stringify()}};sn.registerLazyResult=e=>{tn=e},sn.registerProcessor=e=>{rn=e};var on=sn;sn.default=sn;let an={};var ln=function(e){an[e]||(an[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let cn=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 un=cn;cn.default=cn;let dn=un,hn=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 dn(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var pn=hn;hn.default=hn;const fn="'".charCodeAt(0),mn='"'.charCodeAt(0),gn="\\".charCodeAt(0),yn="/".charCodeAt(0),wn="\n".charCodeAt(0),bn=" ".charCodeAt(0),Sn="\f".charCodeAt(0),vn="\t".charCodeAt(0),Cn="\r".charCodeAt(0),In="[".charCodeAt(0),kn="]".charCodeAt(0),xn="(".charCodeAt(0),En=")".charCodeAt(0),On="{".charCodeAt(0),An="}".charCodeAt(0),Mn=";".charCodeAt(0),Rn="*".charCodeAt(0),Ln=":".charCodeAt(0),Tn="@".charCodeAt(0),Nn=/[\t\n\f\r "#'()/;[\\\]{}]/g,Dn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pn=/.[\r\n"'(/\\]/,Fn=/[\da-f]/i;let _n=en,Bn=class extends _n{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 zn=Bn;Bn.default=Bn,_n.registerAtRule(Bn);let Un,jn,Wn=en,$n=class extends Wn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=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 s of n)s.raws.before=t.raws.before;return n}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 Un(new jn,this,e).stringify()}};$n.registerLazyResult=e=>{Un=e},$n.registerProcessor=e=>{jn=e};var Vn=$n;$n.default=$n,Wn.registerRoot($n);let Gn={comma:e=>Gn.split(e,[","],!0),space:e=>Gn.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",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?(""!==s&&n.push(s.trim()),s="",o=!1):s+=u;return(r||""!==s)&&n.push(s.trim()),n}};var Zn=Gn;Gn.default=Gn;let Jn=en,Yn=Zn,Hn=class extends Jn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Yn.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 Xn=Hn;Hn.default=Hn,Jn.registerRule(Hn);let Kn=nr,qn=function(e,t={}){let r,n,s,o,i,a,l,c,u,d,h=e.css.valueOf(),p=t.ignoreErrors,f=h.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=h.charCodeAt(m),r){case wn:case bn:case vn:case Cn:case Sn:n=m;do{n+=1,r=h.charCodeAt(n)}while(r===bn||r===wn||r===vn||r===Cn||r===Sn);d=["space",h.slice(m,n)],m=n-1;break;case In:case kn:case On:case An:case Ln:case Mn:case En:{let e=String.fromCharCode(r);d=[e,e,m];break}case xn:if(c=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===c&&u!==fn&&u!==mn&&u!==bn&&u!==wn&&u!==vn&&u!==Sn&&u!==Cn){n=m;do{if(a=!1,n=h.indexOf(")",n+1),-1===n){if(p||t){n=m;break}w("bracket")}for(l=n;h.charCodeAt(l-1)===gn;)l-=1,a=!a}while(a);d=["brackets",h.slice(m,n+1),m,n],m=n}else n=h.indexOf(")",m+1),o=h.slice(m,n+1),-1===n||Pn.test(o)?d=["(","(",m]:(d=["brackets",o,m,n],m=n);break;case fn:case mn:s=r===fn?"'":'"',n=m;do{if(a=!1,n=h.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}w("string")}for(l=n;h.charCodeAt(l-1)===gn;)l-=1,a=!a}while(a);d=["string",h.slice(m,n+1),m,n],m=n;break;case Tn:Nn.lastIndex=m+1,Nn.test(h),n=0===Nn.lastIndex?h.length-1:Nn.lastIndex-2,d=["at-word",h.slice(m,n+1),m,n],m=n;break;case gn:for(n=m,i=!0;h.charCodeAt(n+1)===gn;)n+=1,i=!i;if(r=h.charCodeAt(n+1),i&&r!==yn&&r!==bn&&r!==wn&&r!==vn&&r!==Cn&&r!==Sn&&(n+=1,Fn.test(h.charAt(n)))){for(;Fn.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===bn&&(n+=1)}d=["word",h.slice(m,n+1),m,n],m=n;break;default:r===yn&&h.charCodeAt(m+1)===Rn?(n=h.indexOf("*/",m+2)+1,0===n&&(p||t?n=h.length:w("comment")),d=["comment",h.slice(m,n+1),m,n],m=n):(Dn.lastIndex=m+1,Dn.test(h),n=0===Dn.lastIndex?h.length-1:Dn.lastIndex-2,d=["word",h.slice(m,n+1),m,n],g.push(d),m=n)}return m++,d},position:function(){return m}}},Qn=jr,es=zn,ts=Vn,rs=Xn;const ns={empty:!0,space:!0};let ss=en,os=class{constructor(e){this.input=e,this.root=new ts,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,n,s=new es;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,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){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Qn;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=qn(this.input)}decl(e,t){let r=new Kn;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(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(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[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(n=e[a],"!important"===n[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"===n[1].toLowerCase()){let t=e.slice(0),n="";for(let e=a;e>0;e--){let r=t[e][0];if(0===n.trim().indexOf("!")&&"space"!==r)break;n=t.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=t)}if("space"!==n[0]&&"comment"!==n[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 rs;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,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)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&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){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,n){let s,o,i,a,l=r.length,c="",u=!0;for(let d=0;d<l;d+=1)s=r[d],o=s[0],"space"!==o||d!==l-1||n?"comment"===o?(a=r[d-1]?r[d-1][0]:"empty",i=r[d+1]?r[d+1][0]:"empty",ns[a]||ns[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new rs;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 n=t;n<e.length;n++)r+=e[n][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})}},is=Or;function as(e,t){let r=new is(e,t),n=new os(r);try{n.parse()}catch(s){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===s.name&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?s.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(s.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),s}return n.root}var ls=as;as.default=as,ss.registerParse(as);let{isClean:cs,my:us}=Ut,ds=Br,hs=Zt,ps=en,fs=on,ms=ln,gs=pn,ys=ls,ws=Vn;const bs={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ss={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},vs={Once:!0,postcssPlugin:!0,prepare:!0};function Cs(e){return"object"==typeof e&&"function"==typeof e.then}function Is(e){let t=!1,r=bs[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 ks(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Is(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function xs(e){return e[cs]=!1,e.nodes&&e.nodes.forEach(e=>xs(e)),e}let Es={},Os=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof gs)s=xs(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=ys;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(o){this.processed=!0,this.error=o}s&&!s[us]&&ps.rebuild(s)}else s=xs(r);this.result=new gs(t,s,n),this.helpers={...Es,postcss:Es,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,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(n){console&&console.error&&console.error(n)}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(!Ss[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!vs[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);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],n=this.runOnRoot(t);if(Cs(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cs];){e[cs]=!0;let r=[ks(e)];for(;r.length>0;){let e=this.visitTick(r);if(Cs(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,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 Cs(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=hs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ds(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(Cs(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cs];)e[cs]=!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||ms("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[n,s]of e){let e;this.result.lastPlugin=n;try{e=s(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Cs(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[cs])return n[cs]=!0,void e.push(ks(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[cs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[cs]=!0;let t=Is(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[cs]||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"}};Os.registerPostcss=e=>{Es=e};var As=Os;Os.default=Os,ws.registerLazyResult(Os),fs.registerLazyResult(Os);let Ms=Br,Rs=Zt,Ls=ln,Ts=ls;const Ns=pn;let Ds=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Rs;this.result=new Ns(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ms(s,n,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||Ls("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=Ts;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 Ps=Ds;Ds.default=Ds;let Fs=Ps,_s=As,Bs=on,zs=Vn,Us=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 _s(this,e,t):new Fs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var js=Us;Us.default=Us,zs.registerProcessor(Us),Bs.registerProcessor(Us);let Ws=nr,$s=hr,Vs=jr,Gs=zn,Zs=Or,Js=Vn,Ys=Xn;function Hs(e,t){if(Array.isArray(e))return e.map(e=>Hs(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Zs.prototype};r.map&&(r.map={...r.map,__proto__:$s.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Hs(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Js(n);if("decl"===n.type)return new Ws(n);if("rule"===n.type)return new Ys(n);if("comment"===n.type)return new Vs(n);if("atrule"===n.type)return new Gs(n);throw new Error("Unknown node type: "+e.type)}var Xs=Hs;Hs.default=Hs;let Ks=zt,qs=nr,Qs=As,eo=en,to=js,ro=Zt,no=Xs,so=on,oo=un,io=jr,ao=zn,lo=pn,co=Or,uo=ls,ho=Zn,po=Xn,fo=Vn,mo=er;function go(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new to(e)}go.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new to).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return go([s(r)]).process(e,t)},s},go.stringify=ro,go.parse=uo,go.fromJSON=no,go.list=ho,go.comment=e=>new io(e),go.atRule=e=>new ao(e),go.decl=e=>new qs(e),go.rule=e=>new po(e),go.root=e=>new fo(e),go.document=e=>new so(e),go.CssSyntaxError=Ks,go.Declaration=qs,go.Container=eo,go.Processor=to,go.Document=so,go.Comment=io,go.Warning=oo,go.AtRule=ao,go.Result=lo,go.Input=co,go.Rule=po,go.Root=fo,go.Node=mo,Qs.registerPostcss(go);var yo=go;go.default=go;const wo=Mt(yo);wo.stringify,wo.fromJSON,wo.plugin,wo.parse,wo.list,wo.document,wo.comment,wo.atRule,wo.rule,wo.decl,wo.root,wo.CssSyntaxError,wo.Declaration,wo.Container,wo.Processor,wo.Document,wo.Comment,wo.Warning,wo.AtRule,wo.Result,wo.Input,wo.Rule,wo.Root,wo.Node;var bo=Object.defineProperty,So=(e,t,r)=>((e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Co(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 n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var Io={exports:{}},ko=String,xo=function(){return{isColorSupported:!1,reset:ko,bold:ko,dim:ko,italic:ko,underline:ko,inverse:ko,hidden:ko,strikethrough:ko,black:ko,red:ko,green:ko,yellow:ko,blue:ko,magenta:ko,cyan:ko,white:ko,gray:ko,bgBlack:ko,bgRed:ko,bgGreen:ko,bgYellow:ko,bgBlue:ko,bgMagenta:ko,bgCyan:ko,bgWhite:ko}};Io.exports=xo(),Io.exports.createColors=xo;var Eo=Io.exports;const Oo=Co(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ao=Eo,Mo=Oo,Ro=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.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=Ao.isColorSupported),Mo&&e&&(t=Mo(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=Ao.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Lo=Ro;Ro.default=Ro;var To={};To.isClean=Symbol("isClean"),To.my=Symbol("my");const No={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Do=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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 n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",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 n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||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"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return No[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 s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=No[r]),o.rawCache[r]=n,n}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 n=r.parent;if(n&&n!==e&&n.parent&&n.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],n=e.raws[t];return n&&n.value===r?n.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 Po=Do;Do.default=Do;let Fo=Po;function _o(e,t){new Fo(t).stringify(e)}var Bo=_o;_o.default=_o;let{isClean:zo,my:Uo}=To,jo=Lo,Wo=Po,$o=Bo;function Vo(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Vo(e,r)):("object"===o&&null!==s&&(s=Vo(s)),r[n]=s)}return r}let Go=class{constructor(e={}){this.raws={},this[zo]=!1,this[Uo]=!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=Vo(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:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new jo(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[zo]){this[zo]=!1;let e=this;for(;e=e.parent;)e[zo]=!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 n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let o=0;o<e;o++)"\n"===r[o]?(n=1,s+=1):n+=1;return{column:n,line:s}}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 n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}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 Wo).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 n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);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={},n=null==t;t=t||new Map;let s=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 n=t.get(e.input);null==n&&(n=s,t.set(e.input,s),s++),r[o]={end:e.end,inputId:n,start:e.start}}else r[o]=e}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=$o){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Zo=Go;Go.default=Go;let Jo=Zo,Yo=class extends Jo{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 Ho=Yo;Yo.default=Yo;var Xo={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Ko,SourceMapGenerator:qo}=Oo,{existsSync:Qo,readFileSync:ei}=Oo,{dirname:ti,join:ri}=Oo;let ni=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,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ti(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Ko(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()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ti(e),Qo(e))return this.mapFile=e,ei(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 Ko)return qo.fromSourceMap(t).toString();if(t instanceof qo)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=ri(ti(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 si=ni;ni.default=ni;let{SourceMapConsumer:oi,SourceMapGenerator:ii}=Oo,{fileURLToPath:ai,pathToFileURL:li}=Oo,{isAbsolute:ci,resolve:ui}=Oo,{nanoid:di}=Xo,hi=Oo,pi=Lo,fi=si,mi=Symbol("fromOffsetCache"),gi=Boolean(oi&&ii),yi=Boolean(ui&&ci),wi=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&&(!yi||/^\w+:\/\//.test(t.from)||ci(t.from)?this.file=t.from:this.file=ui(t.from)),yi&&gi){let e=new fi(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 "+di(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new pi(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,n.plugin):new pi(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(li&&(s.input.url=li(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[mi])r=this[mi];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[mi]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ui(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=ci(a.source)?li(a.source):new URL(a.source,this.map.consumer().sourceRoot||li(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ai)throw new Error("file: protocol is not available in this PostCSS build");l.file=ai(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 bi=wi;wi.default=wi,hi&&hi.registerInput&&hi.registerInput(wi);let{SourceMapConsumer:Si,SourceMapGenerator:vi}=Oo,{dirname:Ci,relative:Ii,resolve:ki,sep:xi}=Oo,{pathToFileURL:Ei}=Oo,Oi=bi,Ai=Boolean(Si&&vi),Mi=Boolean(Ci&&ki&&Ii&&xi);var Ri=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,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)),n=e.root||Ci(e.file);!1===this.mapOpts.sourcesContent?(t=new Si(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}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&&Ai&&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=vi.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new vi({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 vi({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<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=n-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=s,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"),n=i.length-t):n+=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=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-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?Ci(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Ci(ki(r,this.mapOpts.annotation)));let n=Ii(r,e);return this.memoizedPaths.set(e,n),n}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 Oi(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 n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,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(Ei){let t=Ei(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;"\\"===xi&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Li=Zo,Ti=class extends Li{constructor(e){super(e),this.type="comment"}};var Ni=Ti;Ti.default=Ti;let Di,Pi,Fi,_i,{isClean:Bi,my:zi}=To,Ui=Ho,ji=Ni,Wi=Zo;function $i(e){return e.map(e=>(e.nodes&&(e.nodes=$i(e.nodes)),delete e.source,e))}function Vi(e){if(e[Bi]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Vi(t)}let Gi=class e extends Wi{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,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],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,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let o of s)this.proxyOf.nodes.splice(n+1,0,o);for(let o in this.indexes)r=this.indexes[o],n<r&&(this.indexes[o]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let i of o)this.proxyOf.nodes.splice(n,0,i);for(let i in this.indexes)r=this.indexes[i],n<=r&&(this.indexes[i]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=$i(Di(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 Ui(t)]}else if(t.selector)t=[new Pi(t)];else if(t.name)t=[new Fi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ji(t)]}return t.map(t=>(t[zi]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Bi]&&Vi(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(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(s){throw t.addToError(s)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(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,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(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,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(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]}};Gi.registerParse=e=>{Di=e},Gi.registerRule=e=>{Pi=e},Gi.registerAtRule=e=>{Fi=e},Gi.registerRoot=e=>{_i=e};var Zi=Gi;Gi.default=Gi,Gi.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Fi.prototype):"rule"===e.type?Object.setPrototypeOf(e,Pi.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ui.prototype):"comment"===e.type?Object.setPrototypeOf(e,ji.prototype):"root"===e.type&&Object.setPrototypeOf(e,_i.prototype),e[zi]=!0,e.nodes&&e.nodes.forEach(e=>{Gi.rebuild(e)})};let Ji,Yi,Hi=Zi,Xi=class extends Hi{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ji(new Yi,this,e).stringify()}};Xi.registerLazyResult=e=>{Ji=e},Xi.registerProcessor=e=>{Yi=e};var Ki=Xi;Xi.default=Xi;let qi={};var Qi=function(e){qi[e]||(qi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ea=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 ta=ea;ea.default=ea;let ra=ta,na=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 ra(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var sa=na;na.default=na;const oa="'".charCodeAt(0),ia='"'.charCodeAt(0),aa="\\".charCodeAt(0),la="/".charCodeAt(0),ca="\n".charCodeAt(0),ua=" ".charCodeAt(0),da="\f".charCodeAt(0),ha="\t".charCodeAt(0),pa="\r".charCodeAt(0),fa="[".charCodeAt(0),ma="]".charCodeAt(0),ga="(".charCodeAt(0),ya=")".charCodeAt(0),wa="{".charCodeAt(0),ba="}".charCodeAt(0),Sa=";".charCodeAt(0),va="*".charCodeAt(0),Ca=":".charCodeAt(0),Ia="@".charCodeAt(0),ka=/[\t\n\f\r "#'()/;[\\\]{}]/g,xa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ea=/.[\r\n"'(/\\]/,Oa=/[\da-f]/i;let Aa=Zi,Ma=class extends Aa{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 Ra=Ma;Ma.default=Ma,Aa.registerAtRule(Ma);let La,Ta,Na=Zi,Da=class extends Na{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=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 s of n)s.raws.before=t.raws.before;return n}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 La(new Ta,this,e).stringify()}};Da.registerLazyResult=e=>{La=e},Da.registerProcessor=e=>{Ta=e};var Pa=Da;Da.default=Da,Na.registerRoot(Da);let Fa={comma:e=>Fa.split(e,[","],!0),space:e=>Fa.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",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?(""!==s&&n.push(s.trim()),s="",o=!1):s+=u;return(r||""!==s)&&n.push(s.trim()),n}};var _a=Fa;Fa.default=Fa;let Ba=Zi,za=_a,Ua=class extends Ba{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return za.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 ja=Ua;Ua.default=Ua,Ba.registerRule(Ua);let Wa=Ho,$a=function(e,t={}){let r,n,s,o,i,a,l,c,u,d,h=e.css.valueOf(),p=t.ignoreErrors,f=h.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=h.charCodeAt(m),r){case ca:case ua:case ha:case pa:case da:n=m;do{n+=1,r=h.charCodeAt(n)}while(r===ua||r===ca||r===ha||r===pa||r===da);d=["space",h.slice(m,n)],m=n-1;break;case fa:case ma:case wa:case ba:case Ca:case Sa:case ya:{let e=String.fromCharCode(r);d=[e,e,m];break}case ga:if(c=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===c&&u!==oa&&u!==ia&&u!==ua&&u!==ca&&u!==ha&&u!==da&&u!==pa){n=m;do{if(a=!1,n=h.indexOf(")",n+1),-1===n){if(p||t){n=m;break}w("bracket")}for(l=n;h.charCodeAt(l-1)===aa;)l-=1,a=!a}while(a);d=["brackets",h.slice(m,n+1),m,n],m=n}else n=h.indexOf(")",m+1),o=h.slice(m,n+1),-1===n||Ea.test(o)?d=["(","(",m]:(d=["brackets",o,m,n],m=n);break;case oa:case ia:s=r===oa?"'":'"',n=m;do{if(a=!1,n=h.indexOf(s,n+1),-1===n){if(p||t){n=m+1;break}w("string")}for(l=n;h.charCodeAt(l-1)===aa;)l-=1,a=!a}while(a);d=["string",h.slice(m,n+1),m,n],m=n;break;case Ia:ka.lastIndex=m+1,ka.test(h),n=0===ka.lastIndex?h.length-1:ka.lastIndex-2,d=["at-word",h.slice(m,n+1),m,n],m=n;break;case aa:for(n=m,i=!0;h.charCodeAt(n+1)===aa;)n+=1,i=!i;if(r=h.charCodeAt(n+1),i&&r!==la&&r!==ua&&r!==ca&&r!==ha&&r!==pa&&r!==da&&(n+=1,Oa.test(h.charAt(n)))){for(;Oa.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===ua&&(n+=1)}d=["word",h.slice(m,n+1),m,n],m=n;break;default:r===la&&h.charCodeAt(m+1)===va?(n=h.indexOf("*/",m+2)+1,0===n&&(p||t?n=h.length:w("comment")),d=["comment",h.slice(m,n+1),m,n],m=n):(xa.lastIndex=m+1,xa.test(h),n=0===xa.lastIndex?h.length-1:xa.lastIndex-2,d=["word",h.slice(m,n+1),m,n],g.push(d),m=n)}return m++,d},position:function(){return m}}},Va=Ni,Ga=Ra,Za=Pa,Ja=ja;const Ya={empty:!0,space:!0};let Ha=Zi,Xa=class{constructor(e){this.input=e,this.root=new Za,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,n,s=new Ga;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,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){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Va;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=$a(this.input)}decl(e,t){let r=new Wa;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(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(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[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(n=e[a],"!important"===n[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"===n[1].toLowerCase()){let t=e.slice(0),n="";for(let e=a;e>0;e--){let r=t[e][0];if(0===n.trim().indexOf("!")&&"space"!==r)break;n=t.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=t)}if("space"!==n[0]&&"comment"!==n[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 Ja;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,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)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&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){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,n){let s,o,i,a,l=r.length,c="",u=!0;for(let d=0;d<l;d+=1)s=r[d],o=s[0],"space"!==o||d!==l-1||n?"comment"===o?(a=r[d-1]?r[d-1][0]:"empty",i=r[d+1]?r[d+1][0]:"empty",Ya[a]||Ya[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Ja;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 n=t;n<e.length;n++)r+=e[n][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})}},Ka=bi;function qa(e,t){let r=new Ka(e,t),n=new Xa(r);try{n.parse()}catch(s){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===s.name&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?s.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(s.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),s}return n.root}var Qa=qa;qa.default=qa,Ha.registerParse(qa);let{isClean:el,my:tl}=To,rl=Ri,nl=Bo,sl=Zi,ol=Ki,il=Qi,al=sa,ll=Qa,cl=Pa;const ul={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},dl={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},hl={Once:!0,postcssPlugin:!0,prepare:!0};function pl(e){return"object"==typeof e&&"function"==typeof e.then}function fl(e){let t=!1,r=ul[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 ml(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:fl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function gl(e){return e[el]=!1,e.nodes&&e.nodes.forEach(e=>gl(e)),e}let yl={},wl=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof al)s=gl(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=ll;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(o){this.processed=!0,this.error=o}s&&!s[tl]&&sl.rebuild(s)}else s=gl(r);this.result=new al(t,s,n),this.helpers={...yl,postcss:yl,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,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(n){console&&console.error&&console.error(n)}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(!dl[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!hl[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);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],n=this.runOnRoot(t);if(pl(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[el];){e[el]=!0;let r=[ml(e)];for(;r.length>0;){let e=this.visitTick(r);if(pl(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,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 pl(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=nl;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new rl(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(pl(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[el];)e[el]=!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||il("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[n,s]of e){let e;this.result.lastPlugin=n;try{e=s(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(pl(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(o){throw this.handleError(o,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[el])return n[el]=!0,void e.push(ml(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[el]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[el]=!0;let t=fl(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[el]||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"}};wl.registerPostcss=e=>{yl=e};var bl=wl;wl.default=wl,cl.registerLazyResult(wl),ol.registerLazyResult(wl);let Sl=Ri,vl=Bo,Cl=Qi,Il=Qa;const kl=sa;let xl=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=vl;this.result=new kl(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Sl(s,n,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||Cl("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=Il;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 El=xl;xl.default=xl;let Ol=El,Al=bl,Ml=Ki,Rl=Pa,Ll=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 Al(this,e,t):new Ol(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Tl=Ll;Ll.default=Ll,Rl.registerProcessor(Ll),Ml.registerProcessor(Ll);let Nl=Ho,Dl=si,Pl=Ni,Fl=Ra,_l=bi,Bl=Pa,zl=ja;function Ul(e,t){if(Array.isArray(e))return e.map(e=>Ul(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:_l.prototype};r.map&&(r.map={...r.map,__proto__:Dl.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Ul(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Bl(n);if("decl"===n.type)return new Nl(n);if("rule"===n.type)return new zl(n);if("comment"===n.type)return new Pl(n);if("atrule"===n.type)return new Fl(n);throw new Error("Unknown node type: "+e.type)}var jl=Ul;Ul.default=Ul;let Wl=Lo,$l=Ho,Vl=bl,Gl=Zi,Zl=Tl,Jl=Bo,Yl=jl,Hl=Ki,Xl=ta,Kl=Ni,ql=Ra,Ql=sa,ec=bi,tc=Qa,rc=_a,nc=ja,sc=Pa,oc=Zo;function ic(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Zl(e)}ic.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Zl).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return ic([s(r)]).process(e,t)},s},ic.stringify=Jl,ic.parse=tc,ic.fromJSON=Yl,ic.list=rc,ic.comment=e=>new Kl(e),ic.atRule=e=>new ql(e),ic.decl=e=>new $l(e),ic.rule=e=>new nc(e),ic.root=e=>new sc(e),ic.document=e=>new Hl(e),ic.CssSyntaxError=Wl,ic.Declaration=$l,ic.Container=Gl,ic.Processor=Zl,ic.Document=Hl,ic.Comment=Kl,ic.Warning=Xl,ic.AtRule=ql,ic.Result=Ql,ic.Input=ec,ic.Rule=nc,ic.Root=sc,ic.Node=oc,Vl.registerPostcss(ic);var ac=ic;ic.default=ic;const lc=vo(ac);lc.stringify,lc.fromJSON,lc.plugin,lc.parse,lc.list,lc.document,lc.comment,lc.atRule,lc.rule,lc.decl,lc.root,lc.CssSyntaxError,lc.Declaration,lc.Container,lc.Processor,lc.Document,lc.Comment,lc.Warning,lc.AtRule,lc.Result,lc.Input,lc.Rule,lc.Root,lc.Node;class cc{constructor(...e){So(this,"parentElement",null),So(this,"parentNode",null),So(this,"ownerDocument"),So(this,"firstChild",null),So(this,"lastChild",null),So(this,"previousSibling",null),So(this,"nextSibling",null),So(this,"ELEMENT_NODE",1),So(this,"TEXT_NODE",3),So(this,"nodeType"),So(this,"nodeName"),So(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 cc))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 uc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hc={};function pc(e){if(hc[e])return hc[e];const t=globalThis[e],r=t.prototype,n=e in uc?uc[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in dc?dc[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(s&&i&&!globalThis.Zone)return hc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?hc[e]=o:r}catch{return r}}const fc={};function mc(e,t,r){var n;const s=`${e}.${String(r)}`;if(fc[s])return fc[s].call(t);const o=pc(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(fc[s]=i,i.call(t)):t[r]}const gc={};function yc(e,t,r){const n=`${e}.${String(r)}`;if(gc[n])return gc[n].bind(t);const s=pc(e)[r];return"function"!=typeof s?t[r]:(gc[n]=s,s.bind(t))}function wc(){return pc("MutationObserver").constructor}const bc={childNodes:function(e){return mc("Node",e,"childNodes")},parentNode:function(e){return mc("Node",e,"parentNode")},parentElement:function(e){return mc("Node",e,"parentElement")},textContent:function(e){return mc("Node",e,"textContent")},contains:function(e,t){return yc("Node",e,"contains")(t)},getRootNode:function(e){return yc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?mc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?mc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return mc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return mc("Element",e,"querySelectorAll")(t)},mutationObserver:wc};function Sc(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const vc="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 Cc={map:{},getId:()=>(console.error(vc),-1),getNode:()=>(console.error(vc),null),removeNodeFromMap(){console.error(vc)},has:()=>(console.error(vc),!1),reset(){console.error(vc)}};function Ic(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function kc(e,t,r,n,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>kc(e,t,o||{},!0)}function xc(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Cc=new Proxy(Cc,{get:(e,t,r)=>("map"===t&&console.error(vc),Reflect.get(e,t,r))}));let Ec=Date.now;function Oc(e){var t,r,n,s;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=bc.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==(n=bc.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}}function Ac(){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 Rc(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:bc.parentElement(e)}function Lc(e,t,r,n){if(!e)return!1;const s=Rc(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(kt(s,t,n))return!0}catch(o){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function Tc(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Nc(e,t){if(Ye(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=bc.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Nc(n,t))}function Dc(e){return Boolean(e.changedTouches)}function Pc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Fc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function _c(e){return!!e&&(e instanceof cc&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(bc.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ec=()=>(new Date).getTime());class Bc{constructor(){De(this,"id",1),De(this,"styleIDMap",new WeakMap),De(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 zc(e){var t;let r=null;return"getRootNode"in e&&(null==(t=bc.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&bc.host(bc.getRootNode(e))&&(r=bc.host(bc.getRootNode(e))),r}function Uc(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=zc(r);)r=t;return r}(e);return bc.contains(t,r)}function jc(e){const t=e.ownerDocument;return!!t&&(bc.contains(t,e)||Uc(e))}var Wc=(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))(Wc||{}),$c=(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))($c||{}),Vc=(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))(Vc||{}),Gc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Gc||{}),Zc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zc||{}),Jc=(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))(Jc||{}),Yc=(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))(Yc||{});function Hc(e){return"__ln"in e}class Xc{constructor(){De(this,"length",0),De(this,"head",null),De(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&&Hc(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&&Hc(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 Kc=(e,t)=>`${e}@${t}`;class qc{constructor(){De(this,"frozen",!1),De(this,"locked",!1),De(this,"texts",[]),De(this,"attributes",[]),De(this,"attributeMap",new WeakMap),De(this,"removes",[]),De(this,"mapRemoves",[]),De(this,"movedMap",{}),De(this,"addedSet",new Set),De(this,"movedSet",new Set),De(this,"droppedSet",new Set),De(this,"removesSubTreeCache",new Set),De(this,"mutationCb"),De(this,"blockClass"),De(this,"blockSelector"),De(this,"maskTextClass"),De(this,"maskTextSelector"),De(this,"inlineStylesheet"),De(this,"maskInputOptions"),De(this,"maskTextFn"),De(this,"maskInputFn"),De(this,"keepIframeSrcFn"),De(this,"recordCanvas"),De(this,"inlineImages"),De(this,"slimDOMOptions"),De(this,"dataURLOptions"),De(this,"doc"),De(this,"mirror"),De(this,"iframeManager"),De(this,"stylesheetManager"),De(this,"shadowDomManager"),De(this,"canvasManager"),De(this,"processedNodeManager"),De(this,"unattachedDoc"),De(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),De(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Xc,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const o=bc.parentNode(s);if(!o||!jc(s))return;let i=!1;if(s.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=Ye(o)?this.mirror.getId(zc(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=At(s,{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=>{Pc(e,this.mirror)&&this.iframeManager.addIframe(e),Fc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),_c(s)&&this.shadowDomManager.addShadowRoot(bc.shadowRoot(s),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)eu(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(bc.parentNode(a))||s(a);for(const a of this.addedSet)tu(this.droppedSet,a)||eu(this.removesSubTreeCache,a,this.mirror)?tu(this.movedSet,a)?s(a):this.droppedSet.add(a):s(a);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(bc.parentNode(o.value)),r=n(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(bc.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=bc.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=bc.host(n);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),s(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=bc.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),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).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))}),De(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(bc.childNodes(e),e=>bc.textContent(e)||"").join("")}),De(this,"processMutation",e=>{if(!Tc(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=bc.textContent(e.target);Lc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:xt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Rc(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const r=e.target;let n=e.attributeName,s=e.target.getAttribute(n);if("value"===n){const e=rt(r);s=Qe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(Lc(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!It(r.tagName,n))if(o.attributes[n]=Ct(this.doc,et(r.tagName),et(n),s),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(r.style)){const t=r.style.getPropertyValue(e),s=r.style.getPropertyPriority(e);t!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===s?t:[t,s]:o._unchangedStyles[e]=[t,s]}for(const e of Array.from(n.style))""===r.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(Lc(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),n=Ye(e.target)?this.mirror.getId(bc.host(e.target)):this.mirror.getId(e.target);Lc(e.target,this.blockClass,this.blockSelector,!1)||Tc(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Qc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Nc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Kc(r,n)]?Qc(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Ye(e.target)||!He(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),bc.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),De(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Tc(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[Kc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Lc(e,this.blockClass,this.blockSelector,!1)||(bc.childNodes(e).forEach(e=>this.genAdds(e)),_c(e)&&bc.childNodes(bc.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 Qc(e,t){e.delete(t),bc.childNodes(t).forEach(t=>Qc(e,t))}function eu(e,t,r){return 0!==e.size&&function(e,t){const r=bc.parentNode(t);return!!r&&e.has(r)}(e,t)}function tu(e,t){return 0!==e.size&&ru(e,t)}function ru(e,t){const r=bc.parentNode(t);return!!r&&(!!e.has(r)||ru(e,r))}let nu;const su=e=>{if(!nu)return e;return(...t)=>{try{return e(...t)}catch(r){if(nu&&!0===nu(r))return;throw r}}},ou=[];function iu(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 au(e,t){const r=new qc;ou.push(r),r.init(e);const n=new(wc())(su(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function lu({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,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(Vc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=et(o);const c=(t=>o=>{const i=iu(o);if(Lc(i,n,s,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Gc.Mouse;break;case"touch":a=Gc.Touch;break;case"pen":a=Gc.Pen}a===Gc.Touch?Vc[t]===Vc.MouseDown?c="TouchStart":Vc[t]===Vc.MouseUp&&(c="TouchEnd"):Gc.Pen}else Dc(o)&&(a=Gc.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Gc.Touch||c.startsWith("Mouse")&&a===Gc.Mouse)&&(a=null)):Vc[t]===Vc.Click&&(a=l,l=null);const u=Dc(o)?o.changedTouches[0]:o;if(!u)return;const d=r.getId(i),{clientX:h,clientY:p}=u;su(e)({type:Vc[c],id:d,x:h,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Vc[o]){case Vc.MouseDown:case Vc.MouseUp:i=i.replace("mouse","pointer");break;case Vc.TouchStart:case Vc.TouchEnd:return}a.push(Sc(i,c,t))}),su(()=>{a.forEach(e=>e())})}function cu({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){return Sc("scroll",su(Ic(su(o=>{const i=iu(o);if(!i||Lc(i,n,s,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Oc(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 uu=["INPUT","TEXTAREA","SELECT"],du=new WeakMap;function hu(e){return function(e,t){if(gu("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gu("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gu("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gu("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 pu(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function fu({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(bc.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(s=r.ownerDocument)?void 0:s.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 n=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(s){}return n}}),su(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function mu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),s(...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),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...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&&(n=au(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Ic(su(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=su(Ic(su(e=>{const t=iu(e),{clientX:r,clientY:s}=Dc(e)?e.changedTouches[0]:e;i||(i=Ec()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ec()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?$c.Drag:e instanceof MouseEvent?$c.MouseMove:$c.TouchMove)}),s,{trailing:!1})),u=[Sc("mousemove",c,r),Sc("touchmove",c,r),Sc("drag",c,r)];return su(()=>{u.forEach(e=>e())})}(e),o=lu(e),i=cu(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Sc("resize",su(Ic(su(()=>{const t=Ac(),s=Mc();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function d(e){let r=iu(e);const c=e.isTrusted,d=r&&r.tagName;if(r&&"OPTION"===d&&(r=bc.parentElement(r)),!r||!d||uu.indexOf(d)<0||Lc(r,n,s,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=rt(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[d.toLowerCase()]||a[m])&&(p=Qe({element:r,maskInputOptions:a,tagName:d,type:m,value:p,maskInputFn:l})),h(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;h(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function h(t,n){const s=du.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){du.set(t,n);const s=r.getId(t);su(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Sc(e,su(d),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=>kc(e[0],e[1],{set(){su(d)({target:this,isTrusted:!1})}},!1,f))),su(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){const i=su(o=>Ic(su(s=>{const i=iu(s);if(!i||Lc(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=i;e({type:o,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}),s.media||500)),a=[Sc("play",i(Jc.Play),o),Sc("pause",i(Jc.Pause),o),Sc("seeked",i(Jc.Seeked),o),Sc("volumechange",i(Jc.VolumeChange),o),Sc("ratechange",i(Jc.RateChange),o)];return su(()=>{a.forEach(e=>e())})}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:su((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=pu(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),n.apply(s,o)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),n.apply(s,o)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),n.apply(s,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),n.apply(s,o)})}));const l={};yu("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(yu("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),yu("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),yu("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:su((n,s,o)=>{const[i,a]=o,{id:l,styleId:c}=pu(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...hu(s),a||0]}]}),n.apply(s,o)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:su((n,s,o)=>{const[i]=o,{id:a,styleId:l}=pu(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...hu(s),i]}]}),n.apply(s,o)})})}),su(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.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}),d=fu(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:su((s,i,a)=>{var l;const[c,u,d]=a;if(r.has(c))return o.apply(i,[c,u,d]);const{id:h,styleId:p}=pu(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:c,value:u,priority:d},index:hu(i.parentRule)}),s.apply(i,a)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:su((s,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:u,styleId:d}=pu(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:c},index:hu(o.parentRule)}),s.apply(o,a)})}),su(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=xc(t.fonts,"add",function(t){return function(r){return setTimeout(su(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(i),su(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e;let i=!0;const a=su(()=>{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;Lc(i,n,s,!0)||Lc(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})});return a(),Sc("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?xc(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(o){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,r,y.options));return su(()=>{ou.forEach(e=>e.reset()),null==n||n.disconnect(),s(),o(),i(),a(),l(),c(),u(),d(),h(),p(),f(),m(),g.forEach(e=>e())})}function gu(e){return void 0!==window[e]}function yu(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class wu{constructor(e){De(this,"iframeIdToRemoteIdMap",new WeakMap),De(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=n.get(t);return s||-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 bu{constructor(e){De(this,"iframes",new WeakMap),De(this,"crossOriginIframeMap",new WeakMap),De(this,"crossOriginIframeMirror",new wu(pt)),De(this,"crossOriginIframeStyleMirror"),De(this,"crossOriginIframeRootIdMap",new WeakMap),De(this,"mirror"),De(this,"mutationCb"),De(this,"wrappedEmit"),De(this,"loadListener"),De(this,"stylesheetManager"),De(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wu(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,n;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==(n=this.loadListener)||n.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 n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case Wc.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:Wc.IncrementalSnapshot,data:{source:$c.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Wc.Meta:case Wc.Load:case Wc.DomContentLoaded:return!1;case Wc.Plugin:return t;case Wc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Wc.IncrementalSnapshot:switch(t.data.source){case $c.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 $c.Drag:case $c.TouchMove:case $c.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case $c.ViewportResize:return!1;case $c.MediaInteraction:case $c.MouseInteraction:case $c.Scroll:case $c.CanvasMutation:case $c.Input:return this.replaceIds(t.data,e,["id"]),t;case $c.StyleSheetRule:case $c.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case $c.Font:return t;case $c.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case $c.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,n){for(const s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===Yc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Su{constructor(e){De(this,"shadowDoms",new WeakSet),De(this,"mutationCb"),De(this,"scrollCb"),De(this,"bypassOptions"),De(this,"mirror"),De(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(!He(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=au({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(cu({...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(bc.host(e))),this.restoreHandlers.push(fu({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(xc(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),o=bc.shadowRoot(this);return o&&jc(this)&&r.addShadowRoot(o,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Iu=0;Iu<64;Iu++)Cu[vu.charCodeAt(Iu)]=Iu;const ku=new Map;const xu=(e,t,r)=>{if(!e||!Au(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=ku.get(e);return r||(r=new Map,ku.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Eu(e,t,r){if(e instanceof Array)return e.map(e=>Eu(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),n=r.length,s="";for(t=0;t<n;t+=3)s+=vu[r[t]>>2],s+=vu[(3&r[t])<<4|r[t+1]>>4],s+=vu[(15&r[t+1])<<2|r[t+2]>>6],s+=vu[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Eu(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:[Eu(e.data,t,r),e.width,e.height]}}if(Au(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:xu(e,t,r)}}return e}const Ou=(e,t,r)=>e.map(e=>Eu(e,t,r)),Au=(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,n){const s=[];try{const o=xc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...o){if(!Lc(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["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,[s,...o])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function Ru(e,t,r,n,s,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=xc(e,l,function(e){return function(...i){const a=e.apply(this,i);if(xu(a,o,this),"tagName"in this.canvas&&!Lc(this.canvas,n,s,!0)){const e=Ou(i,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});i.push(a)}catch{const n=kc(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(n)}return i}const Lu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Tu="undefined"!=typeof window&&window.Blob&&new Blob([(Nu=Lu,Uint8Array.from(atob(Nu),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Nu;function Du(e){let t;try{if(t=Tu&&(window.URL||window.webkitURL).createObjectURL(Tu),!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,"+Lu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Pu{constructor(e){De(this,"pendingCanvasMutations",new Map),De(this,"rafStamps",{latestId:0,invokeId:null}),De(this,"mirror"),De(this,"mutationCb"),De(this,"resetObservers"),De(this,"frozen",!1),De(this,"locked",!1),De(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:n,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{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,n,s){const o=Mu(t,r,n,!0),i=new Map,a=new Du;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:o}=e.data;this.mutationCb({id:t,type:Zc["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Lc(t,r,n,!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 n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[n])})),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Mu(e,t,r,!1),s=function(e,t,r,n){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=xc(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return Lc(this.canvas,r,n,!0)||setTimeout(()=>{const r=Ou(o,t,this);e(this.canvas,{type:Zc["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch{const r=kc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Zc["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const s=[];return s.push(...Ru(t.WebGLRenderingContext.prototype,Zc.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Ru(t.WebGL2RenderingContext.prototype,Zc.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),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 n=r.map(e=>{const{type:t,...r}=e;return r}),{type:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class Fu{constructor(e){De(this,"trackedLinkElements",new WeakSet),De(this,"mutationCb"),De(this,"adoptedStyleSheetCb"),De(this,"styleMirror",new Bc),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:[]},n=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),n.push({styleId:e,rules:Array.from(s.rules||CSSRule,(e,t)=>({rule:Ke(e,s.href),index:t}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class _u{constructor(){De(this,"nodeMap",new WeakMap),De(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 Bu,zu,Uu,ju=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Te=e.contentWindow)?void 0:Te.Array.from)||Array.from,document.body.removeChild(e)}}catch(Dh){console.debug("Unable to override Array.from",Dh)}const Wu=new qe;function $u(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,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:A,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:L}=e;nu=L;const T=!I||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(Z){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),Wu.reset();const D=!0===d?{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!==h?h:{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 A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};Bu=(e,s)=>{var o;const i=e;if(i.timestamp=Ec(),!(null==(o=ou[0])?void 0:o.isFrozen())||i.type===Wc.FullSnapshot||i.type===Wc.IncrementalSnapshot&&i.data.source===$c.Mutation||ou.forEach(e=>e.unfreeze()),T)null==t||t(B(i),s);else if(N){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===Wc.FullSnapshot)F=i,_=0;else if(i.type===Wc.IncrementalSnapshot){if(i.data.source===$c.Mutation&&i.data.isAttachIframe)return;_++;const e=n&&_>=n,t=r&&i.timestamp-F.timestamp>r;(e||t)&&zu(!0)}};const z=e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Mutation,...e}})},U=e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Scroll,...e}}),j=e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.CanvasMutation,...e}}),W=new Fu({mutationCb:z,adoptedStyleSheetCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.AdoptedStyleSheet,...e}})}),$=new bu({mirror:Wu,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:Bu});for(const Y of A||[])Y.getMirror&&Y.getMirror({nodeMirror:Wu,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const V=new _u;Uu=new Pu({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Wu,sampling:w.canvas,dataURLOptions:b});const G=new Su({mutationCb:z,scrollCb:U,bypassOptions:{blockClass:s,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:Uu,keepIframeSrcFn:M,processedNodeManager:V},mirror:Wu});zu=(e=!1)=>{if(!v)return;Bu({type:Wc.Meta,data:{href:window.location.href,width:Mc(),height:Ac()}},e),W.reset(),G.init(),ou.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new qe,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:v=()=>!1}=t||{};return At(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,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:d,maskInputFn:h,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:Wu,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:b,recordCanvas:C,inlineImages:O,onSerialize:e=>{Pc(e,Wu)&&$.addIframe(e),Fc(e,Wu)&&W.trackLinkElement(e),_c(e)&&G.addShadowRoot(bc.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");Bu({type:Wc.FullSnapshot,data:{node:t,initialOffset:Oc(window)}},e),ou.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Wu.getId(document))};try{const e=[],t=e=>{var t;return su(mu)({mutationCb:z,mousemoveCb:(e,t)=>Bu({type:Wc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.ViewportResize,...e}}),inputCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Input,...e}}),mediaInteractionCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.MediaInteraction,...e}}),styleSheetRuleCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.StyleSheetRule,...e}}),styleDeclarationCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.StyleDeclaration,...e}}),canvasMutationCb:j,fontCb:e=>Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Font,...e}}),selectionCb:e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.Selection,...e}})},customElementCb:e=>{Bu({type:Wc.IncrementalSnapshot,data:{source:$c.CustomElement,...e}})},blockClass:s,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:Wu,iframeManager:$,stylesheetManager:W,shadowDomManager:G,processedNodeManager:V,canvasManager:Uu,ignoreCSSAttributes:R,plugins:(null==(t=null==A?void 0:A.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Bu({type:Wc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};$.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(n){console.warn(n)}});const r=()=>{zu(),e.push(t(document)),ju=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Sc("DOMContentLoaded",()=>{Bu({type:Wc.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(Sc("load",()=>{Bu({type:Wc.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),V.destroy(),ju=!1,nu=void 0}}catch(J){console.warn(J)}}var Vu,Gu;$u.addCustomEvent=(e,t)=>{if(!ju)throw new Error("please add custom event after start recording");Bu({type:Wc.Custom,data:{tag:e,payload:t}})},$u.freezePage=()=>{ou.forEach(e=>e.freeze())},$u.takeFullSnapshot=e=>{if(!ju)throw new Error("please take full snapshot after start recording");zu(e)},$u.mirror=Wu,(Gu=Vu||(Vu={}))[Gu.NotStarted=0]="NotStarted",Gu[Gu.Running=1]="Running",Gu[Gu.Stopped=2]="Stopped";const{addCustomEvent:Zu}=$u,{takeFullSnapshot:Ju}=$u,Yu={isRecording:!1,events:[],stopFn:null,startTime:null};let Hu=null;const Xu={maskAllInputs:!1,inlineStylesheet:!0,sampling:{mousemove:50,mouseInteraction:!0,scroll:150,input:"last"},checkoutEveryNth:200,checkoutEveryNms:3e4,recordCanvas:!1,collectFonts:!1,inlineImages:!0};function Ku(){if(!Yu.isRecording)return[];Yu.stopFn&&(Yu.stopFn(),Yu.stopFn=null),Yu.isRecording=!1;const e=[...Yu.events];return Yu.events=[],Yu.startTime=null,e}function qu(e,t){if(Yu.isRecording)try{Zu(e,t)}catch(r){console.warn("[LogSpace] Failed to add custom event:",r)}}const Qu="pending_sessions",ed="current_session";let td=null,rd=null;async function nd(){return rd||(td||(rd=new Promise((e,t)=>{const r=indexedDB.open("logspace-sdk-db",1);r.onerror=()=>{rd=null,t(new Error("Failed to open IndexedDB"))},r.onsuccess=()=>{td=r.result,e(td)},r.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(Qu)){t.createObjectStore(Qu,{keyPath:"id"}).createIndex("by-created","createdAt")}t.objectStoreNames.contains(ed)||t.createObjectStore(ed,{keyPath:"id"})}}),rd))}function sd(){return"undefined"!=typeof indexedDB}async function od(){if(sd())try{const e=await nd(),t=e.transaction(ed,"readwrite").objectStore(ed);await new Promise((e,r)=>{const n=t.delete("current");n.onsuccess=()=>e(),n.onerror=()=>r(n.error)})}catch(e){console.warn("[LogSpace] Failed to clear session backup:",e)}}async function id(e){if(sd())try{const t=await nd(),r=t.transaction(ed,"readwrite").objectStore(ed),n=await new Promise((e,t)=>{const n=r.get("current");n.onsuccess=()=>e(n.result||null),n.onerror=()=>t(n.error)});if(!n||n.sessionId!==e)return;await new Promise((e,t)=>{const n=r.delete("current");n.onsuccess=()=>e(),n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to clear session backup:",t)}}async function ad(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu),n={id:e.id,data:e,createdAt:Date.now(),retryCount:0};await new Promise((e,t)=>{const s=r.put(n);s.onsuccess=()=>e(),s.onerror=()=>t(s.error)})}catch(t){console.warn("[LogSpace] Failed to save pending session:",t)}}async function ld(){if(!sd())return[];try{const e=await nd(),t=e.transaction(Qu,"readonly").objectStore(Qu);return new Promise((e,r)=>{const n=t.getAll();n.onsuccess=()=>e(n.result||[]),n.onerror=()=>r(n.error)})}catch(e){return console.warn("[LogSpace] Failed to get pending sessions:",e),[]}}async function cd(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu);await new Promise((t,n)=>{const s=r.delete(e);s.onsuccess=()=>t(),s.onerror=()=>n(s.error)})}catch(t){console.warn("[LogSpace] Failed to remove pending session:",t)}}async function ud(e){if(sd())try{const t=await nd(),r=t.transaction(Qu,"readwrite").objectStore(Qu),n=r.get(e);await new Promise((e,t)=>{n.onsuccess=()=>{const s=n.result;if(s){s.retryCount++,s.lastRetryAt=Date.now();const n=r.put(s);n.onsuccess=()=>e(),n.onerror=()=>t(n.error)}else e()},n.onerror=()=>t(n.error)})}catch(t){console.warn("[LogSpace] Failed to update pending session retry:",t)}}const dd="1.1.0";let hd=null,pd=null,fd=[],md=[],gd=!1,yd="manual",wd=!1,bd={count:0,windowStart:0},Sd={lastLogHash:null,lastLogCount:0},vd=0,Cd=0,Id=!1,kd=0,xd={count:0,windowStart:0};let Ed=null,Od=null,Ad=null,Md=null,Rd=0,Ld=!1,Td=null,Nd=null,Dd=null,Pd=null,Fd=null,_d=null,Bd=null,zd=null,Ud=null,jd=null;const Wd=new Set,$d={low:{maskAllInputs:!1,checkoutEveryNth:500,recordCanvas:!1},medium:{maskAllInputs:!1,checkoutEveryNth:300,recordCanvas:!1},high:{maskAllInputs:!1,checkoutEveryNth:150,recordCanvas:!1}},Vd={rrweb:!0,console:!0,network:!0,errors:!0,interactions:!0,performance:!0,websocket:!0,sse:!0,storage:!0,resources:!0,spaNavigation:!0},Gd={maskAllInputs:!1,checkoutEveryNth:300,recordCanvas:!1},Zd={maskSensitiveData:!0,maskSelectors:[],excludeUrls:[],blockNetworkBodies:[],redactHeaders:["authorization","cookie","x-api-key"],logLevels:["log","info","warn","error","debug"]},Jd={maxLogs:1e4,maxSize:52428800,maxDuration:1800,idleTimeout:120,navigateAwayTimeout:120,rateLimit:100,deduplicate:!0,maxNetworkBodySize:10},Yd={continueOnRefresh:!0,onIdle:!0,onLimitReached:!0},Hd={enabled:!1,bufferBefore:30,recordAfter:30,triggers:{onError:!0,onConsoleError:!0,onNetworkStatus:[500,502,503,504]}};const Xd="__logspace_tab_id",Kd="__logspace_session_id";let qd=null;function Qd(){if(qd)return qd;if("undefined"!=typeof sessionStorage){const e=sessionStorage.getItem(Xd);if(e)return qd=e,e}const e=`tab_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,8)}`;qd=e;try{sessionStorage.setItem(Xd,e)}catch{}return e}function eh(e){const t=function(){if("undefined"==typeof document)return null;const e=document.referrer||void 0;let t,r,n;if("undefined"!=typeof window&&window.opener)try{const e=window.opener;t=e.sessionStorage?.getItem(Kd)??e.__logspace_session_id,r=e.sessionStorage?.getItem(Xd)??e.__logspace_tab_id,n=e.location?.href}catch{}return e||t||r||n?{referrer:e,openerSessionId:t,openerTabId:r,openerUrl:n}:null}();if(!t&&!e)return;if(!t)return e;const r=e?.logspaceOrigin;return r&&"object"==typeof r&&!Array.isArray(r)?{...e,logspaceOrigin:{...t,...r}}:{...e||{},logspaceOrigin:t}}function th(e){if(!hd?.limits.deduplicate)return!0;const t=function(e){return`${e.type}:${JSON.stringify(e.data)}`}(e);if(t===Sd.lastLogHash){if(Sd.lastLogCount++,fd.length>0){const e=fd[fd.length-1];e&&(e.data.duplicateCount=Sd.lastLogCount)}return!1}return Sd.lastLogHash=t,Sd.lastLogCount=1,!0}function rh(){hd?.autoEnd.onIdle&&(Ed&&clearTimeout(Ed),Ed=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Session auto-ended due to idle timeout"),yd="idle",wd=!0,hd?.hooks.onLimitReached?.("idle"),Nh.stopSession())},1e3*hd.limits.idleTimeout))}function nh(){hd&&gd&&(!wd||pd&&"stopped"!==pd.status||(hd.debug&&console.log("[LogSpace] User activity detected - starting new session"),wd=!1,Nh.startSession()))}const sh=["mousedown","keydown","scroll","touchstart"];function oh(){const e=Date.now();e-Rd<1e3||(Rd=e,rh(),nh())}function ih(e,t){if(!hd?.sampling.enabled)return;if(ph||fh)return void(hd.debug&&console.log(`[LogSpace] Ignoring sampling trigger during unload: ${e}`));const r=!Ld;Ld=!0,Td=e,r&&(Nd=Date.now()),Dd=Date.now(),lh(),hd.debug&&(r?console.log(`[LogSpace] Sampling triggered by: ${e}`):console.log(`[LogSpace] Sampling window extended by: ${e}`)),r&&hd.hooks.onSamplingTrigger?.(e,t),Pd&&(clearTimeout(Pd),Pd=null),Pd=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),yd="samplingTriggered",xh({restartImmediately:!0}))},1e3*hd.sampling.recordAfter)}function ah(){!Fd&&hd?.sampling.enabled&&(Fd=setInterval(()=>{!function(){if(!hd?.sampling.enabled||Ld||!pd)return;const e=Date.now()-1e3*hd.sampling.bufferBefore,t=fd.length,r=md.length;fd=fd.filter(t=>t.timestamp>=e);const n=md.filter(t=>t.timestamp>=e);if(n.some(e=>2===e.type))md=n;else{let t=-1;const r=[];for(let n=0;n<md.length;n++){const s=md[n];s&&2===s.type&&s.timestamp<e&&(-1===t&&(t=n),r.push(n))}if(t>=0){const e=r.map(e=>md[e]).filter(e=>void 0!==e);md=[...e,...n]}else md=n}vd=fd.reduce((e,t)=>e+JSON.stringify(t).length,0),Cd=md.reduce((e,t)=>e+JSON.stringify(t).length,0),dh();const s=t-fd.length,o=r-md.length;hd.debug&&(s>0||o>0)&&console.log(`[LogSpace] Rolling buffer trimmed: ${s} logs, ${o} rrweb events (keeping last ${hd.sampling.bufferBefore}s: ${fd.length} logs, ${md.length} rrweb events)`)}()},5e3),hd.debug&&console.log(`[LogSpace] Sampling rolling buffer started (trimming every 5s, keeping ${hd.sampling.bufferBefore}s)`))}function lh(){Fd&&(clearInterval(Fd),Fd=null)}const ch=e=>{if(!hd||!pd||"recording"!==pd.status)return;if(!function(){if(!hd)return!1;const e=Date.now();return e-bd.windowStart>1e3?(hd.debug&&kd>0&&console.warn(`[LogSpace] Rate limit: dropped ${kd} logs in last second`),bd.windowStart=e,bd.count=1,Id=!1,kd=0,!0):(bd.count++,!(bd.count>hd.limits.rateLimit&&(kd++,Id||(Id=!0,console.warn(`[LogSpace] Rate limit exceeded (${hd.limits.rateLimit}/sec). Logs are being dropped. Consider increasing limits.rateLimit or disabling noisy captures.`)),1)))}())return;if(!th(e))return;const t=hd?fd.length>=hd.limits.maxLogs?"maxLogs":vd+Cd>=hd.limits.maxSize?"maxSize":null:null;if(t)return void(hd.autoEnd.onLimitReached&&(hd.debug&&console.log(`[LogSpace] Session auto-ended: ${t}`),yd=t,hd.hooks.onLimitReached?.(t),xh({restartImmediately:!0})));const r=Qd(),n=h({id:`${fd.length+1}`,timestamp:Date.now(),tabId:r,tabUrl:"undefined"!=typeof window?window.location.href:"",type:e.type,data:e.data,severity:e.severity},hd.privacy);fd.push(n),vd+=JSON.stringify(n).length,uh(n),rh(),function(e){if(hd?.sampling.enabled)if(hd.sampling.triggers.onError&&"error"===e.type)ih("error",e);else{if(hd.sampling.triggers.onConsoleError&&"console"===e.type){const t=e.data;if("error"===t.level||"assert"===t.level)return void ih("consoleError",e)}if(hd.sampling.triggers.onNetworkStatus&&"network"===e.type){const t=e.data;if(t.status&&hd.sampling.triggers.onNetworkStatus.includes(t.status))ih("networkError",e)}}}(n),hd.hooks.onAction?.(n,pd),hd.debug&&console.log("[LogSpace] Captured:",n.type,n.data)};function uh(e){if(pd)switch(pd.stats.logCount++,e.type){case"network":pd.stats.networkLogCount++;break;case"console":pd.stats.consoleLogCount++,"error"===e.data?.level&&pd.stats.errorCount++;break;case"error":pd.stats.errorCount++;break;case"interaction":pd.stats.interactionLogCount++;break;case"performance":pd.stats.performanceLogCount++;break;case"storage":pd.stats.storageLogCount++;break;case"annotation":pd.stats.annotationCount++}}function dh(){if(!pd)return;const e=pd.stats.tabCount||1;pd.stats={logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:e};for(const t of fd)uh(t)}function hh(){g.uninstall(),k.uninstall(),O.uninstall(),D.uninstall(),U.uninstall(),J.uninstall(),Q.uninstall(),pe.uninstall(),ve.uninstall(),Le.uninstall()}let ph=!1,fh=!1;async function mh(){if(pd&&"recording"===pd.status&&sd())try{await async function(e,t,r,n){if(sd())try{const s=(await nd()).transaction(ed,"readwrite").objectStore(ed),o={id:"current",sessionId:e,logs:t,rrwebEvents:r,startTime:n.startTime,url:n.url,title:n.title,userId:n.userId,userTraits:n.userTraits,metadata:n.metadata,lastCheckpoint:Date.now()};await new Promise((e,t)=>{const r=s.put(o);r.onsuccess=()=>e(),r.onerror=()=>t(r.error)})}catch(s){console.warn("[LogSpace] Failed to save session checkpoint:",s)}}(pd.id,fd,md,{startTime:pd.startTime,url:pd.url,title:pd.title,userId:pd.userId,userTraits:pd.userTraits,metadata:pd.metadata}),hd?.debug&&console.log("[LogSpace] Session checkpoint saved",{logs:fd.length,rrwebEvents:md.length})}catch(e){hd?.debug&&console.warn("[LogSpace] Failed to save checkpoint:",e)}}function gh(){Ad&&(clearInterval(Ad),Ad=null)}const yh="__logspace_emergency_backup",wh="__logspace_sampling_state";function bh(){try{localStorage.removeItem(wh)}catch(e){}}function Sh(){try{localStorage.removeItem(yh)}catch(e){}}function vh(){if(ph)return;if(!hd||!pd||"recording"!==pd.status)return;if(fh=!0,ph=!0,yd="unload",hd.autoEnd.continueOnRefresh){try{sessionStorage.setItem("logspace_continuing_session_id",pd.id),sessionStorage.setItem("logspace_continuing_session_start",String(pd.startTime)),sessionStorage.setItem("logspace_continuing_session_saved_at",String(Date.now())),hd.debug&&console.log("[LogSpace] Session ID and startTime saved for continuation:",pd.id,pd.startTime)}catch{}Ld&&function(e){if(Ld)try{const t={triggered:Ld,triggerType:Td,firstTriggerTime:Nd,triggerTime:Dd,sessionId:e};localStorage.setItem(wh,JSON.stringify(t))}catch(t){}}(pd.id)}const e=kh();e&&(!function(e){try{if(0===e.logs.length&&(!e.rrwebEvents||e.rrwebEvents.length<3))return;const t=JSON.stringify(e);localStorage.setItem(yh,t)}catch(t){}}(e),sd()&&ad(e).catch(()=>{}),hd.debug&&console.log("[LogSpace] Session paused and saved for continuation"))}function Ch(){if("hidden"===document.visibilityState){if(!hd||!pd||"recording"!==pd.status)return;const e=1e3*hd.limits.navigateAwayTimeout;hd.debug&&console.log(`[LogSpace] Tab hidden, grace period started (${hd.limits.navigateAwayTimeout}s)`),hd.capture.rrweb&&qu("tab-hidden",{tabId:Qd(),timestamp:Date.now()}),Md&&clearTimeout(Md),Md=setTimeout(()=>{"recording"===pd?.status&&"hidden"===document.visibilityState&&(hd?.debug&&console.log("[LogSpace] Grace period expired, saving session for continuation"),yd="navigateAway",vh())},e)}else{if(Md&&(hd?.debug&&console.log("[LogSpace] Tab visible, grace period cancelled"),clearTimeout(Md),Md=null),fh||ph){const e=fh,t=ph;fh=!1,ph=!1,hd?.debug&&console.log("[LogSpace] Navigation flags reset - page is visible",{wasNavigating:e,wasUnloadHandled:t})}if(hd?.capture.rrweb&&"recording"===pd?.status){const e=Qd();hd.debug&&console.log("[LogSpace] Tab visible, forcing full rrweb snapshot for:",e),qu("tab-visible",{tabId:e,timestamp:Date.now()}),function(){if(Yu.isRecording)try{Ju(!0)}catch(e){console.warn("[LogSpace] Failed to take full snapshot:",e)}}()}rh()}}function Ih(e){vh()}function kh(){if(!pd)return null;if(hd?.sampling.enabled&&!Ld){hd.debug&&console.log("[LogSpace] Sampling enabled but not triggered - session discarded");let e="noTrigger";return"idle"===yd?e="idle":"maxDuration"===yd?e="maxDuration":"manual"===yd&&(e="manual"),hd.hooks.onSessionDiscarded?.(pd,e),null}hd?.sampling.enabled&&Ld&&function(){if(!(hd?.sampling.enabled&&Nd&&Dd&&pd))return;const e=Nd-1e3*hd.sampling.bufferBefore,t=Dd+1e3*hd.sampling.recordAfter;fd=fd.filter(r=>r.timestamp>=e&&r.timestamp<=t);const r=md.filter(r=>r.timestamp>=e&&r.timestamp<=t),n=r.some(e=>2===e.type);if(hd.debug&&(console.log(`[LogSpace] trimLogsToSamplingWindow - before: ${md.length} events, recentEvents: ${r.length}, hasFullSnapshot in recent: ${n}`),console.log(`[LogSpace] trimLogsToSamplingWindow - rrweb types before: ${md.map(e=>e.type).join(",")}`)),n)md=r;else{const t=[];for(let r=0;r<md.length;r++){const n=md[r];n&&2===n.type&&n.timestamp<e&&t.push(n)}hd.debug&&console.log(`[LogSpace] trimLogsToSamplingWindow - found ${t.length} snapshots before window`),md=t.length>0?[...t,...r]:r}hd.debug&&console.log(`[LogSpace] trimLogsToSamplingWindow - after: ${md.length} events, types: ${md.map(e=>e.type).join(",")}`),dh(),hd.debug&&console.log(`[LogSpace] Trimmed to sampling window: ${fd.length} logs, ${md.length} rrweb events`)}();const e=Date.now(),t={id:pd.id,startTime:pd.startTime,endTime:e,duration:e-pd.startTime,url:pd.url,title:pd.title,userId:pd.userId,userTraits:pd.userTraits,metadata:pd.metadata,logs:hd?.hooks.beforeSend?hd.hooks.beforeSend(fd)||[]:fd,stats:pd.stats,endReason:yd,recordingType:"rrweb",userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,sdkVersion:dd};return hd?.sampling.enabled&&Ld&&Td&&(t.samplingTrigger=Td),hd?.capture.rrweb&&md.length>0&&(t.rrwebEvents=md),t}async function xh(e){if(!pd||"stopped"===pd.status)return;const t=!0===e?.restartImmediately,r=pd.id;if(pd.status="stopped",pd.endTime=Date.now(),_d=null,Ed&&(clearTimeout(Ed),Ed=null),Od&&(clearTimeout(Od),Od=null),Md&&(clearTimeout(Md),Md=null),gh(),lh(),hd?.capture.rrweb){const e=Ku();hd.debug&&console.log("[LogSpace] rrweb recording stopped, events:",e.length)}hh(),hd?.hooks.onSessionEnd?.(pd,fd),hd?.debug&&console.log("[LogSpace] Session stopped:",pd.id,{duration:pd.endTime-pd.startTime,logs:fd.length,rrwebEvents:md.length,reason:yd});const n=kh();if(t&&Nh.startSession(),!n)return await id(r),Sh(),void bh();try{await async function(e){if(hd?.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(!hd?.serverUrl)return void(hd?.debug&&console.log("[LogSpace] No serverUrl configured - session stored locally only",{id:e.id,logs:e.logs.length,rrwebEvents:e.rrwebEvents?.length||0}));try{const t=JSON.stringify(e),r=await Eh(t),n="application/gzip"===r.type,s=new FormData;s.append("title",e.title||`SDK Session ${e.id}`),s.append("log_file",r,n?`${e.id}.json.gz`:`${e.id}.json`),e.url&&s.append("description",`Session recorded on ${e.url}`);const o={};for(const u of e.logs){const e=u.type||"unknown";o[e]=(o[e]||0)+1}let i=e.duration;if(e.rrwebEvents&&e.rrwebEvents.length>0){const t=e.rrwebEvents.map(e=>e.timestamp),r=Math.min(...t);i=Math.max(...t)-r}const a={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:i,userAgent:e.userAgent,timestamp:e.startTime,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};s.append("log_metadata",JSON.stringify(a));const l={...hd.headers};hd.apiKey&&(l.Authorization=`Bearer ${hd.apiKey}`);const c=await fetch(`${hd.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:l,body:s});if(!c.ok){const e=await c.text();throw new Error(`HTTP ${c.status}: ${e}`)}if(hd.debug){const t=await c.json();console.log("[LogSpace] Session sent successfully:",{sessionId:e.id,logId:t.id,compressed:n,size:`${Math.round(r.size/1024)}KB`})}}catch(t){throw hd.debug&&console.error("[LogSpace] Failed to send session:",t),hd.hooks.onError?.(t),t}}(n),await id(r),Sh(),bh()}catch(s){throw await ad(n),s}}async function Eh(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 n=[],s=e.readable.getReader();for(;;){const{done:e,value:t}=await s.read();if(e)break;n.push(t)}const o=n.reduce((e,t)=>e+t.length,0),i=new Uint8Array(o);let a=0;for(const t of n)i.set(t,a),a+=t.length;return new Blob([i],{type:"application/gzip"})}return new Blob([t],{type:"application/json"})}async function Oh(e){if(!hd?.serverUrl)throw new Error("No serverUrl configured");const t=JSON.stringify(e),r=await Eh(t),n="application/gzip"===r.type,s=new FormData;s.append("title",e.title||`SDK Session ${e.id}`),s.append("log_file",r,n?`${e.id}.json.gz`:`${e.id}.json`),e.url&&s.append("description",`Recovered session from ${e.url}`);const o={};for(const u of e.logs){const e=u.type||"unknown";o[e]=(o[e]||0)+1}let i=e.duration;if(e.rrwebEvents&&e.rrwebEvents.length>0){const t=e.rrwebEvents.map(e=>e.timestamp),r=Math.min(...t);i=Math.max(...t)-r}const a={totalLogs:e.logs.length,logsByType:o,videoSize:0,videoType:"rrweb",videoDuration:i,userAgent:e.userAgent,timestamp:e.startTime,recovered:!0,url:e.url,userId:e.userId,userTraits:e.userTraits,duration:e.duration,stats:e.stats};s.append("log_metadata",JSON.stringify(a));const l={...hd.headers};hd.apiKey&&(l.Authorization=`Bearer ${hd.apiKey}`);const c=await fetch(`${hd.serverUrl}/api/v1/protected/sdk/logs`,{method:"POST",headers:l,body:s});if(!c.ok){const e=await c.text();throw new Error(`HTTP ${c.status}: ${e}`)}}function Ah(e){try{return JSON.stringify(e)}catch{return String(e)}}function Mh(e){return e.id?`id:${e.id}|ts:${e.timestamp}|type:${e.type}`:`ts:${e.timestamp}|type:${e.type}|data:${Ah(e.data)}`}function Rh(e){const t=e.id??e.data?.id;if(null!=t)return`id:${String(t)}|ts:${e.timestamp}|type:${e.type}`;const r=e.data;return`ts:${e.timestamp}|type:${e.type}|data:${Ah(r)}`}function Lh(e,t){if(pd&&"recording"===pd.status){if(e.length>0){const t=new Set(fd.map(e=>Mh(e))),r=[];for(const n of e){const e=Mh(n);t.has(e)||(t.add(e),r.push(n))}if(r.length>0){fd=[...r,...fd];for(const e of r)vd+=JSON.stringify(e).length,uh(e);hd?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered logs (${e.length-r.length} duplicates skipped)`)}else hd?.debug&&console.log(`[LogSpace] All ${e.length} recovered logs already exist, skipping`)}if(t.length>0){const e=new Set(md.map(e=>Rh(e))),r=[];for(const n of t){const t=Rh(n);e.has(t)||(e.add(t),r.push(n))}if(r.length>0){md=[...r,...md];for(const e of r)Cd+=JSON.stringify(e).length;hd?.sampling.enabled&&Fd&&(lh(),hd?.debug&&console.log("[LogSpace] Stopped sampling trim timer to preserve recovered rrweb events")),hd?.debug&&console.log(`[LogSpace] Merged ${r.length} recovered rrweb events (${t.length-r.length} duplicates skipped)`)}else hd?.debug&&console.log(`[LogSpace] All ${t.length} recovered rrweb events already exist, skipping`)}}else hd?.debug&&console.warn("[LogSpace] Cannot merge recovered data - no active session")}async function Th(){if(hd?.serverUrl)try{const t=function(){try{const e=localStorage.getItem(yh);if(e)return JSON.parse(e)}catch(e){}return null}();if(t)if(Wd.has(t.id))hd.debug&&console.log("[LogSpace] Skipping already processed emergency backup:",t.id),Sh();else if(jd&&t.id===jd)hd.debug&&console.log("[LogSpace] Merging emergency backup into continuing session:",t.id),Lh(t.logs,t.rrwebEvents||[]),Wd.add(t.id),Sh(),await od();else{hd.debug&&console.log("[LogSpace] Recovering emergency backup session:",t.id);try{await Oh(t),Sh(),await od(),sd()&&await cd(t.id),hd.debug&&console.log("[LogSpace] Emergency backup session sent:",t.id)}catch(e){sd()&&(await ad(t),Sh()),hd.debug&&console.warn("[LogSpace] Error sending emergency backup, saved to IndexedDB:",e)}}if(!sd())return;await async function(){if(!sd())return;const t=Date.now();try{const e=await ld();for(const r of e){const e=t-r.createdAt>6048e5,n=r.retryCount>=5;(e||n)&&await cd(r.id)}}catch(e){console.warn("[LogSpace] Failed to cleanup old sessions:",e)}}();const r=await ld();if(0===r.length){const t=await async function(){if(!sd())return null;try{const e=(await nd()).transaction(ed,"readonly").objectStore(ed);return new Promise((t,r)=>{const n=e.get("current");n.onsuccess=()=>t(n.result||null),n.onerror=()=>r(n.error)})}catch(e){return console.warn("[LogSpace] Failed to get session backup:",e),null}}();if(t&&t.logs.length>0)if(jd&&t.sessionId===jd)hd.debug&&console.log("[LogSpace] Merging checkpoint backup into continuing session:",t.sessionId),Lh(t.logs,t.rrwebEvents||[]),Wd.add(t.sessionId),await od();else if(Wd.has(t.sessionId))hd.debug&&console.log("[LogSpace] Skipping already processed backup:",t.sessionId),await od();else{hd.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:dd};r.push({id:t.sessionId,data:e,createdAt:t.lastCheckpoint,retryCount:0}),await ad(e),await od()}}if(0===r.length)return;hd.debug&&console.log(`[LogSpace] Recovering ${r.length} pending session(s)`);for(const n of r)if(Wd.has(n.id))hd.debug&&console.log("[LogSpace] Skipping already processed pending session:",n.id),await cd(n.id);else if(jd&&n.id===jd)hd.debug&&console.log("[LogSpace] Merging pending session into continuing session:",n.id),Lh(n.data.logs,n.data.rrwebEvents||[]),Wd.add(n.id),await cd(n.id);else try{await Oh(n.data),Wd.add(n.id),await cd(n.id),hd.debug&&console.log("[LogSpace] Recovered session sent:",n.id)}catch(e){await ud(n.id),hd.debug&&console.warn("[LogSpace] Error sending recovered session:",n.id,e)}}catch(e){hd.debug&&console.warn("[LogSpace] Session recovery failed:",e)}finally{jd=null}}const Nh={init(e){if(gd)throw new Error("[LogSpace] SDK already initialized. Call destroy() first if you need to reinitialize.");if("undefined"!=typeof window){if(hd=function(e){const t=e.recordingQuality||"medium",r={...Gd,...$d[t],...e.rrweb};return{serverUrl:e.serverUrl,apiKey:e.apiKey,capture:{...Vd,...e.capture},rrweb:r,privacy:{...Zd,...e.privacy},limits:{...Jd,...e.limits},autoEnd:{...Yd,...e.autoEnd},sampling:{...Hd,...e.sampling,triggers:{...Hd.triggers,...e.sampling?.triggers}},hooks:e.hooks||{},headers:e.headers||{},debug:e.debug||!1,dryRun:e.dryRun||!1}}(e),gd=!0,hd.debug&&console.log("[LogSpace] SDK initialized",{version:dd,serverUrl:hd.serverUrl,limits:hd.limits,persistence:sd()?"enabled":"disabled"}),hd.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 n=r?Number(r):0,s=Date.now()-n,o=1e3*hd.limits.navigateAwayTimeout;n>0&&s>o?hd.debug&&console.log("[LogSpace] Session continuation expired:",e,`(${Math.round(s/1e3)}s > ${hd.limits.navigateAwayTimeout}s timeout)`):(_d=e,jd=e,t&&(Bd=Number(t)),hd.debug&&console.log("[LogSpace] Continuing session from previous page:",e,"startTime:",t))}}catch{}window.addEventListener("beforeunload",vh),window.addEventListener("pagehide",Ih),document.addEventListener("visibilitychange",Ch),hd.autoEnd.onIdle&&function(){if("undefined"!=typeof window){for(const e of sh)window.addEventListener(e,nh,{passive:!0,capture:!0});window.addEventListener("mousemove",oh,{passive:!0,capture:!0})}}(),ph=!1,fh=!1,this.startSession(),Th().catch(()=>{})}else console.warn("[LogSpace] SDK requires browser environment")},startSession(e){if(!gd||!hd)return void console.warn("[LogSpace] SDK not initialized");if("recording"===pd?.status)return void console.warn("[LogSpace] Session already recording");let t,r;wd=!1,Ld=!1,Td=null,Nd=null,Dd=null,Pd&&(clearTimeout(Pd),Pd=null),lh(),fd=[],md=[],vd=0,Cd=0,bd={count:0,windowStart:0},xd={count:0,windowStart:0},Id=!1,kd=0,Sd={lastLogHash:null,lastLogCount:0},yd="manual";let n=!1;if(_d){t=_d,r=Bd||Date.now(),hd.debug&&console.log("[LogSpace] Using continuing session ID:",t,"with original startTime:",r);const e=function(){try{const e=localStorage.getItem(wh);if(e)return JSON.parse(e)}catch(e){}return null}();e&&e.sessionId===t&&e.triggered&&(Ld=e.triggered,Td=e.triggerType,Nd=e.firstTriggerTime,Dd=e.triggerTime,n=!0,hd.debug&&console.log("[LogSpace] Restored sampling state from before refresh:",e.triggerType)),bh(),_d=null,Bd=null}else t=`sdk_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`,r=Date.now();const s=zd||Ud,o=Qd(),i=eh(e);if(pd={id:t,tabId:o,startTime:r,status:"recording",url:window.location.href,title:document.title,metadata:i,userId:s?.userId,userTraits:s?.traits,stats:{logCount:0,networkLogCount:0,consoleLogCount:0,errorCount:0,storageLogCount:0,interactionLogCount:0,performanceLogCount:0,annotationCount:0,tabCount:1}},function(e,t){try{sessionStorage.setItem(Kd,e),sessionStorage.setItem(Xd,t)}catch{}try{window.__logspace_session_id=e,window.__logspace_tab_id=t}catch{}}(t,o),hd.capture.rrweb){const e=function(e={},t,r){if(Yu.isRecording)return console.warn("[LogSpace] rrweb recording already in progress"),!1;const n={...Xu,...e};Hu=r||null;try{Yu.events=[],Yu.startTime=Date.now(),Yu.isRecording=!0,Yu.stopFn=$u({emit:(e,r)=>{const n={...e,tabId:Hu||void 0};Yu.events.push(n),t?.(n)},maskAllInputs:n.maskAllInputs,maskTextSelector:n.maskTextSelector,blockSelector:n.blockSelector,ignoreSelector:n.ignoreSelector,inlineStylesheet:n.inlineStylesheet,sampling:n.sampling,checkoutEveryNth:n.checkoutEveryNth,checkoutEveryNms:n.checkoutEveryNms,recordCanvas:n.recordCanvas,collectFonts:n.collectFonts,inlineImages:n.inlineImages,plugins:n.plugins})??null;try{Ju(!0)}catch(s){console.warn("[LogSpace] Failed to take initial full snapshot:",s)}return!0}catch(o){return console.error("[LogSpace] Failed to start rrweb recording:",o),Yu.isRecording=!1,!1}}({maskAllInputs:hd.rrweb.maskAllInputs,maskTextSelector:hd.rrweb.maskTextSelector,blockSelector:hd.rrweb.blockSelector,ignoreSelector:hd.rrweb.ignoreSelector,recordCanvas:hd.rrweb.recordCanvas,checkoutEveryNth:hd.rrweb.checkoutEveryNth},e=>{if(!pd||"recording"!==pd.status)return;const t=Date.now();if(t-xd.windowStart>1e3)xd.windowStart=t,xd.count=1;else if(xd.count++,xd.count>500)return;const r=2===e.type?5e4:500;Cd+=r;hd&&vd+Cd>=hd.limits.maxSize?hd.autoEnd.onLimitReached&&(hd.debug&&console.log("[LogSpace] Session auto-ended: maxSize (rrweb)"),yd="maxSize",hd.hooks.onLimitReached?.("maxSize"),xh({restartImmediately:!0})):(md.push(e),rh())},o);hd.debug&&console.log("[LogSpace] rrweb recording started:",e,o?`(tabId: ${o})`:"")}if(hd.limits.maxDuration>0&&(Od=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Session auto-ended: maxDuration"),yd="maxDuration",hd?.hooks.onLimitReached?.("maxDuration"),xh({restartImmediately:!0}))},1e3*hd.limits.maxDuration)),rh(),function(){if(!hd)return;const e={...hd.privacy};if(hd.serverUrl){const t=[`${hd.serverUrl}/api/v1/sessions`,`${hd.serverUrl}/api/v1/protected/sdk/logs`];e.excludeUrls=[...e.excludeUrls||[],...t]}hd.capture.console&&g.install(ch,hd.privacy),hd.capture.network&&k.install(ch,e,rh,hd.limits),hd.capture.errors&&O.install(ch,hd.privacy),hd.capture.websocket&&D.install(ch,hd.privacy,rh,hd.limits),hd.capture.sse&&U.install(ch,hd.privacy,rh,hd.limits),hd.capture.storage&&J.install(ch,hd.privacy),hd.capture.interactions&&Q.install(ch,hd.privacy),hd.capture.performance&&pe.install(ch,hd.privacy),hd.capture.resources&&ve.install(ch,e),hd.capture.spaNavigation&&Le.install(ch,hd.privacy)}(),!Ad&&sd()&&(Ad=setInterval(()=>{mh()},15e3)),hd.sampling.enabled&&!n)ah();else if(hd.sampling.enabled&&n&&Dd){const e=Date.now()-Dd,t=Math.max(0,1e3*hd.sampling.recordAfter-e);hd.debug&&console.log(`[LogSpace] Sampling was triggered before refresh, ${t}ms remaining in recordAfter`),t>0?Pd=setTimeout(()=>{"recording"===pd?.status&&(hd?.debug&&console.log("[LogSpace] Sampling recordAfter period complete, ending session"),yd="samplingTriggered",xh({restartImmediately:!0}))},t):(hd.debug&&console.log("[LogSpace] Sampling recordAfter period already elapsed, ending session"),yd="samplingTriggered",xh({restartImmediately:!0}))}pd&&s&&zd&&hd.debug&&console.log("[LogSpace] Applied pending user identity:",s.userId),zd&&(zd=null),pd&&(hd.hooks.onSessionStart?.(pd),hd.debug&&console.log("[LogSpace] Session started:",pd.id))},async stopSession(){await xh()},identify(e,t){if(Ud={userId:e,traits:t},!pd)return zd={userId:e,traits:t},void(hd?.debug&&console.log("[LogSpace] User identity queued (session not started yet):",e));pd.userId=e,pd.userTraits=t,hd?.debug&&console.log("[LogSpace] User identified:",e)},track(e,t){ch({type:"annotation",data:{annotationType:"event",eventName:e,properties:t}})},breadcrumb(e,t){ch({type:"annotation",data:{annotationType:"breadcrumb",message:e,category:t}})},pauseRecording(){"recording"===pd?.status&&(pd.status="paused",hd?.debug&&console.log("[LogSpace] Recording paused"))},resumeRecording(){"paused"===pd?.status&&(pd.status="recording",rh(),hd?.debug&&console.log("[LogSpace] Recording resumed"))},trigger(e){hd?.sampling.enabled?(hd.debug&&console.log("[LogSpace] Manual sampling trigger:",e||"user_triggered"),ih("manual")):hd?.debug&&console.log("[LogSpace] trigger() called but sampling is not enabled")},getSession:()=>pd,getSessionLogs:()=>[...fd],getSessionData:()=>kh(),getRRWebEvents:()=>[...md],getConfig:()=>hd?{...hd,rateLimit:hd.limits.rateLimit,maxLogs:hd.limits.maxLogs,maxSize:hd.limits.maxSize,idleTimeout:hd.limits.idleTimeout}:null,setConfig(e){hd?(void 0!==e.rateLimit&&(hd.limits.rateLimit=e.rateLimit),void 0!==e.maxLogs&&(hd.limits.maxLogs=e.maxLogs),void 0!==e.maxSize&&(hd.limits.maxSize=e.maxSize),void 0!==e.idleTimeout&&(hd.limits.idleTimeout=e.idleTimeout,rh()),void 0!==e.debug&&(hd.debug=e.debug),hd.debug&&console.log("[LogSpace] Config updated:",e)):console.warn("[LogSpace] SDK not initialized, cannot update config")},destroy(){if(!gd)return;Ed&&(clearTimeout(Ed),Ed=null),Od&&(clearTimeout(Od),Od=null),Pd&&(clearTimeout(Pd),Pd=null),Md&&(clearTimeout(Md),Md=null),gh(),lh(),hd?.capture.rrweb&&Ku(),"undefined"!=typeof window&&(window.removeEventListener("beforeunload",vh),window.removeEventListener("pagehide",Ih),document.removeEventListener("visibilitychange",Ch)),function(){if("undefined"!=typeof window){for(const e of sh)window.removeEventListener(e,nh,{capture:!0});window.removeEventListener("mousemove",oh,{capture:!0})}}(),hh(),td&&(td.close(),td=null,rd=null);const e=hd?.debug;hd=null,pd=null,fd=[],md=[],vd=0,Cd=0,wd=!1,Ld=!1,Td=null,Nd=null,Dd=null,jd=null,ph=!1,fh=!1,Rd=0,qd=null,gd=!1,e&&console.log("[LogSpace] SDK destroyed")},version:dd};e.LogSpace=Nh,e.default=Nh,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
2
2
  //# sourceMappingURL=logspace.umd.js.map